1var EasyLogicColorPicker=function(){"use strict";function h(t,e){var n=2<arguments.length&&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?r(t):"rgb"==e?i(t,n):"hsl"==e?o(t):t}function r(t){var e=(t=Array.isArray(t)?{r:t[0],g:t[1],b:t[2],a:t[3]}: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);t.b<16&&(r="0"+r);var i="";return t.a<1&&(i=(t=Math.floor(255*t.a)).toString(16),t<16&&(i="0"+i)),"#"+e+n+r+i}function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"rgba(0, 0, 0, 0)";if(void 0!==(t=Array.isArray(t)?{r:t[0],g:t[1],b:t[2],a:t[3]}:t))return 1==t.a||void 0===t.a?isNaN(t.r)?e:"rgb("+t.r+","+t.g+","+t.b+")":"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"}function o(t){return 1==(t=Array.isArray(t)?{r:t[0],g:t[1],b:t[2],a:t[3]}:t).a||void 0===t.a?"hsl("+t.h+","+t.s+"%,"+t.l+"%)":"hsla("+t.h+","+t.s+"%,"+t.l+"%,"+t.a+")"}var t={format:h,rgb:i,hsl:o,hex:r};function u(t,e){return e=void 0===e?1:e,Math.round(t*e)/e}function n(t){return t*Math.PI/180}function a(t){t=180*t/Math.PI;return t=t<0?360+t:t}function s(t,e){return(2<arguments.length&&void 0!==arguments[2]?arguments[2]:0)+e*Math.cos(n(t))}function l(t,e){return(2<arguments.length&&void 0!==arguments[2]?arguments[2]:0)+e*Math.sin(n(t))}function g(t,e){return a(Math.atan2(e,t))}var e={round:u,radianToDegree:a,degreeToRadian:n,getXInCircle:s,getYInCircle:l,caculateAngle:g},c={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
1)",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 f={isColorName:function(t){return!!c[t]},getColorByName:function(t){return c[t]}};function v(t,e,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function p(t,e,n){var r,i,o,a;return 1==arguments.length&&(t=(r=arguments[0]).h,e=r.s,n=r.l),t/=360,n/=100,0==(e/=100)?i=o=a=n:(i=v(e=2*n-(n=n<.5?n*(1+e):n+e-n*e),n,t+1/3),o=v(e,n,t),a=v(e,n,t-1/3)),{r:u(255*i),g:u(255*o),b:u(255*a)}}var d={HUEtoRGB:v,HSLtoHSV:function(t,e,n){var r;return 1==arguments.length&&(t=(r=arguments[0]).h,e=r.s,n=r.l),U((n=p(t,e,n)).r,n.g,n.b)},HSLtoRGB:p},y=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},m=function(t,e,n){return e&&$(t.prototype,e),n&&$(t,n),t};function $(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function b(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function k(t,e,n){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,e);if(void 0!==r){if("value"in r)return r.value;r=r.get;return void 0!==r?r.call(n):void 0}if(null!==(t=Object.getPrototypeOf(t)))return k(t,e,n)}function C(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var x=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},w=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},_=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);
1throw new TypeError("Invalid attempt to destructure non-iterable instance")},O=function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)},S=/(#(?:[\da-f]{3}){1,2}|#(?:[\da-f]{8})|rgb\((?:\s*\d{1,3},\s*){2}\d{1,3}\s*\)|rgba\((?:\s*\d{1,3},\s*){3}\d*\.?\d+\s*\)|hsl\(\s*\d{1,3}(?:,\s*\d{1,3}%){2}\s*\)|hsla\(\s*\d{1,3}(?:,\s*\d{1,3}%){2},\s*\d*\.?\d+\s*\)|([\w_\-]+))/gi;function P(n){var t=n.match(S),e=[];if(!t)return e;for(var r,i=0,o=t.length;i<o;i++)-1<t[i].indexOf("#")||-1<t[i].indexOf("rgb")||-1<t[i].indexOf("hsl")?e.push({color:t[i]}):(r=f.getColorByName(t[i]))&&e.push({color:t[i],nameColor:r});var a={next:0};return e.forEach(function(t){var e=n.indexOf(t.color,a.next);t.startIndex=e,t.endIndex=e+t.color.length,a.next=t.endIndex}),e}function j(n){var t=P(n);return t.forEach(function(t,e){n=n.replace(t.color,"@"+e)}),{str:n,matches:t}}function M(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:",",n=j(t);return n.str.split(e).map(function(t,e){return t=I(t),t=n.matches[e]?t.replace("@"+e,n.matches[e].color):t})}function E(n,t){return t.forEach(function(t,e){n=n.replace("@"+e,t.color)}),n}function I(t){return t.replace(/^\s+|\s+$/g,"")}function D(t){if("string"==typeof t){if(-1<(t=f.isColorName(t)?f.getColorByName(t):t).indexOf("rgb(")){for(var e=0,n=(i=t.replace("rgb(","").replace(")","").split(",")).length;e<n;e++)i[e]=parseInt(I(i[e]),10);var r={type:"rgb",r:i[0],g:i[1],b:i[2],a:1};return r=Object.assign(r,A(r))}if(-1<t.indexOf("rgba(")){for(e=0,n=(i=t.replace("rgba(","").replace(")","").split(",")).length;e<n;e++)i[e]=n-1==e?parseFloat(I(i[e])):parseInt(I(i[e]),10);r={type:"rgb",r:i[0],g:i[1],b:i[2],a:i[3]};return r=Object.assign(r,A(r))}if(-1<t.indexOf("hsl(")){for(e=0,n=(i=t.replace("hsl(","").replace(")","").split(",")).length;e<n;e++)i[e]=parseFloat(I(i[e]));r={type:"hsl",h:i[0],s:i[1],l:i[2],a:1};return r=Object.assign(r,p(r))}if(-1<t.indexOf("hsla(")){for(e=0,n=(i=t.replace("hsla(","").replace(")","").split(",")).length;e<n;e++)i[e]=n-1==e?parseFloat(I(i[e])):parseInt(I(i[e]),10);r={type:"hsl",h:i[0],s:i[1],l:i[2],a:i[3]};return r=Object.assign(r,p(r))}if(0==t.indexOf("#")){var i=[],o=1;if(3==(t=t.replace("#","")).length)for(e=0,n=t.length;e<n;e++){var a=t.substr(e,1);i.push(parseInt(a+a,16))}else if(8===t.length){for(e=0,n=t.length;e<n;e+=2)i.push(parseInt(t.substr(e,2),16));o=i.pop()/255}else for(e=0,n=t.length;e<n;e+=2)i.push(parseInt(t.substr(e,2),16));r={type:"hex",r:i[0],g:i[1],b:i[2],a:o};return r=Object.assign(r,A(r))}}else if("number"==typeof t){if(0<=t&&t<=16777215){r={type:"hex",r:(16711680&t)>>16,g:(65280&t)>>8,b:(255&t)>>0,a:1};return r=Object.assign(r,A(r))}if(0<=t&&t<=4294967295){r={type:"hex",r:(4278190080&t)>>24,g:(16711680&t)>>16,b:(65280&t)>>8,a:(255&t)/255};return r=Object.assign(r,A(r))}}return t}function T(n){var r,t=(n=(n="string"==typeof n?M(n):n).map(function(t){if("string"==typeof t){var e=j(t),n=I(e.str).split(" ");return n[1]?n[1].includes("%")?n[1]=parseFloat(n[1].replace(/%/,""))/100:n[1]=parseFloat(n[1]):n[1]="*",n[0]=E(n[0],e.matches),n}if(Array.isArray(t))return t[1]?"string"==typeof t[1]&&(t[1].includes("%")?t[1]=parseFloat(t[1].replace(/%/,""))/100:t[1]=+t[1]):t[1]="*",[].concat(O(t))})).filter(function(t){return"*"===t[1]}).length;return 0<t&&(r=(1-n.filter(function(t){return"*"!=t[1]&&1!=t[1]}).map(function(t){return t[1]}).reduce(function(t,e){return t+e},0))/t,n.forEach(function(t,e){"*"==t[1]&&0<e&&(n.length-1==e||(t[1]=r))})),n}var V={matches:P,convertMatches:j,convertMatchesArray:M,reverseMatches:E,parse:D,parseGradient:T,trim:I,color_regexp:S,color_split:","};function U(t,e,n){1==arguments.length&&(t=(o=arguments[0]).r,e=o.g,n=o.b);var r=t/255,i=e/255,o=n/255,t=Math.max(r,i,o),e=t-Math.min(r,i,o),n=0;0==e?n=0:t==r?n=(i-o)/e%6*60:t==i?n=60*((o-r)/e+2):t==o&&(n=60*((r-i)/e+4));return{h:n=n<0?360+n:n,s:0==t?0:e/t,v:t}}function A(t,e,n){1==arguments.length&&(t=(a=arguments[0]).r,e=a.g,n=a.b),t/=255,e/=255,n/=255;var r,i=Math.max(t,e,n),o=Math.min(t,e,n),a=(i+o)/2;if(i==o)r=l=0;else{var s=i-o,l=.5<a?s/(2-i-o):s/(i+o);switch(i){case t:r=(e-n)/s+(e<n?6:0);break;case e:r=(n-t)/s+2;break;case n:r=(t-e)/s+4}r/=6}return{h:u(360*r),s:u(100*l),l:u(100*a)}}function L(t){return{r:t,g:t,b:t}}function H(t,e,n){return Math.ceil(.2126*t+.7152*e+.0722*n)}function B(t,e,n){var r;1==arguments.length&&(t=(r=arguments[0]).r,e=r.g,n=r.b);e=H(t,e,n);return{y:e,cr:.713*(t-e),cb:.564*(n-e)}}function R(t,e){return 100*((1<arguments.length&&void 0!==e?e:.04045)<t?Math.pow((t+.055)/1.055,2.4):t/12.92)}function N(t,e,n){var r;1==arguments.length&&(t=(r=arguments[0]).r,e=r.g,n=r.b);e/=255,n/=255;return{x:.4124*(t=R(t=t/255))+.3576*(e=R(e))+.1805*(n=R(n)),y:.2126*t+.7152*e+.0722*n,z:.0193*t+.1192*e+.9505*n}}var F={RGBtoCMYK:function(t,e,n){1==arguments.length&&(t=(r=arguments[0]).r,e=r.g,n=r.b);var r=t/255,t=e/255,e=n/255,n=1-Math.max(r,t,e);return{c:(1-r-n)/(1-n),m:(1-t-n)/(1-n),y:(1-e-n)/(1-n),k:n}},RGBtoGray:function(t,e,n){var r;return 1==arguments.length&&(t=(r=arguments[0]).r,e=r.g,n=r.b),L(B(t,e,n).y)},RGBtoHSL:A,RGBtoHSV:U,RGBtoLAB:function(t,e,n){var r;return 1==arguments.length&&(t=(r=arguments[0]).r,e=r.g,n=r.b),XYZtoLAB(N(t,e,n))},RGBtoSimpleGray:function(t,e,n){var r;return 1==arguments.length&&(t=(r=arguments[0]).r,e=r.g,n=r.b),L(Math.ceil((t+e+n)/3))},RGBtoXYZ:N,RGBtoYCrCb:B,c:function(t,e,n){var r;return 1==arguments.length&&(t=(r=arguments[0]).r,e=r.g,n=r.b),L(90<(t+e+n)/3?0:255)},brightness:H,gray:L};var X={CMYKtoRGB:function(t,e,n,r){var i;return 1==arguments.length&&(t=(i=arguments[0]).c,e=i.m,n=i.y,r=i.k),{r:255*(1-t)*(1-r),g:255*(1-e)*(1-r),b:255*(1-n)*(1-r)}}};function Y(t){return.008856<Math.pow(t,3)?Math.pow(t,3):(t-16/116)/7.787}function G(t){return.0031308<t?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function z(t,e,n){1==arguments.length&&(t=(i=arguments[0]).x,e=i.y,n=i.z);var r=t/100,i=e/100,t=n/100,e=-.9689*r+1.8758*i+.0415*t,n=.0557*r+-.204*i+1.057*t,t=G(t=3.2406*r+-1.5372*i+-.4986*t),e=G(e),n=G(n);return{r:u(255*t),g:u(255*e),b:u(255*n)}}function q(t,e,n){var r;1==arguments.length&&(t=(r=arguments[0]).l,e=r.a,n=r.b);t=e/500+(e=(t+16)/116),n=e-n/200,e=Y(e);return{x:95.047*(t=Y(t)),y:100*e,z:108.883*(n=Y(n))}}var K={XYZtoRGB:z,LABtoRGB:function(t,e,n){var r;return 1==arguments.length&&(t=(r=arguments[0]).l,e=r.a,n=r.b),z(q(t,e,n))},LABtoXYZ:q};function W(t,e,n){1==arguments.length&&(t=(i=arguments[0]).h,e=i.s,n=i.v);var r=t,i=n;360<=r&&(r=0);t=e*i,n=t*(1-Math.abs(r/60%2-1)),e=i-t,i=[];
1return 0<=r&&r<60?i=[t,n,0]:60<=r&&r<120?i=[n,t,0]:120<=r&&r<180?i=[0,t,n]:180<=r&&r<240?i=[0,n,t]:240<=r&&r<300?i=[n,0,t]:300<=r&&r<360&&(i=[t,0,n]),{r:u(255*(i[0]+e)),g:u(255*(i[1]+e)),b:u(255*(i[2]+e))}}var J={HSVtoHSL:function(t,e,n){var r;return 1==arguments.length&&(t=(r=arguments[0]).h,e=r.s,n=r.v),A((n=W(t,e,n)).r,n.g,n.b)},HSVtoRGB:W};var Z={YCrCbtoRGB:function(t,e,n,r){1==arguments.length&&(t=(i=arguments[0]).y,e=i.cr,n=i.cb,r=(r=i.bit)||0);var i=t-.344*(n-r)-.714*(e-r),n=t+1.772*(n-r);return{r:Math.ceil(t+1.402*(e-r)),g:Math.ceil(i),b:Math.ceil(n)}}};function Q(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:.5,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"hex",n={r:u(t.r+(e.r-t.r)*n),g:u(t.g+(e.g-t.g)*n),b:u(t.b+(e.b-t.b)*n),a:u(t.a+(e.a-t.a)*n,100)};return h(n,n.a<1?"rgb":r)}function tt(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:5;if(!t)return[];for(var n=(t=(t="string"==typeof t?M(t):t)||[]).length,r=[],i=0;i<n-1;i++)for(var o=0;o<e;o++)r.push(et(t[i],t[i+1],o/e));return r}function et(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:.5,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"hex";return Q(D(t),D(e),n,r)}function nt(t){return t=D(t),(Math.round(299*t.r)+Math.round(587*t.g)+Math.round(114*t.b))/1e3}function rt(t){for(var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"h",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:9,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"rgb",i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:1,a=6<arguments.length&&void 0!==arguments[6]?arguments[6]:100,s=U(D(t)),l=(o-i)*a/n,u=[],c=1;c<=n;c++)s[e]=Math.abs((a-l*c)/a),u.push(h(W(s),r));return u}tt.parula=function(t){return tt(["#352a87","#0f5cdd","#00b5a6","#ffc337","#fdff00"],t)},tt.jet=function(t){return tt(["#00008f","#0020ff","#00ffff","#51ff77","#fdff00","#ff0000","#800000"],t)},tt.hsv=function(t){return tt(["#ff0000","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff","#ff0000"],t)},tt.hot=function(t){return tt(["#0b0000","#ff0000","#ffff00","#ffffff"],t)},tt.pink=function(t){return tt(["#1e0000","#bd7b7b","#e7e5b2","#ffffff"],t)},tt.bone=function(t){return tt(["#000000","#4a4a68","#a6c6c6","#ffffff"],t)},tt.copper=function(t){return tt(["#000000","#3d2618","#9d623e","#ffa167","#ffc77f"],t)};var it={interpolateRGB:Q,blend:et,mix:function(t,e){return et(t,e,2<arguments.length&&void 0!==arguments[2]?arguments[2]:.5,3<arguments.length&&void 0!==arguments[3]?arguments[3]:"hex")},scale:tt,contrast:nt,contrastColor:function(t){return 128<=nt(t)?"black":"white"},gradient:function(t){for(var e=[],n=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:10)-((t=T(t)).length-1),r=n,i=1,o=t.length;i<o;i++){var a=t[i-1][0],s=t[i][0],l=1==i?t[i][1]:t[i][1]-t[i-1][1],l=i==t.length-1?r:Math.floor(l*n),e=e.concat(tt([a,s],l),[s]);r-=l}return e},scaleHSV:rt,scaleH:function(t){return rt(t,"h",1<arguments.length&&void 0!==arguments[1]?arguments[1]:9,2<arguments.length&&void 0!==arguments[2]?arguments[2]:"rgb",3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,4<arguments.length&&void 0!==arguments[4]?arguments[4]:360,1)},scaleS:function(t){return rt(t,"s",1<arguments.length&&void 0!==arguments[1]?arguments[1]:9,2<arguments.length&&void 0!==arguments[2]?arguments[2]:"rgb",3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,4<arguments.length&&void 0!==arguments[4]?arguments[4]:1,100)},scaleV:function(t){return rt(t,"v",1<arguments.length&&void 0!==arguments[1]?arguments[1]:9,2<arguments.length&&void 0!==arguments[2]?arguments[2]:"rgb",3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,4<arguments.length&&void 0!==arguments[4]?arguments[4]:1,100)}};var ot={euclidean:function(t,e){for(var n=0,r=0,i=t.length;r<i;r++)n+=Math.pow(e[r]-t[r],2);return Math.sqrt(n)},manhattan:function(t,e){for(var n=0,r=0,i=t.length;r<i;r++)n+=Math.abs(e[r]-t[r]);return n},max:function(t,e){for(var n=0,r=0,i=t.length;r<i;r++)n=Math.max(n,Math.abs(e[r]-t[r]));return n}},at={linear:function(t,e){for(var n=[],r=Math.round(Math.random()*t),i=Math.floor(t/e);n.push(r),r=(r+i)%t,n.length<e;);return n},shuffle:function(t,e){for(var n=[];n.length<e;){var r=Math.round(Math.random()*t);-1==n.indexOf(r)&&n.push(r)}return n}};function st(t,e,n,r){for(var i=new Array(t),o=0;o<t;o++)i[o]=[];for(var a=0,s=e.length;a<s;a++){var l=e[a];i[function(n,t,r){var i=1/0,o=0;return t.forEach(function(t,e){t=r(n,t);t<i&&(i=t,o=e)}),o}(l,n,r)].push(l)}return i}function lt(t,e,n,r,i,o){for(var a=0;a<t;a++){var s=n[a],l=r[a],u=new Array(l.length);i=!function(t,e){if(t.length===e.length){for(var n=0,r=t.length;n<r;++n)if(t[n]!==e[n])return;return 1}}(u=0<s.length?function(t){if(!t.length)return[];for(var e=new Array(t[0].length),n=0,r=e.length;n<r;n++)e[n]=0;for(var i=0,r=t.length;i<r;i++)for(var o=t[i],a=i+1,s=0,l=o.length;s<l;s++)e[s]+=(o[s]-e[s])/a;return e=e.map(function(t){return Math.floor(t)})}(s):e[Math.floor(o()*e.length)],l),r[a]=u}return i}function ut(t,e,n,r,i){var o=3<arguments.length&&void 0!==r?r:10,i=4<arguments.length&&void 0!==i?i:"linear";t=t,e=e||Math.max(2,Math.ceil(Math.sqrt(t.length/2)));var a=n||"euclidean";"string"==typeof a&&(a=ot[a]);for(var s=0,l=function(){return(s=(9301*s+49297)%233280)/233280},u=function(e,t,n){return at[2<arguments.length&&void 0!==n?n:"linear"](e.length,t).map(function(t){return e[t]})}(t,e,i),c=!0,h=0;c;){c=lt(e,t,st(e,t,u,a),u,!1,l);if(++h%o==0)break}return u}function ct(e,n){!function(t,e){for(var n=0;n<t;n+=4)e(n)}(e.pixels.length,function(t){n(e.pixels,t)})}var ht={create:function(t,e){var n=document.createElement("canvas");return n.width=t||0,n.height=e||0,n},drawPixels:function(t){var e=this.create(t.width,t.height),n=e.getContext("2d"),r=n.getImageData(0,0,e.width,e.height);return r.data.set(t.pixels),n.putImageData(r,0,0),e},createHistogram:function(i,o,a,t){var e=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{black:!0,red:!1,green:!1,blue:!1},n=this.create(i,o),s=n.getContext("2d");s.clearRect(0,0,i,o),s.fillStyle="white",s.fillRect(0,0,i,o);var l={black:!(s.globalAlpha=.7)};e.black?l.black=!1:l.black=!0,e.red?l.red=!1:l.red=!0,e.green?l.green=!1:l.green=!0,e.blue?l.blue=!1:l.blue=!0,Object.keys(a).forEac
1h(function(t){var e,n,r;l[t]||(e=a[t],n=Math.max.apply(Math,e),r=i/e.length,s.fillStyle=t,e.forEach(function(t,e){t=o*(t/n);s.fillRect(e*r,o-t,r,t)}))}),"function"==typeof t&&t(n)},getHistogram:function(t){for(var r=new Array(256),i=new Array(256),o=new Array(256),a=new Array(256),e=0;e<256;e++)r[e]=0,i[e]=0,o[e]=0,a[e]=0;return ct(t,function(t,e){var n=Math.round(dt.brightness(t[e],t[e+1],t[e+2]));r[n]++,i[t[e]]++,o[t[e+1]]++,a[t[e+2]]++}),{black:r,red:i,green:o,blue:a}},getBitmap:function(t,e){t=this.drawPixels(t);return{pixels:t.getContext("2d").getImageData(e.x||0,e.y||0,e.width||t.width,e.height||t.height).data,width:e.width,height:e.height}},putBitmap:function(t,e,n){var r=this.drawPixels(t),e=this.drawPixels(e),r=r.getContext("2d");return r.drawImage(e,n.x,n.y),t.pixels=r.getImageData(0,0,t.width,t.height).data,t}},ft=(m(vt,[{key:"initialize",value:function(){this.canvas=this.createCanvas(),this.context=this.canvas.getContext("2d")}},{key:"createCanvas",value:function(){return document.createElement("canvas")}},{key:"load",value:function(t){this.loadImage(t)}},{key:"loadImage",value:function(e){var n=this,r=this.context;this.newImage=new Image;var i=this.newImage;i.onload=function(){var t=i.height/i.width;n.opt.canvasWidth&&n.opt.canvasHeight?(n.canvas.width=n.opt.canvasWidth,n.canvas.height=n.opt.canvasHeight):(n.canvas.width=n.opt.maxWidth||i.width,n.canvas.height=n.canvas.width*t),r.drawImage(i,0,0,i.width,i.height,0,0,n.canvas.width,n.canvas.height),n.isLoaded=!0,e&&e()},this.getImageUrl(function(t){i.src=t})}},{key:"load",value:function(t){var e=this;this.newImage=new Image;var n=this.newImage;n.onload=function(){e.isLoaded=!0,t&&t()},this.getImageUrl(function(t){n.src=t})}},{key:"getImageUrl",value:function(e){if("string"==typeof this.imageUrl)return e(this.imageUrl);var t;this.imageUrl instanceof Blob&&((t=new FileReader).onload=function(t){e(t.target.result)},t.readAsDataURL(this.imageUrl))}},{key:"getRGBA",value:function(t,e,n,r){return[t,e,n,r]}},{key:"toArray",value:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),i=r.width,o=r.height;(t=t||function(t,e){e(t)})({pixels:new Uint8ClampedArray(r.data),width:i,height:o},function(t){t=ht.drawPixels(t);"canvas"==n.returnTo?e(t):e(t.toDataURL(n.outputFormat||"image/png"))},n)}},{key:"toHistogram",value:function(t){var e=this.context.getImageData(0,0,this.canvas.width,this.canvas.height),n=e.width,r=e.height,e=new Uint8ClampedArray(e.data);return ht.getHistogram({pixels:e,width:n,height:r})}},{key:"toRGB",value:function(){for(var t=this.context.getImageData(0,0,this.canvas.width,this.canvas.height).data,e=[],n=0,r=t.length;n<r;n+=4)e[e.length]=[t[n+0],t[n+1],t[n+2],t[n+3]];return e}}]),vt);function vt(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};y(this,vt),this.isLoaded=!1,this.imageUrl=t,this.opt=e,this.initialize()}function pt(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{frameTimer:"full"},i=new ft(t);i.loadImage(function(){i.toArray(e,function(t){"function"==typeof n&&n(t)},r)})}var dt=x({},t,e,it,V,Z,F,X,J,d,K,{palette:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:6,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"hex";return(t=t.length>e?ut(t,e):t).map(function(t){return h(t,n)})},ImageToCanvas:function(t,e,n){pt(t,e,n,Object.assign({returnTo:"canvas"},3<arguments.length&&void 0!==arguments[3]?arguments[3]:{frameTimer:"full"}))},ImageToHistogram:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{width:200,height:100},r=new ft(t);r.loadImage(function(){ht.createHistogram(n.width||200,n.height||100,r.toHistogram(n),function(t){"function"==typeof e&&e(t.toDataURL("image/png"))},n)})},ImageToRGB:function(t){var e,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];r?r&&(e=new ft(t,n)).loadImage(function(){"function"==typeof r&&r(e.toRGB())}):(e=new ft(t)).loadImage(function(){"function"==typeof n&&n(e.toRGB())})},ImageToURL:pt,histogram:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=new ft(t);r.loadImage(function(){"function"==typeof e&&e(r.toHistogram(n))})},histogramToPoints:function(t){for(var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:.2,n=[],r=0;r<t.length;r++){var i,o,a,s=t[r];0!=r?r!=t.length-1?(a=t[r-1],(o=t[r+1])[1],a[1],o[0],a[0],i=[a[0]+(o[0]-a[0])*e,a[1]+(o[1]-a[1])*e],i=[[].concat(O(a)),[].concat(i)],a=Math.sqrt(Math.pow(s[0]-a[0],2)+Math.pow(s[1]-a[1],2))/Math.sqrt(Math.pow(o[0]-s[0],2)+Math.pow(o[1]-s[1],2)),o=i[0][0]+(i[1][0]-i[0][0])*a,a=i[0][1]+(i[1][1]-i[0][1])*a,i[0][0]+=s[0]-o,i[0][1]+=s[1]-a,i[1][0]+=s[0]-o,i[1][1]+=s[1]-a,n[r]=i):n[r]=[]:n[r]=[]}return n}});function gt(t){return null==t}function yt(t){return!1===gt(t)}function mt(t){return"string"==typeof t}function $t(t){return"function"==typeof t}function bt(t){return"number"==typeof t}var kt=[{rgb:"#ff0000",start:0},{rgb:"#ffff00",start:.17},{rgb:"#00ff00",start:.33},{rgb:"#00ffff",start:.5},{rgb:"#0000ff",start:.67},{rgb:"#ff00ff",start:.83},{rgb:"#ff0000",start:1}];function Ct(t){for(var e,n,r=0;r<kt.length;r++)if(kt[r].start>=t){e=kt[r-1],n=kt[r];break}return e&&n?dt.mix(e.rgb,n.rgb,(t-e.start)/(n.start-e.start)):kt[0].rgb}!function(){for(var t=0,e=kt.length;t<e;
1t++){var n=kt[t],r=dt.parse(n.rgb);n.r=r.r,n.g=r.g,n.b=r.b}}();var xt={colors:kt,checkHueColor:Ct,getHueScale:function(t){for(var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:.1,n=arguments[2],r=gt(n)?t-e:e,i=gt(n)?t+scale:n,o=[],a=0;a<kt.length;a++){var s=kt[a];r<=s.start&&s.start<i?o.push({rgb:s.rgb,start:s.start}):kt[a+1]&&s.start<r&&r<kt[a+1].start?o.push({rgb:Ct(r),start:r}):kt[a-1]&&kt[a-1].start<i&&i<s.start?o.push({rgb:Ct(i),start:i}):s.start<r||s.start>i||o.push({rgb:s.rgb,start:s.start})}return o}},wt={identity:function(){return[1,0,0,0,1,0,0,0,1]},stretching:function(t){return[t,0,0,0,1,0,0,0,1]},squeezing:function(t){return[t,0,0,0,1/t,0,0,0,1]},scale:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return[t=t||0===t?t:1,0,0,0,e=e||0===e?e:1,0,0,0,1]},scaleX:function(t){return this.scale(t)},scaleY:function(t){return this.scale(1,t)},translate:function(t,e){return[1,0,t,0,1,e,0,0,1]},rotate:function(t){t=this.radian(t);return[Math.cos(t),-Math.sin(t),0,Math.sin(t),Math.cos(t),0,0,0,1]},rotate90:function(){return[0,-1,0,1,0,0,0,0,1]},rotate180:function(){return[-1,0,0,0,-1,0,0,0,1]},rotate270:function(){return[0,1,0,-1,0,0,0,0,1]},radian:function(t){return t*Math.PI/180},skew:function(t,e){t=this.radian(t),e=this.radian(e);return[1,Math.tan(t),0,Math.tan(e),1,0,0,0,1]},skewX:function(t){t=this.radian(t);return[1,Math.tan(t),0,0,1,0,0,0,1]},skewY:function(t){t=this.radian(t);return[1,0,0,Math.tan(t),1,0,0,0,1]},shear1:function(t){return[1,-Math.tan(this.radian(t)/2),0,0,1,0,0,0,1]},shear2:function(t){return[1,0,0,Math.sin(this.radian(t)),1,0,0,0,1]}},_t={CONSTANT:wt,radian:function(t){return wt.radian(t)},multiply:function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]},identity:function(t){return this.multiply(wt.identity(),t)},translate:function(t,e,n){return this.multiply(wt.translate(t,e),n)},rotate:function(t,e){return this.multiply(wt.rotate(t),e)},shear1:function(t,e){return this.multiply(wt.shear1(t),e)},shear2:function(t,e){return this.multiply(wt.shear2(t),e)},rotateShear:function(t,e){var n=this.shear1(t,e);return n=this.shear2(t,n),this.shear1(t,n)}};function Ot(r){var h=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"center",f=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"center";return function(i,t){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=Zt(i.pixels.length,i.width,i.height),o=i.width,a=i.height;"center"==h&&(h=Math.floor(o/2)),"center"==f&&(f=Math.floor(a/2));var s=_t.CONSTANT.translate(-h,-f),l=_t.CONSTANT.translate(h,f),u=_t.CONSTANT.shear1(r),c=_t.CONSTANT.shear2(r);se(function(t,e,n,r){n=_t.multiply(s,[n,r,1]),n=_t.multiply(u,n).map(Math.round);n=_t.multiply(c,n).map(Math.round),n=_t.multiply(u,n).map(Math.round),n=_t.multiply(l,n);r=_(n,2),n=r[0],r=r[1];n<0||r<0||o-1<n||a-1<r||ce(t,r*o+n<<2,i.pixels,e)})(n,function(){t(n)},e)}}function St(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:200,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100,n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],t=ee(t);return ie("\n // refer to Color.brightness \n const v = ($C * Math.ceil($r * 0.2126 + $g * 0.7152 + $b * 0.0722) ) >= $scale ? 255 : 0;\n\n if ($hasColor) {\n\n if (v == 0) {\n $r = 0; \n $g = 0; \n $b = 0;\n }\n \n } else {\n const value = Math.round(v);\n $r = value; \n $g = value;\n $b = value; \n }\n \n ",{$C:(e=ee(e))/100,$scale:t,$hasColor:n})}function Pt(){return he(zt([1,2,1,2,4,2,1,2,1],1/16*(ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100)))}function jt(){return he(zt([1,4,6,4,1,4,16,24,16,4,6,24,36,24,6,4,16,24,16,4,1,4,6,4,1],1/256*(ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100)))}function Mt(){ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:1);return he([5,5,5,-3,0,-3,-3,-3,-3])}function Et(){ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:1);return he([5,-3,-3,5,0,-3,5,-3,-3])}function It(){return he(zt([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,24,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100))}function Dt(){return he(zt([1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1],1/9))}function Tt(){return he(zt([1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1],1/9))}function Vt(){return he(zt([1,0,0,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,0,0,0,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,1],1/9))}function Ut(){return he([-1,-2,-1,0,0,0,1,2,1])}function At(){return he([-1,0,1,-2,0,2,-1,0,1])}var Lt=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,39
16,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Ht=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function Bt(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}function Rt(t,e,n){return n?function(t,e){if(isNaN(e)||e<1)return t;e|=0;var n,r,i,o,a,s,l,u,c,h,f,v,p,d,g,y,m,$,b,k,C=t.pixels,x=t.width,w=t.height,_=e+e+1,O=x-1,S=w-1,P=e+1,j=P*(P+1)/2,M=new Bt,E=M;for(i=1;i<_;i++){var I;E=E.next=new Bt,i==P&&(I=E)}E.next=M;var D=null,T=null;l=s=0;var V=Lt[e],U=Ht[e];for(r=0;r<w;r++){for(d=g=y=u=c=h=0,f=P*(m=C[s]),v=P*($=C[s+1]),p=P*(b=C[s+2]),u+=j*m,c+=j*$,h+=j*b,E=M,i=0;i<P;i++)E.r=m,E.g=$,E.b=b,E=E.next;for(i=1;i<P;i++)o=s+((O<i?O:i)<<2),u+=(E.r=m=C[o])*(k=P-i),c+=(E.g=$=C[o+1])*k,h+=(E.b=b=C[o+2])*k,d+=m,g+=$,y+=b,E=E.next;for(D=M,T=I,n=0;n<x;n++)C[s]=u*V>>U,C[s+1]=c*V>>U,C[s+2]=h*V>>U,u-=f,c-=v,h-=p,f-=D.r,v-=D.g,p-=D.b,o=l+((o=n+e+1)<O?o:O)<<2,d+=D.r=C[o],g+=D.g=C[o+1],y+=D.b=C[o+2],u+=d,c+=g,h+=y,D=D.next,f+=m=T.r,v+=$=T.g,p+=b=T.b,d-=m,g-=$,y-=b,T=T.next,s+=4;l+=x}for(n=0;n<x;n++){for(g=y=d=c=h=u=0,f=P*(m=C[s=n<<2]),v=P*($=C[s+1]),p=P*(b=C[s+2]),u+=j*m,c+=j*$,h+=j*b,E=M,i=0;i<P;i++)E.r=m,E.g=$,E.b=b,E=E.next;for(a=x,i=1;i<=e;i++)s=a+n<<2,u+=(E.r=m=C[s])*(k=P-i),c+=(E.g=$=C[s+1])*k,h+=(E.b=b=C[s+2])*k,d+=m,g+=$,y+=b,E=E.next,i<S&&(a+=x);for(s=n,D=M,T=I,r=0;r<w;r++)C[o=s<<2]=u*V>>U,C[o+1]=c*V>>U,C[o+2]=h*V>>U,u-=f,c-=v,h-=p,f-=D.r,v-=D.g,p-=D.b,o=n+((o=r+P)<S?o:S)*x<<2,u+=d+=D.r=C[o],c+=g+=D.g=C[o+1],h+=y+=D.b=C[o+2],D=D.next,f+=m=T.r,v+=$=T.g,p+=b=T.b,d-=m,g-=$,y-=b,T=T.next,s+=x}return t}(t,e):stackBlurCanvasRGB(t,0,0,e)}function Nt(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10,r=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],n=ee(n);return function(t,e){e(Rt(t,n,r))}}function Ft(){return he(zt([1,4,6,4,1,4,16,24,16,4,6,24,-476,24,6,4,16,24,16,4,1,4,6,4,1],-1/ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:256)))}var Xt=x({},{crop:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,l=arguments[2],u=arguments[3],c=Zt(l*u*4,l,u);return function(t,e){for(var n=s,r=0;n<u;n++,r++)for(var i=a,o=0;i<l;i++,o++)c.pixels[r*l*o]=t.pixels[n*l*i];e(c)}},resize:function(r,i){return function(t,e){var n=ht.drawPixels(t),t=n.getContext("2d");n.width=r,n.height=i,e({pixels:new Uint8ClampedArray(t.getImageData(0,0,r,i).data),width:r,height:i})}},flipH:function(){return function(t,e){for(var n=t.width,r=t.height,i=(n%2==1?1:0)?Math.floor(n/2):n/2,o=0;o<r;o++)for(var a=0;a<i;a++)ae(t.pixels,o*n+a<<2,o*n+(n-1-a)<<2);e(t)}},flipV:function(){return function(t,e){for(var n=t.width,r=t.height,i=(r%2==1?1:0)?Math.floor(r/2):r/2,o=0;o<i;o++)for(var a=0;a<n;a++)ae(t.pixels,o*n+a<<2,(r-1-o)*n+a<<2);e(t)}},rotate:function(){var s=ee(s=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0);return s%=360,function(o,t){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(0==s)return o;if(90==s||270==s)var a=Zt(o.pixels.length,o.height,o.width);else{if(180!=s)return Ot(s)(o,t,e);a=Zt(o.pixels.length,o.width,o.height)}se(function(t,e,n,r){var i;90==s?i=n*a.width+(a.width-1-r)<<2:270==s?i=(a.height-1-n)*a.width+r<<2:180==s&&(i=(a.height-1-r)*a.width+(a.width-1-n)<<2),ce(a.pixels,i,o.pixels,e)})(o,function(){t(a)},e)}},rotateDegree:Ot,histogram:function(){for(var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"gray",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0;r<e.length-1;r++)for(var i=e[r],o=e[r+1],a=o[0]-i[0],s=(o[1]-i[1])/a,l=0,u=i[0];l<a;l++,u++)n[u]=i[1]+l*s;return n[255]=255,ie("red"===t?function(){$r=n[$r]}:"green"===t?function(){$g=n[$g]}:"blue"===t?function(){$b=n[$b]}:function(){var t=Color.RGBtoYCrCb($r,$g,$b),t=Color.YCrCbtoRGB(clamp(n[clamp(t.y)]),t.cr,t.cb,0);$r=t.r,$g=t.g,$b=t.b},{},{$realPoints:n})},"rotate-degree":Ot},{bitonal:function(t,e){return ie(" \n const thresholdColor = ( $r + $g + $b ) <= $threshold ? $darkColor : $lightColor\n\n $r = thresholdColor.r;\n $g = thresholdColor.g;\n $b = thresholdColor.b; \n ",{$threshold:2<arguments.length&&void 0!==arguments[2]?arguments[2]:100},{$darkColor:dt.parse(t),$lightColor:dt.parse(e)})},brightness:function(){var t=ee(t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1);return ie("\n $r += $C;\n $g += $C;\n $b += $C;\n ",{$C:Math.floor(t/100*255)})},brownie:function(){return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a; \n ",{$matrix:[.5997023498159715,.34553243048391263,-.2708298674538
1042,0,-.037703249837783157,.8609577587992641,.15059552388459913,0,.24113635128153335,-.07441037908422492,.44972182064877153,0,0,0,0,1]})},clip:function(){var t=ee(t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0);return ie("\n\n $r = ($r > 255 - $C) ? 255 : 0;\n $g = ($g > 255 - $C) ? 255 : 0;\n $b = ($b > 255 - $C) ? 255 : 0;\n\n ",{$C:2.55*Math.abs(t)})},contrast:function(){var t=ee(t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0);return ie("\n $r *= $C;\n $g *= $C;\n $b *= $C;\n ",{$C:Math.max((128+t)/128,0)})},gamma:function(){return ie("\n $r = Math.pow($r / 255, $C) * 255;\n $g = Math.pow($g / 255, $C) * 255;\n $b = Math.pow($b / 255, $C) * 255;\n ",{$C:ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:1)})},gradient:function(){var t=[].concat(Array.prototype.slice.call(arguments)),e=(e=(t=(t=1===t.length&&"string"==typeof t[0]?dt.convertMatchesArray(t[0]):t).map(function(t){return dt.matches(t).length?{type:"param",value:t}:{type:"scale",value:t}})).filter(function(t){return"scale"==t.type})[0])?+e.value:256;return t=t.filter(function(t){return"param"==t.type}).map(function(t){return t.value}).join(","),ie("\n const colorIndex = clamp(Math.ceil($r * 0.2126 + $g * 0.7152 + $b * 0.0722));\n const newColorIndex = clamp(Math.floor(colorIndex * ($scale / 256)));\n const color = $colors[newColorIndex];\n\n $r = color.r; \n $g = color.g; \n $b = color.b; \n $a = clamp(Math.floor(color.a * 256));\n ",{},{$colors:dt.gradient(t,e).map(function(t){t=dt.parse(t);return{r:t.r,g:t.g,b:t.b,a:t.a}}),$scale:e})},grayscale:function(t){return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a;
1\n ",{$matrix:[.2126+.7874*(1-(t=1<(t=(t=ee(t))/100)?1:t)),.7152-.7152*(1-t),.0722-.0722*(1-t),0,.2126-.2126*(1-t),.7152+.2848*(1-t),.0722-.0722*(1-t),0,.2126-.2126*(1-t),.7152-.7152*(1-t),.0722+.9278*(1-t),0,0,0,0,1]})},hue:function(){return ie("\n var hsv = Color.RGBtoHSV($r, $g, $b);\n\n // 0 ~ 360 \n var h = hsv.h;\n h += Math.abs($C);\n h = h % 360;\n hsv.h = h;\n\n var rgb = Color.HSVtoRGB(hsv);\n\n $r = rgb.r;\n $g = rgb.g;\n $b = rgb.b;\n ",{$C:ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:360)})},invert:function(){return ie("\n $r = (255 - $r) * $C;\n $g = (255 - $g) * $C;\n $b = (255 - $b) * $C;\n ",{$C:ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100})},kodachrome:function(){return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a;\n ",{$matrix:[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,0,0,0,1]})},matrix:function(){return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a;\n ",{$matrix:[0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,5<arguments.length&&void 0!==arguments[5]?arguments[5]:0,6<arguments.length&&void 0!==arguments[6]?arguments[6]:0,7<arguments.length&&void 0!==arguments[7]?arguments[7]:0,8<arguments.length&&void 0!==arguments[8]?arguments[8]:0,9<arguments.length&&void 0!==arguments[9]?arguments[9]:0,10<arguments.length&&void 0!==arguments[10]?arguments[10]:0,11<arguments.length&&void 0!==arguments[11]?arguments[11]:0,12<arguments.length&&void 0!==arguments[12]?arguments[12]:0,13<arguments.length&&void 0!==arguments[13]?arguments[13]:0,14<arguments.length&&void 0!==arguments[14]?arguments[14]:0,15<arguments.length&&void 0!==arguments[15]?arguments[15]:0]})},noise:function(){return ie("\n const C = Math.abs($C) * 5;\n const min = -C;\n const max = C;\n const noiseValue = Math.round(min + (Math.random() * (max - min)));\n\n $r += noiseValue;\n $g += noiseValue;\n $b += noiseValue;\n ",{$C:ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:1)})},opacity:function(){return ie("\n $a *= $C; \n ",{$C:ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100})},polaroid:function(){return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a;\n ",{$matrix:[1.438,-.062,-.062,0,-.122,1.378,-.122,0,-.016,-.016,1.483,0,0,0,0,1]})},saturation:function(){var t=ee(t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:100);return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a; \n ",{$matrix:[t=1-Math.abs(t/100),0,0,0,0,t,0,0,0,0,t,0,0,0,0,t]})},sepia:function(){var t=ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:1);return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a; \n ",{$matrix:[.393+.607*(1-(t=1<t?1:t)),.769-.769*(1-t),.189-.189*(1-t),0,.349-.349*(1-t),.686+.314*(1-t),.168-.168*(1-t),0,.272-.272*(1-t),.534-.534*(1-t),.131+.869*(1-t),0,0,0,0,1]})},shade:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1;return ie("\n $r *= $redValue;\n $g *= $greenValue;\n $b *= $blueValue;\n ",{$redValue:ee(t),$greenValue:ee(e),$blueValue:ee(n)})},shift:function(){return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a; \n ",{$matrix:[1.438,-.062,-.062,0,-.122,1.378,-.122,0,-.016,-.016,1.483,0,0,0,0,1]})},solarize:function(t,e,n){return ie("\n $r = ($r < $redValue) ? 255 - $r: $r;\n $g = ($g < $greenValue) ? 255 - $g: $g;\n $b = ($b < $blueValue) ? 255 - $b: $b;\n ",{$redValue:ee(t),$greenValue:ee(e),$blueValue:ee(n)})},technicolor:function(){return ie("\n $r = $matrix[0] * $r + $matrix[1] * $g + $matrix[2] * $b + $matrix[3] * $a;\n $g = $matrix[4] * $r + $matrix[5] * $g + $matrix[6] * $b + $matrix[7] * $a;\n $b = $matrix[8] * $r + $matrix[9] * $g + $matrix[10] * $b + $matrix[11] * $a;\n $a = $matrix[12] * $r + $matrix[13] * $g + $matrix[14] * $b + $matrix[15] * $a;\n ",{$matrix:[1.9125277891456083,-.8545344976951645,-.091555084827
155585,0,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-.231103377548616,-.7501899197440212,1.847597816108189,0,0,0,0,1]})},threshold:function(){return St(0<arguments.length&&void 0!==arguments[0]?arguments[0]:200,1<arguments.length&&void 0!==arguments[1]?arguments[1]:100,!1)},"threshold-color":St,tint:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1;return ie("\n\n $r += (255 - $r) * $redTint;\n $g += (255 - $g) * $greenTint;\n $b += (255 - $b) * $blueTint;\n\n ",{$redTint:ee(t),$greenTint:ee(e),$blueTint:ee(n)})}},{blur:function(){return he(le(ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:3)))},emboss:function(){var t;return he([-2*(t=ee(t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:4)),-t,0,-t,1,t,0,t,2*t])},gaussianBlur:Pt,"gaussian-blur":Pt,gaussianBlur5x:jt,"gaussian-blur-5x":jt,grayscale2:function(){return he(zt([.3,.3,.3,0,0,.59,.59,.59,0,0,.11,.11,.11,0,0,0,0,0,0,0,0,0,0,0,0],ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100))},normal:function(){return he([0,0,0,0,1,0,0,0,0])},kirschHorizontal:Mt,"kirsch-horizontal":Mt,kirschVertical:Et,"kirsch-vertical":Et,laplacian:function(){return he(zt([-1,-1,-1,-1,8,-1,-1,-1,-1],ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100))},laplacian5x:It,"laplacian-5x":It,motionBlur:Dt,"motion-blur":Dt,motionBlur2:Tt,"motion-blur-2":Tt,motionBlur3:Vt,"motion-blur-3":Vt,negative:function(){return he(zt([-1,0,0,0,0,0,-1,0,0,0,0,0,-1,0,0,0,0,0,1,0,1,1,1,1,1],ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100))},sepia2:function(){return he(zt([.393,.349,.272,0,0,.769,.686,.534,0,0,.189,.168,.131,0,0,0,0,0,0,0,0,0,0,0,0],ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100))},sharpen:function(){return he(zt([0,-1,0,-1,5,-1,0,-1,0],ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100))},sobelHorizontal:Ut,"sobel-horizontal":Ut,sobelVertical:At,"sobel-vertical":At,stackBlur:Nt,"stack-blur":Nt,transparency:function(){return he(zt([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,.3,0,0,0,0,0,1],ee(0<arguments.length&&void 0!==arguments[0]?arguments[0]:100)/100))},unsharpMasking:Ft,"unsharp-masking":Ft},{kirsch:function(){return de("kirsch-horizontal kirsch-vertical")},sobel:function(){return de("sobel-horizontal sobel-vertical")},vintage:function(){return de("brightness(15) saturation(-20) gamma(1.8)")}}),Yt=0,X=(b(F={partial:$e,multi:ye,merge:me,weight:zt,repeat:qt,colorMatrix:function(t,e,n){var r=t[e],i=t[e+1],o=t[e+2],a=t[e+3];ue(t,e,n[0]*r+n[1]*i+n[2]*o+n[3]*a,n[4]*r+n[5]*i+n[6]*o+n[7]*a,n[8]*r+n[9]*i+n[10]*o+n[11]*a,n[12]*r+n[13]*i+n[14]*o+n[15]*a)},each:Wt,eachXY:Jt,createRandomCount:function(){return[9,16,25,36,49,64,81,100].sort(function(t,e){return.5-Math.random()})[0]},createRandRange:function(t,e,n){for(var r=[],i=1;i<=n;i++){var o=Math.random()*(e-t)+t,a=Math.floor(10*Math.random())%2==0?-1:1;r.push(a*o)}r.sort();var s=Math.floor(n>>1),l=r[s];return r[s]=r[0],r[0]=l,r},createBitmap:Zt,createBlurMatrix:le,pack:function(r){return function(n,t){Wt(n.pixels.length,function(t,e){r(n.pixels,t,e,n.pixels[t],n.pixels[t+1],n.pixels[t+2],n.pixels[t+3])},function(){t(n)})}},packXY:se,pixel:ie,getBitmap:Qt,putBitmap:te,radian:function(t){return _t.CONSTANT.radian(t)},convolution:he,parseParamNumber:ee,filter:de,clamp:pe,fillColor:ue,fillPixelColor:ce},"multi",ye),b(F,"merge",me),b(F,"matches",fe),b(F,"parseFilter",ve),b(F,"partial",$e),F),Gt=X;function zt(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return t.map(function(t){return t*e})}function qt(t,e){for(var n=new Array(e),r=0;r<e;r++)n[r]=t;return n}function Kt(i,t,e,n,r,o,a,s){var t=1<arguments.length&&void 0!==t?t:0,l=2<arguments.length&&void 0!==e?e:1,u=n,c=r,h=5<arguments.length&&void 0!==o?o:1e4,a=6<arguments.length&&void 0!==a?a:"full",f=7<arguments.length&&void 0!==s?s:50,v=t,p=function(t){setTimeout(t,0)};function d(){for(var t,e=function(t){return t=[].concat(O(Array(0<arguments.length&&void 0!==t?t:50))).map(function(t){return"cri = ri + i * s; if (cri >= mx) return {currentRunIndex: cri, i: null}; c(cri); i++;"}).join("\n"),new Function("ri","i","s","mx","c","\n let cri = ri;\n \n "+t+"\n \n return {currentRunIndex: cri, i: i} \n ")}(f),n=v,r=0;r<h;){if(null==(t=e(v,r,l,i,u)).i){n=t.currentRunIndex;break}r=t.i,n=t.currentRunIndex}!function(t){t?v=t:v+=l;i<=v?c():p?p(d):d()}(n)}"requestAnimationFrame"==a&&(p=requestAnimationFrame,h=1e3),"full"==a&&(p=null,h=i),d()}function Wt(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};Kt(t,0,4,function(t){e(t,t>>2)},function(){n()},r.functionDumpCount,r.frameTimer,r.loopCount)}function Jt(t,n,r,e){var i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:{};Kt(t,0,4,function(t){var e=t>>2;r(t,e%n,Math.floor(e/n))},function(){e()},i.functionDumpCount,i.frameTimer,i.loopCount)}function Zt(t,e,n){return{pixels:new Uint8ClampedArray(t),width:e,height:n}}function Qt(t,e){return ht.getBitmap(t,e)}function te(t,e,n){return ht.putBitmap(t,e,n)}function ee(t){return+(t="string"==typeof t?(t=t.replace(/deg/,"")).replace(/px/,""):t)}var ne=/(([\w_\-]+)(\(([^\)]*)\))?)+/gi;function re(t,e,n){var a;return a={},e=(t=[{callback:t,context:1<arguments.length&&void 0!==e?e:{},rootContext:2<arguments.length&&void 0!==n?n:{}}]).map(function(r){var i=[];Object.keys(r.context).forEach(function(t,e){i[t]="n$"+Yt+++t+"$"}),Object.keys(r.rootContext).forEach(function(t,e){i[t]="r$"+Yt+++t+"$",a[i[t]]=r.rootContext[t]});var t=Object.keys(r.context).filter(function(t){return"number"!=typeof r.context[t]&&"string"!=typeof r.context[t]&&(!Array.isArray(r.context[t])||"number"!=typeof r.context[t][0]&&"string"!=typeof r.context[t][0])}).map(function(t,e){return[i[t],JSON.stringify(r.context[t])].join(" = ")}),o=r.callback;return"function"==typeof r.callback&&((o=r.callback.toString().split("{")).shift(),(o=(o=o.join("{")).split("}")).pop(),o=o.join("}
1")),Object.keys(i).forEach(function(n){var t=i[n];"number"==typeof r.context[n]||"string"==typeof r.context[n]?o=o.replace(new RegExp("\\"+n,"g"),r.context[n]):Array.isArray(r.context[n])&&("number"==typeof r.context[n][0]||"string"==typeof r.context[n][0])?r.context[n].forEach(function(t,e){o=o.replace(new RegExp("\\"+n+"\\["+e+"\\]","g"),t)}):o=o.replace(new RegExp("\\"+n,"g"),t)}),{preCallbackString:o,preContext:t}}),n=e.map(function(t,e){return t.preContext.length?"const "+t.preContext+";":""}).join("\n\n"),t=e.map(function(t){return t.preCallbackString}).join("\n\n"),(e=new Function("$pixels","$pixelIndex","$clamp","$Color"," \n let $r = $pixels[$pixelIndex], $g = $pixels[$pixelIndex+1], $b = $pixels[$pixelIndex+2], $a = $pixels[$pixelIndex+3];\n\n "+n+"\n\n "+t+"\n \n $pixels[$pixelIndex] = $r\n $pixels[$pixelIndex+1] = $g \n $pixels[$pixelIndex+2] = $b \n $pixels[$pixelIndex+3] = $a \n ")).$preCallbackString=t,e.$preContext=n,e.rootContextObject=a,e}function ie(t){var e=re(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}),t=function(t,e){};return t.userFunction=e,t}var oe=[0,1,2,3];function ae(n,r,i){oe.forEach(function(t){var e=n[r+t];n[r+t]=n[i+t],n[i+t]=e})}function se(i){return function(r,t){Jt(r.pixels.length,r.width,function(t,e,n){i(r.pixels,t,e,n)},function(){t(r)},2<arguments.length&&void 0!==arguments[2]?arguments[2]:{})}}function le(){var t=Math.pow(0<arguments.length&&void 0!==arguments[0]?arguments[0]:3,2);return qt(1/t,t)}function ue(t,e,n,r,i,o){var a;3==arguments.length&&(n=(a=arguments[2]).r,r=a.g,i=a.b,o=a.a),"number"==typeof n&&(t[e]=n),"number"==typeof r&&(t[e+1]=r),"number"==typeof i&&(t[e+2]=i),"number"==typeof o&&(t[e+3]=o)}function ce(t,e,n,r){ue(t,e,n[r],n[r+1],n[r+2],n[r+3])}function he(h){var f=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],v=function(t,e,n){var r=1<arguments.length&&void 0!==e?e:0,i=2<arguments.length&&void 0!==n?n:255,o=t.map(function(t,e){return[]});return t.forEach(function(t,e){if(0!=t)for(var n=o[e],e=r;e<=i;e++)n[e]=t*e}),o}(h);return function(t,e){var n=Math.round(Math.sqrt(h.length)),r=function(t,e){var n=1<arguments.length&&void 0!==e?e:0,e=t.width+n,n=t.height+n;return{pixels:new Uint8ClampedArray(e*n*4),width:e,height:n}}(t,2*n);!function(t,e,n,r){for(var i,o,a,s,l=e.pixels.length/4,u=0;u<l;u++)a=u%e.width,i=r+(o=Math.floor(u/e.width)),(s=n+a)>t.width||i>t.height||(a=o*e.width+a<<2,s=i*t.width+s<<2,t.pixels[s]=e.pixels[a],t.pixels[1+s]=e.pixels[1+a],t.pixels[2+s]=e.pixels[2+a],t.pixels[3+s]=e.pixels[3+a])}(r,t,n,n);for(var i=Zt(r.pixels.length,r.width,r.height),o=Zt(t.pixels.length,t.width,t.height),a=function(t,o,i,e){var a=Math.round(Math.sqrt(t.length)),s=Math.floor(a/2),n=e?1:0,e="let r = 0, g = 0, b = 0, a = 0, scy = 0, scx =0, si = 0; ",l=[],u=[],c=[],h=[];t.forEach(function(t,e){var n=Math.floor(e/a)-s,r=e%a-s;0!=t&&(l.push("$t["+e+"][$sp[(($sy + ("+n+")) * "+i+" + ($sx + ("+r+"))) * 4]]"),u.push("$t["+e+"][$sp[(($sy + ("+n+")) * "+i+" + ($sx + ("+r+"))) * 4 + 1]]"),c.push("$t["+e+"][$sp[(($sy + ("+n+")) * "+i+" + ($sx + ("+r+"))) * 4 + 2]]"),h.push("$t["+e+"][$sp[(($sy + ("+n+")) * "+i+" + ($sx + ("+r+"))) * 4 + 3]]"))}),e+="r = "+l.join(" + ")+"; g = "+u.join(" + ")+"; b = "+c.join(" + ")+"; a = "+h.join(" + ")+";",e+="$dp[$di] = r; $dp[$di+1] = g;$dp[$di+2] = b;$dp[$di+3] = a + ("+n+")*(255-a); ";var f=new Function("$dp","$sp","$di","$sx","$sy","$t",e);return function(t,e,n,r,i){f(t,e,n,r,i,o)}}(h,v,r.width,(r.height,f)),s=t.pixels.length/4,l=0;l<s;l++){var u=l%t.width+n,c=Math.floor(l/t.width)+n;a(i.pixels,r.pixels,4*(c*r.width+u),u,c)}!function(t,e,n,r){for(var i=e.pixels.length>>2,o=0,a=0,s=0;s<i;s++){var l=s%e.width,u=r+(a=Math.floor(s/e.width));(o=n+l)>t.width||u>t.height||(u=u*t.width+o<<2,l=a*e.width+l<<2,e.pixels[l]=t.pixels[u],e.pixels[1+l]=t.pixels[1+u],e.pixels[2+l]=t.pixels[2+u],e.pixels[3+l]=t.pixels[3+u])}}(i,o,n,n),e(o)}}function fe(n){var e=dt.convertMatches(n),t=e.str.match(ne),r=[];if(!t)return r;var r=t.map(function(t){return{filter:t,origin:dt.reverseMatches(t,e.matches)}}),i={next:0};return r=r.map(function(t){var e=n.indexOf(t.origin,i.next);return t.startIndex=e,t.endIndex=e+t.origin.length,t.arr=ve(t.origin),i.next=t.endIndex,t}).filter(function(t){return!!t.arr.length})}function ve(t){var e=dt.convertMatches(t),n=e.str.match(ne);if(!n[0])return[];var r=n[0].split("("),t=r.shift(),n=[];return r.length&&(n=r.shift().split(")")[0].split(",").map(function(t){return dt.reverseMatches(t,e.matches)})),[t].concat(O(n)).map(dt.trim)}function pe(t){return Math.min(255,t)}function de(t){return me(fe(t).map(function(t){return t.arr}))}function ge(t){for(var e=0<arguments.length&&void 0!==t?t:[],n=[],r=[],i=0,o=e.length;i<o;i++){var a=e[i];a.userFunction?r.push(a):(r.length&&n.push([].concat(O(r))),n.push(a),r=[])}
1return r.length&&n.push([].concat(O(r))),n.forEach(function(t,e){var i;Array.isArray(t)&&(n[e]=(i=function(t){var e=t.map(function(t){return" \n "+t.userFunction.$preContext+"\n\n "+t.userFunction.$preCallbackString+"\n\n $r = clamp($r); $g = clamp($g); $b = clamp($b); $a = clamp($a);\n "}).join("\n\n"),n={clamp:pe,Color:dt};t.forEach(function(t){Object.assign(n,t.userFunction.rootContextObject)});var t="const "+Object.keys(n).map(function(t){return" "+t+" = $rc."+t+" "}).join(","),r=new Function("$p","$pi","$rc"," \n let $r = $p[$pi], $g = $p[$pi+1], $b = $p[$pi+2], $a = $p[$pi+3];\n \n "+t+"\n\n "+e+"\n \n $p[$pi] = $r; $p[$pi+1] = $g; $p[$pi+2] = $b; $p[$pi+3] = $a;\n ");return function(t,e){r(t,e,n)}}(t),function(t,e){for(var n=0,r=t.pixels.length;n<r;n+=4)i(t.pixels,n);e(t)}))}),n}function ye(){for(var t=arguments.length,a=Array(t),e=0;e<t;e++)a[e]=arguments[e];var s=(a=ge(a=a.map(function(t){if("function"==typeof t)return t;var e=(t=(t="string"==typeof t?[t]:t).slice(0)).shift();if("function"==typeof e)return e;var n=t;if(!(t=Xt[e]||Gt[e]))throw new Error(e+" is not filter. please check filter name.");return t.apply(t,n)}).filter(function(t){return t}))).length;return function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=t,i=0;function o(){a[i].call(null,r,function(t){r=t,s<=++i?e(r):o()},n)}o()}}function me(t){return ye.apply(void 0,O(t))}function $e(r){for(var i=null,t=arguments.length,e=Array(1<t?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return i=1==e.length&&"string"==typeof e[0]?de(e[0]):me(e),function(e,n){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};i(Qt(e,r),function(t){n(te(e,t,r))},t)}}var J=x({},Xt,X),d={Color:dt,HueColor:xt,ColorNames:f,ImageFilter:J,Canvas:ht,ImageLoader:ft},be=(dt.color,0),ke=[],Ce=(m(xe,[{key:"attr",value:function(t,e){return 1==arguments.length?this.el.getAttribute(t):(this.el.setAttribute(t,e),this)}},{key:"closest",value:function(t){for(var e=this,n=!1;!(n=e.hasClass(t));){if(!e.el.parentNode)return null;e=new xe(e.el.parentNode)}return n?e:null}},{key:"checked",value:function(){return this.el.checked}},{key:"removeClass",value:function(t){return this.el.className=(" "+this.el.className+" ").replace(" "+t+" "," ").trim(),this}},{key:"hasClass",value:function(t){return!!this.el.className&&-1<(" "+this.el.className+" ").indexOf(" "+t+" ")}},{key:"addClass",value:function(t){return this.hasClass(t)||(this.el.className=this.el.className+" "+t),this}},{key:"toggleClass",value:function(t){this.hasClass(t)?this.removeClass(t):this.addClass(t)}},{key:"html",value:function(e){try{"string"==typeof e?this.el.innerHTML=e:this.empty().append(e)}catch(t){console.log(e)}return this}},{key:"find",value:function(t){return this.el.querySelector(t)}},{key:"$",value:function(t){return new xe(this.find(t))}},{key:"findAll",value:function(t){return this.el.querySelectorAll(t)}},{key:"$$",value:function(t){return[].concat(O(this.findAll(t))).map(function(t){return new xe(t)})}},{key:"empty",value:function(){return this.html("")}},{key:"append",value:function(t){return"string"==typeof t?this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t.el||t),this}},{key:"appendTo",value:function(t){return(t.el||t).appendChild(this.el),this}},{key:"remove",value:function(){return this.el.parentNode&&this.el.parentNode.removeChild(this.el),this}},{key:"text",value:function(){return this.el.textContent}},{key:"css",value:function(t,e){var n=this;if(2==arguments.length)this.el.style[t]=e;else if(1==arguments.length){if("string"==typeof t)return getComputedStyle(this.el)[t];var r=t||{};Object.keys(r).forEach(function(t){n.el.style[t]=r[t]})}return this}},{key:"cssFloat",value:function(t){return parseFloat(this.css(t))}},{key:"cssInt",value:function(t){return parseInt(this.css(t))}},{key:"px",value:function(t,e){return this.css(t,e+"px")}},{key:"offset",value:function(){var t=this.el.getBoundingClientRect();return{top:t.top+xe.getScrollTop(),left:t.left+xe.getScrollLeft()}}},{key:"rect",value:function(){return this.el.getBoundingClientRect()}},{key:"position",value:function(){return this.el.style.top?{top:parseFloat(this.css("top")),left:parseFloat(this.css("left"))}:this.el.getBoundingClientRect()}},{key:"size",value:function(){return[this.width(),this.height()]}},{key:"width",value:function(){return this.el.offsetWidth||this.el.getBoundingClientRect().width}},{key:"contentWidth",value:function(){return this.width()-this.cssFloat
1("padding-left")-this.cssFloat("padding-right")}},{key:"height",value:function(){return this.el.offsetHeight||this.el.getBoundingClientRect().height}},{key:"contentHeight",value:function(){return this.height()-this.cssFloat("padding-top")-this.cssFloat("padding-bottom")}},{key:"dataKey",value:function(t){return this.uniqId+"."+t}},{key:"data",value:function(t,e){if(2==arguments.length)return ke[this.dataKey(t)]=e,this;if(1==arguments.length)return ke[this.dataKey(t)];var t=Object.keys(ke),n=this.uniqId+".";return t.filter(function(t){return 0==t.indexOf(n)}).map(function(t){return ke[t]})}},{key:"val",value:function(t){return 0==arguments.length?this.el.value:(1==arguments.length&&(this.el.value=t),this)}},{key:"int",value:function(){return parseInt(this.val(),10)}},{key:"float",value:function(){return parseFloat(this.val())}},{key:"show",value:function(){return this.css("display","block")}},{key:"hide",value:function(){return this.css("display","none")}},{key:"toggle",value:function(){return"none"==this.css("display")?this.show():this.hide()}},{key:"scrollTop",value:function(){return this.el===document.body?xe.getScrollTop():this.el.scrollTop}},{key:"scrollLeft",value:function(){return this.el===document.body?xe.getScrollLeft():this.el.scrollLeft}},{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(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},n=new xe(t,e,n);return n.css(r),this.append(n),n}},{key:"firstChild",value:function(){return new xe(this.el.firstElementChild)}},{key:"replace",value:function(t,e){return this.el.replaceChild(e,t),this}}],[{key:"getScrollTop",value:function(){return Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop)}},{key:"getScrollLeft",value:function(){return Math.max(window.pageXOffset,document.documentElement.scrollLeft,document.body.scrollLeft)}}]),xe);function xe(t,e,n){if(y(this,xe),"string"!=typeof t)this.el=t;else{var r,i=document.createElement(t);for(r in this.uniqId=be++,e&&(i.className=e),n=n||{})i.setAttribute(r,n[r]);this.el=i}}m(we,[{key:"initialize",value:function(){var e=this;this.filterProps().forEach(function(t){e.$store.action(t,e)})}},{key:"filterProps",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"/";return Object.getOwnPropertyNames(this.__proto__).filter(function(t){return t.startsWith(e)})}}]),K=we;function we(t){y(this,we),this.$store=t,this.initialize()}var _e=(C(Oe,K),m(Oe,[{key:"initialize",value:function(){k(Oe.prototype.__proto__||Object.getPrototypeOf(Oe.prototype),"initialize",this).call(this),this.$store.colorSetsList=[{name:"Material",colors:["#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548","#9E9E9E","#607D8B"],edit:!0},{name:"Custom",edit:!0,colors:[]},{name:"Color Scale",scale:["red","yellow","black"],count:5}],this.$store.currentColorSets={}}},{key:"/list",value:function(t){return Array.isArray(t.userList)&&t.userList.length?t.userList:t.colorSetsList}},{key:"/setUserPalette",value:function(t,e){t.userList=e,t.dispatch("/resetUserPalette"),t.dispatch("/setCurrentColorSets")}},{key:"/resetUserPalette",value:function(r){r.userList&&r.userList.length&&(r.userList=r.userList.map(function(t,e){var n;return"function"==typeof t.colors&&(n=t.colors,t.colors=n(r),t._colors=n),Object.assign({name:"color-"+e,colors:[]},t)}),r.emit("changeUserList"))}},{key:"/setCurrentColorSets",value:function(t,e){var n=t.dispatch("/list");t.currentColorSets=void 0===e?n[0]:"number"==typeof e?n[e]:n.filter(function(t){return t.name==e})[0],t.emit("changeCurrentColorSets")}},{key:"/getCurrentColorSets",value:function(t){return t.currentColorSets}},{key:"/addCurrentColor",value:function(t,e){Array.isArray(t.currentColorSets.colors)&&(t.currentColorSets.colors.push(e),t.emit("changeCurrentColorSets"),t.emit("addCurrentColor",e))}},{key:"/setCurrentColorAll",value:function(t){t.currentColorSets.colors=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],t.emit("changeCurrentColorSets")}},{key:"/removeCurrentColor",value:function(t,e){t.currentColorSets.colors[e]&&(t.currentColorSets.colors.splice(e,1),t.emit("changeCurrentColorSets"))}},{key:"/removeCurrentColorToTheRight",value:function(t,e){t.currentColorSets.colors[e]&&(t.currentColorSets.colors.splice(e,Number.MAX_VALUE),t.emit("changeCurrentColorSets"))}},{key:"/clearPalette",value:function(t){t.currentColorSets.colors&&(t.currentColorSets.colors=[],t.emit("changeCurrentColorSets"))}},{key:"/getCurrentColors",value:function(t){return t.dispatch("/getColors",t.currentColorSets)}},{key:"/getColors",value:function(t,e){return e.scale?dt.scale(e.scale,e.count):e.colors||[]}},{key:"/getColorSetsList",value:function(e){return e.dispatch("/list").map(function(t){return{name:t.name,edit:t.edit,colors:e.dispatch("/getColors",t)}})}}]),Oe);function Oe(){return y(this,Oe),w(this,(Oe.__proto__||Object.getPrototypeOf(Oe)).apply(this,arguments))}var Se={addEvent:function(t,e,n,r){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){t=this.pos(t);return{x:t.pageX,y:t.pageY}}},Pe=(m(je,[{key:"set",value:function(t,e){this.settingObj[t]=e||(2<arguments.length&&void 0!==arguments[2]?arguments[2]:void 0)}},{key:"init",value:function(t){if(!this.has(t)||!this.settingObj[t]){var e=t.split("."),n=this.masterObj.refs[e[0]]||this.masterObj[e[0]]||this.masterObj,e=e.pop();if(n[e]){for(var r=arguments.length,i=Array(1<r?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];n=n[e].apply(n,i);this.set(t,n)}}}},{key:"get",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return this.init(t,e),this.settingObj[t]||e}},{key:"has",value:function(t){return!!this.settingObj[t]}}]),je);function je(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};y(this,je),this.masterObj=t,this.settingObj=e}var Me=/^(click|mouse(down|up|move|enter|leave)|touch(start|move|end)|key(down|up|press)|contextmenu|change|input)/gi,Ee=/^load (.*)/gi,Ie=["Control","Shift","Alt","Meta"],F=(m(De,[{key:"newChildComponents",value:function(){var n=this;
1Object.keys(this.childComponents).forEach(function(t){var e=n.childComponents[t];n[t]=new e(n)})}},{key:"render",value:function(){this.$el=this.parseTemplate(this.template()),this.refs.$el=this.$el,this.parseTarget(),this.load(),this.afterRender()}},{key:"afterRender",value:function(){}},{key:"components",value:function(){return{}}},{key:"parseTemplate",value:function(t){var n=this,e=new Ce("div").html(t).firstChild(),t=e.findAll("[ref]");return[].concat(O(t)).forEach(function(t){var e=t.getAttribute("ref");n.refs[e]=new Ce(t)}),e}},{key:"parseTarget",value:function(){var r=this,t=this.$el.findAll("[target]");[].concat(O(t)).forEach(function(t){var e=t.getAttribute("target"),n=t.getAttribute("ref")||e,e=new r.childComponents[e](r);r[n]=e,r.refs[n]=e.$el,e&&(e.render(),new Ce(t.parentNode).replace(t,e.$el.el))})}},{key:"load",value:function(){var n=this;this.filterProps(Ee).forEach(function(t){var e=t.split("load ")[1];n.refs[e]&&n.refs[e].html(n.parseTemplate(n[t].call(n)))})}},{key:"template",value:function(){return"<div></div>"}},{key:"initialize",value:function(){}},{key:"initializeEvent",value:function(){var e=this;this.initializeEventMachin(),Object.keys(this.childComponents).forEach(function(t){e[t]&&e[t].initializeEvent()})}},{key:"destroy",value:function(){var e=this;this.destroyEventMachin(),Object.keys(this.childComponents).forEach(function(t){e[t]&&e[t].destroy()})}},{key:"destroyEventMachin",value:function(){this.removeEventAll()}},{key:"initializeEventMachin",value:function(){this.filterProps(Me).forEach(this.parseEvent.bind(this))}},{key:"collectProps",value:function(){if(!this.collapsedProps){for(var t=this.__proto__,e=[];e.push.apply(e,O(Object.getOwnPropertyNames(t))),t=t.__proto__;);this.collapsedProps=e}return this.collapsedProps}},{key:"filterProps",value:function(e){return this.collectProps().filter(function(t){return t.match(e)})}},{key:"parseEvent",value:function(t){var e=t.split(" ");this.bindingEvent(e,this[t].bind(this))}},{key:"getDefaultDomElement",value:function(t){var e=void 0;return(e=t?this.refs[t]||this[t]||window[t]:this.el||this.$el||this.$root)instanceof Ce?e.getElement():e}},{key:"getDefaultEventObject",value:function(t){var e=this,n=t.split("."),r=n.shift(),i=n.includes("Control"),o=n.includes("Shift"),a=n.includes("Alt"),t=n.includes("Meta"),s=(n=n.filter(function(t){return!1===Ie.includes(t)})).filter(function(t){return!!e[t]});return{eventName:r,isControl:i,isShift:o,isAlt:a,isMeta:t,codes:n=n.filter(function(t){return!1===s.includes(t)}).map(function(t){return t.toLowerCase()}),checkMethodList:s}}},{key:"bindingEvent",value:function(t,e){var n=(r=t,Array.isArray(r)?r:Array.from(r)),t=n[0],r=n[1],n=n.slice(2),r=this.getDefaultDomElement(r),t=this.getDefaultEventObject(t);t.dom=r,t.delegate=n.join(" "),this.addEvent(t,e)}},{key:"matchPath",value:function(t,e){return t?t.matches(e)?t:this.matchPath(t.parentElement,e):null}},{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:"checkEventType",value:function(e,t){var n=this,r=!t.isControl||e.ctrlKey,i=!t.isShift||e.shiftKey,o=!t.isAlt||e.altKey,a=!t.isMeta||e.metaKey,s=!0;t.codes.length&&(s=t.codes.includes(e.code.toLowerCase())||t.codes.includes(e.key.toLowerCase()));var l=!0;return t.checkMethodList.length&&(l=t.checkMethodList.every(function(t){return n[t].call(n,e)})),r&&o&&i&&a&&s&&l}},{key:"makeCallback",value:function(n,r){var i=this;return n.delegate?function(t){if(t.xy=Se.posXY(t),i.checkEventType(t,n)){var e=i.matchPath(t.target||t.srcElement,n.delegate);if(e)return t.delegateTarget=e,t.$delegateTarget=new Ce(e),r(t)}}:function(t){if(t.xy=Se.posXY(t),i.checkEventType(t,n))return r(t)}}},{key:"addEvent",value:function(t,e){t.callback=this.makeCallback(t,e),this.addBinding(t);e=!0;"touchstart"===t.eventName&&(e={passive:!0}),Se.addEvent(t.dom,t.eventName,t.callback,e)}},{key:"removeEventAll",value:function(){var e=this;
1this.getBindings().forEach(function(t){e.removeEvent(t)}),this.initBindings()}},{key:"removeEvent",value:function(t){var e=t.eventName,n=t.dom,t=t.callback;Se.removeEvent(n,e,t)}}]),De);function De(){y(this,De),this.state=new Pe(this),this.refs={},this.childComponents=this.components()}var Te=/^@/,X=(C(Ve,F),m(Ve,[{key:"initializeStoreEvent",value:function(){var n=this;this.storeEvents={},this.filterProps(Te).forEach(function(t){var e=t.split("@");e.shift();e=e.join("@");n.storeEvents[e]=n[t].bind(n),n.$store.on(e,n.storeEvents[e])})}},{key:"destoryStoreEvent",value:function(){var e=this;Object.keys(this.storeEvents).forEach(function(t){e.$store.off(t,e.storeEvents[t])})}}]),Ve);function Ve(t){y(this,Ve);var e=w(this,(Ve.__proto__||Object.getPrototypeOf(Ve)).call(this,t));return e.opt=t||{},t&&t.$store&&(e.$store=t.$store),e.initialize(),e.initializeStoreEvent(),e}var Ue=(C(Ae,K),m(Ae,[{key:"initialize",value:function(){k(Ae.prototype.__proto__||Object.getPrototypeOf(Ae.prototype),"initialize",this).call(this),this.$store.rgb={},this.$store.hsl={},this.$store.hsv={},this.$store.alpha=1,this.$store.format="hex"}},{key:"/changeFormat",value:function(t,e){t.format=e,t.emit("changeFormat")}},{key:"/initColor",value:function(t,e,n){t.dispatch("/changeColor",e,n,!0),t.emit("initColor")}},{key:"/changeColor",value:function(t,e,n,r){(e="string"==typeof(e=e||"#FF0000")?dt.parse(e):e).source=e.source||n,t.alpha=void 0===(n=e.a)||null==n?t.alpha:e.a,t.format="hsv"!=e.type&&e.type||t.format,"hsl"==e.type?(t.hsl=Object.assign(t.hsl,e),t.rgb=dt.HSLtoRGB(t.hsl),t.hsv=dt.HSLtoHSV(e)):"hex"==e.type||"rgb"==e.type?(t.rgb=Object.assign(t.rgb,e),t.hsl=dt.RGBtoHSL(t.rgb),t.hsv=dt.RGBtoHSV(e)):"hsv"==e.type&&(t.hsv=Object.assign(t.hsv,e),t.rgb=dt.HSVtoRGB(t.hsv),t.hsl=dt.HSVtoHSL(t.hsv)),r||t.emit("changeColor",e.source)}},{key:"/getHueColor",value:function(t){return xt.checkHueColor(t.hsv.h/360)}},{key:"/toString",value:function(t,e){var n=t[e=e||t.format]||t.rgb;return dt.format(x({},n,{a:t.alpha}),e)}},{key:"/toColor",value:function(t,e){return"rgb"==(e=e||t.format)?t.dispatch("/toRGB"):"hsl"==e?t.dispatch("/toHSL"):"hex"==e?t.dispatch("/toHEX"):t.dispatch("/toString",e)}},{key:"/toRGB",value:function(t){return t.dispatch("/toString","rgb")}},{key:"/toHSL",value:function(t){return t.dispatch("/toString","hsl")}},{key:"/toHEX",value:function(t){return t.dispatch("/toString","hex").toUpperCase()}}]),Ae);function Ae(){return y(this,Ae),w(this,(Ae.__proto__||Object.getPrototypeOf(Ae)).apply(this,arguments))}var Le=(m(He,[{key:"initialize",value:function(){this.initializeModule()}},{key:"initializeModule",value:function(){var e=this;this.modules.forEach(function(t){new t(e)})}},{key:"action",value:function(t,e){this.actions[t]={context:e,callback:e[t]}}},{key:"dispatch",value:function(t){var e=[].concat(Array.prototype.slice.call(arguments)),t=e.shift(),t=this.actions[t];if(t)return t.callback.apply(t.context,[this].concat(O(e)))}},{key:"module",value:function(t){}},{key:"on",value:function(t,e){this.callbacks.push({event:t,callback:e})}},{key:"off",value:function(e,n){0==arguments.length?this.callbacks=[]:1==arguments.length?this.callbacks=this.callbacks.filter(function(t){return t.event!=e}):2==arguments.length&&(this.callbacks=this.callbacks.filter(function(t){return t.event!=e&&t.callback!=n}))}},{key:"emit",value:function(){var e=[].concat(Array.prototype.slice.call(arguments)),n=e.shift();this.callbacks.filter(function(t){return t.event==n}).forEach(function(t){t&&"function"==typeof t.callback&&t.callback.apply(t,O(e))})}}]),He);function He(t){y(this,He),this.callbacks=[],this.actions=[],this.modules=t.modules||[],this.initialize()}C(Be,X),m(Be,[{key:"initialize",value:function(){var e=this;this.$body=null,this.$root=null,this.$store=new Le({modules:[Ue,_e]}),this.callbackChange=function(){e.callbackColorValue()},this.callbackLastUpdate=function(){e.callbackLastUpdateColorValue()},this.callbackAddCurrentColor=function(t){e.callbackAddCurrentColorValue(t)},this.colorpickerShowCallback=function(){},this.colorpickerHideCallback=function(){},this.colorpickerLastUpdateCallback=function(){},this.colorpickerAddCurrentColorCallback=function(){},this.$body=new Ce(this.getContainer()),this.$root=new Ce("div","easylogic-colorpicker",{tabIndex:-1}),"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.$arrow=new Ce("div","arrow"),this.$root.append(this.$arrow),this.opt.colorSets?this.$store.dispatch("/setUserPalette",this.opt.colorSet):$t(this.opt.onRetrievePreset)?this.$store.dispatch("/setUserPalette",this.opt.onRetrievePreset()):this.$store.dispatch("/setUserPalette",[]),this.render(),this.$root.append(this.$el),this.initColorWithoutChangeEvent(this.opt.color),this.initializeEvent()}},{key:"initColorWithoutChangeEvent",value:function(t){this.$store.dispatch("/initColor",t)}},{key:"show",value:function(t,e,n,r,i,o){this.colorpickerShowCallback=n,this.colorpickerHideCallback=r,this.colorpickerLastUpdateCallback=i,this.colorpickerAddCurrentColorCallback=o,this.$root.css(this.getInitalizePosition()).show(),this.isColorPickerShow=!0,this.isShortCut=t.isShortCut||!1,this.outputFormat=t.outputFormat,this.hideDelay=+(void 0===t.hideDelay?2e3:t.hideDelay),0<this.hideDelay&&this.setHideDelay(this.hideDelay),this.$root.appendTo(this.$body),this.definePosition(t),this.initColorWithoutChangeEvent(e)}},{key:"initColor",value:function(t,e){this.$store.dispatch("/changeColor",t,e)}},{key:"hide",value:function(){this.isColorPickerShow&&(this.$root.hide(),this.$root.remove(),this.isColorPickerShow=!1,this.callbackHideColorValue())}},{key:"setColorsInPalette",value:function(){this.$store.dispatch("/setCurrentColorAll",0<arguments.length&&void 0!==arguments[0]?arguments[0]:[])}},{key:"setUserPalette",value:function(){this.$store.dispatch("/setUserPalette",0<arguments.length&&void 0!==arguments[0]?arguments[0]:[])}},{key:"getOption",value:function(t){return this.opt[t]}},{key:"setOption",value:function(t,e){this.opt[t]=e}},{key:"isType",value:function(t){return this.getOption("type")==t}},{key:"isPaletteType",value:function(){return this.isType("palette")}},{key:"isSketchType",value:function(){return this.isType("sketch")}},{key:"getContainer",value:function(){return this.opt.container||document.body}},{key:"getColor",value:function(t){return this.$store.dispatch("/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);t=t.top-this.$body.scrollTop();n+t>window.innerHeight&&(t-=n+t-window.innerHeight),this.$root.css({left:r+"px",to
1p:(t=t<0?0:t)+"px"})}},{key:"getInitalizePosition",value:function(){return"inline"==this.opt.position?{position:"relative",left:"auto",top:"auto",display:"inline-block"}:{position:"fixed",left:"-10000px",top:"-10000px"}}},{key:"isAbsolute",value:function(){return"inline"!==this.opt.position}},{key:"mouseup.isAbsolute document",value:function(t){this.__isMouseDown=!1,this.checkInHtml(t.target)||(0==this.checkColorPickerClass(t.target)?this.hide():this.__isMouseIn||(clearTimeout(this.timerCloseColorPicker),this.timerCloseColorPicker=setTimeout(this.hide.bind(this),this.delayTime||this.hideDelay)))}},{key:"keyup.isAbsolute.escape $root",value:function(t){this.hide()}},{key:"mouseover.isAbsolute $root",value:function(t){clearTimeout(this.timerCloseColorPicker)}},{key:"mousemove.isAbsolute $root",value:function(t){clearTimeout(this.timerCloseColorPicker)}},{key:"mouseenter.isAbsolute $root",value:function(t){clearTimeout(this.timerCloseColorPicker),this.__isMouseIn=!0}},{key:"mouseleave.isAbsolute $root",value:function(t){this.__isMouseIn=!1,this.__isMouseDown||(clearTimeout(this.timerCloseColorPicker),this.timerCloseColorPicker=setTimeout(this.hide.bind(this),this.delayTime||this.hideDelay))}},{key:"mousedown.isAbsolute $root",value:function(t){this.__isMouseDown=!0}},{key:"setHideDelay",value:function(t){this.delayTime=t||0}},{key:"runHideDelay",value:function(){this.isColorPickerShow&&this.setHideDelay()}},{key:"callbackColorValue",value:function(t){t=t||this.getCurrentColor(),"function"==typeof this.opt.onChange&&this.opt.onChange.call(this,t),"function"==typeof this.colorpickerShowCallback&&this.colorpickerShowCallback(t)}},{key:"callbackLastUpdateColorValue",value:function(t){t=t||this.getCurrentColor(),"function"==typeof this.opt.onLastUpdate&&this.opt.onLastUpdate.call(this,t),"function"==typeof this.colorpickerLastUpdateCallback&&this.colorpickerLastUpdateCallback(t)}},{key:"callbackAddCurrentColorValue",value:function(t){"function"==typeof this.opt.onLastUpdate&&this.opt.onAddPreset.call(this,t),"function"==typeof this.colorpickerAddCurrentColorCallback&&this.colorpickerAddCurrentColorCallback(t)}},{key:"callbackHideColorValue",value:function(t){t=t||this.getCurrentColor(),"function"==typeof this.opt.onHide&&this.opt.onHide.call(this,t),"function"==typeof this.colorpickerHideCallback&&this.colorpickerHideCallback(t)}},{key:"getCurrentColor",value:function(){return this.$store.dispatch("/toColor",this.outputFormat)}},{key:"checkColorPickerClass",value:function(t){var e=new Ce(t).closest("codemirror-colorview"),n=new Ce(t).closest("easylogic-colorpicker"),r=new Ce(t).closest("CodeMirror");t.nodeName;return!!(n||e||r)}},{key:"checkInHtml",value:function(t){return"HTML"==t.nodeName}},{key:"initializeStoreEvent",value:function(){k(Be.prototype.__proto__||Object.getPrototypeOf(Be.prototype),"initializeStoreEvent",this).call(this),this.$store.on("changeColor",this.callbackChange),this.$store.on("lastUpdateColor",this.callbackLastUpdate),this.$store.on("changeFormat",this.callbackChange),this.$store.on("addCurrentColor",this.callbackAddCurrentColor)}},{key:"destroy",value:function(){k(Be.prototype.__proto__||Object.getPrototypeOf(Be.prototype),"destroy",this).call(this),this.$store.off("changeColor",this.callbackChange),this.$store.off("lastUpdateColor",this.callbackLastUpdate),this.$store.off("changeFormat",this.callbackChange),this.$store.off("addCurrentColor",this.callbackAddCurrentColor),this.callbackChange=void 0,this.callbackLastUpdate=void 0,this.callbackAddCurrentColor=void 0,this.colorpickerShowCallback=void 0,this.colorpickerHideCallback=void 0}}]),J=Be;function Be(t){y(this,Be);t=w(this,(Be.__proto__||Object.getPrototypeOf(Be)).call(this,t));return t.isColorPickerShow=!1,t.isShortCut=!1,t.hideDelay=+(void 0===t.opt.hideDeplay?2e3:t.opt.hideDelay),t.timerCloseColorPicker,t.autoHide=t.opt.autoHide||!0,t.outputFormat=t.opt.outputFormat,t.$checkColorPickerClass=t.checkColorPickerClass.bind(t),t}C(Re,X),m(Re,[{key:"refresh",value:function(){}},{key:"refreshColorUI",value:function(t){}},{key:"changeColor",value:function(t){this.$store.dispatch("/changeColor",Object.assign({source:this.source},t||{}))}},{key:"mouseup document",value:function(t){this.onDragEnd(t)}},{key:"mousemove document",value:function(t){this.onDragMove(t)}},{key:"mousedown $bar",value:function(t){t.preventDefault(),this.isDown=!0}},{key:"mousedown $container",value:function(t){this.isDown=!0,this.onDragStart(t)}},{key:"touchend document",value:function(t){this.onDragEnd(t)}},{key:"touchmove document",value:function(t){this.onDragMove(t)}},{key:"touchstart $bar",value:function(t){t.preventDefault(),this.isDown=!0}},{key:"touchstart $container",value:function(t){this.onDragStart(t)}},{key:"onDragStart",value:function(t){this.isDown=!0,this.refreshColorUI(t)}},{key:"onDragMove",value:function(t){this.isDown&&this.refreshColorUI(t)}},{key:"onDragEnd",value:function(t){this.isDown&&(this.$store.emit("lastUpdateColor"),this.isDown=!1)}},{key:"@changeColor",value:function(t){this.source!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),F=Re;function Re(t){y(this,Re);t=w(this,(Re.__proto__||Object.getPrototypeOf(Re)).call(this,t));return t.source="base-box",t}C(Ne,F),m(Ne,[{key:"getMinMaxPosition",value:function(){var t=this.getMinPosition(),e=this.getMaxDist();return{min:t,max:t+e,width:e}}},{key:"getCurrent",value:function(t){return min+this.getMaxDist()*t}},{key:"getMinPosition",value:function(){return this.refs.$container.offset().left}},{key:"getMaxDist",value:function(){return this.state.get("$container.width")}},{key:"getDist",value:function(t){var e=this.getMinMaxPosition(),n=e.min,e=e.max,n=t<n?0:e<t?100:(t-n)/(e-n)*100;return n}},{key:"getCaculatedDist",value:function(t){t=t?this.getMousePosition(t):this.getCurrent(this.getDefaultValue()/this.maxValue);return this.getDist(t)}},{key:"getDefaultValue",value:function(){return 0}},{key:"setMousePosition",value:function(t){this.refs.$bar.css({left:t+"px"})}},{key:"getMousePosition",value:function(t){return Se.pos(t).pageX}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(t){if(t=t||this.getDefaultValue(),this.lastV===t)return!0;(this.lastV=t)<=this.minValue?this.refs.$bar.addClass("first").removeClass("last"):(t>=this.maxValue?this.refs.$bar.addClass("last"):this.refs.$bar.removeClass("last")).removeClass("first"),this.setMousePosition(this.getMaxDist()*((t||0)/this.maxValue))}}]),K=Ne;function Ne(t){y(this,Ne);t=w(this,(Ne.__proto__||Object.getPrototypeOf(Ne)).call(this,t));return t.minValue=0,t.maxValue=1,t.source="base-slider",t}var Fe=(C(Xe,K),m(Xe,[{key:"template",value:function(){return'\n <div class="value">\n <div ref="$container" class="value-container">\n <div ref="$bar" class="drag-bar"></div>\n </div>\n </div>\n '}}
1,{key:"setBackgroundColor",value:function(){this.refs.$container.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){k(Xe.prototype.__proto__||Object.getPrototypeOf(Xe.prototype),"refresh",this).call(this),this.setBackgroundColor()}},{key:"getDefaultValue",value:function(){return this.$store.hsv.v}},{key:"refreshColorUI",value:function(t){t=this.getCaculatedDist(t);this.setColorUI(t/100*this.maxValue),this.changeColor({type:"hsv",v:t/100*this.maxValue})}}]),Xe);function Xe(t){y(this,Xe);t=w(this,(Xe.__proto__||Object.getPrototypeOf(Xe)).call(this,t));return t.minValue=0,t.maxValue=1,t.source="value-control",t}var Ye=(C(Ge,K),m(Ge,[{key:"template",value:function(){return'\n <div class="opacity">\n <div ref="$container" class="opacity-container">\n <div ref="$colorbar" class="color-bar"></div>\n <div ref="$bar" class="drag-bar2"></div>\n </div>\n </div>\n '}},{key:"refresh",value:function(){k(Ge.prototype.__proto__||Object.getPrototypeOf(Ge.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=Object.assign({},this.$store.rgb);t.a=0;var e=dt.format(t,"rgb");t.a=1;t=dt.format(t,"rgb");this.setOpacityColorBarBackground(e,t)}},{key:"setOpacityColorBarBackground",value:function(t,e){this.refs.$colorbar.css("background","linear-gradient(to right, "+t+", "+e+")")}},{key:"getDefaultValue",value:function(){return this.$store.alpha}},{key:"refreshColorUI",value:function(t){t=this.getCaculatedDist(t);this.setColorUI(t/100*this.maxValue),this.changeColor({a:Math.floor(t)/100*this.maxValue})}}]),Ge);function Ge(t){y(this,Ge);t=w(this,(Ge.__proto__||Object.getPrototypeOf(Ge)).call(this,t));return t.minValue=0,t.maxValue=1,t.source="opacity-control",t}var ze=(C(qe,X),m(qe,[{key:"components",value:function(){return{Value:Fe,Opacity:Ye}}},{key:"template",value:function(){return'\n <div class="control">\n <div target="Value" ></div>\n <div target="Opacity" ></div>\n <div ref="$controlPattern" class="empty"></div>\n <div ref="$controlColor" class="color"></div>\n </div>\n '}},{key:"setBackgroundColor",value:function(){this.refs.$controlColor.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){this.setColorUI(),this.setBackgroundColor()}},{key:"setColorUI",value:function(){this.Value.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"macos-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),qe);function qe(){return y(this,qe),w(this,(qe.__proto__||Object.getPrototypeOf(qe)).apply(this,arguments))}var Ke=(C(We,X),m(We,[{key:"template",value:function(){return'\n <div class="wheel">\n <canvas class="wheel-canvas" ref="$colorwheel" ></canvas>\n <div class="wheel-canvas" ref="$valuewheel" ></div>\n <div class="drag-pointer" ref="$drag_pointer"></div>\n </div>\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, "+t+")"})}},{key:"renderWheel",value:function(t,e){this.width&&!t&&(t=this.width),this.height&&!e&&(e=this.height);var n=new Ce("canvas"),r=n.el.getContext("2d");n.el.width=t,n.el.height=e,n.css({width:t+"px",height:e+"px"});for(var i=r.getImageData(0,0,t,e),o=i.data,a=Math.floor(t/2),s=Math.floor(e/2),l=e<t?s:a,u=a,c=s,h=0;h<e;h++)for(var f=0;f<t;f++){var v=f-u+1,p=h-c+1,d=v*v+p*p,p=g(v,p),p=dt.HSVtoRGB(p,Math.min(Math.sqrt(d)/l,1),1),d=4*(h*t+f);o[d]=p.r,o[1+d]=p.g,o[2+d]=p.b,o[3+d]=255}return r.putImageData(i,0,0),0<this.thinkness&&(r.globalCompositeOperation="destination-out",r.fillStyle="black",r.beginPath(),r.arc(u,c,l-this.thinkness,0,2*Math.PI),r.closePath(),r.fill()),n}},{key:"renderCanvas",value:function(){var t,e,n,r;this.$store.createdWheelCanvas||(e=(t=this.refs.$colorwheel).el.getContext("2d"),n=t.size(),n=(r=_(n,2))[0],r=r[1],this.width&&!n&&(n=this.width),this.height&&!r&&(r=this.height),t.el.width=n,t.el.height=r,t.css({width:n+"px",height:r+"px"}),r=this.renderWheel(n,r),e.drawImage(r.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,i){return t?Se.posXY(t):function(t,e,n,r){return n=2<arguments.length&&void 0!==n?n:0,r=3<arguments.length&&void 0!==r?r:0,{x:s(t,e,n),y:l(t,e,r)}}(e,n,r,i)}},{key:"getRectangle",value:function(){var t=this.state.get("$el.width"),e=this.state.get("$el.height"),n=this.state.get("$colorwheel.width")/2,r=this.refs.$el.offset().left,i=r+t/2,o=this.refs.$el.offset().top;return{minX:r,minY:o,width:t,height:e,radius:n,centerX:i,centerY:o+e/2}}},{key:"setHueColor",value:function(t,e){var n,r,i,o,a,s,l,u,c;this.state.get("$el.width")&&(n=(u=this.getRectangle()).minX,r=u.minY,c=u.radius,i=u.centerX,s=u.centerY,a=(o=(l=(a=this.getCurrentXY(t,this.getDefaultValue(),this.getDefaultSaturation()*c,i,s)).x)-i)*o+(t=(u=a.y)-s)*t,t=g(o,t),c*c<a&&(l=(s=this.getCurrentXY(null,t,c,i,s)).x,u=s.y),c=Math.min(Math.sqrt(a)/c,1),this.refs.$drag_pointer.css({left:l-n+"px",top:u-r+"px"}),e||this.changeColor({type:"hsv",h:t,s:c}))}},{key:"changeColor",value:function(t){this.$store.dispatch("/changeColor",Object.assign({source:this.source},t||{}))}},{key:"@changeColor",value:function(t){this.source!=t&&this.refresh(!0)}},{key:"@initColor",value:function(){this.refresh(!0)}},{key:"mouseup document",value:function(t){this.isDown&&(this.isDown=!1,this.$store.emit("lastUpdateColor"))}},{key:"mousemove document",value:function(t){this.isDown&&this.setHueColor(t)}},{key:"mousedown $drag_pointer",value:function(t){t.preventDefault(),this.isDown=!0}},{key:"mousedown $el",value:function(t){this.isDown=!0,this.setHueColor(t)}},{key:"touchend document",value:function(t){this.isDown&&(this.isDown=!1,this.$store.emit("lastUpdateColor"))}},{key:"touchmove document",value:function(t){this.isDown&&this.setHueColor(t)}},{key:"touchstart $drag_pointer",value:function(t){t.preventDefault(),this.isDown=!0}},{key:"touchstart $el",value:function(t){t.preventDefault(),this.isDown=!0,this.setHueColor(t)}}]),We);function We(t){y(this,We);t=w(this,(We.__proto__||Object.getPrototypeOf(We)).call(this,t));return t.width=214,t.height=214,t.thinkness=0,t.half_thinkness=0,t.source="colorwheel",t}var Je="chromedevtool-information",Ze=(C(Qe,X),m(Qe,[{key:"template",value:function(){return'\n <div class="information hex">\n <div ref="$informationChange" class="information-change">\n <button ref="$formatChangeButton" type="button" class="format-change-button arrow-button"></button>\n </div>\n <div class="information-item hex">\n <div class="input-field hex">\n <input ref="$hexCode" class="input" type="text" />\n <div class="title">HEX</div>\n </div>\n </div>\n <div class="information-item rgb">\n <div class="input-field rgb-r">\n <input ref="$rgb_r" class="input" type="number" step="1" min="0" max="255" />\n <div class="title">R</div>\n </div>\n <div class="input-field rgb-g">\n <input ref="$rgb_g" class="input" type="number" step="1" min="0" max="255" />\n <div class="title">
1G</div>\n </div>\n <div class="input-field rgb-b">\n <input ref="$rgb_b" class="input" type="number" step="1" min="0" max="255" />\n <div class="title">B</div>\n </div> \n <div class="input-field rgb-a">\n <input ref="$rgb_a" class="input" type="number" step="0.01" min="0" max="1" />\n <div class="title">A</div>\n </div> \n </div>\n <div class="information-item hsl">\n <div class="input-field hsl-h">\n <input ref="$hsl_h" class="input" type="number" step="1" min="0" max="360" />\n <div class="title">H</div>\n </div>\n <div class="input-field hsl-s">\n <input ref="$hsl_s" class="input" type="number" step="1" min="0" max="100" />\n <div class="postfix">%</div>\n <div class="title">S</div>\n </div>\n <div class="input-field hsl-l">\n <input ref="$hsl_l" class="input" type="number" step="1" min="0" max="100" />\n <div class="postfix">%</div> \n <div class="title">L</div>\n </div>\n <div class="input-field hsl-a">\n <input ref="$hsl_a" class="input" type="number" step="0.01" min="0" max="1" />\n <div class="title">A</div>\n </div>\n </div>\n </div>\n '}},{key:"setCurrentFormat",value:function(t){this.format=t,this.initFormat()}},{key:"initFormat",value:function(){var e=this,n=this.format||"hex";["hex","rgb","hsl"].filter(function(t){return t!==n}).forEach(function(t){e.$el.removeClass(t)}),this.$el.addClass(n)}},{key:"nextFormat",value:function(){var t=this.format||"hex",e="hex";"hex"==t?e="rgb":"rgb"==t?e="hsl":"hsl"==t&&(e="hex"),this.format=e,this.initFormat(),this.$store.dispatch("/changeFormat",this.format),this.$store.emit("lastUpdateColor")}},{key:"goToFormat",value:function(t){"rgb"!==(this.format=t)&&"hsl"!==t||this.initFormat(),this.$store.dispatch("/changeFormat",this.format)}},{key:"getFormat",value:function(){return this.format||"hex"}},{key:"checkNumberKey",value:function(t){t=t.which;return 37==t||39==t||8==t||46==t||9==t||!(t<48||57<t)}},{key:"checkNotNumberKey",value:function(t){return!this.checkNumberKey(t)}},{key:"changeRgbColor",value:function(){this.$store.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(),source:Je}),this.$store.emit("lastUpdateColor")}},{key:"changeHslColor",value:function(){this.$store.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(),source:Je}),this.$store.emit("lastUpdateColor")}},{key:"@changeColor",value:function(t){Je!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}},{key:"input $rgb_r",value:function(t){this.changeRgbColor()}},{key:"input $rgb_g",value:function(t){this.changeRgbColor()}},{key:"input $rgb_b",value:function(t){this.changeRgbColor()}},{key:"input $rgb_a",value:function(t){this.changeRgbColor()}},{key:"input $hsl_h",value:function(t){this.changeHslColor()}},{key:"input $hsl_s",value:function(t){this.changeHslColor()}},{key:"input $hsl_l",value:function(t){this.changeHslColor()}},{key:"input $hsl_a",value:function(t){this.changeHslColor()}},{key:"keyup $hexCode",value:function(t){var e=this.refs.$hexCode.val();"#"!=e.charAt(0)||7!=e.length&&9!==e.length||(this.$store.dispatch("/changeColor",e,Je),this.$store.emit("lastUpdateColor"))}},{key:"click $formatChangeButton",value:function(t){this.nextFormat()}},{key:"click $el .information-item.hex .input-field .title",value:function(t){this.goToFormat("hex")}},{key:"click $el .information-item.rgb .input-field .title",value:function(t){this.goToFormat("hsl")}},{key:"click $el .information-item.hsl .input-field .title",value:function(t){this.goToFormat("rgb")}},{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.$store.dispatch("/toHEX"))}},{key:"refresh",value:function(){this.setCurrentFormat(this.$store.format),this.setRGBInput(),this.setHSLInput(),this.setHexInput()}}]),Qe);function Qe(){return y(this,Qe),w(this,(Qe.__proto__||Object.getPrototypeOf(Qe)).apply(this,arguments))}var tn=(C(en,X),m(en,[{key:"template",value:function(){return'\n <div class="color-chooser">\n <div class="color-chooser-container">\n <div class="colorsets-item colorsets-item-header">\n <h1 class="title">Color Palettes</h1>
1\n <span ref="$toggleButton" class="items">×</span>\n </div>\n <div ref="$colorsetsList" class="colorsets-list"></div>\n </div>\n </div>\n '}},{key:"refresh",value:function(){this.load()}},{key:"@changeCurrentColorSets",value:function(){this.refresh()}},{key:"@toggleColorChooser",value:function(){this.toggle()}},{key:"load $colorsetsList",value:function(){return"\n <div>\n "+this.$store.dispatch("/getColorSetsList").map(function(t,e){return'\n <div class="colorsets-item" data-colorsets-index="'+e+'" >\n <h1 class="title">'+t.name+'</h1>\n <div class="items">\n <div>\n '+t.colors.filter(function(t,e){return e<5}).map(function(t){return'<div class="color-item" title="'+(t=t||"rgba(255, 255, 255, 1)")+'">\n <div class="color-view" style="background-color: '+t+'"></div>\n </div>'}).join("")+"\n </div>\n </div>\n </div>"}).join("")+"\n </div>\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:"click $toggleButton",value:function(t){this.toggle()}},{key:"click $colorsetsList .colorsets-item",value:function(t){t=t.$delegateTarget;t&&(t=parseInt(t.attr("data-colorsets-index")),this.$store.dispatch("/setCurrentColorSets",t),this.hide())}},{key:"destroy",value:function(){k(en.prototype.__proto__||Object.getPrototypeOf(en.prototype),"destroy",this).call(this),this.hide()}}]),en);function en(){return y(this,en),w(this,(en.__proto__||Object.getPrototypeOf(en)).apply(this,arguments))}var nn=(C(rn,X),m(rn,[{key:"template",value:function(){return'\n <div class="colorsets">\n <div class="menu" title="Open Color Palettes">\n <button ref="$colorSetsChooseButton" type="button" class="color-sets-choose-btn arrow-button"></button>\n </div>\n <div ref="$colorSetsColorList" class="color-list"></div>\n </div>\n '}},{key:"load $colorSetsColorList",value:function(){var t=this.$store.dispatch("/getCurrentColorSets"),e=this.$store.dispatch("/getCurrentColors");return"\n <div>\n <h6>"+t.name+'</h6>\n <div class="current-color-sets">\n '+e.map(function(t,e){return'<div class="color-item" title="'+t+'" data-index="'+e+'" data-color="'+t+'">\n <div class="empty"></div>\n <div class="color-view" style="background-color: '+t+'"></div>\n </div>'}).join("")+" \n "+(t.edit?'<div class="add-color-item">+</div>':"")+" \n </div>\n </div>\n \n "}},{key:"refresh",value:function(){this.load()}},{key:"addColor",value:function(t){this.$store.dispatch("/addCurrentColor",t)}},{key:"@changeCurrentColorSets",value:function(){this.refresh()}},{key:"click $colorSetsChooseButton",value:function(t){this.$store.emit("toggleColorChooser")}},{key:"contextmenu $colorSetsColorList",value:function(t){var e;t.preventDefault(),this.$store.dispatch("/getCurrentColorSets").edit&&((e=new Ce(t.target).closest("color-item"))?(e=parseInt(e.attr("data-index")),this.$store.emit("showContextMenu",t,e)):this.$store.emit("showContextMenu",t))}},{key:"click $colorSetsColorList .add-color-item",value:function(t){this.addColor(this.$store.dispatch("/toColor"))}},{key:"click $colorSetsColorList .color-item",value:function(t){this.$store.dispatch("/changeColor",t.$delegateTarget.attr("data-color")),this.$store.emit("lastUpdateColor")}}]),rn);function rn(){return y(this,rn),w(this,(rn.__proto__||Object.getPrototypeOf(rn)).apply(this,arguments))}var on=(C(an,X),m(an,[{key:"template",value:function(){return'\n <ul class="colorsets-contextmenu">\n <li class="menu-item small-hide" data-type="remove-color">Remove color</li>\n <li class="menu-item small-hide" data-type="remove-all-to-the-right">Remove all to the right</li>\n <li class="menu-item" data-type="clear-palette">Clear palette</li>\n </ul>\n '}},{key:"show",value:function(t,e){t=Se.pos(t);this.$el.css({top:t.clientY-10+"px",left:t.clientX+"px"}),this.$el.addClass("show"),this.selectedColorIndex=e,void 0===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.$store.dispatch("/removeCurrentColor",this.selectedColorIndex);break;case"remove-all-to-the-right":this.$store.dispatch("/removeCurrentColorToTheRight",this.selectedColorIndex);break;case"clear-palette":this.$store.dispatch("/clearPalette")}}},{key:"@showContextMenu",value:function(t,e){this.show(t,e)}},{key:"click $el .menu-item",value:function(t){t.preventDefault(),this.runCommand(t.$delegateTarget.attr("data-type")),this.hide()}}]),an);function an(){return y(this,an),w(this,(an.__proto__||Object.getPrototypeOf(an)).apply(this,arguments))}var sn=(C(ln,J),m(ln,[{key:"template",value:function(){return'\n <div class=\'colorpicker-body\'>\n <div target="colorwheel"></div>\n <div target="control"></div>\n <div target="information"></div>\n <div target="currentColorSets"></div>\n <div target="colorSetsChooser"></div>\n <div target="contextMenu"></div> \n </div>\n '}},{key:"components",value:function(){return{colorwheel:Ke,control:ze,information:Ze,currentColorSets:nn,colorSetsChooser:tn,contextMenu:on}}}]),ln);function ln(){return y(this,ln),w(this,(ln.__proto__||Object.getPrototypeOf(ln)).apply(this,arguments))}var un=(C(cn,K),m(cn,[{key:"template",value:function(){return'\n <div class="hue"> \n <div ref="$container" class="hue-container">\n <div ref="$bar" class="drag-bar"></div>\n </div>\n </div>\n '}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"refreshColorUI",value:function(t){t=this.getCaculatedDist(t);!0!==this.setColorUI(t/100*this.maxValue)&&this.changeColor({h:t/100*this.maxValue,type:"hsv"})}}]),cn);function cn(t){y(this,cn);t=w(this,(cn.__proto__||Object.getPrototypeOf(cn)).call(this,t));return t.minValue=0,t.maxValue=360,t.source="hue-control",t}var hn=(C(fn,K),m(fn,[{key:"initialize",value:function(){k(fn.prototype.__proto__||Object.getPrototypeOf(fn.prototype),"initialize",this).call(this),this.minValue=0,this.maxValue=360,this.hueScaleDist=.05}},{key:"template",value:function(){return'\n <div class="hue-scale">\n <div ref="$container" class="hue-scale-container">\n <div ref="$bar" class="drag-bar"></div>\n </div>\n </div>\n '}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"getCalculatedDist",value:function(t){t=t?this.getMousePosition(t):this.getCurrent(this.getDefaultValue()/this.maxValue);return this.getDist(t)}},{key:"refreshColorUI",value:function(t){t=this.getCalculatedDist(t);!0!==this.setColorUI(t/100)&&this.changeColor({h:360*(this.minValue+this.fullDist*(t/100)),type:"hsv"})}},{key:"setColorUI",value:function(t){var e=void 0;if(t){if(e=this.minValue+t*this.fullDist,this.lastP===e)return!0;this.lastP=e}else{if(e=this.getDefaultValue()/360,this.lastP===e)return!0;var n=(this.lastP=e)+.05,r=e-.05;1<n?r=(n=1)-2*this.hueScaleDist:r<0&&(t=Math.abs(r),r=0,n+=t);var r=xt.getHueScale(e,r,n),i=(this.list=r)[0].start,n=r[r.length-1].start;this.minValue=i,this.maxValue=n;var o=this.maxValue-this.minValue;this.fullDist=o;r=r.map(function(t){return{color:t.rgb,percent:(t.start-i)/o*100,unit:"%"}});this.refs.$container.css("background-image","linear-gradient(to right, "+r.map(function(t){return t.color+" "+t.percent+t.unit}).join(",")+")")}e<=this.minValue?(e=this.minValue,this.refs.$bar.addClass("first").removeClass("last")):e>=this.maxValue?(e=this.maxValue,this.refs.$bar.addClass("last").removeClass("first")):this.refs.$bar.removeClass("last").removeClass("first"),this.setMousePosition(this.getMaxDist()*((e-this.minValue)/this.fullDist))}}]),fn);function fn(){return y(this,fn),w(this,(fn.__proto__||Object.getPrototypeOf(fn)).apply(this,arguments))}
1var vn="chromedevtool-control",pn=(C(dn,X),m(dn,[{key:"components",value:function(){return{Hue:un,Opacity:Ye,HueScale:hn}}},{key:"template",value:function(){return'\n <div class="control">\n <div target="Hue" ></div>\n <div target="HueScale" ></div>\n <div target="Opacity" ></div>\n <div ref="$controlPattern" class="empty"></div>\n <div ref="$controlColor" class="color"></div>\n <div ref="$controlPattern2" class="empty2"></div>\n <div ref="$controlColor2" class="color2"></div> \n </div>\n '}},{key:"setBackgroundColor",value:function(){this.refs.$controlColor.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"setLastUpdateColor",value:function(){this.refs.$controlColor2.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){this.setColorUI(),this.setBackgroundColor()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){vn!=t&&this.refresh()}},{key:"@lastUpdateColor",value:function(t){vn!=t&&this.setLastUpdateColor()}},{key:"@initColor",value:function(){this.refresh()}}]),dn);function dn(){return y(this,dn),w(this,(dn.__proto__||Object.getPrototypeOf(dn)).apply(this,arguments))}var gn="chromedevtool-palette",yn=(C(mn,X),m(mn,[{key:"template",value:function(){return'\n <div class="color">\n <div ref="$saturation" class="saturation">\n <div ref="$value" class="value">\n <div ref="$drag_pointer" class="drag-pointer" data-axis-value="all">\n <div ref="$left_saturation" class="left-saturation" data-axis-value="saturation"></div>\n <div ref="$right_saturation" class="right-saturation" data-axis-value="saturation"></div>\n <div ref="$top_value" class="top-value" data-axis-value="value"></div>\n <div ref="$bottom_value" class="bottom-value" data-axis-value="value"></div>\n </div>\n </div>\n </div> \n </div> \n '}},{key:"setBackgroundColor",value:function(t){this.$el.css("background-color",t)}},{key:"refresh",value:function(){this.cacheSize(),this.setColorUI()}},{key:"calculateSV",value:function(){var t=this.drag_pointer_pos||{x:0,y:0},e=this.state.get("$el.width"),n=this.state.get("$el.height"),e=t.x/e,n=(n-t.y)/n;this.$store.dispatch("/changeColor",{type:"hsv",s:e,v:n,source:gn})}},{key:"setColorUI",value:function(){var t=this.w*this.$store.hsv.s,e=this.h*(1-this.$store.hsv.v);this.refs.$drag_pointer.css({left:t+"px",top:e+"px"}),this.drag_pointer_pos={x:t,y:e},this.setBackgroundColor(this.$store.dispatch("/getHueColor"))}},{key:"setSubColor",value:function(t){var e=t.pageX,n=t.pageY,r=e-this.x,i=n-this.y,o=this.$el.contentWidth(),a=this.$el.contentHeight(),s=this.refs.$drag_pointer.cssFloat("left"),t=this.refs.$drag_pointer.cssFloat("top");"saturation"===this.axis?s+=r:"value"===this.axis&&(t+=i),s<0?s=0:o<s&&(s=o),t<0?t=0:a<t&&(t=a),this.refs.$drag_pointer.px("left",s),this.refs.$drag_pointer.px("top",t),this.drag_pointer_pos={x:s,y:t},this.x=e,this.y=n,this.calculateSV()}},{key:"setMainColor",value:function(t){var e=this.$el.offset(),n=this.w,r=this.h,i=Se.pos(t).pageX-e.left,e=Se.pos(t).pageY-e.top;i<0?i=0:n<i&&(i=n),e<0?e=0:r<e&&(e=r),this.refs.$drag_pointer.css({left:i+"px",top:e+"px"}),this.drag_pointer_pos={x:i,y:e},this.calculateSV()}},{key:"@changeColor",value:function(t){gn!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}},{key:"mouseup document",value:function(t){this.isDown&&(this.isDown=!1,this.$store.emit("lastUpdateColor"))}},{key:"mousemove document",value:function(t){this.isDown&&(this.cacheSize(),"saturation"===this.axis||"value"===this.axis?this.setSubColor(t):this.setMainColor(t))}},{key:"mousedown",value:function(t){this.isDown=!0,this.cacheSize(),this.axis=new Ce(t.target).attr("data-axis-value"),this.x=t.pageX,this.y=t.pageY,"saturation"===this.axis||"value"===this.axis?this.setSubColor(t):this.setMainColor(t)}},{key:"touchend document",value:function(t){this.isDown&&(this.isDown=!1,this.$store.emit("lastUpdateColor"))}},{key:"touchmove document",value:function(t){this.isDown&&this.setMainColor(t)}},{key:"touchstart",value:function(t){t.preventDefault(),this.isDown=!0,this.cacheSize(),this.setMainColor(t)}},{key:"cacheSize",value:function(){this.w=this.state.get("$el.contentWidth"),this.h=this.state.get("$el.contentHeight")}}]),mn);function mn(){return y(this,mn),w(this,(mn.__proto__||Object.getPrototypeOf(mn)).apply(this,arguments))}var $n=(C(bn,J),m(bn,[{key:"template",value:function(){return'\n <div class=\'colorpicker-body\'>\n <div target="palette"></div> \n <div target="control"></div>\n <div target="information"></div>\n <div target="currentColorSets"></div>\n <div target="colorSetsChooser"></div>\n <div target="contextMenu"></div>\n </div>\n '}},{key:"components",value:function(){return{palette:yn,control:pn,information:Ze,currentColorSets:nn,colorSetsChooser:tn,contextMenu:on}}}]),bn);function bn(){return y(this,bn),w(this,(bn.__proto__||Object.getPrototypeOf(bn)).apply(this,arguments))}
1var kn=(C(Cn,X),m(Cn,[{key:"components",value:function(){return{Hue:un,Opacity:Ye}}},{key:"template",value:function(){return'\n <div class="control">\n <div target="Hue" ></div>\n <div target="Opacity" ></div>\n </div>\n '}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"mini-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),Cn);function Cn(){return y(this,Cn),w(this,(Cn.__proto__||Object.getPrototypeOf(Cn)).apply(this,arguments))}var xn=(C(wn,J),m(wn,[{key:"template",value:function(){return'\n <div class=\'colorpicker-body\'>\n <div target="palette"></div>\n <div target="control"></div>\n </div>\n '}},{key:"components",value:function(){return{palette:yn,control:kn}}}]),wn);function wn(){return y(this,wn),w(this,(wn.__proto__||Object.getPrototypeOf(wn)).apply(this,arguments))}C(_n,K),m(_n,[{key:"getMaxDist",value:function(){return this.state.get("$container.height")}},{key:"setMousePosition",value:function(t){this.refs.$bar.css({top:t+"px"})}},{key:"getMousePosition",value:function(t){return Se.pos(t).pageY}},{key:"getMinPosition",value:function(){return this.refs.$container.offset().top}},{key:"getCaculatedDist",value:function(t){t=t?this.getMousePosition(t):this.getCurrent(this.getDefaultValue()/this.maxValue);return 100-this.getDist(t)}},{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"):this.refs.$bar.removeClass("last")).removeClass("first");t=1-(t||0)/this.maxValue;this.setMousePosition(this.getMaxDist()*t)}}]),F=_n;function _n(t){y(this,_n);t=w(this,(_n.__proto__||Object.getPrototypeOf(_n)).call(this,t));return t.source="vertical-slider",t}var On=(C(Sn,F),m(Sn,[{key:"template",value:function(){return'\n <div class="hue">\n <div ref="$container" class="hue-container">\n <div ref="$bar" class="drag-bar"></div>\n </div>\n </div>\n '}},{key:"getDefaultValue",value:function(){return this.$store.hsv.h}},{key:"refreshColorUI",value:function(t){t=this.getCaculatedDist(t);this.setColorUI(t/100*this.maxValue),this.changeColor({h:t/100*this.maxValue,type:"hsv"})}}]),Sn);function Sn(t){y(this,Sn);t=w(this,(Sn.__proto__||Object.getPrototypeOf(Sn)).call(this,t));return t.minValue=0,t.maxValue=360,t.source="vertical-hue-control",t}var Pn=(C(jn,F),m(jn,[{key:"template",value:function(){return'\n <div class="opacity">\n <div ref="$container" class="opacity-container">\n <div ref="$colorbar" class="color-bar"></div>\n <div ref="$bar" class="drag-bar2"></div>\n </div>\n </div>\n '}},{key:"refresh",value:function(){k(jn.prototype.__proto__||Object.getPrototypeOf(jn.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=Object.assign({},this.$store.rgb);t.a=0;var e=dt.format(t,"rgb");t.a=1;t=dt.format(t,"rgb");this.refs.$colorbar.css("background","linear-gradient(to top, "+e+", "+t+")")}},{key:"getDefaultValue",value:function(){return this.$store.alpha}},{key:"refreshColorUI",value:function(t){t=this.getCaculatedDist(t);this.setColorUI(t/100*this.maxValue),this.changeColor({a:Math.floor(t)/100*this.maxValue})}}]),jn);function jn(t){y(this,jn);t=w(this,(jn.__proto__||Object.getPrototypeOf(jn)).call(this,t));return t.source="vertical-opacity-control",t}var Mn=(C(En,X),m(En,[{key:"components",value:function(){return{Hue:On,Opacity:Pn}}},{key:"template",value:function(){return'<div class="control"><div target="Hue" ></div><div target="Opacity" ></div></div>'}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"mini-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),En);function En(){return y(this,En),w(this,(En.__proto__||Object.getPrototypeOf(En)).apply(this,arguments))}var In=(C(Dn,J),m(Dn,[{key:"template",value:function(){return'\n <div class=\'colorpicker-body\'>\n <div target="palette"></div><div target="control"></div>\n </div>\n '}},{key:"components",value:function(){return{palette:yn,control:Mn}}}]),Dn);function Dn(){return y(this,Dn),w(this,(Dn.__proto__||Object.getPrototypeOf(Dn)).apply(this,arguments))}
1var Tn=(C(Vn,X),m(Vn,[{key:"components",value:function(){return{Value:Fe,Opacity:Ye}}},{key:"template",value:function(){return'\n <div class="control">\n <div target="Value" ></div>\n <div target="Opacity" ></div>\n <div ref="$controlPattern" class="empty"></div>\n <div ref="$controlColor" class="color"></div>\n </div>\n '}},{key:"setBackgroundColor",value:function(){this.refs.$controlColor.css("background-color",this.$store.dispatch("/toRGB"))}},{key:"refresh",value:function(){this.setColorUI(),this.setBackgroundColor()}},{key:"setColorUI",value:function(){this.Value.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"macos-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),Vn);function Vn(){return y(this,Vn),w(this,(Vn.__proto__||Object.getPrototypeOf(Vn)).apply(this,arguments))}var Un=(C(An,Ke),m(An,[{key:"template",value:function(){return'\n <div class="wheel" data-type="ring">\n <canvas class="wheel-canvas" ref="$colorwheel" ></canvas>\n <div class="drag-pointer" ref="$drag_pointer"></div>\n </div>\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,r,i,o,a,s,l;this.state.get("$el.width")&&(n=(l=this.getRectangle()).minX,r=l.minY,i=l.radius,o=l.centerX,s=l.centerY,a=g((l=(a=this.getCurrentXY(t,this.getDefaultValue(),i,o,s)).x)-o,(t=a.y)-s),l=(s=this.getCurrentXY(null,a,i-this.half_thinkness,o,s)).x,t=s.y,this.refs.$drag_pointer.css({left:l-n+"px",top:t-r+"px"}),e||this.changeColor({type:"hsv",h:a}))}}]),An);function An(t){y(this,An);t=w(this,(An.__proto__||Object.getPrototypeOf(An)).call(this,t));return t.width=214,t.height=214,t.thinkness=16,t.half_thinkness=t.thinkness/2,t.source="colorring",t}var Ln=(C(Hn,J),m(Hn,[{key:"template",value:function(){return'\n <div class=\'colorpicker-body\'>\n <div target="colorring"></div>\n <div target="palette"></div> \n <div target="control"></div>\n <div target="information"></div>\n <div target="currentColorSets"></div>\n <div target="colorSetsChooser"></div>\n <div target="contextMenu"></div>\n </div>\n '}},{key:"components",value:function(){return{colorring:Un,palette:yn,control:Tn,information:Ze,currentColorSets:nn,colorSetsChooser:tn,contextMenu:on}}}]),Hn);function Hn(){return y(this,Hn),w(this,(Hn.__proto__||Object.getPrototypeOf(Hn)).apply(this,arguments))}var Bn=(C(Rn,X),m(Rn,[{key:"components",value:function(){return{Hue:On,Opacity:Pn}}},{key:"template",value:function(){return'\n <div class="control">\n <div target="Hue" ></div>\n <div target="Opacity" ></div>\n </div>\n '}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(){this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),Rn);function Rn(){return y(this,Rn),w(this,(Rn.__proto__||Object.getPrototypeOf(Rn)).apply(this,arguments))}var Nn=(C(Fn,J),m(Fn,[{key:"template",value:function(){return'\n <div class=\'colorpicker-body\'>\n <div target="palette"></div> \n <div target="control"></div>\n <div target="information"></div>\n <div target="currentColorSets"></div>\n <div target="colorSetsChooser"></div>\n <div target="contextMenu"></div>\n </div>\n '}},{key:"components",value:function(){return{palette:yn,control:Bn,information:Ze,currentColorSets:nn,colorSetsChooser:tn,contextMenu:on}}}]),Fn);function Fn(){return y(this,Fn),w(this,(Fn.__proto__||Object.getPrototypeOf(Fn)).apply(this,arguments))}var Xn=(C(Yn,X),m(Yn,[{key:"components",value:function(){return{Hue:On,Opacity:Pn}}},{key:"template",value:function(){return'\n <div class="control">\n <div target="Opacity" ></div> \n <div target="Hue" ></div>\n </div>\n '}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(){this.Hue.setColorUI(),this.Opacity.setColorUI()}},{key:"@changeColor",value:function(t){"mini-control"!=t&&this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),Yn);function Yn(){return y(this,Yn),w(this,(Yn.__proto__||Object.getPrototypeOf(Yn)).apply(this,arguments))}var Gn=(C(zn,J),m(zn,[{key:"template",value:function(){return"\n <div class='colorpicker-body'>\n <div class='color-view'>\n <div class='color-view-container' ref=\"$colorview\"></div>\n </div>\n <div class='color-tool'>\n <div target=\"palette\"></div>\n <div target=\"control\"></div>\n </div>\n </div>\n "}},{key:"components",value:function(){return{palette:yn,control:Xn}}},{key:"initColorWithoutChangeEvent",value:function(t){this.$store.dispatch("/initColor",t),this.refresh()}}
1,{key:"setBackgroundColor",value:function(){var t=this.$store.dispatch("/toColor"),e=this.$store.rgb,e=dt.brightness(e.r,e.g,e.b);this.refs.$colorview.css({"background-color":t,color:127<e?"black":"white"}),this.refs.$colorview.html(t)}},{key:"click $colorview",value:function(t){this.nextFormat()}},{key:"nextFormat",value:function(){var t=this.$store.format||"hex",e="hex";"hex"==t?e="rgb":"rgb"==t?e="hsl":"hsl"==t&&(e="hex"),this.$store.dispatch("/changeFormat",e),this.$store.emit("lastUpdateColor"),this.refresh()}},{key:"refresh",value:function(){this.setBackgroundColor()}},{key:"@changeColor",value:function(){this.refresh()}},{key:"@initColor",value:function(){this.refresh()}}]),zn);function zn(){return y(this,zn),w(this,(zn.__proto__||Object.getPrototypeOf(zn)).apply(this,arguments))}var qn={create:function(t){switch(t.type){case"macos":return new sn(t);case"xd":return new Nn(t);case"ring":return new Ln(t);case"mini":return new xn(t);case"vscode":return new Gn(t);case"mini-vertical":return new In(t);case"sketch":case"palette":default:return new $n(t)}},ColorPicker:$n,ChromeDevToolColorPicker:$n,MacOSColorPicker:sn,RingColorPicker:Ln,MiniColorPicker:xn,VSCodePicker:Gn,MiniVerticalColorPicker:In},Kn=(C(Wn,X),m(Wn,[{key:"afterRender",value:function(){var e=this,t=this.opt.opt.colorpickerOptions||{type:"sketch"};this.colorPicker=qn.create(x({position:"inline",container:this.refs.$el.el,onChange:function(t){e.changeColor(t)}},t))}},{key:"template",value:function(){return'<div ref="$color"></div>'}},{key:"changeColor",value:function(t){this.$store.emit("changeEmbedColorPicker",t)}},{key:"setValue",value:function(t){this.colorPicker.initColorWithoutChangeEvent(t)}}]),Wn);function Wn(){return y(this,Wn),w(this,(Wn.__proto__||Object.getPrototypeOf(Wn)).apply(this,arguments))}m(Jn,[{key:"getDefaultTitle",value:function(){return"Item"}},{key:"isAttribute",value:function(){return!1}},{key:"is",value:function(){if(!this.json)return!1;for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return-1<e.indexOf(this.json.itemType)}},{key:"convert",value:function(t){return t}},{key:"checkField",value:function(t,e){return!0}},{key:"toCloneObject",value:function(){return{itemType:this.json.itemType,type:this.json.type,selected:this.json.selected}}},{key:"clone",value:function(){var t=new this.constructor(this.toCloneObject());return t.parent=this.json.parent,t}},{key:"reset",value:function(t){t instanceof Jn&&(t=t.toJSON()),this.json=this.convert(x({},this.json,t))}},{key:"getDefaultObject",value:function(){return x({selected:!1,type:"",itemType:""},0<arguments.length&&void 0!==arguments[0]?arguments[0]:{})}},{key:"add",value:function(t){return this.json.layers.push(t),t.parent=this.ref,t}},{key:"toggle",value:function(t,e){gt(e)?this.json[t]=!this.json[t]:this.json[t]=!!e}},{key:"toJSON",value:function(){return this.json}},{key:"resize",value:function(){}},{key:"copy",value:function(){this.json.parent.copyItem(this.ref)}},{key:"copyItem",value:function(t){var e=t.clone();e.width.add(10),e.width.add(10);for(var n=this.json.layers,r=-1,i=0,o=n.length;i<o;i++)if(n[i]===t){r=i;break}-1<r&&this.json.layers.splice(r,0,e)}},{key:"remove",value:function(){this.json.parent.removeItem(this.ref)}},{key:"removeItem",value:function(t){for(var e=this.json.layers,n=-1,r=0,i=e.length;r<i;r++)if(e[r]===t){n=r;break}-1<n&&this.json.layers.splice(n,1)}},{key:"title",get:function(){return this.json.name||this.getDefaultTitle()}},{key:"id",get:function(){return this.json.id}},{key:"layers",get:function(){return this.json.layers}},{key:"parent",get:function(){return this.json.parent}},{key:"html",get:function(){var t=this.json,e=t.elementType,n=t.id,r=t.layers,e=e||"div";return"\n <"+e+" class='element-item "+t.itemType+"' data-id=\""+n+'">\n '+r.map(function(t){return t.html}).join("")+"\n </"+e+">\n "}},{key:"allLayers",get:function(){return[].concat(O(function e(t){var n=[];return t.layers.length&&t.layers.forEach(function(t){n.push.apply(n,O(e(t)))}),n.push(t),n}(this.ref)))}}]),K=Jn;function Jn(){var r=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return y(this,Jn),t instanceof Jn&&(t=t.toJSON()),this.json=this.convert(x({},this.getDefaultObject(),t)),this.ref=new Proxy(this,{get:function(r,t){var i=r[t];return $t(i)?function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return i.apply(r,e)}:i||r.json[t]},set:function(t,e,n){if(n&&n.realVal&&$t(n.realVal)&&(n=n.realVal()),!r.checkField(e,n))throw new Error(n+" is invali
1d as "+e+" property value.");return t.json[e]=n,!0}}),this.ref}C(Zn,K),m(Zn,[{key:"getDefaultObject",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return k(Zn.prototype.__proto__||Object.getPrototypeOf(Zn.prototype),"getDefaultObject",this).call(this,x({itemType:"image-resource",type:"image"},t))}},{key:"isGradient",value:function(){return!1}},{key:"isLinear",value:function(){return!1}},{key:"isRadial",value:function(){return!1}},{key:"isConic",value:function(){return!1}},{key:"isStatic",value:function(){return!1}},{key:"isImage",value:function(){return!1}},{key:"hasAngle",value:function(){return!1}},{key:"isUrl",value:function(){return!1}},{key:"isFile",value:function(){return!1}},{key:"isAttribute",value:function(){return!0}},{key:"toString",value:function(){return"none"}}]),F=Zn;function Zn(){return y(this,Zn),w(this,(Zn.__proto__||Object.getPrototypeOf(Zn)).apply(this,arguments))}function Qn(){y(this,Qn)}var tr={center:50,top:0,left:0,right:100,bottom:100};Qn.CENTER="center",Qn.TOP="top",Qn.RIGHT="right",Qn.LEFT="left",Qn.BOTTOM="bottom";var er=/([\d.]+)(px|pt|fr|r?em|deg|vh|vw|m?s|%|g?rad|turn)/gi,nr=(m(rr,[{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(--"+this.value+")";case"calc":return"calc("+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 rr(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 yt(tr[this.value])?rr.percent(tr[this.value]):rr.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(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:16;return this.isPercent()?this:this.isPx()?rr.percent(100*this.value/t):this.isEm()?rr.percent(this.value*e*100/t):this.isString()?this.stringToPercent(t):this.isDeg()?rr.percent(this.value/360*100):void 0}},{key:"toEm",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:16;return this.isPercent()?rr.em(this.value/100*t/e):this.isPx()?rr.em(this.value/e):this.isEm()?this:this.isString()?this.stringToEm(t):void 0}},{key:"toPx",value:function(t){return this.isPercent()?rr.px(this.value/100*t):this.isPx()?this:this.isEm()?rr.px(this.value/100*t/16):this.isString()?this.stringToPx(t):void 0}},{key:"toSecond",value:function(){return this.isSecond()?this:this.isMs()?rr.second(this.value/1e3):void 0}},{key:"toMs",value:function(){return this.isSecond()?rr.ms(1e3*this.value):this.isMs()?this:void 0}},{key:"to",value:function(t,e){var n=2<arguments.length&&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(t){return new rr(this.value,t)}},{key:"calculate",value:function(t,e){t=this[t];return t?t.call(this,e):this}},{key:"includes",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return e.includes(this.value)}}
1,{key:"round",value:function(t){return new rr(u(this.value,t),this.unit)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}}],[{key:"min",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=e.shift(),i=0,o=e.length;i<o;i++)r.value>e[i].value&&(r=e[i]);return r}},{key:"max",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=e.shift(),i=0,o=e.length;i<o;i++)r.value<e[i].value&&(r=e[i]);return r}},{key:"string",value:function(t){return new rr(t+"","")}},{key:"number",value:function(t){return new rr(+t,"number")}},{key:"px",value:function(t){return new rr(+t,"px")}},{key:"em",value:function(t){return new rr(+t,"em")}},{key:"percent",value:function(t){return new rr(+t,"%")}},{key:"deg",value:function(t){return new rr(+t,"deg")}},{key:"fr",value:function(t){return new rr(+t,"fr")}},{key:"second",value:function(t){return new rr(+t,"s")}},{key:"ms",value:function(t){return new rr(+t,"ms")}},{key:"var",value:function(t){return new rr(t+"","--")}},{key:"calc",value:function(t){return new rr(t,"calc")}},{key:"parse",value:function(t){if(mt(t)){if(-1<t.indexOf("calc("))return new rr(t.split("calc(")[1].split(")")[0],"calc");var e=t.replace(er,"$1 $2").split(" ");return+e[0]==e[0]?new rr(+e[0],e[1]):new rr(e[0])}if(t instanceof rr)return t;if(t.unit){if("%"==t.unit||"percent"==t.unit){var n=0;return yt(t.percent)?n=t.percent:yt(t.value)&&(n=t.value),rr.percent(n)}if("px"==t.unit){n=0;return yt(t.px)?n=t.px:yt(t.value)&&(n=t.value),rr.px(n)}if("em"==t.unit){n=0;return yt(t.em)?n=t.em:yt(t.value)&&(n=t.value),rr.em(n)}if("deg"==t.unit){n=0;return yt(t.deg)?n=t.deg:yt(t.value)&&(n=t.value),rr.deg(n)}if("s"==t.unit){n=0;return yt(t.second)?n=t.second:yt(t.value)&&(n=t.value),rr.second(n)}if("ms"==t.unit){n=0;return yt(t.ms)?n=t.ms:yt(t.value)&&(n=t.value),rr.ms(n)}if("number"==t.unit){n=0;return yt(t.value)&&(n=t.value),rr.number(n)}if("--"==t.unit){n=0;return yt(t.value)&&(n=t.value),rr.var(n)}if(""===t.unit||"string"===t.unit){n="";return yt(t.str)?n=t.str:yt(t.value)&&(n=t.value),rr.string(n)}}return rr.string(t)}}]),rr);function rr(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";y(this,rr),this.value=t,this.unit=e}nr.auto=nr.string("auto");var ir=(C(or,K),m(or,[{key:"getDefaultObject",value:function(){return k(or.prototype.__proto__||Object.getPrototypeOf(or.prototype),"getDefaultObject",this).call(this,{cut:!1,percent:0,unit:"%",px:0,em:0,color:"rgba(0, 0, 0, 0)",prevColorStep:null})}},{key:"toCloneObject",value:function(){return x({},k(or.prototype.__proto__||Object.getPrototypeOf(or.prototype),"toCloneObject",this).call(this),{cut:this.json.cut,percent:this.json.percent,unit:this.json.unit,px:this.json.px,em:this.json.em,color:this.json.color})}},{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:"getUnit",value:function(){return"%"==this.json.unit?"percent":this.json.unit}},{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 nr.parse(this.json)}},{key:"getPrevLength",value:function(){return this.json.prevColorStep?this.json.prevColorStep.toLength():""}},{key:"toString",value:function(){var t=this.json.cut?this.getPrevLength():"";return this.json.color+" "+t+" "+this.toLength()}},{key:"reset",value:function(t){k(or.prototype.__proto__||Object.getPrototypeOf(or.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}}],[{key:"parse",value:function(t){var n=[],e=j(t),r=e.str.split(" ").filter(function(t){return t.trim()}),t=+r[0].replace("@",""),i=e.matches[t].color;return 1===r.length?n.push(new or({color:i,unit:"%",percent:0})):2===r.length?(t={unit:(e=nr.parse(r[1])).unit},e.isPercent()?t.percent=e.value:e.isPx()?t.px=e.value:e.isEm()&&(t.em=e.value),n.push(new or(x({color:i},t)))):3===r.length&&[1,2].forEach(function(t){var e=nr.parse(r[t]),t={unit:e.unit};e.isPercent()?t.percent=e.value:e.isPx()?t.px=e.value:e.isEm()&&(t.em=e.value),n.push(new or(x({color:i},t)))}),n}}]),or);function or(){return y(this,or),w(this,(or.__proto__||Object.getPrototypeOf(or)).apply(this,arguments))}var ar={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left"
1:315},sr=(C(lr,F),m(lr,[{key:"isGradient",value:function(){return!0}},{key:"toString",value:function(){return"none"}},{key:"getDefaultObject",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return k(lr.prototype.__proto__||Object.getPrototypeOf(lr.prototype),"getDefaultObject",this).call(this,x({type:"gradient",colorsteps:[]},t))}},{key:"toCloneObject",value:function(){return x({},k(lr.prototype.__proto__||Object.getPrototypeOf(lr.prototype),"toCloneObject",this).call(this),{colorsteps:this.json.colorsteps.map(function(t){return t.clone()})})}},{key:"convert",value:function(t){return t.colorsteps=t.colorsteps.map(function(t){return new ir(t)}),t}},{key:"calculateAngle",value:function(){var t=this.json.angle;return gt(ar[t])?t:ar[t]||0}},{key:"addColorStep",value:function(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return this.json.colorsteps.push(t),e&&this.sortColorStep(),t}},{key:"insertColorStep",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"rgba(216,216,216,0)",n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"rgba(216,216,216,1)",r=this.colorsteps;if(r.length){if(t<r[0].percent)return r[0].index=1,void this.addColorStep(new ir({index:0,color:r[0].color,percent:t}));var i=r.length-1;if(r[i].percent<t){var o=r[i].color,i=r[i].index+1;this.addColorStep(new ir({index:i,color:o,percent:t}))}else for(var a=0,s=r.length-1;a<s;a++){var l=r[a],u=r[a+1];if(l.percent<=t&&t<=u.percent){o=Color.mix(l.color,u.color,(t-l.percent)/(u.percent-l.percent),"rgb");return void this.addColorStep(new ir({index:l.index+1,color:o,percent:t}))}}}else this.addColorStepList([new ir({color:e,percent:t,index:0}),new ir({color:n,percent:100,index:100})])}},{key:"sortColorStep",value:function(){var t=this.colorsteps;t.sort(function(t,e){return t.percent>e.percent?1:t.percent<e.percent?-1:t.percent==e.percent?t.index===e.index?0:t.index>e.index?1:-1:void 0}),t.forEach(function(t,e){t.index=100*e})}},{key:"addColorStepList",value:function(){var e=this;(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(t){e.addColorStep(t,!1)}),this.sortColorStep()}},{key:"getColorStep",value:function(e){return this.json.colorsteps.filter(function(t){return t.id==e})[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 n=this.colorsteps;return n.length?n.map(function(t,e){return t.prevColorStep=t.cut&&0<e?n[e-1]:null,t}).map(function(t){return""+t}).join(","):""}},{key:"colorsteps",get:function(){return this.json.colorsteps}}],[{key:"random",value:function(){return"linear-gradient("+Math.floor(1e3*Math.random())%360+"deg, "+Color.random()+" 0%, "+Color.random()+" 100%)"}}]),lr);function lr(){return y(this,lr),w(this,(lr.__proto__||Object.getPrototypeOf(lr)).apply(this,arguments))}var ur=["circle","circle closest-side","circle closest-corner","circle farthest-side","circle farthest-corner","ellipse","ellipse closest-side","ellipse closest-corner","ellipse farthest-side","ellipse farthest-corner"],cr=(C(hr,X),m(hr,[{key:"initialize",value:function(){k(hr.prototype.__proto__||Object.getPrototypeOf(hr.prototype),"initialize",this).call(this);var t=[{offset:nr.percent(0),cut:!1,color:"yellow"},{offset:nr.percent(100),cut:!1,color:"red"}];this.type="linear-gradient",this.index=0,this.colorsteps=t,this.radialPosition=[nr.percent(50),nr.percent(50)],this.radialType="ellipse"}},{key:"@setGradientEditor",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"linear-gradient",r=arguments[3],i=arguments[4],o=arguments[5],a=j(t),t=a.str.split(",").map(function(t){return t.trim()}).map(function(t){var e=t.split(" ").filter(function(t){return t.length}),n=_(e,3),r=n[0],t=n[1],e=n[2],r=E(r,a.matches),n=!1,t=(n=e?!0:n)?nr.parse(e):nr.parse(t);return{color:r,offset:t=t.isDeg()?nr.percent(t.value/360*100):t,cut:n}});1==t.length&&t.push({color:t[0].color,offset:nr.percent(100),cut:!1}),this.cachedStepListRect=null,this.colorsteps=t,this.index=e,this.type=n,this.angle=nr.parse(r||"90deg"),this.radialPosition=i||[nr.percent(50),nr.percent(50)],this.radialType=o,this.refresh(),this.selectStep(e),this.reloadInputValue()}},{key:"template",value:function(){var e=this;return"\n <div class='gradient-editor' data-selected-editor='"+this.type+"'>\n <div class='gradient-steps' data-editor='gradient'>\n <div class=\"hue-container\" ref=\"$back\"></div> \n <div class=\"hue\" ref=\"$steps\">\n <div class='step-list' ref=\"$stepList\" ></div>\n </div>\n </div>\n <div class='tools' data-editor='tools'>\n <label>Offset <input type='checkbox' ref='$cut' checked /> connected</label>\n <div class='unit'>\n <div><input type='range' data-key='length' min='0' max=\"100\" step='0.1' ref='$offset' /></div>\n <div><input type='number' data-key='length' min='0' max=\"100\" step='0.1' ref='$offsetNumber' /></div> \n <div><select ref='$offsetSelect'>\n <option value='%'>%</option>\n <option value='px'>px</option>\n <option value='em'>
1em</option>\n </select></div>\n </div>\n </div>\n <div class='sub-editor' ref='$subEditor'> \n <div data-editor='angle'>\n <label>Angle</label>\n <div class='unit'> \n <div><input type='range' data-key='angle' min='-720' max=\"720\" step='0.1' ref='$angle' /> </div>\n <div><input type='number' data-key='angle' min='-720' max=\"720\" step='0.1' ref='$angleNumber' /></div> \n <span>deg</span>\n </div>\n </div>\n <div data-editor='centerX'>\n <label>Center X</label>\n <div class='unit'>\n <div><input type='range' data-key='centerX' min='-100' max=\"100\" step='0.1' ref='$centerX' /></div>\n <div><input type='number' data-key='centerX' min='-100' max=\"100\" step='0.1' ref='$centerXNumber' /></div>\n <div><select ref='$centerXSelect'>\n <option value='%'>%</option>\n <option value='px'>px</option>\n <option value='em'>em</option>\n </select></div>\n </div>\n </div> \n <div data-editor='centerY'> \n <label>Center Y</label> \n <div class='unit'>\n <div><input type='range' data-key='centerY' min='-100' max=\"100\" step='0.1' ref='$centerY' /></div>\n <div><input type='number' data-key='centerX' min='-100' max=\"100\" step='0.1' ref='$centerYNumber' /></div>\n <div><select ref='$centerYSelect'>\n <option value='%'>%</option>\n <option value='px'>px</option>\n <option value='em'>em</option>\n </select></div>\n </div>\n </div> \n <div data-editor='radialType'> \n <label>Radial Type</label> \n <div><select ref='$radialType'>\n "+ur.map(function(t){return'<option value="'+t+'" '+(e.radialType===t?"selected":"")+">"+t+"</option>"}).join("")+"\n </select></div>\n </div>\n </div> \n </div>\n "}},{key:"input $offset",value:function(t){this.refs.$offsetNumber.val(this.refs.$offset.val()),this["@changeColorStepOffset"]("offset",new nr(this.refs.$offset.val(),this.refs.$offsetSelect.val()))}},{key:"input $offsetNumber",value:function(t){this.refs.$offset.val(this.refs.$offsetNumber.val()),this["@changeColorStepOffset"]("offset",new nr(this.refs.$offset.val(),this.refs.$offsetSelect.val()))}},{key:"input $angle",value:function(t){this.refs.$angleNumber.val(this.refs.$angle.val()),this["@changeKeyValue"]("angle",nr.deg(this.refs.$angle.val()))}},{key:"input $angleNumber",value:function(t){this.refs.$angle.val(this.refs.$angleNumber.val()),this["@changeKeyValue"]("angle",nr.deg(this.refs.$angle.val()))}},{key:"input $centerX",value:function(t){this.refs.$centerXNumber.val(this.refs.$centerX.val()),this["@changeKeyValue"]("radialPositionX")}},{key:"input $centerXNumber",value:function(t){this.refs.$centerX.val(this.refs.$centerXNumber.val()),this["@changeKeyValue"]("radialPositionX")}},{key:"input $centerY",value:function(t){this.refs.$centerYNumber.val(this.refs.$centerY.val()),this["@changeKeyValue"]("radialPositionY")}},{key:"input $centerYNumber",value:function(t){this.refs.$centerY.val(this.refs.$centerYNumber.val()),this["@changeKeyValue"]("radialPositionX")}},{key:"change $centerXSelect",value:function(t){this["@changeKeyValue"]("radialPositionX")}},{key:"change $centerYSelect",value:function(t){this["@changeKeyValue"]("radialPositionY")}},{key:"change $radialType",value:function(t){this["@changeKeyValue"]("radialType",this.refs.$radialType.val())}},{key:"@changeKeyValue",value:function(t,e){"angle"===t&&(e=e.value),"radialPositionX"===t||"radialPositionY"===t?this.radialPosition=[this.radialPositionX,this.radialPositionY]:this[t]=e,this.updateData()}},{key:"@changeColorStepOffset",value:function(t,e){this.currentStep&&(this.currentStep.offset=e.clone(),this.$currentStep.css({left:this.currentStep.offset}),this.setColorUI(),this.updateData())}},{key:"click $back",value:function(t){var e,n,r,i;this.startXY||(i=(r=this.refs.$stepList.rect()).x,e=r.right,(t=t.xy.x)<i?t=i:e<t&&(t=e),n=(t-i)/r.width*100,r=(i=this.colorsteps.map(function(t,e){return{index:e,color:t.color,offset:t.offset}})).filter(function(t){return t.offset.value<=n}).pop(),i=i.filter(function(t){return t.offset.value>=n}).shift(),r&&i?this.colorsteps.splice(i.index,0,{cut:!1,offset:nr.percent(n),color:Color.mix(r.color,i.color,(n-r.offset.value)/(i.offset.value-r.offset.value))}):r?this.colorsteps.splice(r.index+1,0,{cut:!1,offset:nr.percent(n),color:"rgba(0, 0, 0, 1)"}):i?this.colorsteps.splice(i.index-1,0,{cut:!1,offset:nr.percent(n),color:"rgba(0, 0, 0, 1)"}):this.colorsteps.push({cut:!1,offset:nr.percent(0),color:"rgba(0, 0, 0, 1)"}),this.refresh(),this.updateData())}},{key:"reloadStepList",value:function(){this.refs.$stepList.html(this.colorsteps.map(function(t,e){return"<div class='step' data-index='"+e+"' data-cut='"+t.cut+"' style='left: "+t.offset+";'>\n <div class='color-view' style=\"background-color: "+t.color+"\"></div>\n <div class='arrow' style=\"background-color: "+t.color+'"></div>\n </div>'}).join(""))}},{key:"click $cut",value:function(){this.currentStep&&(this.currentStep.cut=this.refs.$cut.checked(),this.$currentStep.attr("data-cut",this.currentStep.cut),this.setColorUI(),this.updateData())}},{key:"removeStep",value:function(t){var e,n;2!==this.colorsteps.length&&(this.colorsteps.splice(t,1),n=t,(e=this.colorsteps[t])||(e=this.colorsteps[t-1],n=t-1),e&&this.selectStep(n),this.refresh(),this.updateData())}},{key:"selectStep",value:function(t){this.index=t,this.currentStep=this.colorsteps[t],this.refs.$stepList.attr("data-selected-index",t),this.$currentStep=this.refs.$stepList.$('[data-index="'+t.toString()+'"]'),this.$currentStep&&(this.$colorView=this.$currentStep.$(".color-view"),this.$arrow=this.$currentStep.$(".arrow"),this.refs.$cut.el.checked=this.currentStep.cut),this.prev=this.colorsteps[t-1],this.next=this.colorsteps[t+1]}},{key:"mousedown $stepList .step",value:function(t){var e=+t.$delegateTarget.attr("data-index");t.altKey?this.removeStep(e):(this.selectStep(e),this.startXY=t.xy,this.$store.emit("selectColorStep",this.currentStep.color),this.refs.$cut.checked(this.currentStep.cut),this.refs.$offset.val(this.currentStep.offset.value),this.refs.$stepList.attr("data-selected-index",e),this.cachedStepListRect=this.refs.$stepList.rect())}},{key:"getStepListRect",value:function(){return this.cachedStepListRect}},{key:"mouseup document",value:function(t){this.startXY&&(this.startXY=null)}},{key:"mousemove document",value:function(t){var e,n,r;this.startXY&&(n=t.xy.x-this.startXY.x,t.xy.y,this.startXY.y,e=(r=this.getStepListRect()).x,t=r.right,(n=this.startXY.x+n)<e?n=e:t<n&&(n=t),r=(n-e)/r.width*100,this.prev&&this.prev.offset.value>r&&(r=this.prev.offset.value),this.next&&this.next.offset.value<r&&(r=this.next.offset.value),this.currentStep.offset.set(u(r,100)),this.$currentStep.css({left:nr.percent(r)}),this.refs.$offset.val(this.currentStep.offset.value),this.setColorUI(),this.updateData())}},{key:"refresh",value:function(){this.reloadStepList(),this.setColorUI()}},{key:"getLinearGradient",value:function(){var n=this;if(0===this.colorsteps.length)return"";if(1!==this.colorsteps.length)return"linear-gradient(to right, "+this.colorsteps.map(function(t,e){if(t.cut){e=n.colorsteps[e-1];return e?t.color+" "+e.offset+" "+t.offset:t.color+" "+t.offset}return t.color+" "+t.offset}).join(",")+")";var t=this.colorsteps[0];return"linear-gradient(to right, "+t.color+" "+t.offset+", "+t.color+" 100%)"}},{key:"setColorUI",value:function(){this.refs.$stepList.css("background-image",this.getLinearGradient()),this.refs.$el.attr("data-selected-editor",this.type)}},{key:"reloadInputValue",value:function(){this.refs.$offset.val(this.currentStep.offset.value),this.refs.$offsetNumber.val(this.currentStep.offset.value),this.refs.$offsetSelect.val(this.currentStep.offset.unit),this.refs.$angle.val(this.angle.value),this.refs.$angleNumber.val(this.angle.value),this.refs.$centerX.val(this.radialPosition[0].value),this.refs.$centerXNumber.val(this.radialPosition[0].value),this.refs.$centerXSelect.val(this.radialPosition[0].unit),this.refs.$centerY.val(this.radialPosition[1].value),this.refs.$centerYNumber.val(this.radialPosition[1].value),this.refs.$centerYSelect.val(this.radialPosition[1].unit),this.refs.$radialType.val(this.radialType)}},{key:"@setColorStepColor",value:function(t){this.currentStep&&(this.currentStep.color=t,this.$colorView.css({"background-color":t}),this.$arrow.css({"background-color":t}),this.setColorUI(),this.updateData())}},{key:"updateData",value:function(){this.$store.emit("changeGradientEditor",{type:this.t
1ype,index:this.index,angle:this.angle,colorsteps:this.colorsteps,radialPosition:this.radialPosition,radialType:this.radialType})}},{key:"radialPositionX",get:function(){return new nr(this.refs.$centerX.val(),this.refs.$centerXSelect.val())}},{key:"radialPositionY",get:function(){return new nr(this.refs.$centerY.val(),this.refs.$centerYSelect.val())}}]),hr);function hr(){return y(this,hr),w(this,(hr.__proto__||Object.getPrototypeOf(hr)).apply(this,arguments))}var fr={0:"to top",45:"to top right",90:"to right",135:"to bottom right",180:"to bottom",225:"to bottom left",270:"to left",315:"to top left"},vr={"to top":"0","to top right":"45","to right":"90","to bottom right":"135","to bottom":"180","to bottom left":"225","to left":"270","to top left":"315"},pr=(C(dr,sr),m(dr,[{key:"getDefaultObject",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return k(dr.prototype.__proto__||Object.getPrototypeOf(dr.prototype),"getDefaultObject",this).call(this,x({type:"linear-gradient",angle:0},t))}},{key:"toCloneObject",value:function(){return x({},k(dr.prototype.__proto__||Object.getPrototypeOf(dr.prototype),"toCloneObject",this).call(this),{angle:this.json.angle})}},{key:"isLinear",value:function(){return!0}},{key:"hasAngle",value:function(){return!0}},{key:"toString",value:function(){if(0===this.colorsteps.length)return"";var t=this.getColorString(),e="";return bt(e=this.json.angle||0)&&(e=fr[""+e]||e),bt(e)&&(e=360<e?e%360:e,e+="deg"),this.json.type+"("+e+", "+t+")"}}],[{key:"toLinearGradient",value:function(t){return 0===t.length?"none":new dr({angle:"to right",colorsteps:t})+""}},{key:"parse",value:function(t){var n=j(t),r=0,i=[];return n.str.split("(")[1].split(")")[0].split(",").map(function(t){return t.trim()}).forEach(function(t,e){t.includes("@")?(t=E(t,n.matches),i.push.apply(i,O(ir.parse(t)))):r=gt(vr[t])?nr.parse(t):nr.deg(+vr[t])}),new dr({angle:r,colorsteps:i})}}]),dr);function dr(){return y(this,dr),w(this,(dr.__proto__||Object.getPrototypeOf(dr)).apply(this,arguments))}var gr=(C(yr,pr),m(yr,[{key:"getDefaultObject",value:function(){return k(yr.prototype.__proto__||Object.getPrototypeOf(yr.prototype),"getDefaultObject",this).call(this,{type:"repeating-linear-gradient",angle:0})}}],[{key:"parse",value:function(t){t=pr.parse(t);return new yr({angle:t.angle,colorsteps:t.colorsteps})}}]),yr);function yr(){return y(this,yr),w(this,(yr.__proto__||Object.getPrototypeOf(yr)).apply(this,arguments))}var mr=(b(X={},"center",!0),b(X,"top",!0),b(X,"left",!0),b(X,"right",!0),b(X,"bottom",!0),X),br=(C(kr,sr),m(kr,[{key:"getDefaultObject",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return k(kr.prototype.__proto__||Object.getPrototypeOf(kr.prototype),"getDefaultObject",this).call(this,x({type:"radial-gradient",radialType:"ellipse",radialPosition:[Qn.CENTER,Qn.CENTER]},t))}},{key:"toCloneObject",value:function(){var t=this.json.radialPosition||[nr.percent(50),nr.percent(50)];return x({},k(kr.prototype.__proto__||Object.getPrototypeOf(kr.prototype),"toCloneObject",this).call(this),{radialType:this.json.radialType||"ellipse",radialPosition:JSON.parse(JSON.stringify(t))})}},{key:"isRadial",value:function(){return!0}},{key:"toString",value:function(){if(0===this.colorsteps.length)return"";var t=this.getColorString(),e=this.json,n=e.radialType,r=e.radialPosition||["center","center"],r=mr[r]?r:r.join(" ");return(e.type||"radial-gradient")+"("+(r?n+" at "+r:n)+", "+t+")"}}],[{key:"parse",value:function(t){var r=j(t),i="ellipse",o=[Qn.CENTER,Qn.CENTER],a=[];return r.str.split("(")[1].split(")")[0].split(",").map(function(t){return t.trim()}).forEach(function(t,e){var n;t.includes("@")?(t=E(t,r.matches),a.push.apply(a,O(ir.parse(t)))):(t.includes("at")?(n=t.split("at").map(function(t){return t.trim()}),n=_(n,2),i=n[0],o=n[1]):i=t,mt(o)&&(1===(n=o.split(" ")).length?(t=nr.parse(n[0]),o=t.isString()?[t.value,t.value]:[t.clone(),t.clone()]):2===n.length&&(o=n.map(function(t){t=nr.parse(t);return t.isString()?t.value:t}))))}),new kr({radialType:i,colorsteps:a})}}]),kr);function kr(){return y(this,kr),w(this,(kr.__proto__||Object.getPrototypeOf(kr)).apply(this,arguments))}var Cr=(C(xr,br),m(xr,[{key:"getDefaultObject",value:function(){return k(xr.prototype.__proto__||Object.getPrototypeOf(xr.prototype),"getDefaultObject",this).call(this,{type:"repeating-radial-gradient"})}}],[{key:"parse",value:function(t){t=br.parse(t);return new xr({radialType:t.radialType,radialPosition:t.radialPosition,colorsteps:t.colorsteps})}}]),xr);function xr(){return y(this,xr),w(this,(xr.__proto__||Object.getPrototypeOf(xr)).apply(this,arguments))}var wr=(b(X={},"center",!0),b(X,"top",!0),b(X,"left",!0),b(X,"right",!0),b(X,"bottom",!0),X),_r={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left"
1:315},Or=(C(Sr,sr),m(Sr,[{key:"getDefaultObject",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return k(Sr.prototype.__proto__||Object.getPrototypeOf(Sr.prototype),"getDefaultObject",this).call(this,x({type:"conic-gradient",angle:0,radialPosition:[Qn.CENTER,Qn.CENTER]},t))}},{key:"toCloneObject",value:function(){return x({},k(Sr.prototype.__proto__||Object.getPrototypeOf(Sr.prototype),"toCloneObject",this).call(this),{angle:this.json.angle,radialPosition:JSON.parse(JSON.stringify(this.json.radialPosition))})}},{key:"isConic",value:function(){return!0}},{key:"hasAngle",value:function(){return!0}},{key:"getColorString",value:function(){if(0===this.colorsteps.length)return"";var n=this.colorsteps;return n?(n.sort(function(t,e){return t.percent==e.percent?0:t.percent>e.percent?1:-1}),n.map(function(t,e){return t.prevColorStep=t.cut&&0<e?n[e-1]:null,t}).map(function(t){var e=Math.floor(3.6*t.percent),n="";return t.cut&&t.prevColorStep&&(n=Math.floor(3.6*t.prevColorStep.percent)+"deg"),t.color+" "+n+" "+e+"deg"}).join(",")):""}},{key:"toString",value:function(){var t=this.getColorString(),e=[],n=this.json,r=n.angle,i=n.radialPosition||Qn.CENTER,i=wr[i]?i:i.join(" ");yt(r)&&e.push("from "+(r=+(_r[r]||r))+"deg"),i&&e.push("at "+i);e=e.length?e.join(" ")+",":"";return n.type+"("+e+" "+t+")"}}],[{key:"parse",value:function(t){var r=j(t),i="0deg",o=[Qn.CENTER,Qn.CENTER],a=[];return r.str.split("(")[1].split(")")[0].split(",").map(function(t){return t.trim()}).forEach(function(t,e){var n;t.includes("@")?(t=E(t=t.split(" ").map(function(t){return t.trim()}).map(function(t){return t.includes("deg")?nr.parse(t).toPercent():t}).join(" "),r.matches),a.push.apply(a,O(ir.parse(t)))):(t.includes("at")?(n=t.split("at").map(function(t){return t.trim()}),n=_(n,2),i=n[0],o=n[1]):i=t,isString(o)&&(1===(n=o.split(" ")).length?(t=nr.parse(n[0]),o=t.isString()?[t.value,t.value]:[t.clone(),t.clone()]):2===n.length&&(o=n.map(function(t){t=nr.parse(t);return t.isString()?t.value:t}))),isString(i)&&i.includes("from")&&(i=i.split("from")[1],i=isUndefined(_r[i])?nr.parse(i):nr.deg(+_r[i])))}),new Sr({angle:i,radialPosition:o,colorsteps:a})}}]),Sr);function Sr(){return y(this,Sr),w(this,(Sr.__proto__||Object.getPrototypeOf(Sr)).apply(this,arguments))}var Pr=(C(jr,Or),m(jr,[{key:"getDefaultObject",value:function(){return k(jr.prototype.__proto__||Object.getPrototypeOf(jr.prototype),"getDefaultObject",this).call(this,{type:"repeating-conic-gradient",angle:0,radialPosition:[Qn.CENTER,Qn.CENTER]})}}],[{key:"parse",value:function(t){t=Or.parse(t);return new jr({angle:t.angle,radialPosition:t.radialPosition,colorsteps:t.colorsteps})}}]),jr);function jr(){return y(this,jr),w(this,(jr.__proto__||Object.getPrototypeOf(jr)).apply(this,arguments))}var Mr=[{type:"linear-gradient",title:"Linear Gradient"},{type:"repeating-linear-gradient",title:"Repeating Linear Gradient"},{type:"radial-gradient",title:"Radial Gradient"},{type:"repeating-radial-gradient",title:"Repeating Radial Gradient"},{type:"conic-gradient",title:"Conic Gradient"},{type:"repeating-conic-gradient",title:"Repeating Conic Gradient"}],Er=/((linear\-gradient|repeating\-linear\-gradient|radial\-gradient|repeating\-radial\-gradient|conic\-gradient|repeating\-conic\-gradient|url)\(([^\)]*)\))/gi,Ir=(C(Dr,J),m(Dr,[{key:"components",value:function(){return{EmbedColorPicker:Kn,gradientEditor:cr}}},{key:"parseImage",value:function(t){var n=j(t),r=null;return n.str.match(Er).forEach(function(t,e){(t=E(t,n.matches)).includes("repeating-linear-gradient")?r=gr.parse(t):t.includes("linear-gradient")?r=pr.parse(t):t.includes("repeating-radial-gradient")?r=Cr.parse(t):t.includes("radial")?r=br.parse(t):t.includes("repeating-conic-gradient")?r=Pr.parse(t):t.includes("conic")&&(r=Or.parse(t))}),r}},{key:"callbackColorValue",value:function(t){var e=this.image.toString();"function"==typeof this.opt.onChange&&this.opt.onChange.call(this,e,this.image),"function"==typeof this.colorpickerShowCallback&&this.colorpickerShowCallback(e,this.image)}},{key:"callbackHideColorValue",value:function(t){var e=this.image.toString();"function"==typeof this.opt.onHide&&this.opt.onHide.call(this,e,this.image),"function"==typeof this.colorpickerHideCallback&&this.colorpickerHideCallback(e,this.image)}},{key:"initialize",value:function(){k(Dr.prototype.__proto__||Object.getPrototypeOf(Dr.prototype),"initialize",this).call(this),this.$root.addClass("gradient-picker"),this.selectedTab="linear-gradient",this.setValue(this.opt.gradient||"linear-gradient(to right, red 0%, yellow 100%)")}},{key:"setValue",value:function(t){this.gradient=t,this.image=this.parseImage(this.gradient),this.selectTabContent(this.image.type)}},{key:"getValue",value:function(){return this.image.toString()}},{key:"template",value:function(){return'\n <div class="gradient-body">\n\n <div class=\'box\'>\n <div class=\'gradient-preview\'>\n <div class=\'gradient-view\' ref=\'$gradientView\'></div>\n </div>\n <div class="picker-tab">\n <div class="picker-tab-list" ref="$tab" data-value="static-gradient" data-is-image-hidden="false">\n '+Mr.map(function(t){return"\n <sp
1an \n class='picker-tab-item "+(t.selected?"selected":"")+"' \n data-selected-value='"+t.type+"'\n title='"+t.title+"'\n > \n <div class='icon'></div>\n </span>"}).join("")+"\n </div>\n </div>\n <div target='gradientEditor'></div>\n\n </div>\n <div class='box'>\n <div target=\"EmbedColorPicker\"></div>\n </div>\n </div>\n \n "}},{key:"getColorString",value:function(){return this.image?this.image.getColorString():""}},{key:"getCurrentStepColor",value:function(){return(this.image.colorsteps[this.selectColorStepIndex||0]||{color:"rgba(0, 0, 0, 1)"}).color}},{key:"@changeGradientEditor",value:function(t){var e=t.colorsteps.map(function(t,e){return new ir({color:t.color,percent:t.offset.value,cut:t.cut,index:100*(e+1)})});t=x({},t,{type:this.selectedTab,colorsteps:e}),this.image.reset(t),this.updateGradientPreview(),this.updateData()}},{key:"click $tab .picker-tab-item",value:function(t){t=t.$delegateTarget.attr("data-selected-value");this.selectTabContent(t)}},{key:"selectTabContent",value:function(t){this.selectedTab=t,this.refs.$tab.attr("data-value",t),this.image=this.createGradient({type:t},this.image),this.$store.emit("setGradientEditor",this.getColorString(),this.selectColorStepIndex,this.image.type,this.image.angle,this.image.radialPosition,this.image.radialType);t=this.getCurrentStepColor();this["@selectColorStep"](t),this.updateGradientPreview()}},{key:"createGradient",value:function(t,e){var n=t.colorsteps||e.colorsteps,r=t.angle||e.angle,i=t.radialType||e.radialType||"ellipse",o=t.radialPosition||e.radialPosition||[nr.percent(50),nr.percent(50)],e=e.clone().toJSON();switch(delete e.itemType,delete e.type,t.type){case"linear-gradient":return new pr({colorsteps:n,angle:r});case"repeating-linear-gradient":return new gr({colorsteps:n,angle:r});case"radial-gradient":return new br({colorsteps:n,radialType:i,radialPosition:o});case"repeating-radial-gradient":return new Cr({colorsteps:n,radialType:i,radialPosition:o});case"conic-gradient":return new Or({colorsteps:n,angle:r,radialPosition:o});case"repeating-conic-gradient":return new Pr({colorsteps:n,angle:r,radialPosition:o})}return new sr}},{key:"@changeEmbedColorPicker",value:function(t){this.$store.emit("setColorStepColor",t)}},{key:"@selectColorStep",value:function(t){this.EmbedColorPicker.setValue(t)}},{key:"@changeColorStep",value:function(){this.image.reset(x({},0<arguments.length&&void 0!==arguments[0]?arguments[0]:{})),this.updateGradientPreview()}},{key:"updateGradientPreview",value:function(){this.image&&(this.refs.$gradientView.css("background-image",this.image.toString()),this.updateData())}},{key:"updateData",value:function(){this.callbackChange()}}]),Dr);function Dr(){return y(this,Dr),w(this,(Dr.__proto__||Object.getPrototypeOf(Dr)).apply(this,arguments))}return x({},d,qn,{createGradientPicker:function(t){return new Ir(t)}})}();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.