(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pagesSub-pages-mine-qrcode"],{"02b4":function(t,e,i){"use strict";i.r(e);var n=i("1b05"),r=i("319e");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);i("f2ab");var s=i("828b"),a=Object(s["a"])(r["default"],n["b"],n["c"],!1,null,"4320523e",null,!1,n["a"],void 0);e["default"]=a.exports},1274:function(t,e,i){"use strict";i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var n={lPainter:i("02b4").default,lPainterView:i("8e9b").default,lPainterImage:i("d159").default,uvLoadingIcon:i("2526").default},r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"app",style:"width: "+t.boxWidth+"px;min-height: "+t.boxHeight+"px"},[i("v-uni-view",{class:["header-box",t.fixedTop?"header-fixed":""]},[i("navbar",{attrs:{title:"推广二维码",color:"#fff",leftColor:"#fff",showLeft:!0,place:!0}})],1),t.userInfo.id?i("v-uni-view",{class:["main"],style:"min-height: "+t.boxHeight+"px"},[i("v-uni-view",{staticClass:"qrcode-box"},[i("v-uni-image",{staticStyle:{width:"100%"},attrs:{src:t.qrcode,mode:"widthFix"}}),i("l-painter",{ref:"painter",attrs:{hidden:!0,css:{height:t.poster.height},useCORS:!0,isCanvasToTempFilePath:!0},on:{success:function(e){arguments[0]=e=t.$handleEvent(e),t.success.apply(void 0,arguments)}}},[i("l-painter-view",{attrs:{css:{width:"100%",height:t.poster.height,position:"absolute",zIndex:"-1"}}},[i("l-painter-image",{attrs:{src:t.bgImg,css:{width:"100%",height:t.poster.height}}})],1),i("l-painter-view",{attrs:{css:{height:"100%"}}},[i("l-painter-view",{attrs:{css:{width:"240px",height:"240px",position:"absolute","margin-top":t.halfHeight+"px",left:"50%","margin-left":"-120px"}}},[i("l-painter-image",{attrs:{src:t.userInfo.qrcode,css:{width:"240px",height:"240px","border-radius":"5px"}}})],1)],1)],1)],1),i("v-uni-view",{staticClass:"action-box"},[i("v-uni-view",{staticClass:"btn",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.saveQrcode()}}},[t._v("保存相册")])],1)],1):t._e(),i("showModal",{ref:"uvModal"}),i("uv-loading-icon",{staticClass:"loading",attrs:{show:t.loading,textSize:"1rem",color:"var(--color)",customStyle:{position:"absolute",top:"50%",left:0,right:0}}})],1)},o=[]},1542:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement,e=this._self._c||t;return e("div")},r=[]},1851:function(t,e,i){"use strict";var n=i("8bdb"),r=i("84d6"),o=i("1cb5");n({target:"Array",proto:!0},{fill:r}),o("fill")},"1b05":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{ref:"limepainter",staticClass:"lime-painter"},[t.canvasId&&t.size?i("v-uni-view",{style:t.styles},[t.use2dCanvas?i("v-uni-canvas",{staticClass:"lime-painter__canvas",style:t.size,attrs:{id:t.canvasId,type:"2d"}}):i("v-uni-canvas",{staticClass:"lime-painter__canvas",style:t.size,attrs:{id:t.canvasId,"canvas-id":t.canvasId,width:t.boardWidth*t.dpr,height:t.boardHeight*t.dpr,hidpi:t.hidpi}})],1):t._e(),t._t("default")],2)},r=[]},2077:function(t,e,i){"use strict";var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.children=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.indexKey;return{inject:(0,s.default)({},t,{default:null}),watch:{el:{handler:function(t,e){JSON.stringify(t)!=JSON.stringify(e)&&this.bindRelation()},deep:!0,immediate:!0},src:{handler:function(t,e){t!=e&&this.bindRelation()},immediate:!0},text:{handler:function(t,e){t!=e&&this.bindRelation()},immediate:!0},css:{handler:function(t,e){t!=e&&(this.el.css=("object"==(0,o.default)(t)?t:t&&Object.assign.apply(Object,(0,r.default)(a(t))))||{})},immediate:!0},replace:{handler:function(t,e){JSON.stringify(t)!=JSON.stringify(e)&&this.bindRelation()},deep:!0,immediate:!0}},created:function(){var e=this;this._uid||(this._uid=this._.uid),Object.defineProperty(this,"parent",{get:function(){return e[t]||[]}}),Object.defineProperty(this,"index",{get:function(){e.bindRelation();var t=e.parent;t=void 0===t?{}:t;var i=t.el;i=void 0===i?{}:i;var n=i.views,r=void 0===n?[]:n;return r.indexOf(e.el)}}),this.el.type=this.type,this.uid&&(this.el.uid=this.uid),this.bindRelation()},beforeDestroy:function(){this.removeEl()},methods:{removeEl:function(){var t=this;this.parent&&(this.parent.el.views=this.parent.el.views.filter((function(e){return e._uid!==t._uid})))},bindRelation:function(){var t=this;if(this.el._uid||(this.el._uid=this._uid),["text","qrcode"].includes(this.type)&&(this.el.text=this.$slots&&this.$slots.default&&this.$slots.default[0].text||"".concat(this.text||"").replace(/\\n/g,"\n")),"image"==this.type&&(this.el.src=this.src),this.parent){var e=this.parent.el.views||[];-1!==e.indexOf(this.el)?this.parent.el.views=e.map((function(e){return e._uid==t._uid?t.el:e})):this.parent.el.views=[].concat((0,r.default)(e),[this.el])}}},mounted:function(){}}},e.parent=function(t){return{provide:function(){return(0,s.default)({},t,this)},data:function(){return{el:{id:null,css:{},views:[]}}},watch:{css:{handler:function(t){this.canvasId&&(this.el.css=("object"==(0,o.default)(t)?t:t&&Object.assign.apply(Object,(0,r.default)(a(t))))||{},this.canvasWidth=this.el.css&&this.el.css.width||this.canvasWidth,this.canvasHeight=this.el.css&&this.el.css.height||this.canvasHeight)},immediate:!0}}}};var r=n(i("b7c7")),o=n(i("fcf3")),s=n(i("39d8"));i("fd3c"),i("8f71"),i("bf0f"),i("5c47"),i("0506"),i("f7a5"),i("5ef2"),i("a1c1"),i("d4b5"),i("6a54"),i("4626"),i("c223");var a=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(";").filter((function(t){return t&&!/^[\n\s]+$/.test(t)})).map((function(t){var e=t.slice(0,t.indexOf(":")),i=t.slice(t.indexOf(":")+1);return(0,s.default)({},e.replace(/-([a-z])/g,(function(){return arguments[1].toUpperCase()})).replace(/\s+/g,""),i.replace(/^\s+/,"").replace(/\s+$/,"")||"")}))}},"20f3":function(t,e,i){"use strict";var n=i("8bdb"),r=i("5145");n({target:"Array",proto:!0,forced:r!==[].lastIndexOf},{lastIndexOf:r})},"235c1":function(t,e,i){"use strict";i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.base64ToPath=function(t){var e=/^data:image\/(\w+);base64,/.exec(t)||[],i=(0,a.default)(e,2);i[1];return new Promise((function(e,i){for(var n=t.split(",")[0].split(":")[1].split(";")[0],r=atob(t.split(",")[1]),o=new ArrayBuffer(r.length),s=new Uint8Array(o),a=0;a2&&void 0!==arguments[2]&&arguments[2];if("number"===typeof e)return e;if(f(e))return 1*e;if("string"===typeof e){var r=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g,o=r.exec(e);if(!e||!o)return 0;var s=o[3];e=parseFloat(e);var a=0;return"rpx"===s?a=uni.upx2px(e):"px"===s?a=1*e:"%"===s?a=e*t(i)/100:"em"===s&&(a=e*t(i||14)),n?1*a.toFixed(2):Math.round(a)}return 0};var r=n(i("2634")),o=n(i("9b1b")),s=n(i("2fdc")),a=n(i("5de6"));i("5c47"),i("0506"),i("bf0f"),i("e838"),i("aa9c"),i("e966"),i("c9b5"),i("15d1"),i("d5c6"),i("5a56"),i("f074"),i("80e3"),i("4db2"),i("c976"),i("4d8f"),i("7b97"),i("668a"),i("c5b7"),i("8ff5"),i("2378"),i("641a"),i("64e0"),i("cce3"),i("efba"),i("d009"),i("bd7d"),i("7edd"),i("d798"),i("f547"),i("5e54"),i("b60a"),i("8c18"),i("12973"),i("f991"),i("198e"),i("8557"),i("63b1"),i("1954"),i("1cf1"),i("18f7"),i("de6c"),i("dc89"),i("2425"),i("a1c1");e.networkReg=/^(http|\/\/)/;e.isBase64=function(t){return/^data:image\/(\w+);base64/.test(t)};var h=uni.getSystemInfoSync(),c=h.platform,d=(h.SDKVersion,/windows|mac/.test(c));e.isPC=d;var u={};function f(t){return/^-?\d+(\.\d+)?$/.test(t)}function l(t,e){t=t.split("."),e=e.split(".");var i=Math.max(t.length,e.length);while(t.lengtho)return 1;if(r30?this.fixedTop=!0:t.scrollTop<=0&&(this.fixedTop=!1)},onPullDownRefresh:function(){uni.stopPullDownRefresh(),this.getInfo()},onShareAppMessage:function(){var t=(0,s.getSycCache)("userInfo"),e="undefined"!=typeof t.id?t.id:this.$store.state.uid,i="/pagesSub/pages/mine/qrcode?rid="+e;return{path:i,success:function(t){console.log("转发成功",t)},fail:function(t){console.log("转发失败",t)}}},onShareTimeline:function(){var t=(0,s.getSycCache)("userInfo"),e="undefined"!=typeof t.id?t.id:this.$store.state.uid,i="/pagesSub/pages/mine/qrcode?rid="+e;return{path:i,success:function(t){console.log("转发成功",t)},fail:function(t){console.log("转发失败",t)}}},methods:{success:function(t){this.qrcode=t,this.loading=!1},previewImage:function(t,e){uni.previewImage({current:t,urls:e})},getConfig:function(){var t=this;return(0,o.default)((0,r.default)().mark((function e(){return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$request.apiGetConfig(!0);case 2:t.config=e.sent;case 3:case"end":return e.stop()}}),e)})))()},getInfo:function(){var t=this;return(0,o.default)((0,r.default)().mark((function e(){return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.loading=!0,e.next=3,t.$request.apiGetUserInfo(t,!0,"agent");case 3:t.userInfo=e.sent,t.userInfo.qrcode||uni.showToast({title:"小程序二维码生成失败",icon:"none"});case 5:case"end":return e.stop()}}),e)})))()},saveQrcode:function(){var t="/".concat(this.userInfo.id,"_").concat(this.userInfo.phone,"_user_qrcode.png"),e=this.qrcode.replace(/^data:image\/\w+;base64,/,""),i=wx.env.USER_DATA_PATH+t,n=uni.getFileSystemManager();Math.random();n.writeFile({filePath:i,data:e,encoding:"base64",success:function(t){uni.saveImageToPhotosAlbum({filePath:i,success:function(t){uni.showToast({title:"保存成功",icon:"success",duration:1e3})},fail:function(t){uni.showToast({title:"保存失败",icon:"success",duration:1e3})}})}})}}};e.default=c},"7df2":function(t,e,i){"use strict";i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(i("2634")),o=n(i("2fdc"));i("c223"),i("dc8a"),i("d4b5"),i("aa9c"),i("bf0f"),i("5c47"),i("7a76"),i("c9b5"),i("e966"),i("a1c1"),i("0506");var s=i("2077"),a=n(i("a982")),h=i("235c1"),c=n(i("f0d6")),d={name:"lime-painter",mixins:[a.default,(0,s.parent)("painter"),{}],data:function(){return{use2dCanvas:!1,canvasHeight:150,canvasWidth:null,parentWidth:0,inited:!1,progress:0,firstRender:0,done:!1,tasks:[]}},computed:{styles:function(){return"".concat(this.size).concat(this.customStyle||"",";")+(this.hidden&&"position: fixed; left: 1500rpx;")},canvasId:function(){return"l-painter".concat(this._&&this._.uid||this._uid)},size:function(){if(this.boardWidth&&this.boardHeight)return"width:".concat(this.boardWidth,"px; height: ").concat(this.boardHeight,"px;")},dpr:function(){return this.pixelRatio||uni.getSystemInfoSync().pixelRatio},boardWidth:function(){var t=this.elements&&this.elements.css||this.elements||this,e=t.width,i=void 0===e?0:e,n=(0,h.toPx)(i||this.width);return n||Math.max(n,(0,h.toPx)(this.canvasWidth))},boardHeight:function(){var t=this.elements&&this.elements.css||this.elements||this,e=t.height,i=void 0===e?0:e,n=(0,h.toPx)(i||this.height);return n||Math.max(n,(0,h.toPx)(this.canvasHeight))},hasBoard:function(){return this.board&&Object.keys(this.board).length},elements:function(){return this.hasBoard?this.board:JSON.parse(JSON.stringify(this.el))}},created:function(){this.use2dCanvas="2d"===this.type&&(0,h.canIUseCanvas2d)()&&!h.isPC},mounted:function(){var t=this;return(0,o.default)((0,r.default)().mark((function e(){return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,h.sleep)(30);case 2:return e.next=4,t.getParentWeith();case 4:t.$nextTick((function(){setTimeout((function(){t.$watch("elements",t.watchRender,{deep:!0,immediate:!0})}),30)}));case 5:case"end":return e.stop()}}),e)})))()},destroyed:function(){this.done=!1,this.inited=!1,this.firstRender=0,this.progress=0,this.painter=null,clearTimeout(this.rendertimer)},methods:{watchRender:function(t,e){var i=this;return(0,o.default)((0,r.default)().mark((function n(){return(0,r.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t&&t.views&&(i.firstRender?i.firstRender:t.views.length)&&Object.keys(t).length&&JSON.stringify(t)!=JSON.stringify(e)){n.next=2;break}return n.abrupt("return");case 2:i.firstRender=1,i.progress=0,i.done=!1,clearTimeout(i.rendertimer),i.rendertimer=setTimeout((function(){i.render(t)}),i.beforeDelay);case 7:case"end":return n.stop()}}),n)})))()},setFilePath:function(t,e){var i=this;return(0,o.default)((0,r.default)().mark((function n(){var o,s,a,c;return(0,r.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=t,s=e||i,a=s.pathType,c=void 0===a?i.pathType:a,"base64"!=c||(0,h.isBase64)(t)){n.next=8;break}return n.next=5,(0,h.pathToBase64)(t);case 5:o=n.sent,n.next=12;break;case 8:if("url"!=c||!(0,h.isBase64)(t)){n.next=12;break}return n.next=11,(0,h.base64ToPath)(t);case 11:o=n.sent;case 12:return e&&e.isEmit&&i.$emit("success",o),n.abrupt("return",o);case 14:case"end":return n.stop()}}),n)})))()},getSize:function(t){var e=this;return(0,o.default)((0,r.default)().mark((function i(){var n,o,s,a;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.css||t,o=n.width,s=t.css||t,a=s.height,e.size){i.next=12;break}if(!o&&!a){i.next=10;break}return e.canvasWidth=o||e.canvasWidth,e.canvasHeight=a||e.canvasHeight,i.next=8,(0,h.sleep)(30);case 8:i.next=12;break;case 10:return i.next=12,e.getParentWeith();case 12:case"end":return i.stop()}}),i)})))()},canvasToTempFilePathSync:function(t){this.tasks.push(t),this.done&&this.runTask()},runTask:function(){while(this.tasks.length){var t=this.tasks.shift();this.canvasToTempFilePath(t)}},getParentWeith:function(){var t=this;return new Promise((function(e){uni.createSelectorQuery().in(t).select(".lime-painter").boundingClientRect().exec((function(i){var n=i[0]||{},r=n.width,o=n.height;t.parentWidth=Math.ceil(r||0),t.canvasWidth=t.parentWidth||300,t.canvasHeight=o||t.canvasHeight||150,e(i[0])}))}))},render:function(){var t=arguments,e=this;return(0,o.default)((0,r.default)().mark((function i(){var n,o,s,a,d,u,f,l,p,g,v,x,b,w;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.length>0&&void 0!==t[0]?t[0]:{},Object.keys(n).length){i.next=3;break}return i.abrupt("return",console.error("空对象"));case 3:return e.progress=0,e.done=!1,i.next=7,e.getSize(n);case 7:return i.next=9,e.getContext();case 9:if(o=i.sent,s=e.use2dCanvas,a=e.boardWidth,d=e.boardHeight,u=e.canvas,f=e.afterDelay,!s||u){i.next=13;break}return i.abrupt("return",Promise.reject(new Error("canvas 没创建")));case 13:return e.boundary={top:0,left:0,width:a,height:d},e.painter=null,e.painter||(l=n.css||n,p=l.width,g=n.css||n,g.height,!p&&e.parentWidth&&Object.assign(n,{width:e.parentWidth}),v={context:o,canvas:u,width:a,height:d,pixelRatio:e.dpr,useCORS:e.useCORS,createImage:h.getImageInfo.bind(e),performance:e.performance,listen:{onProgress:function(t){e.progress=t,e.$emit("progress",t)},onEffectFail:function(t){e.$emit("faill",t)}}},e.painter=new c.default(v)),i.prev=16,i.next=19,e.painter.source(JSON.parse(JSON.stringify(n)));case 19:return x=i.sent,b=x.width,w=x.height,e.boundary.height=e.canvasHeight=w,e.boundary.width=e.canvasWidth=b,i.next=26,(0,h.sleep)(e.sleep);case 26:return i.next=28,e.painter.render();case 28:return i.next=30,new Promise((function(t){return e.$nextTick(t)}));case 30:if(s){i.next=33;break}return i.next=33,e.canvasDraw();case 33:if(!f||!s){i.next=36;break}return i.next=36,(0,h.sleep)(f);case 36:return e.$emit("done"),e.done=!0,e.isCanvasToTempFilePath&&e.canvasToTempFilePath().then((function(t){e.$emit("success",t.tempFilePath)})).catch((function(t){e.$emit("fail",new Error(JSON.stringify(t)))})),e.runTask(),i.abrupt("return",Promise.resolve({ctx:o,draw:e.painter,node:e.node}));case 43:i.prev=43,i.t0=i["catch"](16);case 45:case"end":return i.stop()}}),i,null,[[16,43]])})))()},canvasDraw:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,n){return t.ctx.draw(e,(function(){return setTimeout((function(){return i()}),t.afterDelay)}))}))},getContext:function(){var t=this;return(0,o.default)((0,r.default)().mark((function e(){var i,n,o;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.canvasWidth){e.next=4;break}return t.$emit("fail","painter no size"),console.error("[lime-painter]: 给画板或父级设置尺寸"),e.abrupt("return",Promise.reject());case 4:if(!t.ctx||!t.inited){e.next=6;break}return e.abrupt("return",Promise.resolve(t.ctx));case 6:if(i=t.type,n=t.use2dCanvas,t.dpr,t.boardWidth,t.boardHeight,o=function(){return new Promise((function(e){uni.createSelectorQuery().in(t).select("#".concat(t.canvasId)).boundingClientRect().exec((function(i){if(i){var n=uni.createCanvasContext(t.canvasId,t);if(t.inited||(t.inited=!0,t.use2dCanvas=!1,t.canvas=i),!n.measureText){var r=function(t){for(var e=0,i=0;i0&&t.charCodeAt(i)<128?e++:e+=2;return e};n.measureText=function(t){var e=n.state&&n.state.fontSize||12,i=n.__font;return i&&12==e&&(e=parseInt(i.split(" ")[3],10)),e/=2,{width:r(t)*e}}}t.ctx=n,e(t.ctx)}else console.error("[lime-painter] no node")}))}))},n){e.next=10;break}return e.abrupt("return",o());case 10:return e.abrupt("return",new Promise((function(e){uni.createSelectorQuery().in(t).select("#".concat(t.canvasId)).node().exec((function(n){var r=n&&n[0]||{},o=r.node;if(o){var s=o.getContext(i);t.inited||(t.inited=!0,t.use2dCanvas=!0,t.canvas=o),t.ctx=s,e(t.ctx)}else console.error("[lime-painter]: no size")}))})));case 11:case"end":return e.stop()}}),e)})))()},canvasToTempFilePath:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var i=(0,o.default)((0,r.default)().mark((function i(n,s){var a,h,c,d,u,f,l,p,g,v,x;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(a=t.use2dCanvas,h=t.canvasId,t.dpr,c=t.fileType,d=t.quality,u=function(){var i=(0,o.default)((0,r.default)().mark((function i(o){var s,a;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,t.setFilePath(o.tempFilePath||o,e);case 3:s=i.sent,a=Object.assign(o,{tempFilePath:s}),e.success&&e.success(a),n(a),i.next=12;break;case 9:i.prev=9,i.t0=i["catch"](0),t.$emit("fail",i.t0);case 12:case"end":return i.stop()}}),i,null,[[0,9]])})));return function(t){return i.apply(this,arguments)}}(),f=t.boundary||t,l=f.top,void 0===l?0:l,p=f.left,void 0===p?0:p,f.width,f.height,g=Object.assign({canvasId:h,id:h,fileType:c,quality:d},e,{success:u}),!a){i.next=25;break}if(g.canvas=t.canvas,i.prev=6,v=t.canvas.toDataURL("image/".concat(e.fileType||c).replace(/pg/,"peg"),e.quality||d),!/data:,/.test(v)){i.next=12;break}uni.canvasToTempFilePath(g,t),i.next=17;break;case 12:return i.next=14,t.setFilePath(v,e);case 14:x=i.sent,e.success&&e.success({tempFilePath:x}),n({tempFilePath:x});case 17:i.next=23;break;case 19:i.prev=19,i.t0=i["catch"](6),e.fail&&e.fail(i.t0),s(i.t0);case 23:i.next=26;break;case 25:uni.canvasToTempFilePath(g,t);case 26:case"end":return i.stop()}}),i,null,[[6,19]])})));return function(t,e){return i.apply(this,arguments)}}())}}};e.default=d},"7f22":function(t,e,i){"use strict";i.r(e);var n=i("6425"),r=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},"8e9b":function(t,e,i){"use strict";i.r(e);var n=i("d07d"),r=i("efab");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);var s=i("828b"),a=Object(s["a"])(r["default"],n["b"],n["c"],!1,null,"3e106eac",null,!1,n["a"],void 0);e["default"]=a.exports},a982:function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("64aa");var n={props:{board:Object,pathType:String,fileType:{type:String,default:"png"},hidden:Boolean,quality:{type:Number,default:1},css:[String,Object],width:[Number,String],height:[Number,String],pixelRatio:Number,customStyle:String,isCanvasToTempFilePath:Boolean,sleep:{type:Number,default:1e3/30},beforeDelay:{type:Number,default:100},afterDelay:{type:Number,default:100},performance:Boolean,useCORS:Boolean,hidpi:{type:Boolean,default:!0}}};e.default=n},b88c:function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("2077"),r={name:"lime-painter-view",mixins:[(0,n.children)("painter"),(0,n.parent)("painter")],props:{id:String,type:{type:String,default:"view"},css:[String,Object]},data:function(){return{el:{css:{},views:[]}}},mounted:function(){}};e.default=r},d07d:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement,e=this._self._c||t;return e("v-uni-view",[this._t("default")],2)},r=[]},d159:function(t,e,i){"use strict";i.r(e);var n=i("1542"),r=i("7f22");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);var s=i("828b"),a=Object(s["a"])(r["default"],n["b"],n["c"],!1,null,"bebf3e84",null,!1,n["a"],void 0);e["default"]=a.exports},d6a7:function(t,e,i){"use strict";i.r(e);var n=i("1274"),r=i("4677");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);i("251f");var s=i("828b"),a=Object(s["a"])(r["default"],n["b"],n["c"],!1,null,"635dd5a9",null,!1,n["a"],void 0);e["default"]=a.exports},efab:function(t,e,i){"use strict";i.r(e);var n=i("b88c"),r=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},effa:function(t,e,i){var n=i("449c");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var r=i("967d").default;r("462da65e",n,!0,{sourceMap:!1,shadowMode:!1})},f0d6:function(t,e,i){"use strict";var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Painter=void 0;var r=n(i("fcf3"));i("bf0f"),i("01a2"),i("e39c"),i("844d"),i("18f7"),i("de6c"),i("7a76"),i("c9b5"),i("aa9c"),i("5c47"),i("0506"),i("e838"),i("4626"),i("9db6"),i("2c10"),i("5ef2"),i("0c26"),i("20f3"),i("6a54"),i("8a8d"),i("f7a5"),i("08eb"),i("a1c1"),i("dfcf"),i("64aa"),i("5ac7"),i("23f4"),i("7d2f"),i("9c4e"),i("ab80"),i("2797"),i("4100"),i("473f"),i("c1a3"),i("c223"),i("fd3c"),i("dc8a"),i("bd06"),i("aa77"),i("1851"),i("8f71"),i("d4b5"),i("22b6");var o=function(){return o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(t){return"number"==typeof t}function j(t){return"auto"===t||null===t}function H(t){return/%$/.test(t)}var X=x,D=v,Y=b,G=m,J=y;function U(t){return t.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))}function Z(t,e){var i,n,r=function(t){var e=t.match(/([a-z]+)/)[1];return[e,U(t.split(e)[1])]}(t),o=r[0],s=r[1],a=e.split(" ");if(s)return(i={})[o+s]=e,i;if(a.length&&!s){var h=a[0],d=a[1],u=a[2],f=a[3];return(n={})[o+c[0]]=h,n[o+c[1]]=d||h,n[o+c[2]]=u||h,n[o+c[3]]=f||d||h,n}}var N,K=0,Q=function(){function t(){C(this,"elements",[]),C(this,"afterElements",[]),C(this,"beforeElements",[]),C(this,"ids",[]),C(this,"width",0),C(this,"height",0),C(this,"top",0),C(this,"left",0),C(this,"pre",null),C(this,"offsetX",0),C(this,"offsetY",0),K++,this.id=K}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){if(!this.ids.includes(t.id)){this.ids.push(t.id),this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()}},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)0;)"("===e[h+=1]&&(a+=1),")"===e[h]&&(a-=1);r="".concat(t(e.slice(s+1,h))),s=h}if(isNaN(Number(e[s]))&&"."!==e[s]||s===o-1){var c=parseFloat(r);switch(n){case"+":i.push(c);break;case"-":i.push(-c);break;case"*":i.push(i.pop()*c);break;case"/":i.push(i.pop()/c)}n=e[s],r=""}}for(var d=0;i.length;)d+=i.pop();return d}(n.replace(new RegExp(/-?[0-9]+(\.[0-9]+)?(rpx|px|%)/,"g"),T));t.style.textIndent=r}}},e.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach((function(t,e){i.setIndent(t);var n=i.elements[e-1],r=i.getOffsetY(t);t.style.top=i.top+r,t.style.left=n?n.offsetSize.left+n.offsetSize.width:i.left,t.getBoxPosition()}))},e.refreshLayout=function(){this.afterElements=this.afterElements.sort((function(t,e){return t.computedStyle.zIndex-e.computedStyle.zIndex})),this.beforeElements=this.beforeElements.sort((function(t,e){return t.computedStyle.zIndex-e.computedStyle.zIndex}))},t}(),q=((N={})["row"]={width:"width",contentWidth:"width",lineMaxWidth:"lineMaxWidth",left:"left",top:"top",height:"height",lineMaxHeight:"lineMaxHeight",marginLeft:"marginLeft"},N["column"]={width:"height",contentWidth:"height",lineMaxWidth:"lineMaxWidth",left:"top",top:"left",height:"width",lineMaxHeight:"lineMaxHeight",marginLeft:"marginTop"},N),V=function(t){var e,i;function n(){var e;return C(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e=t.call(this)||this),"outerWidth",0),e.exactValue=0,e.flexTotal=0,e.width=0,e.key=null,e.flexDirection="row",e}i=t,(e=n).prototype=Object.create(i.prototype),e.prototype.constructor=e,E(e,i);var r=n.prototype;return r.bind=function(t){this.container=t.parent,this.container.line=this,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),t.parent&&(this.flexDirection=t.parent.style.flexDirection,this.key=q[this.flexDirection]),this.initHeight(t),this.outerWidth=t.parent&&t.parent.contentSize[this.key.contentWidth]?t.parent.contentSize[this.key.contentWidth]:1/0,this.add(t)},r.add=function(t){this.ids.push(t.id);var e=t.style.flex;F(e)?this.flexTotal+=e:F(this.getWidth(t.style))&&(this.exactValue+=this.getWidth(t.offsetSize)),this.elements.push(t),this.refreshWidthHeight(t),t.next||this.closeLine()},r.closeLine=function(){this.calcFlex()},r.initHeight=function(t){this[this.key.height]=0},r.getWidth=function(t){return t[this.key.width]||0},r.getHeight=function(t){return t[this.key.height]||0},r.setWidth=function(t,e){t[this.key.width]=e},r.setHeight=function(t,e){t[this.key.height]=e},r.calcFlex=function(){var t=this,e=this.container.contentSize[this.key.contentWidth],i=0;this.elements.forEach((function(n){var r=n.style,o=n.contentSize,s=t.getWidth(r)||t.getWidth(o);F(r.flex)&&(s=r.flex/t.flexTotal*(e-t.exactValue)),t.setWidth(n.computedStyle,s),n.isFlexCalc=!0,delete n.line,delete n.lines,delete n.lineMaxWidth,n.getBoxWidthHeight(),i=Math.max(i,t.getHeight(n.offsetSize))})),this.setHeight(this,i)},r.refreshWidthHeight=function(t){var e=this.container.style.alignItems;e&&!t.style.alignSelf&&(t.style.alignSelf=e);var i=this.getHeight(t.offsetSize);i>this[this.key.height]&&(this.container[this.key.lineMaxHeight]=this[this.key.height]=i),this[this.key.width]+=this.getWidth(t.offsetSize);var n=Math.min(this.getWidth(this),!this.getWidth(this.container.contentSize)&&1/0);(this.container[this.key.lineMaxWidth]||0)1)return 0;var e=t.style.alignSelf,i=this.getHeight(this.container.contentSize),n=i-this.getHeight(t.offsetSize);return"flex-end"===e?n:"center"===e?n/2:"stretch"===e?(n&&t.name==g&&(t.style[this.key.width]=this.getWidth(t.offsetSize),t.style[this.key.height]=i,delete t.line,delete t.lines,t.getBoxWidthHeight()),0):0},r.layout=function(t,e){var i=this;this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements.forEach((function(t,e){i.setIndent(t);var n=i.elements[e-1],r=i.getOffsetY(t);t.style[i.key.top]=i[i.key.top]+r,t.style[i.key.left]=n?n.offsetSize[i.key.left]+i.getWidth(n.offsetSize):i[i.key.left],t.getBoxPosition()}))},n}(Q),_=v,$=g,et=m,it=0,nt={left:null,top:null,width:null,height:null},rt=new Map,ot=function(){function t(t,e,i,n){var o=this;C(this,"id",it++),C(this,"style",{left:null,top:null,width:null,height:null}),C(this,"computedStyle",{}),C(this,"originStyle",{}),C(this,"children",{}),C(this,"layoutBox",M({},nt)),C(this,"contentSize",M({},nt)),C(this,"clientSize",M({},nt)),C(this,"borderSize",M({},nt)),C(this,"offsetSize",M({},nt)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.type||t.name,this.attributes=this.getAttributes(t);var s=function(t,e){var i,n=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],o=t.type,s=void 0===o?"view":o,a=t.styles,h=void 0===a?{}:a,d=(e||{}).computedStyle,u=Object.assign({},S);if([D,X,Y].includes(s)&&!h.display&&(u.display="inline-block"),d)for(var f=0;f=0&&d<0,D=h>=0&&l<0;return i==f[0]&&(this[i].left=t.left+s+v+F+(X?2*-d:0),this[i].top=t.top+h+b+T+(D?2*-l:0),this[i].width=t.width+(this[i].widthAdd?0:j),this[i].height=t.height+(this[i].heightAdd?0:H),this[i].widthAdd=j,this[i].heightAdd=H),i==f[1]&&(this[i].left=t.left+s+F+(X<0?-d:0),this[i].top=t.top+h+T+(D?-l:0),this[i].width=t.width+v+m,this[i].height=t.height+b+S),i==f[2]&&(this[i].left=t.left+s+F/2+(X<0?-d:0),this[i].top=t.top+h+T/2+(D?-l:0),this[i].width=t.width+v+m+F/2+E/2,this[i].height=t.height+b+S+z/2+T/2),i==f[3]&&(this[i].left=t.left+(X<0?-d:0),this[i].top=t.top+(D?-l:0),this[i].width=t.width+v+m+F+E+s+d,this[i].height=t.height+b+S+z+T+l+h),this[i]},e.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},s=o.border,a=(s=void 0===s?{}:s).borderWidth,h=void 0===a?0:a,c=o.borderTop,d=(c=void 0===c?{}:c).borderTopWidth,u=void 0===d?h:d,l=o.borderBottom,p=(l=void 0===l?{}:l).borderBottomWidth,g=void 0===p?h:p,v=o.borderRight,x=(v=void 0===v?{}:v).borderRightWidth,b=void 0===x?h:x,w=o.borderLeft,m=(w=void 0===w?{}:w).borderLeftWidth,y=void 0===m?h:m,S=o.padding,A=(S=void 0===S?{}:S).paddingTop,I=void 0===A?0:A,P=S.paddingRight,O=void 0===P?0:P,k=S.paddingBottom,T=void 0===k?0:k,W=S.paddingLeft,B=void 0===W?0:W;i||(t.width-=B+O+b+y),1!==i||n||(t.height-=I+T+u+g)}this.layoutBox&&(f.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},e.getBoxPosition=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,s=void 0===o?0:o,a=M({},this.contentSize,{left:r,top:s}),h=this.contentSize.top-this.offsetSize.top,c=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var d,u=L(this.root.fixedLine.elements);!(d=u()).done;){var f=d.value;f.setPosition(f,this.root.offsetSize),f.getBoxPosition()}}if(e)for(var l,p=L(e.elements);!(l=p()).done;){var g=l.value,v=M({},this.borderSize,{left:r,top:s});g.setPosition(g,v);var x=this.borderSize.top-this.offsetSize.top,b=this.borderSize.left-this.offsetSize.left;g.style.left+=r+b,g.style.top+=s+x,g.getBoxPosition()}if(i)for(var w,m=L(i);!(w=m()).done;)w.value.layout(a.top+h,a.left+c);return this.layoutBoxUpdate(a,t),this.layoutBox},e.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},e.isBlock=function(t){return void 0===t&&(t=this),t&&"block"==t.style.display},e.isFlex=function(t){return void 0===t&&(t=this),t&&"flex"==t.style.display},e.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},e.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&!!t.parent&&(!(!t.parent||"flex"!==t.parent.style.display)||void 0)},e.isInline=function(t){return void 0===t&&(t=this),t&&"inline-block"==t.style.display},e.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},e.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},e.getParentSize=function(t,e){if(void 0===t&&(t=this),void 0===e&&(e=!1),t&&t.parent){if(t.parent.contentSize.width)return t.parent.contentSize;if(e)return this.getParentSize(t.parent,e)}return null},e.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,r=this.parent,o=void 0===r?{}:r,s=this.ctx,a=this.getChildren(),h=i.left,c=void 0===h?0:h,d=i.top,u=void 0===d?0:d,f=i.bottom,l=i.right,p=i.width,g=void 0===p?0:p,v=i.minWidth,x=i.maxWidth,b=i.minHeight,w=i.maxHeight,m=i.height,y=void 0===m?0:m,S=i.fontSize,A=i.fontWeight,I=i.fontFamily,P=i.fontStyle,O=i.position;i.textIndent;var k=i.lineClamp,W=i.lineHeight,B=i.padding,z=void 0===B?{}:B,C=i.margin,M=void 0===C?{}:C,E=i.border,R=(E=void 0===E?{}:E).borderWidth,L=void 0===R?0:R,F=i.borderRight,X=(F=void 0===F?{}:F).borderRightWidth,D=void 0===X?L:X,Y=i.borderLeft,G=(Y=void 0===Y?{}:Y).borderLeftWidth,J=void 0===G?L:G,U=o.contentSize&&o.contentSize.width,Z=o.contentSize&&o.contentSize.height;if(H(g)&&U&&(g=T(g,U)),H(g)&&!U&&(g=null),H(y)&&Z&&(y=T(y,Z)),H(y)&&!Z&&(y=null),H(v)&&U&&(v=T(v,U)),H(x)&&U&&(x=T(x,U)),H(b)&&Z&&(b=T(b,Z)),H(w)&&Z&&(w=T(w,Z)),i.padding&&U)for(var N in i.padding)Object.hasOwnProperty.call(z,N)&&(z[N]=T(z[N],U));var K=z.paddingRight,q=void 0===K?0:K,tt=z.paddingLeft,it=void 0===tt?0:tt;if(i.margin&&[M.marginLeft,M.marginRight].includes("auto"))if(g){var nt=U&&U-g-q-it-J-D||0;M.marginLeft==M.marginRight?M.marginLeft=M.marginRight=nt/2:j(M.marginLeft)?M.marginLeft=nt:M.marginRight=nt}else M.marginLeft=M.marginRight=0;var ot=M.marginRight,st=void 0===ot?0:ot,at=M.marginLeft,ht={width:g,height:y,left:0,top:0},ct=it+q+J+D+(void 0===at?0:at)+st;if(this.offsetWidth=ct,e==_&&!this.attributes.widths){var dt=n.text||"";s.save(),s.setFonts({fontFamily:I,fontSize:S,fontWeight:A,fontStyle:P}),dt.length,"\n"==dt&&(dt="",this.isBr=!0),(""+dt).split("\n").map((function(e){var i=Array.from(e).map((function(e){var i=""+(/^[\u4e00-\u9fa5]+$/.test(e)?"cn":e)+I+S+A+P,n=rt.get(i);if(n)return{width:n,text:e};var r=t.measureText(e,S).width;return rt.set(i,r),{width:r,text:e}})),n=t.measureText(e,S),r=n.fontHeight,o=n.ascent,s=n.descent;t.attributes.fontHeight=r,t.attributes.ascent=o,t.attributes.descent=s,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e.width}),0)})})),s.restore()}if("image"==e&&null==g){var ut=n.width,ft=n.height;ht.width=this.contrastSize(Math.round(ut*y/ft)||0,v,x),this.layoutBoxUpdate(ht,i,0)}if(e==_&&null==g){var lt=this.attributes.widths,pt=Math.max.apply(Math,lt.map((function(t){return t.total})));o&&U>0&&(pt>U||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed&&(pt=U),ht.width=this.contrastSize(pt,v,x),this.layoutBoxUpdate(ht,i,0)}if(e==_&&(o.style.flex||!this.attributes.lines)){var gt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e.width>ht.width?(gt++,e.width):t+e.width}),0)})),gt=k&>>k?k:gt,this.attributes.lines=gt}if("image"==e&&null==y){var vt=n.width,xt=n.height;n.text,ht.height=this.contrastSize(T(ht.width*xt/vt)||0,b,w),this.layoutBoxUpdate(ht,i,1)}e==_&&null==y&&(W=T(W,S),ht.height=this.contrastSize(T(this.attributes.lines*W),b,w),this.layoutBoxUpdate(ht,i,1,!0)),!g&&o&&o.children&&U&&(!this.isFlex(o)||o.isFlexCalc)&&([$,_].includes(e)&&this.isFlex()||e==$&&this.isBlock(this)&&this.isInFlow())&&(ht.width=this.contrastSize(U-(o.isFlexCalc?0:ct),v,x),this.layoutBoxUpdate(ht,i)),g&&!H(g)&&(ht.width=this.contrastSize(g,v,x),this.layoutBoxUpdate(ht,i,0)),y&&!H(y)&&(ht.height=this.contrastSize(ht.height,b,w),this.layoutBoxUpdate(ht,i,1));var bt=0;if(a.length){var wt=null,mt=!1;a.forEach((function(e,n){e.getBoxWidthHeight();var r=a[n+1];if(r&&r.isInFlow()&&(e.next=r),!t.line||!t.line.ids.includes(e.id))if(e.isInFlow()&&!e.inFlexBox()){var o=t.getBoxState(wt,e);if(e.isBr)return mt=!0;t.line&&t.line.canIEnter(e)&&!o&&!mt?t.line.add(e):(mt=!1,(new Q).bind(e)),wt=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new V).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new Q).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new Q).fixedBind(e,1)})),this.lines&&(bt=this.lines.reduce((function(t,e){return t+e.height}),0))}var yt=0,St=0;if(!g&&(this.isAbsolute||this.isFixed)&&U){var At=O==et?U:this.root.width,It=At-(H(c)?T(c,At):c)-(H(l)?T(l,At):l);yt=i.left?It:this.lineMaxWidth}if(!y&&(null!=u?u:this.isAbsolute||this.isFixed&&Z)){var Pt=O==et?Z:this.root.height,Ot=Pt-(H(u)?T(u,Pt):u)-(H(f)?T(f,Pt):f);St=i.top?Ot:0}if(g&&!H(g)||ht.width||(ht.width=yt||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?U||o.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,v,x),this.layoutBoxUpdate(ht,i,0)),y||!bt&&!St||(ht.height=St||this.contrastSize(bt,b,w),this.layoutBoxUpdate(ht,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var N in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,N)&&(i.borderRadius[N]=T(i.borderRadius[N],this.borderSize.width));return this.layoutBox},e.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.root.contentSize=this.contentSize,this.getBoxPosition(),this.offsetSize},t}(),st=function(){var t,e,i,n,r,o,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],a=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],h=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],c=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],d=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],u=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],f=[],l=[],p=[],g=[],v=[],x=2;function b(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,g[i+=t]=1}function w(t,i){var n;for(p[t+e*i]=1,n=-2;n<2;n++)p[t+n+e*(i-2)]=1,p[t-2+e*(i+n+1)]=1,p[t+2+e*(i+n)]=1,p[t+n+1+e*(i+2)]=1;for(n=0;n<2;n++)b(t-1,i+n),b(t+1,i-n),b(t-n,i-1),b(t+n,i+1)}function m(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var y=[];function S(t,e,i,n){var r,o,s;for(r=0;re&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,g[i+=t]}function I(t){var i,n,r,o;switch(t){case 0:for(n=0;n>1&1,i=0;i=5&&(i+=3+v[e]-5);for(e=3;et||3*v[e-3]>=4*v[e]||3*v[e+3]>=4*v[e])&&(i+=40);return i}function O(){var t,i,n,r,o,s=0,a=0;for(i=0;ie*e;)h-=e*e,c++;for(s+=10*c,t=0;t1)for(W=s[t],k=e-7;;){for(P=e-7;P>W-3&&(w(P,k),!(P6)for(W=a[t-7],T=17,P=0;P<6;P++)for(k=0;k<3;k++,T--)1&(T>11?t>>T-12:W>>T)?(p[5-P+e*(2-k+e-11)]=1,p[2-k+e-11+e*(5-P)]=1):(b(5-P,2-k+e-11),b(2-k+e-11,5-P));for(k=0;k=(P=r*(i+n)+n)-2&&(B=P-2,t>9&&B--),z=B,t>9){for(f[z+2]=0,f[z+3]=0;z--;)W=f[z],f[z+3]|=255&W<<4,f[z+2]=W>>4;f[2]|=255&B<<4,f[1]=B>>4,f[0]=64|B>>12}else{for(f[z+1]=0,f[z+2]=0;z--;)W=f[z],f[z+2]|=255&W<<4,f[z+1]=W>>4;f[1]|=255&B<<4,f[0]=64|B>>4}for(z=B+3-(t<10);z0;C--)y[C]=y[C]?y[C-1]^u[m(d[y[C]]+z)]:y[C-1];y[0]=u[m(d[y[0]]+z)]}for(z=0;z<=o;z++)y[z]=d[y[z]];for(T=P,k=0,z=0;z>=1)1&k&&(p[e-1-T+8*e]=1,T<6?p[8+e*T]=1:p[8+e*(T+1)]=1);for(T=0;T<7;T++,k>>=1)1&k&&(p[8+e*(e-7+T)]=1,T?p[6-T+8*e]=1:p[7+8*e]=1);return p}(v)},utf16to8:function(t){var e,i,n,r;for(e="",n=t.length,i=0;i=1&&r<=127?e+=t.charAt(i):r>2047?(e+=String.fromCharCode(224|r>>12&15),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r>>0&63)):(e+=String.fromCharCode(192|r>>6&31),e+=String.fromCharCode(128|r>>0&63));return e},draw:function(t,i,n,r,o){i.drawView(n,r);var s=i.ctx,a=n.contentSize,h=a.width,c=a.height,d=a.left,u=a.top;r.borderRadius,r.backgroundColor;var f=r.color,l=void 0===f?"#000000":f;if(r.border,n.contentSize.left,n.borderSize.left,n.contentSize.top,n.borderSize.top,x=o||x,s){s.save(),i.setOpacity(r),i.setTransform(n,r);var p=Math.min(h,c);t=this.utf16to8(t);var g=this.getFrame(t),v=p/e;s.setFillStyle(l);for(var b=0;b=360&&(s-=360),s<0&&(s+=360),0===(s=Math.round(s)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===s)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===s)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===s)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var a=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(s===a)return{x0:n,y0:i+r,x1:e+n,y1:r};if(s===180-a)return{x0:n,y0:r,x1:e+n,y1:i+r};if(s===180+a)return{x0:e+n,y0:r,x1:n,y1:i+r};if(s===360-a)return{x0:e+n,y0:i+r,x1:n,y1:r};var h,c=0,d=0,u=0,f=0;if(s180-a&&s<180||s>180&&s<180+a||s>360-a){var l=s*Math.PI/180,p=s360-a?i/2:-i/2,g=Math.tan(l)*p,v=s180-a&&s<180?e/2-g:-e/2-g;c=-(u=g+(h=Math.pow(Math.sin(l),2)*v)),d=-(f=p+h/Math.tan(l))}(s>a&&s<90||s>90&&s<90+a||s>180+a&&s<270||s>270&&s<360-a)&&(l=(90-s)*Math.PI/180,g=s>a&&s<90||s>90&&s<90+a?e/2:-e/2,p=Math.tan(l)*g,v=s>a&&s<90||s>270&&s<360-a?i/2-p:-i/2-p,c=-(u=g+(h=Math.pow(Math.sin(l),2)*v)/Math.tan(l)),d=-(f=p+h));return c=Math.round(c+e/2)+n,d=Math.round(i/2-d)+r,u=Math.round(u+e/2)+n,f=Math.round(i/2-f)+r,{x0:c,y0:d,x1:u,y1:f}}(r,t,e,i,n),a=s.x0,h=s.y0,c=s.x1,d=s.y1,u=o.createLinearGradient(a,h,c,d),f=r.match(/linear-gradient\((.+)\)/)[1],l=z(f.substring(f.indexOf(",")+1)),p=0;p=s||n==c&&o=s)&&(a=e.width/i.width);var d=i.width*a,u=i.height*a,f=r||[],l=f[0],p=f[1],g=B(l)?T(l,e.width):(e.width-d)*(W(l)?T(l,1):{left:0,center:.5,right:1}[l||"center"]),v=B(p)?T(p,e.height):(e.height-u)*(W(p)?T(p,1):{top:0,center:.5,bottom:1}[p||"center"]),x=function(t,e){return[(t-g)/a,(e-v)/a]},b=x(0,0),w=b[0],m=b[1],y=x(e.width,e.height),S=y[0],A=y[1],I=Math.max,P=Math.min;return{sx:I(w,0),sy:I(m,0),sw:P(S-w,i.width),sh:P(A-m,i.height),dx:I(g,0),dy:I(v,0),dw:P(d,e.width),dh:P(u,e.height)}}({objectFit:l,objectPosition:v},e.contentSize,t),n=i.sx,o=i.sy,s=i.sh,a=i.sw,c=i.dx,d=i.dy,u=i.dh,f=i.dw;I==h.MP_BAIDU?r.drawImage(t.src,c+y,d+S,f,u,n,o,a,s):r.drawImage(t.src,n,o,a,s,c+y,d+S,f,u)}else r.drawImage(t.src,y,S,w,m)},k=function(){r.restore(),C.drawView(e,i,!1,!0,!1),o(1)},z=function(t){O(t),k()},z(t),[2]}))}))}))];case 1:return o.sent(),[2]}}))}))},t.prototype.drawText=function(t,e,i,n){var r=this,o=this.ctx,s=e.borderSize,a=e.contentSize,h=e.left,c=e.top,d=a.width,u=a.height,f=a.left-s.left||0,l=a.top-s.top||0,p=i.color,g=i.lineHeight,v=i.fontSize,x=i.fontWeight,b=i.fontFamily,w=i.fontStyle,m=i.textIndent,y=void 0===m?0:m,S=i.textAlign,A=i.textStroke,I=i.verticalAlign,P=void 0===I?ft:I,O=i.backgroundColor,W=i.lineClamp,B=i.backgroundClip,z=i.textShadow,C=i.textDecoration;if(y=k(y)?y:0,this.drawView(e,i,B!=ht),g=T(g,v),t){o.save(),h+=f,c+=l;var M=n.fontHeight,E=n.descent,R=void 0===E?0:E,L=n.ascent,F=R+(void 0===L?0:L);switch(o.setFonts({fontFamily:b,fontSize:v,fontWeight:x,fontStyle:w}),o.setTextBaseline(ft),o.setTextAlign(S),B?this.setBackground(O,d,u,h,c):o.setFillStyle(p),S){case pt:break;case gt:h+=.5*d;break;case vt:h+=d}var j=n.lines*g,H=Math.ceil((u-j)/2);switch(H<0&&(H=0),P){case ut:break;case ft:c+=H;break;case lt:c+=2*H}var X=(g-M)/2,D=g/2,Y=function(t){var e=o.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,r=e.actualBoundingBoxAscent;return P==ut?{fix:F?void 0===r?0:r:D-X/2,lineY:F?0:X-X/2}:P==ft?{fix:F?D+n/4:D,lineY:F?0:X}:P==lt?{fix:F?g-n:D+X/2,lineY:F?2*X:X+X/2}:{fix:0,height:0,lineY:0}},G=function(t,e,i){var r=t;switch(S){case pt:r+=i;break;case gt:r=(t-=i/2)+i;break;case vt:r=t,t-=i}if(C){o.setLineWidth(v/13),o.beginPath();var s=.1*n.fontHeight;/\bunderline\b/.test(C)&&(o.moveTo(t,e+n.fontHeight+s),o.lineTo(r,e+n.fontHeight+s)),/\boverline\b/.test(C)&&(o.moveTo(t,e-s),o.lineTo(r,e-s)),/\bline-through\b/.test(C)&&(o.moveTo(t,e+.5*n.fontHeight),o.lineTo(r,e+.5*n.fontHeight)),o.closePath(),o.setStrokeStyle(p),o.stroke()}},J=function(t,e,i){var n=function(){o.setLineWidth(A.width),o.setStrokeStyle(A.color),o.strokeText(t,e,i)},s="outset";A&&A.type!==s?(o.save(),r.setShadow({boxShadow:z}),o.fillText(t,e,i),o.restore(),n()):A&&A.type==s?(o.save(),r.setShadow({boxShadow:z}),n(),o.restore(),o.save(),o.fillText(t,e,i),o.restore()):(r.setShadow({boxShadow:z}),o.fillText(t,e,i))};if(!n.widths||1==n.widths.length&&n.widths[0].total+y<=a.width){var U=Y(t),Z=U.fix,N=void 0===Z?0:Z,K=U.lineY;return J(t,h+y,c+N),G(h+y,c+K,n&&n.widths&&n.widths[0].total||n.text),c+=g,o.restore(),void this.setBorder(e,i)}for(var Q=c,q=h,V="",_=0,$=o.measureText("...").width,tt=n.widths,et=0;eta.width){_>=W&&(V+="…"),_++,nt=0;var dt=Y(V);N=dt.fix,K=dt.lineY,J(V,q,c+N),G(q,c+K,nt),c+=g,V=""}else if(rt==it.length-1){et!=tt.length-1&&_==W&&$+ntQ+u||_>W)break}}o.restore()}},t.prototype.source=function(t){return s(this,void 0,void 0,(function(){var e,i,n,r,o=this;return a(this,(function(s){switch(s.label){case 0:if(this.node=null,e=+new Date,"{}"==JSON.stringify(t))return[2];if(t.styles=t.styles||t.css||{},!t.type)for(i in t.type=dt,t)["views","children","type","css","styles"].includes(i)||(t.styles[i]=t[i],delete t[i]);return t.styles.boxSizing||(t.styles.boxSizing="border-box"),[4,this.create(t)];case 1:return(n=s.sent())?(r=n.layout()||{},this.size=r,this.node=n,this.onEffectFinished().then((function(t){return o.lifecycle("onEffectSuccess",t)})).catch((function(t){return o.lifecycle("onEffectFail",t)})),this.performance&&console.log("布局用时:"+(+new Date-e)+"ms"),[2,this.size]):[2,console.warn("no node")]}}))}))},t.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},t.prototype.create=function(t,e){return s(this,void 0,void 0,(function(){var i,n,r,s,h,c,d,u,f,l,p,g,v,x,b,w,m,y,S,A,I,P,O,k;return a(this,(function(a){switch(a.label){case 0:if(!t)return[2];if(t.styles||(t.styles=t.css||{}),i=t.type,n=t.show,r=void 0===n||n,s=i==at,h=[ht,ct].includes(i),c="textBox"==i,d=t.styles||{},u=d.backgroundImage,f=d.display,s&&!t.src&&!t.url)return[2];if("none"==f||!r)return[2];if(h||c){if(l=t.children,p=t.views,!l&&p&&(t.children=l=p),!t.text&&(!l||l&&!l.length))return[2];l&&l.length&&!t.flattened&&(g=function t(e,i,n){void 0===i&&(i={}),void 0===n&&(n=!0);var r=[];return e.forEach((function(e){var s=e.styles,a=void 0===s?{}:s,h=e.css,c=void 0===h?{}:h,d=e.children,u=void 0===d?[]:d,f=e.views,l=void 0===f?[]:f,p=e.text,g=void 0===p?"":p,v=e.type,x=void 0===v?"":v;!u&&l&&(e.children=u=l);var b;b=o(o(n?o({},i):{},a),c);var w={},m={},y={};if(Object.keys(b).map((function(t){if(t.includes("padding")||t.includes("margin")){var e=Z(t,b[t]);Object.keys(e).map((function(t){t.includes("Left")?m[t]=e[t]:t.includes("Right")?y[t]=e[t]:w[t]=e[t]}))}})),b.textIndent&&(m.textIndent=b.textIndent,delete i.textIndent),""!==g){var S=Array.from(g);S.forEach((function(t,e){var i=Object.assign({},b,w);0===e?Object.assign(i,m):e==S.length-1&&Object.assign(i,y),delete i.padding,delete i.margin,r.push({type:"text",text:t,styles:i})}))}if(x==at||x==ct)r.push(e);else if("block"===a.display&&u.length>0){var A=t(u,b,!1);e.children=A,e.flattened=!0,r.push(e)}else u.length>0&&(A=t(u,b,n),r=r.concat(A))})),r}(t.children||t.views),t.type="view",t.children=g)}if(!(s||t.type==dt&&u))return[3,4];v=s?t.src:"",x=/url\(['"]?(.*?)['"]?\)/.exec(u),u&&x&&x[1]&&(v=x[1]||""),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.getImageInfo(v)];case 2:return b=a.sent(),w=b.width,m=b.height,!(y=b.path)&&s?[2]:(y&&(t.attributes=Object.assign(t.attributes||{},{width:w,height:m,path:y,src:y,naturalSrc:v})),[3,4]);case 3:return S=a.sent(),t.type!=dt?[2]:(this.lifecycle("onEffectFail",o(o({},S),{src:v})),[3,4]);case 4:if(this.count+=1,A=new ot(t,e,this.root,this.ctx),!(I=t.children||t.views))return[3,8];P=0,a.label=5;case 5:return P