diff --git a/dist/editor.js b/dist/editor.js index e5a824f74..d291eccd8 100644 --- a/dist/editor.js +++ b/dist/editor.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.editor=e():t.editor=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=142)}([function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){function n(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"create",(function(){return fe})),n.d(r,"clone",(function(){return he})),n.d(r,"copy",(function(){return pe})),n.d(r,"fromValues",(function(){return de})),n.d(r,"set",(function(){return ve})),n.d(r,"identity",(function(){return ye})),n.d(r,"transpose",(function(){return ge})),n.d(r,"invert",(function(){return me})),n.d(r,"adjoint",(function(){return be})),n.d(r,"determinant",(function(){return ke})),n.d(r,"multiply",(function(){return xe})),n.d(r,"translate",(function(){return we})),n.d(r,"scale",(function(){return Pe})),n.d(r,"rotate",(function(){return Oe})),n.d(r,"rotateX",(function(){return Se})),n.d(r,"rotateY",(function(){return je})),n.d(r,"rotateZ",(function(){return $e})),n.d(r,"fromTranslation",(function(){return Re})),n.d(r,"fromScaling",(function(){return Ce})),n.d(r,"fromRotation",(function(){return Me})),n.d(r,"fromXRotation",(function(){return Te})),n.d(r,"fromYRotation",(function(){return Ve})),n.d(r,"fromZRotation",(function(){return Ee})),n.d(r,"fromRotationTranslation",(function(){return Ie})),n.d(r,"fromQuat2",(function(){return De})),n.d(r,"getTranslation",(function(){return Le})),n.d(r,"getScaling",(function(){return Be})),n.d(r,"getRotation",(function(){return Ae})),n.d(r,"fromRotationTranslationScale",(function(){return ze})),n.d(r,"fromRotationTranslationScaleOrigin",(function(){return Fe})),n.d(r,"fromQuat",(function(){return He})),n.d(r,"frustum",(function(){return Ge})),n.d(r,"perspective",(function(){return _e})),n.d(r,"perspectiveFromFieldOfView",(function(){return Ne})),n.d(r,"ortho",(function(){return Xe})),n.d(r,"lookAt",(function(){return Ye})),n.d(r,"targetTo",(function(){return Ke})),n.d(r,"str",(function(){return Ue})),n.d(r,"frob",(function(){return We})),n.d(r,"add",(function(){return Ze})),n.d(r,"subtract",(function(){return qe})),n.d(r,"multiplyScalar",(function(){return Je})),n.d(r,"multiplyScalarAndAdd",(function(){return Qe})),n.d(r,"exactEquals",(function(){return tn})),n.d(r,"equals",(function(){return en})),n.d(r,"mul",(function(){return nn})),n.d(r,"sub",(function(){return rn}));var i={};n.r(i),n.d(i,"create",(function(){return an})),n.d(i,"clone",(function(){return on})),n.d(i,"length",(function(){return cn})),n.d(i,"fromValues",(function(){return sn})),n.d(i,"copy",(function(){return un})),n.d(i,"set",(function(){return ln})),n.d(i,"add",(function(){return fn})),n.d(i,"subtract",(function(){return hn})),n.d(i,"multiply",(function(){return pn})),n.d(i,"divide",(function(){return dn})),n.d(i,"ceil",(function(){return vn})),n.d(i,"floor",(function(){return yn})),n.d(i,"min",(function(){return gn})),n.d(i,"max",(function(){return mn})),n.d(i,"round",(function(){return bn})),n.d(i,"scale",(function(){return kn})),n.d(i,"scaleAndAdd",(function(){return xn})),n.d(i,"distance",(function(){return wn})),n.d(i,"squaredDistance",(function(){return Pn})),n.d(i,"squaredLength",(function(){return On})),n.d(i,"negate",(function(){return Sn})),n.d(i,"inverse",(function(){return jn})),n.d(i,"normalize",(function(){return $n})),n.d(i,"dot",(function(){return Rn})),n.d(i,"cross",(function(){return Cn})),n.d(i,"lerp",(function(){return Mn})),n.d(i,"hermite",(function(){return Tn})),n.d(i,"bezier",(function(){return Vn})),n.d(i,"random",(function(){return En})),n.d(i,"transformMat4",(function(){return In})),n.d(i,"transformMat3",(function(){return Dn})),n.d(i,"transformQuat",(function(){return Ln})),n.d(i,"rotateX",(function(){return Bn})),n.d(i,"rotateY",(function(){return An})),n.d(i,"rotateZ",(function(){return zn})),n.d(i,"angle",(function(){return Fn})),n.d(i,"zero",(function(){return Hn})),n.d(i,"str",(function(){return Gn})),n.d(i,"exactEquals",(function(){return _n})),n.d(i,"equals",(function(){return Nn})),n.d(i,"sub",(function(){return Yn})),n.d(i,"mul",(function(){return Kn})),n.d(i,"div",(function(){return Un})),n.d(i,"dist",(function(){return Wn})),n.d(i,"sqrDist",(function(){return Zn})),n.d(i,"len",(function(){return qn})),n.d(i,"sqrLen",(function(){return Jn})),n.d(i,"forEach",(function(){return Qn}));var a={};n.r(a),n.d(a,"create",(function(){return nr})),n.d(a,"identity",(function(){return rr})),n.d(a,"setAxisAngle",(function(){return ir})),n.d(a,"getAxisAngle",(function(){return ar})),n.d(a,"getAngle",(function(){return or})),n.d(a,"multiply",(function(){return cr})),n.d(a,"rotateX",(function(){return sr})),n.d(a,"rotateY",(function(){return ur})),n.d(a,"rotateZ",(function(){return lr})),n.d(a,"calculateW",(function(){return fr})),n.d(a,"exp",(function(){return hr})),n.d(a,"ln",(function(){return pr})),n.d(a,"pow",(function(){return dr})),n.d(a,"slerp",(function(){return vr})),n.d(a,"random",(function(){return yr})),n.d(a,"invert",(function(){return gr})),n.d(a,"conjugate",(function(){return mr})),n.d(a,"fromMat3",(function(){return br})),n.d(a,"fromEuler",(function(){return kr})),n.d(a,"str",(function(){return xr})),n.d(a,"clone",(function(){return Cr})),n.d(a,"fromValues",(function(){return Mr})),n.d(a,"copy",(function(){return Tr})),n.d(a,"set",(function(){return Vr})),n.d(a,"add",(function(){return Er})),n.d(a,"mul",(function(){return Ir})),n.d(a,"scale",(function(){return Dr})),n.d(a,"dot",(function(){return Lr})),n.d(a,"lerp",(function(){return Br})),n.d(a,"length",(function(){return Ar})),n.d(a,"len",(function(){return zr})),n.d(a,"squaredLength",(function(){return Fr})),n.d(a,"sqrLen",(function(){return Hr})),n.d(a,"normalize",(function(){return Gr})),n.d(a,"exactEquals",(function(){return _r})),n.d(a,"equals",(function(){return Nr})),n.d(a,"rotationTo",(function(){return Xr})),n.d(a,"sqlerp",(function(){return Yr})),n.d(a,"setAxes",(function(){return Kr}));var o={};n.r(o),n.d(o,"create",(function(){return Ur})),n.d(o,"clone",(function(){return Wr})),n.d(o,"fromValues",(function(){return Zr})),n.d(o,"copy",(function(){return qr})),n.d(o,"set",(function(){return Jr})),n.d(o,"add",(function(){return Qr})),n.d(o,"subtract",(function(){return ti})),n.d(o,"multiply",(function(){return ei})),n.d(o,"divide",(function(){return ni})),n.d(o,"ceil",(function(){return ri})),n.d(o,"floor",(function(){return ii})),n.d(o,"min",(function(){return ai})),n.d(o,"max",(function(){return oi})),n.d(o,"round",(function(){return ci})),n.d(o,"scale",(function(){return si})),n.d(o,"scaleAndAdd",(function(){return ui})),n.d(o,"distance",(function(){return li})),n.d(o,"squaredDistance",(function(){return fi})),n.d(o,"length",(function(){return hi})),n.d(o,"squaredLength",(function(){return pi})),n.d(o,"negate",(function(){return di})),n.d(o,"inverse",(function(){return vi})),n.d(o,"normalize",(function(){return yi})),n.d(o,"dot",(function(){return gi})),n.d(o,"cross",(function(){return mi})),n.d(o,"lerp",(function(){return bi})),n.d(o,"random",(function(){return ki})),n.d(o,"transformMat2",(function(){return xi})),n.d(o,"transformMat2d",(function(){return wi})),n.d(o,"transformMat3",(function(){return Pi})),n.d(o,"transformMat4",(function(){return Oi})),n.d(o,"rotate",(function(){return Si})),n.d(o,"angle",(function(){return ji})),n.d(o,"zero",(function(){return $i})),n.d(o,"str",(function(){return Ri})),n.d(o,"exactEquals",(function(){return Ci})),n.d(o,"equals",(function(){return Mi})),n.d(o,"len",(function(){return Ti})),n.d(o,"sub",(function(){return Vi})),n.d(o,"mul",(function(){return Ei})),n.d(o,"div",(function(){return Ii})),n.d(o,"dist",(function(){return Di})),n.d(o,"sqrDist",(function(){return Li})),n.d(o,"sqrLen",(function(){return Bi})),n.d(o,"forEach",(function(){return Ai}));var c={};n.r(c),n.d(c,"round",(function(){return zi})),n.d(c,"degreeToRadian",(function(){return Fi})),n.d(c,"div",(function(){return Hi})),n.d(c,"radianToDegree",(function(){return Gi})),n.d(c,"getXInCircle",(function(){return _i})),n.d(c,"getYInCircle",(function(){return Ni})),n.d(c,"getXYInCircle",(function(){return Xi})),n.d(c,"getDist",(function(){return Yi})),n.d(c,"getPointBetweenVerties",(function(){return Ki})),n.d(c,"vertiesMap",(function(){return Ui})),n.d(c,"makeGuidePoint",(function(){return qi})),n.d(c,"getVertiesMaxX",(function(){return Ji})),n.d(c,"getVertiesMaxY",(function(){return Qi})),n.d(c,"getVertiesMinX",(function(){return ta})),n.d(c,"getVertiesCenterX",(function(){return ea})),n.d(c,"getVertiesMinY",(function(){return na})),n.d(c,"getVertiesCenterY",(function(){return ra})),n.d(c,"calculateAngle",(function(){return ia})),n.d(c,"calculateAngleForVec3",(function(){return aa})),n.d(c,"calculateRotationOriginMat4",(function(){return oa})),n.d(c,"calculateMatrix",(function(){return ca})),n.d(c,"calculateMatrixInverse",(function(){return sa})),n.d(c,"calculateAnglePointDistance",(function(){return ua})),n.d(c,"calculateAngle360",(function(){return la})),n.d(c,"uuid",(function(){return ha})),n.d(c,"uuidShort",(function(){return pa})),n.d(c,"cubicBezier",(function(){return ga})),n.d(c,"getGradientLine",(function(){return ma})),n.d(c,"getCenterInTriangle",(function(){return ba})),n.d(c,"normalize",(function(){return xa}));var s={};n.r(s),n.d(s,"format",(function(){return uc})),n.d(s,"hex",(function(){return lc})),n.d(s,"rgb",(function(){return fc})),n.d(s,"hsl",(function(){return hc}));var u={};n.r(u),n.d(u,"randomNumber",(function(){return pc})),n.d(u,"randomByCount",(function(){return dc})),n.d(u,"random",(function(){return vc})),n.d(u,"randomRGBA",(function(){return yc}));var l={};n.r(l),n.d(l,"randomItem",(function(){return gc})),n.d(l,"repeat",(function(){return mc})),n.d(l,"CSS_TO_STRING",(function(){return bc})),n.d(l,"STRING_TO_CSS",(function(){return kc})),n.d(l,"OBJECT_TO_PROPERTY",(function(){return xc})),n.d(l,"OBJECT_TO_CLASS",(function(){return wc})),n.d(l,"TAG_TO_STRING",(function(){return Pc})),n.d(l,"mapjoin",(function(){return Oc})),n.d(l,"isArrayEquals",(function(){return Sc})),n.d(l,"curveToPath",(function(){return jc})),n.d(l,"curveToPointLine",(function(){return $c}));var f={};n.r(f),n.d(f,"ReverseXyz",(function(){return cs})),n.d(f,"ReverseRGB",(function(){return ss})),n.d(f,"XYZtoRGB",(function(){return us})),n.d(f,"LABtoXYZ",(function(){return ls})),n.d(f,"PivotXyz",(function(){return fs})),n.d(f,"XYZtoLAB",(function(){return hs})),n.d(f,"LABtoRGB",(function(){return ps}));var h={};n.r(h),n.d(h,"RGBtoHSV",(function(){return ds})),n.d(h,"RGBtoCMYK",(function(){return vs})),n.d(h,"RGBtoHSL",(function(){return ys})),n.d(h,"c",(function(){return gs})),n.d(h,"gray",(function(){return ms})),n.d(h,"RGBtoSimpleGray",(function(){return bs})),n.d(h,"RGBtoGray",(function(){return ks})),n.d(h,"brightness",(function(){return xs})),n.d(h,"RGBtoYCrCb",(function(){return ws})),n.d(h,"PivotRGB",(function(){return Ps})),n.d(h,"RGBtoXYZ",(function(){return Os})),n.d(h,"RGBtoLAB",(function(){return Ss}));var p={};n.r(p),n.d(p,"HUEtoRGB",(function(){return js})),n.d(p,"HSLtoHSV",(function(){return $s})),n.d(p,"HSLtoRGB",(function(){return Rs}));var d={};n.r(d),n.d(d,"getColorIndexString",(function(){return Vs})),n.d(d,"isColor",(function(){return Es})),n.d(d,"matches",(function(){return Is})),n.d(d,"convertMatches",(function(){return Ds})),n.d(d,"convertMatchesArray",(function(){return Ls})),n.d(d,"reverseMatches",(function(){return Bs})),n.d(d,"trim",(function(){return zs})),n.d(d,"parse",(function(){return Fs})),n.d(d,"parseGradient",(function(){return Hs}));var v={};n.r(v),n.d(v,"CMYKtoRGB",(function(){return Ks}));var g={};n.r(g),n.d(g,"HSVtoRGB",(function(){return Us})),n.d(g,"HSVtoHSL",(function(){return Ws}));var m={};n.r(m),n.d(m,"YCrCbtoRGB",(function(){return Zs}));var b={};n.r(b),n.d(b,"interpolateRGB",(function(){return qs})),n.d(b,"interpolateRGBObject",(function(){return Js})),n.d(b,"scale",(function(){return Qs})),n.d(b,"blend",(function(){return tu})),n.d(b,"mix",(function(){return eu})),n.d(b,"contrast",(function(){return nu})),n.d(b,"contrastColor",(function(){return ru})),n.d(b,"gradient",(function(){return iu})),n.d(b,"scaleHSV",(function(){return au})),n.d(b,"scaleH",(function(){return ou})),n.d(b,"scaleS",(function(){return cu})),n.d(b,"scaleV",(function(){return su}));var k=n(5),w=n.n(k),P=(n(25),n(26),n(1)),O=n.n(P),S=n(2),j=n.n(S),$=n(3),R=n.n($),C=n(4),M=n.n(C),T=n(0),V=n.n(T),E=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A;return" ".concat(e," ").concat(t)},I=/^domevent (.*)/gi,D=/^load (.*)/gi,L=/^bind (.*)/gi,B=/^subscribe (.*)/gi,A="|",z={},F=function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:A;return E(t,e)},_=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:A;return E("after(".concat(t,")"),e)},N=G,X=(G("ArrowUp"),G("ArrowDown"),G("ArrowLeft"),G("ArrowRight"),G("Enter")),Y=(G("Space"),G("Escape")),K=G("isAltKey"),U=(G("isShiftKey"),G("isMetaKey"),G("isCtrlKey"),G("hasMouse"),G("hasTouch"),G("hasPen"),G("self"),G("isMouseLeftButton")),W=(G("isMouseRightButton"),G("fit"),G("passive"),G("domdiff")),Z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return G("debounce(".concat(t,")"))},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;return G("delay(".concat(t,")"))},J=(Z(1e3),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return G("throttle(".concat(t,")"))}),Q=G("allTrigger()"),tt=G("selfTrigger()"),et=(G("capture()"),_("preventDefault")),nt=_("stopPropagation"),rt=H,it=function(){for(var t=arguments.length,e=new Array(t),n=0;n1?e-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:"$el";return"load "+t},Vt=function(t){return function(){return this.prevState[t]!=this.state[t]}},Et=function(){return!0},It=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$el";return"bind "+t};function Dt(t,e){return Math.sign(t)*Math.min(e,Math.abs(t))}var Lt,Bt={addDomEvent:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t&&t.addEventListener(e,n,r)},removeDomEvent:function(t,e,n){t&&t.removeEventListener(e,n)},pos:function(t){return t.touches&&t.touches[0]?t.touches[0]:t},posXY:function(t){var e=this.pos(t);return{x:e.pageX,y:e.pageY}}},At=n(7),zt=n.n(At),Ft=n(14),Ht=n.n(Ft);function Gt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0===e)return t;var n=void 0;return function(r,i,a,o,c){n&&clearTimeout(n),n=setTimeout((function(){t(r,i,a,o,c)}),e||300)}}function _t(t,e){var n=void 0;return function(r,i,a,o,c){n||(n=setTimeout((function(){t(r,i,a,o,c),n=null}),e||300))}}function Nt(t,e,n){return function(){for(var r=arguments.length,i=new Array(r),a=0;a]*)\/\>/gim,re=(Lt={image:!0,input:!0,br:!0,path:!0,line:!0,circle:!0,rect:!0},w()(Lt,"path",!0),w()(Lt,"polygon",!0),w()(Lt,"polyline",!0),w()(Lt,"use",!0),Lt),ie=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r",">"))}))},ae=function(t,e){var n=t.filter((function(t){return t.indexOf("".concat(e,"("))>-1})),r=n.map((function(t){var n=t.split("".concat(e,"("))[1].split(")")[0].trim().split(" "),r=zt()(n,2);return{target:r[0],param:r[1]}}));return[n,r]},oe=n(8),ce=n.n(oe),se=1e-6,ue="undefined"!=typeof Float32Array?Float32Array:Array,le=Math.random;Math.PI;function fe(){var t=new ue(16);return ue!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function he(t){var e=new ue(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function pe(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function de(t,e,n,r,i,a,o,c,s,u,l,f,h,p,d,v){var y=new ue(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=c,y[8]=s,y[9]=u,y[10]=l,y[11]=f,y[12]=h,y[13]=p,y[14]=d,y[15]=v,y}function ve(t,e,n,r,i,a,o,c,s,u,l,f,h,p,d,v,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=c,t[7]=s,t[8]=u,t[9]=l,t[10]=f,t[11]=h,t[12]=p,t[13]=d,t[14]=v,t[15]=y,t}function ye(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ge(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],c=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=c}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function me(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],c=e[5],s=e[6],u=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],y=e[14],g=e[15],m=n*c-r*o,b=n*s-i*o,k=n*u-a*o,x=r*s-i*c,w=r*u-a*c,P=i*u-a*s,O=l*v-f*d,S=l*y-h*d,j=l*g-p*d,$=f*y-h*v,R=f*g-p*v,C=h*g-p*y,M=m*C-b*R+k*$+x*j-w*S+P*O;return M?(M=1/M,t[0]=(c*C-s*R+u*$)*M,t[1]=(i*R-r*C-a*$)*M,t[2]=(v*P-y*w+g*x)*M,t[3]=(h*w-f*P-p*x)*M,t[4]=(s*j-o*C-u*S)*M,t[5]=(n*C-i*j+a*S)*M,t[6]=(y*k-d*P-g*b)*M,t[7]=(l*P-h*k+p*b)*M,t[8]=(o*R-c*j+u*O)*M,t[9]=(r*j-n*R-a*O)*M,t[10]=(d*w-v*k+g*m)*M,t[11]=(f*k-l*w-p*m)*M,t[12]=(c*S-o*$-s*O)*M,t[13]=(n*$-r*S+i*O)*M,t[14]=(v*b-d*x-y*m)*M,t[15]=(l*x-f*b+h*m)*M,t):null}function be(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],c=e[5],s=e[6],u=e[7],l=e[8],f=e[9],h=e[10],p=e[11],d=e[12],v=e[13],y=e[14],g=e[15];return t[0]=c*(h*g-p*y)-f*(s*g-u*y)+v*(s*p-u*h),t[1]=-(r*(h*g-p*y)-f*(i*g-a*y)+v*(i*p-a*h)),t[2]=r*(s*g-u*y)-c*(i*g-a*y)+v*(i*u-a*s),t[3]=-(r*(s*p-u*h)-c*(i*p-a*h)+f*(i*u-a*s)),t[4]=-(o*(h*g-p*y)-l*(s*g-u*y)+d*(s*p-u*h)),t[5]=n*(h*g-p*y)-l*(i*g-a*y)+d*(i*p-a*h),t[6]=-(n*(s*g-u*y)-o*(i*g-a*y)+d*(i*u-a*s)),t[7]=n*(s*p-u*h)-o*(i*p-a*h)+l*(i*u-a*s),t[8]=o*(f*g-p*v)-l*(c*g-u*v)+d*(c*p-u*f),t[9]=-(n*(f*g-p*v)-l*(r*g-a*v)+d*(r*p-a*f)),t[10]=n*(c*g-u*v)-o*(r*g-a*v)+d*(r*u-a*c),t[11]=-(n*(c*p-u*f)-o*(r*p-a*f)+l*(r*u-a*c)),t[12]=-(o*(f*y-h*v)-l*(c*y-s*v)+d*(c*h-s*f)),t[13]=n*(f*y-h*v)-l*(r*y-i*v)+d*(r*h-i*f),t[14]=-(n*(c*y-s*v)-o*(r*y-i*v)+d*(r*s-i*c)),t[15]=n*(c*h-s*f)-o*(r*h-i*f)+l*(r*s-i*c),t}function ke(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],c=t[6],s=t[7],u=t[8],l=t[9],f=t[10],h=t[11],p=t[12],d=t[13],v=t[14],y=t[15];return(e*o-n*a)*(f*y-h*v)-(e*c-r*a)*(l*y-h*d)+(e*s-i*a)*(l*v-f*d)+(n*c-r*o)*(u*y-h*p)-(n*s-i*o)*(u*v-f*p)+(r*s-i*c)*(u*d-l*p)}function xe(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],c=e[4],s=e[5],u=e[6],l=e[7],f=e[8],h=e[9],p=e[10],d=e[11],v=e[12],y=e[13],g=e[14],m=e[15],b=n[0],k=n[1],x=n[2],w=n[3];return t[0]=b*r+k*c+x*f+w*v,t[1]=b*i+k*s+x*h+w*y,t[2]=b*a+k*u+x*p+w*g,t[3]=b*o+k*l+x*d+w*m,b=n[4],k=n[5],x=n[6],w=n[7],t[4]=b*r+k*c+x*f+w*v,t[5]=b*i+k*s+x*h+w*y,t[6]=b*a+k*u+x*p+w*g,t[7]=b*o+k*l+x*d+w*m,b=n[8],k=n[9],x=n[10],w=n[11],t[8]=b*r+k*c+x*f+w*v,t[9]=b*i+k*s+x*h+w*y,t[10]=b*a+k*u+x*p+w*g,t[11]=b*o+k*l+x*d+w*m,b=n[12],k=n[13],x=n[14],w=n[15],t[12]=b*r+k*c+x*f+w*v,t[13]=b*i+k*s+x*h+w*y,t[14]=b*a+k*u+x*p+w*g,t[15]=b*o+k*l+x*d+w*m,t}function we(t,e,n){var r,i,a,o,c,s,u,l,f,h,p,d,v=n[0],y=n[1],g=n[2];return e===t?(t[12]=e[0]*v+e[4]*y+e[8]*g+e[12],t[13]=e[1]*v+e[5]*y+e[9]*g+e[13],t[14]=e[2]*v+e[6]*y+e[10]*g+e[14],t[15]=e[3]*v+e[7]*y+e[11]*g+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],c=e[4],s=e[5],u=e[6],l=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=c,t[5]=s,t[6]=u,t[7]=l,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=r*v+c*y+f*g+e[12],t[13]=i*v+s*y+h*g+e[13],t[14]=a*v+u*y+p*g+e[14],t[15]=o*v+l*y+d*g+e[15]),t}function Pe(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Oe(t,e,n,r){var i,a,o,c,s,u,l,f,h,p,d,v,y,g,m,b,k,x,w,P,O,S,j,$,R=r[0],C=r[1],M=r[2],T=Math.hypot(R,C,M);return T0?(n[0]=2*(c*o+l*r+s*a-u*i)/f,n[1]=2*(s*o+l*i+u*r-c*a)/f,n[2]=2*(u*o+l*a+c*i-s*r)/f):(n[0]=2*(c*o+l*r+s*a-u*i),n[1]=2*(s*o+l*i+u*r-c*a),n[2]=2*(u*o+l*a+c*i-s*r)),Ie(t,e,n),t}function Le(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Be(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],c=e[6],s=e[8],u=e[9],l=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,c),t[2]=Math.hypot(s,u,l),t}function Ae(t,e){var n=new ue(3);Be(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,c=e[1]*i,s=e[2]*a,u=e[4]*r,l=e[5]*i,f=e[6]*a,h=e[8]*r,p=e[9]*i,d=e[10]*a,v=o+l+d,y=0;return v>0?(y=2*Math.sqrt(v+1),t[3]=.25*y,t[0]=(f-p)/y,t[1]=(h-s)/y,t[2]=(c-u)/y):o>l&&o>d?(y=2*Math.sqrt(1+o-l-d),t[3]=(f-p)/y,t[0]=.25*y,t[1]=(c+u)/y,t[2]=(h+s)/y):l>d?(y=2*Math.sqrt(1+l-o-d),t[3]=(h-s)/y,t[0]=(c+u)/y,t[1]=.25*y,t[2]=(f+p)/y):(y=2*Math.sqrt(1+d-o-l),t[3]=(c-u)/y,t[0]=(h+s)/y,t[1]=(f+p)/y,t[2]=.25*y),t}function ze(t,e,n,r){var i=e[0],a=e[1],o=e[2],c=e[3],s=i+i,u=a+a,l=o+o,f=i*s,h=i*u,p=i*l,d=a*u,v=a*l,y=o*l,g=c*s,m=c*u,b=c*l,k=r[0],x=r[1],w=r[2];return t[0]=(1-(d+y))*k,t[1]=(h+b)*k,t[2]=(p-m)*k,t[3]=0,t[4]=(h-b)*x,t[5]=(1-(f+y))*x,t[6]=(v+g)*x,t[7]=0,t[8]=(p+m)*w,t[9]=(v-g)*w,t[10]=(1-(f+d))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Fe(t,e,n,r,i){var a=e[0],o=e[1],c=e[2],s=e[3],u=a+a,l=o+o,f=c+c,h=a*u,p=a*l,d=a*f,v=o*l,y=o*f,g=c*f,m=s*u,b=s*l,k=s*f,x=r[0],w=r[1],P=r[2],O=i[0],S=i[1],j=i[2],$=(1-(v+g))*x,R=(p+k)*x,C=(d-b)*x,M=(p-k)*w,T=(1-(h+g))*w,V=(y+m)*w,E=(d+b)*P,I=(y-m)*P,D=(1-(h+v))*P;return t[0]=$,t[1]=R,t[2]=C,t[3]=0,t[4]=M,t[5]=T,t[6]=V,t[7]=0,t[8]=E,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+O-($*O+M*S+E*j),t[13]=n[1]+S-(R*O+T*S+I*j),t[14]=n[2]+j-(C*O+V*S+D*j),t[15]=1,t}function He(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,c=r+r,s=i+i,u=n*o,l=r*o,f=r*c,h=i*o,p=i*c,d=i*s,v=a*o,y=a*c,g=a*s;return t[0]=1-f-d,t[1]=l+g,t[2]=h-y,t[3]=0,t[4]=l-g,t[5]=1-u-d,t[6]=p+v,t[7]=0,t[8]=h+y,t[9]=p-v,t[10]=1-u-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ge(t,e,n,r,i,a,o){var c=1/(n-e),s=1/(i-r),u=1/(a-o);return t[0]=2*a*c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*s,t[6]=0,t[7]=0,t[8]=(n+e)*c,t[9]=(i+r)*s,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t}function _e(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}function Ne(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),c=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+c),u=2/(i+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-c)*s*.5,t[9]=(i-a)*u*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t}function Xe(t,e,n,r,i,a,o){var c=1/(e-n),s=1/(r-i),u=1/(a-o);return t[0]=-2*c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*c,t[13]=(i+r)*s,t[14]=(o+a)*u,t[15]=1,t}function Ye(t,e,n,r){var i,a,o,c,s,u,l,f,h,p,d=e[0],v=e[1],y=e[2],g=r[0],m=r[1],b=r[2],k=n[0],x=n[1],w=n[2];return Math.abs(d-k)0&&(l*=p=1/Math.sqrt(p),f*=p,h*=p);var d=s*h-u*f,v=u*l-c*h,y=c*f-s*l;return(p=d*d+v*v+y*y)>0&&(d*=p=1/Math.sqrt(p),v*=p,y*=p),t[0]=d,t[1]=v,t[2]=y,t[3]=0,t[4]=f*y-h*v,t[5]=h*d-l*y,t[6]=l*v-f*d,t[7]=0,t[8]=l,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t}function Ue(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function We(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Ze(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function qe(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Je(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Qe(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t}function tn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function en(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],c=t[5],s=t[6],u=t[7],l=t[8],f=t[9],h=t[10],p=t[11],d=t[12],v=t[13],y=t[14],g=t[15],m=e[0],b=e[1],k=e[2],x=e[3],w=e[4],P=e[5],O=e[6],S=e[7],j=e[8],$=e[9],R=e[10],C=e[11],M=e[12],T=e[13],V=e[14],E=e[15];return Math.abs(n-m)<=se*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-b)<=se*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-k)<=se*Math.max(1,Math.abs(i),Math.abs(k))&&Math.abs(a-x)<=se*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=se*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(c-P)<=se*Math.max(1,Math.abs(c),Math.abs(P))&&Math.abs(s-O)<=se*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(u-S)<=se*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(l-j)<=se*Math.max(1,Math.abs(l),Math.abs(j))&&Math.abs(f-$)<=se*Math.max(1,Math.abs(f),Math.abs($))&&Math.abs(h-R)<=se*Math.max(1,Math.abs(h),Math.abs(R))&&Math.abs(p-C)<=se*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(d-M)<=se*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(v-T)<=se*Math.max(1,Math.abs(v),Math.abs(T))&&Math.abs(y-V)<=se*Math.max(1,Math.abs(y),Math.abs(V))&&Math.abs(g-E)<=se*Math.max(1,Math.abs(g),Math.abs(E))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var nn=xe,rn=qe;function an(){var t=new ue(3);return ue!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function on(t){var e=new ue(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function cn(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function sn(t,e,n){var r=new ue(3);return r[0]=t,r[1]=e,r[2]=n,r}function un(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ln(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function fn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function hn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function pn(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function dn(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function vn(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function yn(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function gn(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function mn(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function bn(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function kn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function xn(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function wn(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)}function Pn(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}function On(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function Sn(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function jn(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function $n(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function Rn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Cn(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],c=n[1],s=n[2];return t[0]=i*s-a*c,t[1]=a*o-r*s,t[2]=r*c-i*o,t}function Mn(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function Tn(t,e,n,r,i,a){var o=a*a,c=o*(2*a-3)+1,s=o*(a-2)+a,u=o*(a-1),l=o*(3-2*a);return t[0]=e[0]*c+n[0]*s+r[0]*u+i[0]*l,t[1]=e[1]*c+n[1]*s+r[1]*u+i[1]*l,t[2]=e[2]*c+n[2]*s+r[2]*u+i[2]*l,t}function Vn(t,e,n,r,i,a){var o=1-a,c=o*o,s=a*a,u=c*o,l=3*a*c,f=3*s*o,h=s*a;return t[0]=e[0]*u+n[0]*l+r[0]*f+i[0]*h,t[1]=e[1]*u+n[1]*l+r[1]*f+i[1]*h,t[2]=e[2]*u+n[2]*l+r[2]*f+i[2]*h,t}function En(t,e){e=e||1;var n=2*le()*Math.PI,r=2*le()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t}function In(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function Dn(t,e,n){var r=e[0],i=e[1],a=e[2];return t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8],t}function Ln(t,e,n){var r=n[0],i=n[1],a=n[2],o=n[3],c=e[0],s=e[1],u=e[2],l=i*u-a*s,f=a*c-r*u,h=r*s-i*c,p=i*h-a*f,d=a*l-r*h,v=r*f-i*l,y=2*o;return l*=y,f*=y,h*=y,p*=2,d*=2,v*=2,t[0]=c+l+p,t[1]=s+f+d,t[2]=u+h+v,t}function Bn(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function An(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function zn(t,e,n,r){var i=[],a=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t}function Fn(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],c=e[2],s=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(a*a+o*o+c*c),u=s&&Rn(t,e)/s;return Math.acos(Math.min(Math.max(u,-1),1))}function Hn(t){return t[0]=0,t[1]=0,t[2]=0,t}function Gn(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function _n(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Nn(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],c=e[2];return Math.abs(n-a)<=se*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=se*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-c)<=se*Math.max(1,Math.abs(i),Math.abs(c))}var Xn,Yn=hn,Kn=pn,Un=dn,Wn=wn,Zn=Pn,qn=cn,Jn=On,Qn=(Xn=an(),function(t,e,n,r,i,a){var o,c;for(e||(e=3),n||(n=0),c=r?Math.min(r*e+n,t.length):t.length,o=n;ose?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),n}function or(t,e){var n=Lr(t,e);return Math.acos(2*n*n-1)}function cr(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],c=n[0],s=n[1],u=n[2],l=n[3];return t[0]=r*l+o*c+i*u-a*s,t[1]=i*l+o*s+a*c-r*u,t[2]=a*l+o*u+r*s-i*c,t[3]=o*l-r*c-i*s-a*u,t}function sr(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],c=Math.sin(n),s=Math.cos(n);return t[0]=r*s+o*c,t[1]=i*s+a*c,t[2]=a*s-i*c,t[3]=o*s-r*c,t}function ur(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],c=Math.sin(n),s=Math.cos(n);return t[0]=r*s-a*c,t[1]=i*s+o*c,t[2]=a*s+r*c,t[3]=o*s-i*c,t}function lr(t,e,n){n*=.5;var r=e[0],i=e[1],a=e[2],o=e[3],c=Math.sin(n),s=Math.cos(n);return t[0]=r*s+i*c,t[1]=i*s-r*c,t[2]=a*s+o*c,t[3]=o*s-a*c,t}function fr(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t}function hr(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=Math.sqrt(n*n+r*r+i*i),c=Math.exp(a),s=o>0?c*Math.sin(o)/o:0;return t[0]=n*s,t[1]=r*s,t[2]=i*s,t[3]=c*Math.cos(o),t}function pr(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=Math.sqrt(n*n+r*r+i*i),c=o>0?Math.atan2(o,a)/o:0;return t[0]=n*c,t[1]=r*c,t[2]=i*c,t[3]=.5*Math.log(n*n+r*r+i*i+a*a),t}function dr(t,e,n){return pr(t,e),Dr(t,t,n),hr(t,t),t}function vr(t,e,n,r){var i,a,o,c,s,u=e[0],l=e[1],f=e[2],h=e[3],p=n[0],d=n[1],v=n[2],y=n[3];return(a=u*p+l*d+f*v+h*y)<0&&(a=-a,p=-p,d=-d,v=-v,y=-y),1-a>se?(i=Math.acos(a),o=Math.sin(i),c=Math.sin((1-r)*i)/o,s=Math.sin(r*i)/o):(c=1-r,s=r),t[0]=c*u+s*p,t[1]=c*l+s*d,t[2]=c*f+s*v,t[3]=c*h+s*y,t}function yr(t){var e=le(),n=le(),r=le(),i=Math.sqrt(1-e),a=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*n),t[1]=i*Math.cos(2*Math.PI*n),t[2]=a*Math.sin(2*Math.PI*r),t[3]=a*Math.cos(2*Math.PI*r),t}function gr(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,c=o?1/o:0;return t[0]=-n*c,t[1]=-r*c,t[2]=-i*c,t[3]=a*c,t}function mr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function br(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*a+o]-e[3*o+a])*n,t[a]=(e[3*a+i]+e[3*i+a])*n,t[o]=(e[3*o+i]+e[3*i+o])*n}return t}function kr(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),o=Math.cos(e),c=Math.sin(n),s=Math.cos(n),u=Math.sin(r),l=Math.cos(r);return t[0]=a*s*l-o*c*u,t[1]=o*c*l+a*s*u,t[2]=o*s*u-a*c*l,t[3]=o*s*l+a*c*u,t}function xr(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var wr,Pr,Or,Sr,jr,$r,Rr,Cr=function(t){var e=new ue(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},Mr=function(t,e,n,r){var i=new ue(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},Tr=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Vr=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Er=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},Ir=cr,Dr=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},Lr=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},Br=function(t,e,n,r){var i=e[0],a=e[1],o=e[2],c=e[3];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t[3]=c+r*(n[3]-c),t},Ar=tr,zr=Ar,Fr=er,Hr=Fr,Gr=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t},_r=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]},Nr=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=e[0],c=e[1],s=e[2],u=e[3];return Math.abs(n-o)<=se*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-c)<=se*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(i-s)<=se*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-u)<=se*Math.max(1,Math.abs(a),Math.abs(u))},Xr=(wr=an(),Pr=sn(1,0,0),Or=sn(0,1,0),function(t,e,n){var r=Rn(e,n);return r<-.999999?(Cn(wr,Pr,e),qn(wr)<1e-6&&Cn(wr,Or,e),$n(wr,wr),ir(t,wr,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Cn(wr,e,n),t[0]=wr[0],t[1]=wr[1],t[2]=wr[2],t[3]=1+r,Gr(t,t))}),Yr=(Sr=nr(),jr=nr(),function(t,e,n,r,i,a){return vr(Sr,e,i,a),vr(jr,n,r,a),vr(t,Sr,jr,2*a*(1-a)),t}),Kr=($r=new ue(9),ue!=Float32Array&&($r[1]=0,$r[2]=0,$r[3]=0,$r[5]=0,$r[6]=0,$r[7]=0),$r[0]=1,$r[4]=1,$r[8]=1,Rr=$r,function(t,e,n,r){return Rr[0]=n[0],Rr[3]=n[1],Rr[6]=n[2],Rr[1]=r[0],Rr[4]=r[1],Rr[7]=r[2],Rr[2]=-e[0],Rr[5]=-e[1],Rr[8]=-e[2],Gr(t,br(t,Rr))});function Ur(){var t=new ue(2);return ue!=Float32Array&&(t[0]=0,t[1]=0),t}function Wr(t){var e=new ue(2);return e[0]=t[0],e[1]=t[1],e}function Zr(t,e){var n=new ue(2);return n[0]=t,n[1]=e,n}function qr(t,e){return t[0]=e[0],t[1]=e[1],t}function Jr(t,e,n){return t[0]=e,t[1]=n,t}function Qr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function ti(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function ei(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function ni(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function ri(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function ii(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function ai(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function oi(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function ci(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function si(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function ui(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function li(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function fi(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function hi(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function pi(t){var e=t[0],n=t[1];return e*e+n*n}function di(t,e){return t[0]=-e[0],t[1]=-e[1],t}function vi(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function yi(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function gi(t,e){return t[0]*e[0]+t[1]*e[1]}function mi(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function bi(t,e,n,r){var i=e[0],a=e[1];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t}function ki(t,e){e=e||1;var n=2*le()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function xi(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function wi(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function Pi(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function Oi(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}function Si(t,e,n,r){var i=e[0]-n[0],a=e[1]-n[1],o=Math.sin(r),c=Math.cos(r);return t[0]=i*c-a*o+n[0],t[1]=i*o+a*c+n[1],t}function ji(t,e){var n=t[0],r=t[1],i=e[0],a=e[1],o=Math.sqrt(n*n+r*r)*Math.sqrt(i*i+a*a),c=o&&(n*i+r*a)/o;return Math.acos(Math.min(Math.max(c,-1),1))}function $i(t){return t[0]=0,t[1]=0,t}function Ri(t){return"vec2("+t[0]+", "+t[1]+")"}function Ci(t,e){return t[0]===e[0]&&t[1]===e[1]}function Mi(t,e){var n=t[0],r=t[1],i=e[0],a=e[1];return Math.abs(n-i)<=se*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=se*Math.max(1,Math.abs(r),Math.abs(a))}var Ti=hi,Vi=ti,Ei=ei,Ii=ni,Di=li,Li=fi,Bi=pi,Ai=function(){var t=Ur();return function(e,n,r,i,a,o){var c,s;for(n||(n=2),r||(r=0),s=i?Math.min(i*n+r,e.length):e.length,c=r;c1&&void 0!==arguments[1]?arguments[1]:1;return 0===t?0:t/e}function Gi(t){var e=t*(180/Math.PI);return e<0&&(e=360+e),e}function _i(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n+e*Math.cos(Fi(t))}function Ni(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n+e*Math.sin(Fi(t))}function Xi(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x:_i(t,e,n),y:Ni(t,e,r)}}function Yi(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return o.distance([t,e],[n,r])}function Ki(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return i.lerp([],t,e,1+n/i.dist(t,e))}function Ui(t,e){return 1===t.length?[i.transformMat4([],t[0],e)]:2===t.length?[i.transformMat4([],t[0],e),i.transformMat4([],t[1],e)]:3===t.length?[i.transformMat4([],t[0],e),i.transformMat4([],t[1],e),i.transformMat4([],t[2],e)]:4===t.length?[i.transformMat4([],t[0],e),i.transformMat4([],t[1],e),i.transformMat4([],t[2],e),i.transformMat4([],t[3],e)]:5===t.length?[i.transformMat4([],t[0],e),i.transformMat4([],t[1],e),i.transformMat4([],t[2],e),i.transformMat4([],t[3],e),i.transformMat4([],t[4],e)]:t.map((function(t){return i.transformMat4([],t,e)}))}function Wi(t,e,n,r){return[t,[e[0],t[1],e[2]],n,Math.abs(t[0]-e[0]),r]}function Zi(t,e,n,r){return[[e[0],t[1],t[2]],e,n,Math.abs(t[1]-e[1]),r]}function qi(t,e){var n=t,r=e,a=!1;t[4][0]-e[4][0]>0&&(n=e,r=t,a=!0);var o=i.lerp([],n[1],n[2],.5),c=i.lerp([],r[0],r[3],.5),s=[];return r[0][1]<=o[1]&&o[1]<=r[3][1]?s.push(Wi(o,c,"x",null)):r[0][1]<=n[1][1]?r[3][0]<=n[1][0]&&n[1][0]<=r[2][0]?s.push(Zi(r[3],[r[3][0],n[1][1],n[1][2]],"y",null)):s.push(Wi(n[1],c,"x",r[3])):n[3][0]<=r[0][0]&&r[0][0]<=n[2][0]?s.push(Zi(n[3],r[0],"y")):r[3][0]<=n[0][0]&&n[0][0]<=r[2][0]?s.push(Zi([r[0][0],n[3][1],n[3][2]],r[0],"y")):r[3][0]<=n[1][0]&&n[1][0]<=r[2][0]?s.push(Zi(r[3],[r[3][0],n[1][1],n[1][2]],"y")):s.push(Wi(n[2],c,"x",r[0])),s.sort((function(t,e){return t[3]-e[3]})),function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!1===e)return t;var n=zt()(t,7),r=n[0],i=n[1],a=n[2],o=n[3],c=n[4],s=n[5],u=n[6];return c?[[i[0],c[1],i[2]],[r[0],c[1],r[2]],a,o,[r[0],r[1],c[2]],s,u,e]:[i,r,a,o,c,s,u,e]}([].concat(ce()(s[0]),[t,e]),a)}function Ji(t){var e=Number.MIN_SAFE_INTEGER;return t.forEach((function(t){e=Math.max(t[0],e)})),e}function Qi(t){var e=Number.MIN_SAFE_INTEGER;return t.forEach((function(t){e=Math.max(t[1],e)})),e}function ta(t){var e=Number.MAX_SAFE_INTEGER;return t.forEach((function(t){e=Math.min(t[0],e)})),e}function ea(t){var e=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER;return t.forEach((function(t){e=Math.min(t[0],e),n=Math.max(t[0],n)})),Math.round((e+n)/2)}function na(t){var e=Number.MAX_SAFE_INTEGER;return t.forEach((function(t){e=Math.min(t[1],e)})),e}function ra(t){var e=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER;return t.forEach((function(t){e=Math.min(t[1],e),n=Math.max(t[1],n)})),Math.round((e+n)/2)}function ia(t,e){return Gi(Math.atan2(e,t))}function aa(t,e,n){return ua({x:t[0],y:t[1]},{x:e[0],y:e[1]},{dx:n[0],dy:n[1]})}function oa(t,e){var n=r.create();return r.translate(n,n,e),r.rotateZ(n,n,Fi(t)),r.translate(n,n,i.negate([],e)),n}function ca(){for(var t=r.create(),e=arguments.length,n=new Array(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(O()(this,t),this.value=e,Qt(this.value)&&isNaN(this.value))throw new Error("NaN is not able to set");this.unit=n}return j()(t,[{key:Symbol.toPrimitive,value:function(t){return"number"==t?this.value:this.toString()}},{key:"toString",value:function(){switch(this.unit){case"string":case"number":return this.value+"";case"var":return"var(--".concat(this.value,")");case"calc":return"calc(".concat(this.value,")");default:return this.value+this.unit}}},{key:"isUnitType",value:function(t){return this.unit===t}},{key:"isCalc",value:function(){return this.isUnitType("calc")}},{key:"isFr",value:function(){return this.isUnitType("fr")}},{key:"isPercent",value:function(){return this.isUnitType("%")}},{key:"isPx",value:function(){return this.isUnitType("px")}},{key:"isEm",value:function(){return this.isUnitType("em")}},{key:"isDeg",value:function(){return this.isUnitType("deg")}},{key:"isRad",value:function(){return this.isUnitType("rad")}},{key:"isTurn",value:function(){return this.isUnitType("turn")}},{key:"isSecond",value:function(){return this.isUnitType("s")}},{key:"isMs",value:function(){return this.isUnitType("ms")}},{key:"isNumber",value:function(){return this.isUnitType("number")}},{key:"isString",value:function(){return this.isUnitType("")}},{key:"isVar",value:function(){return this.isUnitType("--")}},{key:"isNaN",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){return Qt(this.value)&&isNaN(this.value)}))},{key:"set",value:function(t){return this.value=t,this}},{key:"add",value:function(t){return this.value+=+t,this}},{key:"sub",value:function(t){return this.add(-1*t)}},{key:"mul",value:function(t){return this.value*=+t,this}},{key:"div",value:function(t){return this.value/=+t,this}},{key:"mod",value:function(t){return this.value%=+t,this}},{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"getUnitName",value:function(){return"%"===this.unit?"percent":this.unit}},{key:"toJSON",value:function(){return this.toString()}},{key:"rate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this.value/t}},{key:"stringToPercent",value:function(){return Ut(wa[this.value])?t.percent(wa[this.value]):t.percent(0)}},{key:"stringToEm",value:function(t){return this.stringToPercent().toEm(t)}},{key:"stringToPx",value:function(t){return this.stringToPercent().toPx(t)}},{key:"toPercent",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return this.isPercent()?this.clone():this.isPx()?t.percent(100*this.value/e):this.isEm()?t.percent(this.value*n*100/e):this.isString()?this.stringToPercent(e):this.isDeg()?t.percent(this.value/360*100):void 0}},{key:"toEm",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return this.isPercent()?t.em(this.value/100*e/n):this.isPx()?t.em(this.value/n):this.isEm()?this.clone():this.isString()?this.stringToEm(e):void 0}},{key:"toPx",value:function(e){return this.isPercent()?t.px(this.value/100*e):this.isPx()?this.clone():this.isEm()?t.px(this.value/100*e/16):this.isString()?this.stringToPx(e):void 0}},{key:"toDeg",value:function(){return this.isDeg()?this.clone():this.isTurn()?t.deg(360*this.value):this.isRad()?t.deg(Gi(this.value)):void 0}},{key:"toRad",value:function(){if(this.isRad())return this.clone();if(this.isTurn()){var e=this.toDeg();return t.rad(Fi(e.value))}return this.isDeg()?t.rad(Fi(this.value)):void 0}},{key:"toTurn",value:function(){return this.isTurn()?this.clone():this.isDeg()?t.turn(this.value/360):void 0}},{key:"toSecond",value:function(){return this.isSecond()?this:this.isMs()?t.second(this.value/1e3):void 0}},{key:"toMs",value:function(){return this.isSecond()?t.ms(1e3*this.value):this.isMs()?this:void 0}},{key:"to",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16;return"px"===t?this.toPx(e,n):"%"===t||"percent"===t?this.toPercent(e,n):"em"===t?this.toEm(e,n):"deg"===t?this.toDeg():"turn"===t?this.toTurn():void 0}},{key:"toUnit",value:function(e){return new t(this.value,e)}},{key:"calculate",value:function(t,e){var n=this[t];return n?n.call(this,e):this}},{key:"includes",value:function(){for(var t=arguments.length,e=new Array(t),n=0;ne[i].value&&(r=e[i]);return r}},{key:"max",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:Ma,n=[],r=t.layers.length,i=r;i--;){var a=t.layers[i];n.push.apply(n,ce()(Ta(a.ref,e)))}return e(t)&&n.push(t),n}var Va=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return O()(this,t),this.ref=new Proxy(this,{get:function(t,e){var n=t[e];return Jt(n)?function(){for(var e=arguments.length,r=new Array(e),i=0;i0&&void 0!==arguments[0]?arguments[0]:"";return this.json.id+t}},{key:"is",value:function(t){return!!this.json&&t===this.json.itemType}},{key:"isNot",value:function(t){return!1===this.is(t)}},{key:"isSVG",value:function(){return!1}},{key:"addCache",value:function(t,e){this.cachedValue[t]=e}},{key:"getCache",value:function(t){return this.cachedValue[t]}},{key:"computed",value:function(t,e){var n="__cachedKey_".concat(t),r="".concat(n,"__parseValue"),i=this.json[t];return this.getCache(t)===i&&this.getCache(r)||(this.addCache(t,i),this.addCache(r,e(i,this.ref))),this.getCache(r)}},{key:"editable",value:function(t){return!0}},{key:"generateListNumber",value:function(){this.layers.forEach((function(t,e){t.no=e,t.generateListNumber()}))}},{key:"convert",value:function(t){var e=this;return t.layers&&t.layers.forEach((function(t){t.parent=e.ref})),t}},{key:"setCache",value:function(){}},{key:"toCloneObject",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.attrs("itemType","name","elementType","type","visible","lock","selected");return t&&(e.layers=this.json.layers.map((function(e){return e.clone(t)}))),e}},{key:"clone",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.constructor,n=new e(this.toCloneObject(t));return n.setParent(this.json.parent),n}},{key:"reset",value:function(t){return t.__changedId||(t.__changedId=ha()),this.lastChangedField.__changedId!==t.__changedId&&(this.json=this.convert(Object.assign(this.json,t)),this.lastChangedField=t,this.lastChangedFieldKeys=Object.keys(t),this.changed()),!0}},{key:"hasChangedField",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=pa();return Ca({id:e,_timestamp:Date.now(),_time:performance.now(),visible:!0,lock:!1,selected:!1,layers:[]},t)}},{key:"attrs",value:function(){for(var t=this,e={},n=arguments.length,r=new Array(n),i=0;i0}},{key:"appendChildItem",value:function(t){return t.parent===this.ref||(this.resetMatrix(t),t.parent&&t.remove(),t.setParent(this.ref),this.json.layers.push(t),this.project.addIndexItem(t)),t}},{key:"prependChildItem",value:function(t){return this.resetMatrix(t),t.parent&&t.remove(),t.setParent(this.ref),this.json.layers.unshift(t),this.project.addIndexItem(t),t}},{key:"resetMatrix",value:function(t){}},{key:"refreshMatrixCache",value:function(){}},{key:"insertChildItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.resetMatrix(t),t.parent&&t.remove(),t.setParent(this.ref),this.json.layers.splice(e,0,t),this.project.addIndexItem(t),t}},{key:"appendAfter",value:function(t){var e=this.parent.findIndex(this);return this.parent.insertChildItem(t,e),this.project.addIndexItem(t),t}},{key:"appendBefore",value:function(t){var e=this.parent.findIndex(this);return this.parent.insertChildItem(t,e-1),this.project.addIndexItem(t),t}},{key:"setPositionInPlace",value:function(t,e){this.layers.splice(t,0,e)}},{key:"toggle",value:function(t,e){Kt(e)?this.json[t]=!this.json[t]:this.json[t]=!!e}},{key:"isTreeItemHide",value:function(){var t=this.parent,e=[];do{if(t.is("project"))break;e.push(Boolean(t.collapsed)),t=t.parent}while(t);return Boolean(e.filter(Boolean).length)}},{key:"expectJSON",value:function(t){return"parent"!==t&&!Kt(this.json[t])}},{key:"toJSON",value:function(){var t=this,e=this.json,n={};return Object.keys(e).filter((function(e){return t.expectJSON(e)})).forEach((function(t){n[t]=e[t]})),n}},{key:"resize",value:function(){}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.json.parent.copyItem(this.ref,t)}},{key:"findIndex",value:function(t){return this.json.layers.indexOf(t.ref)}},{key:"copyItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=t.clone();n.renameWithCount(),n.move([e,e,0]);var r=this.findIndex(t);return r>-1&&(this.json.layers.push(n),this.project.addIndexItem(n)),n}},{key:"remove",value:function(){this.json.parent.removeItem(this.ref),this.project.removeIndexItem(this.ref)}},{key:"removeItem",value:function(t){var e=this.findIndex(t);e>-1&&this.json.layers.splice(e,1)}},{key:"hasParent",value:function(t){var e=this.json.parent.id===t;return e||!1!==this.json.parent.is("project")?e:this.json.parent.hasParent(t)}},{key:"searchById",value:function(t){if(this.id===t)return e.addIndexItem(this.ref),this.ref;for(var e=this.project,n=0,r=this.layers.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=[];r.push.apply(r,Object.keys(e)),r.push.apply(r,Object.keys(n));for(var i=ce()(new Set(r)),a=0,o=i.length;a1&&void 0!==arguments[1]?arguments[1]:"http://www.w3.org/2000/svg";return Object.keys(t).forEach((function(r){e.attr(r,t[r],n)})),this}},{key:"setProp",value:function(t){var e=this;return Object.keys(t).forEach((function(n){e.el[n]!=t[n]&&(e.el[n]=t[n])})),this}},{key:"data",value:function(t,e){return 1===arguments.length?this.attr("data-"+t):2===arguments.length?this.attr("data-"+t,e):this}},{key:"attr",value:function(t,e){return 1==arguments.length?this.el.getAttribute(t):(this.el.getAttribute(t)!=e&&this.el.setAttribute(t,e),this)}},{key:"attrNS",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"http://www.w3.org/2000/svg";return 1==arguments.length?this.el.getAttributeNS(n,t):(this.el.getAttributeNS(n,t)!=e&&this.el.setAttributeNS(n,t,e),this)}},{key:"attrKeyValue",value:function(t){return w()({},this.el.getAttribute(t),this.val())}},{key:"attrs",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:"div";Ya(this,t.create(n).html(e))}},{key:"updateSVGDiff",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"div";Ya(this,t.create(n).html("".concat(e,"")).firstChild.firstChild)}},{key:"find",value:function(t){return this.el.querySelector(t)}},{key:"$",value:function(e){var n=this.find(e);return n?t.create(n):null}},{key:"findAll",value:function(t){return ce()(this.el.querySelectorAll(t))}},{key:"$$",value:function(e){return this.findAll(e).map((function(e){return t.create(e)}))}},{key:"empty",value:function(){for(;this.el.firstChild;)this.el.removeChild(this.el.firstChild);return this}},{key:"append",value:function(t){return"string"==typeof t?this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t.el||t),this}},{key:"prepend",value:function(t){return"string"==typeof t?this.el.prepend(document.createTextNode(t)):this.el.prepend(t.el||t),this}},{key:"prependHTML",value:function(e){var n=t.create("div").html(e);return this.prepend(n.createChildrenFragment()),n}},{key:"appendHTML",value:function(e){var n=t.create("div").html(e);return this.append(n.createChildrenFragment()),n}},{key:"createChildrenFragment",value:function(){var t=this.children(),e=document.createDocumentFragment();return t.forEach((function(t){return e.appendChild(t.el)})),e}},{key:"appendTo",value:function(t){return(t.el?t.el:t).appendChild(this.el),this}},{key:"remove",value:function(){return this.el.parentNode&&this.el.parentNode.removeChild(this.el),this}},{key:"removeChild",value:function(t){return this.el.removeChild(t.el||t),this}},{key:"text",value:function(e){if(void 0===e)return this.el.textContent;var n=e;return e instanceof t&&(n=e.text()),this.el.textContent!==n&&(this.el.textContent=n),this}},{key:"css",value:function(t,e){var n=this;if(void 0!==t&&void 0!==e)0===t.indexOf("--")&&void 0!==e?this.el.style.setProperty(t,e):this.el.style[t]=e;else if(void 0!==t){if("string"==typeof t)return getComputedStyle(this.el)[t];Object.entries(t).forEach((function(t){var e=zt()(t,2),r=e[0],i=e[1];0===r.indexOf("--")&&void 0!==i?n.el.style.setProperty(r,i):n.el.style[r]=i}))}return this}},{key:"getComputedStyle",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){for(var t=getComputedStyle(this.el),e={},n=arguments.length,r=new Array(n),i=0;i0&&void 0!==arguments[0]?arguments[0]:"block";return this.el.style.display="none"!=t?t:"block",this}},{key:"hide",value:function(){return this.el.style.display="none",this}},{key:"isHide",value:function(){return"none"===this.el.style.display}},{key:"isShow",value:function(){return!this.isHide()}},{key:"toggle",value:function(t){var e=this.isHide();return 1==arguments.length?t?this.show():this.hide():e?this.show():this.hide()}},{key:"totalLength",get:function(){return this.el.getTotalLength()}},{key:"scrollIntoView",value:function(){this.el.scrollIntoView()}},{key:"addScrollLeft",value:function(t){return this.el.scrollLeft+=t,this}},{key:"addScrollTop",value:function(t){return this.el.scrollTop+=t,this}},{key:"setScrollTop",value:function(t){return this.el.scrollTop=t,this}},{key:"setScrollLeft",value:function(t){return this.el.scrollLeft=t,this}},{key:"scrollTop",value:function(){return this.el===document.body?t.getScrollTop():this.el.scrollTop}},{key:"scrollLeft",value:function(){return this.el===document.body?t.getScrollLeft():this.el.scrollLeft}},{key:"scrollHeight",value:function(){return this.el.scrollHeight}},{key:"scrollWidth",value:function(){return this.el.scrollWidth}},{key:"on",value:function(t,e,n,r){return this.el.addEventListener(t,e,n,r),this}},{key:"off",value:function(t,e){return this.el.removeEventListener(t,e),this}},{key:"getElement",value:function(){return this.el}},{key:"createChild",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=t.create(e,n,r);return a.css(i),this.append(a),a}},{key:"firstChild",get:function(){return t.create(this.el.firstElementChild)}},{key:"children",value:function(){var e=this.el.firstElementChild;if(!e)return[];var n=[];do{n.push(t.create(e)),e=e.nextElementSibling}while(e);return n}},{key:"childLength",value:function(){return this.el.children.length}},{key:"replace",value:function(t){return this.el.parentNode&&this.el.parentNode.replaceChild(t.el||t,this.el),this}},{key:"replaceChild",value:function(t,e){return this.el.replaceChild(e.el||e,t.el||t),this}},{key:"checked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 0==arguments.length?!!this.el.checked:(this.el.checked=!!t,this)}},{key:"click",value:function(){return this.el.click(),this}},{key:"focus",value:function(){return this.el.focus(),this}},{key:"select",value:function(){if("true"===this.attr("contenteditable")){var t=document.createRange();t.selectNodeContents(this.el);var e=window.getSelection();e.removeAllRanges(),e.addRange(t)}else this.el.select();return this}},{key:"blur",value:function(){return this.el.blur(),this}},{key:"context",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"2d";return this._initContext||(this._initContext=this.el.getContext(t)),this._initContext}},{key:"resize",value:function(t){var e=t.width,n=t.height;this._initContext=null;var r=this.context(),i=window.devicePixelRatio||1;this.px("width",+e),this.px("height",+n),this.el.width=e*i,this.el.height=n*i,r.scale(i,i)}},{key:"toDataURL",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.el.toDataURL(t,e)}},{key:"clear",value:function(){this.context().clearRect(0,0,this.el.width,this.el.height)}},{key:"update",value:function(t){this.clear(),t.call(this,this)}},{key:"drawImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.context(),i=window.devicePixelRatio||1;r.drawImage(t,e,n,t.width,t.height,0,0,this.el.width/i,this.el.height/i)}},{key:"drawOption",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.context();Object.assign(e,t)}},{key:"drawLine",value:function(t,e,n,r){var i=this.context();i.beginPath(),i.moveTo(t,e),i.lineTo(n,r),i.stroke(),i.closePath()}},{key:"drawPath",value:function(){var t=this.context();t.beginPath();for(var e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};O()(this,t),this.context=e,this.options=n}return j()(t,[{key:"initialize",value:function(){}},{key:"load",value:function(){}},{key:"refresh",value:function(){}},{key:"render",value:function(){}},{key:"getRef",value:function(t){return this.context.getRef(t)}},{key:"run",value:function(){}},{key:"destroy",value:function(){}}]),t}();function Wa(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Za={touchstart:!0,touchmove:!0,mousedown:!0,mouseup:!0,mousemove:!0},qa={doubletab:"touchend"},Ja={doubletab:!0},Qa=function(t){R()(n,t);var e=Wa(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"initialize",value:function(){var t=this;this.destroy(),this._domEvents||(this._domEvents=this.context.filterProps(I)),this._domEvents.forEach((function(e){return t.parseDomEvent(e)}))}},{key:"destroy",value:function(){this.removeEventAll()}},{key:"removeEventAll",value:function(){var t=this;this.getBindings().forEach((function(e){t.removeDomEvent(e)})),this.initBindings()}},{key:"removeDomEvent",value:function(t){var e=t.eventName,n=t.dom,r=t.callback;Bt.removeDomEvent(n,e,r)}},{key:"getBindings",value:function(){return this._bindings||this.initBindings(),this._bindings}},{key:"addBinding",value:function(t){this.getBindings().push(t)}},{key:"initBindings",value:function(){this._bindings=[]}},{key:"matchPath",value:function(t,e){return t?t.matches(e)?t:this.matchPath(t.parentElement,e):null}},{key:"hasDelegate",value:function(t,e){return this.matchPath(t.target||t.srcElement,e.delegate)}},{key:"makeCallback",value:function(t,e){return t.delegate?this.makeDelegateCallback(t,e):this.makeDefaultCallback(t,e)}},{key:"makeDefaultCallback",value:function(t,e){var n=this;return function(r){var i=n.runEventCallback(r,t,e);if(Ut(i))return i}}},{key:"makeDelegateCallback",value:function(t,e){var n=this;return function(r){var i=n.hasDelegate(r,t);if(i){r.$dt=Ka.create(i);var a=n.runEventCallback(r,t,e);if(Ut(a))return a}}}},{key:"runEventCallback",value:function(t,e,n){var r=this.context;if(t.xy=Bt.posXY(t),e.beforeMethods.length&&e.beforeMethods.every((function(e){return r[e.target].call(r,t,e.param)})),this.checkEventType(t,e)){var i=n(t,t.$dt,t.xy);return!1!==i&&e.afterMethods.length&&e.afterMethods.forEach((function(e){return r[e.target].call(r,t,e.param)})),i}}},{key:"checkEventType",value:function(t,e){var n=this.context,r=!0;e.codes.length&&(r=!!t.code&&e.codes.indexOf(t.code.toLowerCase())>-1||!!t.key&&e.codes.indexOf(t.key.toLowerCase())>-1);var i=!0;return e.checkMethodList.length&&(i=e.checkMethodList.every((function(e){var r=n[e];return Jt(r)&&r?r.call(n,t):!Ut(r)||!!r}))),r&&i}},{key:"getDefaultDomElement",value:function(t){var e,n=this.context;return(e=t?n.refs[t]||n[t]||window[t]:n.el||n.$el||n.$root)instanceof Ka?e.getElement():e}},{key:"getRealEventName",value:function(t){return qa[t]||t}},{key:"getCustomEventName",value:function(t){return Ja[t]?t:""}},{key:"getDefaultEventObject",value:function(t,e){var n=this.context,r=e,i=r.filter((function(t){return!!n[t]})),a=ae(r,"after"),o=zt()(a,2),c=o[0],s=o[1],u=ae(r,"before"),l=zt()(u,2),f=l[0],h=l[1],p=ae(r,"debounce"),d=zt()(p,2),v=d[0],y=d[1],g=ae(r,"delay"),m=zt()(g,2),b=m[0],k=m[1],x=ae(r,"throttle"),w=zt()(x,2),P=w[0],O=w[1],S=ae(r,"capture"),j=zt()(S,1)[0],$=[].concat(ce()(i),ce()(c),ce()(f),ce()(b),ce()(v),ce()(P),ce()(j)),R=r.filter((function(t){return-1===$.indexOf(t)})).map((function(t){return t.toLowerCase()}));return{eventName:this.getRealEventName(t),customEventName:this.getCustomEventName(t),codes:R,captures:j,afterMethods:s,beforeMethods:h,delayMethods:k,debounceMethods:y,throttleMethods:O,checkMethodList:i}}},{key:"addDomEvent",value:function(t,e){t.callback=this.makeCallback(t,e),this.addBinding(t);var n=!!t.captures.length;Za[t.eventName]&&(n={passive:!0,capture:n}),Bt.addDomEvent(t.dom,t.eventName,t.callback,n)}},{key:"makeCustomEventCallback",value:function(t,e){var n=this;if("doubletab"===t.customEventName){var r=300;return t.delayMethods.length&&(r=+t.delayMethods[0].target),function(){n.doubleTab?(performance.now()-n.doubleTab.time-1}));i.forEach(function(){var e=La()(Fa.a.mark((function e(r){var i,a,o,c,s,u,l,f,h,p,d,v,y,g,m;return Fa.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.context[r],a=r.split(A),o=zt()(a,2),r=o[0],c=o[1],s=t.getRef(c),u=Et,""!=s&&"string"==typeof s?u=Vt(s):"function"==typeof s&&(u=s),l=r.split("bind ")[1],f=t.context.refs[l],h="function"==typeof u&&u.call(t.context),!f||!h){e.next=16;break}return e.next=11,i.call.apply(i,[t.context].concat(n));case 11:if(p=e.sent){e.next=14;break}return e.abrupt("return");case 14:for(d=Object.keys(p),v=0,y=d.length;v0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(t).forEach((function(e){ro[e]||(ro[e]=t[e])}))}var ao,oo,co,so=/[xy]/g;function uo(){var t=(new Date).getTime();return"xxx12-xx-34xx".replace(so,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}function lo(){var t=(new Date).getTime();return"idxxxxxxx".replace(so,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}function fo(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ho(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){c=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function vo(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:{};this.opt=t||{},this.parent=this.opt,this.props=e,this.source=uo(),this.sourceName=this.constructor.name}},{key:"initComponents",value:function(){this.childComponents=this.components()}},{key:"initializeHandler",value:function(){return[new no(this),new Qa(this)]}},{key:"initState",value:function(){return{}}},{key:"setState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.prevState=this.state,this.state=Object.assign({},this.state,t),e&&this.load()}},{key:"toggleState",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.setState(w()({},t,!this.state[t]),e)}},{key:"variable",value:function(t){var e="".concat("__ref__variable:").concat(lo());return this.__tempVariables.set(e,t),e}},{key:"recoverVariable",value:function(t){if(!1===Zt(t))return t;var e=t;return this.__tempVariables.has(t)&&(e=this.__tempVariables.get(t),this.__tempVariables.delete(t)),e}},{key:"_reload",value:function(t){this.props=t,this.state={},this.setState(this.initState(),!1),this.refresh(!0)}},{key:"render",value:function(t){this.$el=this.parseTemplate(ie(oo||(oo=Aa()(["\n ","\n "])),this.template())),this.refs.$el=this.$el,t&&t.append(this.$el),this.load(),this.afterRender()}},{key:"initialize",value:function(){this.state=this.initState()}},{key:"afterRender",value:function(){}},{key:"components",value:function(){return{}}},{key:"getRef",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n-1})),t.next=5,i.forEach(function(){var t=La()(Fa.a.mark((function t(e){var r,i,o,c,s,u,l,f,h;return Fa.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.split("load ")[1],i=r.split(A).map((function(t){return t.trim()})),o=Ia()(i),c=o[0],s=(s=o.slice(1)).map((function(t){return t.trim()})),u=Boolean(s.filter((function(t){return W.includes(t)})).length),!a.refs[c]){t.next=11;break}return t.next=7,(l=a[e]).call.apply(l,[a].concat(n));case 7:f=t.sent,Array.isArray(f)&&(f=f.join("")),h=a.parseTemplate(ie(co||(co=Aa()(["",""])),f),!0),u?a.refs[c].htmlDiff(h):a.refs[c].html(h);case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 5:this._afterLoad();case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"runHandlers",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"run",e=arguments.length,n=new Array(e>1?e-1:0),r=1;r"}},{key:"eachChildren",value:function(t){Jt(t)&&Xt(this.children,(function(e,n){t(n)}))}},{key:"rerender",value:function(){var t=this.$el.parent();this.destroy(),this.render(t)}},{key:"destroy",value:function(){this.eachChildren((function(t){t.destroy()})),this.runHandlers("destroy"),this.$el&&this.$el.remove(),this.$el=null,this.refs={},this.children={}}},{key:"collectProps",value:function(){return this.__cachedMethodList||(this.__cachedMethodList=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t,r=[];do{var i=n instanceof Object;if(!1===i)break;var a=Object.getOwnPropertyNames(n).filter((function(n){return t&&Jt(t[n])&&!e[n]}));r.push.apply(r,a)}while(n=Object.getPrototypeOf(n));return r}(this,bo)),this.__cachedMethodList}},{key:"filterProps",value:function(t){return this.collectProps().filter((function(e){return e.match(t)}))}},{key:"self",value:function(t){return t&&t.$dt&&t.$dt.is(t.target)}},{key:"isAltKey",value:function(t){return t.altKey}},{key:"isCtrlKey",value:function(t){return t.ctrlKey}},{key:"isShiftKey",value:function(t){return t.shiftKey}},{key:"isMetaKey",value:function(t){return t.metaKey||"Meta"==t.key||t.code.indexOf("Meta")>-1}},{key:"isMouseLeftButton",value:function(t){return 1===t.buttons}},{key:"isMouseRightButton",value:function(t){return 2===t.buttons}},{key:"hasMouse",value:function(t){return"mouse"===t.pointerType}},{key:"hasTouch",value:function(t){return"touch"===t.pointerType}},{key:"hasPen",value:function(t){return"pen"===t.pointerType}},{key:"preventDefault",value:function(t){return t.preventDefault(),!0}},{key:"stopPropagation",value:function(t){return t.stopPropagation(),!0}}]),t}(),xo=function(){function t(e){O()(this,t),this.cachedCallback={},this.callbacks={},this.commandes=[],this.editor=e}return j()(t,[{key:"getCallbacks",value:function(t){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t]}},{key:"setCallbacks",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.callbacks[t]=e}},{key:"debug",value:function(){var t;this.editor&&this.editor.config.get("debug")&&(t=console).debug.apply(t,arguments)}},{key:"on",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5],c=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],u=e;return i>0?u=Gt(e,i):a>0&&(u=_t(e,a)),s.length&&(u=Nt(u,n,s)),this.getCallbacks(t).push({event:t,callback:u,context:n,originalCallback:e,enableAllTrigger:o,enableSelfTrigger:c}),this.debug("add message event",t,n.sourceName),function(){r.off(t,e)}}},{key:"off",value:function(t,e){this.debug("off message event",t),1==arguments.length?this.setCallbacks(t):2==arguments.length&&this.setCallbacks(t,this.getCallbacks(t).filter((function(t){return t.originalCallback!==e})))}},{key:"offAll",value:function(t){var e=this;Object.keys(this.callbacks).forEach((function(n){e.setCallbacks(n,e.getCallbacks(n).filter((function(e){return e.context!==t})))})),this.debug("off all message",t.sourceName)}},{key:"getCachedCallbacks",value:function(t){return this.getCallbacks(t)}},{key:"sendMessage",value:function(t,e){for(var n=this,r=arguments.length,i=new Array(r>2?r-2:0),a=2;a2?n-2:0),i=2;i2?r-2:0),a=2;a1?e-1:0),r=1;r1?e-1:0),r=1;r1e3&&So.clear(),So.set(t,e)}}]),t}(),$o=function(){function t(){O()(this,t)}return j()(t,null,[{key:"parseStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"50% 50% 0%";if(jo.has(t))return jo.get(t);var e=t.trim().split(" ").filter((function(t){return t.trim()})),n=null;return n=1===e.length?[e[0],e[0]].map((function(t){return Sa.parse(t)})):e.map((function(t){return Sa.parse(t)})),jo.set(t,n),n}},{key:"scale",value:function(e,n,r){var i=t.parseStyle(e);return[i[0].toPx(n).value,i[1].toPx(r).value,i[2].value]}},{key:"toPx",value:function(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=t.parseStyle(e),o=zt()(a,3),c=o[0],s=o[1],u=o[2];return c=c.toPx(n),s=s.toPx(r),u=u.toPx(i),"".concat(c," ").concat(s," ").concat(u)}}]),t}();function Ro(t,e,n,r,i,a,o,c){var s=((o-i)*(e-a)-(c-a)*(t-i))/((c-a)*(n-t)-(o-i)*(r-e)),u=((n-t)*(e-a)-(r-e)*(t-i))/((c-a)*(n-t)-(o-i)*(r-e));return 0<=s&&s<=1&&0<=u&&u<=1}function Co(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=t.length;return t.forEach((function(a,o){var c=zt()(a,2),s=c[0],u=c[1],l=zt()(t[(o+1)%i],2),f=l[0],h=l[1];(u>=n&&h=n)&&e<(f-s)*(n-u)/(h-u)+s&&(r=!r)})),r}function Mo(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=t.length;return t.some((function(o,c){var s=zt()(o,2),u=s[0],l=s[1],f=zt()(t[(c+1)%a],2),h=f[0],p=f[1];return Ro(e,n,r,i,u,l,h,p)}))}function To(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t.length;return t.some((function(r,i){var a=zt()(r,2),o=a[0],c=a[1],s=zt()(t[(i+1)%n],2),u=s[0],l=s[1],f=Mo(e,o,c,u,l);return!!f||!!(f=Co(t,e[0][0],e[0][1]))}))}function Vo(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"50% 50% 0px",a=$o.scale(i,n,r);return[[t,e,0],[t+n,e,0],[t+n,e+r,0],[t,e+r,0],[t+a[0],e+a[1],0]]}function Eo(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=i.lerp([],t[0],t[1],.5),r=i.lerp([],t[2],t[3],.5),a=Ki(r,n,e);return a}function Io(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,a=[],o=[];return t.forEach((function(t){t.originVerties.forEach((function(t){a.push(t[0]),o.push(t[1])}))})),e=Math.min.apply(Math,a),r=Math.max.apply(Math,a),n=Math.min.apply(Math,o),i=Math.max.apply(Math,o),e===Number.MAX_SAFE_INTEGER&&(e=0),n===Number.MAX_SAFE_INTEGER&&(n=0),r===Number.MIN_SAFE_INTEGER&&(r=0),i===Number.MIN_SAFE_INTEGER&&(i=0),Vo(e,n,r-e,i-n)}function Do(t){var e=Sa.px(t[0][0]).floor(),n=Sa.px(t[0][1]).floor();return{x:e,left:e,y:n,top:n,width:Sa.px(i.dist(t[0],t[1])).floor(),height:Sa.px(i.dist(t[0],t[3])).floor()}}function Lo(t){return Bo(t).filter((function(t,e){return e<4}))}function Bo(t){var e=Number.MAX_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,i=Number.MIN_SAFE_INTEGER,a=[],o=[];return t.forEach((function(t){a.push(t[0]),o.push(t[1])})),e=Math.min.apply(Math,a),r=Math.max.apply(Math,a),n=Math.min.apply(Math,o),i=Math.max.apply(Math,o),e===Number.MAX_SAFE_INTEGER&&(e=0),n===Number.MAX_SAFE_INTEGER&&(n=0),r===Number.MIN_SAFE_INTEGER&&(r=0),i===Number.MIN_SAFE_INTEGER&&(i=0),Vo(e,n,r-e,i-n)}var Ao={linear:!0,ease:!0,"ease-in":!0,"ease-out":!0,"ease-in-out":!0},zo={ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)"},Fo=[[0,0,1,1,"linear",!0],[.25,.1,.25,1,"ease",!0],[.42,0,1,1,"ease-in",!0],[0,0,.58,1,"ease-out",!0],[.47,0,.745,.715,"ease-in-sine"],[.39,.575,.565,1,"ease-out-sine"],[.445,.05,.55,.95,"ease-in-out-sine"],[.55,.085,.68,.53,"ease-in-quad"],[.25,.46,.45,.94,"ease-out-quad"],[.455,.03,.515,.955,"ease-in-out-quad"],[.55,.055,.675,.19,"ease-in-cubic"],[.215,.61,.355,1,"ease-out-cubic"],[.645,.045,.355,1,"ease-in-out-cubic"],[.895,.03,.685,.22,"ease-in-quart"],[.165,.84,.44,1,"ease-out-quart"],[.77,0,.175,1,"ease-in-out-quart"],[.6,.04,.98,.335,"ease-in-circ"],[.075,.82,.165,1,"ease-out-circ"],[.785,.135,.15,.86,"ease-in-out-circ"],[.95,.05,.795,.035,"ease-in-expo"],[.19,1,.22,1,"ease-out-expo"],[1,0,0,1,"ease-in-out-expo"],[.755,.05,.855,.06,"ease-in-quint"],[.23,1,.32,1,"ease-out-quint"],[.86,0,.07,1,"ease-in-out-quint"],[.6,-.28,.735,.045,"ease-in-back"],[.175,.885,.32,1.275,"ease-out-back"],[.68,-.55,.265,1.55,"ease-in-out-back"]],Ho=function(t){return ce()(_o(zo[t]||t))},Go=function(t){t=t.map((function(t){return Math.floor(100*t)/100}));for(var e=0,n=Fo.length;e8&&void 0!==arguments[8]?arguments[8]:1e3,u=No({x:t,y:e},{x:n,y:r},{x:i,y:a},{x:o,y:c}),l=0,f=u(0),h=0;h<=s;h++){var p=h/s,d=u(p);l+=Yi(f.x,f.y,d.x,d.y),f=d}return l},Wo=function(t,e,n,r,i,a){for(var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1e3,c=Xo({x:t,y:e},{x:n,y:r},{x:i,y:a}),s=0,u=c(0),l=0;l<=o;l++){var f=l/o,h=c(f);s+=Yi(u.x,u.y,h.x,h.y),u=h}return s},Zo=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n={minDist:1/0,minT:0};return function(r,i){for(var a=0;a<=e;a++)Ko(n,t,a/e,r,i);var o=1/(2*e),c=n.minT;for(a=0;a4&&void 0!==arguments[4]?arguments[4]:100;return Zo(No(t,e,n,r),i)},Jo=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;return Zo(Xo(t,e,n),r)},Qo=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return Zo(Yo(t,e),n)},tc=function(t){if("linear"===t)return Yo(n={x:0,y:0},r={x:1,y:1});var e=_o(t),n={x:0,y:0},r={x:e[0],y:e[1]},i={x:e[2],y:e[3]};return No(n,r,i,{x:1,y:1})},ec=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}},nc=function(t,e){var n=ec(t[0],t[1],e),r=ec(t[1],t[2],e),i=ec(t[2],t[3],e),a=ec(n,r,e),o=ec(r,i,e);return ec(a,o,e)},rc=function(t,e){var n=ec(t[0],t[1],e),r=ec(t[1],t[2],e);return ec(n,r,e)},ic=function(t,e){return ec(t[0],t[1],e)},ac=function(t,e){var n=ec(t[0],t[1],e),r=ec(t[1],t[2],e),i=ec(t[2],t[3],e),a=ec(n,r,e),o=ec(r,i,e),c=ec(a,o,e);return{first:[t[0],n,a,c],second:[c,o,i,t[3]]}},oc=function(t,e){var n=ec(t[0],t[1],e),r=ec(t[1],t[2],e),i=ec(n,r,e);return{first:[t[0],n,i],second:[i,r,t[2]]}},cc=function(t,e){var n=ec(t[0],t[1],e);return{first:[t[0],n],second:[n,t[1]]}},sc=function(t){var e=function(t){var e=i.negate([],t[0]),n=i.multiply([],[3,3,3],t[1]),r=i.multiply([],[-3,-3,-3],t[2]),a=t[3],o=i.add([],i.add([],e,n),i.add([],r,a));return i.multiply([],[3,3,3],o)}(t),n=function(t){var e=t[0],n=i.multiply([],[-2,-2,-2],t[1]),r=t[2],a=i.add([],i.add([],e,n),r);return i.multiply([],[6,6,6],a)}(t),r=function(t){var e=i.add([],t[1],i.negate([],t[0]));return i.multiply([],[3,3,3],e)}(t),a=[],o=n[0]*n[0]-4*e[0]*r[0];if(o<0);else if(0===o){var c=-n[0]/(2*e[0]);0<=c&&c<=1&&a.push(c)}else if(o>0){var s=(-n[0]+Math.sqrt(o))/(2*e[0]),u=(-n[0]-Math.sqrt(o))/(2*e[0]);0<=s&&s<=1&&a.push(s),0<=u&&u<=1&&a.push(u)}var l=n[1]*n[1]-4*e[1]*r[1];if(l<0);else if(0===l){var f=-n[1]/(2*e[1]);0<=f&&f<=1&&a.push(f)}else if(l>0){var h=(-n[1]+Math.sqrt(l))/(2*e[1]),p=(-n[1]-Math.sqrt(l))/(2*e[1]);0<=h&&h<=1&&a.push(h),0<=p&&p<=1&&a.push(p)}return a};function uc(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(0, 0, 0, 0)";return Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),"hex"==e?lc(t):"rgb"==e?fc(t,n):"hsl"==e?hc(t):t}function lc(t){Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]});var e=t.r.toString(16);t.r<16&&(e="0"+e);var n=t.g.toString(16);t.g<16&&(n="0"+n);var r=t.b.toString(16);if(t.b<16&&(r="0"+r),1==t.a||void 0===t.a)return"#".concat(e).concat(n).concat(r);var i=Math.ceil(255*t.a),a=i.toString(16);return i<16&&(a="0"+a),"#".concat(e).concat(n).concat(r).concat(a)}function fc(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(0, 0, 0, 0)";if(Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),void 0!==t)return 1==t.a||void 0===t.a?isNaN(t.r)?e:"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")"):"rgba(".concat(t.r,",").concat(t.g,",").concat(t.b,",").concat(t.a,")")}function hc(t){return Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),1==t.a||void 0===t.a?"hsl(".concat(t.h,",").concat(t.s,"%,").concat(t.l,"%)"):"hsla(".concat(t.h,",").concat(t.s,"%,").concat(t.l,"%,").concat(t.a,")")}function pc(t,e){return Math.floor(Math.random()*(e-t+1))+t}function dc(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:"",n=t||{};return Object.keys(n).filter((function(t){return Ut(n[t])})).map((function(t){return"".concat(t,": ").concat(n[t])})).join(";"+e)}function kc(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:";",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:":",r={};return""===(t+="")||t.split(e).forEach((function(t){var e=t.split(n).map((function(t){return t.trim()})),i=Ia()(e),a=i[0],o=i.slice(1);""!=a&&(r[a]=o.join(n))})),r}function xc(t){return Object.keys(t).map((function(e){return"class"===e&&isObject(t[e])?"".concat(e,'="').concat(wc(t[e]),'"'):Wt(t[e])||Kt(t[e])||"undefined"===t[e]?t[e]?e:"":"".concat(e,'="').concat(t[e],'"')})).join(" ")}function wc(t){return Object.keys(t).filter((function(e){return t[e]})).map((function(t){return t})).join(" ")}function Pc(t){return t.replace(/\/g,">")}function Oc(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.map(e).join(n)}function Sc(t,e){var n=new Set([].concat(ce()(t),ce()(e)));return n.size===t.length&&n.size===e.length}var jc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,r=Ho(t);return"\n M0 ".concat(e," \n C \n ").concat(r[0]*e," ").concat(0==r[1]?n:(1-r[1])*n,",\n ").concat(r[2]*e," ").concat(1==r[3]?0:(1-r[3])*n,",\n ").concat(e," 0\n ")},$c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,r=Ho(t);return"\n M 0 ".concat(e," \n L ").concat(r[0]*e," ").concat(0==r[1]?n:(1-r[1])*n,"\n M ").concat(e," 0\n L ").concat(r[2]*e," ").concat(1==r[3]?0:(1-r[3])*n,"\n ")};function Rc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Cc(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return Cc({selected:!1,layers:[]},t)}},{key:"isAttribute",value:function(){return!0}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){return bc(this.toCSS())}}]),n}(Va),Vc=new Map,Ec=function(){function t(){O()(this,t)}return j()(t,null,[{key:"has",value:function(t){return Vc.has(t)}},{key:"get",value:function(t){return Vc.get(t)}},{key:"set",value:function(t,e){Vc.size>1e3&&Vc.clear(),Vc.set(t,e)}}]),t}();function Ic(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dc(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Lc=/((matrix|translate(X|Y|Z|3d)?|scale(X|Y|Z|3d)?|rotate(X|Y|Z|3d)?|skew(X|Y)?|matrix(3d)?|perspective)\(([^\)]*)\))/gi,Bc=function(t){R()(n,t);var e=Dc(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return{itemType:"transform",value:[]}}},{key:"toCloneObject",value:function(){return function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:[];return"string"==typeof e&&(e=[e]),n.filter(t,(function(t){return!1===e.includes(t.type)}))}},{key:"filter",value:function(t,e){return n.join(n.parseStyle(t,!1).filter((function(t){return e(t)})))}},{key:"replace",value:function(t,e){var r=n.parseStyle(t,!1),i=r.find((function(t){return t.type===e.type}));return i?i.value=e.value:r.push(e),n.join(r)}},{key:"replaceAll",value:function(t,e){for(var r=n.parseStyle(t,!1),i=n.parseStyle(e),a=0,o=i.length;a2&&void 0!==arguments[2]?arguments[2]:"rotate",i=n.createRotateKey(t,e,r);return Ec.has(i)||Ec.set(i,n.replace(t,{type:r,value:[e]})),Ec.get(i)}},{key:"rotateZ",value:function(t,e){return n.rotate(t,e,"rotateZ")}},{key:"rotateX",value:function(t,e){return n.rotate(t,e,"rotateX")}},{key:"rotateY",value:function(t,e){return n.rotate(t,e,"rotateY")}},{key:"parseStyle",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=[];if(!t)return r;if(e&&Ec.has(t))return Ec.get(t);var i=t.match(Lc)||[];return i.forEach((function(t,e){var i=t.split("("),a=zt()(i,2),o=a[0],c=a[1],s=(c=c.split(")")[0]).split(",");s=c.includes("matrix")||c.includes("scale")?s.map((function(t){return Sa.number(t.trim())})):s.map((function(t){return Sa.parse(t.trim())})),r[e]=n.parse({type:o,value:s})})),e&&Ec.set(t,r),r}},{key:"createTransformMatrix",value:function(t,e,n){for(var i=r.create(),a=0,o=t.length;a1?c.value[1].toDeg().toRad():l;r.multiply(i,i,r.fromValues(1,Math.tan(f.value),0,0,Math.tan(l.value),1,0,0,0,0,1,0,0,0,0,1));break;case"matrix":s=[(s=c.value)[0].value,s[1].value,0,0,s[2].value,s[3].value,0,0,0,0,1,0,s[4].value,s[5].value,0,1],r.multiply(i,i,s);break;case"matrix3d":s=c.value.map((function(t){return t.value}));r.multiply(i,i,s);break;case"perspective":s=c.value;r.perspective(i,.5*Math.PI,e/n,1,s[0].value)}}return i}},{key:"fromScale",value:function(t){if(1===t[0]&&1===t[1])return"";var e=[];return 1!=t[0]&&e.push("scaleX(".concat(t[0],")")),1!=t[1]&&e.push("scaleY(".concat(t[1],")")),1!=t[2]&&e.push("scaleZ(".concat(t[2],")")),e.join(" ")}}]),n}(Tc),Ac=function(){function t(){O()(this,t)}return j()(t,null,[{key:"isEqual",value:function(e,n,r){return 2===arguments.length?e.x===n.x&&e.y===n.y:3===arguments.length?t.isEqual(e,n)&&t.isEqual(n,r):void 0}},{key:"isFirst",value:function(t){return t&&"M"==t.command}},{key:"DouglasPeuker",value:function(e,n,r,i){if(!(i<=r+1)){for(var a=0,o=r,c=e*e,s=n[r],u=n[i],l=r+1;lc&&(n[o].mark=!0,t.DouglasPeuker(e,n,r,o),t.DouglasPeuker(e,n,o,i))}}},{key:"simply",value:function(e,n){return e.length<=2?e:((e=ee(e))[0].mark=!0,e[e.length-1].mark=!0,t.DouglasPeuker(n,e,0,e.length-1),e.filter((function(t){return Boolean(t.mark)})))}},{key:"segmentDistance2",value:function(t,e,n,r){var i=r.x-n.x,a=r.y-n.y,o=i*i+a*a,c=t-n.x,s=e-n.y,u=i*c+a*s;if(0===o)return c*c+s*s;if(u<=0)return c*c+s*s;if(u>=o)return(c=t-r.x)*c+(s=e-r.y)*s;var l=c*a-s*i;return l*l/o}},{key:"isInLine",value:function(t,e,n){return t.x===n.x?e.x===n.x:t.y===n.y?e.y===n.y:(t.x-n.x)*(t.y-n.y)==(n.x-e.x)*(n.y-e.y)}},{key:"isLine",value:function(e){return t.isInLine(e.endPoint,e.startPoint,e,reversePoint)}},{key:"getReversePoint",value:function(t,e){var n=t.x-e.x,r=t.y-e.y;return{x:t.x+n,y:t.y+r}}},{key:"getIndexPoint",value:function(t,e){return t[e]}},{key:"getPoint",value:function(e,n){return e.filter((function(e){return t.isEqual(e.startPoint,n)}))[0]}},{key:"getIndex",value:function(e,n){for(var r=-1,i=0,a=e.length;i0;r--)if("M"===t[r].command){n=r;break}-1===n&&(n=0);var i=t[n];return i&&(i.index=n),i}},{key:"getConnectedPoint",value:function(t,e){}},{key:"getPrevPoint",value:function(e,n){var r=n-1;if(r<0)return t.getLastPoint(e,n);var i=e[r];return i&&(i.index=r),i}},{key:"getNextPoint",value:function(e,n){var r=e[n],i=e[n+1];return i&&(i.index=n+1),r.connected&&(i=t.getFirstPoint(e,n)),i}},{key:"removePoint",value:function(t,e,n){if("startPoint"===n)return t.filter((function(t,n){return n!==e}))}},{key:"splitPoints",value:function(e){var n=[],r=[];return e.forEach((function(e){t.isFirst(e)?(r=[e],n.push(r)):r.push(e)})),n}},{key:"recoverPoints",value:function(t){var e=[];return t.forEach((function(t){t.forEach((function(t,e){0===e&&(t.command="M",t.originalCommand="M")})),e.push.apply(e,t)})),e.forEach((function(t,e){t.index=e})),e}}]),t}(),zc=/([mMlLvVhHcCsSqQtTaAzZ]([^mMlLvVhHcCsSqQtTaAzZ]*))/g,Fc=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi,Hc=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";O()(this,t),this.reset(e)}return j()(t,[{key:"reset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.segments=[],this.pathString=t,this.parse()}},{key:"resetSegments",value:function(t){this.segments=t||[],this.pathString=this.joinPath()}},{key:"trim",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.match(Fc)||[];return e.filter((function(t){return""!=t}))}},{key:"parse",value:function(){var t=this,e=this.pathString.match(zc)||[];this.segments=e.map((function(e){var n=e[0];return{command:n,values:t.trim(e.replace(n,"")).map((function(t){return+t}))}})),this.segments=this.segments.map((function(e,n){switch(e.command){case"c":case"m":case"l":case"q":case"s":case"t":case"v":case"h":for(var r=t.segments[n-1],i=r.values[r.values.length-2],a=r.values[r.values.length-1],o=0,c=e.values.length;o1&&void 0!==arguments[1]&&arguments[1],r=this.segments.map((function(n,r){return t.call(e,n,r)}));if(n)return r;this.segments=r}},{key:"_loop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.each((function(e){var n=e.values;switch(e.command){case"M":case"L":var r=t(n,0);e.values=[r[0],r[1]];break;case"V":r=t([+n[0],0]);e.values=[r[0]];break;case"H":r=t([0,+n[0]]);e.values=[r[1]];break;case"C":case"S":case"T":case"Q":for(var i=0,a=n.length;i1&&void 0!==arguments[1]&&arguments[1];return this.each((function(e){var n=e.values;switch(e.command){case"M":case"L":var r=i.transformMat4([],[n[0],n[1],0],t);e.values=[r[0],r[1]];break;case"V":r=i.transformMat4([],[+n[0],0,0],t);e.values=[r[0]];break;case"H":r=i.transformMat4([],[0,+n[0],0],t);e.values=[r[1]];break;case"C":case"S":case"T":case"Q":for(var a=0,o=n.length;a0&&void 0!==arguments[0]?arguments[0]:1;return this.each((function(e){return e.values=e.values.map((function(e){return zi(e,t)})),e})),this}},{key:"reverseSegments",value:function(t){for(var e=[],n=t.length-1,r=n;r>0;r--){var i=t[r],a=i.values,o=i.command,c=t[r-1],s=c.values[c.values.length-2],u=c.values[c.values.length-1];switch(o){case"L":r===n&&e.push({command:"M",values:[a[0],a[1]]}),e.push({command:"L",values:[s,u]});break;case"C":r===n&&e.push({command:"M",values:[a[4],a[5]]}),e.push({command:"C",values:[a[2],a[3],a[0],a[1],s,u]});break;case"Q":r===n&&e.push({command:"M",values:[a[2],a[3]]}),e.push({command:"Q",values:[a[0],a[1],s,u]});break;case"Z":e.push(i),n=r-1}}return"Z"===e[0].command&&e.push(e.shift()),e}},{key:"splitSegments",value:function(){var t=[],e=[];return this.segments.forEach((function(n){"M"===n.command?(e=[n],t.push(e)):e.push(n)})),t}},{key:"reverse",value:function(){var t=this,e=this.splitSegments(),n=[];e.forEach((function(e){n.push.apply(n,t.reverseSegments(e))})),this.segments=n}},{key:"verties",get:function(){var t=[],e=[];return this.each((function(n){var r=n.values;switch(n.command){case"M":case"L":t.push([].concat(ce()(n.values),[0]));break;case"V":t.push([r[0],e.pop(),0]);break;case"H":e.pop(),t.push([e.pop(),r[0],0]);break;case"C":case"S":case"T":case"Q":for(var i=0,a=r.length;i0&&void 0!==arguments[0])||arguments[0];return _c(_c({},$a()(V()(n.prototype),"toCloneObject",this).call(this,t)),this.attrs("x","y","width","height","transform","rotate","rotateZ"))}},{key:"convert",value:function(t){return(t=$a()(V()(n.prototype),"convert",this).call(this,t)).x=Sa.parse(t.x),t.y=Sa.parse(t.y),t.width=Sa.parse(t.width),t.height=Sa.parse(t.height),t}},{key:"reset",value:function(t){var e=$a()(V()(n.prototype),"reset",this).call(this,t);return e&&this.hasChangedField("x","y","width","height","transform","rotateZ","rotate","transform-origin","perspective","perspective-origin")&&this.refreshMatrixCache(),e}},{key:"setParent",value:function(t){$a()(V()(n.prototype),"setParent",this).call(this,t),this.refreshMatrixCache()}},{key:"refreshMatrixCache",value:function(){this.setCacheItemTransformMatrix(),this.setCacheLocalTransformMatrix(),this.setCacheAccumulatedMatrix(),this.setCacheLocalVerties(),this.setCacheVerties(),this.setCacheGuideVerties(),this.setCacheAreaPosition(),this.layers.forEach((function(t){t.refreshMatrixCache()}))}},{key:"setCacheItemTransformMatrix",value:function(){this._cachedItemTransform=this.getItemTransformMatrix(),this._cachedItemTransformInverse=r.invert([],this._cachedItemTransform)}},{key:"setCacheLocalTransformMatrix",value:function(){this._cachedLocalTransform=this.getLocalTransformMatrix(),this._cachedLocalTransformInverse=r.invert([],this._cachedLocalTransform),this._cachedTransformWithTranslate=this.getTransformWithTranslate(this),this._cachedTransformWithTranslateInverse=r.invert([],this._cachedTransformWithTranslate),this._cachedTransformWithTranslateTranspose=r.transpose([],this._cachedTransformWithTranslate)}},{key:"setCacheAccumulatedMatrix",value:function(){this._cachedAccumulatedMatrix=this.getAccumulatedMatrix(),this._cachedAccumulatedMatrixInverse=r.invert([],this._cachedAccumulatedMatrix)}},{key:"setCacheVerties",value:function(){this._cachedVerties=this.getVerties(),this._cachedVertiesWithoutTransformOrigin=this.rectVerties()}},{key:"setCacheLocalVerties",value:function(){this._cachedLocalVerties=this.getLocalVerties()}},{key:"setCacheGuideVerties",value:function(){this._cachedGuideVerties=this.getGuideVerties()}},{key:"setCacheAreaPosition",value:function(){this._cachedAreaPosition=this.getAreaPosition()}},{key:"localMatrix",get:function(){return this._cachedLocalTransform||this.getLocalTransformMatrix()}},{key:"localMatrixInverse",get:function(){return this._cachedLocalTransformInverse||this.getLocalTransformMatrixInverse()}},{key:"transformWithTranslate",get:function(){return this._cachedTransformWithTranslate||this.getTransformWithTranslate(this)}},{key:"transformWithTranslateToTranspose",get:function(){return this._cachedTransformWithTranslateTranspose||r.transpose([],this.getTransformWithTranslate(this))}},{key:"transformWithTranslateInverse",get:function(){return this._cachedTransformWithTranslateInverse||r.invert([],this.getTransformWithTranslate(this))}},{key:"itemMatrix",get:function(){return this._cachedItemTransform||this.getItemTransformMatrix()}},{key:"itemMatrixInverse",get:function(){return this._cachedItemTransformInverse||this.getItemTransformMatrixInverse()}},{key:"accumulatedMatrix",get:function(){return this._cachedAccumulatedMatrix||this.getAccumulatedMatrix()}},{key:"accumulatedMatrixInverse",get:function(){return this._cachedAccumulatedMatrixInverse||this.getAccumulatedMatrixInverse()}},{key:"verties",get:function(){return this._cachedVerties||this.getVerties()}},{key:"originVerties",get:function(){return this._cachedVertiesWithoutTransformOrigin||this.rectVerties()}},{key:"localVerties",get:function(){return this._cachedLocalVerties||this.getLocalVerties()}},{key:"guideVerties",get:function(){return this._cachedGuideVerties||this.getGuideVerties()}},{key:"areaPosition",get:function(){return this._cachedAreaPosition||this.getAreaPosition()}},{key:"getAreaPosition",value:function(){var t=Bo(this.getVerties());return{column:[Math.ceil(t[0][0]/100),Math.ceil(t[1][0]/100)],row:[Math.ceil(t[0][1]/100),Math.ceil(t[3][1]/100)]}}},{key:"setScreenX",value:function(t){var e=0;this.isChild&&(e=this.json.parent.screenX.value),this.json.x.set(t-e),this.changed()}},{key:"setScreenY",value:function(t){var e=0;this.isChild&&(e=this.json.parent.screenY.value),this.json.y.set(t-e),this.changed()}},{key:"screenX",get:function(){return this.isChild?Sa.px(this.json.parent.screenX.value+this.json.x.value):this.json.x||Sa.z()}},{key:"screenY",get:function(){return this.isChild?Sa.px(this.json.parent.screenY.value+this.json.y.value):this.json.y||Sa.z()}},{key:"offsetX",get:function(){return this.parent?this.json.x.toPx(this.screenWidth.value):this.json.x||Xc}},{key:"offsetY",get:function(){return this.parent?this.json.y.toPx(this.screenHeight.value):this.json.y||Xc}},{key:"screenWidth",get:function(){return this.is("project")||!this.parent?Xc:this.parent.is("project")||this.is("artboard")?this.json.width.toPx():this.json.width.toPx(this.parent.screenWidth.value)}},{key:"screenHeight",get:function(){return this.is("project")||!this.parent?Xc:this.parent.is("project")||this.is("artboard")?this.json.height.toPx():this.json.height.toPx(this.parent.screenHeight.value)}},{key:"move",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0];this.reset({x:Sa.px(this.offsetX.value+t[0]).round(),y:Sa.px(this.offsetY.value+t[1]).round()})}},{key:"moveByCenter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=this.matrix;this.reset({x:Sa.px(t[0]-e.width/2),y:Sa.px(t[1]-e.height/2)})}},{key:"setAngle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.reset({transform:Bc.replaceAll(this.transform,"rotateZ(".concat(Sa.deg(t).round(1e3),")"))})}},{key:"addAngle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.reset({transform:Bc.addTransform(this.transform,"rotateZ(".concat(Sa.deg(t).round(1e3),")"))})}},{key:"checkInArea",value:function(t){return To(t,this.originVerties)}},{key:"hasPoint",value:function(t,e){return Co(this.originVerties,t,e)}},{key:"isIncludeByArea",value:function(t){return 4===this.originVerties.map((function(e){return Co.apply(void 0,[t].concat(ce()(e)))})).filter(Boolean).length}},{key:"getPerspectiveMatrix",value:function(){if(this.json.perspective||Bc.get(this.json.transform||"","perspective")){var t=$o.parseStyle(this.json["perspective-origin"]),e=zt()(t,2),n=e[0],i=void 0===n?Sa.percent(50):n,a=e[1],o=void 0===a?Sa.percent(50):a,c=this.screenWidth.value,s=this.screenHeight.value;i=i.toPx(c).value,o=o.toPx(s).value;var u=r.create();r.translate(u,u,[i,o,0]);var l=Bc.get(this.json.transform,"perspective");if(l.length)r.multiply(u,u,r.fromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,-1/l[0].value,1));else{if(!this.json.perspective||"none"==this.json.perspective)return;r.multiply(u,u,r.fromValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,-1/Sa.parse(this.json.perspective).value,1))}return r.translate(u,u,[-i,-o,0]),u}}},{key:"getItemTransformMatrix",value:function(){var t,e=Bc.parseStyle(null===(t=this.json)||void 0===t?void 0:t.transform),n=this.screenWidth.value,r=this.screenHeight.value;return Bc.createTransformMatrix(e,n,r)}},{key:"getItemTransformMatrixInverse",value:function(){return r.invert([],this.getItemTransformMatrix())}},{key:"getLocalTransformMatrix",value:function(){var t=$o.scale(this.json["transform-origin"]||"50% 50% 0px",this.screenWidth.value,this.screenHeight.value),e=r.create();return r.translate(e,e,t),r.multiply(e,e,this.itemMatrix),r.translate(e,e,i.negate([],t)),e}},{key:"getLocalTransformMatrixInverse",value:function(){return r.invert([],this.getLocalTransformMatrix())}},{key:"getDirectionTransformMatrix",value:function(t,e,n){var a=this.offsetX.value,o=this.offsetY.value,c=i.add([],$o.scale(this.json["transform-origin"]||"50% 50% 0px",e,n),i.negate([],t)),s=r.create();return r.translate(s,s,[a,o,0]),r.translate(s,s,t),r.translate(s,s,c),r.multiply(s,s,this.itemMatrix),r.translate(s,s,i.negate([],c)),s}},{key:"getDirectionTopLeftMatrix",value:function(t,e){return this.getDirectionTransformMatrix([0,0,0],t,e)}},{key:"getDirectionLeftMatrix",value:function(t,e){return this.getDirectionTransformMatrix([0,e/2,0],t,e)}},{key:"getDirectionTopMatrix",value:function(t,e){return this.getDirectionTransformMatrix([t/2,0,0],t,e)}},{key:"getDirectionBottomLeftMatrix",value:function(t,e){return this.getDirectionTransformMatrix([0,e,0],t,e)}},{key:"getDirectionTopRightMatrix",value:function(t,e){return this.getDirectionTransformMatrix([t,0,0],t,e)}},{key:"getDirectionRightMatrix",value:function(t,e){return this.getDirectionTransformMatrix([t,e/2,0],t,e)}},{key:"getDirectionBottomRightMatrix",value:function(t,e){return this.getDirectionTransformMatrix([t,e,0],t,e)}},{key:"getDirectionBottomMatrix",value:function(t,e){return this.getDirectionTransformMatrix([t/2,e,0],t,e)}},{key:"getAccumulatedMatrix",value:function(){for(var t=r.create(),e=this.path.filter((function(t){return!1===t.is("project")})),n=0,i=e.length;n0&&void 0!==arguments[0]?arguments[0]:"",e=t||this.d,n=new Hc(e);return n.transformMat4(this.accumulatedMatrix),n}},{key:"invertPath",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=new Hc(t);return e.transformMat4(this.accumulatedMatrixInverse),e}},{key:"invertPathString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.invertPath(t).d}},{key:"checkInAreaForAll",value:function(t){var e=ce()(this.checkInAreaForLayers(t));return this.is("artboard")||this.is("project")||this.checkInArea(t)&&e.push(this.ref),e}},{key:"checkInAreaForLayers",value:function(t){var e=[];return this.layers.forEach((function(n){e.push.apply(e,n.checkInAreaForLayers(t)),n.checkInArea(t)&&e.push(n)})),e}},{key:"getTransformOriginMatrix",value:function(){return r.fromTranslation([],$o.scale(this.json["transform-origin"]||"50% 50% 0px",this.screenWidth.value,this.screenHeight.value))}},{key:"getTransformOriginMatrixInverse",value:function(){return r.invert([],this.getTransformOriginMatrix())}},{key:"resetMatrix",value:function(t){var e=ca(this.accumulatedMatrixInverse,t.accumulatedMatrix),n=Bc.fromScale(r.getScaling([],e).map((function(t){return zi(t,1e3)}))),i=r.getRotation([],e),o=[],c=a.getAxisAngle(o,i),s=[{angle:o[0]?Gi(c*o[0]):0,type:"rotateX"},{angle:o[1]?Gi(c*o[1]):0,type:"rotateY"},{angle:o[2]?Gi(c*o[2]):0,type:"rotateZ"}].filter((function(t){return 0!==t.angle})).map((function(t){return"".concat(t.type,"(").concat(Sa.deg(t.angle%360).round(1e3),")")})).join(" "),u=Bc.replaceAll(t.transform,"".concat(n," ").concat(s)),l=Bc.parseStyle(u),f=t.screenWidth.value,h=t.screenHeight.value,p=Bc.createTransformMatrix(l,f,h),d=r.getTranslation([],ca(e,sa(t.getTransformOriginMatrix(),p,t.getTransformOriginMatrixInverse()))),v=zt()(d,3),y=v[0],g=v[1];v[2];t.reset({x:Sa.px(y),y:Sa.px(g),transform:u}),t.refreshMatrixCache()}},{key:"getIndex",value:function(){for(var t=this.json.parent.layers,e=-1,n=0,r=t.length;n-1&&(e.layers[n]=e.layers[t],e.layers[t]=this.ref)}},{key:"next",value:function(){if(this.isLast())return this.ref;var t=this.getIndex();return this.json.parent.layers[t+1]}},{key:"prev",value:function(){if(this.isFirst())return this.ref;var t=this.getIndex();return this.json.parent.layers[t-1]}},{key:"orderNext",value:function(){if(this.isLast()){if(this.json.parent.is("artboard"))return;this.json.parent.next().add(this,"prepend")}else{var t=this.getIndex();t>-1&&this.setOrder(t+1)}}},{key:"isFirst",value:function(){return 0===this.getIndex()}},{key:"isLast",value:function(){return this.getIndex()===this.json.parent.layers.length-1}},{key:"orderPrev",value:function(){if(this.isFirst()){if(this.json.parent.is("artboard"))return;this.json.parent.prev().add(this)}else{var t=this.getIndex();t>0&&this.setOrder(t-1)}}},{key:"orderFirst",value:function(){this.setOrder(0)}},{key:"orderLast",value:function(){this.setOrder(this.json.parent.layers.length-1)}},{key:"orderTop",value:function(){}},{key:"orderBottom",value:function(){}}]),n}(Va);function Kc(t,e){if(Zt(e)){var n=e.split(":"),r=zt()(n,4),i=r[0],a=r[1],o=r[2],c=r[3];return 3600*(i=parseInt(i,10))+60*(a=parseInt(a,10))+(o=parseInt(o,10))+(c=parseInt(c,10))*(1/t)}return Qt(e)?e/t:0}function Uc(t,e){var n=Math.floor(e/3600),r=Math.floor(e/60%60),i=Math.floor(e%60),a=Math.round((e-Math.floor(e))*t);return a===t&&(a=0,60===(i+=1)&&60===(r+=1)&&(n+=1)),[n,r,i,a].map((function(t){return(t+"").padStart(2,"0")})).join(":")}function Wc(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Uc(t,Kc(t,e)-Kc(t,n))}function Zc(t){var e={id:0,start:0,speed:t.speed||1,elapsed:t.elapsed||0,duration:t.duration||0,iterationStartCount:1,iterationCount:t.iterationCount||Number.MAX_SAFE_INTEGER,direction:t.direction||"normal",log:[],logIndex:0,tick:t.tick||function(){},startCallback:t.start||function(){},endCallback:t.end||function(){},firstCallback:t.first||function(){},lastCallback:t.last||function(){}},n=function(t){return"normal"===e.direction||"reverse"!==e.direction&&("alternate"===e.direction?e.iterationStartCount%2==1:"alternate-reverse"===e.direction?e.iterationStartCount%2==0:void 0)?t:1-t},r=function(t){var r=!1;null===e.start&&(e.start=t,r=!0);var o=t-e.start;e.elapsed+=o*e.speed,e.start=t,e.elapsed>e.duration&&(e.elapsed=e.duration);var c=n(e.elapsed/e.duration)*e.duration;r&&e.startCallback(c,e),e.log[e.logIndex++]={elapsed:c,dt:e.lastTime-c},e.lastTime=c,e.tick(c,e),e.elapsed===e.duration?a():i()},i=function(){e.id=requestAnimationFrame(r)},a=function(){e.endCallback(e.elapsed,e),e.iterationStartCount++,e.iterationStartCount>e.iterationCount?(e.lastCallback(e.elapsed,e),cancelAnimationFrame(e.id)):(e.start=null,e.elapsed=0,i())},o=function(t){e.elapsed=t,e.tick(e.elapsed,e)};return{play:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.start=null,e.iterationStartCount=1,e.log=[],e.lastTime=0,e.logIndex=0,Qt(t.elapsed)&&(e.elapsed=t.elapsed),Qt(t.speed)&&(e.speed=t.speed),Qt(t.duration)&&(e.duration=t.duration),Qt(t.iterationCount)&&(e.iterationCount=t.iterationCount||Number.MAX_SAFE_INTEGER),Zt(t.direction)&&(e.direction=t.direction),Jt(t.tick)&&(e.tick=t.tick),Jt(t.start)&&(e.startCallback=t.start),Jt(t.end)&&(e.endCallback=t.end),Jt(t.first)&&(e.firstCallback=t.first),Jt(t.last)&&(e.lastCallback=t.last),Jt(t.stop)&&(e.stopCallback=t.stop),e.firstCallback(e.elapsed,e),i()},stop:function(){e.stopCallback(e.elapsed,e),cancelAnimationFrame(e.id)},tick:r,first:function(t){o(0)},last:function(t){o(e.duration)},seek:o,timer:e}}function qc(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return function(t,e){var a=0;return a=0===e?n:1===e?r:n+(r-n)*t,i?a+i:a}}function Jc(t,e,n){return function(t,e){return n}}function Qc(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"width",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"parent",a=null;return"parent"===i?a=t[i][r]:"self"===i&&(a=t[r]),a?n.toPx(a.value):n}function ts(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"width",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"parent",o=null;return"parent"===a?o=t[a][i]:"self"===a&&(o=t[i]),o?n.to(r,o.value):n}function es(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"width",a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"parent",o=Sa.parse(n),c=Sa.parse(r);return o.unit===c.unit?qc(t,e,o.value,c.value,o.unit):o.equals(c)?Jc(0,0,o):function(n,r){var s=Qc(t,e,o,i,a),u=Qc(t,e,c,i,a);return 0===r?s:1===r?u:ts(t,e,Sa.px(s.value+(u.value-s.value)*n),o.unit,i,a)}}var ns=function(){function t(){O()(this,t)}return j()(t,null,[{key:"parseStyle",value:function(t){var e={isAll:!0,"border-radius":Sa.z(),"border-top-left-radius":Sa.z(),"border-top-right-radius":Sa.z(),"border-bottom-right-radius":Sa.z(),"border-bottom-left-radius":Sa.z()},n=t.split(" ").filter((function(t){return Sa.parse(t)}));return 1===n.length?(e.isAll=!0,e["border-radius"]=n[0]):(e.isAll=!1,e["border-top-left-radius"]=n[0],e["border-top-right-radius"]=n[1],e["border-bottom-right-radius"]=n[2],e["border-bottom-left-radius"]=n[3]),e}}]),t}(),rs=function(t){return t.isAll?[t["border-radius"]||"0px",t["border-radius"]||"0px",t["border-radius"]||"0px",t["border-radius"]||"0px"]:[t["border-top-left-radius"]||"0px",t["border-top-right-radius"]||"0px",t["border-bottom-right-radius"]||"0px",t["border-bottom-left-radius"]||"0px"]};function is(t,e,n,r){for(var i=rs(ns.parseStyle(n)),a=rs(ns.parseStyle(r)),o=Math.max(i.length,a.length),c=[],s=0;s.008856?Math.pow(t,3):(t-16/116)/7.787}function ss(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function us(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.x,e=r.y,n=r.z}var i=t/100,a=e/100,o=n/100,c=3.2406*i+-1.5372*a+-.4986*o,s=-.9689*i+1.8758*a+.0415*o,u=.0557*i+-.204*a+1.057*o;c=ss(c),s=ss(s),u=ss(u);var l=zi(255*c),f=zi(255*s),h=zi(255*u);return{r:l,g:f,b:h}}function ls(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}var i=(t+16)/116,a=e/500+i,o=i-n/200;i=cs(i);var c=95.047*(a=cs(a)),s=100*i,u=108.883*(o=cs(o));return{x:c,y:s,z:u}}function fs(t){return t>.008856?Math.pow(t,1/3):(7.787*t+16)/116}function hs(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.x,e=r.y,n=r.z}var i=t/95.047,a=e/100,o=n/108.883;i=fs(i);var c=116*(a=fs(a))-16,s=500*(i-a),u=200*(a-(o=fs(o)));return{l:c,a:s,b:u}}function ps(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}return us(ls(t,e,n))}function ds(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var i=t/255,a=e/255,o=n/255,c=Math.max(i,a,o),s=Math.min(i,a,o),u=c-s,l=0;0==u?l=0:c==i?l=(a-o)/u%6*60:c==a?l=60*((o-i)/u+2):c==o&&(l=60*((i-a)/u+4)),l<0&&(l=360+l);return{h:l,s:0==c?0:u/c,v:c}}function vs(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var i=t/255,a=e/255,o=n/255,c=1-Math.max(i,a,o),s=(1-i-c)/(1-c),u=(1-a-c)/(1-c),l=(1-o-c)/(1-c);return{c:s,m:u,y:l,k:c}}function ys(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}t/=255,e/=255,n/=255;var i,a,o=Math.max(t,e,n),c=Math.min(t,e,n),s=(o+c)/2;if(o==c)i=a=0;else{var u=o-c;switch(a=s>.5?u/(2-o-c):u/(o+c),o){case t:i=(e-n)/u+(e90?0:255)}function ms(t){return{r:t,g:t,b:t}}function bs(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return ms(Math.ceil((t+e+n)/3))}function ks(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return ms(ws(t,e,n).y)}function xs(t,e,n){return Math.ceil(.2126*t+.7152*e+.0722*n)}function ws(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var i=xs(t,e,n),a=.564*(n-i),o=.713*(t-i);return{y:i,cr:o,cb:a}}function Ps(t){return 100*(t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)}function Os(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var i=t/255,a=e/255,o=n/255,c=.4124*(i=Ps(i))+.3576*(a=Ps(a))+.1805*(o=Ps(o)),s=.2126*i+.7152*a+.0722*o,u=.0193*i+.1192*a+.9505*o;return{x:c,y:s,z:u}}function Ss(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return hs(Os(t,e,n))}function js(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function $s(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var i=Rs(t,e,n);return ds(i.r,i.g,i.b)}function Rs(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var i,a,o;if(t/=360,n/=100,0==(e/=100))i=a=o=n;else{var c=n<.5?n*(1+e):n+e-n*e,s=2*n-c;i=js(s,c,t+1/3),a=js(s,c,t),o=js(s,c,t-1/3)}return{r:zi(255*i),g:zi(255*a),b:zi(255*o)}}function Cs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ms(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"@";return"".concat(e).concat(t.startIndex).padEnd(10,"0")}function Es(t){return!!Is(t).length}function Is(t){var e=t.match(Ts),n=[];if(!e)return n;for(var r=0,i=e.length;r-1||e[r].indexOf("rgb")>-1||e[r].indexOf("hsl")>-1)n.push({color:e[r]});else{var a=os.getColorByName(e[r]);a&&n.push({color:e[r],nameColor:a})}var o={next:0};return n.forEach((function(e){var n=t.indexOf(e.color,o.next);e.startIndex=n,e.endIndex=n+e.color.length,o.next=e.endIndex})),n}function Ds(t){var e=Is(t);return e.forEach((function(e){t=t.replace(e.color,Vs(e))})),{str:t,matches:e}}function Ls(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=Ds(t);return n.str.split(e).map((function(t,e){return t=zs(t),n.matches[e]&&(t=t.replace(Vs(n.matches[e]),n.matches[e].color)),t}))}function Bs(t,e){return e.forEach((function(e){t=t.replace(Vs(e),e.color)})),t}var As=/^\s+|\s+$/g;function zs(t){return t.replace(As,"")}function Fs(t){if(Zt(t)){if(os.isColorName(t)&&(t=os.getColorByName(t)),t.indexOf("rgb(")>-1){for(var e=0,n=(r=t.replace("rgb(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("rgba(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("hsl(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("hsla(","").replace(")","").split(",")).length;e>16,g:(65280&t)>>8,b:(255&t)>>0,a:1}),ys(o));if(0<=t&&t<=4294967295)return o=Ms(Ms({},o={type:"hex",r:(4278190080&t)>>24,g:(16711680&t)>>16,b:(65280&t)>>8,a:(255&t)/255}),ys(o))}return t}function Hs(t){Zt(t)&&(t=Ls(t));var e=(t=t.map((function(t){if(Zt(t)){var e=Ds(t),n=zs(e.str).split(" ");return n[1]?n[1].indexOf("%")>-1?n[1]=parseFloat(n[1].replace(/%/,""))/100:n[1]=parseFloat(n[1]):n[1]="*",n[0]=Bs(n[0],e.matches),n}if(Array.isArray(t))return t[1]?Zt(t[1])&&(t[1].indexOf("%")>-1?t[1]=parseFloat(t[1].replace(/%/,""))/100:t[1]=+t[1]):t[1]="*",ce()(t)}))).filter((function(t){return"*"===t[1]})).length;if(e>0){var n=(1-t.filter((function(t){return"*"!=t[1]&&1!=t[1]})).map((function(t){return t[1]})).reduce((function(t,e){return t+e}),0))/e;t.forEach((function(e,r){"*"==e[1]&&r>0&&(t.length-1==r||(e[1]=n))}))}return t}function Gs(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _s(t){for(var e=1;e=360&&(i=0);var c=a*o,s=c*(1-Math.abs(i/60%2-1)),u=o-c,l=[];return 0<=i&&i<60?l=[c,s,0]:60<=i&&i<120?l=[s,c,0]:120<=i&&i<180?l=[0,c,s]:180<=i&&i<240?l=[0,s,c]:240<=i&&i<300?l=[s,0,c]:300<=i&&i<360&&(l=[c,0,s]),{r:zi(255*(l[0]+u)),g:zi(255*(l[1]+u)),b:zi(255*(l[2]+u))}}function Ws(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var i=Us(t,e,n);return ys(i.r,i.g,i.b)}function Zs(t,e,n,r){if(1==arguments.length){var i=arguments[0];t=i.y,e=i.cr,n=i.cb;r=(r=i.bit)||0}var a=t+1.402*(e-r),o=t-.344*(n-r)-.714*(e-r),c=t+1.772*(n-r);return{r:Math.ceil(a),g:Math.ceil(o),b:Math.ceil(c)}}function qs(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex",i=Js(t,e,n);return uc(i,r)}function Js(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,r=void 0===t.a?1:t.a,i=void 0===e.a?1:e.a;return{r:zi(t.r+(e.r-t.r)*n),g:zi(t.g+(e.g-t.g)*n),b:zi(t.b+(e.b-t.b)*n),a:zi(r+(i-r)*n,100)}}function Qs(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(!t)return[];"string"==typeof t&&(t=Ls(t));for(var n=(t=t||[]).length,r=[],i=0;i2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex",i=Fs(t),a=Fs(e);return qs(i,a,n,r)}function eu(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex";return tu(t,e,n,r)}function nu(t){return t=Fs(t),(Math.round(299*t.r)+Math.round(587*t.g)+Math.round(114*t.b))/1e3}function ru(t){return nu(t)>=128?"black":"white"}function iu(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=[],r=e-((t=Hs(t)).length-1),i=r,a=1,o=t.length;a1&&void 0!==arguments[1]?arguments[1]:"h",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:9,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:100,c=Fs(t),s=ds(c),u=(a-i)*o/n,l=[],f=1;f<=n;f++)s[e]=Math.abs((o-u*f)/o),l.push(uc(Us(s),r));return l}function ou(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:360;return au(t,"h",e,n,r,i,1)}function cu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return au(t,"s",e,n,r,i,100)}function su(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return au(t,"v",e,n,r,i,100)}function uu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function lu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"end";return t=+t,function(n){var r=1/t;return"start"==e?r*Math.ceil(n/r):"end"==e?r*Math.floor(n/r):void 0}};function yu(){return vu(1,"start")}function gu(){return vu(1,"end")}var mu=function(){return function(t){return Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1}},bu={step:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"end";return vu(t,e)},"step-start":yu,"step-end":gu,stepStart:yu,stepEnd:gu,"ease-out-elastic":mu,easeOutElastic:mu};function ku(t,e,n,r){var i=Sa.parse(n),a=Sa.parse(r);return function(t,e){var n=i.value,r=a.value;return 0===e?Sa.deg(n):1===e?Sa.deg(r):Sa.deg(n+(r-n)*t).to(i.unit)}}function xu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"",e=Ds(t),r=e.str.split(",").filter((function(t){return t.trim()})).map((function(t){var r=t.split(" "),i=r.filter((function(t){return t.includes("@")})).map((function(t){return Bs(t,e.matches)||"black"})),a=r.filter((function(t){return!t.includes("@")}));return n.parse({color:i[0]||"rgba(0, 0, 0, 1)",offsetX:Sa.parse(a[0]||"0px"),offsetY:Sa.parse(a[1]||"0px"),blurRadius:Sa.parse(a[2]||"0px")})}));return r}},{key:"join",value:function(t){return t.map((function(t){return n.parse(t)})).join(", ")}}]),n}(Tc);function Su(t,e,n,r){for(var i=Ou.parseStyle(n),a=Ou.parseStyle(r),o=Math.max(i.length,a.length),c=[],s=0,u=o;s0&&void 0!==arguments[0]?arguments[0]:{};return $u({itemType:"image-resource",type:"image"},t)}},{key:"isGradient",value:function(){return!1}},{key:"isLinear",value:function(){return!1}},{key:"isRadial",value:function(){return!1}},{key:"isConic",value:function(){return!1}},{key:"isStatic",value:function(){return!1}},{key:"isImage",value:function(){return!1}},{key:"hasAngle",value:function(){return!1}},{key:"isUrl",value:function(){return!1}},{key:"isFile",value:function(){return!1}},{key:"isAttribute",value:function(){return!0}},{key:"toString",value:function(){return"none"}}]),n}(Tc);function Mu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Tu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"%",r=pc(2,t),i=e/r,a=mc(r).map((function(t,e){return"".concat(fu.random()," ").concat(e*i).concat(n)})).join(",");return a}},{key:"createRepeatColorStep",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sa.px(1),n=pc(2,t),r=mc(n).map((function(t,n){return"".concat(fu.random()," ").concat(Sa.parse(e).mul(n+1))})).join(",");return r}}]),n}(Va);function Du(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Lu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return Lu({itemType:"image-resource",type:"gradient",colorsteps:[]},t)}},{key:"toCloneObject",value:function(){return Lu(Lu({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),{},{colorsteps:this.json.colorsteps.map((function(t){return t.clone()}))})}},{key:"convert",value:function(t){return t.colorsteps[0]instanceof Iu||(t.colorsteps=t.colorsteps.map((function(t){return new Iu(t)}))),t}},{key:"calculateAngle",value:function(){var t=this.json.angle;return Kt(Au[t])?t:Au[t]||0}},{key:"addColorStep",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.json.colorsteps.push(t),e&&this.sortColorStep(),t}},{key:"insertColorStep",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(216,216,216,0)",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(216,216,216,1)",r=this.colorsteps;if(r.length){if(te.percent?1:t.percente.index?1:-1:void 0})),t.forEach((function(t,e){t.index=100*e}))}},{key:"addColorStepList",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){t.addColorStep(e,!1)})),this.sortColorStep()}},{key:"getColorStep",value:function(t){return this.json.colorsteps.filter((function(e){return e.id==t}))[0]}},{key:"clear",value:function(){arguments.length?this.json.colorsteps.splice(+(arguments.length<=0?void 0:arguments[0]),1):this.json.colorsteps=[]}},{key:"removeColorStep",value:function(t){this.json.colorsteps=this.json.colorsteps.filter((function(e){return e.id!=t}))}},{key:"colorsteps",get:function(){return this.json.colorsteps}},{key:"getColorString",value:function(){var t=this.colorsteps;return n.toColorString(t)}}],[{key:"toColorString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!t.length)return"";var e=t.map((function(e,n){return e.prevColorStep=e.cut&&n>0?t[n-1]:null,e}));return 1===e.length&&e.push(new Iu({color:e[0].color||"transparent",percent:100})),e.map((function(t){return"".concat(t)})).join(",")}}]),n}(Cu);function Fu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Hu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"transparent";return new n({colorsteps:[new Iu({color:t,percent:0,index:0}),new Iu({color:t,percent:100,index:1})]})}}]),n}(zu);function Nu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Xu(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,Xu({type:"url",url:"",datauri:""},t))}},{key:"toCloneObject",value:function(){return Xu(Xu({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("url","datauri"))}},{key:"isUrl",value:function(){return!0}},{key:"toString",value:function(){var t=this.json;return"url(".concat(t.url,")")}}],[{key:"parse",value:function(t){return new n({url:t.split("(")[1].split(")")[0]})}},{key:"isImageFile",value:function(t){return Ku.includes(t)}}]),n}(Cu);function Wu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zu(t){for(var e=1;e360?e%360:e,"deg")),"".concat(this.json.type,"(").concat(e,", ").concat(t,")")}}],[{key:"toLinearGradient",value:function(t){return 0===t.length?"none":new n({angle:"to right",colorsteps:t})+""}},{key:"parse",value:function(t){var e=Ds(t),r=0,i=[];return e.str.split("(")[1].split(")")[0].split(",").map((function(t){return t.trim()})).forEach((function(t,n){t.includes("@")?(t=Bs(t,e.matches),i.push.apply(i,Iu.parse(t))):r=Kt(Qu[t])?Sa.parse(t):Sa.deg(+Qu[t])})),new n({angle:r.value,colorsteps:i})}}]),n}(zu);function el(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var nl,rl=function(t){R()(n,t);var e=el(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"repeating-linear-gradient",angle:0})}}],[{key:"parse",value:function(t){var e=tl.parse(t);return new n({angle:e.angle,colorsteps:e.colorsteps})}}]),n}(tl);function il(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function al(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,al({type:"radial-gradient",radialType:"ellipse",radialPosition:[Pa.CENTER,Pa.CENTER]},t))}},{key:"toCloneObject",value:function(){return al(al({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("radialType","radialPosition"))}},{key:"isRadial",value:function(){return!0}},{key:"toString",value:function(){if(0===this.colorsteps.length)return"";var t,e=this.getColorString(),n=this.json,r=n.radialType,i=n.radialPosition||["center","center"];return t=(i=cl[i]?i:i.join(" "))?"".concat(r," at ").concat(i):r,"".concat(n.type||"radial-gradient","(").concat(t,", ").concat(e,")")}}],[{key:"parse",value:function(t){var e=Ds(t),r="ellipse",i=[Pa.CENTER,Pa.CENTER],a=[];return e.str.split("(")[1].split(")")[0].split(",").map((function(t){return t.trim()})).forEach((function(t,n){if(t.includes("@"))t=Bs(t,e.matches),a.push.apply(a,Iu.parse(t));else{if(t.includes("at")){var o=t.split("at").map((function(t){return t.trim()})),c=zt()(o,2);r=c[0],i=c[1]}else r=t;if("string"==typeof i){var s=i.split(" ");if(1===s.length){var u=Sa.parse(s[0]);i=u.isString()?[u.value,u.value]:[u.clone(),u.clone()]}else 2===s.length&&(i=s.map((function(t){var e=Sa.parse(t);return e.isString()?e.value:e.clone()})))}}})),new n({radialType:r,radialPosition:i,colorsteps:a})}}]),n}(zu);function ul(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var ll,fl=function(t){R()(n,t);var e=ul(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"repeating-radial-gradient"})}}],[{key:"parse",value:function(t){var e=sl.parse(t);return new n({radialType:e.radialType,radialPosition:e.radialPosition,colorsteps:e.colorsteps})}}]),n}(sl);function hl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pl(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,pl({type:"conic-gradient",angle:0,radialPosition:[Pa.CENTER,Pa.CENTER]},t))}},{key:"toCloneObject",value:function(){return pl(pl({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),{},{angle:this.json.angle,radialPosition:ee(this.json.radialPosition)})}},{key:"isConic",value:function(){return!0}},{key:"hasAngle",value:function(){return!0}},{key:"getColorString",value:function(){if(0===this.colorsteps.length)return"";var t=this.colorsteps;return t?(t.sort((function(t,e){return t.percent==e.percent?0:t.percent>e.percent?1:-1})),t.map((function(e,n){return e.prevColorStep=e.cut&&n>0?t[n-1]:null,e})).map((function(t){var e=Math.floor(3.6*t.percent),n="";if(t.cut&&t.prevColorStep){var r=Math.floor(3.6*t.prevColorStep.percent);n="".concat(r,"deg")}return"".concat(t.color," ").concat(n," ").concat(e,"deg")})).join(",")):""}},{key:"toString",value:function(){var t=this.getColorString(),e=[],n=this.json,r=n.angle,i=n.radialPosition||Pa.CENTER;i=vl[i]?i:i.join(" "),Ut(r)&&(r=+(yl[r]||r),e.push("from ".concat(r,"deg"))),i&&e.push("at ".concat(i));var a=e.length?e.join(" ")+",":"";return"".concat(n.type,"(").concat(a," ").concat(t,")")}}],[{key:"parse",value:function(t){var e=Ds(t),r="0deg",i=[Pa.CENTER,Pa.CENTER],a=[];return e.str.split("(")[1].split(")")[0].split(",").map((function(t){return t.trim()})).forEach((function(t,n){if(t.includes("@"))t=Bs(t=t.split(" ").map((function(t){return t.trim()})).map((function(t){return t.includes("deg")?Sa.parse(t).toPercent():t})).join(" "),e.matches),a.push.apply(a,Iu.parse(t));else{if(t.includes("at")){var o=t.split("at").map((function(t){return t.trim()})),c=zt()(o,2);r=c[0],i=c[1]}else r=t;if(Zt(i)){var s=i.split(" ");if(1===s.length){var u=Sa.parse(s[0]);i=u.isString()?[u.value,u.value]:[u.clone(),u.clone()]}else 2===s.length&&(i=s.map((function(t){var e=Sa.parse(t);return e.isString()?e.value:e})))}Zt(r)&&r.includes("from")&&(r=r.split("from")[1],r=Kt(yl[r])?Sa.parse(r):Sa.deg(+yl[r]))}})),new n({angle:r.value,radialPosition:i,colorsteps:a})}}]),n}(zu);function ml(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var bl=function(t){R()(n,t);var e=ml(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"repeating-conic-gradient",angle:0,radialPosition:[Pa.CENTER,Pa.CENTER]})}}],[{key:"parse",value:function(t){var e=gl.parse(t);return new n({angle:e.angle,radialPosition:e.radialPosition,colorsteps:e.colorsteps})}}]),n}(gl);function kl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xl(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=Math.max(n.length,r.length),a=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,Ll({itemType:"filter"},t))}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value||"",")")}}],[{key:"parse",value:function(t){var e=ql[t.type];return e?new e(t):new Hl({value:t.value})}},{key:"parseStyle",value:function(t){var e=[];if(!t)return e;var r=Ds(t);return(r.str.match(Al)||[]).forEach((function(t,i){var a=t.split("("),o=zt()(a,2),c=o[0],s=o[1];if(s=s.split(")")[0],"drop-shadow"===c){var u=s.split(" "),l=u.filter((function(t){return t.includes("@")})).map((function(t){return Bs(t,r.matches)})),f=u.filter((function(t){return!t.includes("@")}));e[i]=n.parse({type:c,offsetX:Sa.parse(f[0]),offsetY:Sa.parse(f[1]),blurRadius:Sa.parse(f[2]),color:l[0]||"rgba(0, 0, 0, 1)"})}else e[i]=n.parse({type:c,value:Sa.parse(s)})})),e}},{key:"join",value:function(t){return t.map((function(t){return n.parse(t)})).join(" ")}}]),n}(Tc),Fl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"blur",value:n.spec.defaultValue})}},{key:"toCloneObject",value:function(){return Ll(Ll({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("value"))}}]),n}(zl);Fl.spec={inputType:"range",min:0,max:100,step:1,unit:"px",units:["px","em"],defaultValue:Sa.z()};var Hl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"svg",value:n.spec.defaultValue})}},{key:"toCloneObject",value:function(){return Ll(Ll({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("value"))}},{key:"toString",value:function(){return"url(#".concat(this.json.value||"",")")}}]),n}(zl);Hl.spec={inputType:"select",defaultValue:""};var Gl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"grayscale",value:n.spec.defaultValue})}},{key:"toCloneObject",value:function(){return Ll(Ll({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("value"))}}]),n}(zl);Gl.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Sa.percent(0)};var _l=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"hue-rotate",value:n.spec.defaultValue})}}]),n}(zl);_l.spec={inputType:"range",min:0,max:360,step:1,unit:"deg",units:["deg"],defaultValue:Sa.deg(0)};var Nl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"invert",value:n.spec.defaultValue})}}]),n}(zl);Nl.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Sa.percent(0)};var Xl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"brightness",value:n.spec.defaultValue})}}]),n}(zl);Xl.spec={inputType:"range",min:0,max:200,step:1,unit:"%",units:["%"],defaultValue:Sa.percent(100)};var Yl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"contrast",value:n.spec.defaultValue})}}]),n}(zl);Yl.spec={inputType:"range",min:0,max:200,step:1,unit:"%",units:["%"],defaultValue:Sa.percent(100)};var Kl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"opacity",value:n.spec.defaultValue})}}]),n}(zl);Kl.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Sa.percent(100)};var Ul=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"saturate",value:n.spec.defaultValue})}}]),n}(zl);Ul.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Sa.percent(100)};var Wl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"sepia",value:n.spec.defaultValue})}}]),n}(zl);Wl.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:Sa.percent(0)};var Zl=function(t){R()(n,t);var e=Bl(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"drop-shadow",multi:!0,offsetX:n.spec.offsetX.defaultValue,offsetY:n.spec.offsetY.defaultValue,blurRadius:n.spec.blurRadius.defaultValue,color:n.spec.color.defaultValue})}},{key:"toString",value:function(){var t=this.json;return"drop-shadow(".concat(t.offsetX," ").concat(t.offsetY," ").concat(t.blurRadius," ").concat(t.color,")")}}]),n}(zl);Zl.spec={offsetX:{title:"Offset X",inputType:"range",min:-100,max:100,step:1,defaultValue:Sa.z(),unit:"px",units:["px","em"]},offsetY:{title:"Offset Y",inputType:"range",min:-100,max:100,step:1,defaultValue:Sa.z(),unit:"px",units:["px","em"]},blurRadius:{title:"Blur Radius",inputType:"range",min:0,max:100,step:1,defaultValue:Sa.z(),unit:"px",units:["px","em","%"]},color:{title:"Color",inputType:"color",defaultValue:"rgba(0, 0, 0, 1)",unit:"color"}};var ql={blur:Fl,grayscale:Gl,"hue-rotate":_l,invert:Nl,brightness:Xl,contrast:Yl,opacity:Kl,saturate:Ul,sepia:Wl,"drop-shadow":Zl,svg:Hl};function Jl(t,e,n,r){var i={type:du(0,0,n.type,r.type),value:Ys(0,0,n.value,r.value)};switch(n.type){case"blur":i.value=es(t,e,n.value,r.value);break;case"grayscale":case"invert":case"brightness":case"contrast":case"opacity":case"saturate":case"sepia":case"hue-rotate":i.value=qc(t,e,n.value.value,r.value.value,n.value.unit);break;case"drop-shadow":i.offsetX=es(t,e,n.offsetX,r.offsetX,"width","self"),i.offsetY=es(t,e,n.offsetY,r.offsetY,"height","self"),i.blurRadius=es(t,e,n.blurRadius,r.blurRadius,"width","self"),i.spreadRadius=es(t,e,n.spreadRadius,r.spreadRadius,"width","self"),i.color=hu(0,0,n.color,r.color)}return function(t,e){return"drop-shadow"===i.type(t,e)?{type:i.type(t,e),offsetX:i.offsetX(t,e),offsetY:i.offsetY(t,e),blurRadius:i.blurRadius(t,e),spreadRadius:i.spreadRadius(t,e),color:i.color(t,e)}:{type:i.type(t,e),value:i.value(t,e)}}}function Ql(t,e,n,r){for(var i=zl.parseStyle(n),a=zl.parseStyle(r),o=Math.max(i.length,a.length),c=[],s=0,u=o;s0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,nf({itemType:"clip-path",type:"none",value:""},t))}},{key:"toCloneObject",value:function(){return nf(nf({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("value"))}},{key:"toString",value:function(){var t=this.json.type,e=this.json.value,n=this.json.box,r="";switch(t){case"circle":case"inset":case"ellipse":case"polygon":case"path":r="".concat(t,"(").concat(e,")");break;case"svg":r="url(#".concat(e,")");break;default:r="none"}return n?"".concat(n," ").concat(r):r}},{key:"toCSS",value:function(){return{"clip-path":this.toString()}}}],[{key:"toCSS",value:function(t){return new n(t).toCSS()}},{key:"toString",value:function(t){return n.toCSS(t)["clip-path"]}},{key:"parse",value:function(t){return new n(t)}},{key:"parseStyle",value:function(t){var e={};return t?((t.match(af)||[]).forEach((function(t,n){if(t.includes("-box"))e.box=t;else{var r=t.split("("),i=zt()(r,2),a=i[0],o=i[1];o=o||"",o="none"===a?"":o.split(")")[0],e.type=a,e.value=o}})),e):{}}},{key:"parseStyleForCircle",value:function(t){var e=new Sa("","closest-side"),n="";if((t=t||"50%").includes("at")){var r=t.split("at").map((function(t){return t.trim()})),i=zt()(r,2);e=i[0],n=i[1]}else n=t.trim();var a=n.split(" "),o=zt()(a,2),c=o[0],s=o[1];return Kt(s)&&(s=c),{radius:e,x:c=Sa.parse(c),y:s=Sa.parse(s)}}},{key:"parseStyleForEllipse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"50% 50%",e="50% 50%",n="";if((t=t||"50%").includes("at")){var r=t.split("at").map((function(t){return t.trim()})),i=zt()(r,2);e=i[0],n=i[1]}else n=t.trim();var a=n.split(" "),o=zt()(a,2),c=o[0],s=o[1];Kt(s)&&(s=c),c=Sa.parse(c),s=Sa.parse(s);var u=e.split(" "),l=zt()(u,2),f=l[0],h=l[1];return Kt(h)&&(h=f),{radiusX:f=Sa.parse(f),radiusY:h=Sa.parse(h),x:c,y:s}}},{key:"parseStyleForInset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.split("round"),n=zt()(e,2),r=n[0],i=n[1],a=tf.parse(r),o=zt()(a,5),c=o[0],s=o[1],u=o[2],l=o[3],f=o[4];if(i)var h=tf.parse(i),p=zt()(h,5),d=p[0],v=p[1],y=p[2],g=p[3],m=p[4];return{isAll:1===c,top:s,right:u,bottom:l,left:f,round:i,isAllRadius:1===d,topRadius:v,rightRadius:y,bottomRadius:g,leftRadius:m}}},{key:"parseStyleForPolygon",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(",").filter((function(t){return t.trim()})).map((function(t){var e=t.trim().split(" "),n=zt()(e,2),r=n[0],i=n[1];return{x:Sa.parse(r),y:Sa.parse(i)}}))}}]),n}(Tc);function cf(t,e,n,r){var i=of.parseStyle(n),a=of.parseStyle(r),o={type:Ys(0,0,i.type,i.type),value:Ys(0,0,n,r)};if(i.type==a.type&&"none"!=i)switch(i.type){case"circle":i.value=of.parseStyleForCircle(i.value),a.value=of.parseStyleForCircle(a.value),o.value=function(t,e,n,r){var i={};return"closest-side"===n.radius||"farthest-side"===n.radius||"closest-side"===r.radius||"farthest-side"===r.radius?i.radius=Ys(0,0,n.radius,r.radius):n.radius.unit===r.radius.unit?i.radius=makeInterpolateNumber(t,e,n.radius.value,r.radius.value,n.radius.unit):i.radius=es(t,e,n.radius,r.radius,"width","self"),i.x=es(t,e,n.x,r.x,"width","self"),i.y=es(t,e,n.y,r.y,"height","self"),function(t,e){var n=i.radius(t,e),r=i.x(t,e),a=i.y(t,e),o="".concat(r," ").concat(a),c=n+"";return c.includes("closest-side")?c="closest-side":c.includes("farthest-side")&&(c="farthest-side"),n?"".concat(c," at ").concat(o):"".concat(o)}}(t,e,i.value,a.value);break;case"ellipse":i.value=of.parseStyleForEllipse(i.value),a.value=of.parseStyleForEllipse(a.value),o.value=function(t,e,n,r){var i={radiusX:es(t,e,n.radiusX,r.radiusX,"width","self"),radiusY:es(t,e,n.radiusY,r.radiusY,"height","self"),x:es(t,e,n.x,r.x,"width","self"),y:es(t,e,n.y,r.y,"height","self")};return function(t,e){var n=i.radiusX(t,e),r=i.radiusY(t,e),a=i.x(t,e),o=i.y(t,e);return"".concat(n," ").concat(r," at ").concat(a," ").concat(o)}}(t,e,i.value,a.value);break;case"inset":i.value=of.parseStyleForInset(i.value),a.value=of.parseStyleForInset(a.value),o.value=function(t,e,n,r){var i={top:qc(t,e,n.top.value,r.top.value,n.top.unit),left:qc(t,e,n.left.value,r.left.value,n.left.unit),right:qc(t,e,n.right.value,r.right.value,n.right.unit),bottom:qc(t,e,n.bottom.value,r.bottom.value,n.bottom.unit),round:Ys(0,0,n.round,r.round),topRadius:qc(t,e,n.topRadius.value,r.topRadius.value,n.topRadius.unit),leftRadius:qc(t,e,n.leftRadius.value,r.leftRadius.value,n.leftRadius.unit),rightRadius:qc(t,e,n.rightRadius.value,r.rightRadius.value,n.rightRadius.unit),bottomRadius:qc(t,e,n.bottomRadius.value,r.bottomRadius.value,n.bottomRadius.unit)};return function(t,e){var n=i.top(t,e),r=i.right(t,e),a=i.bottom(t,e),o=i.left(t,e),c=i.round(t,e),s=i.topRadius(t,e),u=i.leftRadius(t,e),l=i.bottomRadius(t,e),f=i.rightRadius(t,e),h=[n,r,a,o].join(" "),p=[s,f,l,u].join(" ");return"".concat(h," ").concat(c&&p.trim()?"round ".concat(p):"")}}(t,e,i.value,a.value);break;case"polygon":i.value=of.parseStyleForPolygon(i.value),a.value=of.parseStyleForPolygon(a.value),o.value=function(t,e,n,r){for(var i=Math.max(n.length,r.length),a=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:[];return this.pathArray.push("".concat(t," ").concat(this.getPointString(e))),this}},{key:"M",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:"object";return'")}}],[{key:"makeRect",value:function(e,n,r,i){return(new t).M({x:e,y:n}).L({x:e+r,y:n}).L({x:e+r,y:n+i}).L({x:e,y:n+i}).L({x:e,y:n}).Z().d}},{key:"makeLine",value:function(e,n,r,i){return(new t).M({x:e,y:n}).L({x:r,y:i}).d}},{key:"makeCircle",value:function(e,n,r,i){var a=(new t).M({x:0,y:-1}).C({x:.552284749831,y:-1},{x:1,y:-.552284749831},{x:1,y:0}).C({x:1,y:.552284749831},{x:.552284749831,y:1},{x:0,y:1}).C({x:-.552284749831,y:1},{x:-1,y:.552284749831},{x:-1,y:0}).C({x:-1,y:-.552284749831},{x:-.552284749831,y:-1},{x:0,y:-1}).Z().d,o=new Hc(a);return o.translate(1,1).scale(r/2,i/2).translate(e,n),o.toString()}},{key:"makePathByPoints",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=new t,r=0,i=e.length;r0&&void 0!==arguments[0]?arguments[0]:[],n=new t,r=0,i=e.length;r0&&void 0!==arguments[0]?arguments[0]:"";return O()(this,n),e.call(this,t)}return j()(n,[{key:"reset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.segments=[],this.points=t,this.parse()}},{key:"resetSegments",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=t,this.points=this.joinPoints()}},{key:"parse",value:function(){var t=this.points;Array.isArray(t)&&(t=t.join(" "));for(var e=t.trim().split(bf).filter((function(t){return t})),n=[],r=0,i=e.length;r1&&void 0!==arguments[1]&&arguments[1],r=this.segments.map((function(n){return t.call(e,n)}));if(n)return r;this.segments=r}},{key:"_loop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.each((function(e){var n=t([e.x,e.y],0),r=zt()(n,2),i=r[0],a=r[1];return e.x=i,e.y=a,e}),e)}},{key:"clone",value:function(){return new n(this.joinPoints())}},{key:"toString",value:function(){return this.joinPoints()}}]),n}(Hc);function xf(t,e,n,r){for(var i=new kf,a=new kf(n),o=new kf(r),c=Math.max(a.segments.length,o.segments.length),s=[],u=a.segments[a.segments.length-1].x,l=a.segments[a.segments.length-1].y,f=o.segments[o.segments.length-1].x,h=o.segments[o.segments.length-1].y,p=0;p1&&(e-=1);var c=a[0];0===e?c=a[0]:1===e&&(c=a[a.length-1]);var s=a.find((function(t){return t.startT<=e&&e0&&void 0!==arguments[0]?arguments[0]:"linear",e=t.split("(").map((function(t){return t.trim()})),n=zt()(e,2),r=n[0],i=n[1];i=(i||"").split(")")[0].trim();var a=bu[r];if(a){var o=t.split("(")[1].split(")")[0].split(",").map((function(t){return t.trim()}));return a.apply(void 0,ce()(o))}return If(t)}function If(t){var e=tc(t);return function(t){return e(t).y}}function Df(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Lf(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return this.addProperty(Lf({checked:!0,value:Sa.z()},t))}},{key:"addProperty",value:function(t){this.json.properties.push(t)}},{key:"removeProperty",value:function(t){this.json.properties.splice(t,1)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};Object.assign(this.json.properties[+t],Lf({},e))}},{key:"updatePropertyByKey",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.json.properties,r=-1,i=0,a=n.length;ie.offset.value?1:-1})),e.map((function(e){return 0===e.properties.length?"":t.toOffsetString(e)})).join("\n")}},{key:"toCSSText",value:function(){return this.json.offsets.map((function(t){return t})).sort((function(t,e){return t.offset.value>e.offset.value?1:-1})),"\n@keyframes ".concat(this.json.name," {\n\n ").concat(this.toOffsetText(),"\n\n}\n")}},{key:"createOffset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addOffset(new Af(Ff({checked:!0},t)))}},{key:"addOffset",value:function(t){this.json.offsets.push(t)}},{key:"removeOffset",value:function(t){this.json.offsets.splice(t,1)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.offsets[+t].reset(e)}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){return this.toCSSText()}}],[{key:"parse",value:function(t){return new n(t)}},{key:"parseStyle",value:function(t){var e=[],r={};if(t.keyframe){var i=Ds(t.keyframe);i.str.split("|").map((function(t){return t.trim()})).forEach((function(t,a){var o=t.split(" "),c=Ia()(o),s=c[0],u=c[1],l=c[2],f=c.slice(3).join(" ");r[s]||(r[s]=new n({name:s}),e[a]=s);var h=r[s].offsets.filter((function(t){return t.offset.equals(Sa.parse(u))})),p=null;h.length?p=h[0]:(p=new Af({offset:Sa.parse(u)}),r[s].offsets.push(p)),p.addProperty({key:l,value:Bs(f,i.matches)})}))}return e.map((function(t){return r[t].offsets.forEach((function(t){var e=[],n=[];t.properties.forEach((function(t){t.key.includes("--")?e.push(t):n.push(t)}));var r=e.map((function(t){return"".concat(t.key,":").concat(t.value)})).join(";");e.length&&n.push({key:"var",value:r}),t.properties=n})),r[t]}))}}]),n}(Tc);function _f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Nf(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,Kf({timeline:[],compiledTimeline:{}},t))}},{key:"expectJSON",value:function(t){return"compiledTimeline"!==t&&$a()(V()(n.prototype),"expectJSON",this).call(this,t)}},{key:"setTimelineInfo",value:function(t){var e=this.getSelectedTimeline();e&&["speed","iterationCount","direction"].forEach((function(n){Ut(t[n])&&(e[n]=t[n])}))}},{key:"compileAll",value:function(){var t=this,e=this.getSelectedTimeline();this.json.compiledTimeline={},e&&e.animations.forEach((function(e){e.properties.forEach((function(n){t.compiledTimingFunction(e.id,n.property)}))}))}},{key:"searchTimelineOffset",value:function(t){var e=this,n=this.getSelectedTimeline(),r=[];return n&&n.animations.forEach((function(n){n.properties.forEach((function(i){var a=e.getCompiledTimingFunction(n.id,i.property);r.push(a.find((function(e){return!!(e.isOnlyTime&&e.startTime<=t)||e.startTime<=t&&t1&&void 0!==arguments[1]?arguments[1]:function(t){return t},n=this.getSelectedTimeline();if(n){Ut(t)&&this.setTimelineCurrentTime(t);var r=n.currentTime;this.searchTimelineOffset(r).filter(e).forEach((function(t){"offset-path"===t.property||"playTime"===t.property?t.func(r):t.layer&&t.layer.reset(w()({},t.property,t.func(r)))}))}}},{key:"getSelectedTimeline",value:function(){var t=this.json.timeline,e=t.filter((function(t){return t.selected}));return(e.length?e[0]:t[0])||null}},{key:"getKeyframeListReturnArray",value:function(){var t=this.getSelectedTimeline(),e=[];return t&&t.animations.forEach((function(t){t.properties.forEach((function(t){e.push.apply(e,t.keyframes)}))})),e}},{key:"getKeyframeList",value:function(t){var e=this.getSelectedTimeline();e&&e.animations.forEach((function(n){n.properties.forEach((function(n){n.keyframes.forEach((function(n){t&&t(e,n)}))}))}))}},{key:"getSelectedTimelineLastTime",value:function(){var t=0;return this.getKeyframeList((function(e,n){t=Math.max(n.time,t)})),t}},{key:"getSelectedTimelineFirstTime",value:function(){var t=Number.MAX_SAFE_INTEGER;return this.getKeyframeList((function(e,n){t=Math.min(n.time,t)})),t}},{key:"getSelectedTimelinePrevTime",value:function(){var t=this.getSelectedTimelineFirstTime();return this.getKeyframeList((function(e,n){Uc(e.fps,n.time)e.currentTimecode&&(t=Math.min(n.time,t))})),t}},{key:"setTimelineTitle",value:function(t,e){var n=this.json.timeline.find((function(e){return e.id===t}));n&&(n.title=e)}},{key:"selectTimeline",value:function(t){t?this.json.timeline.forEach((function(e){e.selected=e.id===t})):this.json.timeline.filter((function(t){return t.selected})).length||this.json.timeline.length&&(this.json.timeline.selected=!0);this.compileAll()}},{key:"removeAnimation",value:function(t){this.json.timeline=this.json.timeline.filter((function(e){return e.id!==t})),this.json.timeline.length&&(this.json.timeline[0].selected=!0),this.compileAll()}},{key:"addTimeline",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"00:00:10:00",n=pa(),r=Kf(Kf({id:n,title:"sample"},this.getTimelineLayerInfo(t,e)),{},{animations:[]});return this.json.timeline.push(r),this.selectTimeline(n),r}},{key:"addTimelineLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"00:00:10:00",r=this.getSelectedTimeline();if(r||(r=this.addTimeline(e,n)),r.selected=!0,t){var i=r.animations.filter((function(e){return e.id===t}));i[0]||r.animations.push({id:t,properties:[]})}}},{key:"getTimelineLayerInfo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"00:00:10:00",n=Kc(t,e);return{fps:t,speed:1,direction:"normal",iterationCount:1,currentTimecode:Uc(t,0),totalTimecode:Uc(t,n),currentTime:0,totalTime:n,displayStartTime:0,displayEndTime:n}}},{key:"setTimelineCurrentTime",value:function(t){var e=this.getSelectedTimeline(),n=e.fps,r=e.totalTimecode;if(e){var i=t,a=t;+i+""===i&&(a=Wc(n,i=+i)),a>r&&(a=r);var o=Kc(n,a);e.currentTime=o,e.currentTimecode=Uc(n,o)}}},{key:"setDisplayTimeDxRate",value:function(t,e,n){var r=this.getSelectedTimeline();if(r){var i=t*r.totalTime,a=e+i,o=n+i;a=Math.max(a,0),0===(a=Math.min(a,o))&&(o=n-e),o=Math.max(o,a),(o=Math.min(o,r.totalTime))===r.totalTime&&(a=r.totalTime-(n-e)),r.displayStartTime=a,r.displayEndTime=o}}},{key:"setDisplayStartTimeRate",value:function(t){var e=this.getSelectedTimeline();e&&(e.displayStartTime=t*e.totalTime)}},{key:"setDisplayEndTimeRate",value:function(t){var e=this.getSelectedTimeline();e&&(e.displayEndTime=t*e.totalTime)}},{key:"setTimelineCurrentTimeRate",value:function(t){var e=this.getSelectedTimeline();if(e){var n=e.displayStartTime,r=e.displayEndTime,i=e.fps,a=n+(r-n)*t;this.setTimelineCurrentTime(Uc(i,a))}}},{key:"setTimelineTotalTime",value:function(t){var e=this.getSelectedTimeline();if(e){var n=t,r=t;+n+""===n&&(n=+n,r=Wc(e.fps,n)),Kc(e.fps,r)3&&void 0!==arguments[3]?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,o=this.getTimelineKeyframeById(t,e,n);o&&(Ut(a)&&(o.time=a),Ut(r)&&(o.value=r),Ut(i)&&(o.timing=i),this.compiledTimingFunction(t,e))}},{key:"addTimelineKeyframe",value:function(t){var e=t.layerId,n=t.property,r=t.value,i=t.timing,a=t.time,o=t.editor;this.addTimelineProperty(e,n);var c=this.getSelectedTimeline(),s=this.getTimelineProperty(e,n);if(s){var u=a||c.currentTime;if(!s.keyframes.filter((function(t){return t.time===u})).length){r=Kt(r)||""===r?this.getDefaultPropertyValue(n):r;var l={id:pa(),layerId:e,property:n,time:u,value:r,timing:i||"linear",editor:o};return s.keyframes.push(l),s.keyframes.sort((function(t,e){return t.time>e.time?1:-1})),this.compiledTimingFunction(e,n),l}}}},{key:"getDefaultPropertyValue",value:function(t){switch(t){case"mix-blend-mode":return"normal";case"rotate":return"0deg";case"box-shadow":return"0px 0px 0px 0px rgba(0, 0, 0, 1)";case"text-shadow":return"0px 0px 0px rgba(0, 0, 0, 1)";case"opacity":return 1;default:return""}}},{key:"copyTimelineKeyframe",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.getTimelineProperty(t,e);if(r){var i=this.getSelectedTimeline(),a=n||i.currentTime,o=r.keyframes.filter((function(t){return t.timee.time?-1:1})),c=o[0].value+"",s=o[0].timing+"",u=o[0].editor),this.addTimelineKeyframe({layerId:t,property:e,value:c,timing:s,editor:u})}}},{key:"getTimelineKeyframe",value:function(t,e,n){var r=this.getTimelineProperty(t,e);if(r)return r.keyframes.find((function(t){return t.time===n}))}},{key:"getTimelineKeyframeById",value:function(t,e,n){var r=this.getTimelineProperty(t,e);if(r)return r.keyframes.find((function(t){return t.id===n}))}},{key:"sortTimelineKeyframe",value:function(t,e){var n=this.getTimelineProperty(t,e);n&&(n.keyframes.sort((function(t,e){return t.time>e.time?1:-1})),this.compiledTimingFunction(t,e))}},{key:"setFps",value:function(t){var e=this.getSelectedTimeline();e&&(e.fps=t,e.currentTimecode=Uc(t,e.currentTime),e.totalTimecode=Uc(t,e.totalTime))}},{key:"toCloneObject",value:function(){return Kf(Kf({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),{},{timeline:ee(this.json.timeline)})}}]),n}(function(t){R()(n,t);var e=Xf(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,Nf({comments:[],colors:[],gradients:[],svgfilters:[],svgimages:[],keyframes:[],images:[],imageKeys:[],videos:[],videoKeys:[],audios:[]},t))}},{key:"addKeyframe",value:function(t){return this.json.keyframes.push(t),t}},{key:"createKeyframe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addKeyframe(new Gf(Nf({checked:!0},t)))}},{key:"removeKeyframe",value:function(t){this.removePropertyList(this.json.keyframes,t)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.keyframes[+t].reset(e)}},{key:"toKeyframeString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.json.keyframes.map((function(e){return e.toString(t)})).join("\n\n")}},{key:"copyPropertyList",value:function(t,e){var n=Nf({},t[e]);t.splice(e,0,n)}},{key:"toCloneObject",value:function(){this.json;return Nf(Nf({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("colors","gradients","svgfilters","svgimages","images","keyframes"))}},{key:"removePropertyList",value:function(t,e){t.splice(e,1)}},{key:"removeColor",value:function(t){this.removePropertyList(this.json.colors,t)}},{key:"copyColor",value:function(t){this.copyPropertyList(this.json.colors,t)}},{key:"sortColor",value:function(t,e){this.sortItem(this.json.colors,t,e)}},{key:"setColorValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.colors[t]=Nf(Nf({},this.json.colors[t]),e)}},{key:"getColorIndex",value:function(t){return this.json.colors[t]}},{key:"getColor",value:function(t){return this.json.colors.filter((function(e){return e.name===t}))[0]}},{key:"addColor",value:function(t){return this.json.colors.push(t),t}},{key:"createColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addColor(t)}},{key:"removeImage",value:function(t){this.removePropertyList(this.json.images,t),this.refreshImageKeys()}},{key:"copyImage",value:function(t){this.copyPropertyList(this.json.images,t),this.refreshImageKeys()}},{key:"sortImage",value:function(t,e){this.sortItem(this.json.images,t,e)}},{key:"setImageValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.images[t]=Nf(Nf({},this.json.images[t]),e),this.refreshImageKeys()}},{key:"getImageValueById",value:function(t){var e=this.json.imageKeys[t];if(e)return e.local}},{key:"refreshImageKeys",value:function(){var t={};this.json.images.forEach((function(e){t[e.id]=e})),this.reset({imageKeys:t})}},{key:"addImage",value:function(t){return this.json.images.push(t),this.refreshImageKeys(),t}},{key:"createImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addImage(t)}},{key:"removeVideo",value:function(t){this.removePropertyList(this.json.videos,t),this.refreshVideoKeys()}},{key:"copyVideo",value:function(t){this.copyPropertyList(this.json.videos,t),this.refreshVideoKeys()}},{key:"sortVideo",value:function(t,e){this.sortItem(this.json.videos,t,e)}},{key:"setVideoValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.videos[t]=Nf(Nf({},this.json.videos[t]),e)}},{key:"getVideoValueById",value:function(t){var e=this.json.videoKeys[t];if(e)return e.local}},{key:"refreshVideoKeys",value:function(){var t={};this.json.videos.forEach((function(e){t[e.id]=e})),this.reset({videoKeys:t})}},{key:"addVideo",value:function(t){return this.json.videos.push(t),this.refreshVideoKeys(),t}},{key:"createVideo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addVideo(t)}},{key:"removeGradient",value:function(t){this.removePropertyList(this.json.gradients,t)}},{key:"copyGradient",value:function(t){this.copyPropertyList(this.json.gradients,t)}},{key:"sortGradient",value:function(t,e){this.sortItem(this.json.gradients,t,e)}},{key:"setGradientValue",value:function(t,e){this.json.gradients[t]=Nf(Nf({},this.json.gradients[t]),e)}},{key:"getGradientIndex",value:function(t){return this.json.gradients[t]}},{key:"getGradient",value:function(t){return this.json.gradients.filter((function(e){return e.name===t}))[0]}},{key:"addGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.json.gradients.push(t),t}},{key:"createGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addGradient(t)}},{key:"getSVGFilterIndex",value:function(t){var e,n=this.json.svgfilters.map((function(t,e){return{id:t.id,index:e}})).filter((function(e){return e.id===t}));return n.length?null==n||null===(e=n[0])||void 0===e?void 0:e.index:-1}},{key:"removeSVGFilter",value:function(t){this.removePropertyList(this.json.svgfilters,t)}},{key:"copySVGFilter",value:function(t){this.copyPropertyList(this.json.svgfilters,t)}},{key:"sortSVGFilter",value:function(t,e){this.sortItem(this.json.svgfilters,t,e)}},{key:"setSVGFilterValue",value:function(t,e){this.json.svgfilters[t]=Nf(Nf({},this.json.svgfilters[t]),e)}},{key:"addSVGFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.json.svgfilters.push(t);var e=this.json.svgfilters.length-1;return e}},{key:"createSVGFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSVGFilter(t)}},{key:"getSVGImageIndex",value:function(t){var e=this.json.svgimages.map((function(t,e){return{id:t.id,index:e}})).filter((function(e){return e.id===t}))[0];return e?e.index:-1}},{key:"removeSVGImage",value:function(t){this.removePropertyList(this.json.svgimages,t)}},{key:"copySVGImage",value:function(t){this.copyPropertyList(this.json.svgimages,t)}},{key:"sortSVGImage",value:function(t,e){this.sortItem(this.json.svgimages,t,e)}},{key:"setSVGImageValue",value:function(t,e){this.json.svgimages[t]=Nf(Nf({},this.json.svgimages[t]),e)}},{key:"addSVGImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.json.svgimages.push(t);var e=this.json.svgimages.length-1;return e}},{key:"createSVGImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSVGImage(t)}}]),n}(Va));function Zf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qf(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,qf({itemType:"project",name:"new Project",description:"",rootVariable:""},t))}},{key:"toCloneObject",value:function(){return qf(qf({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("name","description","rootVariable"))}},{key:"artboards",get:function(){return(this.json.layers||[]).filter((function(t){return t.is("artboard")}))}},{key:"offsetX",get:function(){return Qf}},{key:"offsetY",get:function(){return th}},{key:"hasLayout",value:function(){return!1}},{key:"getTransformMatrix",value:function(){return r.create()}},{key:"resetMatrix",value:function(t){var e=r.getTranslation([],ca(t.accumulatedMatrix,t.localMatrixInverse)),n=zt()(e,2),i=n[0],a=n[1];t.reset({x:Sa.px(i),y:Sa.px(a)})}},{key:"rectVerties",get:function(){var t;return null!==(t=this.layers)&&void 0!==t&&t.length?Io(this.layers):null}},{key:"accumulatedMatrix",get:function(){return eh}},{key:"accumulatedMatrixInverse",get:function(){return eh}},{key:"contentBox",get:function(){return{left:0,top:0,width:0,height:0}}}]),n}(Wf);function rh(t,e){var n=[];return t.layers.length&&t.layers.forEach((function(t){n.push.apply(n,rh(t,e))})),(e.id||e.includes(t.id))&&n.push(t),n}var ih=function(){function t(e){var n=this;O()(this,t),this.$editor=e,this.project=null,this.items=[],this.itemKeys={},this.hoverId="",this.hoverItems=[],this.ids=[],this.idsString="",this.colorsteps=[],this.cachedItemVerties=[],this.cachedArtBoardVerties=[],this.cachedVerties=Vo(0,0,0,0,"50% 50% 0px"),this.selectionCamera=new Yc({parent:this.currentProject,x:Sa.px(0),y:Sa.px(0),width:Sa.px(0),height:Sa.px(0)}),this.$editor.on("config:bodyEvent",(function(){n.refreshMousePosition()}))}return j()(t,[{key:"refreshMousePosition",value:function(){var t=this.$editor.config,e=this.$editor.viewport.getWorldPosition();this.pos=e,this.column=Math.ceil(e[0]/t.get("area.width")),this.row=Math.ceil(e[1]/t.get("area.width"))}},{key:"initialize",value:function(){this.items=[],this.itemKeys={},this.ids=[],this.idsString="",this.cachedItemVerties={}}},{key:"current",get:function(){return this.items[0]}},{key:"currentProject",get:function(){return this.project}},{key:"isEmpty",get:function(){return!this.length}},{key:"isOne",get:function(){return 1===this.length}},{key:"isMany",get:function(){return this.length>1}},{key:"length",get:function(){return this.items.length}},{key:"isLayoutItem",get:function(){var t;return null===(t=this.current)||void 0===t?void 0:t.isLayoutItem()}},{key:"allLayers",get:function(){return this.currentProject.allLayers||[]}},{key:"filteredLayers",get:function(){var t=this;return this.currentProject.filteredAllLayers((function(e){var n=e.areaPosition;if(!n)return!1;var r=n.column,i=n.row;return r[0]<=t.column&&t.column<=r[1]&&i[0]<=t.row&&t.row<=i[1]})).filter((function(e){return e.hasPoint(t.pos[0],t.pos[1])}))}},{key:"snapTargetLayers",get:function(){var t=this;return this.currentProject?this.currentProject.allLayers.filter((function(e){return!e.is("project")&&(!t.check(e)&&e.verties.some((function(e){return t.$editor.viewport.checkInViewport(e)})))})):[]}},{key:"snapTargetLayersWithSelection",get:function(){var t=this;return this.currentProject?this.currentProject.allLayers.filter((function(e){return!e.is("project")&&e.verties.some((function(e){return t.$editor.viewport.checkInViewport(e)}))})):[]}},{key:"selectedArtboards",get:function(){return ce()(new Set(this.items.map((function(t){return t.artboard}))))}},{key:"hasChangedField",value:function(){var t;return!!this.current&&(t=this.current).hasChangedField.apply(t,arguments)}},{key:"getRootItem",value:function(t){var e=t;return t&&t.parent&&(e=t.parent),e}},{key:"selectColorStep",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:null,e=[];if(Array.isArray(t)?e=t:(Zt(t)||qt(t))&&(e=[t]),e.length){var n=this.project,r=[],i=[];e.forEach((function(t){n.hasIndexItem(t)?r.push(n.getIndexItem(t)):i.push(t)}));var a=rh(this.project,i);return a.forEach((function(t){n.addIndexItem(t)})),r.push.apply(r,a),r}return this.items}},{key:"makeItemMap",value:function(t){var e={};return this.ids.forEach((function(n){e[n]=ee(t)})),e}},{key:"selectById",value:function(t){t&&this.select.apply(this,ce()(rh(this.project,t)))}},{key:"selectAfterCopy",value:function(){this.select.apply(this,ce()(this.items.map((function(t){return t.copy()}))))}},{key:"addById",value:function(t){this.itemKeys[t]||this.select.apply(this,ce()(this.items).concat(ce()(rh(this.project,t))))}},{key:"removeById",value:function(t){var e=t;Zt(t)&&(e=[t]);var n=this.items.filter((function(t){return!1===e.includes(t.id)}));this.select.apply(this,ce()(n))}},{key:"toggleById",value:function(t){this.itemKeys[t]?this.removeById(t):this.addById(t)}},{key:"getArtboardByPoint",value:function(t){return this.currentProject.artboards.find((function(e){return Co(e.matrix.verties.filter((function(t,e){return e<4})),t[0],t[1])}))}},{key:"changeArtBoard",value:function(){var t=this,e=!1;return this.each((function(n){if(!1===n.is("artboard")){var r=n.originVerties;if(n.artboard){var i=n.artboard.originVerties;if(Co(i,r[0][0],r[0][1])||To(r,i))return!1}var a=t.cachedArtBoardVerties.find((function(t){var e=t.matrix.verties.filter((function(t,e){return e<4}));return Co(e,r[0][0],r[0][1])||To(r,e)}));a?a.item!==n.artboard&&(a.item.appendChildItem(n),e=!0):n.artboard&&(t.currentProject.appendChildItem(n),e=!0)}})),e}},{key:"setRectCache",value:function(){if(this.isEmpty)return this.cachedVerties=[],this.cachedRectVerties=[],this.cachedItemVerties=[],void(this.cachedArtBoardVerties=this.currentProject.artboards.map((function(t){return{item:t,matrix:t.matrix}})));this.cachedVerties=this.verties,this.cachedRectVerties=Bo(this.verties),this.cachedItemVerties=this.items.map((function(t){return t.fakeParent=void 0,t.matrix})),this.cachedArtBoardVerties=this.currentProject.artboards.map((function(t){return{item:t,matrix:t.matrix}}))}},{key:"verties",get:function(){return this.isOne?this.current.verties:this.rectVerties}},{key:"selectionVerties",get:function(){return this.isOne?this.current.selectionVerties():this.rectVerties}},{key:"rectVerties",get:function(){return this.isEmpty?[]:Io(this.items)}},{key:"itemRect",get:function(){var t=this.verties;return{x:Sa.px(t[0][0]),y:Sa.px(t[0][1]),width:Sa.px(i.distance(t[0],t[1])),height:Sa.px(i.distance(t[0],t[3]))}}},{key:"toCloneObject",value:function(){var t={};return this.each((function(e){t[e.id]=e.toCloneObject(!1)})),t}},{key:"pack",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n={},r=[];return null===e?r=this.items:(Zt(e)||Array.isArray(e))&&(r=this.itemsByIds(e)),r.forEach((function(e){n[e.id]={},Object.keys(t).forEach((function(r){n[e.id][r]=Jt(t[r])?t[r].call(t,e):t[r]}))})),n}},{key:"each",value:function(t){Jt(t)&&this.items.forEach((function(e,n){t(e)}))}},{key:"map",value:function(t){return Jt(t)?this.items.map((function(e,n){return t(e,n)})):this.items}},{key:"reset",value:function(t){var e=this;Object.entries(t).forEach((function(t){var n,r=zt()(t,2),i=r[0],a=r[1];null===(n=e.get(i))||void 0===n||n.reset(a)}))}},{key:"resetCallback",value:function(t){this.each((function(e){return e.reset(t(e))}))}},{key:"resize",value:function(){this.each((function(t){return t.resize()}))}},{key:"remove",value:function(){this.each((function(t){return t.remove()})),this.empty()}},{key:"copy",value:function(){this.copyItems=this.items.map((function(t){return t}))}},{key:"paste",value:function(){this.select.apply(this,ce()(this.copyItems.map((function(t){return t.copy(10)})))),this.copy()}},{key:"isInParent",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t,r=n.parent,i=e.includes(r);!i&&!Kt(r);)n=r,r=r.parent,i=e.includes(r);return i}},{key:"hasPoint",value:function(t){return this.isMany?Co(this.rectVerties,t[0],t[1]):this.cachedItemVerties.some((function(e){return Co(e.verties,t[0],t[1])}))}},{key:"checkHover",value:function(t){return Zt(t)?this.hoverId===t:this.hoverItems.findIndex((function(e){return e.id===t.id}))>-1}},{key:"setHoverId",value:function(t){var e=!1;return!t||this.itemKeys[t]||this.cachedArtBoardVerties.find((function(e){return e.item.id===t}))?(""!=this.hoverId&&(e=!0),this.hoverId="",this.hoverItems=[]):(this.hoverId!=t&&(e=!0),this.hoverId=t,this.hoverItems=this.itemsByIds([t]).filter((function(t){return!1===t.is("artboard")})),0===this.hoverItems.length&&(this.hoverId="",e=!0)),e&&this.$editor.emit("changeHoverItem"),e}}]),t}(),ah=function(){function t(e){O()(this,t),this.editor=e,this.components={},this.inspectors={}}return j()(t,[{key:"registerComponent",value:function(t,e){if(this.components[t])throw new Error("It has duplicated item name. "+t);this.components[t]=e}},{key:"registerInspector",value:function(t,e){if(this.inspectors[t])throw new Error("It has duplicated item name. "+t);this.inspectors[t]=e}},{key:"getComponentClass",value:function(t){return this.components[t]||this.components.rect}},{key:"getInspector",value:function(t){return this.inspectors[t]}},{key:"createComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getComponentClass(t);if(!n)throw new Error("".concat(t," type is not valid."));return new n(e)}},{key:"createInspector",value:function(t){var e=this.getInspector(t.itemType);return Jt(e)?e(t)||[]:Jt(t.getProps)&&t.getProps()||[]}}]),t}();function oh(t){t.emit("noneSelectMenu"),t.nextTick((function(){t.emit("refreshAll"),t.emit("refreshSelectionTool")}))}function ch(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sh(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:[];t.emit("updateResource",e)}},yh={command:"updateImage",execute:function(t,e,n,r){var i=new FileReader;i.onload=function(i){var a=i.target.result,o=URL.createObjectURL(e);t.emit("addImageAssetItem",{id:pa(),type:e.type,name:e.name,original:a,local:o},n,r)},i.readAsDataURL(e)}},gh={command:"updateVideo",execute:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=new FileReader;i.onload=function(i){var a=i.target.result,o=URL.createObjectURL(e);t.emit("addVideoAssetItem",{id:pa(),type:e.type,name:e.name,original:a,local:o},n,r)},i.readAsDataURL(e)}};function mh(t,e){var n=new Image;n.onload=function(){var r={id:t.id,local:t.local,naturalWidth:Sa.px(n.naturalWidth),naturalHeight:Sa.px(n.naturalHeight),width:Sa.px(n.naturalWidth),height:Sa.px(n.naturalHeight)};e&&e(r,n)},n.onerror=function(t){console.log(t,t.message)},n.src=t.local}function bh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kh(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=t.selection.currentProject;i&&(i.createImage(e),t.emit("addImageAsset"),mh(e,(function(i){var a=n.width.value/i.width.value,o=n.width,c=Sa.px(i.height.value*a);t.emit("addImage",kh(kh(kh({src:e.id},i),n),{},{width:o,height:c}),r),t.changeMode(Lg),t.emit("afterChangeMode")})))}};function wh(t,e){var n=document.createElement("video");n.onloadeddata=function(){var r={local:t.local,naturalWidth:Sa.px(n.videoWidth),naturalHeight:Sa.px(n.videoHeight),width:Sa.px(n.videoWidth),height:Sa.px(n.videoHeight),duration:n.duration,playTime:"0:1:".concat(n.duration),volume:n.volume,muted:n.muted,placebackRate:n.playbackRate};e&&e(r,n)},n.src=t.local}function Ph(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Oh(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,i=t.selection.currentProject;i&&(i.createVideo(e),t.emit("addVideoAsset"),wh(e,(function(i){t.emit("addVideo",Oh(Oh({src:e.id},i),n),r),t.changeMode(Lg),t.emit("afterChangeMode")})))}};function jh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var $h={command:"dropImageUrl",execute:function(t,e){mh({local:e},(function(e){t.emit("addImage",function(t){for(var e=1;e1&&void 0!==arguments[1]&&arguments[1],r=e.split("data:"),i=zt()(r,2),a=(i[0],i[1]),o=a.split(","),c=Ia()(o),s=c[0],u=c.slice(1),l=s.split(";"),f=zt()(l,2),h=f[0],p=f[1];return u=u.join(","),{mimeType:h,local:n&&t.getLink(h,p,u)}}},{key:"getLink",value:function(t,e,n){if("base64"===e){for(var r=atob(n),i=r.length,a=new Uint8Array(i),o=0;o-1){var r=Th.parse(n,!0);switch(r.mimeType){case"image/png":case"image/gif":case"image/jpg":case"image/jpeg":t.emit("addImageAssetItem",{id:pa(),type:r.mimeType,name:"",original:n,local:r.local})}}else{var i=e.data.split(".").pop(),a=e.data.split("/").pop();switch(i){case"png":case"jpg":case"gif":case"svg":t.emit("addImageAssetItem",{id:pa(),type:"image/"+i,name:a,original:e.data,local:e.data})}}}};function Eh(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"easylogic.json",n=document.createElement("a");n.href=t,n.download=e,n.click()}var Ih={command:"downloadJSON",execute:function(t,e){var n=JSON.stringify(t.projects);Eh("data:application/json;base64,"+window.btoa(n),e||"easylogic.json")}},Dh=function(t,e){return t.replaceLocalUrltoRealUrl(t.svg.render(e))},Lh={command:"downloadSVG",execute:function(t){var e=t.selection.current;if(e){var n=Dh(t,e).trim();Eh("data:image/svg+xml;base64,"+window.btoa(n),e.id)}}};function Bh(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png",r=Ka.create("canvas"),i=t.width,a=t.height;r.resize({width:i,height:a}),r.drawImage(t),e&&e(r.toDataURL(n))}var Ah={command:"downloadPNG",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.selection.current;if(n){var r=Dh(t,n).trim(),i="data:image/svg+xml;base64,"+window.btoa(r),a=n.id;mh({local:i},(function(n,r){Bh(r,(function(n){Eh(n,a),e&&t.emit(e,n)}))}))}}},zh={command:"load.json",execute:function(t,e){0===(e=t.loadResource("projects",[])||e).length&&(e=[{itemType:"project",layers:[{itemType:"artboard",name:"New ArtBoard",x:"300px",y:"200px",width:"375px",height:"667px","background-color":"white",layer:[]}]}]);var n=e.map((function(e){return t.createItem(e)}));if(n.forEach((function(t){t.artboards.forEach((function(e){t.selectTimeline(e.id)}))})),n.length){var r=n[0];t.selection.selectProject(r),t.load(n),oh(t)}}};function Fh(t,e){var n=t.selection.currentProject;if(n){var r=n.getSelectedTimeline();e&&e(n,r)}}var Hh={command:"addTimelineProperty",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{timing:"linear"};Fh(t,(function(r,i){var a;!1===Array.isArray(e)&&(e=[e]);var o=[];e.forEach((function(t){var e={layerId:t,property:n.property,value:n.value+"",timing:n.timing,editor:n.editor},i=r.addTimelineKeyframe(e);i&&o.push(i)})),(a=t.timeline).select.apply(a,o),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Gh={command:"setTimelineOffset",debounce:100,execute:function(t,e){Fh(t,(function(n,r){n.setTimelineKeyframeOffsetValue(e.layerId,e.property,e.id,e.value,e.timing,e.time),t.emit("refreshTimeline")}))}},_h={command:"addTimelineCurrentProperty",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timing:"linear"};Fh(t,(function(n,r){var i,a=[];t.selection.each((function(t){var r={layerId:t.id,property:e.property,value:t[e.property]+"",timing:e.timing,editor:e.editor},i=n.addTimelineKeyframe(r);i&&a.push(i)})),(i=t.timeline).select.apply(i,a),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Nh={command:"removeTimelineProperty",execute:function(t,e,n){Fh(t,(function(r,i){r.removeTimelineProperty(e,n),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Xh={command:"deleteTimelineKeyframe",execute:function(t){Fh(t,(function(e,n){t.timeline.each((function(t){e.deleteTimelineKeyframe(t.layerId,t.property,t.id)})),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Yh={command:"selectTimelineItem",execute:function(t,e){Fh(t,(function(n,r){n.selectTimeline(e),t.emit("refreshTimeline"),t.emit("selectTimeline")}))}},Kh={command:"removeTimeline",execute:function(t,e){Fh(t,(function(n,r){n.removeTimeline(e),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Uh={command:"removeAnimationItem",execute:function(t,e){Fh(t,(function(n,r){n.removeAnimation(e),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("removeAnimation")}))}},Wh={command:"addTimelineKeyframe",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timing:"linear"};Fh(t,(function(n,r){var i=n.searchById(e.layerId),a={layerId:e.layerId,property:e.property,time:e.time,value:i[e.property]+"",timing:e.timing,editor:e.editor},o=n.addTimelineKeyframe(a);t.timeline.select(o),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Zh={command:"copyTimelineProperty",execute:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Fh(t,(function(i,a){i.copyTimelineKeyframe(e,n,r),t.emit("refreshTimeline")}))}},qh={command:"playTimelineItem",description:"Play button action",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";t.selection.empty(),t.emit("refreshSelection"),t.changeMode("play"),t.emit("afterChangeMode"),Fh(t,(function(i,a){var o=i.getSelectedTimelineLastTime();t.timer?t.timer.stop():t.timer=Zc({elapsed:1e3*a.currentTime,speed:e,duration:1e3*o,iterationCount:n,direction:r}),t.timer.play({duration:1e3*o,elapsed:1e3*a.currentTime,speed:e,iterationCount:n,direction:r,tick:function(e,n){i.seek(Uc(a.fps,e/1e3)),t.emit("playTimeline")},last:function(e,n){i.seek(Uc(a.fps,e/1e3)),t.emit("playTimeline"),t.nextTick((function(){t.emit("stopTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))},stop:function(e,n){i.stop(Uc(a.fps,e/1e3)),t.emit("stopTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}})}))}},Jh={command:"prevTimelineItem",execute:function(t){Fh(t,(function(e,n){var r=e.getSelectedTimelinePrevTime();e.setTimelineCurrentTime(Uc(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},Qh={command:"firstTimelineItem",execute:function(t){Fh(t,(function(e,n){var r=e.getSelectedTimelineFirstTime();e.setTimelineCurrentTime(Uc(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},tp={command:"nextTimelineItem",execute:function(t){Fh(t,(function(e,n){var r=e.getSelectedTimelineNextTime();e.setTimelineCurrentTime(Uc(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},ep={command:"lastTimelineItem",execute:function(t){Fh(t,(function(e,n){var r=e.getSelectedTimelineLastTime();e.setTimelineCurrentTime(Uc(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},np={command:"addTimelineItem",execute:function(t,e){Fh(t,(function(n,r){e?n.addTimelineLayer(e):n.addTimeline(),t.emit("refreshTimeline"),t.emit("addTimeline")}))}},rp={command:"drop.asset",execute:function(){var t=La()(Fa.a.mark((function t(e,n){var r,i,a=arguments;return Fa.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=a.length>2&&void 0!==a[2]?a[2]:null,!n.color){t.next=5;break}e.emit("addBackgroundColor",n.color,r),t.next=22;break;case 5:if(!n.gradient){t.next=9;break}e.emit("addBackgroundImageGradient",n.gradient,r),t.next=22;break;case 9:if(!n.pattern){t.next=13;break}e.emit("addBackgroundImagePattern",n.pattern,r),t.next=22;break;case 13:if(!n.imageUrl){t.next=17;break}e.emit("addBackgroundImageAsset",n.imageUrl,r),t.next=22;break;case 17:if(!n.asset){t.next=22;break}return t.next=20,e.storageManager.getCustomAsset(n.asset.id);case 20:(i=t.sent)&&e.emit("addArtBoard",i,n.asset.center);case 22:oh(e);case 23:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},ip={command:"addBackgroundImageGradient",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;console.log(n);var r=t.selection.itemsByIds(n);console.log(r);var i={};r.forEach((function(t){var n=jl.parseStyle(kc(t["background-image"]));n.unshift(new jl({image:jl.parseImage(e)})),i[t.id]={"background-image":jl.join(n)}})),t.emit("history.setAttributeForMulti","add gradient",i)}},ap={command:"addBackgroundImageAsset",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n),i={};r.forEach((function(t){var n=jl.parseStyle(kc(t["background-image"]));n.unshift(new jl({image:new Uu({url:e})})),i[t.id]={"background-image":jl.join(n)}})),t.emit("history.setAttributeForMulti","add background image",i)}},op={command:"removeLayer",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;t.selection.itemsByIds(e||t.selection.ids).forEach((function(t){t.remove()})),t.selection.empty(),t.nextTick((function(){t.emit("refreshAll")}))}},cp={command:"change.mode.view",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CanvasView";t.changeModeView(e)}},sp={command:"segment.move.down",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.emit("moveSegment",0,n)}},up={command:"segment.move.up",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.emit("moveSegment",0,-1*n)}},lp={command:"segment.move.right",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.emit("moveSegment",n,0)}},fp={command:"segment.move.left",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.emit("moveSegment",-1*n,0)}},hp=new Map,pp=function(){function t(){O()(this,t)}return j()(t,null,[{key:"has",value:function(t){return hp.has(t)}},{key:"get",value:function(t){return hp.get(t)}},{key:"set",value:function(t,e){hp.size>1e3&&hp.clear(),hp.set(t,e)}}]),t}();function dp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vp(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,vp({itemType:"pattern"},t))}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value||"",")")}}],[{key:"parse",value:function(t){var e=$p[t.type];if(e)return new e(t)}},{key:"parseStyle",value:function(t){var e=[];if(!t)return e;if(pp.has(t))return pp.get(t);var r=Ds(t);return(r.str.match(gp)||[]).forEach((function(t,i){var a=t.split("("),o=zt()(a,2),c=o[0],s=o[1],u=(s=s.split(")")[0]).split(",").map((function(t){return t.trim()})),l=zt()(u,6),f=l[0],h=l[1],p=l[2],d=l[3],v=l[4],y=l[5],g=f.split(" "),m=zt()(g,2),b=m[0],k=m[1],x=h.split(" "),w=zt()(x,2),P=w[0],O=w[1],S=(y||"").split(" "),j=zt()(S,2),$=j[0],R=j[1];e[i]=n.parse({type:c,x:Sa.parse(P),y:Sa.parse(O),width:Sa.parse(b),height:Sa.parse(k),foreColor:Bs(p,r.matches),backColor:Bs(d,r.matches),blendMode:v||"normal",lineWidth:Sa.parse($||"1px"),lineHeight:Sa.parse(R||"1px")})})),pp.set(t,e),e}},{key:"join",value:function(t){return t.map((function(t){return n.parse(t)})).join(" ")}},{key:"toCSS",value:function(t){var e=[];return n.parseStyle(t).forEach((function(t){e.push.apply(e,jl.parseStyle(kc(t.toCSS())))})),jl.joinCSS(e)}}]),n}(Tc),bp=function(t){R()(n,t);var e=yp(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"base",x:Sa.z(),y:Sa.z(),width:Sa.px(20),height:Sa.px(20),lineWidth:Sa.px(1),lineHeight:Sa.px(1),foreColor:"black",backColor:"white",blendMode:"normal"})}},{key:"convert",value:function(t){return(t=$a()(V()(n.prototype),"convert",this).call(this,t)).width=Sa.parse(t.width),t.height=Sa.parse(t.height),t.lineWidth=Sa.parse(t.lineWidth),t.lineHeight=Sa.parse(t.lineHeight),t.x=Sa.parse(t.x),t.y=Sa.parse(t.y),t}},{key:"toString",value:function(){var t=this.json,e=t.type,n=t.width,r=t.height,i=t.x,a=t.y,o=t.foreColor,c=t.backColor,s=t.blendMode,u=t.lineWidth,l=t.lineHeight;return"".concat(e,"(").concat(n," ").concat(r,", ").concat(i," ").concat(a,", ").concat(o,", ").concat(c,", ").concat(s,", ").concat(u," ").concat(l,")")}}]),n}(mp),kp=function(t){R()(n,t);var e=yp(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"check"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,i=t.y,a=t.backColor,o=t.foreColor,c=t.blendMode;return a=a||"transparent","\n background-image: repeating-linear-gradient(45deg, ".concat(o=o||"black"," 25%, ").concat(a," 25%, ").concat(a," 75%, ").concat(o," 75%, ").concat(o," 100%),repeating-linear-gradient(45deg, ").concat(o," 25%, ").concat(a," 25%, ").concat(a," 75%, ").concat(o," 75%, ").concat(o," 100%);\n background-position: 0px 0px, ").concat(r," ").concat(i,";\n background-size: ").concat(e," ").concat(n,", ").concat(e," ").concat(n,";\n background-blend-mode: ").concat(c,", ").concat(c,";\n ")}}]),n}(bp),xp=function(t){R()(n,t);var e=yp(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"grid"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.lineWidth,i=t.lineHeight,a=t.backColor,o=t.foreColor,c=t.blendMode;return a=a||"transparent","\n background-image: linear-gradient(".concat(o=o||"black"," ").concat(i,", ").concat(a," ").concat(i,"),linear-gradient(to right, ").concat(o," ").concat(r,", ").concat(a," ").concat(r,");\n background-size: ").concat(e.value/2,"px ").concat(n.value/2,"px, ").concat(e.value/2,"px ").concat(n.value/2,"px; \n background-blend-mode: ").concat(c,", ").concat(c,"; \n ")}}]),n}(bp),wp=function(t){R()(n,t);var e=yp(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"dot"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.lineWidth,i=(t.lineHeight,t.backColor),a=t.foreColor,o=t.blendMode;return i=i||"transparent","\n background-image: radial-gradient(".concat(a=a||"black"," ").concat(r,", ").concat(i," ").concat(r,");\n background-size: ").concat(e.value/2,"px ").concat(n.value/2,"px; \n background-blend-mode: ").concat(o,"; \n ")}}]),n}(bp),Pp=function(t){R()(n,t);var e=yp(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"cross-dot"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,i=t.y,a=t.lineWidth,o=(t.lineHeight,t.backColor),c=t.foreColor,s=t.blendMode;return o=o||"transparent","\n background-image: radial-gradient(".concat(c=c||"black"," ").concat(a,", ").concat(o," ").concat(a,"),radial-gradient(").concat(c," ").concat(a,", ").concat(o," ").concat(a,");\n background-size: ").concat(e," ").concat(n,",").concat(e," ").concat(n,";\n background-position: 0px 0px, ").concat(r," ").concat(i,"; \n background-blend-mode: multiply, ").concat(s,";\n ")}}]),n}(bp),Op=function(t){R()(n,t);var e=yp(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"diagonal-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,i=t.lineWidth,a=t.backColor,o=t.foreColor,c=t.blendMode;return a=a||"transparent",o=o||"black","\n background-image: repeating-linear-gradient(".concat(r,", ").concat(o," 0px, ").concat(o," ").concat(i,", ").concat(a," 0px, ").concat(a," 50%);\n background-size: ").concat(e," ").concat(n,"; \n background-blend-mode: ").concat(c,";\n ")}}]),n}(bp),Sp=function(t){R()(n,t);var e=yp(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"vertical-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,i=t.y,a=t.lineWidth,o=t.backColor,c=t.foreColor,s=t.blendMode;return o=o||"transparent","\n background-image: repeating-linear-gradient(to right, ".concat(c=c||"black"," 0px, ").concat(c," ").concat(a,", ").concat(o," ").concat(a,", ").concat(o," 100%);\n background-size: ").concat(e," ").concat(n,"; \n background-position: ").concat(r," ").concat(i,"; \n background-blend-mode: ").concat(s,";\n ")}}]),n}(bp),jp=function(t){R()(n,t);var e=yp(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getDefaultObject",value:function(){return $a()(V()(n.prototype),"getDefaultObject",this).call(this,{type:"horizontal-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,i=t.y,a=t.lineWidth,o=t.backColor,c=t.foreColor,s=t.blendMode;return o=o||"transparent","\n background-image: repeating-linear-gradient(0deg, ".concat(c=c||"black"," 0px, ").concat(c," ").concat(a,", ").concat(o," ").concat(a,", ").concat(o," 100%); \n background-position: ").concat(r," ").concat(i,";\n background-size: ").concat(e," ").concat(n,"; \n background-blend-mode: ").concat(s,";\n ")}}]),n}(bp),$p={check:kp,grid:xp,dot:wp,"cross-dot":Pp,"diagonal-line":Op,"vertical-line":Sp,"horizontal-line":jp},Rp={command:"addBackgroundImagePattern",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n),i={};r.forEach((function(t){i[t.id]={pattern:mp.join([].concat(ce()(mp.parseStyle(e)),ce()(mp.parseStyle(t.pattern))))}})),t.emit("history.setAttributeForMulti","add pattern",i)}},Cp={command:"addBackgroundColor",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.command("setAttributeForMulti","add background color",t.selection.packByValue({"background-color":e},n))}};var Mp={command:"sort.center",execute:function(t){if(t.selection.isOne){var e=t.selection.current;if(e.parent.is("project"));else if(e.artboard){var n=ea(e.artboard.verties)-ea(t.selection.verties);t.emit("moveLayer",n,0)}}else if(t.selection.isMany){var r=ea(t.selection.verties);t.emit("moveLayerForItems",t.selection.map((function(t){var e=ea(t.verties);return{item:t,dist:[r-e,0,0]}})))}}},Tp={command:"sort.left",execute:function(t){if(t.selection.isOne){var e=t.selection.current;if(e.parent.is("project"));else if(e.artboard){var n=ta(e.artboard.verties)-ta(t.selection.verties);t.emit("moveLayer",n,0)}}else if(t.selection.isMany){var r=ta(t.selection.verties);t.emit("moveLayerForItems",t.selection.map((function(t){var e=ta(t.verties);return{item:t,dist:[r-e,0,0]}})))}}},Vp={command:"sort.middle",execute:function(t){if(t.selection.isOne){var e=t.selection.current;if(e.parent.is("project"));else if(e.artboard){var n=ra(e.artboard.verties)-ra(t.selection.verties);t.emit("moveLayer",0,n)}}else if(t.selection.isMany){var r=ra(t.selection.verties);t.emit("moveLayerForItems",t.selection.map((function(t){var e=ra(t.verties);return{item:t,dist:[0,r-e,0,0]}})))}}},Ep={command:"sort.bottom",execute:function(t){if(t.selection.isOne){var e=t.selection.current;if(e.parent.is("project"));else if(e.artboard){var n=Qi(e.artboard.verties)-Qi(t.selection.verties);t.emit("moveLayer",0,n)}}else if(t.selection.isMany){var r=Qi(t.selection.verties);t.emit("moveLayerForItems",t.selection.map((function(t){var e=Qi(t.verties);return{item:t,dist:[0,r-e,0,0]}})))}}},Ip={command:"sort.top",execute:function(t){if(t.selection.isOne){var e=t.selection.current;if(e.parent.is("project"));else if(e.artboard){var n=na(e.artboard.verties)-na(t.selection.verties);t.emit("moveLayer",0,n)}}else if(t.selection.isMany){var r=na(t.selection.verties);t.emit("moveLayerForItems",t.selection.map((function(t){var e=na(t.verties);return{item:t,dist:[0,r-e,0,0]}})))}}},Dp={command:"sort.right",execute:function(t){if(t.selection.isOne){var e=t.selection.current;if(e.parent.is("project"));else if(e.artboard){var n=Ji(e.artboard.verties)-Ji(t.selection.verties);t.emit("moveLayer",n,0)}}else if(t.selection.isMany){var r=Ji(t.selection.verties);t.emit("moveLayerForItems",t.selection.map((function(t){var e=Ji(t.verties);return{item:t,dist:[r-e,0,0]}})))}}},Lp={command:"same.width",description:"fit at the same width",execute:function(t){if(console.log(t.selection.isMany),t.selection.isMany){var e=Do(t.selection.verties);t.command("setAttributeForMulti","fit at the same width",t.selection.packByValue({x:e.x,width:e.width}))}}},Bp={command:"same.height",description:"fit at the same height",execute:function(t){var e=t.selection.length;if(1==e);else if(e>1){var n=Do(t.selection.verties);t.command("setAttributeForMulti","fit at the same height",t.selection.packByValue({y:n.y,height:n.height}))}}};var Ap={command:"item.move.depth.down",execute:function(t){var e=t.selection.current;e&&e.orderPrev(),oh(t)}},zp={command:"item.move.depth.up",execute:function(t){var e=t.selection.current;e&&e.orderNext(),oh(t)}};function Fp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Hp={command:"group.item",execute:function(t){if(0!==t.selection.length){var e=t.selection.currentProject;if(e){e.generateListNumber();var n=t.selection.map((function(t){return{depth:t.depth,item:t}}));n.sort((function(t,e){return t.depth===e.depth?t.no>e.no?-1:1:t.depth>e.depth?1:-1}));var r=t.createItem(function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"selection",n=t.selection.ids,r=t.history.selectedIds;Sc(n,r)||(t.history.add(e,this,{currentValues:n,undoValues:r}),this.nextAction(t))},nextAction:function(t){t.nextTick((function(){t.history.saveSelection(),t.emit("refreshSelection"),t.nextTick((function(){t.emit("refreshSelectionTool")}))}))},redo:function(t,e){var n=e.currentValues;t.selection.selectById(n),this.nextAction(t)},undo:function(t,e){var n=e.undoValues;t.selection.selectById(n),this.nextAction(t)}},Np={command:"setAttributeForMulti",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(e).forEach((function(n){var r=e[n];t.selection.itemsByIds(n).forEach((function(e){var i={};Object.keys(r).forEach((function(t){var n=r[t];i[t]=Jt(n)?n(e):n})),e.reset(i)&&(t.emit("refreshElement",e),t.emit("changeValue",n,i))}))}))}},Xp={command:"history.setAttributeForMulti",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.emit("setAttributeForMulti",n),t.history.add(e,this,{currentValues:[n],undoValues:t.history.getUndoValuesForMulti(n)}),t.nextTick((function(){t.history.saveSelection()}))},redo:function(t,e){var n=e.currentValues;t.emit.apply(t,["setAttributeForMulti"].concat(ce()(n))),t.nextTick((function(){t.selection.reselect(),t.emit("refreshAll")}))},undo:function(t,e){var n=e.undoValues,r=Object.keys(n);t.selection.itemsByIds(r).forEach((function(t){t.reset(n[t.id])})),t.selection.reselect(),t.nextTick((function(){t.emit("refreshAll")}))}},Yp={command:"history.addLayer",description:"add layer in history ",execute:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5?arguments[5]:void 0;t.emit("addLayer",n,i,a,o),t.nextTick((function(){t.history.add(e,r,{currentValues:[n,{},a,n.parent],undoValues:[n.id]})})),t.nextTick((function(){t.history.saveSelection()}))},redo:function(t,e){var n=e.currentValues;t.emit.apply(t,["addLayer"].concat(ce()(n))),t.nextTick((function(){t.emit("refreshAll")}))},undo:function(t,e){var n=e.undoValues;t.selection.itemsByIds(n).forEach((function(t){t&&t.remove()})),t.nextTick((function(){t.emit("refreshAll")}))}};function Kp(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t.filter((function(e){var n=0;return e.path.forEach((function(e){n+=t.filter((function(t){return t.id===e.id})).length?1:0})),1===n}))}var Up={command:"history.removeLayer",description:"remove layer",execute:function(t,e,n,r){var i=t.selection.itemsByIds(r||t.selection.ids),a=(i=Kp(i)).map((function(t){return t.id})),o=t.serialize(i);i.forEach((function(t){return t.remove()})),t.history.add(e,this,{currentValues:[a],undoValues:o}),t.nextTick((function(){t.selection.removeById(i.map((function(t){return t.id}))),t.emit("refreshAll"),t.emit("removeGuideLine"),t.nextTick((function(){t.history.saveSelection()}))}))},redo:function(t,e){var n=e.currentValues[0],r=t.selection.itemsByIds(n||t.selection.ids);(r=Kp(r)).forEach((function(t){return t.remove()})),t.nextTick((function(){t.emit("refreshAll")}))},undo:function(t,e){var n=e.undoValues;t.deserialize(n,!0),t.nextTick((function(){t.emit("refreshAll")}))}},Wp={command:"updatePathItem",description:"Update path string for selected svg path item",execute:function(t,e){var n=t.selection.current;if(n)if("box"===e.box){var r=n.invertPath(e.d);t.emit("setAttributeForMulti",t.selection.packByValue({d:r.scale(1/n.width.value,1/n.height.value).d}))}else{var a=n.invertPath(e.d),o=a.getBBox(),c=n.offsetX.value+o[0][0],s=n.offsetY.value+o[0][1],u=i.distance(o[1],o[0]),l=i.distance(o[3],o[0]);a.translate(-o[0][0],-o[0][1]),t.emit("setAttributeForMulti",t.selection.packByValue({d:a.scale(1/u,1/l).d,x:Sa.px(c),y:Sa.px(s),width:Sa.px(u),height:Sa.px(l)}))}}},Zp={command:"moveLayer",description:"move layer by keydown with matrix ",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t.command("setAttributeForMulti","item move down",t.selection.packByValue({x:function(t){return Sa.px(t.offsetX.value+e)},y:function(t){return Sa.px(t.offsetY.value+n)}})),t.nextTick((function(){t.selection.reselect(),t.emit("refreshAll")}))}},qp={command:"moveToCenter",description:"Move Layer to Center on Viewport",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e&&t.viewport.moveLayerToCenter(e,void 0,n)}},Jp={command:"moveLayerForItems",description:"mova layer by multi items ",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={};e.forEach((function(t){n[t.item.id]={x:Sa.px(t.item.offsetX.value+t.dist[0]).round(),y:Sa.px(t.item.offsetY.value+t.dist[1]).round()}})),t.emit("history.setAttributeForMulti","item move down",n),t.nextTick((function(){t.selection.reselect(),t.emit("refreshAll")}))}},Qp={command:"moveSelectionToCenter",description:"Move selection project or artboards to center on Viewport",execute:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=[];n=t.selection.isEmpty?t.selection.currentProject.rectVerties:Io(t.selection.items),t.emit("moveToCenter",n,e)}},td={command:"savePNG",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.selection.current;if(n){var r=Dh(t,n).trim(),i="data:image/svg+xml;base64,"+window.btoa(r);mh({local:i},(function(n,r){Bh(r,(function(n){e&&t.emit(e,n)}))}))}}},ed={command:"refreshCursor",execute:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i1&&void 0!==arguments[1]?arguments[1]:0;t.command("setAttributeForMulti","change rotate",t.selection.packByValue({transform:function(t){return Bc.addTransform(t.transform,"rotateZ(".concat(Sa.deg(e).round(1e3),")"))}})),t.nextTick((function(){t.selection.reselect(),t.emit("refreshAll")}))}},historyAddLayer:Yp,historyRemoveLayer:Up,historySetAttributeForMulti:Xp,historyRefreshSelection:_p,historyRedo:{command:"history.redo",execute:function(t){t.history.redo()}},historyUndo:{command:"history.undo",execute:function(t){t.history.undo()}},moveLayer:Zp,moveLayerForItems:Jp,moveToCenter:qp,moveSelectionToCenter:Qp,groupItem:Hp,ungroupItem:Gp,setEditorLayout:{command:"setEditorLayout",execute:function(t,e){t.setLayout(e),t.emit("changedEditorlayout")}},refreshArtboard:function(t){t.emit("refreshLayerTreeView"),t.emit("refreshAllCanvas"),t.emit("refreshStyleView"),t.emit("refreshSelectionStyleView"),t.emit("refreshAllElementBoundSize"),t.emit("refreshSelection"),t.nextTick((function(){t.emit("refreshSelectionTool",!0)}))},resetSelection:function(t){t.nextTick((function(){t.emit("refreshSelectionTool")}))},addBackgroundColor:Cp,addBackgroundImagePattern:Rp,segmentDelete:{command:"segment.delete",execute:function(t,e){t.emit("deleteSegment")}},segmentMoveDown:sp,segmentMoveUp:up,segmentMoveRight:lp,segmentMoveLeft:fp,changeModeView:cp,removeLayer:op,itemMoveDepthDown:Ap,itemMoveDepthUp:zp,keymapKeydown:{command:"keymap.keydown",execute:function(t,e){t.keyboardManager.add(e.code,e.keyCode),t.shortcuts.execute(e,"keydown")}},keymapKeyup:{command:"keymap.keyup",execute:function(t,e){t.keyboardManager.remove(e.key,e.keyCode),t.shortcuts.execute(e,"keyup")}},scaleMinus:{command:"scale.minus",execute:function(t){var e=t.viewport.scale;t.viewport.setScale(t.viewport.scale-.25),t.emit("updateViewport",t.viewport.scale,e)}},scalePlus:{command:"scale.plus",execute:function(t){var e=t.viewport.scale;t.viewport.setScale(t.viewport.scale+.25),t.emit("updateViewport",t.viewport.scale,e)}},dropAsset:rp,addBackgroundImageAsset:ap,addBackgroundImageGradient:ip,addTimelineItem:np,pauseTimelineItem:{command:"pauseTimelineItem",execute:function(t){t.timer&&t.timer.stop()}},lastTimelineItem:ep,nextTimelineItem:tp,firstTimelineItem:Qh,prevTimelineItem:Jh,playTimelineItem:qh,copyTimelineProperty:Zh,addTimelineKeyframe:Wh,removeAnimationItem:Uh,removeTimeline:Kh,selectTimelineItem:Yh,deleteTimelineKeyframe:Xh,removeTimelineProperty:Nh,addTimelineCurrentProperty:_h,setTimelineOffset:Gh,refreshSelectedOffset:{command:"refreshSelectedOffset",execute:function(t){var e=t.timeline.items[0];e&&t.emit("refreshOffsetValue",e)}},addTimelineProperty:Hh,setLocale:{command:"setLocale",execute:function(t,e){t.setLocale(e),t.emit("changed.locale")}},loadJSON:zh,saveJSON:{command:"saveJSON",execute:function(t){t.saveResource("projects",t.projects)}},savePNG:td,downloadPNG:Ah,downloadSVG:Lh,downloadJSON:Ih,updateUriList:Vh,updateImageAssetItem:Ch,updateVideoAssetItem:Mh,addSVGFilterAssetItem:Rh,dropImageUrl:$h,addImageAssetItem:xh,addVideoAssetItem:Sh,updateImage:yh,updateVideo:gh,updateResource:{command:"updateResource",execute:function(t,e){e.forEach((function(e){switch(e.type){case"image/svg+xml":case"image/png":case"image/gif":case"image/jpg":case"image/jpeg":t.emit("updateImage",e);break;case"text/plain":case"text/html":t.emit("addText",{content:e.data});break;case"text/uri-list":t.emit("updateUriList",e)}}))}},fileDropItems:vh,updateScale:{command:"updateScale",execute:function(t,e){var n=t.viewport.scale;t.viewport.setScale(e),t.emit("updateViewport",e,n)}},showExportView:{command:"showExportView",execute:function(t){t.emit("showExportWindow")}},switchTheme:{command:"switchTheme",execute:function(t,e){t.changeTheme(e),t.emit("changeTheme")}},clipboardPaste:dh,clipboardCopy:{command:"clipboard.copy",title:"Copy",description:"Copy",execute:function(t,e){t.selection.copy()}},addComponentType:function(t,e){t.changeAddType(e),t.emit("afterChangeMode"),t.emit("addStatusBarMessage","Drag if you want to create ".concat(e," layer"))},addArtBoard:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.currentProject;r||(r=t.add(t.createItem({itemType:"project"})),t.selection.selectProject(r));var i=r.appendChildItem(t.createItem(sh({itemType:"artboard",x:Sa.px(300),y:Sa.px(200),width:Sa.px(375),height:Sa.px(667)},e)));n&&(i.reset({x:Sa.px(0),y:Sa.px(0)}),i.moveByCenter(n)),t.selection.select(i),oh(t)},addCustomComponent:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.currentProject,i=r.appendChildItem(t.createItem(ad({x:Sa.px(300),y:Sa.px(200),width:Sa.px(375),height:Sa.px(667)},e)));n&&(i.reset({x:Sa.px(0),y:Sa.px(0)}),i.moveByCenter(n)),t.selection.select(i),oh(t)},addImage:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t.emit("newComponent","image",e,!0,n)},addVideo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t.emit("newComponent","video",e,!0,n)},addLayer:function(t,e){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;r||(r=t.selection.current||t.selection.currentProject),r&&(r.is("project")||r.enableHasChildren()||(r=r.parent),r.appendChildItem(e),n&&t.selection.select(e),oh(t))},addLayerView:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t.selection.empty(),t.emit("refreshSelectionTool"),t.emit("hideAddViewLayer"),t.emit("removeGuideLine"),"select"===e||("brush"===e?t.emit("showPathDrawEditor"):"path"===e?t.emit("showPathEditor","path"):t.emit("showLayerAppendView",e,n))},addProject:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.add(t.createItem(lh({itemType:"project"},e)));t.selection.selectProject(n),oh(t)},convertPath:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.current;if(r)if(r.is("svg-path","svg-brush","svg-textpath")){var i=e;if(n)(a=new Hc(e)).scale(r.width.value/n.width,r.height.value/n.height),i=a.d;t.command("setAttributeForMulti","set attribute -d",t.selection.packByValue({d:i},r.id))}else if(r["clip-path"].includes("path")){var a;i=e;if(n)(a=new Hc(e)).scale(r.width.value/n.width,r.height.value/n.height),i=a.d;t.command("setAttributeForMulti","change clip path",t.selection.packByValue({"clip-path":"path(".concat(i,")")},r.id))}},newComponent:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;"svg-textpath"===e?n=hh(hh({},n),{},{"font-size":Sa.parse(n.height),textLength:"100%",d:gf.makeLine(0,1,1,1)}):"svg-circle"===e?(e="svg-path",n=hh(hh({},n),{},{"background-color":void 0,fill:"#C4C4C4",d:gf.makeCircle(0,0,1,1)})):"svg-rect"===e?(e="svg-path",n=hh(hh({},n),{},{"background-color":void 0,fill:"#C4C4C4",d:gf.makeRect(0,0,1,1)})):"text"===e?n=hh({width:Sa.px(300),height:Sa.px(50)},n):"artboard"===e&&(n=hh(hh({},n),{},{"background-color":"white"})),t.command("addLayer","add layer - ".concat(e),t.createItem(hh({itemType:e},n)),n,r,i),t.changeMode(Lg),t.emit("afterChangeMode")},refreshElement:function(t,e){t.emit("refreshSelectionStyleView",e),t.emit("refreshElementBoundSize",t.selection.getRootItem(e))},refreshProject:function(t,e){t.emit("refreshStyleView",e,!0)},resizeArtBoard:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.selection.current;if(n&&n.is("artboard")){if(!e.trim())return;var r=e.split("x"),i=zt()(r,2),a=i[0],o=i[1];a=Sa.px(+a),o=Sa.px(+o),n.reset({width:a,height:o}),t.selection.select(n),oh(t)}},setAttributeForMulti:Np,sortBottom:Ep,sortCenter:Mp,sortLeft:Tp,sortMiddle:Vp},w()(od,"sortBottom",Ep),w()(od,"sortTop",Ip),w()(od,"sortRight",Dp),w()(od,"sameWidth",Lp),w()(od,"sameHeight",Bp),w()(od,"updatePathItem",Wp),w()(od,"updateClipPath",{command:"updateClipPath",description:"update clip-path property ",execute:function(t,e){t.command("setAttributeForMulti","change clip-path",t.selection.packByValue({"clip-path":"path(".concat(e.d,")")}))}}),od),sd=function(){function t(e){O()(this,t),this.$editor=e,this.loadCommands()}return j()(t,[{key:"loadCommands",value:function(){var t=this;Object.keys(cd).forEach((function(e){Jt(cd[e])?t.registerCommand(e,cd[e]):t.registerCommand(cd[e])}))}},{key:"registerCommand",value:function(t,e){var n=this;if(2===arguments.length){var r=function(){for(var t,r=arguments.length,i=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:"keydown",r=this.checkShortCut(this.makeKeyCodeString(t),this.makeKeyString(t),this.makeCodeString(t));if(r){var i=r.filter((function(t){return t.eventType===n})).filter((function(t){return e.checkWhen(t)}));i.length&&t.preventDefault(),i.forEach((function(n){var r;(r=e.$editor).emit.apply(r,[n.command].concat(ce()(n.args),[t]))}))}}}]),t}(),md=function(){function t(e){O()(this,t),this.editor=e,this.configList=[],this.config=new Map}return j()(t,[{key:"get",value:function(t){var e;!1===this.config.has(t)&&this.config.set(t,null===(e=this.configList.find((function(e){return e.key==t})))||void 0===e?void 0:e.defaultValue);return this.config.get(t)}},{key:"set",value:function(t,e){var n=this.config.get(t);n!==e&&(this.config.set(t,e),this.editor.emit("config:"+t,e,n))}},{key:"setAll",value:function(t){var e=this;Object.keys(t).forEach((function(n){e.set(n,t[n])}))}},{key:"getType",value:function(t){var e;return null===(e=this.configList.find((function(e){return e.key==t})))||void 0===e?void 0:e.type}},{key:"isType",value:function(t,e){return this.getType(t)===e}},{key:"isBoolean",value:function(t){return this.isType(t,"boolean")}},{key:"toggle",value:function(t){this.isBoolean(t)&&this.set(t,!this.get(t))}},{key:"true",value:function(t){return!0===this.get(t)}},{key:"false",value:function(t){return!1===this.get(t)}},{key:"remove",value:function(t){this.config.delete(t),this.editor.emit("config:"+t)}},{key:"registerConfig",value:function(t){this.config.set(t.key,t.defaultValue),this.configList.push(t)}}]),t}(),bd=function(){function t(e){O()(this,t),this.$editor=e,this.currentIndex=-1,this.undoHistories=[],this.redoHistories=[],this.selection={}}return j()(t,[{key:"length",get:function(){return this.undoHistories.length}},{key:"selectedIds",get:function(){return Object.keys(this.selection)}},{key:"createCommand",value:function(t){return this.$editor.isPointerUp?"history.".concat(t):t}},{key:"saveSelection",value:function(){this.selection=this.$editor.selection.toCloneObject()}},{key:"getUndoValues",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={};return Object.keys(this.selection).forEach((function(r){n[r]={},Object.keys(e).forEach((function(e){n[r][e]=t.selection[r][e]}))})),n}},{key:"getUndoValuesForMulti",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={};return Object.keys(e).forEach((function(r){n[r]={};var i=t.selection[r]||t.$editor.selection.itemsByIds(r)[0],a=e[r];Object.keys(a).forEach((function(t){n[r][t]=i[t]}))})),n}},{key:"add",value:function(t,e,n){var r=performance.now(),i=this.undoHistories[this.undoHistories.length-1],a={message:t,command:e,data:n,time:r};return i&&i.message===t&&r-i.timethis.length)){this.currentIndex<0&&this.currentIndex++;var e=this.undoHistories[this.currentIndex];e&&e.command&&(e.command.redo(this.$editor,e.data),this.$editor.debug(e)),this.$editor.nextTick((function(){t.$editor.emit("refreshHistory",e.command)}))}}}]),t}(),kd=i.fromValues(0,0,0);function xd(t,e){return Math.abs(t[0]-e[0])<1}function wd(t,e){return Math.abs(t[1]-e[1])<1}var Pd=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;O()(this,t),this.editor=e,this.map=new Map,this.snapTargetLayers=[],this.snapDistance=n}return j()(t,[{key:"dist",get:function(){return this.editor.config.get("snap.distance")||this.snapDistance}},{key:"gridSize",get:function(){return this.editor.config.get("snap.grid")||50}},{key:"clear",value:function(){var t=this;this.snapTargetLayers=this.editor.selection.snapTargetLayers.map((function(e){return t.convertMatrix(e)}))}},{key:"convertMatrix",value:function(t){var e=this.convertGuideAndPathMatrix(t),n=e.map((function(t){return t[0]})),r=e.map((function(t){return t[1]}));return{id:t.id,xList:n,yList:r,verties:e,rectVerties:Lo(t.originVerties)}}},{key:"convertGuideAndPathMatrix",value:function(t){var e=t.guideVerties;return ce()(e)}},{key:"getSnapPoints",value:function(){var t=this,e=[];return this.editor.selection.snapTargetLayersWithSelection.forEach((function(n){e.push.apply(e,t.convertGuideAndPathMatrix(n))})),e}},{key:"checkX",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=[];return t.forEach((function(t,a){e.forEach((function(e,o){var c=t-e,s=n.gridSize-Math.abs(e)%n.gridSize;Math.abs(c)<=r?i.push({targetX:t,sourceX:e,sourceIndex:o,targetIndex:a,dx:c}):Math.abs(s)<=r&&i.push({targetX:t,sourceX:e,sourceIndex:o,targetIndex:a,dx:s})}))})),i}},{key:"checkY",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[];return t.forEach((function(t,i){e.forEach((function(e,a){var o=t-e;Math.abs(o)<=n&&r.push({targetY:t,sourceY:e,sourceIndex:a,targetIndex:i,dy:o})}))})),r}},{key:"check",value:function(t){var e=this,n=[],r=this.dist,a=t.map((function(t){return t[0]})),o=t.map((function(t){return t[1]}));return this.snapTargetLayers.forEach((function(t){var c=e.checkX(t.xList,a,r)[0],s=e.checkY(t.yList,o,r)[0];n.push(i.fromValues(c?c.dx:0,s?s.dy:0,0))})),n.find((function(t){return te(t[0])||te(t[1])}))||kd}},{key:"checkPoint",value:function(t){var e=this.check([t]);return i.add([],t,e)}},{key:"getGuidesByPointPoint",value:function(t,e){for(var n,r,a=[],o={},c=0,s=t.length;c1&&void 0!==arguments[1]?arguments[1]:-.2,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=i.lerp([],t[0],t[2],.5),a=i.dist(t[0],t[1]),o=i.dist(t[0],t[3]),c=i.lerp([],this.verties[0],this.verties[2],.5),s=i.dist(this.verties[0],this.verties[1]),u=i.dist(this.verties[0],this.verties[3]),l=n?Math.min(s/a,u/o)+e:1;this.setTranslate(i.add([],this.translate,i.subtract([],c,r))),this.setTransformOrigin(r),this.setScale(this.scale*l),this.editor.emit("updateViewport")}},{key:"pos",get:function(){return[(this.mouse[0]-this.verties[0][0])/(this.verties[2][0]-this.verties[0][0])*100,(this.mouse[1]-this.verties[0][1])/(this.verties[2][1]-this.verties[0][1])*100,0]}},{key:"minX",get:function(){return this.verties[0][0]}},{key:"maxX",get:function(){return this.verties[2][0]}},{key:"minY",get:function(){return this.verties[0][1]}},{key:"maxY",get:function(){return this.verties[2][1]}},{key:"center",get:function(){return this.verties[4]}},{key:"height",get:function(){return this.maxY-this.minY}},{key:"width",get:function(){return this.maxX-this.minX}},{key:"checkInViewport",value:function(t){var e=zt()(t,3),n=e[0],r=e[1],i=(e[2],this.minX0&&void 0!==a[0]?a[0]:"",!(n=this.editor.selection.current)){t.next=13;break}return t.next=5,this.getCustomAssetList();case 5:return r=t.sent,t.next=8,this.editor.json.render(n);case 8:return(i=t.sent).x="0px",i.y="0px",t.next=13,this.setCustomAssetList([].concat(ce()(r),[{id:ha(),preview:e,component:i}]));case 13:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"removeCustomAsset",value:(e=La()(Fa.a.mark((function t(e){var n;return Fa.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getCustomAssetList();case 2:return n=t.sent,t.next=5,this.setCustomAssetList(n.filter((function(t){return t.id!==e})));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),t}();function $d(t,e){var n=Object.assign({width:24,height:24},e);return'\n ').concat(t,"")}var Rd=$d('\n \n'),Cd=$d('\n \n'),Md=$d(''),Td=$d(''),Vd=$d(''),Ed=$d(''),Id=$d(''),Dd=$d(''),Ld=$d(''),Bd=$d(''),Ad=$d(''),zd=$d(''),Fd=$d(''),Hd=$d(''),Gd=$d(''),_d=$d(''),Nd=$d(''),Xd=$d(''),Yd=$d(''),Kd=$d(''),Ud=$d(''),Wd=$d(''),Zd=$d(''),qd=$d(''),Jd=$d(''),Qd=$d(''),tv=$d(''),ev=$d(''),nv=$d(''),rv=$d(''),iv=$d(''),av=$d(''),ov=$d(''),cv=$d(''),sv=$d(''),uv=$d(''),lv=$d(''),fv=$d(''),hv=$d(''),pv=$d(''),dv=$d(''),vv=$d(''),yv=$d(''),gv=$d(''),mv=$d(''),bv=$d(''),kv=$d(''),xv=$d(''),wv=$d(''),Pv=$d(''),Ov=$d(''),Sv=$d(''),jv=$d(''),$v=$d(''),Rv=$d(''),Cv=$d(''),Mv=$d(''),Tv=$d(''),Vv=$d(''),Ev=$d(''),Iv=$d(''),Dv=$d(''),Lv=$d(''),Bv=$d(''),Av=$d(''),zv=$d(''),Fv=$d(''),Hv=$d(''),Gv=$d(''),_v=$d(''),Nv=$d(''),Xv=$d(''),Yv=$d(''),Kv=$d('\n\n'),Uv=$d(''),Wv=$d(''),Zv=$d(''),qv=$d(''),Jv=$d(''),Qv=$d(''),ty=$d(''),ey=$d(''),ny=$d(''),ry=$d(''),iy=$d(''),ay=$d(''),oy=$d(''),cy=$d(''),sy=$d(''),uy=$d(''),ly=$d(''),fy=$d(''),hy=$d(''),py=$d(''),dy=$d(''),vy=$d(''),yy=$d(''),gy=$d(''),my=$d(''),by=$d(''),ky=$d(''),xy=$d(''),wy=$d(''),Py=$d(''),Oy=$d(''),Sy=$d(''),jy=$d('\n \n \n \n'),$y=$d(''),Ry=$d(''),Cy=$d('\n\n\n\n'),My=$d(''),Ty=$d(''),Vy=$d(''),Ey=$d(''),Iy=$d(''),Dy=$d(''),Ly=$d(''),By=$d('\n \n'),Ay=$d(''),zy=$d(''),Fy=$d(''),Hy=$d(''),Gy=$d('\n \n'),_y=$d('\n \n'),Ny=$d(''),Xy=$d(''),Yy=$d(''),Ky=$d(''),Uy=$d(''),Wy=$d('\n \n '),Zy=$d('\n \n \n \n'),qy=$d('\n \n '),Jy=$d('\n \n '),Qy=$d('\n \n'),tg=$d('\n \n'),eg=$d(''),ng=$d('\n \n '),rg=$d(''),ig=$d(''),ag=$d(''),og=$d(''),cg=$d(''),sg=$d(''),ug=$d(''),lg=$d(''),fg=$d(''),hg=$d(''),pg=$d('\n \n '),dg=$d(''),vg=$d(''),yg=$d(''),gg=$d(''),mg=$d(''),bg=$d(''),kg=$d(''),xg=$d(''),wg=$d(''),Pg=$d(''),Og=$d(''),Sg=$d(''),jg=$d('');function $g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Rg(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"";return $d('"),{width:20,height:20})},rotate:pg,align_horizontal_center:ag,align_horizontal_left:og,align_horizontal_right:cg,align_vertical_bottom:sg,align_vertical_center:ug,align_vertical_top:lg,vertical_distribute:dg,horizontal_distribute:vg,rotate_left:hg,swap_horiz:fg,arrow_right:rg,group:ng,volume_down:Jy,arrowLeft:eg,volume_up:Qy,volume_off:tg,pentool:Zy,launch:Wy,apps:Yy,outline_rect:Ky,outline_circle:Uy,keyboard:Xy,local_movie:Ny,same_height:_y,same_width:Gy,layers:ig,middle:Hy,bottom:Fy,top:zy,right:Ay,center:By,left:Ly,flag:Dy,lens:Iy,local_library:Ey,italic:Vy,strikethrough:Ty,underline:My,cylinder:Cy,text_rotate:Ry,device_hub:$y,control_point:Sy,flip_camera:jy,flipY:Oy,flip:Py,account_tree:xy,format_shapes:wy,merge:by,texture:ky,settings_input_component:my,view_comfy:gy,camera_roll:yy,broken_image:vy,shadow:dy,opacity:py,looks:hy,vintage:fy,waves:ly,blur_linear:uy,blur:sy,landscape:cy,palette:oy,diffuse:ay,specular:iy,photo:ry,near_me:ny,view_list:ey,flash_on:ty,doc:Qv,storage:Jv,archive:qv,file_copy:Zv,gps_fixed:Wv,refresh:Uv,cat:Kv,shuffle:Yv,replay:Xv,speed:Nv,alternate_reverse:_v,alternate:Gv,note:Bv,rect:Lv,circle:Dv,color_lens:Iv,cube:Ev,polygon:Vv,star:Tv,dahaze:Mv,brush:Cv,expand:Rv,list:jv,grid:$v,align_center:wv,align_justify:Pv,align_left:Ov,align_right:Sv,color:xv,size:kv,edit:bv,outline_image:mv,ballot:vv,shape:dv,scatter:pv,transform:hv,gradient:fv,close:lv,build:uv,code:sv,autorenew:cv,play:av,pause:ov,skip_next:Av,skip_prev:zv,fast_forward:Fv,fast_rewind:Hv,filter:iv,input:rv,timer:ev,title:tv,paint:Qd,border_all:qd,border_inner:Jd,check:Zd,video:qy,arrowRight:Wd,screen:Ud,repeat:Kd,remove2:Yd,setting:Xd,image:Nd,artboard:_d,folder:Gd,publish:Hd,add_note:Fd,add:zd,save:Bd,export:Ad,redo:Ld,undo:Dd,lock:Id,lock_open:gv,remove:Vd,copy:Ed,visible:Td,add_box:Md,add_circle:yv,create_folder:Cd,chevron_right:Rd,chevron_left:nv}),Mg=function(){function t(){O()(this,t)}var e;return j()(t,[{key:"load",value:(e=La()(Fa.a.mark((function t(){var e,n,r,i,a,o,c,s=arguments;return Fa.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=s.length>0&&void 0!==s[0]?s[0]:"default",!Cg[e]){t.next=8;break}for(r=s.length,i=new Array(r>1?r-1:0),a=1;a-1&&(t=t.replace(new RegExp("#".concat(r.id),"g"),r.local))})),t}}]),t}(),Vg=function(){function t(e){O()(this,t),this.editor=e,this.plugins=[]}var e;return j()(t,[{key:"registerPlugin",value:function(t){this.plugins.push(t)}},{key:"initializePlugin",value:(e=La()(Fa.a.mark((function t(){var e,n=this,r=arguments;return Fa.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,Promise.all(this.plugins.map(function(){var t=La()(Fa.a.mark((function t(r){return Fa.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r(n.editor,e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()));case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),Eg=function(){function t(e){O()(this,t),this.editor=e,this.renderers={},this.rendererTypes={}}return j()(t,[{key:"getRenderType",value:function(t){return this.renderers[t]||(this.renderers[t]={}),this.renderers[t]}},{key:"registerRenderer",value:function(t,e,n){var r=this.getRenderType(t);if(r[e])throw new Error("It has duplicated renderer name. "+e);r[e]=n}},{key:"registerRendererType",value:function(t,e){if(this.rendererTypes[t])throw new Error("It has duplcated renderer type name. "+name);this.rendererTypes[t]=e}},{key:"getRenderer",value:function(t){return this.rendererTypes[t]}},{key:"getRendererInstance",value:function(t,e){return this.getRenderType(t)[e]}}]),t}(),Ig=function(){function t(e){O()(this,t),this.editor=e,this.menuItems={}}return j()(t,[{key:"registerMenuItem",value:function(t,e){var n=this;this.menuItems[t]||(this.menuItems[t]=[]),Object.keys(e).forEach((function(r){n.menuItems[t].push({refClass:r,class:e[r]})}))}},{key:"getTargetMenuItems",value:function(t){return this.menuItems[t]||[]}},{key:"generate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getTargetMenuItems(t).map((function(t){var n=e?'ref="$'.concat(t.refClass,'"'):"";return'")})).join("\n")}}]),t}(),Dg=function(){function t(e){O()(this,t),this.editor=e,this.locales={},this.fallbackLang="en_US"}return j()(t,[{key:"getLang",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return t||this.fallbackLang}},{key:"setFallbackLang",value:function(t){this.fallbackLang=t}},{key:"get",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=this.getLang(i),o=(null===(e=this.locales[a])||void 0===e?void 0:e[t])||(null===(n=this.locales[this.fallbackLang])||void 0===n?void 0:n[t])||t||void 0;if(Jt(o))return o(r);var c=o;return t===c?t.split(".").pop():(Object.entries(r).forEach((function(t){var e=zt()(t,2),n=e[0],r=e[1];c=c.replace(new RegExp("{".concat(n,"}"),"ig"),r)})),c)}},{key:"hasKey",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=this.getLang(e);return!(!this.locales[n][t]&&!this.locales[this.fallbackLang][t])}},{key:"registerI18nMessage",value:function(t,e){this.locales[t]||(this.locales[t]={}),Object.assign(this.locales[t],e)}}]),t}(),Lg="SELECTION",Bg=function(){function t(){O()(this,t),this.EDITOR_ID=ha(),this.projects=[],this.popupZIndex=1e4,this.canvasWidth=1e5,this.canvasHeight=1e5,this.symbols={},this.images={},this.openRightPanel=!0,this.mode=Lg,this.modeView="CanvasView",this.addComponentType="",this.loadManagers()}return j()(t,[{key:"loadManagers",value:function(){this.store=new xo(this),this.config=new md(this),this.snapManager=new Pd(this),this.commands=new sd(this),this.shortcuts=new gd(this),this.selection=new ih(this),this.timeline=new Oo(this),this.history=new bd(this),this.keyboardManager=new Od(this),this.viewport=new Sd(this),this.storageManager=new jd(this),this.cursorManager=new Mg(this),this.assetManager=new Tg(this),this.menuItemManager=new Ig(this),this.components=new ah(this),this.pluginManager=new Vg(this),this.renderers=new Eg(this),this.i18n=new Dg(this),this.initTheme(),this.initPlugins(),this.initStorage()}},{key:"initStorage",value:function(){this.locale=this.loadItem("locale")||"en_US",this.layout=this.loadItem("layout")||"all"}},{key:"createProject",value:function(){return this.createItem({itemType:"project"})}},{key:"getI18nMessage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this.i18n.get(t,e,n||this.locale)}},{key:"hasI18nkey",value:function(t,e){return this.i18n.hasKey(t,e||this.locale)}},{key:"initI18nMessage",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,a="".concat(e,".").concat(n);return t.hasI18nkey(a,i)?t.i18n("".concat(e,".").concat(n),r,i):t.i18n("".concat(n),r,i)}}},{key:"setLocale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en_US";this.locale=t,this.saveItem("locale",this.locale)}},{key:"setLayout",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";this.layout=t,this.saveItem("layout",this.layout)}},{key:"setUser",value:function(t){this.user=t}},{key:"initTheme",value:function(){var t="dark";window.localStorage&&(t=window.localStorage.getItem("easylogic.studio.theme"),t=["dark","light"].includes(t)?t:"dark"),this.theme=t||"dark",window.localStorage.setItem("easylogic.studio.theme",this.theme)}},{key:"initPlugins",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.pluginManager.initializePlugin(t)}},{key:"themeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return wo[this.theme][t]||e}},{key:"changeMode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lg;this.mode=t}},{key:"changeModeView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"CanvasView";this.modeView=t}},{key:"isMode",value:function(t){return this.mode===t}},{key:"isAddMode",value:function(){return this.isMode("ADD")}},{key:"isSelectionMode",value:function(){return this.isMode(Lg)}},{key:"changeAddType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.changeMode("ADD"),this.addComponentType=t,this.isComponent=e}},{key:"changeTheme",value:function(t){t=["light","toon"].includes(t)?t:"dark",this.theme=t,window.localStorage.setItem("easylogic.studio.theme",t)}},{key:"zIndex",get:function(){return this.popupZIndex++}},{key:"isPointerUp",get:function(){var t=this.config.get("bodyEvent");return!t||("pointerup"===t.type||"pointermove"===t.type&&0===t.buttons)}},{key:"isPointerDown",get:function(){return!this.isPointerUp}},{key:"isPointerMove",get:function(){return!!this.config.get("bodyEvent")&&"pointermove"===this.config.get("bodyEvent").type}},{key:"getFile",value:function(t){return this.images[t]||t}},{key:"setStore",value:function(t){this.store=t}},{key:"emit",value:function(){var t;this.store.source="EDITOR_ID",(t=this.store).emit.apply(t,arguments)}},{key:"on",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r2?n-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:[];this.projects=t}},{key:"add",value:function(t){return this.projects.push(t),t}},{key:"remove",value:function(t){this.projects.splice(t,1)}},{key:"clear",value:function(){this.projects=[]}},{key:"get",value:function(t){return this.projects[t]}},{key:"replaceLocalUrltoRealUrl",value:function(t){var e=this.selection.currentProject,n={};return e.images.forEach((function(e){t.indexOf(e.local)>-1&&(n[e.local]=e.original)})),Object.keys(n).forEach((function(e){t.indexOf(e)>-1&&(t=t.replace(new RegExp(e,"g"),n[e]))})),t}},{key:"replaceLocalUrltoId",value:function(t){var e=this.projects,n={};return e.forEach((function(e){e.images.forEach((function(e){t.indexOf(e.local)>-1&&(n[e.local]="#"+e.id)}))})),Object.keys(n).forEach((function(e){t.indexOf(e)>-1&&(t=t.replace(new RegExp(e,"g"),n[e]))})),t}},{key:"makeResource",value:function(t){var e=JSON.stringify(t);return e=this.replaceLocalUrltoId(e)}},{key:"serialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return t.forEach((function(t){var n=t.toJSON();n._parentId=t.parent?t.parent.id:void 0,n._positionInParent=t.positionInParent,e.push(n)})),JSON.stringify(e)}},{key:"createItem",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t._parentId&&(t.parent=this.searchItem(t._parentId),delete t._parentId),t.layers=(t.layers||[]).map((function(t){return e.createItem(t)}));var r=this.components.createComponent(t.itemType,t);return n&&r.parent.setPositionInPlace(t._positionInParent,r),r}},{key:"searchItem",value:function(t){var e=[];return Zt(t)?e.push(t):Array.isArray(t)&&(e=ce()(t)),this.selection.currentProject.getSearchedIndexItemList(e).filter(Boolean)[0]}},{key:"deserialize",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=JSON.parse(t)||[];return r.map((function(t){return e.createItem(t,n)}))}},{key:"storeKey",get:function(){return"__els__.".concat(this.config.get("store.key"))}},{key:"saveResource",value:function(t,e){window.localStorage.setItem("".concat(this.storeKey,".").concat(t),this.makeResource(e))}},{key:"saveItem",value:function(t,e){window.localStorage.setItem("".concat(this.storeKey,".").concat(t),JSON.stringify(e))}},{key:"loadResource",value:function(t){return this.assetManager.revokeResource(window.localStorage.getItem("".concat(this.storeKey,".").concat(t)))}},{key:"loadItem",value:function(t){return JSON.parse(window.localStorage.getItem("".concat(this.storeKey,".").concat(t))||JSON.stringify(""))}},{key:"registerElement",value:function(t){io(t)}},{key:"registerMenuItem",value:function(t,e){this.menuItemManager.registerMenuItem(t,e),this.registerElement(e)}},{key:"registerComponent",value:function(t,e){this.components.registerComponent(t,e)}},{key:"registerItem",value:function(t,e){this.registerComponent(t,e)}},{key:"registerInspector",value:function(t,e){this.components.registerInspector(t,e)}},{key:"registerRenderer",value:function(t,e,n){this.renderers.registerRenderer(t,e,n)}},{key:"registerRendererType",value:function(t,e){this.renderers.registerRendererType(t,e)}},{key:"getRendererInstance",value:function(t,e){return this.renderers.getRendererInstance(t,e)}},{key:"renderer",value:function(t){return this.renderers.getRenderer(t)}},{key:"html",get:function(){return this.renderer("html")}},{key:"svg",get:function(){return this.renderer("svg")}},{key:"json",get:function(){return this.renderer("json")}},{key:"registerCommand",value:function(t){return this.commands.registerCommand(t)}},{key:"registerShortCut",value:function(t){this.shortcuts.registerShortCut(t)}},{key:"registerPlugin",value:function(t){this.pluginManager.registerPlugin(t)}},{key:"registerPluginList",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){return t.registerPlugin(e)}))}},{key:"registerConfig",value:function(t){this.config.registerConfig(t)}},{key:"registerI18nMessage",value:function(t,e){this.i18n.registerI18nMessage(t,e)}},{key:"registerI18nMessageWithLocale",value:function(t){var e=this;Object.entries(t).forEach((function(t){var n=zt()(t,2),r=n[0],i=n[1];e.registerI18nMessage(r,i)}))}}]),t}(),Ag=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"move";return _("bodyMouseMove ".concat(t))},zg=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";return _("bodyMouseUp ".concat(t))};function Fg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Hg=function(t){R()(n,t);var e=Fg(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return O()(this,n),(r=e.call(this,t,i)).__UID=new Set,r.created(),r.initialize(),r.initializeStoreEvent(),r}return j()(n,[{key:"created",value:function(){}},{key:"getRealEventName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:MULTI_PREFIX,n=t.indexOf(e);return t.substr(n<0?0:n+e.length)}},{key:"splitMethod",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=ae(t,e),i=zt()(r,2),a=i[0],o=i[1];return[a.length?+o[0].target:n,a,o]}},{key:"createLocalCallback",value:function(t,e){var n=e.bind(this);return n.displayName="".concat(this.sourceName,".").concat(t),n.source=this.source,n}},{key:"initializeStoreEvent",value:function(){var t=this;this.filterProps(B).forEach((function(e){var n=t.getRealEventName(e,"subscribe "),r=n.split(A),i=Ia()(r),a=(i[0],i.slice(1)),o=a.map((function(t){return t.trim()})).filter((function(e){return t[e]})).map((function(t){return{target:t}})),c=t.splitMethod(a,"debounce"),s=zt()(c,2),u=s[0],l=s[1],f=t.splitMethod(a,"throttle"),h=zt()(f,2),p=h[0],d=h[1],v=t.splitMethod(a,"allTrigger"),y=zt()(v,2),g=(y[0],y[1]),m=t.splitMethod(a,"selfTrigger"),b=zt()(m,2),k=(b[0],b[1]);n.split(A).filter((function(t){return-1===o.indexOf(t)&&-1===l.indexOf(t)&&-1===g.indexOf(t)&&-1===k.indexOf(t)&&-1===d.indexOf(t)})).map((function(t){return t.trim()})).filter(Boolean).forEach((function(n){if(Jt(t[e])){var r=t.createLocalCallback(n,t[e]);t.$store.on(n,r,t,u,p,g.length,k.length,o)}}))}))}},{key:"destoryStoreSUBSCRIBE",value:function(){this.$store.offAll(this)}},{key:"destroy",value:function(){$a()(V()(n.prototype),"destroy",this).call(this),this.destoryStoreSUBSCRIBE()}},{key:"rerender",value:function(){$a()(V()(n.prototype),"rerender",this).call(this),this.initialize(),this.initializeStoreEvent()}},{key:"emit",value:function(t){var e;this.$store.source=this.source,this.$store.sourceContext=this;for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i1?n-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r="subscribe.".concat(lo()),i=this.createLocalCallback(r,t);return this.$store.on(r,i,this,e,n,!1,!0),r}}]),n}(ko);function Gg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var _g=function(t){R()(n,t);var e=Gg(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"initialize",value:function(){$a()(V()(n.prototype),"initialize",this).call(this),this.$editor.registerI18nMessageWithLocale(this.initializeI18nMessage())}},{key:"initializeI18nMessage",value:function(){return{}}},{key:"$editor",get:function(){return this.parent.$editor}},{key:"$store",get:function(){return this.$editor.store||this.parent.$store}},{key:"$i18n",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this.$editor.getI18nMessage(t,e,n)}},{key:"$initI18n",value:function(t){return this.$editor.initI18nMessage(t)}},{key:"$config",get:function(){return this.$editor.config}},{key:"$selection",get:function(){return this.$editor.selection}},{key:"$viewport",get:function(){return this.$editor.viewport}},{key:"$snapManager",get:function(){return this.$editor.snapManager}},{key:"$timeline",get:function(){return this.$editor.timeline}},{key:"$history",get:function(){return this.$editor.history}},{key:"$shortcuts",get:function(){return this.$editor.shortcuts}},{key:"$keyboardManager",get:function(){return this.$editor.keyboardManager}},{key:"$storageManager",get:function(){return this.$editor.storageManager}},{key:"$menuManager",get:function(){return this.$editor.menuItemManager}},{key:"command",value:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i0&&void 0!==arguments[0]?arguments[0]:0;this.$config.set("body.move.ms",t);var e=0===t?this.__loopBodyMoves.bind(this):Gt(this.__loopBodyMoves.bind(this),this.$config.get("body.move.ms"));this.__funcBodyMoves=e}},{key:"__loopBodyMoves",value:function(){var t=this.$config.get("pos"),e=this.$config.get("bodyEvent"),n=this.$config.get("lastPos")||Yg;!(n.x===t.x&&n.y===t.y)&&this.__moves.size&&(this.__moves.forEach((function(n){var r=Yi(t.x,t.y,n.xy.x,n.xy.y);if(Math.abs(r)>.5){var i=Math.floor(t.x-n.xy.x),a=Math.floor(t.y-n.xy.y);n.func.call(n.context,i,a,"move",e.pressure)}})),this.$config.set("lastPos",t)),requestAnimationFrame(this.__funcBodyMoves)}},{key:"__removeBodyMoves",value:function(){var t=this.$config.get("pos"),e=this.$config.get("bodyEvent");t&&this.__ends.forEach((function(n){n.func.call(n.context,t.x-n.xy.x,t.y-n.xy.y,"end",e.pressure)})),this.__moves.clear(),this.__ends.clear()}},{key:it("add/body/mousemove"),value:function(t,e,n){this.__moves.add({func:t,context:e,xy:n})}},{key:it("add/body/mouseup"),value:function(t,e,n){this.__ends.add({func:t,context:e,xy:n})}},{key:wt("document"),value:function(t){var e=t.xy||Xg;this.$config.set("bodyEvent",t),this.$config.set("pos",e)}},{key:St("document"),value:function(t){var e=t.xy||Xg;this.$config.set("bodyEvent",t),this.$config.set("pos",e),this.__requestId||(this.__requestId=requestAnimationFrame(this.__funcBodyMoves))}},{key:jt("document"),value:function(t){this.$config.set("bodyEvent",t),this.__removeBodyMoves(),cancelAnimationFrame(this.__requestId),this.__requestId=null}},{key:xt("window")+Z(100),value:function(){this.emit("resize.window")}},{key:rt("refreshAll"),value:function(){this.emit("refreshProjectList"),this.trigger("refreshAllSelectProject")}},{key:rt("refreshAllSelectProject"),value:function(){this.emit("refreshArtboard")}},{key:rt("changeTheme"),value:function(){this.$el.attr("data-theme",this.$editor.theme)}},{key:rt("changed.locale"),value:function(){this.rerender()}}]),n}(_g);n(34);function Ug(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Wg=[],Zg=function(t){R()(n,t);var e=Ug(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n
\n
\n
\n
\n "}},{key:"afterRender",value:function(){this.refreshCanvasSize()}},{key:"refreshCanvasSize",value:function(){this.state.rect=this.$el.rect()}},{key:"makeLine",value:function(t,e,n,r,i,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:3,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:30,s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:10,u=n-n%e,l=r+r%e,f=(u-n)/i*a,h=(u+e-n)/i*a;if(!(Math.abs(h-f)5&&void 0!==arguments[5]?arguments[5]:3,o=[],c=e-e%t,s=n+n%t,u=(c-e)/r*i,l=(c+t-e)/r*i;if(!(Math.abs(l-u)').concat(f,"")}return o.join("")}}},{key:"makeRulerForCurrentArtboard",value:function(){var t=this.$selection.current;if(!t)return"";var e=t.artboard;if(!e)return"";var n=e.verties,r=this.$viewport,i=r.minX,a=(r.maxX,r.width),o=this.state.rect.width,c=(n[0][0]-i)/a*o,s=(n[2][0]-i)/a*o;return"\n M ".concat(c," 20 \n L ").concat(c," 30 \n L ").concat(s," 30 \n L ").concat(s," 20 \n Z\n ")}},{key:"makeRulerForCurrent",value:function(){if(!this.$selection.current)return"";var t=this.$selection.verties.map((function(t){return t[0]})),e=Math.min.apply(Math,t),n=Math.max.apply(Math,t),r=this.$viewport,i=r.minX,a=r.width,o=this.state.rect.width,c=(e-i)/a*o,s=(n-i)/a*o;return"\n M ".concat(c," 15 \n L ").concat(c," 20 \n L ").concat(s," 20 \n L ").concat(s," 15 \n Z\n ")}},{key:"makeRuler",value:function(){var t=this.$viewport,e=t.minX,n=t.maxX,r=t.width,i=this.state.rect.width;return Wg=[],this.makeLine(Wg,200,e,n,r,i,10,20,1e4),this.makeLine(Wg,100,e,n,r,i,10,20,200),this.makeLine(Wg,50,e,n,r,i,10,20,100),this.makeLine(Wg,10,e,n,r,i,10,18,50),this.makeLine(Wg,5,e,n,r,i,10,15,10),this.makeLine(Wg,1,e,n,r,i,10,13,5),Wg.join("")}},{key:"makeRulerText",value:function(){var t=this.$viewport,e=t.minX,n=t.maxX,r=t.width,i=this.state.rect.width,a=Math.abs(n-e);return[a>3e3?this.makeLineText(500,e,n,r,i,20):"",1e3\n \n ').concat(this.makeRulerText()," \n \n ")}},{key:Tt("$layerRuler")+W,value:function(){return this.state.rect&&0!=this.state.rect.width||(this.state.rect=this.$el.rect()),'\n \n \n \n ')}},{key:"refresh",value:function(){this.$config.get("show.ruler")&&this.load()}},{key:rt("updateViewport","refreshSelection"),value:function(){this.refresh()}},{key:rt("refreshSelectionStyleView")+J(10),value:function(){this.$selection.current&&(this.$selection.current.hasChangedField("x","y","width","height","transform","rotateZ","rotate")&&this.refresh())}},{key:rt("resize.window","resizeCanvas"),value:function(){this.refreshCanvasSize()}}]),n}(_g);n(35);function qg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Jg=[],Qg=function(t){R()(n,t);var e=qg(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n
\n
\n
\n
\n "}},{key:"afterRender",value:function(){this.refreshCanvasSize()}},{key:"refreshCanvasSize",value:function(){this.state.rect=this.$el.rect()}},{key:"makeLine",value:function(t,e,n,r,i,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:3,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:30,s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:10,u=n-n%e,l=r+r%e,f=(u-n)/i*a,h=(u+e-n)/i*a;if(!(Math.abs(h-f)5&&void 0!==arguments[5]?arguments[5]:3,o=[],c=e-e%t,s=n+n%t,u=(c-e)/r*i,l=(c+t-e)/r*i;if(!(Math.abs(l-u)').concat(f,"")}return o.join("")}}},{key:"makeRulerForCurrentArtboard",value:function(){var t=this.$selection.current;if(!t)return"";var e=t.artboard;if(!e)return"";var n=e.verties,r=this.$viewport,i=r.minY,a=(r.maxY,r.height),o=this.state.rect.height,c=(n[0][1]-i)/a*o,s=(n[2][1]-i)/a*o;return"\n M 20 ".concat(c,"\n L 30 ").concat(c,"\n L 30 ").concat(s,"\n L 20 ").concat(s,"\n Z\n ")}},{key:"makeRulerForCurrent",value:function(){if(!this.$selection.current)return"";var t=this.$viewport,e=t.minY,n=t.height,r=this.state.rect.height,i=this.$selection.verties.map((function(t){return t[1]})),a=(Math.min.apply(Math,i)-e)/n*r,o=(Math.max.apply(Math,i)-e)/n*r;return"\n M 15 ".concat(a,"\n L 20 ").concat(a,"\n L 20 ").concat(o,"\n L 15 ").concat(o,"\n Z\n ")}},{key:"makeRuler",value:function(){var t=this.$viewport,e=t.minY,n=t.maxY,r=t.height,i=this.state.rect.height;return Jg=[],this.makeLine(Jg,200,e,n,r,i,10,18,1e4),this.makeLine(Jg,100,e,n,r,i,10,18,200),this.makeLine(Jg,50,e,n,r,i,10,18,100),this.makeLine(Jg,10,e,n,r,i,10,18,50),this.makeLine(Jg,5,e,n,r,i,10,15,10),this.makeLine(Jg,1,e,n,r,i,10,14,5),Jg.join("")}},{key:"makeRulerText",value:function(){var t=this.$viewport,e=t.minY,n=t.maxY,r=t.height,i=this.state.rect.height,a=Math.abs(n-e);return[a>3e3?this.makeLineText(500,e,n,r,i,20):"",1e3\n \n ').concat(this.makeRulerText(),"\n \n ")}},{key:Tt("$layerRuler")+W,value:function(){return this.state.rect&&0!=this.state.rect.width||(this.state.rect=this.$el.rect()),'\n \n \n \n ')}},{key:"refresh",value:function(){this.$config.get("show.ruler")&&this.load()}},{key:rt("updateViewport"),value:function(){this.refresh()}},{key:rt("refreshSelectionStyleView")+J(10),value:function(){var t=this.$selection.current;t&&t.hasChangedField("x","y","width","height","transform","rotateZ","rotate")&&this.refresh()}},{key:rt("refreshSelection"),value:function(){this.load("$layerRuler")}},{key:rt("resize.window","resizeCanvas"),value:function(){this.refreshCanvasSize()}}]),n}(_g),tm=function(){function t(){O()(this,t)}return j()(t,null,[{key:"getAllDropItems",value:function(t){var e=[];t.dataTransfer&&(e=ce()(t.dataTransfer.types).map((function(e,n){if(e.includes("text"))return{kind:"string",type:e,data:t.dataTransfer.getData(e)}})).filter((function(t){return t})));var n=[];return t.dataTransfer&&(n=ce()(t.dataTransfer.files)),[].concat(ce()(e),ce()(n))}}]),t}(),em=["blur","grayscale","hue-rotate","invert","brightness","contrast","drop-shadow","opacity","saturate","sepia","svg"],nm={text:!0,points:!0,textLength:!0,startOffset:!0,lengthAdjust:!0},rm={d:!0},im={position:!0,x:!0,y:!0,right:!0,bottom:!0,width:!0,height:!0,rootVariable:!0,variable:!0,transform:!0,filter:!0,"backdrop-filter":!0,"background-color":!0,"background-clip":!0,"background-image":!0,"border-radius":!0,"box-shadow":!0,"text-shadow":!0,"text-clip":!0,"clip-path":!0,color:!0,"font-size":!0,"font-stretch":!0,"line-height":!0,"text-align":!0,"text-transform":!0,"text-decoration":!0,"letter-spacing":!0,"word-spacing":!0,"text-indent":!0,"perspective-origin":!0,"transform-origin":!0,"transform-style":!0,perspective:!0,"mix-blend-mode":!0,opacity:!0,rotate:!0,"text-fill-color":!0,"text-stroke-color":!0,"text-stroke-width":!0,"offset-path":!0,"offset-distance":!0,border:!0,outline:!0,borderRadius:!0,animations:!0,transitions:!0,fill:!0,"fill-opacity":!0,stroke:!0,"stroke-width":!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,"fill-rule":!0,"stroke-linecap":!0,"stroke-linejoin":!0},am=function(t){return nm[t]||!1},om=function(t){return im[t]||!1};function cm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var sm=Ka.create("div"),um=function(t){R()(n,t);var e=cm(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n
\n
\n \n
\n "}},{key:"initialize",value:function(){$a()(V()(n.prototype),"initialize",this).call(this),this.refs.$head=Ka.create(document.head)}},{key:"makeStyle",value:function(t){return this.$editor.html.toStyle(t)}},{key:"refreshStyleHead",value:function(){var t=this,e=this.$selection.currentProject||new nh;this.refs.$head.$$('style[data-renderer-type="html"]').forEach((function(t){return t.remove()})),this.changeStyleHead(e),e.layers.forEach((function(e){return t.changeStyleHead(e)}))}},{key:"changeStyleHead",value:function(t){var e=this,n=Ka.create("div"),r=this.makeStyle(t);n.html(r).children().forEach((function(t){e.refs.$head.append(t)}))}},{key:"refreshStyleHeadOne",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[t];e||(n=t.allLayers);var r=n.map((function(t){return'style[data-renderer-type="html"][data-id="'.concat(t.id,'"]')})).join(","),i=!1;this.refs.$head.$$(r).forEach((function(e){t.isChanged(e.attr("data-timestamp"))&&(i=!0,e.remove())})),i&&this.changeStyleHead(t)}},{key:Tt("$svgArea")+W,value:function(){var t=this.$selection.currentProject||{};return this.$editor.html.renderSVG(t)}},{key:rt("refreshStyleView","moveTimeline","playTimeline"),value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(this.load(),this.refreshStyleHeadOne(t,e)):this.refresh()}},{key:rt("refreshSVGArea"),value:function(){this.load("$svgArea")}},{key:rt("refreshSelection"),value:function(){var t=this.$selection.items.map((function(t){return'[data-id="'.concat(t.id,'"]')})).join(","),e=this.$selection.isMany?"\n ".concat(t," {\n box-shadow: 0 0 0 1px #66baff;\n }\n "):"";this.refs.$styleView.html(e)}},{key:rt("refreshSelectionStyleView"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=t;Array.isArray(t)?e=t:null!==t&&(e=[t]);for(var n=[],r=[],i=[],a=0,o=(n=e?Zt(e[0])?this.$selection.itemsByIds(e):e:this.$selection.items).length;a\n \n
\n ".concat(this.$menuManager.generate("render.view"),"\n \n ")}},{key:rt("afterChangeMode"),value:function(){this.$el.attr("data-mode",this.$editor.mode)}},{key:rt("refElement"),value:function(t,e){Jt(e)&&e(this.getElement(t))}},{key:"clearElementAll",value:function(){var t=this;this.$selection.each((function(e){t.clearElement(e.id)}))}},{key:"clearElement",value:function(t){this.state.cachedCurrentElement[t]=void 0}},{key:"getElement",value:function(t){return this.state.cachedCurrentElement[t]||(this.state.cachedCurrentElement[t]=this.refs.$view.$('[data-id="'.concat(t,'"]'))),this.state.cachedCurrentElement[t]}},{key:ut("$view .element-item.text .text-content"),value:function(t){t.$dt.addClass("focused"),t.$dt.attr("contenteditable","true"),t.$dt.focus(),t.$dt.select()}},{key:bt("$view .element-item.text .text-content"),value:function(t){t.$dt.removeAttr("contenteditable"),t.$dt.removeClass("focused")}},{key:ft("$view .element-item.text .text-content"),value:function(t){var e=t.$dt.html(),n=t.$dt.text(),r=t.$dt.parent().attr("data-id"),i=[];this.$selection.items.filter((function(t){return t.id===r})).forEach((function(t){t.reset({content:e,text:n}),i.push({id:t.id,content:e,text:n})})),this.emit("refreshContent",i),this.emit("refreshSelectionTool",!1)}},{key:"checkEditMode",value:function(t){if(this.$config.get("set.tool.hand"))return!1;var e=this.$shortcuts.getGeneratedKeyCode(hd.space);if(this.$keyboardManager.check(e))return!1;var n=this.$viewport.getWorldPosition(t);if(this.$selection.hasPoint(n))return!0;var r=Ka.create(t.target);if(r.hasClass("canvas-view"))return!1;var i=r.closest("element-item");if(!i)return!!this.$editor.isSelectionMode();if(i.hasClass("focused"))return!1;var a=i.attr("data-id");if(!1===t.altKey){var o=this.$selection.currentProject.searchById(a);if(o.is("artboard")&&o.hasChildren())return this.$config.set("set.dragarea.mode",!0),!0}return this.$editor.isSelectionMode()}},{key:ut("$view"),value:function(t){var e=Ka.create(t.target).closest("element-item").attr("data-id"),n=this.$selection.get(e);this.$selection.isOne&&n&&(this.emit("open.editor"),this.emit("removeGuideLine"))}},{key:wt("$view")+N("checkEditMode")+Ag("calculateMovedElement")+zg("calculateEndedElement"),value:function(t){if(this.initMousePoint=this.$viewport.getWorldPosition(t),this.$config.get("set.dragarea.mode"))this.emit("startDragAreaView");else{var e=this.$selection.hasPoint(this.initMousePoint),n=Ka.create(t.target);if(n.hasClass("canvas-view"))return this.$selection.select(),this.initializeDragSelection(),this.emit("history.refreshSelection"),!1;var r=n.closest("element-item"),i=r&&r.attr("data-id");if(e&&r&&!1===r.hasClass("artboard")&&(e=!1),t.altKey)e||!1===this.$selection.check({id:i})&&this.$selection.selectById(i),!1===this.$selection.isEmpty&&(this.$selection.selectAfterCopy(),this.trigger("refreshAllCanvas"),this.emit("refreshLayerTreeView"),this.initializeDragSelection(),this.emit("history.refreshSelection"));else{if(e);else if(t.shiftKey)this.$selection.toggleById(i);else if(!1===this.$selection.check({id:i})){var a=this.$selection.currentProject.searchById(i);a&&a.is("artboard")&&a.hasChildren()||this.$selection.selectById(i)}this.initializeDragSelection(),this.emit("history.refreshSelection")}}}},{key:"initializeDragSelection",value:function(){this.$selection.reselect(),this.$snapManager.clear(),this.emit("refreshSelectionTool",!0)}},{key:"calculateMovedElement",value:function(){if(this.$config.get("set.dragarea.mode"))this.emit("moveDragAreaView");else if(!this.$selection.isLayoutItem){var t=this.$viewport.getWorldPosition(),e=i.floor([],i.subtract([],t,this.initMousePoint));this.moveTo(e),this.$selection.changeArtBoard()&&(this.initMousePoint=t,this.$selection.reselect(),this.$snapManager.clear(),this.clearElementAll(),this.trigger("refreshAllCanvas"),this.emit("refreshLayerTreeView")),this.emit("setAttributeForMulti",this.$selection.pack("x","y")),this.emit("refreshSelectionTool",!0)}}},{key:"moveTo",value:function(t){t=i.floor([],t);var e=this.$snapManager.check(this.$selection.cachedRectVerties.map((function(e){return i.add([],e,t)})),3),n=i.add([],e,t),r={};this.$selection.cachedItemVerties.forEach((function(t){r[t.id]={x:Sa.px(t.x+n[0]).round(1e3),y:Sa.px(t.y+n[1]).round(1e3)}})),this.$selection.reset(r)}},{key:rt("selectionToolView.moveTo"),value:function(t){this.moveTo(t),this.emit("refreshSelectionTool",!0)}},{key:"calculateEndedElement",value:function(t,e){var n=this.$viewport.getWorldPosition(),r=i.dist(n,this.initMousePoint);if(this.$config.get("set.dragarea.mode"))return this.emit("endDragAreaView"),void this.$config.set("set.dragarea.mode",!1);r<1?this.$selection.current:(this.$selection.reselect(),this.$snapManager.clear(),this.command("setAttributeForMulti","move item",this.$selection.pack("x","y"))),this.emit("refreshSelectionTool",!0)}},{key:It("$body"),value:function(){var t=this.$editor,e=t.canvasWidth,n=t.canvasHeight;return{"data-mode":t.mode,tabIndex:-1,style:{width:Sa.px(e),height:Sa.px(n)}}}},{key:It("$view"),value:function(){var t=this.$viewport,e=t.translate,n=t.transformOrigin,r=t.scale,i="translate(".concat(e[0],"px, ").concat(e[1],"px) scale(").concat(r||1,")");return{style:{"transform-origin":"".concat(n[0],"px ").concat(n[1],"px"),transform:i}}}},{key:rt("refreshSelectionStyleView"),value:function(t){var e=this;(t?[t]:this.$selection.items).forEach((function(t){e.updateElement(t)}))}},{key:"updateElement",value:function(t){t&&this.$editor.html.update(t,this.getElement(t.id),this.$editor)}},{key:"updateTimelineElement",value:function(t){t&&this.$editor.html.update(t,this.getElement(t.id),this.$editor)}},{key:rt("playTimeline","moveTimeline"),value:function(){var t=this,e=this.$selection.currentProject,n=e.getSelectedTimeline();n&&n.animations.map((function(t){return e.searchById(t.id)})).forEach((function(e){t.updateTimelineElement(e,!0,!1)}))}},{key:rt("refreshAllCanvas"),value:function(){this.clearElementAll();var t=this.$selection.currentProject,e=this.$editor.html.render(t,null,this.$editor)||"";this.setState({html:e},!1),this.refs.$view.updateDiff(e),this.bindData("$view"),this.trigger("updateAllCanvas",t)}},{key:rt("updateAllCanvas"),value:function(t){var e=this;t.layers.forEach((function(t){e.updateElement(t,e.getElement(t.id)),e.trigger("updateAllCanvas",t)}))}},{key:rt("refreshAllElementBoundSize"),value:function(){var t=this,e=this.$selection.items.map((function(t){return t.is("artboard")?t:t.parent}));ce()(new Set(e)).forEach((function(e){t.trigger("refreshElementBoundSize",e)}))}},{key:rt("refreshElementBoundSize"),value:function(t){var e=this;t&&t.layers.forEach((function(t){if(t.isLayoutItem()){var n=e.getElement(t.id);if(n){var r=n.offsetRect(),i=r.x,a=r.y,o=r.width,c=r.height;t.reset({x:Sa.px(i),y:Sa.px(a),width:Sa.px(o),height:Sa.px(c)}),e.trigger("refreshSelectionStyleView",t,!0)}}e.trigger("refreshElementBoundSize",t)}))}},{key:rt("updateViewport"),value:function(){this.bindData("$view")}}]),n}(_g);n(37);function hm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var pm=function(t){R()(n,t);var e=hm(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){var t=this;return" \n
\n \n
\n ").concat(Cg.add," \n \n \n \n \n ").concat(this.$menuManager.generate("page.tools")," \n \n\n ")}},{key:rt("updateViewport"),value:function(){var t=Math.floor(100*this.$viewport.scale);this.children.$scale&&this.children.$scale.setValue(t)}},{key:st("$plus")+et+nt,value:function(){var t=this.$viewport.scale;this.$viewport.setScale(t+.01),this.emit("updateViewport"),this.trigger("updateViewport")}},{key:st("$minus")+et+nt,value:function(){var t=this.$viewport.scale;this.$viewport.setScale(t-.01),this.emit("updateViewport"),this.trigger("updateViewport")}},{key:st("$center")+et+nt,value:function(){this.emit("moveSelectionToCenter")}},{key:st("$pantool")+et+nt,value:function(){this.$config.toggle("set.tool.hand")}},{key:st("$ruler")+et+nt,value:function(){this.$config.toggle("show.ruler")}},{key:st("$fullscreen")+et+nt,value:function(){this.emit("bodypanel.toggle.fullscreen")}},{key:ot("set.tool.hand"),value:function(){this.refs.$pantool.toggleClass("on",this.$config.get("set.tool.hand"))}}]),n}(_g);n(38);function dm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var ym=function(t){R()(n,t);var e=vm(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n
\n
\n
\n
\n \n \n
\n "}},{key:"initState",value:function(){return{dragStart:!1,width:0,height:0,color:"black",fontSize:30,showRectInfo:!1,areaVerties:Vo(0,0,0,0),content:"Insert a text",pathManager:new gf,rect:{},options:{},containerItem:void 0}}},{key:"scale",get:function(){return this.$viewport.scale}},{key:"checkNotDragStart",value:function(){return!1===Boolean(this.state.dragStart)}},{key:St("$el")+N("checkNotDragStart"),value:function(t){var e=this.$viewport.getWorldPosition(t),n=this.$snapManager.checkPoint(e);!1===i.equals(n,e)?(this.state.target=n,this.state.targetVertex=this.$viewport.applyVertex(this.state.target),this.state.targetPositionVertex=i.clone(this.state.target),this.state.targetGuides=this.$snapManager.findGuideOne([this.state.target])):(this.state.target=null,this.state.targetGuides=[],this.state.targetPositionVertex=null),this.bindData("$mousePointer")}},{key:wt("$el")+Ag()+zg()+et+nt,value:function(t){this.initMousePoint=this.state.targetPositionVertex?this.state.targetPositionVertex:this.$viewport.getWorldPosition(t),this.state.dragStart=!0,this.state.color="#C4C4C4",this.state.text="";var e=Vo(this.initMousePoint[0],this.initMousePoint[1],0,0);this.state.areaVerties=this.$viewport.applyVerties(e),this.bindData("$area"),this.bindData("$areaRect")}},{key:"createLayerTemplate",value:function(t,e){var n=this.state,r=n.type,i=n.text,a=n.color;switch(r){case"artboard":return"
";case"rect":return"
");case"circle":return"
");case"text":case"svg-text":return"\n
\n

\n
";case"svg-rect":return"\n
\n \n \n \n
\n ');case"svg-circle":return"\n
\n \n \n \n
\n ');case"svg-textpath":return"\n
\n \n \n \n \n \n ').concat(i,"\n \n \n
\n ");default:return"
"}}},{key:It("$area"),value:function(){var t=Do(this.state.areaVerties),e=t.left,n=t.top,r=t.width,i=t.height;return{style:{left:e,top:n,width:r,height:i},innerHTML:this.createLayerTemplate(r.value,i.value)}}},{key:It("$areaRect"),value:function(){var t=this.state,e=t.areaVerties,n=t.showRectInfo,r=Do(this.$viewport.applyVertiesInverse(e)),i=r.width,a=r.height;return{style:{display:n?"inline-block":"none",left:Sa.px(e[2][0]),top:Sa.px(e[2][1])},innerHTML:"".concat(i.value," x ").concat(a.value)}}},{key:"makeMousePointer",value:function(){var t=this;if(!this.state.target)return"";var e=(this.state.targetGuides||[]).filter(Boolean);return 0!==e.length?'\n \n '.concat(e.map((function(e){return t.state.pathManager.reset(),e=t.$viewport.applyVerties([e[0],e[1]]),t.state.pathManager.M({x:e[0][0],y:e[0][1]}).L({x:e[1][0],y:e[1][1]}).X({x:e[0][0],y:e[0][1]}).X({x:e[1][0],y:e[1][1]}).toString("layer-add-snap-pointer")})).join("\n"),"\n \n "):void 0}},{key:It("$mousePointer"),value:function(){return{innerHTML:this.makeMousePointer()}}},{key:"move",value:function(){var t=this.$config.get("bodyEvent"),e=this.$viewport.getWorldPosition(),n=this.$snapManager.checkPoint(e);!1===i.equals(n,e)?(this.state.target=n,this.state.targetVertex=this.$viewport.applyVertex(n),this.state.targetGuides=this.$snapManager.findGuideOne([n]).filter(Boolean)):(this.state.target=null,this.state.targetGuides=[]);var r=t.shiftKey,a=Math.min(n[0],this.initMousePoint[0]),o=Math.min(n[1],this.initMousePoint[1]),c=Math.max(n[0],this.initMousePoint[0])-a,s=Math.max(n[1],this.initMousePoint[1])-o;r&&(s=c);var u=Vo(a,o,c,s);this.state.areaVerties=this.$viewport.applyVerties(u),this.state.showRectInfo=!0,this.bindData("$area"),this.bindData("$areaRect"),this.bindData("$mousePointer")}},{key:"end",value:function(t,e){var n=this.$config.get("bodyEvent").altKey,r=this.state,i=r.color,a=r.content,o=r.fontSize,c=r.areaVerties,s=this.$viewport.applyVertiesInverse(c),u=this.$selection.getArtboardByPoint(s[0]),l=Do(s),f=l.x,h=l.y,p=l.width,d=l.height,v=!0;if(0===p.value&&0===d.value)switch(this.state.type){case"text":a="",d.set(this.state.fontSize),v=!1;break;default:p.set(100),d.set(100)}var y=function(t){for(var e=1;e p");return m.parent().css("height","".concat(g,"px")),m.parent().css("font-size","".concat(g,"px")),m.select(),void m.focus()}y["font-size"]=Sa.px(this.state.fontSize/this.$viewport.scale);default:this.emit("newComponent",this.state.type,y,!0,u)}n||this.trigger("hideLayerAppendView"),this.state.dragStart=!1,this.state.showRectInfo=!1,this.state.target=null,this.bindData("$areaRect")}},{key:rt("showLayerAppendView"),value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.state.type=t,this.state.options=e,this.state.isShow=!0,this.refs.$area.empty(),this.$el.show(),this.$el.focus(),this.$snapManager.clear(),this.emit("change.mode.view","CanvasView")}},{key:rt("hideLayerAppendView"),value:function(){this.$el.isShow()&&(this.state.isShow=!1,this.$el.hide(),this.emit("change.mode.view"))}},{key:rt("hideAddViewLayer"),value:function(){this.state.isShow=!1,this.$el.hide()}},{key:"isShow",value:function(){return this.state.isShow}},{key:lt("document")+N("isShow")+Y+X+et+nt,value:function(t){}},{key:ft("document")+N("isShow")+Y+X+et+nt,value:function(t){switch(this.state.type){case"text":var e=Ka.create(t.target),n=this.state,r=n.fontSize,i=n.areaVerties,a=this.$viewport.applyVertiesInverse(i),o=Do(a),c=o.x,s=o.y,u=e.rect(),l=u.width,f=u.height,h=e.text();if(console.log(h,f),0===h.length)break;var p=this.$viewport.applyScaleVertiesInverse([[l,f,r]]),d=zt()(p,1),v=zt()(d[0],3),y=v[0],g=v[1],m=v[2],b={x:c,y:s,width:Sa.px(y),height:Sa.px(g),content:h.trim(),"font-size":Sa.px(m)},k=this.$selection.getArtboardByPoint(a[0]);this.emit("newComponent",this.state.type,b,!0,k)}this.state.dragStart=!1,this.state.showRectInfo=!1,this.state.target=null,this.bindData("$areaRect"),this.trigger("hideLayerAppendView")}},{key:ft("$el")+N("isShow"),value:function(t){switch(this.state.type){case"text":var e=Ka.create(t.target).rect();e.width,e.height}}},{key:yt("$file"),value:function(t){var e=this;this.refs.$file.files.forEach((function(t){e.emit("updateImage",t,e.state.rect,e.state.containerItem)}))}},{key:yt("$video"),value:function(t){var e=this;this.refs.$video.files.forEach((function(t){e.emit("updateVideo",t,e.state.rect,e.state.containerItem)}))}},{key:rt("openImage"),value:function(t,e){this.state.rect=t,this.state.containerItem=e,this.refs.$file.click()}},{key:rt("openVideo"),value:function(t,e){this.state.rect=t,this.state.containerItem=e,this.refs.$video.click()}}]),n}(_g);function gm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function mm(t){for(var e=1;e4&&void 0!==arguments[4]&&arguments[4];return this.segmentList.push(mm(mm({},t),{},{cx:e.x,cy:e.y,selected:i,index:n,segment:r,isFirst:e.isFirst,isLast:e.isLast,isSecond:e.isSecond})),this}},{key:"addStartPoint",value:function(t,e){return this.segmentList.push(mm(mm({},t),{},{cx:e.x,cy:e.y,start:!0})),this}},{key:"addCurvePoint",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.segmentList.push({curve:!0,cx:t.x,cy:t.y,index:e,selected:r,segment:n,isFirst:t.isFirst,isLast:t.isLast,isSecond:t.isSecond}),this}},{key:"addText",value:function(t,e){return this.segmentList.push({type:"text",cx:t.x,cy:t.y,text:e+""}),this}},{key:"toString",value:function(){return this.segmentList.sort((function(t,e){return t.line&&!e.line?-1:!t.line&&e.line?1:0})),this.segmentList.map((function(t){return t.angle?"\n '):t.line?'\n "):t.text?"":t.curve?"\n '):t.start?"\n '):"\n ')})).join("")}}]),t}();function km(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function xm(t){for(var e=1;ee.dist?1:-1})),i.length?i[0].point:null}function Sm(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=[],a=0,o=t.length;a3&&void 0!==arguments[3]?arguments[3]:1,i=n.command,a=n.values;switch(i){case"Z":return"Z";default:var o=a.map((function(n){var i=n.x-t==0?0:(n.x-t)/r,a=n.y-e==0?0:(n.y-e)/r;return"".concat(i," ").concat(a)})).join(" ");return"".concat(i," ").concat(o)}}var $m=function(){function t(e){O()(this,t),this.pathEditor=e,this.pathStringManager=new gf,this.guideLineManager=new gf,this.segmentManager=new bm,this.initialize(),this.initializeSelect()}return j()(t,[{key:"initialize",value:function(){this.splitLines=[],this.guideLineManager.reset(),this.segmentManager.reset(),this.pathStringManager.reset()}},{key:"initializeSelect",value:function(){this.selectedPointKeys={},this.selectedPointList=[]}},{key:"state",get:function(){return this.pathEditor.state}},{key:"clonePoints",get:function(){return ce()(this.state.points)}},{key:"selectInBox",value:function(t){var e=[],n=["startPoint","endPoint","reversePoint"];this.state.points.forEach((function(r,i){n.forEach((function(n){var a=r[n];(function(t,e){return!(t.x2.valuee.x)&&!(t.y.value>e.y)))})(t,a)&&e.push({x:a.x,y:a.y,key:n,index:i})}))})),this.select.apply(this,e)}},{key:"select",value:function(){var t=this;this.selectedPointKeys={};for(var e=arguments.length,n=new Array(e),r=0;r2&&void 0!==arguments[2]?arguments[2]:[],r=this.state,i=r.points;this.snapPointList=[],r.selectedIndex=t,r.connectedPoint=Ac.getPrevPoint(i,t),r.connectedPoint&&!r.connectedPoint.connected&&(r.connectedPoint=null),r.segment=Ac.getIndexPoint(i,t),r.segment.connected&&(r.connectedPoint=Ac.getNextPoint(i,t));var a=Ac.isFirst(r.segment);if(a){var o=Ac.getLastPoint(i,t);o.connected&&(r.connectedPoint=o)}r.segmentKey=e,r.isCurveSegment=r.segment.curve&&"startPoint"!=r.segmentKey,r.originalSegment=ee(r.segment),r.connectedPoint&&(r.originalConnectedPoint=ee(r.connectedPoint)),r.cachedPoints=[],i.filter((function(t){return t&&t!=r.segment})).forEach((function(t){r.cachedPoints.push(t.startPoint,t.reversePoint,t.endPoint)})),r.cachedPoints.push.apply(r.cachedPoints,n.map((function(t){var e=zt()(t,3);return{x:e[0],y:e[1],z:e[2]}})))}},{key:"moveSegment",value:function(t,e,n){var r=this.state,i=r.originalSegment[t],a=r.segment[t];i&&(a.x=i.x+e,a.y=i.y+n)}},{key:"calculateToCurve",value:function(t,e,n){var r=(e.startPoint.x+n.startPoint.x)/2,i=(e.startPoint.y+n.startPoint.y)/2,a=(e.startPoint.x-r)/2,o=(e.startPoint.y-i)/2;return t.endPoint={x:t.startPoint.x+a,y:t.startPoint.y+o},t.reversePoint={x:t.startPoint.x-a,y:t.startPoint.y-o},{dx:a,dy:o}}},{key:"convertToCurve",value:function(t){var e=this.state.points,n=e[t];if(n.curve)if(n.curve=!1,n.reversePoint=ee(n.startPoint),n.endPoint=ee(n.startPoint),"M"===n.command){var r=Ac.getPrevPoint(e,n.index);r.connected&&(r.curve=!1,r.reversePoint=ee(r.startPoint),r.endPoint=ee(r.startPoint))}else{if((i=Ac.getNextPoint(e,t))&&"M"===i.command)(o=i).curve=!1,o.reversePoint=ee(o.startPoint),o.endPoint=ee(o.startPoint)}else{n.curve=!0;var i,a=Ac.getPrevPoint(e,t);if((i=Ac.getNextPoint(e,t))&&i.indext&&"M"!==i.command)this.calculateToCurve(n,i,a);else if(!i&&a){var c=(n.startPoint.x-a.startPoint.x)/3,s=(n.startPoint.y-a.startPoint.y)/3;n.endPoint={x:n.startPoint.x+c,y:n.startPoint.y+s},n.reversePoint=Ac.getReversePoint(n.startPoint,n.endPoint)}else if(!a&&i){c=(n.startPoint.x-i.startPoint.x)/3,s=(n.startPoint.y-i.startPoint.y)/3;n.endPoint={x:n.startPoint.x+c,y:n.startPoint.y+s},n.reverse=Ac.getReversePoint(n.startPoint,n.endPoint)}}}},{key:"moveCurveSegment",value:function(t,e,n){var r=this.state;this.moveSegment(t,e,n);var i="endPoint"===t?"reversePoint":"endPoint";r.segment[i]=Ac.getReversePoint(r.segment.startPoint,r.segment[t])}},{key:"rotateSegmentTarget",value:function(t,e){var n=this.state;if(n.originalSegment&&n.segment){var r=n.originalSegment.startPoint,i=r.x,a=r.y,o=n.segment[t],c=o.x,s=o.y,u=n.originalSegment[e],l=u.x,f=u.y,h=Xi(la(c-i,s-a),Yi(l,f,i,a),i,a),p=h.x,d=h.y;n.segment[e]={x:p,y:d}}}},{key:"rotateSegment",value:function(t){this.rotateSegmentTarget(t,"endPoint"===t?"reversePoint":"endPoint")}},{key:"calculateSnap",value:function(t,e,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return function(e,n){var a=r.state,o=a.cachedPoints,c=a.originalSegment[t];if(!t)return{dx:e,dy:n,snapPointList:[]};var s=c.x+e,u=c.y+n,l=Pm(o,"x",s,e,i),f=l.point,h=(e=l.distanceValue,Pm(o,"y",u,n,i)),p=h.point,d=(n=h.distanceValue,{x:c.x+e,y:c.y+n}),v=[];return f&&v.push({startPoint:f,endPoint:d}),p&&v.push({startPoint:p,endPoint:d}),{dx:e,dy:n,snapPointList:v}}(e,n)}},{key:"copySegment",value:function(t,e){e.startPoint=ee(t.startPoint),e.endPoint=ee(t.endPoint),e.reversePoint=ee(t.reversePoint)}},{key:"selectedLength",get:function(){return this.selectedPointList.length}},{key:"moveSelectedSegment",value:function(t,e){var n=this;this.selectedPointList.forEach((function(r){var i=n.state.points[r.index][r.key];i.x=r.x+t,i.y=r.y+e}))}},{key:"removeSelectedSegment",value:function(){var t=this;this.selectedPointList.forEach((function(e){t.state.points[e.index][e.key].removed=!0}));var e=Ac.splitPoints(this.state.points),n=Ac.recoverPoints(e.map((function(t){return t.filter((function(t){return!t.startPoint.removed})).map((function(t){return t.endPoint.removed&&(t.endPoint=ee(t.startPoint)),t.reversePoint.removed&&(t.reversePoint=ee(t.startPoint)),Ac.isEqual(t.endPoint,t.startPoint,t.reversePoint)&&(t.command="L",t.curve=!1),t}))})));this.state.points=n,this.select()}},{key:"move",value:function(t,e,n){var r=this.state,i=r.isCurveSegment,a=r.segmentKey,o=r.connectedPoint,c=this.calculateSnap(a,t,e,3),s=(t=c.dx,e=c.dy,c.snapPointList);if(this.snapPointList=s||[],this.selectedPointList.length>1)this.moveSelectedSegment(t,e);else if(i)if(n.shiftKey)this.moveSegment(a,t,e);else if(n.altKey)this.moveSegment(a,t,e),this.rotateSegment(a);else{this.moveSegment(a,t,e);var u="endPoint"===a?"reversePoint":"endPoint";r.segment[u]=Ac.getReversePoint(r.segment.startPoint,r.segment[a])}else this.moveSegment("startPoint",t,e),this.moveSegment("endPoint",t,e),this.moveSegment("reversePoint",t,e);o&&this.copySegment(r.segment,r.connectedPoint)}},{key:"moveEnd",value:function(t,e){var n=this.state,r=n.points,i=n.dragXY.x+t,a=n.dragXY.y+e,o={x:i,y:a},c={x:i,y:a};n.dragPoints&&(c=Ac.getReversePoint(n.startPoint,o)),r.push({command:0===n.clickCount?"M":"",startPoint:n.startPoint,endPoint:o,curve:!!n.dragPoints,reversePoint:c}),n.startPoint=null,n.dragPoints=!1,n.moveXY=null}},{key:"setPoint",value:function(t){var e=t.first[0],n=t.second[t.second.length-1],r=this.clonePoints,i=Ac.getPoint(r,e),a=Ac.getPoint(r,n),o=[xm(xm({},i),{},{endPoint:t.first[1]}),{startPoint:t.first[3],reversePoint:t.first[2],curve:!0,endPoint:t.second[1]},xm(xm({},a),{},{reversePoint:t.second[2]})],c=Ac.getIndex(r,e);return r.splice.apply(r,[c,2].concat(o)),this.state.points=r,c+1}},{key:"setPointQuard",value:function(t){var e=t.first[0],n=t.second[t.second.length-1],r=this.clonePoints,i=Ac.getPoint(r,e),a=Ac.getPoint(r,n);if(i.curve&&!1===a.curve){var o=[xm(xm({},i),{},{endPoint:i.startPoint}),{startPoint:t.first[2],reversePoint:t.first[1],curve:!0,endPoint:t.second[1]}],c=Ac.getIndex(r,e);r.splice.apply(r,[c,1].concat(ce()(o)))}else{o=[xm({},i),{startPoint:t.first[2],reversePoint:t.first[1],curve:!0,endPoint:t.second[1]},xm(xm({},a),{},{reversePoint:t.second[1],curve:!0})],c=Ac.getIndex(r,e);r.splice.apply(r,[c,2].concat(ce()(o)))}return this.state.points=r,c+1}},{key:"setPointLine",value:function(t){var e=t.first[0],n=this.clonePoints,r=[{command:"L",startPoint:t.first[1],curve:!1,endPoint:t.first[1],reversePoint:t.first[1]}],i=Ac.getIndex(n,e);return n.splice.apply(n,[i+1,0].concat(r)),this.state.points=n,i+1}},{key:"toPath",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Sm(this.clonePoints,t,e,n)}},{key:"makeSVGPath",value:function(){return this.initialize(),this.makePointGuide(this.clonePoints),this.makeMovePositionGuide(),this.toSVGString()}},{key:"makeTriangleDistancePointGuide",value:function(t,e){var n=Math.min(t.startPoint.x,e.startPoint.x),r=Math.max(t.startPoint.x,e.startPoint.x),i=Math.min(t.startPoint.y,e.startPoint.y),a=Math.max(t.startPoint.y,e.startPoint.y);if(t.startPoint.xe.startPoint.y?this.segmentManager.addDistanceLine({x:n,y:a},{x:r,y:a}).addDistanceLine({x:r,y:i},{x:r,y:a}):t.startPoint.x>e.startPoint.x&&t.startPoint.y>e.startPoint.y?this.segmentManager.addDistanceLine({x:n,y:i},{x:n,y:a}).addDistanceLine({x:n,y:a},{x:r,y:a}):t.startPoint.x>e.startPoint.x&&t.startPoint.y2&&void 0!==arguments[2]?arguments[2]:1,r=Om(t,"x",e.x,n),i=Om(t,"y",e.y,n),a=xm({},e);r&&(a.x=r.x),i&&(a.y=i.y);var o=[];return r&&o.push({startPoint:r,endPoint:a}),i&&o.push({startPoint:i,endPoint:a}),{snapPointList:o,moveXY:a}}(e,r,3),c=o.snapPointList,s=o.moveXY;a.push.apply(a,c),t.moveXY=s,r=s,this.snapPointList=a;var u=e[e.length-1];if(i)if(u){if(u.curve){var l=Ac.getReversePoint(n,r);p=l.x,d=l.y;this.guideLineManager.M(u.startPoint).C(u.endPoint,{x:p,y:d},n),this.segmentManager.addGuideLine(u.startPoint,u.endPoint).addGuideLine(n,{x:p,y:d}).addGuideLine(n,r).addCurvePoint(u.endPoint).addCurvePoint({x:p,y:d}).addCurvePoint(r).addPoint(!1,n)}else if(!1===u.curve){var f=Ac.getReversePoint(n,r);p=f.x,d=f.y;this.guideLineManager.M(u.startPoint).Q({x:p,y:d},n),this.segmentManager.addGuideLine(r,{x:p,y:d}).addPoint(!1,n).addCurvePoint({x:p,y:d}).addCurvePoint(r)}}else{var h=Ac.getReversePoint(n,r),p=h.x,d=h.y;this.guideLineManager.M(r).L(n).L({x:p,y:d}),this.segmentManager.addCurvePoint(n).addCurvePoint(r).addCurvePoint({x:p,y:d})}else u&&(u.curve?(this.guideLineManager.M(u.startPoint).Q(u.endPoint,r),this.segmentManager.addGuideLine(u.endPoint,u.startPoint).addCurvePoint(u.endPoint)):u.close||(this.guideLineManager.M(u.startPoint).L(r),this.segmentManager.addPoint(!1,u.startPoint)))}}},{key:"makeSnapLines",value:function(){var t=[];if(this.snapPointList){var e=new gf;t=this.snapPointList.map((function(t){return e.reset(),e.M(t.startPoint).L(t.endPoint).X(t.startPoint).toString("snap-path")}))}return t.join("")}},{key:"toSVGString",value:function(){return'\n \n '.concat(this.guideLineManager.toString("guide",this.state.isPolygon),"\n ").concat(this.pathStringManager.toString("object",this.state.isPolygon),"\n ").concat(this.splitLines.join(""),"\n ").concat(this.makeSnapLines(),"\n ").concat(this.segmentManager.toString(),"\n \n ")}}],[{key:"generatorPathString",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return Sm(t,e,n,r).d}}]),t}();function Rm(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Cm=function(t){R()(n,t);var e=Rm(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"toString",value:function(){return""}},{key:"toSVGString",value:function(t){return""}},{key:"toFillValue",value:function(t){return""}}]),n}(zu);function Mm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Tm(t){for(var e=1;e\n ').concat(this.colorsteps.map((function(t){return'')})).join("\n"),"\n \n ")}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}],[{key:"toLinearGradient",value:function(t){return 0===t.length?"none":new LinearGradient({angle:"to right",colorsteps:t})+""}},{key:"parse",value:function(t){var e=Ds(t),r={},i=[];return e.str.split("(")[1].split(")")[0].split(",").map((function(t){return t.trim()})).forEach((function(t,n){if(t.includes("@"))t=Bs(t,e.matches),i.push.apply(i,Iu.parse(t));else{var a=t.split(" "),o=zt()(a,5),c=o[0],s=o[1],u=o[2],l=o[3],f=o[4];r.x1=Sa.parse(c),r.y1=Sa.parse(s),r.x2=Sa.parse(u),r.y2=Sa.parse(l),r.spreadMethod=f||"pad"}})),new n(Tm(Tm({},r),{},{colorsteps:i}))}}]),n}(Cm);function Im(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dm(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,Dm({type:"radial-gradient",cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",fr:"0%",spreadMethod:"pad"},t))}},{key:"toCloneObject",value:function(){return Dm(Dm({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("cx","cy","r","fx","fy","fr","spreadMethod"))}},{key:"toString",value:function(){if(0===this.colorsteps.length)return"";var t=this.getColorString(),e=this.json,n=[e.cx,e.cy,e.r,e.fx,e.fy,e.fr,e.spreadMethod].join(" ");return"".concat(this.json.type,"(").concat(n,", ").concat(t,")")}},{key:"toSVGString",value:function(t){var e=this.json,n=e.cx,r=e.cy,i=e.r,a=e.fx,o=e.fy,c=e.fr,s=e.spreadMethod;return"\n\n ").concat(this.colorsteps.map((function(t){return'')})).join("\n"),"\n\n")}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}],[{key:"parse",value:function(t){var e=Ds(t),r={},i=[];return e.str.split("(")[1].split(")")[0].split(",").map((function(t){return t.trim()})).forEach((function(t,n){if(t.includes("@"))t=Bs(t,e.matches),i.push.apply(i,Iu.parse(t));else{var a=t.split(" "),o=zt()(a,7),c=o[0],s=o[1],u=o[2],l=o[3],f=o[4],h=o[5],p=o[6];r.cx=c,r.cy=s,r.r=u,r.fx=l,r.fy=f,r.fr=h,r.spreadMethod=p||"pad"}})),new n(Dm(Dm({},r),{},{colorsteps:i}))}}]),n}(Cm);function Am(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function zm(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"transparent";return new n({colorsteps:[new Iu({color:t,percent:0,index:0}),new Iu({color:t,percent:100,index:0})]})}}]),n}(Cm);function Gm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _m(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,_m({type:"url",url:"",datauri:"",patternUnits:"userSpaceOnUse",patternWidth:"100%",patternHeight:"100%",imageX:"0%",imageY:"0%",imageWidth:"100%",imageHeight:"100%"},t))}},{key:"toCloneObject",value:function(){return _m(_m({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("url","datauri","patternUnits","patternWidth","patternHeight","imageX","imageY","imageWidth","imageHeight"))}},{key:"isUrl",value:function(){return!0}},{key:"toString",value:function(){var t=this.json,e=t.patternUnits,n=t.patternWidth,r=t.patternHeight,i=t.imageX,a=t.imageY,o=t.imageWidth,c=t.imageHeight,s=t.url,u=[e,n,r,i,a,o,c].join(",").trim();return"url(".concat(s,"#").concat(u,")")}},{key:"toSVGString",value:function(t){var e=this.json,n=e.patternUnits,r=e.patternWidth,i=e.patternHeight,a=e.imageX,o=e.imageY,c=e.imageWidth,s=e.imageHeight;return"\n \n \n \n ")}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}],[{key:"parse",value:function(t){var e=t.split("(")[1].split(")")[0].trim().split("#"),r=zt()(e,2),i=r[0],a=r[1];if(!a)return new n({url:i});var o=a.split(","),c=zt()(o,7);return new n({patternUnits:c[0],patternWidth:c[1],patternHeight:c[2],imageX:c[3],imageY:c[4],imageWidth:c[5],imageHeight:c[6],url:i})}},{key:"isImageFile",value:function(t){return Xm.includes(t)}}]),n}(Cu);function Km(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Um(t){for(var e=1;e\n
\n "}},{key:"initRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state.rect&&!t||(this.state.rect=this.$el.rect())}},{key:ft("document")+N("isShow")+Y+X+et+nt,value:function(){this.trigger("hidePathDrawEditor")}},{key:"totalPathLength",get:function(){if(!this.refs.$view)return 0;var t=this.refs.$view.$("path.object");return t?t.totalLength:0}},{key:"makePathLayer",value:function(t){var e,n=this,r=this.$selection.currentProject;if(r){var a=Ac.simply(this.state.points,this.state.tolerance),o=new Hc(gf.makePathByPoints(a)),c=new Hc($m.generatorPathString(o.convertGenerator()));c.transformMat4(this.$viewport.matrixInverse);var s=c.getBBox(),u=i.distance(s[1],s[0]),l=i.distance(s[3],s[0]);c.translate(-s[0][0],-s[0][1]);var f={itemType:"svg-path",x:Sa.px(s[0][0]),y:Sa.px(s[0][1]),width:Sa.px(u),height:Sa.px(l),d:c.scale(1/u,1/l).d,totalLength:this.totalPathLength};eb.forEach((function(t){n.state[t]&&Object.assign(f,w()({},t,n.state[t]))})),e=r.appendChildItem(this.$editor.createItem(f))}return e}},{key:"addPathLayer",value:function(){var t=this.getPathRect();if(0!==t.width&&0!==t.height){var e=this.makePathLayer(t);e&&(this.$selection.select(e),this.trigger("hidePathDrawEditor"),this.emit("refreshAll"))}}},{key:"changeMode",value:function(t){this.setState(Qm(Qm({},this.initState()),t),!1)}},{key:"getCurrentObject",value:function(){var t=this.state.current;return t?{current:t,d:t.d,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}:null}},{key:rt("showPathDrawEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.changeMode(t),this.$el.show(),this.$el.focus(),this.emit("showDrawManager",{instance:this,fill:this.state.fill,stroke:this.state.stroke,"fill-opacity":this.state["fill-opacity"],"stroke-width":this.state["stroke-width"],"stroke-linecap":this.state["stroke-linecap"],"stroke-linejoin":this.state["stroke-linejoin"]}),this.emit("hidePathEditor"),this.emit("change.mode.view","PathDrawView")}},{key:rt("initPathDrawEditor"),value:function(){this.pathParser.reset(""),this.refs.$view.empty()}},{key:rt("hidePathDrawEditor"),value:function(){this.$el.isShow()&&(this.trigger("initPathDrawEditor"),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hideDrawManager"),this.emit("change.mode.view"))}},{key:rt("hideAddViewLayer"),value:function(){this.$el.hide(),this.emit("hideDrawManager")}},{key:"getInnerId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"draw-manager-"+t}},{key:"toFillSVG",get:function(){return qm.parseImage(this.state.fill||"transparent").toSVGString(this.fillId)}},{key:"toStrokeSVG",get:function(){return qm.parseImage(this.state.stroke||"black").toSVGString(this.strokeId)}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return"\n \n ".concat(t,"\n \n ")}},{key:"fillId",get:function(){return this.getInnerId("fill")}},{key:"strokeId",get:function(){return this.getInnerId("stroke")}},{key:"toFillValue",get:function(){return qm.parseImage(this.state.fill||"transparent").toFillValue(this.fillId)}},{key:"toStrokeValue",get:function(){return qm.parseImage(this.state.stroke||"black").toFillValue(this.strokeId)}},{key:It("$view"),value:function(){return{innerHTML:'\n \n '.concat(this.toDefString,"\n \n \n ')}}},{key:"renderPath",value:function(){this.bindData("$view")}},{key:rt("resizeEditor"),value:function(){this.initRect(!0)}},{key:"getPathRect",value:function(){this.initRect(!0);var t=this.refs.$view.$("path.object"),e={x:Sa.z(),y:Sa.z(),width:Sa.z(),height:Sa.z()};return t&&((e=t.rect()).x-=this.state.rect.x,e.y-=this.state.rect.y),e}},{key:wt("$view")+Ag()+zg(),value:function(t){this.initRect(),this.state.altKey=!1,this.state.startXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.points=[this.state.startXY]}},{key:"move",value:function(t,e,n,r){this.state.points.push({x:this.state.startXY.x+t,y:this.state.startXY.y+e,pressure:r}),this.renderPath()}},{key:"end",value:function(t,e){this.addPathLayer(),this.trigger("initPathDrawEditor")}}]),n}(_g);n(40);function rb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ib(t){for(var e=1;e\n
\n
\n \n \n \n
\n
\n "}},{key:"isShow",value:function(){return this.state.isShow}},{key:"initRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state.rect&&!t||(this.state.rect=this.$el.rect())}},{key:ft("document")+N("isShow")+X+et+nt,value:function(){this.state.current?(this.refreshPathLayer(),this.trigger("hidePathEditor")):this.addPathLayer(),!this.state.current&&this.state.points.length?this.trigger("initPathEditorView"):this.trigger("hidePathEditor")}},{key:ft("document")+N("isShow")+Y+et+nt,value:function(){this.state.current?this.refreshPathLayer():this.addPathLayer(),this.trigger("hidePathEditor")}},{key:"totalPathLength",get:function(){if(!this.refs.$view)return 0;var t=this.refs.$view.$("path.object");return t?t.totalLength:0}},{key:"makePathLayer",value:function(){var t,e=this,n=this.$selection.currentProject;if(n){var r=new Hc(this.pathGenerator.toPath().d);r.transformMat4(this.$viewport.matrixInverse);var a=r.getBBox(),o=i.distance(a[1],a[0]),c=i.distance(a[3],a[0]);r.translate(-a[0][0],-a[0][1]);var s={itemType:"svg-path",x:Sa.px(a[0][0]),y:Sa.px(a[0][1]),width:Sa.px(o),height:Sa.px(c),d:r.scale(1/o,1/c).d,totalLength:this.totalPathLength,fill:"#C4C4C4"};cb.forEach((function(t){e.state[t]&&(s[t]=e.state[t])})),t=(this.$selection.getArtboardByPoint(a[0])||n).appendChildItem(this.$editor.createItem(s))}return t}},{key:"updatePathLayer",value:function(){var t=this.pathGenerator.toPath().d,e=new Hc(t);e.transformMat4(this.$viewport.matrixInverse),this.emit(this.state.changeEvent,{d:e.d,box:this.state.box,totalLength:this.totalPathLength})}},{key:"addPathLayer",value:function(){this.changeMode("modify");var t=this.makePathLayer();t&&t.totalLength&&(this.$selection.select(t),this.trigger("hidePathEditor"),this.emit("refreshAll"))}},{key:"changeMode",value:function(t,e){this.setState(ib({mode:t,clickCount:0,moveXY:null},e),!1),this.emit("changePathManager",this.state.mode)}},{key:rt("changePathManager"),value:function(t){this.setState(ib(ib({},t),{},{clickCount:0}),!1),this.renderPath()}},{key:"isMode",value:function(t){return this.state.mode===t}},{key:rt("updateViewport"),value:function(t,e){if(this.$el.isShow()){var n=this.pathGenerator.toPath().d,r=new Hc(n);r.transformMat4(this.state.cachedMatrixInverse),this.refresh({d:r.d})}}},{key:"refresh",value:function(t){t&&t.d&&(this.pathParser.reset(t.d),this.pathParser.transformMat4(this.$viewport.matrix),this.state.cachedMatrixInverse=this.$viewport.matrixInverse,this.state.points=this.pathParser.convertGenerator()),this.pathGenerator.initializeSelect(),this.renderPath()}},{key:rt("showPathEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"path",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"move"===t&&(e.current=null,e.points=[]),e.box=e.box||"canvas",this.changeMode(t,e),this.refresh(e),this.state.isShow=!0,this.$el.show(),this.$el.focus(),this.emit("showPathManager",{mode:this.state.mode}),this.emit("hidePathDrawEditor"),this.emit("change.mode.view","PathEditorView")}},{key:rt("hidePathEditor"),value:function(){this.$el.isShow()&&(this.pathParser.reset(""),this.setState(this.initState(),!1),this.refs.$view.empty(),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hidePathManager"),this.emit("change.mode.view"))}},{key:rt("hideAddViewLayer"),value:function(){this.state.isShow=!1,this.pathParser.reset(""),this.setState(this.initState(),!1),this.refs.$view.empty(),this.$el.hide(),this.emit("hidePathManager")}},{key:It("$view"),value:function(){return{class:{path:"path"===this.state.mode,modify:"modify"===this.state.mode,box:"box"===this.state.box,canvas:"canvas"===this.state.box,"segment-move":"segment-move"===this.state.mode},innerHTML:this.pathGenerator.makeSVGPath()}}},{key:It("$splitCircle"),value:function(){return this.state.splitXY?{cx:this.state.splitXY.x,cy:this.state.splitXY.y,r:5}:{r:0}}},{key:"refreshPathLayer",value:function(){this.updatePathLayer()}},{key:"renderPath",value:function(){this.bindData("$view")}},{key:"getPathRect",value:function(){this.initRect(!0);var t=this.refs.$view.$("path.object"),e={x:0,y:0,width:0,height:0};return t&&((e=t.rect()).x-=this.state.rect.x,e.y-=this.state.rect.y),e}},{key:"resetTransformZone",value:function(){var t=this.getPathRect();this.state.transformZoneRect=t}},{key:St("$view")+et,value:function(t){if(this.initRect(),this.isMode("path")&&this.state.rect)this.state.moveXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.altKey=t.altKey,this.renderPath();else{var e=Ka.create(t.target),n=e.hasClass("split-path");this.state.splitXY=n?this.calculatePointOnLine(e.attr("d"),{x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y}):null,this.bindData("$splitCircle"),this.state.altKey=!1}}},{key:wt("$view :not(.split-path)")+et+nt+Ag()+zg(),value:function(t){this.initRect(),this.state.altKey=!1;var e=this.isMode("path");this.state.dragXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.isOnCanvas=!1;var n=Ka.create(t.target);if(n.hasClass("svg-editor-canvas")&&!e?this.state.isOnCanvas=!0:(this.pathGenerator.reselect(),this.state.isSegment="true"===n.attr("data-segment"),this.state.isFirstSegment=this.state.isSegment&&"true"===n.attr("data-is-first")),e){if(this.state.isFirstSegment){var r=+n.attr("data-index");this.state.startPoint=this.state.points[r].startPoint}else this.state.startPoint=this.state.dragXY;this.state.dragPoints=!1,this.state.endPoint=null}else if(this.isOnCanvas)this.renderSelectBox(this.state.dragXY);else if(this.state.isSegment){this.changeMode("segment-move");var i=n.attrs("data-index","data-segment-point"),a=zt()(i,2),o=(r=a[0],a[1]);this.pathGenerator.setCachePoint(+r,o,this.$viewport.applyVerties(this.$snapManager.getSnapPoints())),this.pathGenerator.selectKeyIndex(o,r)}}},{key:"hideSelectBox",value:function(){this.refs.$segmentBox.css({left:Sa.px(-1e5)})}},{key:"renderSelectBox",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r={left:Sa.px(t.x+(e<0?e:0)),top:Sa.px(t.y+(n<0?n:0)),width:Sa.px(Math.abs(e)),height:Sa.px(Math.abs(n))};this.refs.$segmentBox.css(r)}},{key:"getSelectBox",value:function(){var t=this.refs.$segmentBox.styles("left","top","width","height").map((function(t){return Sa.parse(t)})),e=zt()(t,4),n={x:e[0],y:e[1],width:e[2],height:e[3]};return n.x2=Sa.px(n.x.value+n.width.value),n.y2=Sa.px(n.y.value+n.height.value),n}},{key:"move",value:function(t,e){if(this.state.isOnCanvas)this.renderSelectBox(this.state.dragXY,t,e);else if(this.isMode("segment-move")){var n=this.$config.get("bodyEvent");this.pathGenerator.move(t,e,n),this.renderPath(),this.updatePathLayer()}else if(this.isMode("path")){if(Yi(t,e,0,0)>=2){n=this.$config.get("bodyEvent");this.state.dragPoints=!n.altKey}}}},{key:"renderSegment",value:function(t){this.pathGenerator.selectedLength&&(this.pathGenerator.reselect(),Jt(t)&&t(),this.renderPath(),this.updatePathLayer())}},{key:rt("deleteSegment"),value:function(){var t=this;this.renderSegment((function(){t.pathGenerator.removeSelectedSegment()}))}},{key:rt("moveSegment"),value:function(t,e){var n=this;this.renderSegment((function(){n.pathGenerator.moveSelectedSegment(t,e)}))}},{key:rt("initPathEditorView"),value:function(){this.pathParser.reset(""),this.setState(this.initState(),!1),this.state.isShow=!0,this.refs.$view.empty(),this.$el.focus()}},{key:"end",value:function(t,e){this.state.isOnCanvas?0===t&&0===e?(this.changeMode("modify"),this.trigger("hidePathEditor")):(this.changeMode("segment-move"),this.pathGenerator.selectInBox(this.getSelectBox()),this.renderPath(),this.hideSelectBox()):this.isMode("modify")||(this.isMode("segment-move")?this.changeMode("modify"):this.isMode("path")&&(this.state.isFirstSegment?(this.changeMode("modify"),this.pathGenerator.setConnectedPoint(t,e),this.renderPath(),this.state.current?this.refreshPathLayer():(this.addPathLayer(),this.trigger("initPathEditorView"))):this.state.isSplitPath||(this.pathGenerator.moveEnd(t,e),this.state.clickCount++,this.renderPath()),this.state.isSplitPath=!1))}}]),n}(function(t){R()(n,t);var e=ab(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:rt("changePathTransform"),value:function(t){this.resetTransformZone();var e=this.state.transformZoneRect,n=e.width,r=e.height;switch(this.pathGenerator.initTransform(this.state.transformZoneRect),t){case"flipX":this.pathGenerator.transform("flipX",n,0);break;case"flipY":this.pathGenerator.transform("flipY",0,r);break;case"flip":this.pathGenerator.transform("flip",n,r)}this.renderPath(),this.refreshPathLayer()}},{key:rt("changePathUtil"),value:function(t){switch(t){case"reverse":var e=this.pathGenerator.toPath().d,n=new Hc(e);n.reverse(),n.transformMat4(this.state.cachedMatrixInverse),this.refresh({d:n.d})}}}]),n}(function(t){R()(n,t);var e=ab(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"calculatePointOnLine",value:function(t,e){var n=new Hc(t);if("C"===n.segments[1].command){var r=[ob(n.segments[0].values),ob(n.segments[1].values.slice(0,2)),ob(n.segments[1].values.slice(2,4)),ob(n.segments[1].values.slice(4,6))],i=qo.apply(void 0,ce()(r).concat([200]))(e.x,e.y);return ac(r,i).first[3]}if("Q"===n.segments[1].command){r=[ob(n.segments[0].values),ob(n.segments[1].values.slice(0,2)),ob(n.segments[1].values.slice(2,4))],i=Jo.apply(void 0,ce()(r).concat([200]))(e.x,e.y);return oc(r,i).first[2]}if("L"===n.segments[1].command){r=[ob(n.segments[0].values),ob(n.segments[1].values.slice(0,2))],i=Qo.apply(void 0,ce()(r).concat([200]))(e.x,e.y);return cc(r,i).first[1]}return e}},{key:wt("$view .split-path")+Ag()+zg(),value:function(t){this.initRect();var e=new Hc(t.$dt.attr("d")),n={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},r=-1;if("path"===this.state.mode)return this.state.dragXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.startPoint=this.state.dragXY,this.pathGenerator.setLastPoint(this.state.startPoint),this.state.isSplitPath=!0,this.renderPath(),void(this.state.current?this.refreshPathLayer():(this.addPathLayer(),this.trigger("initPathEditorView")));if("C"===e.segments[1].command){var i=[ob(e.segments[0].values),ob(e.segments[1].values.slice(0,2)),ob(e.segments[1].values.slice(2,4)),ob(e.segments[1].values.slice(4,6))],a=qo.apply(void 0,ce()(i).concat([200]))(n.x,n.y);r=this.pathGenerator.setPoint(ac(i,a))}else if("Q"===e.segments[1].command){i=[ob(e.segments[0].values),ob(e.segments[1].values.slice(0,2)),ob(e.segments[1].values.slice(2,4))],a=Jo.apply(void 0,ce()(i).concat([200]))(n.x,n.y);r=this.pathGenerator.setPointQuard(oc(i,a))}else if("L"===e.segments[1].command){i=[ob(e.segments[0].values),ob(e.segments[1].values.slice(0,2))],a=Qo.apply(void 0,ce()(i).concat([200]))(n.x,n.y);r=this.pathGenerator.setPointLine(cc(i,a))}this.renderPath(),this.refreshPathLayer(),this.changeMode("segment-move"),this.pathGenerator.setCachePoint(r,"startPoint",this.$viewport.applyVerties(this.$snapManager.getSnapPoints())),this.pathGenerator.selectKeyIndex("startPoint",r)}}]),n}(function(t){R()(n,t);var e=ab(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"convertToCurve",value:function(t){this.pathGenerator.convertToCurve(t),this.renderPath(),this.refreshPathLayer()}},{key:ut("$view [data-segment]"),value:function(t){var e=+t.$dt.attr("data-index");this.convertToCurve(e)}},{key:Mt("$view [data-segment]")+et+q(300),value:function(t){var e=+t.$dt.attr("data-index");this.convertToCurve(e)}}]),n}(_g))));n(41);function ub(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var lb=function(t){R()(n,t);var e=ub(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n
\n
\n
\n "}},{key:ot("bodyEvent"),value:function(){var t,e=null===(t=this.$selection.filteredLayers.filter((function(t){return!1===t.is("artboard")}))[0])||void 0===t?void 0:t.id;e&&!1!==this.$config.get("hoverView")?this.$selection.setHoverId(e)&&this.renderHoverLayer():(this.$selection.setHoverId(""),this.renderHoverLayer())}},{key:rt("updateViewport"),value:function(){this.$selection.setHoverId(""),this.renderHoverLayer()}},{key:"renderHoverLayer",value:function(){var t=this.$selection.hoverItems;if(0===t.length)this.refs.$hoverRect.updateDiff(""),this.emit("removeGuideLine");else{var e=t[0].verties,n=this.createPointerLine(this.$viewport.applyVerties(e));this.refs.$hoverRect.updateDiff(n),this.emit("refreshGuideLineByTarget",[t[0].verties])}}},{key:"createPointerLine",value:function(t){return 0===t.length?"":'\n \n \n ')}}]),n}(_g);n(42);function fb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var hb=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"base-line";return'")},pb=function(t,e){var n="".concat(Math.floor(t)),r=13,i=16,a=n.length*r,o=i;return'\n \n \n ').concat(n,"\n ")},db=function(t,e){return hb(t,e)},vb=function(t,e){return hb(t,e)},yb=function(t){return'\n \n')},gb=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left";return"left"===n?'\n \n '):"right"===n?'\n \n '):"up"===n?'\n \n '):"down"===n?'\n \n '):'\n \n ')},mb=function(t){R()(n,t);var e=fb(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return'\n \n '}},{key:"initState",value:function(){return{list:[]}}},{key:It("$guide"),value:function(){return{svgDiff:"".concat(this.createGuideLine(this.state.list),"")}}},{key:"createGuideLine",value:function(t){for(var e=[],n=[],r=0,a=(t=t.filter(Boolean)).length;r0&&e.push(hb(v,y,"dash-line")),g&&e.push(hb(y,g,"dash-line")),d>0&&n.push(pb(d,i.lerp([],v,y,.5)))),"y"===u&&(d>0&&e.push(hb(v,y,"dash-line")),g&&e.push(hb(y,g,"dash-line")),d>0&&n.push(pb(d,i.add([],i.lerp([],v,y,.5),[20,0,0])))),"x"===u&&e.push(db(y,v)),"y"===u&&e.push(vb(y,v)),this.state.hasVerties&&(e.push(gb(v,3,"vertex")),e.push(gb(y,3,"vertex"))),h&&(this.$selection.isOne&&this.$editor.isPointerDown||this.$selection.isMany&&!this.$editor.isPointerMove)&&e.push(yb(this.$viewport.applyVerties(h))),p&&e.push(yb(this.$viewport.applyVerties(p)))}return[].concat(e,n).join("")}},{key:"removeGuideLine",value:function(){this.setState({list:[]})}},{key:"setGuideLine",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setState({list:t,hasVerties:e})}},{key:rt("removeGuideLine","refreshSelection"),value:function(){this.removeGuideLine()}},{key:rt("refreshGuideLineByTarget"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.refreshSmartGuides(t)}},{key:rt("updateViewport"),value:function(){this.refresh()}},{key:"refreshSmartGuides",value:function(t){if(!this.$selection.isEmpty){var e,n=Bo(this.$selection.verties);if(t)e=t.map((function(t){return Bo(t)}));else{var r=this.$selection.snapTargetLayers.map((function(t){var e=Bo(t.verties);return{targetVerties:e,dist:i.dist(e[4],n[4])}}));r.sort((function(t,e){return t.dist-e.dist})),e=r.map((function(t){return t.targetVerties}))}var a=e.map((function(t){return qi(n,t)}));a.sort((function(t,e){return t[3]-e[3]}));var o=[a[0],a[1]].filter(Boolean);this.setGuideLine(o)}}},{key:"refreshSmartGuidesForVerties",value:function(){var t=this.$snapManager.findGuide(this.$selection.verties);this.setGuideLine(t,!0)}},{key:rt("refreshSelectionStyleView"),value:function(){!this.$selection.hasChangedField("d","clip-path")&&this.$selection.hasChangedField("x","y","width","height","transform","transform-origin")&&this.refreshSmartGuidesForVerties()}}]),n}(_g);n(43);function bb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var kb=function(t){R()(n,t);var e=bb(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"
"}},{key:wt("$el [data-artboard-title-id]")+U+Ag("calculateMovedElement")+zg("calculateEndedElement"),value:function(t){this.startXY=t.xy,this.initMousePoint=this.$viewport.getWorldPosition(t);var e=t.$dt.attr("data-artboard-title-id");this.$selection.selectById(e),t.altKey&&(this.$selection.selectAfterCopy(),this.emit("refreshAllCanvas"),this.emit("refreshLayerTreeView")),this.initializeDragSelection(),this.emit("history.refreshSelection")}},{key:"initializeDragSelection",value:function(){this.$selection.reselect(),this.$snapManager.clear(),this.emit("refreshSelectionTool")}},{key:"calculateMovedElement",value:function(){var t=this,e=this.$viewport.getWorldPosition(),n=i.floor([],i.subtract([],e,this.initMousePoint));this.emit("selectionToolView.moveTo",n),this.nextTick((function(){t.emit("refreshSelectionStyleView"),t.emit("refreshSelectionTool",!1),t.refresh()}))}},{key:rt("refreshItemName"),value:function(t,e){var n;this.emit("setAttributeForMulti",w()({},t,{name:e})),null===(n=this.$el.$("[data-artboard-title-id='".concat(t,"']")))||void 0===n||n.text(e)}},{key:"calculateEndedElement",value:function(t,e){this.command("setAttributeForMulti","move item",this.$selection.pack("x","y")),this.emit("refreshSelectionTool",!0)}},{key:rt("updateViewport"),value:function(){this.refresh()}},{key:rt("refreshSelectionStyleView"),value:function(){this.$selection.current&&this.$selection.current.is("artboard")&&this.$selection.hasChangedField("x","y","width","height","transform","transform-origin")&&this.refresh()}},{key:Tt("$el")+W,value:function(){var t=this;return this.$selection.currentProject.artboards.map((function(e){return{title:e.name,id:e.id,rect:[t.$viewport.applyVertex(e.verties[0]),t.$viewport.applyVertex(e.verties[1])]}})).map((function(e){return t.makeArtboardTitleArea(e)}))}},{key:"makeArtboardTitleArea",value:function(t){return'\n
').concat(t.title,"
")}}]),n}(_g);function xb(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wb(t){for(var e=1;e"}},{key:Tt("$el"),value:function(){var t=this;if(1!==this.$selection.length)return"";var e=this.$selection.current;if(e.isInGrid()){var n=e.parent,r=n.screenX,i=n.screenY,a=n.width,o=n.height,c=this.$editor.html.toGridLayoutCSS(n);return"
\n ").concat(n.layers.map((function(e){var n=t.$editor.html.toLayoutItemCSS(e);return"
")})).join(""),"\n
")}return"
"}},{key:rt("refreshGridLayoutLine","refreshSelectionTool","refreshSelection"),value:function(){this.refresh()}},{key:rt("updateViewport"),value:function(){this.refresh()}}]),n}(_g);n(20);function Sb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var jb=function(t){R()(n,t);var e=Sb(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"initState",value:function(){return{mode:"selection",x:Sa.z(),y:Sa.z(),width:Sa.px(1e4),height:Sa.px(1e4),cachedCurrentElement:{},html:""}}},{key:"template",value:function(){return'\n
\n '}},{key:"checkSelectionArea",value:function(t){var e=this.$viewport.getWorldPosition(t);if(this.$selection.hasPoint(e))return!0}},{key:"checkEditMode",value:function(t){if(this.$config.get("set.tool.hand"))return!1;var e=this.$shortcuts.getGeneratedKeyCode(hd.space);if(this.$keyboardManager.check(e))return!1;var n=this.$viewport.getWorldPosition(t);return this.inSelection=!1,this.$selection.hasPoint(n)?(this.inSelection=!0,this.$selection.current.is("artboard")&&this.$selection.current.hasChildren()?(this.$config.set("set.dragarea.mode",!0),this.$config.set("set.move.mode",!1),!0):(this.$config.set("set.dragarea.mode",!1),this.$config.set("set.move.mode",!0),!0)):(this.mouseOverItem=this.$selection.filteredLayers[0],this.mouseOverItem?(this.$config.set("set.dragarea.mode",!1),this.$config.set("set.move.mode",!0)):(this.$config.set("set.dragarea.mode",!0),this.$config.set("set.move.mode",!1)),!0)}},{key:wt("$dragAreaView")+N("checkEditMode")+Ag("movePointer")+zg("moveEndPointer"),value:function(t){if(this.$config.get("set.dragarea.mode"))this.emit("startDragAreaView");else if(this.$config.get("set.move.mode"))if(this.initMousePoint=this.$viewport.getWorldPosition(),this.mouseOverItem=this.$selection.filteredLayers[0],t.altKey)!1===this.$selection.isEmpty&&this.$selection.hasPoint(this.initMousePoint)&&(this.$selection.selectAfterCopy(),this.trigger("refreshAllCanvas"),this.emit("refreshLayerTreeView"),this.initializeDragSelection(),this.emit("history.refreshSelection"));else{if(this.mouseOverItem){var e=this.mouseOverItem.id;if(t.shiftKey)this.$selection.toggleById(e);else if(!1===this.$selection.check({id:e})){var n=this.$selection.currentProject.searchById(e);n&&n.is("artboard")&&n.hasChildren()||this.$selection.selectById(e)}}this.initializeDragSelection(),this.emit("history.refreshSelection")}}},{key:"initializeDragSelection",value:function(){this.$selection.reselect(),this.$snapManager.clear(),this.emit("refreshSelectionTool",!0)}},{key:"movePointer",value:function(t,e){if(this.$config.get("set.dragarea.mode"))this.emit("moveDragAreaView");else if(this.$config.get("set.move.mode")){if(this.$selection.isLayoutItem)return;var n=this.$viewport.getWorldPosition(),r=i.floor([],i.subtract([],n,this.initMousePoint));this.moveTo(r),this.$selection.changeArtBoard()&&(this.initMousePoint=n,this.$selection.reselect(),this.$snapManager.clear(),this.emit("refreshAllCanvas"),this.emit("refreshLayerTreeView")),this.emit("setAttributeForMulti",this.$selection.pack("x","y")),this.emit("refreshSelectionTool",!0)}}},{key:"moveTo",value:function(t){t=i.floor([],t);var e=this.$snapManager.check(this.$selection.cachedRectVerties.map((function(e){return i.add([],e,t)})),3),n=i.add([],e,t),r={};this.$selection.cachedItemVerties.forEach((function(t){var e=t.verties.map((function(t){return i.add([],t,n)})),a=i.subtract([],i.transformMat4([],e[0],t.parentMatrixInverse),i.transformMat4([],t.verties[0],t.parentMatrixInverse));r[t.id]={x:Sa.px(t.x+a[0]).round(1e3),y:Sa.px(t.y+a[1]).round(1e3)}})),this.$selection.reset(r)}},{key:rt("selectionToolView.moveTo"),value:function(t){this.moveTo(t),this.emit("refreshSelectionTool",!0)}},{key:"moveEndPointer",value:function(){if(this.$config.get("set.dragarea.mode"))this.emit("endDragAreaView");else if(this.$config.get("set.move.mode")){var t=this.$viewport.getWorldPosition();if(i.floor([],i.subtract([],t,this.initMousePoint))<1){if(this.$selection.current.isSVG())return this.emit("open.editor"),void this.emit("removeGuideLine")}else this.$selection.reselect(),this.$snapManager.clear(),this.command("setAttributeForMulti","move item",this.$selection.pack("x","y"));this.emit("refreshSelectionTool",!0)}this.$config.set("set.dragarea.mode",!1),this.$config.set("set.move.mode",!1)}}]),n}(_g);function $b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Rb=function(t){R()(n,t);var e=$b(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"initState",value:function(){return{mode:"selection",x:Sa.z(),y:Sa.z(),width:Sa.px(1e4),height:Sa.px(1e4),cachedCurrentElement:{},html:""}}},{key:"template",value:function(){return'\n
\n
\n
\n '}},{key:rt("drawAreaView"),value:function(t){this.refs.$dragAreaRect.css(t)}},{key:rt("initDrawAreaView"),value:function(){this.refs.$dragAreaRect.css({left:Sa.px(-1e4),top:Sa.z(),width:Sa.z(),height:Sa.z()})}},{key:rt("startDragAreaView"),value:function(){this.initMousePoint=this.$viewport.getWorldPosition(),this.$config.set("hoverView",!1),this.dragRect={left:Sa.px(this.initMousePoint[0]),top:Sa.px(this.initMousePoint[1]),width:Sa.z(),height:Sa.z()},this.trigger("drawAreaView",this.dragRect)}},{key:"getSelectedItems",value:function(t,e){var n=this.$selection.currentProject,r=[],i=[];return n&&(0===t.width&&0===t.height?r=[]:(n.layers.forEach((function(t){t.is("artboard")&&t.isIncludeByArea(e)?i.push(t):t.is("artboard")&&t.checkInArea(e)&&!1===t.hasChildren()?r.push(t):r.push.apply(r,t.checkInAreaForAll(e))})),r.length>1&&(r=r.filter((function(t){return!1===t.is("artboard")}))))),i.length?i:r}},{key:rt("moveDragAreaView"),value:function(){var t=this.$config.get("bodyEvent"),e=this.$viewport.getWorldPosition(),n=i.floor([],i.subtract([],e,this.initMousePoint));t.shiftKey&&(n[1]=n[0]);var r=i.floor([],this.initMousePoint),a=i.floor([],i.add([],this.initMousePoint,n)),o=Bo([this.$viewport.applyVertex(r),this.$viewport.applyVertex(a)]);if(this.dragRect={left:Sa.px(o[0][0]),top:Sa.px(o[0][1]),width:Sa.px(Math.abs(o[1][0]-o[0][0])),height:Sa.px(Math.abs(o[3][1]-o[0][1]))},this.trigger("drawAreaView",this.dragRect),this.$editor.isSelectionMode()){var c=this.dragRect,s=c.left,u=c.top,l=c.width,f=c.height,h={x:s.value,y:u.value,width:l.value,height:f.value};if(this.$selection.currentProject){var p,d=this.getSelectedItems(h,Lo([r,a]));(p=this.$selection).select.apply(p,ce()(d))&&(this.emit("refreshSelection"),this.emit("refreshSelectionTool",!0))}}}},{key:rt("endDragAreaView"),value:function(){var t=this.$viewport.getWorldPosition(),e=i.floor([],i.subtract([],t,this.initMousePoint));this.$config.set("hoverView",!0),0===e[0]&&0===e[1]&&this.$selection.empty(),this.trigger("initDrawAreaView"),this.$selection.reselect(),this.emit("history.refreshSelection"),this.emit("refreshSelectionTool",!0),this.emit("removeGuideLine")}}]),n}(_g);n(21);function Cb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Mb={1:"to top left",2:"to top right",3:"to bottom right",4:"to bottom left",11:"to top",12:"to right",13:"to bottom",14:"to left"},Tb=function(t){R()(n,t);var e=Cb(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n \n "}},{key:rt("keymap.keydown"),value:function(t){t.shiftKey&&this.$el.attr("data-has-shift","true")}},{key:rt("keymap.keyup"),value:function(t){this.$el.attr("data-has-shift","")}},{key:"toggleEditingPath",value:function(t){this.$el.toggleClass("editing-path",t)}},{key:"checkEditMode",value:function(){return this.$editor.isSelectionMode()}},{key:wt("$pointerRect .rotate-pointer")+Ag("rotateVertex")+zg("rotateEndVertex"),value:function(t){this.state.moveType="rotate",this.initMousePoint=this.$viewport.getWorldPosition(t),this.$selection.reselect(),this.verties=ee(this.$selection.verties),this.$snapManager.clear(),this.rotateTargetNumber=+t.$dt.attr("data-number"),this.refreshRotatePointerIcon(),this.state.dragging=!0,this.state.isRotate=!0}},{key:"rotateVertex",value:function(){var t=this,e=this.$viewport.getWorldPosition(),n=i.subtract([],e,this.initMousePoint),r=4===this.rotateTargetNumber?Eo(this.verties,34):this.verties[this.rotateTargetNumber],a=Math.floor(aa(r,this.verties[4],n));this.$selection.cachedItemVerties.forEach((function(e){var n=t.$selection.get(e.id);if(n){var r=Bc.addTransform(e.transform,"rotateZ(".concat(Sa.deg(a).round(1e3),")"));if(t.$config.get("bodyEvent").shiftKey){var i=Bc.get(r,"rotateZ");if(i[0]){var o=i[0].value-i[0].value%t.$config.get("fixed.angle");r=Bc.rotateZ(r,Sa.deg(o))}}n.reset({transform:r})}})),this.state.dragging=!0,this.command("setAttributeForMulti","change rotate",this.$selection.pack("transform"))}},{key:"rotateEndVertex",value:function(){var t=this;this.state.dragging=!1,this.state.isRotate=!1,this.emit("recoverCursor"),this.verties=null,this.nextTick((function(){t.command("setAttributeForMulti","change rotate",t.$selection.pack("transform"))}))}},{key:"refreshRotatePointerIcon",value:function(t){this.emit("refreshCursor","rotate")}},{key:"refreshPointerIcon",value:function(t){var e=t.$dt.data("pointer");if(e){var n=e.split(",").map((function(t){return Number(t)})),r=i.subtract([],n,this.state.renderPointerList[0][4]),a=la(r[0],r[1]),o=Math.floor(a)-130;this.emit("refreshCursor","open_in_full","rotate(".concat(o," 12 12)"))}else this.emit("recoverCursor")}},{key:"checkPointerIsNotMoved",value:function(t){return!1===Boolean(this.state.dragging)}},{key:Pt("$pointerRect .rotate-pointer")+N("checkPointerIsNotMoved"),value:function(t){this.refreshRotatePointerIcon(t)}},{key:Pt("$pointerRect .pointer")+N("checkPointerIsNotMoved"),value:function(t){this.refreshPointerIcon(t)}},{key:Ot("$pointerRect .pointer,.rotate-pointer")+N("checkPointerIsNotMoved"),value:function(t){this.emit("recoverCursor")}},{key:wt("$pointerRect .pointer")+Ag("moveVertex")+zg("moveEndVertex"),value:function(t){this.refreshPointerIcon(t),this.state.dragging=!0;var e=+t.$dt.attr("data-number"),n=Mb["".concat(e)];this.initMousePoint=this.$viewport.getWorldPosition(t),this.state.moveType=n,this.state.moveTarget=e,this.$selection.reselect(),this.$snapManager.clear(),this.verties=this.$selection.verties}},{key:"calculateNewOffsetMatrixInverse",value:function(t,e,n,a,o){var c=i.subtract([],$o.scale(a,e,n),t);return sa(r.fromTranslation([],t),r.fromTranslation([],c),o,r.fromTranslation([],i.negate([],c)))}},{key:"calculateDistance",value:function(t,e,n){var r=i.clone(t),a=this.$snapManager.check([i.add([],r,e)]),o=i.add([],r,i.add([],e,a)),c=i.transformMat4([],r,n),s=i.transformMat4([],o,n);return i.floor([],i.add([],s,i.negate([],c)))}},{key:"calculateRealDist",value:function(t,e,n){return this.calculateDistance(t.verties[e],n,t.accumulatedMatrixInverse)}},{key:"moveItem",value:function(t,e,n,r){t&&t.reset({x:Sa.px(e[0]+(n<0?n:0)),y:Sa.px(e[1]+(r<0?r:0)),width:Sa.px(Math.abs(n)),height:Sa.px(Math.abs(r))})}},{key:"moveDirectionVertex",value:function(t,e,n,i,a){var o=ca(t.directionMatrix[i],this.calculateNewOffsetMatrixInverse(a,e,n,t.originalTransformOrigin,t.itemMatrix)),c=r.getTranslation([],o);this.moveItem(this.$selection.get(t.id),c,e,n)}},{key:"moveBottomRightVertex",value:function(t){var e=this;this.verties&&this.$selection.cachedItemVerties.forEach((function(n){var r=e.calculateRealDist(n,2,t),i=zt()(r,2),a=i[0],o=i[1];e.$config.get("bodyEvent").shiftKey&&(o=a*n.height/n.width);var c=n.width+a,s=n.height+o;e.moveDirectionVertex(n,c,s,"to top left",[0,0,0])}))}},{key:"moveTopRightVertex",value:function(t){var e=this.$selection.cachedItemVerties[0];if(e){var n=this.calculateRealDist(e,1,t),r=zt()(n,2),i=r[0],a=r[1];this.$config.get("bodyEvent").shiftKey&&(a=-i*e.height/e.width);var o=e.width+i,c=e.height-a;this.moveDirectionVertex(e,o,c,"to bottom left",[0,c,0])}}},{key:"moveTopLeftVertex",value:function(t){var e=this.$selection.cachedItemVerties[0];if(e){var n=this.calculateRealDist(e,0,t),r=zt()(n,2),i=r[0],a=r[1];this.$config.get("bodyEvent").shiftKey&&(a=i*e.height/e.width);var o=e.width-i,c=e.height-a;this.moveDirectionVertex(e,o,c,"to bottom right",[o,c,0])}}},{key:"moveTopVertex",value:function(t){var e=this.$selection.cachedItemVerties[0];if(e){var n=this.calculateRealDist(e,0,t),r=zt()(n,2),i=(r[0],r[1]),a=e.width,o=e.height-i;this.moveDirectionVertex(e,a,o,"to bottom",[a/2,o,0])}}},{key:"moveBottomVertex",value:function(t){var e=this.$selection.cachedItemVerties[0];if(e){var n=this.calculateRealDist(e,3,t),r=zt()(n,2),i=(r[0],r[1]),a=e.width,o=e.height+i;this.moveDirectionVertex(e,a,o,"to top",[a/2,0,0])}}},{key:"moveRightVertex",value:function(t){var e=this.$selection.cachedItemVerties[0];if(e){var n=this.calculateRealDist(e,1,t),r=zt()(n,2),i=r[0],a=(r[1],e.width+i),o=e.height;this.moveDirectionVertex(e,a,o,"to left",[0,o/2,0])}}},{key:"moveLeftVertex",value:function(t){var e=this.$selection.cachedItemVerties[0];if(e){var n=this.calculateRealDist(e,0,t),r=zt()(n,2),i=r[0],a=(r[1],e.width-i),o=e.height;this.moveDirectionVertex(e,a,o,"to right",[a,o/2,0])}}},{key:"moveBottomLeftVertex",value:function(t){var e=this.$selection.cachedItemVerties[0];if(e){var n=this.calculateRealDist(e,3,t),r=zt()(n,2),i=r[0],a=r[1];this.$config.get("bodyEvent").shiftKey&&(a=-i*e.height/e.width);var o=e.width-i,c=e.height+a;this.moveDirectionVertex(e,o,c,"to top right",[o,0,0])}}},{key:"moveVertex",value:function(){var t=this.$viewport.getWorldPosition(),e=i.subtract([],t,this.initMousePoint);"to top left"===this.state.moveType?this.moveTopLeftVertex(e):"to top"===this.state.moveType?this.moveTopVertex(e):"to right"===this.state.moveType?this.moveRightVertex(e):"to bottom"===this.state.moveType?this.moveBottomVertex(e):"to left"===this.state.moveType?this.moveLeftVertex(e):"to top right"===this.state.moveType?this.moveTopRightVertex(e):"to bottom right"===this.state.moveType?this.moveBottomRightVertex(e):"to bottom left"===this.state.moveType&&this.moveBottomLeftVertex(e),this.emit("setAttributeForMulti",this.$selection.pack("x","y","width","height")),this.state.dragging=!0}},{key:"moveEndVertex",value:function(){var t=this;this.state.dragging=!1,this.emit("recoverCursor"),this.$selection.reselect(),this.nextTick((function(){t.command("setAttributeForMulti","move selection pointer",t.$selection.pack("x","y","width","height"))}))}},{key:"moveTo",value:function(t){t=i.floor([],t);var e=this.$snapManager.check(this.$selection.cachedRectVerties.map((function(e){return i.add([],e,t)}))),n=i.add([],t,e),r={};this.$selection.cachedItemVerties.forEach((function(t){r[t.id]={x:Sa.px(t.x+n[0]),y:Sa.px(t.y+n[1])}})),this.$selection.reset(r)}},{key:"getSelectedElements",value:function(){var t=this;return this.$selection.ids.map((function(e){return t.parent.state.cachedCurrentElement[e]}))}},{key:"initSelectionTool",value:function(){this.$editor.isSelectionMode()&&this.$el.isHide()&&this.$selection.isOne?this.$el.show():this.$el.isShow()&&!1===this.$selection.isOne&&this.$el.hide(),this.makeSelectionTool()}},{key:"makeSelectionTool",value:function(){this.renderPointers()}},{key:"renderPointers",value:function(){if(!this.$selection.isEmpty){var t=this.$selection.verties,e=this.$selection.selectionVerties,n=r.getTranslation([],this.$selection.cachedItemVerties[0].parentMatrix);this.state.renderPointerList=[this.$viewport.applyVerties(t),this.$viewport.applyVerties(e),this.$viewport.applyVerties([n])];var i=this.createRenderPointers.apply(this,ce()(this.state.renderPointerList));if(i){var a=i.line,o=i.point,c=i.size;this.refs.$pointerRect.updateDiff(a+o+c)}}}},{key:"createPointer",value:function(t,e,n){return"\n
\n ')}},{key:"createRotatePointer",value:function(t,e,n){return 0===t.length?"":e<4?"\n
\n '):"\n
\n ')}},{key:"createPointerRect",value:function(t,e,n){if(0===t.length)return"";var r=this.$selection.current,a="";if(!(r&&r.is("artboard"))){var o=i.lerp([],t[0],t[1],.5);a+="\n M ".concat(o[0],",").concat(o[1]," \n L ").concat(e[0],",").concat(e[1]," \n ")}return'\n \n \n ')}},{key:"createSize",value:function(t){var e=i.lerp([],t[0],t[1],.5),n=i.lerp([],t[1],t[2],.5),r=i.lerp([],t[2],t[3],.5),a=i.lerp([],t[3],t[0],.5),o=[{start:e,end:r},{start:n,end:a},{start:r,end:e},{start:a,end:n}].map((function(t,e){return{index:e,data:t}}));o.sort((function(t,e){return t.data.start[1]>e.data.start[1]?-1:1}));var c=o[0],s=i.lerp([],c.data.end,c.data.start,1+16/i.dist(c.data.start,c.data.end)),u=this.$selection.current.width.value,l=this.$selection.current.height.value,f=i.subtract([],c.data.start,c.data.end),h=la(f[0],f[1])+90,p="".concat(zi(u,100)," x ").concat(zi(l,100));if(this.state.isRotate){var d=Bc.get(this.$selection.current.transform,"rotateZ");d&&(p="".concat(zi(d[0].value,1e3),"°"))}return'\n
\n ').concat(p,"\n
\n ")}},{key:"createRenderPointers",value:function(t,e,n){var r=this.$selection.current,a=this.$editor.isPointerMove;if(!r||!r.is("text")||0!==r.width.value||0!==r.height.value){var o=r&&r.is("artboard"),c=i.subtract([],i.lerp([],t[0],t[1],.5),i.lerp([],t[0],t[2],.5)),s=Sa.deg(la(c[0],c[1])+90).round(1e3),u=Eo(t,34),l=i.dist(t[0],t[2]);return{line:this.createPointerRect(t,u,n[0]),size:this.createSize(t),point:[o?void 0:this.createRotatePointer(e[0],0),o?void 0:this.createRotatePointer(e[1],1),o?void 0:this.createRotatePointer(e[2],2),o?void 0:this.createRotatePointer(e[3],3),o?void 0:this.createRotatePointer(u,4,"center center"),a?void 0:this.createPointer(t[0],1,s),a?void 0:this.createPointer(t[1],2,s),a?void 0:this.createPointer(t[2],3,s),a?void 0:this.createPointer(t[3],4,s),this.createPointer(t[4],5,s),l<20||a?void 0:this.createPointer(i.lerp([],t[0],t[1],.5),11,s),l<20||a?void 0:this.createPointer(i.lerp([],t[1],t[2],.5),12,s),l<20||a?void 0:this.createPointer(i.lerp([],t[2],t[3],.5),13,s),l<20||a?void 0:this.createPointer(i.lerp([],t[3],t[0],.5),14,s)].join("")}}}},{key:"checkShow",value:function(){return!(!this.$selection.isOne||!this.$selection.hasChangedField("x","y","width","height","transform","transform-origin","perspective","perspective-origin"))}},{key:rt("refreshSelectionStyleView")+N("checkShow"),value:function(){this.renderPointers()}},{key:rt("hideSelectionToolView"),value:function(){this.$el.hide()}}]),n}(function(t){R()(n,t);var e=Cb(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:rt("hideSubEditor"),value:function(t){this.toggleEditingPath(!1)}},{key:rt("finishPathEdit"),value:function(){this.toggleEditingPath(!1)}},{key:rt("refreshSelectionTool"),value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.initSelectionTool(t)}},{key:rt("updateViewport"),value:function(){this.$selection.isOne&&this.initSelectionTool()}}]),n}(_g));function Vb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Eb=function(t){R()(n,t);var e=Vb(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"isGroup",get:function(){return Boolean(this.layers.length)}},{key:"isLayoutItem",value:function(){return this.parent.hasLayout()}},{key:"hasLayout",value:function(){return"default"!==this.json.layout}},{key:"isInGrid",value:function(){return!!this.isLayoutItem()&&"grid"===this.parent.layout}},{key:"isInFlex",value:function(){return!!this.isLayoutItem()&&"flex"===this.parent.layout}}]),n}(Yc);function Ib(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Db(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(t).concat(this.json.selector," {\n ").concat(this.toPropertyString(),"\n}")}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.toCSSText(t)}}],[{key:"parse",value:function(t){return new n(t)}}]),n}(Tc);function Ab(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function zb(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,zb({position:"absolute",x:Sa.z(),y:Sa.z(),right:"",bottom:"",rootVariable:"",variable:"",width:Sa.px(300),height:Sa.px(300),color:"black",overflow:"visible",opacity:1,"z-index":Sa.auto,"transform-style":"preserve-3d",layout:"default","flex-layout":"display:flex;","grid-layout":"display:grid;",selectors:[],svg:[]},t))}},{key:"toCloneObject",value:function(){var t=this.json;return zb(zb(zb({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("position","right","bottom","rootVariable","variable","transform","filter","backdrop-filter","background-color","background-image","text-clip","border-radius","border","box-shadow","text-shadow","clip-path","color","font-size","font-stretch","line-height","text-align","text-transform","text-decoration","letter-spacing","word-spacing","text-indent","perspective-origin","transform-origin","transform-style","perspective","mix-blend-mode","overflow","opacity","flex-layout","grid-layout","animation","transition")),{},{selectors:t.selectors.map((function(t){return t.clone()})),svg:t.svg.map((function(t){return t.clone()}))})}},{key:"editable",value:function(t){if("border"==t&&this.hasChildren())return!1;switch(t){case"svg-item":case"box-model":case"transform":case"transform-origin":case"perspective":case"perspective-origin":return!1}return Boolean(Hb[t])}},{key:"addSelector",value:function(t){return this.json.selectors.push(t),t}},{key:"createSelector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSelector(new Bb(zb({checked:!0},t)))}},{key:"removePropertyList",value:function(t,e){t.splice(e,1)}},{key:"removeSelector",value:function(t){this.removePropertyList(this.json.selectors,t)}},{key:"enableHasChildren",value:function(){return!0}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.selectors[+t].reset(e)}},{key:"traverse",value:function(t,e,n){var r=this;t.isAttribute()||(n||!t.isLayoutItem()||t.isRootItem())&&(e.push(t),t.children.forEach((function(t){r.traverse(t,e)})))}},{key:"tree",value:function(t){var e=this,n=[];return this.children.forEach((function(r){e.traverse(r,n,t)})),n}},{key:"toAnimationKeyframes",value:function(t){return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:t}]}},{key:"toBound",value:function(){var t={x:this.json.x?this.json.x.clone():Sa.z(),y:this.json.y?this.json.y.clone():Sa.z(),width:this.json.width.clone(),height:this.json.height.clone()};return t.x2=Sa.px(t.x.value+t.width.value),t.y2=Sa.px(t.y.value+t.height.value),t}},{key:"reset",value:function(t){var e=$a()(V()(n.prototype),"reset",this).call(this,t);return e&&this.hasChangedField("clip-path")&&this.setClipPathCache(),e}},{key:"setClipPathCache",value:function(){var t=of.parseStyle(this.json["clip-path"]);"path"===t.type&&(this.cacheClipPath=new Hc(t.value.trim()))}},{key:"setCache",value:function(){$a()(V()(n.prototype),"setCache",this).call(this),this.setClipPathCache()}},{key:"clipPathString",get:function(){if(this.cacheClipPath||this.setClipPathCache(),this.cacheClipPath)return this.cacheClipPath.clone().scaleTo(this.json.width.value,this.json.height.value)}}]),n}(Eb);function _b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Nb(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $a()(V()(n.prototype),"getDefaultObject",this).call(this,Nb({itemType:"artboard",name:"New ArtBoard",width:Sa.px(1e3),height:Sa.px(1e3),"background-color":"white","transform-style":"flat"},t))}},{key:"toCloneObject",value:function(){return Nb(Nb({},$a()(V()(n.prototype),"toCloneObject",this).call(this)),this.attrs("name"))}},{key:"getDefaultTitle",value:function(){return"ArtBoard"}},{key:"getIcon",value:function(){return Cg.artboard}},{key:"editable",value:function(t){switch(t){case"border":case"border-radius":case"backdrop-filter":case"box-shadow":case"clip-path":return!1;case"artboard-size":case"layout":return!0}return $a()(V()(n.prototype),"editable",this).call(this,t)}}]),n}(Gb);function Kb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Ub={1:"to top left",2:"to top right",3:"to bottom right",4:"to bottom left",11:"to top",12:"to right",13:"to bottom",14:"to left"},Wb=function(t){R()(n,t);var e=Kb(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n \n "}},{key:rt("keymap.keydown"),value:function(t){t.shiftKey&&this.$el.attr("data-has-shift","true")}},{key:rt("keymap.keyup"),value:function(t){this.$el.attr("data-has-shift","")}},{key:"toggleEditingPath",value:function(t){this.refs.$selectionView.toggleClass("editing-path",t)}},{key:"checkEditMode",value:function(){return this.$editor.isSelectionMode()}},{key:wt("$pointerRect .rotate-pointer")+Ag("rotateVertex")+zg("rotateEndVertex"),value:function(t){this.state.moveType="rotate",this.initMousePoint=this.$viewport.getWorldPosition(t),this.verties=this.groupItem.verties,this.rotateTargetNumber=+t.$dt.attr("data-number"),this.refreshRotatePointerIcon(),this.state.dragging=!0,this.state.isRotate=!0}},{key:"rotateVertex",value:function(){var t=this,e=this.$viewport.getWorldPosition(),n=i.subtract([],e,this.initMousePoint),a=4===this.rotateTargetNumber?Eo(this.verties,34):this.verties[this.rotateTargetNumber],o=Math.floor(aa(a,this.verties[4],n));this.$config.get("bodyEvent").shiftKey&&(o-=o%this.$config.get("fixed.angle")),this.localAngle=this.angle+o,this.groupItem.reset({transform:Bc.rotateZ(this.groupItem.transform,Sa.deg(this.localAngle))});var c=oa(o,this.verties[4]);this.$selection.cachedItemVerties.forEach((function(e){var n=Ui(e.verties,r.multiply([],e.parentMatrixInverse,c)),a=Eo(n,34),o=ia(a[0]-n[4][0],a[1]-n[4][1])-270,s=i.transformMat4([],n[0],oa(-o,n[4])),u=t.$selection.get(e.id);u&&u.reset({x:Sa.px(s[0]),y:Sa.px(s[1]),transform:Bc.rotateZ(e.transform,Sa.deg(o))})})),this.state.dragging=!0,this.emit("setAttributeForMulti",this.$selection.pack("x","y","width","height","transform"))}},{key:"rotateEndVertex",value:function(){var t=this;this.state.dragging=!1,this.state.isRotate=!1,this.emit("recoverCursor"),this.$selection.reselect(),this.initMatrix(!0),this.nextTick((function(){t.command("setAttributeForMulti","rotate selection pointer",t.$selection.pack("x","y","width","height","transform"))}))}},{key:"refreshRotatePointerIcon",value:function(t){this.emit("refreshCursor","rotate")}},{key:"refreshPointerIcon",value:function(t){var e=t.$dt.data("pointer");if(e){var n=e.split(",").map((function(t){return Number(t)})),r=i.subtract([],n,this.state.renderPointerList[0][4]),a=la(r[0],r[1]),o=Math.floor(a)-135;this.emit("refreshCursor","open_in_full","rotate(".concat(o," 12 12)"))}else this.emit("recoverCursor")}},{key:"checkPointerIsNotMoved",value:function(t){return!1===Boolean(this.state.dragging)}},{key:Pt("$pointerRect .rotate-pointer")+N("checkPointerIsNotMoved")+et,value:function(t){this.refreshRotatePointerIcon(t)}},{key:Pt("$pointerRect .pointer")+N("checkPointerIsNotMoved")+et,value:function(t){this.refreshPointerIcon(t)}},{key:Ot("$pointerRect .pointer,.rotate-pointer")+N("checkPointerIsNotMoved")+et,value:function(t){this.emit("recoverCursor")}},{key:wt("$pointerRect .pointer")+et+Ag("moveVertex")+zg("moveEndVertex"),value:function(t){this.refreshPointerIcon(t),this.state.dragging=!0;var e=+t.$dt.attr("data-number");this.state.moveType=Ub["".concat(e)],this.initMousePoint=this.$viewport.getWorldPosition(t),this.$selection.reselect(),this.initMatrix(!0),this.cachedGroupItem=this.groupItem.matrix}},{key:"calculateNewOffsetMatrixInverse",value:function(t,e,n,a,o){var c=i.add([],$o.scale(a,e,n),i.negate([],t));return sa(r.fromTranslation([],t),r.fromTranslation([],c),o,r.fromTranslation([],i.negate([],c)))}},{key:"calculateDistance",value:function(t,e,n){var r=i.clone(t),a=this.$snapManager.check([i.add([],r,e)]),o=i.add([],r,i.add([],e,a)),c=i.transformMat4([],r,n),s=i.transformMat4([],o,n);return i.floor([],i.add([],s,i.negate([],c)))}},{key:"calculateRealDist",value:function(t,e,n){return this.calculateDistance(t.verties[e],n,t.accumulatedMatrixInverse)}},{key:"moveGroupItem",value:function(t,e,n){this.groupItem.reset({x:Sa.px(t[0]+(e<0?e:0)).round(1e3),y:Sa.px(t[1]+(n<0?n:0)).round(1e3),width:Sa.px(Math.abs(e)).round(1e3),height:Sa.px(Math.abs(n)).round(1e3)})}},{key:"moveItemForGroup",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=sa(r.fromTranslation([],e[4]),t.itemMatrix,r.fromTranslation([],i.negate([],e[4]))),c=i.transformMat4([],e[0],o),s=zt()(c,2),u=s[0],l=s[1],f=i.distance(e[0],e[1]),h=i.distance(e[0],e[3]),p=this.$selection.get(t.id);p&&p.reset({x:Sa.px(u+n),y:Sa.px(l+a),width:Sa.px(f),height:Sa.px(h)})}},{key:"recoverItemForGroup",value:function(t,e,n){var i=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,c=t.accumulatedMatrix,s=t.accumulatedMatrixInverse;this.$selection.cachedItemVerties.forEach((function(t){var u=ca(t.parentMatrixInverse,c,r.fromTranslation([],[a,o,0]),r.fromScaling([],[e,n,1]),s),l=Ui(t.verties,u);i.moveItemForGroup(t,l)}))}},{key:"moveBottomRightVertex",value:function(t){var e=this.cachedGroupItem,n=this.calculateRealDist(e,2,t),r=zt()(n,2),i=r[0],a=r[1];this.$config.get("bodyEvent").shiftKey&&(a=i*e.height/e.width);var o=e.width+i,c=e.height+a;this.moveDirectionVertex(e,0,0,o,c,"to top left",[0,0,0])}},{key:"moveTopRightVertex",value:function(t){var e=this.cachedGroupItem,n=this.calculateRealDist(e,1,t),r=zt()(n,2),i=r[0],a=r[1];this.$config.get("bodyEvent").shiftKey&&(a=-i*e.height/e.width);var o=e.width+i,c=e.height-a;this.moveDirectionVertex(e,0,a,o,c,"to bottom left",[0,c,0])}},{key:"moveDirectionVertex",value:function(t,e,n,i,a,o,c){var s=i/t.width,u=a/t.height;if(s>=0&&u>=0){var l=ca(t.directionMatrix[o],this.calculateNewOffsetMatrixInverse(c,i,a,t.originalTransformOrigin,t.itemMatrix)),f=r.getTranslation([],l);this.moveGroupItem(f,i,a),this.recoverItemForGroup(t,s,u,e,n)}}},{key:"moveTopVertex",value:function(t){var e=this.cachedGroupItem,n=this.calculateRealDist(e,0,t),r=zt()(n,2),i=(r[0],r[1]),a=e.width,o=e.height-i;this.moveDirectionVertex(e,0,i,a,o,"to bottom",[a/2,o,0])}},{key:"moveBottomVertex",value:function(t){var e=this.cachedGroupItem,n=this.calculateRealDist(e,2,t),r=zt()(n,2),i=(r[0],r[1]),a=e.width,o=e.height+i;this.moveDirectionVertex(e,0,0,a,o,"to top",[a/2,0,0])}},{key:"moveTopLeftVertex",value:function(t){var e=this.cachedGroupItem,n=this.calculateRealDist(e,0,t),r=zt()(n,2),i=r[0],a=r[1];this.$config.get("bodyEvent").shiftKey&&(a=i*e.height/e.width);var o=e.width-i,c=e.height-a;this.moveDirectionVertex(e,i,a,o,c,"to bottom right",[o,c,0])}},{key:"moveLeftVertex",value:function(t){var e=this.cachedGroupItem,n=this.calculateRealDist(e,0,t),r=zt()(n,2),i=r[0],a=(r[1],e.width-i),o=e.height;this.moveDirectionVertex(e,i,0,a,o,"to right",[a,o/2,0])}},{key:"moveRightVertex",value:function(t){var e=this.cachedGroupItem,n=this.calculateRealDist(e,2,t),r=zt()(n,2),i=r[0],a=(r[1],e.width+i),o=e.height;this.moveDirectionVertex(e,0,0,a,o,"to left",[0,o/2,0])}},{key:"moveBottomLeftVertex",value:function(t){var e=this.cachedGroupItem,n=this.calculateRealDist(e,3,t),r=zt()(n,2),i=r[0],a=r[1];this.$config.get("bodyEvent").shiftKey&&(a=-i*e.height/e.width);var o=e.width-i,c=e.height+a;this.moveDirectionVertex(e,i,0,o,c,"to top right",[o,0,0])}},{key:"moveVertex",value:function(){var t=this.$viewport.getWorldPosition(),e=i.subtract([],t,this.initMousePoint);"to bottom right"===this.state.moveType?this.moveBottomRightVertex(e):"to top right"===this.state.moveType?this.moveTopRightVertex(e):"to top left"===this.state.moveType?this.moveTopLeftVertex(e):"to bottom left"===this.state.moveType?this.moveBottomLeftVertex(e):"to top"===this.state.moveType?this.moveTopVertex(e):"to left"===this.state.moveType?this.moveLeftVertex(e):"to right"===this.state.moveType?this.moveRightVertex(e):"to bottom"===this.state.moveType&&this.moveBottomVertex(e),this.emit("setAttributeForMulti",this.$selection.pack("x","y","width","height","transform")),this.state.dragging=!0}},{key:"moveEndVertex",value:function(t,e){var n=this;this.state.dragging=!1,this.emit("recoverCursor"),this.$selection.reselect(),this.state.dragging=!1,this.initMatrix(!0),this.nextTick((function(){n.command("setAttributeForMulti","move selection pointer",n.$selection.pack("x","y","width","height","transform"))}))}},{key:"getSelectedElements",value:function(){var t=this;return this.$selection.ids.map((function(e){return t.parent.state.cachedCurrentElement[e]}))}},{key:"initSelectionTool",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$editor.isSelectionMode()&&this.$el.isHide()&&this.$selection.isMany?this.$el.show():this.$el.isShow()&&!1===this.$selection.isMany&&this.$el.hide(),this.initMatrix(t),this.makeSelectionTool()}},{key:"item",get:function(){var t=this.verties||Vo(0,0,0,0);return this.state.newArtBoard||(this.state.newArtBoard=new Yb),this.state.newArtBoard.reset({parent:this.$selection.currentProject,x:Sa.px(t[0][0]),y:Sa.px(t[0][1]),width:Sa.px(i.dist(t[0],t[1])),height:Sa.px(i.dist(t[0],t[3])),transform:""}),this.state.newArtBoard}},{key:"initMatrix",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&this.$selection.isMany&&(this.verties=ee(this.$selection.verties),this.angle=0,this.localAngle=this.angle,this.groupItem=this.item,this.cachedGroupItem=this.item.matrix)}},{key:"makeSelectionTool",value:function(){this.renderPointers()}},{key:"renderPointers",value:function(){if(this.groupItem){var t=this.state.dragging?this.groupItem.verties:this.$selection.verties,e=this.groupItem.selectionVerties();if(0!==t.length){this.state.renderPointerList=[this.$viewport.applyVerties(t),this.$viewport.applyVerties(e)];var n=this.createRenderPointers.apply(this,ce()(this.state.renderPointerList)),r=n.line,i=n.point,a=n.size;this.refs.$pointerRect.updateDiff(r+i+a)}}}},{key:"createPointer",value:function(t,e,n){return"\n
\n ')}},{key:"createRotatePointer",value:function(t,e){return 0===t.length?"":e<4?"\n
\n '):"\n
\n ')}},{key:"createPointerRect",value:function(t,e){if(0===t.length)return"";var n=i.lerp([],t[0],t[1],.5),r="\n M ".concat(n[0],",").concat(n[1]," \n L ").concat(e[0],", ").concat(e[1]," \n ");return'\n \n \n ')}},{key:"createSize",value:function(t){var e=i.lerp([],t[0],t[1],.5),n=i.lerp([],t[1],t[2],.5),r=i.lerp([],t[2],t[3],.5),a=i.lerp([],t[3],t[0],.5),o=[{start:e,end:r},{start:n,end:a},{start:r,end:e},{start:a,end:n}].map((function(t,e){return{index:e,data:t}}));o.sort((function(t,e){return t.data.start[1]>e.data.start[1]?-1:1}));var c=o[0],s=i.lerp([],c.data.end,c.data.start,1+16/i.dist(c.data.start,c.data.end)),u=this.groupItem.width.value,l=this.groupItem.height.value,f=i.subtract([],c.data.start,c.data.end),h=la(f[0],f[1])+90,p="".concat(zi(u,100)," x ").concat(zi(l,100));if(this.state.isRotate){var d=Bc.get(this.groupItem.transform,"rotateZ");d&&(p="".concat(d[0].value,"°"))}return"\n
\n ').concat(p,"\n
\n ")}},{key:"createRenderPointers",value:function(t,e){var n=this.$editor.isPointerMove,r=i.subtract([],i.lerp([],t[0],t[1],.5),i.lerp([],t[0],t[2],.5)),a=Sa.deg(la(r[0],r[1])-90).round(1e3),o=Eo(t,30),c=i.dist(t[0],t[2]);return{line:this.createPointerRect(t,o),size:this.createSize(t),point:[this.createRotatePointer(e[0],0,"bottom right"),this.createRotatePointer(e[1],1,"bottom left"),this.createRotatePointer(e[2],2,"top left"),this.createRotatePointer(e[3],3,"top right"),this.createRotatePointer(o,4,"center center"),n?void 0:this.createPointer(t[0],1,a),n?void 0:this.createPointer(t[1],2,a),n?void 0:this.createPointer(t[2],3,a),n?void 0:this.createPointer(t[3],4,a),c<20||n?void 0:this.createPointer(i.lerp([],t[0],t[1],.5),11),c<20||n?void 0:this.createPointer(i.lerp([],t[1],t[2],.5),12),c<20||n?void 0:this.createPointer(i.lerp([],t[2],t[3],.5),13),c<20||n?void 0:this.createPointer(i.lerp([],t[3],t[0],.5),14)].join("")}}},{key:"checkShow",value:function(){return!(!this.$selection.isMany||!this.$selection.hasChangedField("x","y","width","height","transform","transform-origin","perspective","perspective-origin"))}},{key:rt("refreshSelectionStyleView")+N("checkShow"),value:function(){this.renderPointers()}},{key:rt("hideSelectionToolView"),value:function(){this.$el.hide()}}]),n}(function(t){R()(n,t);var e=Kb(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:rt("hideSelectionToolView"),value:function(){}},{key:rt("hideSubEditor"),value:function(t){this.toggleEditingPath(!1)}},{key:rt("finishPathEdit"),value:function(){this.toggleEditingPath(!1)}},{key:rt("refreshSelectionTool"),value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.initSelectionTool(t)}},{key:rt("updateViewport"),value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.$selection.isMany&&this.initSelectionTool(t)}}]),n}(_g));n(44);function Zb(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var qb=function(t){R()(r,t);var e,n=Zb(r);function r(){return O()(this,r),n.apply(this,arguments)}return j()(r,[{key:"components",value:function(){return{SelectionToolView:Tb,GroupSelectionToolView:Wb,PageTools:pm,GridLayoutLineView:Ob,DragAreaRectView:Rb,HTMLRenderView:fm,SelectionInfoView:kb,LayerAppendView:ym,PathEditorView:sb,PathDrawView:nb,HoverView:lb,GuideLineView:mb,DragAreaView:jb}}},{key:"initState",value:function(){return{cursor:"auto",cursorArgs:[]}}},{key:"afterRender",value:function(){var t=this;this.nextTick((function(){t.trigger("resizeCanvas"),t.emit("moveSelectionToCenter",!1),t.refreshCursor()}))}},{key:"template",value:function(){return"\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n "}},{key:It("$pageView"),value:function(){return{style:{"--elf--canvas-background-color":this.$config.get("style.canvas.background.color")}}}},{key:"makeViewportConsole",value:function(){if(!this.$viewport.verties)return"";var t=this.$viewport.pos;return"\n
\n
\n
\n
".concat(Math.floor(this.$viewport.minX),"
\n
").concat(Math.floor(this.$viewport.maxX),"
\n
").concat(Math.floor(this.$viewport.minY),"
\n
").concat(Math.floor(this.$viewport.maxY),"
\n
").concat(this.$viewport.transformOrigin.map((function(t){return Math.floor(t)})).join(", "),"
\n
\n mouse: ").concat(this.$viewport.mouse.map((function(t){return Math.floor(t)})).join(", "),"
\n translate: ").concat(this.$viewport.translate.join(", "),"
\n zoom : ").concat(this.$viewport.zoomFactor,"
\n
\n\n
\n ")}},{key:"checkSpace",value:function(t){return!!this.$config.get("set.tool.hand")||this.$keyboardManager.check(this.$shortcuts.getGeneratedKeyCode(hd.space))}},{key:wt("$lock")+N("checkSpace")+Ag("movePan")+zg("moveEndPan"),value:function(t){this.startMovePan()}},{key:ot("set.tool.hand"),value:function(t){t?(this.startMovePan(),this.emit("refreshCursor","grab")):(this.emit("recoverCursor","auto"),this.emit("addStatusBarMessage",""))}},{key:"startMovePan",value:function(){this.lastDist=i.create(),this.emit("addStatusBarMessage",this.$i18n("viewport.panning.enable"))}},{key:"movePan",value:function(t,e){var n;this.emit("refreshCursor","grabbing");var r=i.fromValues(t,e,0);(n=this.$viewport).pan.apply(n,ce()(i.transformMat4([],i.subtract([],this.lastDist,r),this.$viewport.scaleMatrixInverse))),this.lastDist=r}},{key:"refreshCursor",value:function(){!1===this.$config.get("set.tool.hand")?(this.emit("refreshCursor","auto"),this.emit("addStatusBarMessage","")):this.emit("refreshCursor","grab")}},{key:"moveEndPan",value:function(){this.refreshCursor()}},{key:It("$container"),value:(e=La()(Fa.a.mark((function t(){var e,n;return Fa.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(e=this.$editor.cursorManager).load.apply(e,[this.state.cursor].concat(ce()(this.state.cursorArgs||[])));case 2:return n=t.sent,t.abrupt("return",{style:{cursor:n}});case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:dt("$lock")+et,value:function(){}},{key:pt("$lock")+et,value:function(t){var e=this.$viewport.getWorldPosition(t);if(t.dataTransfer.getData("text/asset"))this.emit("drop.asset",{asset:{id:t.dataTransfer.getData("text/asset"),center:e}});else{tm.getAllDropItems(t);var n=Ka.create(t.target).attr("data-id");if(n)this.emit("drop.asset",{gradient:t.dataTransfer.getData("text/gradient"),pattern:t.dataTransfer.getData("text/pattern"),color:t.dataTransfer.getData("text/color"),imageUrl:t.dataTransfer.getData("image/info")},n);else{var r=t.dataTransfer.getData("image/info");this.emit("dropImageUrl",r)}}}},{key:Rt("$lock")+et,value:function(t){var e=this,n=function(t){var e=t.deltaX,n=t.deltaY;if(0===e&&t.shiftKey){var r=[e,n];n=r[0],e=r[1]}return t.deltaMode===WheelEvent.DOM_DELTA_LINE?n*=8:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=24),[Dt(e,24),Dt(n,24),0]}(t),r=zt()(n,2),i=r[0],a=r[1];if(this.state.gesture)if(t.ctrlKey){var o=1-2.5*a/100;this.$viewport.zoom(o)}else{var c=-2.5*i,s=-2.5*a;this.$viewport.pan(-c/this.$viewport.scale,-s/this.$viewport.scale,0)}else t.ctrlKey&&this.$viewport.setMousePoint(t.clientX,t.clientY),this.emit("startGesture"),this.state.gesture=!0;clearTimeout(this.state.timer),this.state.timer=setTimeout((function(){e.state.gesture=void 0,e.emit("endGesture")}),200)}},{key:"refreshCanvasSize",value:function(){this.$viewport.refreshCanvasSize(this.refs.$lock.rect())}},{key:rt("resize.window","resizeCanvas"),value:function(){this.refreshCanvasSize()}},{key:rt("changeIconView"),value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r\n \n \n \n \n "}},{key:It("$el"),value:function(){return{class:"elf--body-panel ".concat(this.$config.get("show.ruler")?"ruler":"")}}},{key:ot("show.ruler"),value:function(){this.refresh()}},{key:rt("bodypanel.toggle.fullscreen"),value:function(){this.refs.$el.toggleFullscreen()}}]),n}(_g);n(46);function tk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var ek=function(t){R()(n,t);var e=tk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n
\n
\n
\n \n \n ').concat(this.getTools(),"\n \n \n
\n
").concat(this.getBody(),"
\n
\n
\n ")}},{key:"getClassName",value:function(){return""}},{key:"getTitle",value:function(){return""}},{key:"getTools",value:function(){return""}},{key:"getBody",value:function(){return""}},{key:st("$close"),value:function(){this.$el.hide()}},{key:"show",value:function(){this.$el.show("block")}},{key:"hide",value:function(){this.$el.hide()}}]),n}(_g);n(47);function nk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var rk=function(t){R()(n,t);var e=nk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getClassName",value:function(){return"elf--export-window"}},{key:"getTitle",value:function(){return"Export"}},{key:"initState",value:function(){return{selectedIndex:1}}},{key:"getBody",value:function(){return'\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n                
\n
\n
\n                
\n
\n
\n                
\n
\n
\n                
\n
\n
\n
\n
\n
\n '}},{key:rt("showExportWindow"),value:function(){this.show(),this.refresh()}},{key:"refresh",value:function(){var t=this,e=this.$selection.currentProject||{layers:[]},n="\n".concat(this.makeStyle(e),"\n").concat(e.layers.map((function(e){return t.makeStyle(e)})).join("\n"),"\n");this.refs.$css.text(n);var r="\n".concat(this.$editor.html.renderSVG(e),"\n").concat(this.$editor.html.render(e),"\n ");this.refs.$html.text(r);var i=e.layers.map((function(e){return t.$editor.svg.render(e)}));this.refs.$svgimage.text(i.join("\n\n")),this.refs.$svgimagePreview.html(Ka.createByHTML("
".concat(i.map((function(t){return"
".concat(t,"
")})).join(""),"
")))}},{key:"makeStyle",value:function(t){return this.$editor.html.toStyle(t)}},{key:"makeHTML",value:function(t){return this.$editor.html.render(t)}},{key:st("$header .tab-item"),value:function(t){var e=+t.$dt.attr("data-value");this.state.selectedIndex!==e&&(this.$el.$$('[data-value="'.concat(this.state.selectedIndex,'"]')).forEach((function(t){return t.removeClass("selected")})),this.$el.$$('[data-value="'.concat(e,'"]')).forEach((function(t){return t.addClass("selected")})),this.setState({selectedIndex:e},!1))}}]),n}(ek);io({ExportWindow:rk});n(48);function ik(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var ak=new Set;fd.forEach((function(t){ak.add(t.category)}));var ok={};ak.forEach((function(t){fd.filter((function(e){return e.category===t})).forEach((function(t){ok[t.category]||(ok[t.category]=[]),ok[t.category].push(t)}))}));var ck={ARROWRIGHT:"→",ARROWLEFT:"←",ARROWUP:"↑",ARROWDOWN:"→",BACKSPACE:"⌫",CMD:"⌘"},sk=ld(),uk=function(t){R()(n,t);var e=ik(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getClassName",value:function(){return"elf--shortcut-window"}},{key:"getTitle",value:function(){return"ShortCuts"}},{key:"getKeyString",value:function(t,e){return(e[t]||e.key).split("+").map((function(t){return t.trim()})).map((function(t){var e=t.toUpperCase();return"".concat(ck[e]||e,"")})).join(" + ")}},{key:"getTemplateForShortcutItem",value:function(t){return"\n
\n
".concat(t.description,"
\n
").concat(this.getKeyString(sk,t),"
\n
\n ")}},{key:"getTemplateForCategory",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return"\n
\n

".concat(t,"

\n
\n ").concat(n.map((function(t){return e.getTemplateForShortcutItem(t)})).join(""),"\n
\n
\n ")}},{key:"getTemplateForLayer",value:function(){return"\n
\n

Layer

\n
\n
\n
\n Add Rect\n fdsafdsfdf\n
\n\n
CTRL+R
\n
R
\n
R
\n
\n
\n
\n "}},{key:"getBody",value:function(){var t=this;return'\n
\n '.concat(Object.keys(ok).map((function(e){return t.getTemplateForCategory(e,ok[e])})).join(""),"\n
\n ")}},{key:rt("showShortcutWindow"),value:function(){this.show()}}]),n}(ek);io({ShortcutWindow:uk});n(49);function lk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var fk=function(t){R()(n,t);var e=lk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getClassName",value:function(){return"elf--project-window"}},{key:"getTitle",value:function(){return"Project Manager"}},{key:"initState",value:function(){return{selectedIndex:1}}},{key:"getBody",value:function(){return'\n
\n
\n Project Menu\n
\n
\n Project List\n
\n
\n '}},{key:rt("open.projects"),value:function(){this.show(),this.refresh()}},{key:"refresh",value:function(){this.$selection.currentProject}}]),n}(ek);io({ProjectWindow:fk});n(50);function hk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var pk=function(t){R()(n,t);var e=hk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return"\n
\n
\n "}},{key:Ct("$el"),value:function(t){Ka.create(t.target).remove()}},{key:st("$el .item > .icon"),value:function(t){t.$dt.parent().remove()}},{key:"getMessageTemplate",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3;return"\n
\n
").concat(e,"
\n
").concat(n,"
\n ").concat(Cg.close,"\n
\n ")}},{key:rt("notify"),value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e3,i=Ka.createByHTML(this.getMessageTemplate(t,e,n,r));this.$el.prepend(i),setTimeout((function(t){t.css("opacity",0)}),100,i)}}]),n}(_g);function dk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var vk=function(t){R()(n,t);var e=dk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"components",value:function(){return{NotificationView:pk}}},{key:"template",value:function(){return"\n
\n \n \n \n \x3c!-- LoginWindow / --\x3e\n \x3c!-- SignWindow / --\x3e\n \x3c!-- ImageFileView / --\x3e\n \n ".concat(this.$menuManager.generate("popup"),"\n \n ")}}]),n}(_g);function yk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var gk=["TEXTAREA","INPUT","SELECT"],mk=function(t){R()(n,t);var e=yk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return'\n
\n '}},{key:"isNotFormElement",value:function(t){var e=t.target.tagName;return!gk.includes(e)&&"true"!==Ka.create(t.target).attr("contenteditable")}},{key:lt("document")+N("isNotFormElement")+et,value:function(t){this.emit("keymap.keydown",t)}},{key:ft("document")+N("isNotFormElement"),value:function(t){this.emit("keymap.keyup",t)}}]),n}(_g);function bk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var kk=function(t){R()(n,t);var e=bk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"initState",value:function(){return{selectedIndexValue:"style"}}},{key:"template",value:function(){var t=this;return'\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n\n ").concat(this.$menuManager.getTargetMenuItems("inspector.tab").map((function(t){var e=t.class,n=e.value,r=e.title;return"\n
\n \n
\n ")})),'\n
\n
\n\n
\n \n\n \x3c!-- Default Property --\x3e \n \n \n\n ').concat(this.$menuManager.generate("inspector.tab.style")," \n
\n \n
\n ").concat(this.$menuManager.generate("inspector.tab.transition"),' \n
\n
\n
\n ').concat(this.$menuManager.generate("inspector.tab.code")," \n
\n
\n \n \n ").concat(this.$menuManager.getTargetMenuItems("inspector.tab").map((function(e){var n=e.class,r=n.value,i=(n.title,n.loadElements);return"\n
\n ").concat(i.map((function(t){return'')})).join("\n"),"\n ").concat(t.$menuManager.generate("inspector.tab.".concat(r)),"\n \n ")}))," \n \n \n \n \n ")}},{key:st("$header .tab-item:not(.empty-item)"),value:function(t){var e=t.$dt.attr("data-value");this.state.selectedIndexValue!==e&&(this.$el.$$('[data-value="'.concat(this.state.selectedIndexValue,'"]')).forEach((function(t){return t.removeClass("selected")})),this.$el.$$('[data-value="'.concat(e,'"]')).forEach((function(t){return t.addClass("selected")})),this.setState({selectedIndexValue:e},!1))}}]),n}(_g);function xk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var wk=function(t){R()(n,t);var e=xk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"locales",get:function(){return Object.keys(this.$editor.i18n.locales)}},{key:"template",value:function(){var t=this,e=this.locales.map((function(e){return{text:t.$i18n("app.lang.".concat(e)),value:e}}));return"\n
\n \n
\n \n \n \n ')}},{key:at("changeLocale"),value:function(t,e){this.emit("setLocale",e)}}]),n}(_g);function Pk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Ok=["dark","light"],Sk=function(t){R()(n,t);var e=Pk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){var t=this,e=Ok.map((function(e){return{value:e,text:t.$i18n("app.theme.".concat(e))}}));return"\n
\n \n
\n \n \n
\n \n \n \n ')}},{key:at("changeEditorLayoutValue"),value:function(t,e){this.emit("setEditorLayout",e)}}]),n}(_g);function Rk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Ck=function(t){R()(n,t);var e=Rk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"initState",value:function(){return{version:"0.10.72"}}},{key:"template",value:function(){return'
v'.concat(this.state.version,"
")}}]),n}(_g);n(51);function Mk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Tk=function(t){R()(n,t);var e=Mk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return'\n \n ")}},{key:st(),value:function(){this.$config.toggle("show.left.panel")}}]),n}(_g);n(52);function Vk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Ek=function(t){R()(n,t);var e=Vk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return'\n \n ")}},{key:st(),value:function(){this.$config.toggle("show.right.panel")}}]),n}(_g);n(53);function Ik(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Dk=function(t){R()(n,t);var e=Ik(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"components",value:function(){return{LanguageSelector:wk,ThemeSwitcher:Sk,LayoutSelector:$k,VersionView:Ck,SwitchLeftPanel:Tk,SwitchRightPanel:Ek}}},{key:"template",value:function(){return"\n
\n
\n \n ".concat(this.$menuManager.generate("statusbar.left")," \n \n
\n
\n ").concat(this.$menuManager.generate("statusbar.right"),'\n \n \n \n \n \n \n \n ')}},{key:"initState",value:function(){return{msg:""}}},{key:It("$msg"),value:function(){return{text:this.state.msg}}},{key:rt("addStatusBarMessage"),value:function(t){this.setState({msg:t})}}]),n}(_g);n(54);function Lk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Bk=function(t){R()(n,t);var e=Lk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"initState",value:function(){return{tolerance:1,stroke:"black","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round",msg:this.$i18n("path.manager.msg")}}},{key:rt("refreshSelection"),value:function(){var t=this.$selection.current;t&&(this.children.$stroke.setValue(t.stroke||"rgba(0, 0, 0, 1)"),this.children.$strokeWidth.setValue(t["stroke-width"]||Sa.number(1)))}},{key:rt("setColorAsset"),value:function(t){var e=t.color;this.$el.isShow()&&(this.setState({stroke:e},!1),this.children.$stroke.setValue(e),this.updateData({stroke:e}))}},{key:"template",value:function(){return"\n
\n
\n
\n \n \n \n
\n \n \n \n\n
\n \n \n \n \n\n
\n \n \n \n
\n \n \n \n \n \n ')}},{key:at("changeValue"),value:function(t,e,n){this.updateData(w()({},t,e))}},{key:"updateData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState(t,!1),this.state.instance.trigger(this.state.changeEvent,t)}},{key:rt("changePathManager"),value:function(t){this.setState({mode:t})}},{key:rt("showDrawManager"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.changeEvent=t.changeEvent||"changeDrawManager",this.setState(t),this.$el.show(),this.emit("addStatusBarMessage",this.state.msg),this.emit("hidePathManager")}},{key:rt("hideDrawManager"),value:function(){this.$el.hide()}}]),n}(_g);n(55);function Ak(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var zk={"segment-move":"modify",modify:"modify",path:"path"},Fk=function(t){R()(n,t);var e=Ak(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"initState",value:function(){return{mode:"move",fill:null,stroke:null,"fill-opacity":null,"stroke-width":null,msg:this.$i18n("path.manager.msg")}}},{key:rt("refreshSelection"),value:function(){var t=this.$selection.current;t&&(this.children.$fill.setValue(t.fill||"rgba(0, 0, 0, 0)"),this.children.$stroke.setValue(t.stroke||"rgba(0, 0, 0, 1)"),this.children.$fillOpacity.setValue(t["fill-opacity"]||Sa.number(1)),this.children.$strokeWidth.setValue(t["stroke-width"]||Sa.number(1)))}},{key:"template",value:function(){return"\n
\n
\n \n \n
\n
\n \n \n \n
\n\n
\n \n
\n
\n
\n \n \n
\n \n \n
\n \n
\n\n
\n \n
\n \n \n ')}},{key:rt("setColorAsset"),value:function(t){var e=t.color;this.$el.isShow()&&(this.setState({stroke:e},!1),this.children.$stroke.setValue(e),this.updateData({stroke:e}),this.command("setAttributeForMulti","change color assets",this.$selection.packByValue({stroke:e})))}},{key:at("changeValue"),value:function(t,e,n){this.command("setAttributeForMulti","change path",this.$selection.packByValue(w()({},t,e))),this.updateData(w()({},t,e))}},{key:It("$mode"),value:function(){return{"data-selected-value":zk[this.state.mode]}}},{key:"refresh",value:function(){this.bindData("$mode")}},{key:st("$flip button"),value:function(t){var e=t.$dt.attr("data-value");this.emit("changePathTransform",e)}},{key:st("$util button"),value:function(t){var e=t.$dt.attr("data-value");this.emit("changePathUtil",e)}},{key:st("$mode button"),value:function(t){var e=t.$dt.attr("data-value");this.updateData({mode:e}),this.refresh()}},{key:"updateData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState(t,!1),this.emit(this.state.changeEvent,t)}},{key:rt("changePathManager"),value:function(t){this.setState({mode:t})}},{key:rt("showPathManager"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.changeEvent=t.changeEvent||"changePathManager",this.setState(t),this.$el.show(),this.emit("addStatusBarMessage",this.state.msg),this.emit("change.mode.view","PathEditorView")}},{key:rt("hidePathManager"),value:function(){this.$el.hide()}}]),n}(_g);n(56);function Hk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Gk=function(t){R()(n,t);var e=Hk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"components",value:function(){return{PathManager:Fk,DrawManager:Bk}}},{key:"template",value:function(){return"\n
\n \n \n \n "}}]),n}(_g);function _k(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Nk=function(t){R()(n,t);var e=_k(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"template",value:function(){return'\n \n ")}},{key:"getClassName",value:function(){return""}},{key:"clickButton",value:function(t){}},{key:"getChecked",value:function(){return!1}},{key:"isDisabled",value:function(){return!1}},{key:"setSelected",value:function(t){this.$el.toggleClass("selected",t)}},{key:"getTitle",value:function(){return""}},{key:"getIcon",value:function(){return""}},{key:"getIconString",value:function(){return""}},{key:"isHideTitle",value:function(){return!1}},{key:st(),value:function(t){this.clickButton(t)}},{key:"getDirection",value:function(){return this.props.direction||""}}],[{key:"createMenuItem",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){R()(r,e);var n=_k(r);function r(){return O()(this,r),n.apply(this,arguments)}return j()(r,[{key:"getIconString",value:function(){return t.iconString||"add_box"}},{key:"getTitle",value:function(){return t.title||"New Item"}},{key:"isHideTitle",value:function(){return t.isHideTitle||!0}},{key:"clickButton",value:function(e){t.clickButton(e)}},{key:"getDirection",value:function(){return t.direction}}]),r}(n)}}]),n}(_g);function Xk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Yk=function(t){R()(n,t);var e=Xk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"afterRender",value:function(){this.$el.$(".icon").css("transform","rotate(-30deg)")}},{key:"getIconString",value:function(){return"navigation"}},{key:"getTitle",value:function(){return this.props.title||"Select"}},{key:"clickButton",value:function(t){this.emit("addLayerView","select")}},{key:rt("addLayerView"),value:function(t){this.setSelected("select"===t)}},{key:rt("refreshSelection"),value:function(){this.setSelected(this.$selection.isEmpty)}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function Kk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Uk=function(t){R()(n,t);var e=Kk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"artboard"}},{key:"getTitle",value:function(){return this.props.title||"ArtBoard"}},{key:"clickButton",value:function(t){this.emit("addLayerView","artboard")}},{key:"isHideTitle",value:function(){return!0}},{key:rt("addLayerView"),value:function(t){this.setSelected("artboard"===t)}}]),n}(Nk);function Wk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddArtboard:Uk});var Zk=function(t){R()(n,t);var e=Wk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"rect"}},{key:"getTitle",value:function(){return this.props.title||"Rect"}},{key:"clickButton",value:function(t){this.emit("addLayerView","rect")}},{key:rt("addLayerView"),value:function(t){this.setSelected("rect"===t)}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function qk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddRect:Zk});var Jk=function(t){R()(n,t);var e=qk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"lens"}},{key:"getTitle",value:function(){return this.props.title||"Circle"}},{key:"clickButton",value:function(t){this.emit("addLayerView","circle")}},{key:rt("addLayerView"),value:function(t){this.setSelected("circle"===t)}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function Qk(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddCircle:Jk});var tx=function(t){R()(n,t);var e=Qk(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"title"}},{key:"getTitle",value:function(){return this.props.title||"Text"}},{key:"getClassName",value:function(){return"text"}},{key:"clickButton",value:function(t){this.emit("addLayerView","text")}},{key:rt("addLayerView"),value:function(t){this.setSelected("text"===t)}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function ex(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddText:tx});var nx=function(t){R()(n,t);var e=ex(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"photo"}},{key:"getTitle",value:function(){return this.props.title||"Image"}},{key:"clickButton",value:function(){this.emit("addLayerView","image")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function rx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddImage:nx});var ix=function(t){R()(n,t);var e=rx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"draw"}},{key:"getTitle",value:function(){return this.props.title||"Draw"}},{key:"clickButton",value:function(t){this.emit("addLayerView","brush")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function ax(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddDrawPath:ix});var ox=function(t){R()(n,t);var e=ax(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"pentool"}},{key:"getTitle",value:function(){return this.props.title||"Path"}},{key:"clickButton",value:function(t){this.emit("addLayerView","path")}},{key:rt("addLayerView"),value:function(t){this.setSelected("path"===t)}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function cx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddPath:ox});var sx=function(t){R()(n,t);var e=cx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"outline_rect"}},{key:"getTitle",value:function(){return this.props.title||"RectPath"}},{key:"clickButton",value:function(t){this.emit("addLayerView","svg-rect")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function ux(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddSVGRect:sx});var lx=function(t){R()(n,t);var e=ux(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"outline_circle"}},{key:"getTitle",value:function(){return this.props.title||"CirclePath"}},{key:"clickButton",value:function(t){this.emit("addLayerView","svg-circle")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function fx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}io({AddSVGCircle:lx});var hx=function(t){R()(n,t);var e=fx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"text_rotate"}},{key:"getTitle",value:function(){return this.props.title||"TextPath"}},{key:"clickButton",value:function(t){this.emit("addLayerView","svg-textpath")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);n(57);function px(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var dx=function(t){R()(n,t);var e=px(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"components",value:function(){return{SelectTool:Yk,AddArtboard:Uk,AddRect:Zk,AddCircle:Jk,AddText:tx,AddImage:nx,AddDrawPath:ix,AddPath:ox,AddSVGRect:sx,AddSVGCircle:lx,AddSVGTextPath:hx}}},{key:"template",value:function(){return"\n
\n
\n
\n\n \n \n \n \n \n \n \n \x3c!--object refClass='AddVideo' /--\x3e\n ").concat(this.$menuManager.generate("tool.menu.css"),"\n \n \n
\n \n \n \n \n \x3c!-- --\x3e\n \n \n ").concat(this.$menuManager.generate("tool.menu.svg")," \n \n \n \n\n \n ")}},{key:rt("changedEditorlayout"),value:function(){this.refs.$items.attr("data-selected-value",this.$editor.layout)}},{key:rt("noneSelectMenu"),value:function(){var t=this.refs.$items.$(".selected");t&&t.removeClass("selected")}},{key:st("$items button"),value:function(t){t.$dt.onlyOneClass("selected")}}]),n}(_g);function vx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var yx=function(t){R()(n,t);var e=vx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"note"}},{key:"getTitle",value:function(){return this.$i18n("menu.item.projects.title")}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){this.emit("open.projects")}}]),n}(Nk);function gx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var mx=function(t){R()(n,t);var e=gx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"fullscreen"}},{key:"getTitle",value:function(){return this.$i18n("menu.item.fullscreen.title")}},{key:"clickButton",value:function(t){this.emit("toggle.fullscreen")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function bx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var kx=function(t){R()(n,t);var e=bx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"keyboard"}},{key:"getTitle",value:function(){return this.$i18n("menu.item.shortcuts.title")}},{key:"clickButton",value:function(t){this.emit("showShortcutWindow")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function xx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var wx=function(t){R()(n,t);var e=xx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"launch"}},{key:"getTitle",value:function(){return this.$i18n("menu.item.export.title")}},{key:"clickButton",value:function(t){this.emit("showExportView")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function Px(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Ox=function(t){R()(n,t);var e=Px(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"archive"}},{key:"getTitle",value:function(){return this.$i18n("menu.item.download.title")}},{key:"clickButton",value:function(t){this.emit("downloadJSON")}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);function Sx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var jx=function(t){R()(n,t);var e=Sx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"storage"}},{key:"getTitle",value:function(){return this.$i18n("menu.item.save.title")}},{key:"clickButton",value:function(t){var e=this;this.emit("saveJSON"),this.nextTick((function(){e.emit("notify","alert","Save","Save the content on localStorage",2e3)}))}},{key:"isHideTitle",value:function(){return!0}}]),n}(Nk);n(58);function $x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Rx=function(t){R()(n,t);var e=$x(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"components",value:function(){return{Projects:yx,Fullscreen:mx,KeyBoard:kx,ExportView:wx,Download:Ox,Save:jx,PageSubEditor:Gk,ToolMenu:dx}}},{key:"template",value:function(){return"\n
\n
\n \n
\n
\n
\n
\n
\n \n \n ".concat(this.$menuManager.generate("toolbar.left"),"\n \n \n \n \n
\n \n \n \n
\n
\n
\n
\n \n \n \n \n ").concat(this.$menuManager.generate("toolbar.right")," \n \n \n \n \n \n ")}}]),n}(_g);function Cx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Mx=function(t){R()(n,t);var e=Cx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"align_vertical_bottom"}},{key:"getTitle",value:function(){return"Bottom"}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){this.emit("sort.bottom")}}]),n}(Nk);function Tx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Vx=function(t){R()(n,t);var e=Tx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"align_horizontal_center"}},{key:"getTitle",value:function(){return"Center"}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){this.emit("sort.center")}}]),n}(Nk);function Ex(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Ix=function(t){R()(n,t);var e=Ex(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"align_horizontal_left"}},{key:"getTitle",value:function(){return"Left"}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){this.emit("sort.left")}}]),n}(Nk);function Dx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Lx=function(t){R()(n,t);var e=Dx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"align_vertical_center"}},{key:"getTitle",value:function(){return"middle"}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){this.emit("sort.middle")}}]),n}(Nk);function Bx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Ax=function(t){R()(n,t);var e=Bx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"align_horizontal_right"}},{key:"getTitle",value:function(){return"Right"}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){this.emit("sort.right")}}]),n}(Nk);function zx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Fx=function(t){R()(n,t);var e=zx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"vertical_distribute"}},{key:"getTitle",value:function(){return"height"}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){this.emit("same.height")}}]),n}(Nk);function Hx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Gx=function(t){R()(n,t);var e=Hx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"horizontal_distribute"}},{key:"getTitle",value:function(){return"width"}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){console.log(t),this.emit("same.width")}}]),n}(Nk);function _x(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Nx=function(t){R()(n,t);var e=_x(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getIconString",value:function(){return"align_vertical_top"}},{key:"getTitle",value:function(){return"Top"}},{key:"isHideTitle",value:function(){return!0}},{key:"clickButton",value:function(t){this.emit("sort.top")}}]),n}(Nk);n(59);function Xx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Yx=function(t){R()(n,t);var e=Xx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"onToggleShow",value:function(){}},{key:"template",value:function(){return"\n
\n ").concat(this.isHideHeader()?"":"\n
\n \n ').concat(this.getTools(),"\n
"),"\n
").concat(this.getBody(),"
\n ").concat(this.getFooter()?""):"","\n
\n ")}},{key:"setTitle",value:function(t){this.refs.$propertyTitle.text(t)}},{key:"hasKeyframe",value:function(){return!1}},{key:"isHideHeader",value:function(){return!1}},{key:"isFirstShow",value:function(){return!0}},{key:"getClassName",value:function(){return""}},{key:"getTitleClassName",value:function(){return""}},{key:"getBodyClassName",value:function(){return""}},{key:"getKeyframeProperty",value:function(){return""}},{key:"getTitle",value:function(){return""}},{key:"getTools",value:function(){return""}},{key:"getBody",value:function(){return""}},{key:"getFooter",value:function(){return""}},{key:st("$el .property-body .add-timeline-property")+et+nt,value:function(t){var e=t.$dt.attr("data-property"),n=t.$dt.attr("data-editor");this.emit("addTimelineCurrentProperty",{property:e,editor:n})}},{key:st("$el .property-title .add-timeline-property")+et+nt,value:function(t){var e=t.$dt.attr("data-property"),n=t.$dt.attr("data-editor");this.emit("addTimelineCurrentProperty",{property:e,editor:n})}},{key:"isPropertyShow",value:function(){return this.$el.hasClass("show")}},{key:"toggle",value:function(t){this.$el.toggle(t)}},{key:"hide",value:function(){this.$el.hide()}},{key:"show",value:function(){this.$el.show()}},{key:"onShowTitle",value:function(t){}},{key:"refreshShowIsNot",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.$selection.current;n&&(t.includes(n.itemType)?this.hide():(this.show(),e&&this.refresh()))}},{key:"refreshShow",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.$selection.current;n&&(Jt(t)&&t()||!Jt(t)&&t.includes(n.itemType))?(this.show(),e&&this.refresh()):this.hide()}},{key:"startInputEditing",value:function(t){t&&(t.attr("contenteditable",!0),t.css({"background-color":"white",outline:"1px auto black",color:"black"}),t.focus())}},{key:"endInputEditing",value:function(t,e){if(t){t.attr("contenteditable",!1),t.css({"background-color":null,outline:null,color:null});var n=t.attr("data-index");e&&e(n,t.text().trim()),t.blur()}}},{key:"editableProperty",get:function(){return""}},{key:"checkShow",value:function(){return this.$selection.current&&this.$selection.current.editable(this.editableProperty)?(this.show(),!0):(this.hide(),!1)}}]),n}(_g);n(60);function Kx(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var Ux=function(t){R()(n,t);var e=Kx(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"components",value:function(){return{LeftAlign:Ix,CenterAlign:Vx,RightAlign:Ax,TopAlign:Nx,MiddleAlign:Lx,BottomAlign:Mx,SameWidth:Gx,SameHeight:Fx}}},{key:"getTitle",value:function(){return this.$i18n("alignment.property.title")}},{key:"isHideHeader",value:function(){return!0}},{key:"getBody",value:function(){return'\n
\n \n \n \n\n \n \n \n\n \n \n \n '}}]),n}(Yx);function Wx(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"@";return"".concat(e).concat(t.startIndex).padEnd(10,"0")}function Zx(t,e){var n=function(t,e){var n=t.match(e),r=[];if(!n)return r;for(var i=0,a=n.length;i1&&void 0!==arguments[1]?arguments[1]:{},r=n.parseStyle(t);return r.push(n.parse(e)),n.join(r)}},{key:"remove",value:function(t,e){return n.filter(t,(function(t,n){return e!=n}))}},{key:"filter",value:function(t,e){return n.join(n.parseStyle(t).filter((function(t){return e(t)})))}},{key:"replace",value:function(t,e,r){var i=n.parseStyle(t);return i[e]?i[e]=r:i.push(r),n.join(i)}},{key:"get",value:function(t,e){return n.parseStyle(t)[e]}},{key:"parseStyle",value:function(t){var e=[];if(!t)return e;var r=Zx(t,tw);return(e=r.str.split(",").map((function(t){var e=t.split(" ").filter(Boolean);return e.length>=7?{duration:Sa.parse(e[0]),timingFunction:qx(e[1],r.matches),delay:Sa.parse(e[2]),iterationCount:"infinite"===e[3]?Sa.string("infinite"):Sa.parse(e[3]),direction:e[4],fillMode:e[5],playState:e[6],name:e[7]}:e.length>=3?{duration:Sa.parse(e[0]),timingFunction:qx(e[1],r.matches),delay:Sa.parse(e[2]),name:e[3]}:e.length>=1?{duration:Sa.parse(e[0]),name:e[1]}:{}}))).map((function(t){return n.parse(t)}))}}]),n}(Tc);n(61);function nw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function rw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var iw=function(t){R()(n,t);var e=rw(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getTitle",value:function(){return this.$i18n("animation.property.title")}},{key:"getBody",value:function(){return"
"}},{key:"getTools",value:function(){return'\n \n ")}},{key:"isFirstShow",value:function(){return!0}},{key:Tt("$animationList")+W,value:function(){var t=this,e=this.$selection.current;return e?ew.parseStyle(e.animation).map((function(e,n){var r=t.state.selectedIndex===n?"selected":"",i=jc(e.timingFunction,30,30);return"\n
\n
\n
\n \n \n \n
\n
\n
\n ').concat(e.name?e.name:"< ".concat(t.$i18n("animation.property.select a keyframe")," >"),"\n
\n
\n \n \n \n \n \n \n
\n
\n
\n \n
\n
\n
\n ")})):""}},{key:rt("refreshSelection")+Z(100),value:function(){this.refreshShowIsNot("project"),this.emit("hideAnimationPropertyPopup")}},{key:st("$add"),value:function(t){var e=this;this.$selection.current?(this.command("setAttributeForMulti","add animation property",this.$selection.packByValue({animation:function(t){return ew.add(t.animation,{name:null})}})),this.nextTick((function(){setTimeout((function(){e.refresh()}),100)}))):alert("Select a layer")}},{key:st("$animationList .tools .del"),value:function(t){var e=t.$dt.attr("data-index"),n=this.$selection.current;n&&(n.reset({animation:ew.remove(n.animation,e)}),this.emit("refreshElement",n),this.refresh())}},{key:st("$animationList .play-state"),value:function(t){var e=+t.$dt.attr("data-index"),n=this.$selection.current;if(n){var r=ew.parseStyle(n.animation),i=r[e];i&&(i.togglePlayState(),t.$dt.attr("data-play-state-selected-value",i.playState),n.reset({animation:ew.join(r)}),this.emit("refreshElement",n))}}},{key:"selectItem",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e?this.refs["animationIndex".concat(t)].addClass("selected"):this.refs["animationIndex".concat(t)].removeClass("selected")}},{key:"viewAnimationPicker",value:function(t){"number"==typeof this.selectedIndex&&this.selectItem(this.selectedIndex,!1),this.selectedIndex=+t.attr("data-index"),this.current=this.$selection.current,this.current&&(this.currentAnimation=ew.get(this.current.animation,this.selectedIndex),this.viewAnimationPropertyPopup())}},{key:"viewAnimationPropertyPopup",value:function(){if(this.currentAnimation){var t=this.currentAnimation;this.emit("showAnimationPropertyPopup",{changeEvent:"changeAnimationPropertyPopup",data:t.toCloneObject(),instance:this})}}},{key:st("$animationList .preview"),value:function(t){this.viewAnimationPicker(t.$dt)}},{key:"getRef",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n\n \n \n \x3c!-- --\x3e\n \n ")}},{key:"getClassName",value:function(){return""}},{key:"getTitle",value:function(){return""}},{key:"getTools",value:function(){return""}},{key:"getBody",value:function(){return""}},{key:st("$close"),value:function(){this.$el.hide()}},{key:wt("$title")+Ag("movePopupTitle")+zg("endPopupTitle"),value:function(){this.x=Sa.parse(this.$el.css("left")),this.y=Sa.parse(this.$el.css("top"))}},{key:"movePopupTitle",value:function(t,e){var n=Sa.px(this.x.value+t),r=Sa.px(this.y.value+e);this.$el.css({left:n,top:r,right:"auto",bottom:"auto"})}},{key:"show",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,e=28,n=320,r=this.$el.css("top"),i=this.$el.css("left"),a="auto"!==r?Sa.parse(r):Sa.px(110),o="auto"!==i?Sa.parse(i):Sa.px(document.body.clientWidth-n-e-t);this.$el.css({top:a,left:o,"z-index":this.$editor.zIndex}).show("inline-block")}},{key:"hide",value:function(){this.$el.hide()}},{key:rt("hidePropertyPopup"),value:function(){this.hide()}},{key:wt("$resizer")+Ag("moveResizer"),value:function(t){this.width=Sa.parse(this.$el.css("width")),this.height=Sa.parse(this.$el.css("height"))}},{key:"moveResizer",value:function(t,e){this.$el.css({width:Sa.px(Math.min(this.width.value+t,1e3)),height:Sa.px(Math.min(this.height.value+e,700))})}}]),n}(_g);n(63);function cw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sw(t){for(var e=1;e"}},{key:Tt("$popup"),value:function(){return'\n
\n '.concat(this.templateForKeyframe(),"\n ").concat(this.templateForTimingFunction(),"\n ").concat(this.templateForIterationCount(),"\n ").concat(this.templateForDelay(),"\n ").concat(this.templateForDuration(),"\n ").concat(this.templateForDirection(),"\n ").concat(this.templateForFillMode(),"\n ").concat(this.templateForPlayState(),"\n
\n ")}},{key:"templateForTimingFunction",value:function(){return"\n
\n \n \n \n ")}},{key:"templateForKeyframe",value:function(){return"\n
\n \n
\n \n
\n
\n ")}},{key:Tt("$name"),value:function(){var t=this,e=this.$selection.currentProject,n=[];return e&&e.keyframes&&(n=e.keyframes.map((function(t){return{key:t.name,value:t.name}}))),n.unshift({key:"Select a keyframe",value:""}),n.map((function(e){var n=e.value===t.name?"selected":"",r=t.$i18n(e.key);return"")}))}},{key:yt("$name"),value:function(){this.updateData({name:this.refs.$name.value})}},{key:"templateForDirection",value:function(){var t=this,e="normal,reverse,alternate,alternate-reverse".split(",").map((function(e){return"".concat(e,":").concat(t.$i18n(e))})).join(",");return"\n
\n \n \n ")}},{key:at("changeSelect"),value:function(t,e){this.updateData(w()({},t,e))}},{key:"templateForPlayState",value:function(){return"\n
\n \n \n ")}},{key:"templateForFillMode",value:function(){var t=this,e="none,forwards,backwards,both".split(",").map((function(e){return"".concat(e,":").concat(t.$i18n(e))})).join(",");return"\n
\n \n \n ")}},{key:"templateForDelay",value:function(){return"\n
\n \n \n ")}},{key:"templateForDuration",value:function(){return"\n
\n \n \n ")}},{key:"templateForIterationCount",value:function(){return"\n
\n \n \n ")}},{key:at("changeRangeEditor"),value:function(t,e){"iterationCount"===t&&(e="normal"===e.unit?Sa.number(e.value):Sa.string(e.unit)),this.updateData(w()({},t,e))}},{key:at("changeCubicBezier"),value:function(t,e){this.updateData(w()({},t,e))}},{key:rt("showAnimationPropertyPopup"),value:function(t){this.setState(t),this.show(250),this.children.$cubicBezierEditor.trigger("showCubicBezierEditor",t.data.timingFunction)}},{key:rt("hideAnimationPropertyPopup"),value:function(){this.$el.hide()}}]),n}(ow);function fw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=V()(t);if(e){var i=V()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return M()(this,n)}}var hw=["visible","hidden","scroll","auto"],pw=function(t){R()(n,t);var e=fw(n);function n(){return O()(this,n),e.apply(this,arguments)}return j()(n,[{key:"getTitle",value:function(){return this.$i18n("background.color.property.title")}},{key:"getOverflowList",value:function(){var t=this;return this.variable(hw.map((function(e){return{value:e,text:t.$i18n("background.color.property.overflow.".concat(e))}})))}},{key:"getBody",value:function(){return"\n
\n
\n \n
\n \n \n