diff --git a/docs/main.js b/docs/main.js index 19fb11ed9..a953c67d4 100644 --- a/docs/main.js +++ b/docs/main.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.EasylogicStudio=e():t.EasylogicStudio=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));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=1)}([function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"debounce",function(){return k}),n.d(r,"keyEach",function(){return O}),n.d(r,"keyMap",function(){return S}),n.d(r,"get",function(){return j}),n.d(r,"defaultValue",function(){return P}),n.d(r,"isUndefined",function(){return x}),n.d(r,"isNotUndefined",function(){return C}),n.d(r,"isArray",function(){return _}),n.d(r,"isBoolean",function(){return E}),n.d(r,"isString",function(){return $}),n.d(r,"isNotString",function(){return T}),n.d(r,"isObject",function(){return R}),n.d(r,"isFunction",function(){return I}),n.d(r,"isNumber",function(){return B}),n.d(r,"clone",function(){return D}),n.d(r,"cleanObject",function(){return z}),n.d(r,"combineKeyArray",function(){return A}),n.d(r,"flatKeyValue",function(){return V}),n.d(r,"repeat",function(){return M}),n.d(r,"html",function(){return H});var o={};n.r(o),n.d(o,"format",function(){return N}),n.d(o,"hex",function(){return G}),n.d(o,"rgb",function(){return X}),n.d(o,"hsl",function(){return Y});var i={};n.r(i),n.d(i,"random",function(){return K});var a={};n.r(a),n.d(a,"round",function(){return W}),n.d(a,"degreeToRadian",function(){return q}),n.d(a,"radianToDegree",function(){return J}),n.d(a,"getXInCircle",function(){return Z}),n.d(a,"getYInCircle",function(){return Q}),n.d(a,"getXYInCircle",function(){return tt}),n.d(a,"getDist",function(){return et}),n.d(a,"calculateAngle",function(){return nt}),n.d(a,"uuid",function(){return rt}),n.d(a,"uuidShort",function(){return ot}),n.d(a,"cubicBezier",function(){return at}),n.d(a,"getGradientLine",function(){return ut});var u={};n.r(u),n.d(u,"ReverseXyz",function(){return ct}),n.d(u,"ReverseRGB",function(){return st}),n.d(u,"XYZtoRGB",function(){return lt}),n.d(u,"LABtoXYZ",function(){return ft}),n.d(u,"PivotXyz",function(){return pt}),n.d(u,"XYZtoLAB",function(){return yt}),n.d(u,"LABtoRGB",function(){return ht});var c={};n.r(c),n.d(c,"RGBtoHSV",function(){return vt}),n.d(c,"RGBtoCMYK",function(){return dt}),n.d(c,"RGBtoHSL",function(){return bt}),n.d(c,"c",function(){return gt}),n.d(c,"gray",function(){return mt}),n.d(c,"RGBtoSimpleGray",function(){return wt}),n.d(c,"RGBtoGray",function(){return kt}),n.d(c,"brightness",function(){return Ot}),n.d(c,"RGBtoYCrCb",function(){return St}),n.d(c,"PivotRGB",function(){return jt}),n.d(c,"RGBtoXYZ",function(){return Pt}),n.d(c,"RGBtoLAB",function(){return xt});var s={};n.r(s),n.d(s,"CMYKtoRGB",function(){return Ct});var l={};n.r(l),n.d(l,"HSVtoRGB",function(){return _t}),n.d(l,"HSVtoHSL",function(){return Et});var f={};n.r(f),n.d(f,"HUEtoRGB",function(){return $t}),n.d(f,"HSLtoHSV",function(){return Tt}),n.d(f,"HSLtoRGB",function(){return Rt});var p={};n.r(p),n.d(p,"YCrCbtoRGB",function(){return It});var y={};n.r(y),n.d(y,"matches",function(){return Ft}),n.d(y,"convertMatches",function(){return Lt}),n.d(y,"convertMatchesArray",function(){return Ht}),n.d(y,"reverseMatches",function(){return Nt}),n.d(y,"trim",function(){return Gt}),n.d(y,"parse",function(){return Xt}),n.d(y,"parseGradient",function(){return Yt});var h={};n.r(h),n.d(h,"interpolateRGB",function(){return Ut}),n.d(h,"interpolateRGBObject",function(){return Kt}),n.d(h,"scale",function(){return Wt}),n.d(h,"blend",function(){return qt}),n.d(h,"mix",function(){return Jt}),n.d(h,"contrast",function(){return Zt}),n.d(h,"contrastColor",function(){return Qt}),n.d(h,"gradient",function(){return te}),n.d(h,"scaleHSV",function(){return ee}),n.d(h,"scaleH",function(){return ne}),n.d(h,"scaleS",function(){return re}),n.d(h,"scaleV",function(){return oe});var v={};n.r(v),n.d(v,"start",function(){return Cr});n(0);var d="",b=" ";function g(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:d,n={};return Object.keys(t).forEach(function(r){var o=r;e!==d&&(o="".concat(e,".").concat(r)),R(t[r])?n=function(t){for(var e=1;e]*)\/\>/gim,L={image:!0,input:!0,br:!0,path:!0},H=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r",">"))})};function N(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?G(t):"rgb"==e?X(t,n):"hsl"==e?Y(t):t}function G(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);return t.b<16&&(r="0"+r),"#".concat(e).concat(n).concat(r)}function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(0, 0, 0, 0)";if(_(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),!x(t))return 1==t.a||x(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 Y(t){return _(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),1==t.a||x(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 U(t,e){return Math.floor(Math.random()*(e-t+1))+t}function K(){return X({r:U(0,255),g:U(0,255),b:U(0,255)})}function W(t,e){return e=x(e)?1:e,Math.round(t*e)/e}function q(t){return t*Math.PI/180}function J(t){var e=180*t/Math.PI;return e<0&&(e=360+e),e}function Z(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)+e*Math.cos(q(t))}function Q(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)+e*Math.sin(q(t))}function tt(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:Z(t,e,n),y:Q(t,e,r)}}function et(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 Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function nt(t,e){return J(Math.atan2(e,t))}function rt(){var t=(new Date).getTime();return"xxx12-xx-34xx".replace(/[xy]/g,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 ot(){var t=(new Date).getTime();return"xxxxxxx".replace(/[xy]/g,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}var it={B1:function(t){return t*t*t},B2:function(t){return 3*t*t*(1-t)},B3:function(t){return 3*t*(1-t)*(1-t)},B4:function(t){return(1-t)*(1-t)*(1-t)}};function at(t,e,n,r){var o=e,i=r;return function(t){return 1-(o*it.B2(t)+i*it.B3(t)+it.B4(t))}}function ut(t,e){var n=Math.abs(e.width*Math.sin(t))+Math.abs(e.height*Math.cos(t)),r={x:e.x+e.width/2,y:e.y+e.height/2},o=Math.sin(t-Math.PI/2)*n/2,i=Math.cos(t-Math.PI/2)*n/2;return{length:n,center:r,start:{x:r.x-i,y:r.y-o},end:{x:r.x+i,y:r.y+o}}}function ct(t){return Math.pow(t,3)>.008856?Math.pow(t,3):(t-16/116)/7.787}function st(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function lt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.x,e=r.y,n=r.z}var o=t/100,i=e/100,a=n/100,u=3.2406*o+-1.5372*i+-.4986*a,c=-.9689*o+1.8758*i+.0415*a,s=.0557*o+-.204*i+1.057*a;return u=st(u),c=st(c),s=st(s),{r:W(255*u),g:W(255*c),b:W(255*s)}}function ft(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}var o=(t+16)/116,i=e/500+o,a=o-n/200;return o=ct(o),{x:95.047*(i=ct(i)),y:100*o,z:108.883*(a=ct(a))}}function pt(t){return t>.008856?Math.pow(t,1/3):(7.787*t+16)/116}function yt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.x,e=r.y,n=r.z}var o=t/95.047,i=e/100,a=n/108.883;return o=pt(o),{l:116*(i=pt(i))-16,a:500*(o-i),b:200*(i-(a=pt(a)))}}function ht(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}return lt(ft(t,e,n))}function vt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255,u=Math.max(o,i,a),c=u-Math.min(o,i,a),s=0;0==c?s=0:u==o?s=(i-a)/c%6*60:u==i?s=60*((a-o)/c+2):u==a&&(s=60*((o-i)/c+4)),s<0&&(s=360+s);return{h:s,s:0==u?0:c/u,v:u}}function dt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255,u=1-Math.max(o,i,a);return{c:(1-o-u)/(1-u),m:(1-i-u)/(1-u),y:(1-a-u)/(1-u),k:u}}function bt(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 o,i,a=Math.max(t,e,n),u=Math.min(t,e,n),c=(a+u)/2;if(a==u)o=i=0;else{var s=a-u;switch(i=c>.5?s/(2-a-u):s/(a+u),a){case t:o=(e-n)/s+(e90?0:255)}function mt(t){return{r:t,g:t,b:t}}function wt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return mt(Math.ceil((t+e+n)/3))}function kt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return mt(St(t,e,n).y)}function Ot(t,e,n){return Math.ceil(.2126*t+.7152*e+.0722*n)}function St(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=Ot(t,e,n);return{y:o,cr:.713*(t-o),cb:.564*(n-o)}}function jt(t){return 100*(t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)}function Pt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255;return{x:.4124*(o=jt(o))+.3576*(i=jt(i))+.1805*(a=jt(a)),y:.2126*o+.7152*i+.0722*a,z:.0193*o+.1192*i+.9505*a}}function xt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return yt(Pt(t,e,n))}function Ct(t,e,n,r){if(1==arguments.length){var o=arguments[0];t=o.c,e=o.m,n=o.y,r=o.k}return{r:255*(1-t)*(1-r),g:255*(1-e)*(1-r),b:255*(1-n)*(1-r)}}function _t(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var o=t,i=n;o>=360&&(o=0);var a=e*i,u=a*(1-Math.abs(o/60%2-1)),c=i-a,s=[];return 0<=o&&o<60?s=[a,u,0]:60<=o&&o<120?s=[u,a,0]:120<=o&&o<180?s=[0,a,u]:180<=o&&o<240?s=[0,u,a]:240<=o&&o<300?s=[u,0,a]:300<=o&&o<360&&(s=[a,0,u]),{r:W(255*(s[0]+c)),g:W(255*(s[1]+c)),b:W(255*(s[2]+c))}}function Et(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var o=_t(t,e,n);return bt(o.r,o.g,o.b)}function $t(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 Tt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var o=Rt(t,e,n);return vt(o.r,o.g,o.b)}function Rt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var o,i,a;if(t/=360,n/=100,0==(e/=100))o=i=a=n;else{var u=n<.5?n*(1+e):n+e-n*e,c=2*n-u;o=$t(c,u,t+1/3),i=$t(c,u,t),a=$t(c,u,t-1/3)}return{r:W(255*o),g:W(255*i),b:W(255*a)}}function It(t,e,n,r){if(1==arguments.length){var o=arguments[0];t=o.y,e=o.cr,n=o.cb;r=(r=o.bit)||0}var i=t+1.402*(e-r),a=t-.344*(n-r)-.714*(e-r),u=t+1.772*(n-r);return{r:Math.ceil(i),g:Math.ceil(a),b:Math.ceil(u)}}var Bt={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb(0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb(0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb(0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb(95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(237, 20, 61)",cyan:"rgb(0, 255, 255)",darkblue:"rgb(0, 0, 139)",darkcyan:"rgb(0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgrey:"rgb(169, 169, 169)",darkgreen:"rgb(0, 100, 0)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb(85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb(72, 61, 139)",darkslategray:"rgb(47, 79, 79)",darkslategrey:"rgb(47, 79, 79)",darkturquoise:"rgb(0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb(0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb(30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb(34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb(75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgreen:"rgb(144, 238, 144)",lightgray:"rgb(211, 211, 211)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb(32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb(0, 255, 0)",limegreen:"rgb(50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb(0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb(60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb(0, 250, 154)",mediumturquoise:"rgb(72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb(25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb(0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",rebeccapurple:"rgb(102, 51, 153)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb(65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb(46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb(0, 255, 127)",steelblue:"rgb(70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb(0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb(64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)",transparent:"rgba(0, 0, 0, 0)"};var Dt={isColorName:function(t){return!!Bt[t]},getColorByName:function(t){return Bt[t]}};function zt(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e-1||e[r].indexOf("rgb")>-1||e[r].indexOf("hsl")>-1)n.push({color:e[r]});else{var i=Dt.getColorByName(e[r]);i&&n.push({color:e[r],nameColor:i})}var a={next:0};return n.forEach(function(e){var n=t.indexOf(e.color,a.next);e.startIndex=n,e.endIndex=n+e.color.length,a.next=e.endIndex}),n}function Lt(t){var e=Ft(t);return e.forEach(function(e,n){t=t.replace(e.color,"@"+n)}),{str:t,matches:e}}function Ht(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=Lt(t);return n.str.split(e).map(function(t,e){return t=Gt(t),n.matches[e]&&(t=t.replace("@"+e,n.matches[e].color)),t})}function Nt(t,e){return e.forEach(function(e,n){t=t.replace("@"+n,e.color)}),t}function Gt(t){return t.replace(/^\s+|\s+$/g,"")}function Xt(t){if($(t)){if(Dt.isColorName(t)&&(t=Dt.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},bt(i));if(0<=t&&t<=4294967295)return i=At({},i={type:"hex",r:(4278190080&t)>>24,g:(16711680&t)>>16,b:(65280&t)>>8,a:(255&t)/255},bt(i))}return t}function Yt(t){$(t)&&(t=Ht(t));var e=(t=t.map(function(t){if($(t)){var e=Lt(t),n=Gt(e.str).split(b);return n[1]?n[1].includes("%")?n[1]=parseFloat(n[1].replace(/%/,""))/100:n[1]=parseFloat(n[1]):n[1]="*",n[0]=Nt(n[0],e.matches),n}if(Array.isArray(t))return t[1]?$(t[1])&&(t[1].includes("%")?t[1]=parseFloat(t[1].replace(/%/,""))/100:t[1]=+t[1]):t[1]="*",zt(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 Ut(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",o=Kt(t,e,n);return N(o,o.a<1?"rgb":r)}function Kt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5;return{r:W(t.r+(e.r-t.r)*n),g:W(t.g+(e.g-t.g)*n),b:W(t.b+(e.b-t.b)*n),a:W(t.a+(e.a-t.a)*n,100)}}function Wt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(!t)return[];$(t)&&(t=Ht(t));for(var n=(t=t||[]).length,r=[],o=0;o2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex";return Ut(Xt(t),Xt(e),n,r)}function Jt(t,e){return qt(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex")}function Zt(t){return t=Xt(t),(Math.round(299*t.r)+Math.round(587*t.g)+Math.round(114*t.b))/1e3}function Qt(t){return Zt(t)>=128?"black":"white"}function te(t){for(var e=[],n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:10)-((t=Yt(t)).length-1),r=n,o=1,i=t.length;o1&&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",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:100,u=vt(Xt(t)),c=(i-o)*a/n,s=[],l=1;l<=n;l++)u[e]=Math.abs((a-c*l)/a),s.push(N(_t(u),r));return s}function ne(t){return ee(t,"h",arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:360,1)}function re(t){return ee(t,"s",arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,100)}function oe(t){return ee(t,"v",arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,100)}function ie(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Wt.parula=function(t){return Wt(["#352a87","#0f5cdd","#00b5a6","#ffc337","#fdff00"],t)},Wt.jet=function(t){return Wt(["#00008f","#0020ff","#00ffff","#51ff77","#fdff00","#ff0000","#800000"],t)},Wt.hsv=function(t){return Wt(["#ff0000","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff","#ff0000"],t)},Wt.hot=function(t){return Wt(["#0b0000","#ff0000","#ffff00","#ffffff"],t)},Wt.pink=function(t){return Wt(["#1e0000","#bd7b7b","#e7e5b2","#ffffff"],t)},Wt.bone=function(t){return Wt(["#000000","#4a4a68","#a6c6c6","#ffffff"],t)},Wt.copper=function(t){return Wt(["#000000","#3d2618","#9d623e","#ffa167","#ffc77f"],t)};var ae=function(t){for(var e=1;e=t){e=ue[r-1],n=ue[r];break}return e&&n?ae.interpolateRGB(e,n,(t-e.start)/(n.start-e.start)):ue[0].rgb}};function se(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var le=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";ve(this,t),this.value=e,this.unit=n}var e,n,r;return e=t,n=[{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:"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:"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{value:this.value,unit:this.unit}}},{key:"rate",value:function(t){return t/this.value}},{key:"stringToPercent",value:function(){return C(de[this.value])?t.percent(de[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: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:this.isString()?this.stringToEm(e):void 0}},{key:"toPx",value:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.isPercent()?t.px(this.value/100*e):this.isPx()?this:this.isEm()?t.px(this.value/100*e/16):this.isString()?this.stringToPx(e):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):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[o].value&&(r=e[o]);return r}},{key:"max",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n-1)return new t(e.split("calc(")[1].split(")")[0],"calc");var n=e.replace(ge,"$1 $2").split(" ");return+n[0]==n[0]?new t(+n[0],n[1]):new t(n[0])}if(e instanceof t)return e;if(e.unit){if("%"==e.unit||"percent"==e.unit){var r=0;return C(e.percent)?r=e.percent:C(e.value)&&(r=e.value),t.percent(r)}if("px"==e.unit){r=0;return C(e.px)?r=e.px:C(e.value)&&(r=e.value),t.px(r)}if("em"==e.unit){r=0;return C(e.em)?r=e.em:C(e.value)&&(r=e.value),t.em(r)}if("deg"==e.unit){r=0;return C(e.deg)?r=e.deg:C(e.value)&&(r=e.value),t.deg(r)}if("s"==e.unit){r=0;return C(e.second)?r=e.second:C(e.value)&&(r=e.value),t.second(r)}if("ms"==e.unit){r=0;return C(e.ms)?r=e.ms:C(e.value)&&(r=e.value),t.ms(r)}if("number"==e.unit){r=0;return C(e.value)&&(r=e.value),t.number(r)}if("--"==e.unit){r=0;return C(e.value)&&(r=e.value),t.var(r)}if(""===e.unit||"string"===e.unit){r="";return C(e.str)?r=e.str:C(e.value)&&(r=e.value),t.string(r)}}return t.string(e)}}],n&&he(e.prototype,n),r&&he(e,r),t}();function we(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:"block";return this.css("display","none"!=t?t:"block")}},{key:"hide",value:function(){return this.css("display","none")}},{key:"toggle",value:function(t){var e="none"==this.css("display");return 1==arguments.length?e&&t?this.show():this.hide():e?this.show():this.hide()}},{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:"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]:d,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=new t(e,n,r);return i.css(o),this.append(i),i}},{key:"firstChild",value:function(){return new t(this.el.firstElementChild)}},{key:"children",value:function(){var e=this.el.firstElementChild;if(!e)return[];var n=[];do{n.push(new t(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.replaceChild(t.el||t,this.el),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:"focus",value:function(){return this.el.focus(),this}},{key:"select",value:function(){return this.el.select(),this}},{key:"blur",value:function(){return this.el.blur(),this}},{key:"select",value:function(){return this.el.select(),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(),o=window.devicePixelRatio||1;this.px("width",e),this.px("height",n),this.el.width=e*o,this.el.height=n*o,r.scale(o,o)}},{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:"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 o=this.context();o.beginPath(),o.moveTo(t,e),o.lineTo(n,r),o.stroke(),o.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]:Be;Pe(this,t),this.value=e,this.split=n}return Ce(t,[{key:"toString",value:function(){return" ".concat(this.split," ")+this.value}}]),t}(),Ee=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be;Pe(this,t),this.value=e,this.split=n}return Ce(t,[{key:"toString",value:function(){return" ".concat(this.split," after(").concat(this.value,")")}}]),t}(),$e=/^load (.*)/gi,Te=/^bind (.*)/gi,Re=["click|dblclick","mouse(down|up|move|over|out|enter|leave)","pointer(start|move|end)","touch(start|move|end)","key(down|up|press)","drag|drop|drag(start|over|enter|leave|exit|end)","contextmenu","change|input|focus|blur|focus(in|out)","paste","resize|scroll|wheel|mousewheel|DOMMouseScroll","submit"].join("|"),Ie=new RegExp("^(".concat(Re,")"),"ig"),Be="|",De=b,ze={},Ae=function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:Be;return new _e(t,e)}),en=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be;return new Ee(t,e)},nn=tn,rn=(tn("ArrowUp"),tn("ArrowDown"),tn("ArrowLeft"),tn("ArrowRight"),tn("Enter"),tn("Space"),tn("isAltKey"),tn("isShiftKey"),tn("isMetaKey"),tn("isCtrlKey"),tn("self"),tn("fit"),tn("passive"),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return tn("debounce(".concat(t,")"))}),on=(tn("capture()"),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"move";return en("bodyMouseMove ".concat(t))}),an=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";return en("bodyMouseUp ".concat(t))},un=en("preventDefault"),cn=(en("stopPropagation"),function(){return"load "+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$el")}),sn=function(){return!0},ln=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$el",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;return"bind "+t+Be+function(t){if(t===d)return d;var e=rt();return ze[e]=t,e}(e)},fn={addEvent:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t&&t.addEventListener(e,n,r)},removeEvent: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}}},pn="CHANGE_SELECTION",yn="CHANGE_EDITOR",hn="CHANGE_ARTBOARD",vn="CHANGE_LAYER",dn="*/",bn="/";function gn(t){return dn+t}function mn(t){return bn+t}function wn(t,e){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:0,o=r>0?k(e,r):e;this.callbacks.push({event:t,callback:o,context:n,originalCallback:e})}},{key:"off",value:function(t,e){0==arguments.length?(this.callbacks=[],this.cachedCallback={}):1==arguments.length?(this.callbacks=this.callbacks.filter(function(e){return e.event!=t}),this.cachedCallback={}):2==arguments.length&&(this.callbacks=this.callbacks.filter(function(n){return!(n.event==t&&n.originalCallback==e)}),this.cachedCallback={})}},{key:"getCachedCallbacks",value:function(t){return this.cachedCallback[t]||(this.cachedCallback[t]=this.callbacks.filter(function(e){return e.event===t})),this.cachedCallback[t]}},{key:"sendMessage",value:function(t,e,n,r,o,i){var a=this;setTimeout(function(){var u=a.getCachedCallbacks(e);u&&u.filter(function(e){return e.originalCallback.source!==t}).forEach(function(t){t.callback(n,r,o,i)})},0)}},{key:"triggerMessage",value:function(t,e,n,r,o,i){var a=this;setTimeout(function(){var u=a.getCachedCallbacks(e);u?u.filter(function(e){return e.originalCallback.source===t}).forEach(function(t){return t.callback(n,r,o,i)}):console.warn(e," is not valid event")},0)}},{key:"emit",value:function(t,e,n,r,o){this.sendMessage(this.source,t,e,n,r,o)}},{key:"trigger",value:function(t,e,n,r,o){this.triggerMessage(this.source,t,e,n,r,o)}}])&&wn(e.prototype,n),r&&wn(e,r),t}();function On(){var t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n ","\n "]);return On=function(){return t},t}function Sn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jn(t,e){for(var n=0;n-1}),r=n.map(function(t){var n=_n(t.split("".concat(e,"("))[1].split(")")[0].trim().split(" "),2);return{target:n[0],param:n[1]}});return[n,r]},Mn=function(t,e,n){e.callback=function(t,e,n){return e.delegate?Dn(t,e,n):Bn(t,e,n)}(t,e,n),t.addBinding(e),fn.addEvent(e.dom,e.eventName,e.callback,!!e.captures.length)},Fn=function(t,e,n,r){var o=Pn(e),i=o[0],a=o[1],u=o.slice(2),c=function(t,e,n){var r=n,o=r.filter(function(e){return!!t[e]}),i=_n(Vn(r,"after"),2),a=i[0],u=i[1],c=_n(Vn(r,"before"),2),s=c[0],l=c[1],f=_n(Vn(r,"debounce"),2),p=f[0],y=f[1],h=_n(Vn(r,"capture"),1)[0],v=[].concat(xn(o),xn(a),xn(s),xn(p),xn(h));return{eventName:e,codes:r.filter(function(t){return!v.includes(t)}).map(function(t){return t.toLowerCase()}),captures:h,afterMethods:u,beforeMethods:l,debounceMethods:y,checkMethodList:o}}(t,i,n);(c.dom=function(t,e){var n;return(n=e?t.refs[e]||t[e]||window[e]:t.el||t.$el||t.$root)instanceof je?n.getElement():n}(t,a),c.delegate=u.join(De),c.debounceMethods.length)&&(r=k(r,+c.debounceMethods[0].target));Mn(t,c,r)},Ln=function(t,e){var n=e.split(Be).map(function(t){return t.trim()}),r=Pn(n.shift().split(De)),o=r[0],i=r.slice(1),a=function(t){var e=[];return t.split(":").forEach(function(t){var n=t.split(":");e.push.apply(e,xn(n))}),e}(o),u=t[e].bind(t);a.forEach(function(e){Fn(t,[e].concat(xn(i)),n,u)})},Hn=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={},this.prevState={},this.refs={},this.children={},this._bindings=[],this.id=rt(),this.childComponents=this.components()}var e,n,r;return e=t,(n=[{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=function(t){for(var e=1;e")}},{key:"templateClass",value:function(){return null}},{key:"eachChildren",value:function(t){I(t)&&O(this.children,function(e,n){t(n)})}},{key:"initializeEvent",value:function(){this.initializeDomEvent(),this.eachChildren(function(t){t.initializeEvent()})}},{key:"destroy",value:function(){this.destroyDomEvent(),this.eachChildren(function(t){t.destroy()})}},{key:"destroyDomEvent",value:function(){this.removeEventAll()}},{key:"initializeDomEvent",value:function(){var t=this;this.destroyDomEvent(),this.filterProps(Ie).forEach(function(e){return Ln(t,e)})}},{key:"collectProps",value:function(){var t=this,e=this.__proto__,n=[];do{if(!1===e instanceof Object)break;var r=Object.getOwnPropertyNames(e).filter(function(e){return I(t[e])});n.push.apply(n,xn(r)),e=e.__proto__}while(e);return n}},{key:"filterProps",value:function(t){return this.collectProps().filter(function(e){return e.match(t)})}},{key:"self",value:function(t){return t&&t.$delegateTarget&&t.$delegateTarget.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}},{key:"preventDefault",value:function(t){return t.preventDefault(),!0}},{key:"stopPropagation",value:function(t){return t.stopPropagation(),!0}},{key:"bodyMouseMove",value:function(t,e){this[e]&&this.emit("add/body/mousemove",this[e],this,t.xy)}},{key:"bodyMouseUp",value:function(t,e){this[e]&&this.emit("add/body/mouseup",this[e],this,t.xy)}},{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:"removeEventAll",value:function(){var t=this;this.getBindings().forEach(function(e){t.removeEvent(e)}),this.initBindings()}},{key:"removeEvent",value:function(t){var e=t.eventName,n=t.dom,r=t.callback;fn.removeEvent(n,e,r)}}])&&jn(e.prototype,n),r&&jn(e,r),t}();function Nn(t){return(Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Xn(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=Yn(this,Kn(e).call(this,t))).initializeProperty(t,r),n.created(),n.initialize(),n.initializeStoreEvent(),n}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wn(t,e)}(e,Hn),n=e,(r=[{key:"initializeProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.opt=t||{},this.parent=this.opt,this.props=e,this.source=rt(),this.sourceName=this.constructor.name,t&&t.$store&&(this.$store=t.$store)}},{key:"created",value:function(){}},{key:"getRealEventName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ME@",n=t.indexOf(e);return t.substr(n<0?0:n+e.length)}},{key:"initializeStoreEvent",value:function(){var t=this;this.storeEvents={},this.filterProps(qn).forEach(function(e){var n=t.getRealEventName(e,"ME@"),r=Gn(Vn(n.split("|"),"debounce"),2),o=r[0],i=r[1],a=0;o.length&&(a=+i[0].target||0),n.split("|").filter(function(t){return!1===o.includes(t)}).map(function(t){return t.trim()}).forEach(function(n){var r=t[e].bind(t);r.displayName=n,r.source=t.source,t.storeEvents[n]=r,t.$store.on(n,t.storeEvents[n],t,a)})})}},{key:"destoryStoreEvent",value:function(){var t=this;O(this.storeEvents,function(e,n){t.$store.off(e,n)})}},{key:"destroy",value:function(){Un(Kn(e.prototype),"destroy",this).call(this),this.destoryStoreEvent()}},{key:"get",value:function(t){return this.$store.items[t]||{}}},{key:"read",value:function(t,e,n,r,o){return this.$store.read(t,e,n,r,o)}},{key:"mapGetters",value:function(){var t;return(t=this.$store).mapGetters.apply(t,arguments)}},{key:"mapActions",value:function(){var t;return(t=this.$store).mapActions.apply(t,arguments)}},{key:"mapDispatches",value:function(){var t;return(t=this.$store).mapDispatches.apply(t,arguments)}},{key:"config",value:function(t,e,n,r,o){if(1==arguments.length)return this.$store.tool[t];this.dispatch("tool/set",t,e,n,r,o)}},{key:"initConfig",value:function(t,e){this.$store.tool[t]=e}},{key:"run",value:function(t,e,n,r,o){return this.$store.run(t,e,n,r,o)}},{key:"dispatch",value:function(t,e,n,r,o){return this.$store.source=this.source,this.$store.dispatch(t,e,n,r,o)}},{key:"emit",value:function(t,e,n,r,o){this.$store.source=this.source,this.$store.emit(t,e,n,r,o)}},{key:"trigger",value:function(t,e,n,r,o){this.$store.source=this.source,this.$store.trigger(t,e,n,r,o)}},{key:"on",value:function(t,e){this.$store.on(t,e)}},{key:"off",value:function(t,e){this.$store.off(t,e)}}])&&Xn(n.prototype,r),o&&Xn(n,o),e}();function Qn(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n instanceof t&&(n=n.toJSON()),this.json=this.convert(nr({},this.getDefaultObject(),n)),new Proxy(this,{get:function(t,e){var n=t[e];return I(n)?function(){for(var e=arguments.length,r=new Array(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:{};return mr.search(nr({parentId:this.id},t))}},{key:"one",value:function(t){return this.search(t)[0]}},{key:"clone",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=JSON.parse(JSON.stringify(this.json));return t&&delete e.id,new(0,this.constructor)(e)}},{key:"addItem",value:function(t,e,n){if(e.itemType!=t)throw new Error("Only ".concat(t," is able to add in ").concat(this.json.type));var r=mr.add(this.id,e);return x(n)?this.sort():this.sort(n),r}},{key:"add",value:function(t){return this.addItem(t.itemType,t,t.itemType)}},{key:"reset",value:function(e){e instanceof t&&(e=e.toJSON()),this.json=this.convert(nr({},this.json,e))}},{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nr({id:ot(),index:Number.MAX_SAFE_INTEGER,visible:!0,lock:!1},t)}},{key:"toggle",value:function(t,e){x(e)?this.json[t]=!this.json[t]:this.json[t]=!!e}},{key:"toJSON",value:function(){return this.json}},{key:"is",value:function(t){return this.json.itemType==t}},{key:"remove",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];mr.remove(this.id,t)}},{key:"clear",value:function(t){C(t)?this.search({itemType:t}).forEach(function(t){return t.remove()}):mr.removeChildren(this.id,this)}},{key:"parent",value:function(){return mr.get(this.parentId)}},{key:"sort",value:function(t){var e=this.children;t&&(e=e.filter(function(e){return e.itemType===t})),e.sort(function(t,e){return t.index===e.index?0:t.index>e.index?1:-1}),e.forEach(function(t,e){t.index=100*e})}},{key:"copy",value:function(){return mr.copy(this.id)}},{key:"insertLast",value:function(t){var e=this.parent(),n=t.parent();t.parentId=this.json.parentId,t.index=this.json.index+1,e.sort(),n.sort()}},{key:"path",value:function(t){var e=[],n=C(t)?t:this.parentId;t||(e=[mr.get(this.json.id)]);do{var r=mr.get(n);r&&e.push(r),n=r?r.parentId:this.json.parentId}while(n);return e}},{key:"title",get:function(){return"".concat(this.json.name||this.getDefaultTitle())}},{key:"id",get:function(){return this.json.id}},{key:"parentId",get:function(){return this.json.parentId}},{key:"children",get:function(){var t=mr.children(this.id);return t.sort(function(t,e){return t.index===e.index?0:t.index>e.index?1:-1}),t}}])&&or(e.prototype,n),r&&or(e,r),t}();function ar(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];return{x:me.px(0),y:me.px(0),width:me.px(0),height:me.px(0)}}},{key:"reset",value:function(t){t instanceof ir&&(t=t.toJSON()),this.json=this.convert(ar({},this.json,t))}},{key:"convert",value:function(t){return t.width=me.parse(t.width),t.height=me.parse(t.height),t.x=me.parse(t.x),t.y=me.parse(t.y),t}},{key:"checkInArea",value:function(t){return 0!==t.width.value&&(0!==t.height.value&&(!(t.screenX2.valuethis.screenX2.value)&&!(t.screenY.value>this.screenY2.value)))))}},{key:"checkInOffset",value:function(t){return 0!==t.width.value&&(0!==t.height.value&&(!(this.screenX.value>t.width+t.left)&&(!(this.screenX2.valuet.height+t.top)&&!(this.screenY2.value1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.currentLayer;r&&r.reset(e),(n||this.editor).emit(t,r)}},{key:"updateRect",value: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=this.currentRect;r&&r.reset(e),(n||this.editor).emit(t,r)}},{key:"updateArtBoard",value: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=this.currentArtBoard;r&&r.reset(e),(n||this.editor).emit(t,r)}},{key:"updateDirectory",value: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=this.currentDirectory;r&&r.reset(e),(n||this.editor).emit(t,r)}},{key:"updateProject",value: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=this.currentProject;r&&r.reset(e),(n||this.editor).emit(t,r)}},{key:"check",value:function(t){return!!this._idSet.has(t)||(!(!this._artboard||this._artboard.id!=t)||!(!this._project||this._project.id!=t))}},{key:"checkOne",value:function(t){return this._idSet.has(t)}},{key:"isEmpty",value:function(){return 0===this._ids.length}},{key:"isNotEmpty",value:function(){return this._ids.length>0}},{key:"count",value:function(){return this._ids.length}},{key:"unitValues",value:function(){return this.items.map(function(t){var e=t.x.value,n=t.y.value,r=t.width.value,o=t.height.value;return{id:t.id,x:e,y:n,width:r,height:o,x2:e+r,y2:n+o,centerX:e+r/2,centerY:n+o/2}})}},{key:"search",value:function(t){return this.items.filter(function(e){return e.itemType===t})}},{key:"is",value:function(t){return this._mode===t}},{key:"select",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;ri&&(t=i),e>a&&(e=a),n1&&void 0!==arguments[1])||arguments[1])&&this.removeChildren(t),vr.delete(t)}},{key:"copy",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=[];if(""==e)r=this.projects;else{var o=this.get(e);o?r=o.children:n&&(r=n.children)}r.length&&r.forEach(function(e){t.removeChildren(e.id),t.remove(e.id)})}},{key:"get",value:function(t){return vr.get(t)}},{key:"set",value:function(t,e){vr.set(t,e)}},{key:"has",value:function(t){return vr.has(t)}},{key:"search",value:function(t){var e=Object.keys(t),n=[],r=!0,o=!1,i=void 0;try{for(var a,u=function(){var r=yr(a.value,2),o=(r[0],r[1]);e.every(function(e){return t[e]===o[e]})&&(n[n.length]=o)},c=vr[Symbol.iterator]();!(r=(a=c.next()).done);r=!0){u()}}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n.sort(function(t,e){return t.index>e.index?1:-1}),n}},{key:"sort",value:function(t){var e=[];"project"===t&&(e=this.projects),e.sort(function(t,e){return t.index===e.index?0:t.index>e.index?1:-1}),e.forEach(function(t,e){t.index=100*e})}},{key:"children",value:function(t){var e=[],n=!0,r=!1,o=void 0;try{for(var i,a=vr[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=yr(i.value,2),c=(u[0],u[1]);c.parentId===t&&(e[e.length]=c)}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return e}},{key:"hasFile",value:function(t){return br.has(t)}},{key:"getFile",value:function(t){return br.get(t)||t}},{key:"createUrl",value:function(t){var e,n=URL.createObjectURL(t);return(e=t,new Promise(function(t){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsDataURL(e)})).then(function(t){br.set(n,t)}),n}},{key:"revokeUrl",value:function(t){br.delete(t)&&URL.revokeObjectURL(t)}},{key:"projects",get:function(){return this.filter("project")}},{key:"artboards",get:function(){return this.filter("artboard")}},{key:"layers",get:function(){return this.filter("layer")}},{key:"all",get:function(){return vr}}])&&hr(e.prototype,n),r&&hr(e,r),t}());function wr(t){return(wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:[];this.$store=new kn({modules:[].concat(kr(this.getModuleList()),kr(t))}),mr.setStore(this.$store),this.$container=new je(this.getContainer()),this.$container.addClass(this.getClassName()),this.render(this.$container),this.initializeEvent(),this.initBodyMoves()}},{key:"initBodyMoves",value:function(){this.moves=new Set,this.ends=new Set,this.modifyBodyMoveSecond(10)}},{key:"modifyBodyMoveSecond",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;mr.config.set("body.move.ms",t),this.funcBodyMoves=k(this.loopBodyMoves.bind(this),mr.config.get("body.move.ms"))}},{key:Jn("modifyBodyMoveSeconds"),value:function(t){this.modifyBodyMoveSecond(t)}},{key:"loopBodyMoves",value:function(){var t=mr.config.get("oldPos"),e=mr.config.get("pos");(t.x!=e.x||t.y!=e.y)&&this.moves.size&&this.moves.forEach(function(t){var n=e.x-t.xy.x,r=e.y-t.xy.y;0==n&&0==r||t.func.call(t.context,n,r)}),requestAnimationFrame(this.funcBodyMoves)}},{key:"removeBodyMoves",value:function(){var t=mr.config.get("pos");this.ends.forEach(function(e){e.func.call(e.context,t.x-e.xy.x,t.y-e.xy.y)}),this.moves.clear(),this.ends.clear()}},{key:Jn("add/body/mousemove"),value:function(t,e,n){this.moves.add({func:t,context:e,xy:n})}},{key:Jn("add/body/mouseup"),value:function(t,e,n){this.ends.add({func:t,context:e,xy:n})}},{key:"getModuleList",value:function(){return t.modules||[]}},{key:"getClassName",value:function(){return t.className||"csseditor"}},{key:"getContainer",value:function(){return t.container||document.body}},{key:"template",value:function(){return"
".concat(t.template,"
")}},{key:"components",value:function(){return t.components||{}}},{key:Ze("document"),value:function(t){var e=mr.config.get("pos")||xr,n=t.xy||xr;this.bodyMoved=!(e.x==n.x&&e.y==n.y),mr.config.set("bodyEvent",t),mr.config.set("pos",n),mr.config.set("oldPos",e),this.requestId||(this.requestId=requestAnimationFrame(this.funcBodyMoves))}},{key:Qe("document"),value:function(t){var e=t.xy||xr;mr.config.set("bodyEvent",t),mr.config.set("pos",e),this.removeBodyMoves(),this.requestId=null}}])&&Or(r.prototype,o),i&&Or(r,i),n}())(t)},_r={App:v,Color:ae,HueColor:ce,ColorNames:Dt};function Er(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"/";return Object.getOwnPropertyNames(this.__proto__).filter(function(e){return e.startsWith(t)})}},{key:"get",value:function(t){return this.$store.items[t]||{}}},{key:"set",value:function(t,e){this.$store.items[t]=e}},{key:"config",value:function(t,e){return isUndefined(this.$store.tool[t])?e:this.$store.tool[t]}},{key:"initConfig",value:function(t,e){this.$store.tool[t]=e}}])&&Er(e.prototype,n),r&&Er(e,r),t}();function Tr(t){return(Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ir(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[];t.currentColorSets.colors=e,t.emit("changeCurrentColorSets")}},{key:mn("removeCurrentColor"),value:function(t,e){t.currentColorSets.colors[e]&&(t.currentColorSets.colors.splice(e,1),t.emit("changeCurrentColorSets"))}},{key:mn("removeCurrentColorToTheRight"),value:function(t,e){t.currentColorSets.colors[e]&&(t.currentColorSets.colors.splice(e,Number.MAX_VALUE),t.emit("changeCurrentColorSets"))}},{key:mn("clearPalette"),value:function(t){t.currentColorSets.colors&&(t.currentColorSets.colors=[],t.emit("changeCurrentColorSets"))}},{key:gn("list"),value:function(t){return Array.isArray(t.userList)&&t.userList.length?t.userList:t.colorSetsList}},{key:gn("getCurrentColors"),value:function(t){return t.read("getColors",t.currentColorSets)}},{key:gn("getColors"),value:function(t,e){return e.scale?ae.scale(e.scale,e.count):e.colors||[]}},{key:gn("getColorSetsList"),value:function(t){return t.read("list").map(function(e){return{name:e.name,edit:e.edit,colors:t.read("getColors",e)}})}}])&&Ir(n.prototype,r),o&&Ir(n,o),e}();function Mr(t){return(Mr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fr(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[];this.$body=null,this.$root=null,this.$store=new kn({modules:[Ur,Vr].concat(Wr(e))}),this.callbackChange=function(){t.callbackChangeValue()},this.colorpickerShowCallback=function(){},this.colorpickerHideCallback=function(){},this.$body=new je(this.getContainer()),this.$root=new je("div","codemirror-colorpicker"),"inline"==this.opt.position&&this.$body.append(this.$root),this.opt.type&&this.$root.addClass(this.opt.type),this.opt.hideInformation&&this.$root.addClass("hide-information"),this.opt.hideColorsets&&this.$root.addClass("hide-colorsets"),this.opt.width&&this.$root.css("width",this.opt.width),this.$arrow=new je("div","arrow"),this.$root.append(this.$arrow),this.dispatch("setUserPalette",this.opt.colorSets),this.render(this.$root),this.initColorWithoutChangeEvent(this.opt.color),this.initializeEvent()}},{key:"initColorWithoutChangeEvent",value:function(t){this.dispatch("initColor",t)}},{key:"show",value:function(t,e,n,r){this.colorpickerShowCallback=n,this.colorpickerHideCallback=r,this.$root.css(this.getInitalizePosition()).show(),this.definePosition(t),this.isColorPickerShow=!0,this.isShortCut=t.isShortCut||!1,this.outputFormat=t.outputFormat,this.hideDelay=+P(t.hideDelay,2e3),this.hideDelay>0&&this.setHideDelay(this.hideDelay),this.$root.appendTo(this.$body),this.initColorWithoutChangeEvent(e)}},{key:"initColor",value:function(t,e){this.dispatch("changeColor",t,e)}},{key:"hide",value:function(){this.isColorPickerShow&&(this.$root.hide(),this.$root.remove(),this.isColorPickerShow=!1,this.callbackHideValue())}},{key:"setColorsInPalette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.dispatch("setCurrentColorAll",t)}},{key:"setUserPalette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.dispatch("setUserPalette",t)}},{key:"getOption",value:function(t){return this.opt[t]}},{key:"setOption",value:function(t,e){this.opt[t]=e}},{key:"getContainer",value:function(){return this.opt.container||document.body}},{key:"getColor",value:function(t){return this.read("toColor",t)}},{key:"definePositionForArrow",value:function(t,e,n){}},{key:"definePosition",value:function(t){var e=this.$root.width(),n=this.$root.height(),r=t.left-this.$body.scrollLeft();e+r>window.innerWidth&&(r-=e+r-window.innerWidth),r<0&&(r=0);var o=t.top-this.$body.scrollTop();n+o>window.innerHeight&&(o-=n+o-window.innerHeight),o<0&&(o=0),this.$root.css({left:me.px(r),top:me.px(o)})}},{key:"getInitalizePosition",value:function(){return"inline"==this.opt.position?{position:"relative",left:"auto",top:"auto",display:"inline-block"}:{position:"absolute"==this.opt.position?"absolute":"fixed",left:me.px(-1e4),top:me.px(-1e4)}}},{key:"setHideDelay",value:function(t){var e=this;t=t||0;var n=this.hide.bind(this);this.$root.off("mouseenter"),this.$root.off("mouseleave"),this.$root.on("mouseenter",function(){clearTimeout(e.timerCloseColorPicker)}),this.$root.on("mouseleave",function(){clearTimeout(e.timerCloseColorPicker),e.timerCloseColorPicker=setTimeout(n,t)}),clearTimeout(this.timerCloseColorPicker)}},{key:"callbackChangeValue",value:function(t){t=t||this.getCurrentColor(),I(this.opt.onChange)&&this.opt.onChange.call(this,t),I(this.colorpickerShowCallback)&&this.colorpickerShowCallback(t)}},{key:"callbackHideValue",value:function(t){t=t||this.getCurrentColor(),I(this.opt.onHide)&&this.opt.onHide.call(this,t),I(this.colorpickerHideCallback)&&this.colorpickerHideCallback(t)}},{key:"getCurrentColor",value:function(){return this.read("toColor",this.outputFormat)}},{key:"checkColorPickerClass",value:function(t){var e=new je(t),n=e.closest("codemirror-colorview"),r=e.closest("codemirror-colorpicker"),o=e.closest("CodeMirror");t.nodeName;return!!(r||n||o)}},{key:"checkInHtml",value:function(t){return"HTML"==t.nodeName}},{key:"initializeStoreEvent",value:function(){Zr(Qr(e.prototype),"initializeStoreEvent",this).call(this),this.$store.on("changeColor",this.callbackChange,this),this.$store.on("changeFormat",this.callbackChange,this)}},{key:"destroy",value:function(){Zr(Qr(e.prototype),"destroy",this).call(this),this.$store.off("changeColor",this.callbackChange),this.$store.off("changeFormat",this.callbackChange),this.callbackChange=void 0,this.colorpickerShowCallback=void 0,this.colorpickerHideCallback=void 0}},{key:Fe("document"),value:function(t){this.checkInHtml(t.target)||0==this.checkColorPickerClass(t.target)&&this.hide()}}])&&qr(n.prototype,r),o&&qr(n,o),e}();function no(t){return(no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ro(t,e){for(var n=0;nr?100:(t-n)/(r-n)*100}},{key:"getCalculatedDist",value:function(t){var e=t?this.getMousePosition(t):this.getCurrent(this.getDefaultValue()/this.maxValue);return this.getDist(e)}},{key:"getDefaultValue",value:function(){return 0}},{key:"setMousePosition",value:function(t){this.refs.$bar.css({left:me.px(t)})}},{key:"getMousePosition",value:function(t){return fn.pos(t).pageX}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(t){(t=t||this.getDefaultValue())<=this.minValue?this.refs.$bar.addClass("first").removeClass("last"):t>=this.maxValue?this.refs.$bar.addClass("last").removeClass("first"):this.refs.$bar.removeClass("last").removeClass("first"),this.setMousePosition(this.getMaxDist()*((t||0)/this.maxValue))}}])&&so(n.prototype,r),o&&so(n,o),e}();function vo(t){return(vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bo(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:"setBackgroundColor",value:function(){this.refs.$container.css("background-color",this.read("toRGB"))}},{key:"refresh",value:function(){mo(wo(e.prototype),"refresh",this).call(this),this.setBackgroundColor()}},{key:"getDefaultValue",value:function(){return this.$store.hsv.v}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({type:"hsv",v:e/100*this.maxValue})}}])&&bo(n.prototype,r),o&&bo(n,o),e}();function So(t){return(So="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Po(t,e){for(var n=0;n\n
\n
\n
\n
\n \n '}},{key:"refresh",value:function(){Co(_o(e.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=function(t){for(var e=1;e'}},{key:"setBackgroundColor",value:function(){this.refs.$el.css("background-color",this.read("toRGB"))}},{key:"refresh",value:function(){this.setBackgroundColor()}},{key:Jn("changeColor","initColor"),value:function(){this.refresh()}}])&&Ro(n.prototype,r),o&&Ro(n,o),e}();function Ao(t){return(Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vo(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Mo(t,e){for(var n=0;n\n \n
\n
\n \n '}},{key:"refresh",value:function(t){this.setColorUI(t)}},{key:"setColorUI",value:function(t){this.renderCanvas(),this.renderValue(),this.setHueColor(null,t)}},{key:"renderValue",value:function(){var t=1-this.$store.hsv.v;this.refs.$valuewheel.css("background-color","rgba(0, 0, 0, ".concat(t,")"))}},{key:"renderWheel",value:function(t,e){this.width&&!t&&(t=this.width),this.height&&!e&&(e=this.height);var n=new je("canvas"),r=n.el.getContext("2d");n.el.width=t,n.el.height=e,n.px("width",t),n.px("height",e);for(var o=r.getImageData(0,0,t,e),i=o.data,a=Math.floor(t/2),u=Math.floor(e/2),c=t>e?u:a,s=a,l=u,f=0;f0&&(r.globalCompositeOperation="destination-out",r.fillStyle="black",r.beginPath(),r.arc(s,l,c-this.thinkness,0,2*Math.PI),r.closePath(),r.fill()),n}},{key:"renderCanvas",value:function(){if(!this.$store.createdWheelCanvas){var t=this.refs.$colorwheel,e=t.el.getContext("2d"),n=Vo(t.size(),2),r=n[0],o=n[1];this.width&&!r&&(r=this.width),this.height&&!o&&(o=this.height),t.el.width=r,t.el.height=o,t.px("width",r),t.px("height",o);var i=this.renderWheel(r,o);e.drawImage(i.el,0,0),this.$store.createdWheelCanvas=!0}}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"getDefaultSaturation",value:function(){return this.$store.hsv.s}},{key:"getCurrentXY",value:function(t,e,n,r,o){return t?t.xy:tt(e,n,r,o)}},{key:"getRectangle",value:function(){var t=this.$el.width(),e=this.$el.height(),n=this.refs.$colorwheel.width()/2,r=this.$el.offsetLeft(),o=r+t/2,i=this.$el.offsetTop();return{minX:r,minY:i,width:t,height:e,radius:n,centerX:o,centerY:i+e/2}}},{key:"setHueColor",value:function(t,e){var n=this.getRectangle(),r=n.minX,o=n.minY,i=n.radius,a=n.centerX,u=n.centerY,c=this.getCurrentXY(t,this.getDefaultValue(),this.getDefaultSaturation()*i,a,u),s=(h=c.x)-a,l=(v=c.y)-u,f=s*s+l*l,p=nt(s,l);if(f>i*i)var y=this.getCurrentXY(null,p,i,a,u),h=y.x,v=y.y;var d=Math.min(Math.sqrt(f)/i,1);this.refs.$drag_pointer.px("left",h-r),this.refs.$drag_pointer.px("top",v-o),e||this.changeColor({type:"hsv",h:p,s:d})}},{key:"changeColor",value:function(t){this.dispatch("changeColor",t||{})}},{key:Jn("changeColor"),value:function(){this.refresh(!0)}},{key:Jn("initColor"),value:function(){this.refresh(!0)}},{key:Qe("document"),value:function(t){this.isDown=!1}},{key:Ze("document"),value:function(t){this.isDown&&this.setHueColor(t)}},{key:Je("$drag_pointer"),value:function(t){t.preventDefault(),this.isDown=!0}},{key:Je(),value:function(t){this.isDown=!0,this.setHueColor(t)}}])&&Mo(n.prototype,r),o&&Mo(n,o),e}();function Xo(t){return(Xo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yo(t,e){for(var n=0;n\n
\n \n
\n
\n
\n \n
HEX
\n
\n
\n
\n
\n \n
R
\n
\n
\n \n
G
\n
\n
\n \n
B
\n
\n
\n \n
A
\n
\n
\n
\n
\n \n
H
\n
\n
\n \n
%
\n
S
\n
\n
\n \n
%
\n
L
\n
\n
\n \n
A
\n
\n
\n \n '}},{key:"setCurrentFormat",value:function(t){this.format=t,this.initFormat()}},{key:"initFormat",value:function(){var t=this.format||"hex";this.$el.removeClass("hex"),this.$el.removeClass("rgb"),this.$el.removeClass("hsl"),this.$el.addClass(t)}},{key:"nextFormat",value:function(){var t=this.format||"hex",e="hex";"hex"==t?e="rgb":"rgb"==t?e="hsl":"hsl"==t&&(e=1==this.$store.alpha?"hex":"rgb"),this.$el.removeClass(t),this.$el.addClass(e),this.format=e,this.dispatch("changeFormat",this.format)}},{key:"getFormat",value:function(){return this.format||"hex"}},{key:"checkNumberKey",value:function(t){return fn.checkNumberKey(t)}},{key:"checkNotNumberKey",value:function(t){return!fn.checkNumberKey(t)}},{key:"changeRgbColor",value:function(){this.dispatch("changeColor",{type:"rgb",r:this.refs.$rgb_r.int(),g:this.refs.$rgb_g.int(),b:this.refs.$rgb_b.int(),a:this.refs.$rgb_a.float()})}},{key:"changeHslColor",value:function(){this.dispatch("changeColor",{type:"hsl",h:this.refs.$hsl_h.int(),s:this.refs.$hsl_s.int(),l:this.refs.$hsl_l.int(),a:this.refs.$hsl_a.float()})}},{key:Jn("changeColor","initColor"),value:function(){this.refresh()}},{key:Ke("$rgb_r"),value:function(t){this.changeRgbColor()}},{key:Ke("$rgb_g"),value:function(t){this.changeRgbColor()}},{key:Ke("$rgb_b"),value:function(t){this.changeRgbColor()}},{key:Ke("$rgb_a"),value:function(t){this.changeRgbColor()}},{key:Ke("$hsl_h"),value:function(t){this.changeHslColor()}},{key:Ke("$hsl_s"),value:function(t){this.changeHslColor()}},{key:Ke("$hsl_l"),value:function(t){this.changeHslColor()}},{key:Ke("$hsl_a"),value:function(t){this.changeHslColor()}},{key:Le("$hexCode"),value:function(t){if(t.which<65||t.which>70)return this.checkNumberKey(t)}},{key:He("$hexCode"),value:function(t){var e=this.refs.$hexCode.val();"#"==e.charAt(0)&&7==e.length&&this.dispatch("changeColor",e)}},{key:Me("$formatChangeButton"),value:function(t){this.nextFormat()}},{key:"setRGBInput",value:function(){this.refs.$rgb_r.val(this.$store.rgb.r),this.refs.$rgb_g.val(this.$store.rgb.g),this.refs.$rgb_b.val(this.$store.rgb.b),this.refs.$rgb_a.val(this.$store.alpha)}},{key:"setHSLInput",value:function(){this.refs.$hsl_h.val(this.$store.hsl.h),this.refs.$hsl_s.val(this.$store.hsl.s),this.refs.$hsl_l.val(this.$store.hsl.l),this.refs.$hsl_a.val(this.$store.alpha)}},{key:"setHexInput",value:function(){this.refs.$hexCode.val(this.read("toHEX"))}},{key:"refresh",value:function(){this.setCurrentFormat(this.$store.format),this.setRGBInput(),this.setHSLInput(),this.setHexInput()}}])&&Yo(n.prototype,r),o&&Yo(n,o),e}();function Jo(t){return(Jo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zo(){var t=ti(['\n
\n

','

\n
\n
\n ',"\n
\n
\n
"]);return Zo=function(){return t},t}function Qo(){var t=ti(["\n
\n ","\n
\n "]);return Qo=function(){return t},t}function ti(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function ei(t,e){for(var n=0;n\n
\n
\n

Color Palettes

\n ×\n
\n
\n
\n '}},{key:Jn("changeCurrentColorSets"),value:function(){this.refresh()}},{key:Jn("toggleColorChooser"),value:function(){this.toggle()}},{key:cn("$colorsetsList"),value:function(){var t=this.read("getColorSetsList");return H(Qo(),t.map(function(t,e){return H(Zo(),e,t.name,t.colors.filter(function(t,e){return e<5}).map(function(t){return'
\n
\n
')}))}))}},{key:"show",value:function(){this.$el.addClass("open")}},{key:"hide",value:function(){this.$el.removeClass("open")}},{key:"toggle",value:function(){this.$el.toggleClass("open")}},{key:Me("$toggleButton"),value:function(t){this.toggle()}},{key:Me("$colorsetsList .colorsets-item"),value:function(t,e){if(e){var n=parseInt(e.attr("data-colorsets-index"));this.dispatch("setCurrentColorSets",n),this.hide()}}},{key:"destroy",value:function(){ri(oi(e.prototype),"destroy",this).call(this),this.hide()}}])&&ei(n.prototype,r),o&&ei(n,o),e}();function ui(t){return(ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ci(){var t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['
\n '," \n "," \n
"]);return ci=function(){return t},t}function si(t,e){for(var n=0;n\n \n
\n \n '}},{key:cn("$colorSetsColorList"),value:function(){var t=this.read("getCurrentColorSets"),e=this.read("getCurrentColors");return H(ci(),e.map(function(t,e){return'
\n
\n
\n
')}),t.edit?'
+
':d)}},{key:"addColor",value:function(t){this.dispatch("addCurrentColor",t),this.refresh()}},{key:Jn("changeCurrentColorSets"),value:function(){this.refresh()}},{key:Jn("initColor"),value:function(){this.refresh()}},{key:Me("$colorSetsChooseButton"),value:function(t){this.emit("toggleColorChooser")}},{key:Ye("$colorSetsColorList"),value:function(t){if(t.preventDefault(),this.read("getCurrentColorSets").edit){var e=new je(t.target).closest("color-item");if(e){var n=parseInt(e.attr("data-index"));this.emit("showContextMenu",t,n)}else this.emit("showContextMenu",t)}}},{key:Me("$colorSetsColorList .add-color-item"),value:function(t){this.addColor(this.read("toColor"))}},{key:Me("$colorSetsColorList .color-item"),value:function(t,e){this.dispatch("changeColor",e.attr("data-color"))}}])&&si(n.prototype,r),o&&si(n,o),e}();function hi(t){return(hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vi(t,e){for(var n=0;n\n \n \n \n \n '}},{key:"show",value:function(t,e){var n=fn.pos(t);this.$el.px("top",n.clientY-10),this.$el.px("left",n.clientX),this.$el.addClass("show"),this.selectedColorIndex=e,x(this.selectedColorIndex)?this.$el.addClass("small"):this.$el.removeClass("small")}},{key:"hide",value:function(){this.$el.removeClass("show")}},{key:"runCommand",value:function(t){switch(t){case"remove-color":this.dispatch("removeCurrentColor",this.selectedColorIndex);break;case"remove-all-to-the-right":this.dispatch("removeCurrentColorToTheRight",this.selectedColorIndex);break;case"clear-palette":this.dispatch("clearPalette")}}},{key:Jn("showContextMenu"),value:function(t,e){this.show(t,e)}},{key:Me("$el .menu-item"),value:function(t,e){t.preventDefault(),this.runCommand(e.attr("data-type")),this.hide()}}])&&vi(n.prototype,r),o&&vi(n,o),e}();function wi(t){return(wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ki(t,e){for(var n=0;n\n \n
\n \n \n
\n \n
\n \n \n \n \n \n '}},{key:"components",value:function(){return{Value:Oo,Opacity:$o,ColorView:zo,ColorWheel:Go,Information:qo,CurrentColorSets:yi,ColorSetsChooser:ai,ContextMenu:mi}}}])&&ki(n.prototype,r),o&&ki(n,o),e}();function xi(t){return(xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ci(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({h:e/100*this.maxValue,type:"hsv"})}}])&&Ci(n.prototype,r),o&&Ci(n,o),e}();function Ii(t){return(Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bi(t,e){for(var n=0;n\n
\n
\n
\n
\n
\n \n '}},{key:"setBackgroundColor",value:function(t){this.$el.css("background-color",t)}},{key:"refresh",value:function(){this.setColorUI()}},{key:"calculateSV",value:function(){var t=this.drag_pointer_pos||{x:0,y:0},e=this.$el.width(),n=this.$el.height(),r=t.x/e,o=(n-t.y)/n;this.dispatch("changeColor",{type:"hsv",s:r,v:o})}},{key:"setColorUI",value:function(){var t=this.$el.width()*this.$store.hsv.s,e=this.$el.height()*(1-this.$store.hsv.v);this.refs.$drag_pointer.px("left",t),this.refs.$drag_pointer.px("top",e),this.drag_pointer_pos={x:t,y:e},this.setBackgroundColor(this.read("getHueColor"))}},{key:"setMainColor",value:function(t){var e=this.$el.offset(),n=this.$el.contentWidth(),r=this.$el.contentHeight(),o=fn.pos(t).pageX-e.left,i=fn.pos(t).pageY-e.top;o<0?o=0:o>n&&(o=n),i<0?i=0:i>r&&(i=r),this.refs.$drag_pointer.px("left",o),this.refs.$drag_pointer.px("top",i),this.drag_pointer_pos={x:o,y:i},this.calculateSV()}},{key:Jn("changeColor","initColor"),value:function(){this.refresh()}},{key:Qe("document"),value:function(t){this.isDown=!1}},{key:Ze("document"),value:function(t){this.isDown&&this.setMainColor(t)}},{key:Je(),value:function(t){this.isDown=!0,this.setMainColor(t)}},{key:Qe(),value:function(t){this.isDown=!1}}])&&Bi(n.prototype,r),o&&Bi(n,o),e}();function Mi(t){return(Mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fi(t,e){for(var n=0;n\n \n
\n \n \n
\n \n
\n \n \n \n \n '}},{key:"components",value:function(){return{Hue:Ri,Opacity:$o,ColorView:zo,Palette:Vi,Information:qo,CurrentColorSets:yi,ColorSetsChooser:ai,ContextMenu:mi}}}])&&Fi(n.prototype,r),o&&Fi(n,o),e}();function Xi(t){return(Xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yi(t,e){for(var n=0;n\n \n
\n \n \n
\n \n "}},{key:"components",value:function(){return{Hue:Ri,Opacity:$o,Palette:Vi}}}])&&Yi(n.prototype,r),o&&Yi(n,o),e}();function Ji(t){return(Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zi(t,e){for(var n=0;n=this.maxValue?this.refs.$bar.addClass("last").removeClass("first"):this.refs.$bar.removeClass("last").removeClass("first");var e=1-(t||0)/this.maxValue;this.setMousePosition(this.getMaxDist()*e)}}])&&Zi(n.prototype,r),o&&Zi(n,o),e}();function ra(t){return(ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oa(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({h:e/100*this.maxValue,type:"hsv"})}}])&&oa(n.prototype,r),o&&oa(n,o),e}();function la(t){return(la="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fa(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pa(t,e){for(var n=0;n\n
\n
\n
\n
\n \n '}},{key:"refresh",value:function(){ha(va(e.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=function(t){for(var e=1;e\n
\n \n "}},{key:"components",value:function(){return{Hue:sa,Opacity:ba,Palette:Vi}}}])&&ma(n.prototype,r),o&&ma(n,o),e}();function ja(t){return(ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pa(t,e){for(var n=0;n\n \n
\n '}},{key:"setColorUI",value:function(t){this.renderCanvas(),this.setHueColor(null,t)}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"setHueColor",value:function(t,e){var n=this.getRectangle(),r=n.minX,o=n.minY,i=n.radius,a=n.centerX,u=n.centerY,c=this.getCurrentXY(t,this.getDefaultValue(),i,a,u),s=nt((f=c.x)-a,(p=c.y)-u),l=this.getCurrentXY(null,s,i-this.half_thinkness,a,u),f=l.x,p=l.y;this.refs.$drag_pointer.px("left",f-r),this.refs.$drag_pointer.px("top",p-o),e||this.changeColor({type:"hsv",h:s})}}])&&Pa(n.prototype,r),o&&Pa(n,o),e}();function Ta(t){return(Ta="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ra(t,e){for(var n=0;n\n \n \n
\n \n \n
\n \n
\n \n \n \n \n \n '}},{key:"components",value:function(){return{Value:Oo,Opacity:$o,ColorView:zo,ColorRing:$a,Palette:Vi,Information:qo,CurrentColorSets:yi,ColorSetsChooser:ai,ContextMenu:mi}}}])&&Ra(n.prototype,r),o&&Ra(n,o),e}();function Aa(t){return(Aa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Va(t,e){for(var n=0;n\n \n
\n \n \n
\n \n \n \n \n \n "}},{key:"components",value:function(){return{Hue:sa,Opacity:ba,Palette:Vi,Information:qo,CurrentColorSets:yi,ColorSetsChooser:ai,ContextMenu:mi}}}])&&Va(n.prototype,r),o&&Va(n,o),e}();function Na(t){return(Na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ga(t,e){for(var n=0;n\n
\n
\n
".concat(this.opt.tabTitle,' Color
\n
Swatch
\n
Color Set
\n
\n
\n
\n \n \n
\n \n \n
\n \n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n ')}},{key:Me("$tabHeader .color-tab-item"),value:function(t,e){if(!e.hasClass("active")){var n;(n=this.refs.$tabHeader.$(".active"))&&n.removeClass("active"),e.addClass("active"),(n=this.refs.$tabBody.$(".active"))&&n.removeClass("active");var r=this.refs.$tabBody.$("[item-id='".concat(e.attr("item-id"),"']"));r&&r.addClass("active")}}},{key:"components",value:function(){return{Value:Oo,Opacity:$o,ColorView:zo,ColorRing:$a,Palette:Vi,Information:qo,CurrentColorSets:yi,ColorSetsChooser:ai,ContextMenu:mi}}}])&&Ga(n.prototype,r),o&&Ga(n,o),e}();function Wa(t){return(Wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qa(t,e){for(var n=0;n\n
\n
\n
".concat(this.opt.tabTitle,' Color
\n
Swatch
\n
Color Set
\n
\n
\n
\n \n
\n \n \n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n\n
\n ')}},{key:Me("$tabHeader .color-tab-item"),value:function(t,e){if(!e.hasClass("active")){var n;(n=this.refs.$tabHeader.$(".active"))&&n.removeClass("active"),e.addClass("active"),(n=this.refs.$tabBody.$(".active"))&&n.removeClass("active");var r=this.refs.$tabBody.$("[item-id='".concat(e.attr("item-id"),"']"));r&&r.addClass("active")}}},{key:"components",value:function(){return{Hue:sa,Opacity:ba,Palette:Vi,Information:qo,CurrentColorSets:yi,ColorSetsChooser:ai,ContextMenu:mi}}}])&&qa(n.prototype,r),o&&qa(n,o),e}(),eu={create:function(t){switch(t.type){case"macos":return new Pi(t);case"xd":return new Ha(t);case"xd-tab":return new tu(t);case"ring":return new za(t);case"ring-tab":return new Ka(t);case"mini":return new qi(t);case"mini-vertical":return new Sa(t);case"sketch":case"palette":default:return new Gi(t)}},ColorPicker:Gi,ChromeDevToolColorPicker:Gi,MacOSColorPicker:Pi,RingColorPicker:za,MiniColorPicker:qi,MiniVerticalColorPicker:Sa,XDColorPicker:Ha};function nu(t){return(nu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ru(t,e){for(var n=0;nthis.screenX2.value)&&!(t.y.value>this.screenY2.value)))))}},{key:"toBoundCSS",value:function(){return{top:"".concat(this.json.y),left:"".concat(this.json.x),width:"".concat(this.json.width),height:"".concat(this.json.height)}}},{key:"screenX",get:function(){return this.json.x}},{key:"screenY",get:function(){return this.json.y}},{key:"screenX2",get:function(){return me.px(this.screenX.value+this.json.width.value)}},{key:"screenY2",get:function(){return me.px(this.screenY.value+this.json.height.value)}},{key:"screenWidth",get:function(){return this.json.width}},{key:"screenHeight",get:function(){return this.json.height}},{key:"screenRect",get:function(){return{left:this.screenX,top:this.screenY,width:this.screenWidth,height:this.screenHeight}}},{key:"centerX",get:function(){var t=0;return 0!=this.json.width.value&&(t=Math.floor(this.json.width.value/2)),me.px(this.screenX.value+t)}},{key:"centerY",get:function(){var t=0;return 0!=this.json.height.value&&(t=Math.floor(this.json.height.value/2)),me.px(this.screenY.value+t)}},{key:"selected",get:function(){return mr.selection.check(this.id)}},{key:"selectedOne",get:function(){return mr.selection.checkOne(this.id)}}])&&ru(n.prototype,r),o&&ru(n,o),e}();function cu(t){return(cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function su(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return yu(hu(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];return $u(Tu(e.prototype),"getDefaultObject",this).call(this,{itemType:"display",type:"block",direction:"row",alignItems:"normal",alignCentent:"normal",flexWrap:"nowrap",justifyContent:"flex-start",gap:me.px(0),rowGap:me.percent(1),columnGap:me.percent(1),columns:[me.fr(1)],rows:[me.fr(1)],areas:[]})}},{key:"toCSS",value:function(){var t=this.json,e={display:t.type};return"flex"==e.display?("row"!=t.direction&&(e["flex-direction"]=t.direction),"normal"!=t.alignItems&&(e["align-items"]=t.alignItems),"normal"!=t.alignContent&&(e["align-content"]=t.alignContent),"nowrap"!=t.flexWrap&&(e["flex-wrap"]=t.flexWrap),"flex-start"!=t.justifyContent&&(e["justify-content"]=t.justifyContent)):"grid"==e.display&&(t.gap.value>0&&(e["grid-gap"]=t.gap),t.rowGap.value>0&&(e["grid-row-gap"]=t.rowGap),t.columnGap.value>0&&(e["grid-column-gap"]=t.columnGap),t.columns.length&&(e["grid-template-columns"]=t.columns.join(b)),t.rows.length&&(e["grid-template-rows"]=t.rows.join(b)),t.areas.length&&(e["grid-template-areas"]=t.areas.map(function(t){return'"'.concat(t.join(b),'"')}).join(b)),"normal"!=t.alignItems&&(e["align-items"]=t.alignItems),"normal"!=t.alignContent&&(e["align-content"]=t.alignContent),"flex-start"!=t.justifyContent&&(e["justify-content"]=t.justifyContent)),e}},{key:"isLayout",value:function(){return this.isGrid()||this.isFlex()}},{key:"isFlex",value:function(){return"flex"==this.json.type}},{key:"isGrid",value:function(){return"grid"==this.json.type}},{key:"isInline",value:function(){return"inline"==this.json.type}},{key:"isInlineBlock",value:function(){return"inline-block"==this.json.type}},{key:"isBlock",value:function(){return"block"==this.json.type}},{key:"changeColumn",value:function(t,e){var n=this.json.columns[t],r=this.json.columns[e];this.json.columns[e]=n,this.json.columns[t]=r}},{key:"removeColumn",value:function(t){this.json.columns.splice(t,1)}},{key:"updateColumn",value:function(t,e){this.json.columns[t]=e}},{key:"changeRow",value:function(t,e){var n=this.json.rows[t],r=this.json.rows[e];this.json.rows[e]=n,this.json.rows[t]=r}},{key:"removeRow",value:function(t){this.json.rows.splice(t,1)}},{key:"updateRow",value:function(t,e){this.json.rows[t]=e}}])&&_u(n.prototype,r),o&&_u(n,o),e}();function Bu(t){return(Bu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Du(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Xu(Yu(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;ee.index?1:-1:t.percent>e.percent?1:-1}),t.forEach(function(t,e){t.index=100*e})}},{key:"select",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;e&&t.forEach(function(t){t.selected=t.id===e}),t.filter(function(t){return t.selected}).length||t[0]&&(t[0].selected=!0)}},{key:"parse",value:function(t){var n=[],r=Lt(t),o=r.str.split(b).filter(function(t){return t.trim()}),i=+o[0].replace("@",""),a=r.matches[i].color;if(1===o.length)n.push(new e({color:a,unit:"%",percent:0}));else if(2===o.length){var u=me.parse(o[1]),c={unit:u.unit};u.isPercent()?c.percent=u.value:u.isPx()?c.px=u.value:u.isEm()&&(c.em=u.value),n.push(new e(qu({color:a},c)))}else 3===o.length&&[1,2].forEach(function(t){var r=me.parse(o[t]),i={unit:r.unit};r.isPercent()?i.percent=r.value:r.isPx()?i.px=r.value:r.isEm()&&(i.em=r.value),n.push(new e(qu({color:a},i)))});return n}}],(r=[{key:"getDefaultObject",value:function(){return tc(ec(e.prototype),"getDefaultObject",this).call(this,{cut:!1,percent:0,unit:"%",px:0,em:0,color:"rgba(0, 0, 0, 0)",prevColorStep:null})}},{key:"on",value:function(){this.json.cut=!0}},{key:"off",value:function(){this.json.cut=!1}},{key:"toggle",value:function(){this.json.cut=!this.json.cut}},{key:"changeUnit",value:function(t,e,n){this.json.unit=t,this.json[t]=e,this.reset(this.getUnitValue(n))}},{key:"getUnit",value:function(){return"%"==this.json.unit?"percent":this.json.unit}},{key:"getUnitValue",value:function(t){return this.isPX?{px:this.json.px,percent:+me.px(this.json.px).toPercent(t),em:+me.px(this.json.px).toEm(t)}:this.isEm?{em:this.json.em,percent:+me.em(this.json.em).toPercent(t),px:+me.em(this.json.em).toPx(t)}:{percent:this.json.percent,px:+me.percent(this.json.percent).toPx(t),em:+me.percent(this.json.percent).toEm(t)}}},{key:"add",value:function(t){var e=this.getUnit();return this.json[e]+=+t,this}},{key:"sub",value:function(t){var e=this.getUnit();return this.json[e]-=+t,this}},{key:"mul",value:function(t){var e=this.getUnit();return this.json[e]*=+t,this}},{key:"div",value:function(t){var e=this.getUnit();return this.json[e]/=+t,this}},{key:"mod",value:function(t){var e=this.getUnit();return this.json[e]%=+t,this}},{key:"toLength",value:function(t){return me.parse(this.json)}},{key:"getPrevLength",value:function(){return this.json.prevColorStep?this.json.prevColorStep.toLength():d}},{key:"toString",value:function(){return"".concat(this.json.color," ").concat(this.json.cut?this.getPrevLength():d," ").concat(this.toLength())}},{key:"reset",value:function(t){tc(ec(e.prototype),"reset",this).call(this,t),this.parent()&&this.parent().sortColorStep()}},{key:"isPx",get:function(){return"px"==this.json.unit}},{key:"isPercent",get:function(){return"%"==this.json.unit||"percent"===this.json.unit}},{key:"isEm",get:function(){return"em"==this.json.unit}}])&&Zu(n.prototype,r),o&&Zu(n,o),e}();function oc(t){return(oc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ic(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ac(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return cc(sc(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e1&&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;(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).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:"getColorString",value:function(){var t=this.colorsteps;return t.length?t.map(function(e,n){return e.prevColorStep=e.cut&&n>0?t[n-1]:null,e}).map(function(t){return"".concat(t)}).join(","):d}},{key:"colorsteps",get:function(){return this.json.colorsteps}}])&&ac(n.prototype,r),o&&ac(n,o),e}();function yc(t){return(yc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"transparent";return new e({colorsteps:[new rc({color:t,percent:0,index:0})]})}}],(r=[{key:"getDefaultObject",value:function(){return dc(bc(e.prototype),"getDefaultObject",this).call(this,{type:"static-gradient",static:!0,colorsteps:[new rc({color:"red",percent:0,index:0})]})}},{key:"toString",value:function(){var t=this.json.colorsteps[0].color;return"linear-gradient(to right, ".concat(t,", ").concat(t,")")}},{key:"isStatic",value:function(){return!0}}])&&hc(n.prototype,r),o&&hc(n,o),e}();function wc(t){return(wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return xc(Cc(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0],e=this.json;return"url(".concat(t?mr.getFile(e.url):e.url,")")}}],[{key:"isImageFile",value:function(t){return $c.includes(t)}}]),e}();function Rc(t){return(Rc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ic(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e360?e%360:e,"deg")),"".concat(this.json.type,"(").concat(e,", ").concat(t,")")}}])&&Dc(n.prototype,r),o&&Dc(n,o),e}();function Nc(t){return(Nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return ns(rs(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return ks(Os(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;ee.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=d;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(",")):d}},{key:"toString",value:function(){var t=this.getColorString(),e=[],n=this.json,r=n.angle,o=n.radialPosition||be.CENTER;o=Ps[o]?o:o.join(b),C(r)&&(r=+(xs[r]||r),e.push("from ".concat(r,"deg"))),o&&e.push("at ".concat(o));var i=e.length?e.join(b)+",":d;return"".concat(n.type,"(").concat(i," ").concat(t,")")}}])&&ms(n.prototype,r),o&&ms(n,o),e}();function _s(t){return(_s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Es(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];if(!this.json.image)return{};var e=this.json.image.toString(t);return{"border-image-source":"".concat(e)}}},{key:"toBorderImageRepeatCSS",value:function(){return this.json.repeat?{"border-image-repeat":"".concat(this.json.repeat)}:{}}},{key:"toBorderImageWidthCSS",value:function(){var t=this;if(!this.json.width)return{};if(0===Object.keys(this.json.width).filter(function(e){return t.json.width[e].value>0}).length)return{};var e=Object.keys(this.json.width).map(function(e){return t.json.width[e].toString()}).join(b);return{"border-image-width":"".concat(e)}}},{key:"toBorderImageSliceCSS",value:function(){var t=this;if(!this.json.slice)return{};var e=Object.keys(this.json.slice).map(function(e){var n=t.json.slice[e];return n.isPercent()?n.toString():n.value}).join(b);return{"border-image-slice":"".concat(e)}}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return zs({},this.toBorderImageCSS(t),this.toBorderImageRepeatCSS(),this.toBorderImageSliceCSS(),this.toBorderImageWidthCSS())}},{key:"toString",value:function(){return S(this.toCSS(),function(t,e){return"".concat(t,": ").concat(e)}).join(";")}},{key:"image",get:function(){return this.json.image},set:function(t){this.json.image=t}}])&&Vs(n.prototype,r),o&&Vs(n,o),e}();function Gs(t){return(Gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xs(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return this.addProperty(al({checked:!0,value:me.px(0)},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],al({},e))}},{key:"updatePropertyByKey",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=-1,r=0,o=this.json.properties.length;re.offset.value?1:-1}),H(wl(),this.json.name,e.map(function(e){return 0===e.properties.length?d:H(ml(),e.offset.toString(),e.properties.map(function(e){if(t.isMultiStyle(e.key))return t.getMultiStyleString(e);var n=e.value.toString();return n?"".concat(e.key,": ").concat(n,";"):d}).join(d),"\n\n")}),"\n\n")}},{key:"createOffset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addOffset(new yl(function(t){for(var e=1;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()}}])&&Ol(n.prototype,r),o&&Ol(n,o),e}();function _l(t){return(_l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function El(t,e){for(var n=0;n0&&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)}}])&&El(n.prototype,r),o&&El(n,o),e}(),Dl={scatter:'',transform:'',gradient:'',close:'',build:'',code:'',autorenew:'',play:'',pause:'',filter:'',input:'',timer:'',title:'',paint:'',border_all:'',border_inner:'',check:'',arrowRight:'',screen:'',repeat:'',remove2:'',setting:'',image:'\n',artboard:'',folder:'',publish:'',add_note:'',add:'',save:'\n',export:'',redo:'',undo:'',lock:'',remove:'',copy:'\n',visible:'\n',add_box:'\n',create_folder:'\n \n',chevron_right:'\n \n',chevron_left:''};function zl(t){return(zl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Al(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Vl(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return Nl(Gl(e.prototype),"getDefaultObject",this).call(this,Ml({width:me.px(300),height:me.px(400),rootVariable:"",variable:"",transform:"",filter:"","backdrop-filter":"","background-color":"","background-image":"","border-radius":"","box-shadow":"","text-shadow":"","clip-path":"",color:"","font-size":"","line-height":"","text-align":"","text-transform":"","text-decoration":"","letter-spacing":"","word-spacing":"","text-indent":"","perspective-origin":"","transform-origin":"",perspective:"","mix-blend-mode":"",opacity:"",border:{},outline:{},borderRadius:{},borderImage:new Ns,applyBorderImage:!1,animations:[],transitions:[],keyframes:[],selectors:[],svg:[],content:""},t))}},{key:"convert",value:function(t){return(t=Nl(Gl(e.prototype),"convert",this).call(this,t)).width=me.parse(t.width),t.height=me.parse(t.height),t.display&&(t.display=Iu.parse(t.display)),t}},{key:"addAnimation",value:function(t){return this.json.animations.push(t),t}},{key:"addTransition",value:function(t){return this.json.transitions.push(t),t}},{key:"addKeyframe",value:function(t){return this.json.keyframes.push(t),t}},{key:"addSelector",value:function(t){return this.json.selectors.push(t),t}},{key:"createAnimation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addAnimation(new qs(Ml({checked:!0},t)))}},{key:"createKeyframe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addKeyframe(new Cl(Ml({checked:!0},t)))}},{key:"createSelector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSelector(new Bl(Ml({checked:!0},t)))}},{key:"createTransition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addTransition(new rl(Ml({checked:!0},t)))}},{key:"removePropertyList",value:function(t,e){t.splice(e,1)}},{key:"removeAnimation",value:function(t){this.removePropertyList(this.json.animations,t)}},{key:"removeKeyframe",value:function(t){this.removePropertyList(this.json.keyframes,t)}},{key:"removeSelector",value:function(t){this.removePropertyList(this.json.selectors,t)}},{key:"removeTransition",value:function(t){this.removePropertyList(this.json.transitions,t)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.animations[+t].reset(e)}},{key:"updateTransition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.transitions[+t].reset(e)}},{key:"updateKeyframe",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.keyframes[+t].reset(e)}},{key:"updateSelector",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.selectors[+t].reset(e)}},{key:"setSize",value:function(t){this.reset(t)}},{key:"setBorder",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=this.json.border;if("all"===t)n?this.json.border={all:n}:["top","right","bottom","left"].forEach(function(t){delete e.json.border[t]});else{if(r.all&&x(n)){var o=Ml({},r.all);r.top=Ml({},o),r.bottom=Ml({},o),r.left=Ml({},o),r.right=Ml({},o)}r.all&&delete r.all,n&&(this.json.border[t]=n)}}},{key:"setOutline",value:function(t){this.json.outline=Ml({},this.json.outline,t)}},{key:"setBorderRadius",value:function(t,e){this.json.borderRadius=e}},{key:"setBorderImageOffset",value:function(t,e){this.json.borderImageOffset=e}},{key:"setBorderImage",value:function(t){this.json.borderImage=t}},{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:"toPropertyCSS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={};return t.forEach(function(t){O(t.toCSS(e),function(t,e){n[t]||(n[t]=[]),n[t].push(e)})}),A(n)}},{key:"toStringPropertyCSS",value:function(t){var e={};return this.json[t].split(";").forEach(function(t){var n=Al(t.split(":").map(function(t){return t.trim()}),2),r=n[0],o=n[1];e[r]=o}),e}},{key:"toBackgroundImageCSS",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.toStringPropertyCSS("background-image")}},{key:"getBorderString",value:function(t){return"".concat(t.width," ").concat(t.style," ").concat(t.color)}},{key:"toSizeCSS",value:function(){return{width:this.json.width,height:this.json.height}}},{key:"toBorderCSS",value:function(){var t=this,e={},n=this.json.border;return n.all?e={border:this.getBorderString(n.all)}:O(n,function(n,r){e["border-".concat(n)]=t.getBorderString(r)}),e}},{key:"toOutlineCSS",value:function(){var t=this.json.outline;return t?0===Object.keys(t).length?{}:{outline:"".concat(t.color," ").concat(t.style," ").concat(t.width)}:{}}},{key:"toBorderRadiusCSS",value:function(){return this.toStringPropertyCSS("border-radius")}},{key:"toBorderImageCSS",value:function(){return this.json.borderImage&&this.json.applyBorderImage?this.json.borderImage.toCSS():{}}},{key:"toKeyCSS",value:function(t){return this.json[t]?Fl({},t,this.json[t]):{}}},{key:"toFilterCSS",value:function(){return this.toKeyCSS("filter")}},{key:"toPerspectiveOriginCSS",value:function(){return this.toKeyCSS("perspective-origin")}},{key:"toClipPathCSS",value:function(){return this.toKeyCSS("clip-path")}},{key:"toTransformCSS",value:function(){return this.toKeyCSS("transform")}},{key:"toBackdropFilterCSS",value:function(){return this.toKeyCSS("backdrop-filter")}},{key:"toBoxShadowCSS",value:function(){return this.toKeyCSS("box-shadow")}},{key:"toTextShadowCSS",value:function(){return this.toKeyCSS("text-shadow")}},{key:"toAnimationCSS",value:function(){return this.toPropertyCSS(this.json.animations)}},{key:"toTransitionCSS",value:function(){return this.toPropertyCSS(this.json.transitions)}},{key:"toString",value:function(){return gu(this.toCSS())}},{key:"toExport",value:function(){return gu(this.toCSS(!0))}},{key:"toBoxModelCSS",value:function(){var t=this.json,e={};return t["margin-top"]&&(e["margin-top"]=t["margin-top"]),t["margin-bottom"]&&(e["margin-bottom"]=t["margin-bottom"]),t["margin-left"]&&(e["margin-left"]=t["margin-left"]),t["margin-right"]&&(e["margin-right"]=t["margin-right"]),t["padding-top"]&&(e["padding-top"]=t["padding-top"]),t["padding-bottom"]&&(e["padding-bottom"]=t["padding-bottom"]),t["padding-left"]&&(e["padding-left"]=t["padding-left"]),t["padding-right"]&&(e["padding-right"]=t["padding-right"]),e}},{key:"toKeyListCSS",value:function(){for(var t=this.json,e={},n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]&&arguments[0];return this.toKeyListCSS("background-color","color","opacity","mix-blend-mode","transform-origin","perspective","perspective-origin")}},{key:"toVariableCSS",value:function(){var t={};return this.json.variable.split(";").filter(function(t){return t.trim()}).forEach(function(e){var n=Al(e.split(":"),2),r=n[0],o=n[1];t["--".concat(r)]=o}),t}},{key:"toRootVariableCSS",value:function(){var t={};return this.json.rootVariable.split(";").filter(function(t){return t.trim()}).forEach(function(e){var n=Al(e.split(":"),2),r=n[0],o=n[1];t["--".concat(r)]=o}),t}},{key:"toRootVariableString",value:function(){return gu(this.toRootVariableCSS())}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return bu(Ml({},this.toVariableCSS(),this.toDefaultCSS(t),this.toFontCSS(),this.toBoxModelCSS(),this.toSizeCSS(),this.toBorderCSS(),this.toOutlineCSS(),this.toBorderRadiusCSS(),this.toBorderImageCSS(),this.toAnimationCSS(),this.toClipPathCSS(),this.toFilterCSS(),this.toTransformCSS(),this.toBackdropFilterCSS(),this.toBackgroundImageCSS(t),this.toBoxShadowCSS(),this.toTextShadowCSS(),this.toAnimationCSS(),this.toTransitionCSS()))}},{key:"toEmbedCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e={content:this.json.content};return bu(Ml({},this.toVariableCSS(),e,this.toDefaultCSS(),this.toFontCSS(),this.toBoxModelCSS(),this.toSizeCSS(),this.toBorderCSS(),this.toOutlineCSS(),this.toBorderRadiusCSS(),this.toBorderImageCSS(),this.toAnimationCSS(),this.toTransitionCSS(),this.toClipPathCSS(),this.toFilterCSS(),this.toTransformCSS(),this.toBackdropFilterCSS(),this.toBackgroundImageCSS(t),this.toBoxShadowCSS(),this.toTextShadowCSS()))}},{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:"toSelectorString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.json.selectors.map(function(e){return e.toString(t)}).join("\n\n")}},{key:"toSVGString",value:function(){var t=this;return this.json.svg.map(function(e){if("filter"===e.type)return"\n <".concat(e.type," id='").concat(e.name,"'>\n ").concat(e.value.join("\n"),"\n ");if("clip-path"===e.type){var n=function(){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?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=new je("div").html(t).$("svg");if(!o)return{paths:"",transform:""};var i=o.html(),a=me.parse(o.attr("width")),u=me.parse(o.attr("height")),c="";if(e){var s=n.value/a.value,l=r.value/u.value;c='transform="scale('.concat(s," ").concat(l,')"')}return{paths:i,transform:c}}(Dl[e.value.icon],e.value.fit,t.json.width,t.json.height);return"\n \n ").concat(n.paths,"\n ")}}).join("\n\n")}},{key:"generateEmbed",value:function(){return{css:this.toEmbedCSS(),keyframeString:this.toKeyframeString(),rootVariable:this.toRootVariableCSS(),content:this.json.content,SVGString:this.toSVGString(),selectorString:this.toSelectorString()}}},{key:"generateView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{css:this.toCSS(),keyframeString:this.toKeyframeString(),rootVariable:this.toRootVariableCSS(),content:this.json.content,SVGString:this.toSVGString(),selectorString:this.toSelectorString(t)}}}])&&Ll(n.prototype,r),o&&Ll(n,o),e}();function Ul(t){return(Ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Wl(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Jl(Zl(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e0&&void 0!==arguments[0]&&arguments[0];return this.json.image?{"background-image":this.json.image.toString(t)}:{}}},{key:"toBackgroundPositionCSS",value:function(){var t=this.json;return{"background-position":"".concat(t.x," ").concat(t.y)}}},{key:"toBackgroundSizeCSS",value:function(){var t=this.json,e="auto";return"contain"==t.size||"cover"==t.size?e=t.size:t.width.isPercent()&&t.width.isPercent()&&100==+t.width&&100==+t.height||(e="".concat(t.width," ").concat(t.height)),{"background-size":e}}},{key:"toBackgroundRepeatCSS",value:function(){return{"background-repeat":this.json.repeat}}},{key:"toBackgroundBlendCSS",value:function(){return{"background-blend-mode":this.json.blendMode}}},{key:"toCSS",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return ff({},this.toBackgroundImageCSS(t),this.toBackgroundPositionCSS(),this.toBackgroundSizeCSS(),this.toBackgroundRepeatCSS(),this.toBackgroundBlendCSS())}},{key:"toString",value:function(){return S(this.toCSS(),function(t,e){return"".concat(t,": ").concat(e)}).join(";")}},{key:"toBackgroundCSS",value:function(){var t=this.toCSS();return{background:"".concat(t["background-image"]," ")}}},{key:"image",get:function(){return this.json.image},set:function(t){this.json.image=t}}])&&yf(n.prototype,r),o&&yf(n,o),e}();function wf(t){return(wf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Of(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jf(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Cf(_f(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return op(ip(e.prototype),"getDefaultObject",this).call(this,function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};this.style=t}},{key:"parseSize",value:function(){var t=this.getStyle(),e={};return t.width&&(e.width=me.parse(t.width)),t.height&&(e.height=me.parse(t.height)),e}},{key:"parseColor",value:function(){var t=this.getStyle();return{color:t.color||"black",backgroundColor:t["background-color"]||"white"}}},{key:"parseBorder",value:function(){var t=this.getStyle(),e={};t.border?e={border:{width:me.parse(t.borderWidth),style:t.borderStyle,color:t.borderColor},borderTop:null,borderLeft:null,borderRight:null,borderBottom:null}:(e.border=null,["border-top","border-right","border-left","border-bottom"].forEach(function(n){t[n]?e[n]={width:me.parse(t["".concat(n,"-width")]),style:t["".concat(n,"-style")],color:t["".concat(n,"-color")]}:e[n]=null}));var n={};return O(e,function(t,e){e&&(n[t]=e)}),n}},{key:"parseOutline",value:function(){var t={};if((r=this.getStyle()).outline){var e=Lt(r.outline),n=null,r="",o="";return e.str.split(b).forEach(function(t){t.indexOf("@")>-1?n=Nt(t,e.matches):fp.test(t)?r=t:(o=me.parse(t)).includes("thick","thin","medium")&&("thick"===o.value?o=me.px(5):"thin"===o.value?o=me.px(1):"medium"===o.value&&(o=me.px(3)))}),o&&(t.width=o),r&&(t.style=r),n&&(t.color=n),t}e={};return O(t,function(t,n){n&&(e[t]=n)}),e}},{key:"filterStyle",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n\n
\n
\n
\n \n \n \n "}},{key:Jn("setParser"),value:function(t){this.parser=t(this)}},{key:"parseEnd",value:function(t){var e=this.styleParser.parse(t);this.modifyArtBoard(e),this.emit(pn)}},{key:"modifyArtBoard",value:function(t){var e=mr.selection.current;e&&e.reset(t)}},{key:"generate",value:function(t){var e=t.css,n=t.keyframeString,r=t.rootVariable,o=t.content,i=t.SVGString,a=t.selectorString;this.refs.$canvas.text()!=o&&this.refs.$canvas.text(o),this.refs.$style.html("\n :root {\n ".concat(gu(r),"\n }\n\n /* element */\n .csseditor .page-canvas { \n ").concat(gu(e),"; \n } \n\n ").concat(a,"\n\n /* keyframe */\n ").concat(n,"\n ")),this.refs.$svg.html(i),this.refs.$lock.css({width:e.width,height:e.height});var u=Object.keys(e).filter(function(t){return!t.includes("--")});this.trigger("refreshComputedStyle",u)}},{key:Jn("refreshComputedStyle")+rn(100),value:function(t){var e,n=(e=this.refs.$canvas).getComputedStyle.apply(e,hp(t));this.emit("refreshComputedStyleCode",n)}},{key:"generateStyle",value:function(){var t=mr.selection.current;t&&(this.props.embed?this.parser.generate(t.generateEmbed()):this.generate(t.generateView(".csseditor .page-canvas")))}},{key:Jn("refreshCanvas")+rn(10),value:function(){this.generateStyle()}},{key:Me(),value:function(){this.emit(pn)}}])&&vp(n.prototype,r),o&&vp(n,o),e}();function kp(t){return(kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Op(t,e){for(var n=0;n\n
').concat(this.getIconString(),'
\n
').concat(this.getTitle(),"
\n \n ")}},{key:"clickButton",value:function(t){}},{key:"getChecked",value:function(){return!1}},{key:"getTitle",value:function(){return xp}},{key:"getIcon",value:function(){return Cp}},{key:"getIconString",value:function(){return Cp}},{key:Me(),value:function(t){this.clickButton(t)}}])&&Op(n.prototype,r),o&&Op(n,o),e}();function Ep(t){return(Ep="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $p(t,e){for(var n=0;n\n \n \n \n '}},{key:qe(),value:function(){var t=mr.selection.current;return t&&this.refs.$codepen.val(JSON.stringify({html:'\n
\n '.concat(t.toSVGString()?'\n \n '.concat(t.toSVGString(),"\n \n "):"","\n "),css:this.generate(t)})),!1}},{key:"generate",value:function(t){var e=t.toCSS(),n=t.toKeyframeString(),r=t.toRootVariableCSS(),o=t.toSelectorString("#sample");return"\n:root {\n ".concat(gu(r),"\n}\n\n/* element */\n#sample { \n").concat(S(e,function(t,e){return t?" ".concat(t,": ").concat(e,"; ").concat("\n"):""}).join(d),"\n} \n\n").concat(o,"\n\n").concat(n?"/* keyframe */\n".concat(n):"")}}])&&zp(n.prototype,r),o&&zp(n,o),e}();function Lp(t){return(Lp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hp(t,e){for(var n=0;n\n \n \n \n \n \n \n \n '}},{key:qe(),value:function(){var t=mr.selection.current;return t&&(this.refs.$title.val("Gradient - easylogic.studio"),this.refs.$description.val("https://gradient.easylogic.studio"),this.refs.$html.val('\n
\n \n '.concat(t.toSVGString(),"\n \n ")),this.refs.$css.val(this.generate(t))),!1}},{key:"generate",value:function(t){var e=t.toCSS(),n=t.toKeyframeString(),r=t.toRootVariableCSS(),o=t.toSelectorString("#sample");return":root {\n ".concat(gu(r),"\n}\n\n/* element */\n#sample { \n").concat(S(e,function(t,e){return" ".concat(t,": ").concat(e,"; ").concat("\n")}).join(d),"\n} \n\n").concat(o,"\n\n/* keyframe */\n").concat(n,"\n ")}}])&&Hp(n.prototype,r),o&&Hp(n,o),e}(),ExportCodePen:Fp,Github:Bp};function Up(t){return(Up="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kp(t,e){for(var n=0;n\n
\n \n
\n
\n \n \n \n
\n \n "}}])&&Kp(n.prototype,r),o&&Kp(n,o),e}();function Qp(t){return(Qp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ey(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n
\n \n
\n \n
\n
\n
\n \n ")}},{key:"getColorStepList",value:function(t){switch(t.type){case"static-gradient":case"linear-gradient":case"repeating-linear-gradient":case"radial-gradient":case"repeating-radial-gradient":case"conic-gradient":case"repeating-conic-gradient":return this.getColorStepString(t.colorsteps)}return d}},{key:"getColorStepString",value:function(t){return t.map(function(t,e){return"
")}).join(d)}},{key:cn("$fillList"),value:function(){var t=this;return this.state.images.map(function(e,n){var r=e.image,o=cy[r.type],i=uy[r.type],a="background-image: ".concat(r.toString(),"; background-size: cover;"),u=e.selected?"selected":"";return e.selected&&(t.selectedIndex=n),"\n
\n
\n
\n
\n
\n
\n
\n
\n
').concat(i,"
\n
\n ').concat(t.getColorStepList(r),"\n
\n
\n \n
\n
\n
\n
').concat(e.width,"/").concat(e.height,'
\n
').concat(e.repeat,"
\n
').concat(e.blendMode,"
\n
\n
\n
\n ")})}},{key:"toPropertyCSS",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={};return t.forEach(function(t){O(t.toCSS(e),function(t,e){n[t]||(n[t]=[]),n[t].push(e)})}),A(n)}},{key:"modifyBackgroundImage",value:function(){var t=gu(this.toPropertyCSS(this.state.images));this.parent.trigger(this.props.onchange,t)}},{key:Me("$add"),value:function(){this.state.images.push(new mf),this.refresh(),this.modifyBackgroundImage()}},{key:"getFillData",value:function(t){var e={type:t.type};switch(e.type){case"image":e.url=t.image?t.image.url:"";break;default:if(t.image){var n=t.image;e.type=n.type,e.colorsteps=ey(n.colorsteps),e.angle=n.angle,e.radialType=n.radialType||"ellipse",e.radialPosition=n.radialPosition||be.CENTER}else e.colorsteps=[],e.angle=0,e.radialType="ellipse",e.radialPosition=be.CENTER}return e}},{key:Me("$fillList .colorsteps .step"),value:function(t){this.getRef("colorsteps",this.selectedIndex).$('[data-selected="true"]').removeAttr("data-selected"),t.$delegateTarget.attr("data-selected",!0);var e=t.$delegateTarget.attr("data-index"),n=t.$delegateTarget.closest("fill-item").$(".preview");this.viewFillPicker(n,e)}},{key:Ne("$fillList .fill-item"),value:function(t){this.startIndex=+t.$delegateTarget.attr("data-index")}},{key:Xe("$fillList .fill-item")+un,value:function(t){}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1])||arguments[1]?this.refs["fillIndex".concat(t)].addClass("selected"):this.refs["fillIndex".concat(t)].removeClass("selected"),this.state.images.forEach(function(e,n){e.selected=n===t})}},{key:"viewFillPicker",value:function(t,e){"number"==typeof this.selectedIndex&&this.selectItem(this.selectedIndex,!1),this.selectedIndex=+t.attr("data-index"),this.selectItem(this.selectedIndex,!0),this.currentBackgroundImage=this.getCurrentBackgroundImage(),this.emit("showFillPicker",{changeEvent:"changeBackgroundImageEditor",image:this.currentBackgroundImage.image,selectColorStepIndex:e,refresh:!0,isImageHidden:!0}),this.viewBackgroundPropertyPopup()}},{key:"viewBackgroundPropertyPopup",value:function(t){this.currentBackgroundImage=this.getCurrentBackgroundImage();var e=this.currentBackgroundImage,n=e.x,r=e.y,o=e.width,i=e.height,a=e.repeat,u=e.size,c=e.blendMode;this.emit("showBackgroundPropertyPopup",{changeEvent:"changeBackgroundImageEditorProperty",position:t,x:n,y:r,width:o,height:i,repeat:a,size:u,blendMode:c})}},{key:Me("$fillList .preview"),value:function(t){this.viewFillPicker(t.$delegateTarget)}},{key:"viewChangeImage",value:function(t){var e,n=this.currentBackgroundImage;n&&((e=this.getRef("miniView",this.selectedIndex))&&e.css(function(t){for(var e=1;e\n
\n \n
\n \n
\n
\n
\n \n ")}},{key:cn("$shadowList"),value:function(){var t=this.state.boxShadows.map(function(t,e){return'\n
\n
').concat(Dl.check,'
\n
\n
\n
\n
\n
').concat(t.offsetX.toString(),'
\n
').concat(t.offsetY.toString(),'
\n
').concat(t.blurRadius.toString(),'
\n
').concat(t.spreadRadius.toString(),'
\n
\n \n
\n
\n ")});return t.length&&t.push('\n
\n
Inset
\n
\n
X
\n
Y
\n
Blur
\n
Spread
\n
\n
\n
\n '),t.join(d)}},{key:Jn(vn,hn,pn),value:function(){this.refresh()}},{key:"modifyBoxShadow",value:function(){var t=this.state.boxShadows.join(", ");this.parent.trigger(this.props.onchange,t)}},{key:Me("$add"),value:function(){this.state.boxShadows.push(new cf),this.refresh(),this.modifyBoxShadow()}},{key:Me("$shadowList .remove"),value:function(t){var e=+t.$delegateTarget.attr("data-index");this.state.boxShadows.splice(e,1),this.refresh(),this.modifyBoxShadow()}},{key:Me("$shadowList .shadow-item.real .color"),value:function(t){var e=+t.$delegateTarget.attr("data-index"),n=this.state.boxShadows[e];this.viewShadowPopup(n,e)}},{key:"viewShadowPopup",value:function(t,e){this.selectedIndex=e,this.emit("showColorPicker",{changeEvent:"changeBoxShadowEditorColor",color:t.color,hasNotHide:!0}),this.viewBoxShadowPropertyPopup(t)}},{key:"viewBoxShadowPropertyPopup",value:function(t){this.emit("showBoxShadowPropertyPopup",{changeEvent:"changeBoxShadowEditorPopup",inset:t.inset,offsetX:t.offsetX,offsetY:t.offsetY,blurRadius:t.blurRadius,spreadRadius:t.spreadRadius})}},{key:Jn("changeBoxShadowEditorColor"),value:function(t){this.state.boxShadows[this.selectedIndex].reset({color:t}),this.refresh(),this.modifyBoxShadow()}},{key:Jn("changeBoxShadowEditorPopup"),value:function(t){this.state.boxShadows[this.selectedIndex].reset(t),this.refresh(),this.modifyBoxShadow()}}])&&fy(n.prototype,r),o&&fy(n,o),e}();function dy(t){return(dy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function by(t,e){for(var n=0;n\n ").concat(t?""):d,"\n \n \n ")}},{key:"getValue",value:function(){return this.refs.$options.value}},{key:ln("$options"),value:function(){return{"data-count":this.state.options.length.toString()}}},{key:cn("$options"),value:function(){var t=this;return this.state.options.map(function(e){var n=e===t.state.value?"selected":"",r=e,o=e;return""===o?o="< none-value >":"-"===o&&(o="----------",r=""),"")})}},{key:Ue("$options"),value:function(){this.updateData({value:this.refs.$options.value})}},{key:"updateData",value:function(t){this.setState(t),this.parent.trigger(this.props.onchange,this.props.key,this.state.value,this.props.params)}}])&&by(n.prototype,r),o&&by(n,o),e}();function Oy(t){return(Oy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sy(){var t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(["\n
\n ","\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n \n \n
\n
\n \n
\n "]);return Sy=function(){return t},t}function jy(t,e){for(var n=0;n"}},{key:cn("$body"),value:function(){var t=this.state,e=t.min,n=t.max,r=t.step,o=t.label,i=t.calc,a=t.type,u=t.removable,c=t.layout,s=+this.state.value.value.toString();isNaN(s)&&(s=0);var l=o?"has-label":d,f=i?"has-calc":d,p=u?"is-removable":d,y=c,h=(+s).toString();return H(Sy(),l,f,p,y,a,o?""):d,Dl.autorenew,h,e,n,r,h,e,n,r,this.state.selectedUnit||this.state.value.unit,this.state.units,this.state.value.unit,this.state.value.toString(),Dl.close)}},{key:"getValue",value:function(){return this.state.value}},{key:"setValue",value:function(t){this.setState({value:me.parse(t)})}},{key:Me("$toggleType"),value:function(t){var e="calc"===this.state.type?"range":"calc";n="";if("calc"===e)n=me.calc(this.refs.$calc.value);else{var n=this.getRef("$propertyNumber").value,r=this.children.$unit.getValue();n=new me(n,r)}this.updateData({type:e,value:n}),this.refs.$range.attr("data-selected-type",e)}},{key:Me("$remove"),value:function(t){this.updateData({value:""})}},{key:Ke("$calc"),value:function(){this.updateData({value:new me(this.refs.$calc.value,this.children.$varType.getValue())})}},{key:"updateData",value:function(t){this.setState(t,!1),this.parent.trigger(this.props.onchange,this.props.key,this.state.value,this.props.params)}},{key:"updateCalc",value:function(){this.refs.$calc.val(this.state.value)}},{key:Ke("$propertyNumber"),value:function(t){var e=+this.getRef("$propertyNumber").value;this.getRef("$property").val(e),this.updateData({value:this.state.value.set(e)}),this.updateCalc()}},{key:Ke("$property"),value:function(t){var e=+this.getRef("$property").value;this.getRef("$propertyNumber").val(e),""===this.state.value&&(this.state.value=new me(0,this.children.$unit.getValue())),this.updateData({value:this.state.value.set(e)}),this.updateCalc()}},{key:Jn("changeUnit"),value:function(t,e){this.updateData({value:this.state.value.toUnit(e)}),this.updateCalc()}},{key:Jn("changeVarType"),value:function(t,e){this.updateData({value:new me(this.refs.$calc.value,e)})}}])&&jy(n.prototype,r),o&&jy(n,o),e}();function Ey(t){return(Ey="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $y(){var t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['\n
\n
\n \n \n
\n
\n \n
\n
\n