From 2e6a4c7aa8239dbc0e13e90048084181f9e084d3 Mon Sep 17 00:00:00 2001 From: Varun Date: Thu, 26 Sep 2019 09:09:05 +0530 Subject: [PATCH] Bump @simonwep/pickr from 1.4.1 to 1.4.2 --- package-lock.json | 41 +++++++++------------------------- vendors/pickr/pickr.es5.min.js | 4 ++-- 2 files changed, 13 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index fac3104..3644995 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3814,8 +3814,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -3836,14 +3835,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3858,20 +3855,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -3988,8 +3982,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -4001,7 +3994,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -4016,7 +4008,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -4024,14 +4015,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -4050,7 +4039,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -4131,8 +4119,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -4144,7 +4131,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -4230,8 +4216,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -4267,7 +4252,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4287,7 +4271,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4331,14 +4314,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, diff --git a/vendors/pickr/pickr.es5.min.js b/vendors/pickr/pickr.es5.min.js index bab866f..8a62513 100644 --- a/vendors/pickr/pickr.es5.min.js +++ b/vendors/pickr/pickr.es5.min.js @@ -1,3 +1,3 @@ -/*! Pickr 1.4.1 MIT | https://github.com/Simonwep/pickr */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Pickr=e():t.Pickr=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);var r={};function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function i(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:{};e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(n)||(n=[n]);var a=!0,c=!1,l=void 0;try{for(var s,u=e[Symbol.iterator]();!(a=(s=u.next()).done);a=!0){var p=s.value,h=!0,f=!1,d=void 0;try{for(var v,y=n[Symbol.iterator]();!(h=(v=y.next()).done);h=!0){var m=v.value;p[t](m,r,i({capture:!1},o))}}catch(t){f=!0,d=t}finally{try{h||null==y.return||y.return()}finally{if(f)throw d}}}}catch(t){c=!0,l=t}finally{try{a||null==u.return||u.return()}finally{if(c)throw l}}return Array.prototype.slice.call(arguments,1)}function u(t){var e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function p(t,e){var n=t.getAttribute(e);return t.removeAttribute(e),n}function h(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=p(e,":obj"),o=p(e,":ref"),i=r?n[r]={}:n;o&&(n[o]=e);for(var a=0,c=Array.from(e.children);a>/g).reduce(function(t,e,n,r){return t=t.querySelector(e),n1&&void 0!==arguments[1]?arguments[1]:function(t){return t};function n(n){var r=[.001,.01,.1][Number(n.shiftKey||2*n.ctrlKey)]*(n.deltaY<0?1:-1),o=0,i=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,function(t,n){return n<=i&&n+t.length>=i?(i=n,e(Number(t),r,o)):(o++,t)}),t.focus(),t.setSelectionRange(i,i),n.preventDefault(),t.dispatchEvent(new Event("input"))}c(t,"focus",function(){return c(window,"wheel",n,{passive:!1})}),c(t,"blur",function(){return l(window,"wheel",n)})}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function m(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&(r-=1)}return[360*r,100*o,100*a]}function C(t,e,n,r){return e/=100,n/=100,m(A(255*(1-b(1,(t/=100)*(1-(r/=100))+r)),255*(1-b(1,e*(1-r)+r)),255*(1-b(1,n*(1-r)+r))))}function S(t,e,n){return e/=100,[t,2*(e*=(n/=100)<.5?n:1-n)/(n+e)*100,100*(n+e)]}function O(t){return A.apply(void 0,m(t.match(/.{2}/g).map(function(t){return parseInt(t,16)})))}function j(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000000";var e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000000"===e.fillStyle?null:e.fillStyle}(t):t;var e,n={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},r=function(t){return t.map(function(t){return/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0})};t:for(var o in n)if(e=n[o].exec(t)){var i=!!e[2];switch(o){case"cmyk":var a=y(r(e),5),c=a[1],l=a[2],s=a[3],u=a[4];if(c>100||l>100||s>100||u>100)break t;return{values:C(c,l,s,u),type:o};case"rgba":var p=y(r(e),7),h=p[3],f=p[4],d=p[5],v=p[6];if(h>255||f>255||d>255||v<0||v>1||i===!v)break t;return{values:[].concat(m(A(h,f,d)),[v]),a:v,type:o};case"hexa":var b=y(e,2)[1];4!==b.length&&3!==b.length||(b=b.split("").map(function(t){return t+t}).join(""));var g=b.substring(0,6),_=b.substring(6);return _=_?parseInt(_,16)/255:void 0,{values:[].concat(m(O(g)),[_]),a:_,type:o};case"hsla":var w=y(r(e),7),k=w[3],j=w[4],x=w[5],E=w[6];if(k>360||j>100||x>100||E<0||E>1||i===!E)break t;return{values:[].concat(m(S(k,j,x)),[E]),a:E,type:o};case"hsva":var L=y(r(e),7),P=L[3],B=L[4],R=L[5],H=L[6];if(P>360||B>100||R>100||H<0||H>1||i===!H)break t;return{values:[P,B,R,H],a:H,type:o}}}return{values:null,type:null}}function x(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=function(t,e){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return e(~n?t.map(function(t){return Number(t.toFixed(n))}):t)}},i={h:t,s:e,v:n,a:r,toHSVA:function(){var t=[i.h,i.s,i.v,i.a];return t.toString=o(t,function(t){return"hsva(".concat(t[0],", ").concat(t[1],"%, ").concat(t[2],"%, ").concat(i.a,")")}),t},toHSLA:function(){var t=[].concat(x(function(t,e,n){var r=(2-(e/=100))*(n/=100)/2;return 0!==r&&(e=1===r?0:r<.5?e*n/(2*r):e*n/(2-2*r)),[t,100*e,100*r]}(i.h,i.s,i.v)),[i.a]);return t.toString=o(t,function(t){return"hsla(".concat(t[0],", ").concat(t[1],"%, ").concat(t[2],"%, ").concat(i.a,")")}),t},toRGBA:function(){var t=[].concat(x(k(i.h,i.s,i.v)),[i.a]);return t.toString=o(t,function(t){return"rgba(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(i.a,")")}),t},toCMYK:function(){var t=function(t,e,n){var r,o=k(t,e,n),i=o[0]/255,a=o[1]/255,c=o[2]/255;return[100*(1===(r=b(1-i,1-a,1-c))?0:(1-i-r)/(1-r)),100*(1===r?0:(1-a-r)/(1-r)),100*(1===r?0:(1-c-r)/(1-r)),100*r]}(i.h,i.s,i.v);return t.toString=o(t,function(t){return"cmyk(".concat(t[0],"%, ").concat(t[1],"%, ").concat(t[2],"%, ").concat(t[3],"%)")}),t},toHEXA:function(){var t=function(t,e,n){return k(t,e,n).map(function(t){return w(t).toString(16).padStart(2,"0")})}(i.h,i.s,i.v),e=i.a>=1?"":Number((255*i.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=function(){return"#".concat(t.join("").toUpperCase())},t},clone:function(){return E(i.h,i.s,i.v,i.a)}};return i}var L=function(t){return Math.max(Math.min(t,1),0)};function P(t){var e={options:Object.assign({lock:null,onchange:function(){return 0},onstop:function(){return 0}},t),_keyboard:function(t){var r=t.type,o=t.key;if(document.activeElement===n.wrapper)if("keydown"===r){var i=0,a=0;switch(o){case"ArrowLeft":i--;break;case"ArrowRight":i++;break;case"ArrowUp":a++;break;case"ArrowDown":a++}e.update(L(e.cache.x+.01*i),L(e.cache.y+.01*a))}else o.startsWith("Arrow")&&e.options.onstop()},_tapstart:function(t){c(document,["mouseup","touchend","touchcancel"],e._tapstop),c(document,["mousemove","touchmove"],e._tapmove),t.preventDefault(),e._tapmove(t)},_tapmove:function(t){var r=e.options.lock,o=e.cache,i=n.element,a=n.wrapper,c=a.getBoundingClientRect(),l=0,s=0;if(t){var u=t&&t.touches&&t.touches[0];l=t?(u||t).clientX:0,s=t?(u||t).clientY:0,lc.left+c.width&&(l=c.left+c.width),sc.top+c.height&&(s=c.top+c.height),l-=c.left,s-=c.top}else o&&(l=o.x*c.width,s=o.y*c.height);"h"!==r&&(i.style.left="calc(".concat(l/c.width*100,"% - ").concat(i.offsetWidth/2,"px)")),"v"!==r&&(i.style.top="calc(".concat(s/c.height*100,"% - ").concat(i.offsetHeight/2,"px)")),e.cache={x:l/c.width,y:s/c.height};var p=L(l/a.offsetWidth),h=L(s/a.offsetHeight);switch(r){case"v":return n.onchange(p);case"h":return n.onchange(h);default:return n.onchange(p,h)}},_tapstop:function(){e.options.onstop(),l(document,["mouseup","touchend","touchcancel"],e._tapstop),l(document,["mousemove","touchmove"],e._tapmove)},trigger:function(){e._tapmove()},update:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.options.wrapper.getBoundingClientRect(),o=r.left,i=r.top,a=r.width,c=r.height;"h"===e.options.lock&&(n=t),e._tapmove({clientX:o+a*t,clientY:i+c*n})},destroy:function(){var t=e.options,n=e._tapstart;l([t.wrapper,t.element],"mousedown",n),l([t.wrapper,t.element],"touchstart",n,{passive:!1})}},n=e.options,r=e._tapstart,o=e._keyboard;return c([n.wrapper,n.element],"mousedown",r),c([n.wrapper,n.element],"touchstart",r,{passive:!1}),c(document,["keydown","keyup"],o),e}function B(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};t=Object.assign({onchange:function(){return 0},className:"",elements:[]},t);var e=c(t.elements,"click",function(e){t.elements.forEach(function(n){return n.classList[e.target===n?"add":"remove"](t.className)}),t.onchange(e)});return{destroy:function(){return l.apply(r,B(e))}}}function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function D(t){var e=t.el,n=t.reference,r=t.padding,o=void 0===r?8:r,i={start:"sme",middle:"mse",end:"ems"},a={top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t[e];if(n)return n;var r=e.split("-"),o=H(r,2),i=o[0],a=o[1],c=void 0===a?"middle":a,l="top"===i||"bottom"===i;return t[e]={position:i,variant:c,isVertical:l}}}();return{update:function(t){var r=c(t),l=r.position,s=r.variant,u=r.isVertical,p=n.getBoundingClientRect(),h=e.getBoundingClientRect(),f=function(t){return t?{s:p.left+p.width-h.width,m:-h.width/2+(p.left+p.width/2),e:p.left}:{s:p.bottom-h.height,m:p.bottom-p.height/2-h.height/2,e:p.bottom-p.height}},d={};function v(t,n,r){var o="top"===r,i=o?h.height:h.width,a=window[o?"innerHeight":"innerWidth"],c=!0,l=!1,s=void 0;try{for(var u,p=t[Symbol.iterator]();!(c=(u=p.next()).done);c=!0){var f=n[u.value],v=d[r]="".concat(f,"px");if(f>0&&f+i\n\n '.concat(r?"":'','\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n \n ')),(u=s.interaction).options.find(function(t){return!t.hidden&&!t.classList.add("active")}),u.type=function(){return u.options.find(function(t){return t.classList.contains("active")})},s),p.useAsButton&&(this._root.button=p.el),p.container.appendChild(this._root.root)}},{key:"_finalBuild",value:function(){var t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){var n=t.el.parentElement;t.el.nextSibling?n.insertBefore(e.app,t.el.nextSibling):n.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}},{key:"_buildComponents",value:function(){var t=this,e=this,n=this.options.components,r=(e.options.sliders||"v").repeat(2),o=T(r.match(/^[vh]+$/g)?r:[],2),i=o[0],a=o[1],c=function(){return t._color||(t._color=t._lastColor.clone())},l={palette:P({element:e._root.palette.picker,wrapper:e._root.palette.palette,onstop:function(){return e._emit("changestop",e)},onchange:function(t,r){if(n.palette){var o=c(),i=e._root,a=e.options;e._recalc&&(o.s=100*t,o.v=100-100*r,o.v<0&&(o.v=0),e._updateOutput());var l=o.toRGBA().toString(0);this.element.style.background=l,this.wrapper.style.background="\n linear-gradient(to top, rgba(0, 0, 0, ".concat(o.a,"), transparent),\n linear-gradient(to left, hsla(").concat(o.h,", 100%, 50%, ").concat(o.a,"), rgba(255, 255, 255, ").concat(o.a,"))\n "),a.comparison?a.useAsButton||e._lastColor||(i.preview.lastColor.style.color=l):i.button.style.color=l;var s=o.toHEXA().toString(),u=!0,p=!1,h=void 0;try{for(var f,d=e._swatchColors[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var v=f.value,y=v.el,m=v.color;y.classList[s===m.toHEXA().toString()?"add":"remove"]("pcr-active")}}catch(t){p=!0,h=t}finally{try{u||null==d.return||d.return()}finally{if(p)throw h}}i.preview.currentColor.style.color=l,e.options.comparison||i.button.classList.remove("clear")}}}),hue:P({lock:"v"===a?"h":"v",element:e._root.hue.picker,wrapper:e._root.hue.slider,onstop:function(){return e._emit("changestop",e)},onchange:function(t){if(n.hue&&n.palette){var r=c();e._recalc&&(r.h=360*t),this.element.style.backgroundColor="hsl(".concat(r.h,", 100%, 50%)"),l.palette.trigger()}}}),opacity:P({lock:"v"===i?"h":"v",element:e._root.opacity.picker,wrapper:e._root.opacity.slider,onstop:function(){return e._emit("changestop",e)},onchange:function(t){if(n.opacity&&n.palette){var r=c();e._recalc&&(r.a=Math.round(100*t)/100),this.element.style.background="rgba(0, 0, 0, ".concat(r.a,")"),l.palette.trigger()}}}),selectable:R({elements:e._root.interaction.options,className:"active",onchange:function(t){e._representation=t.target.getAttribute("data-type").toUpperCase(),e._recalc&&e._updateOutput()}})};this._components=l}},{key:"_bindEvents",value:function(){var t=this,e=this._root,n=this.options,r=[c(e.interaction.clear,"click",function(){return t._clearColor()}),c([e.interaction.cancel,e.preview.lastColor],"click",function(){t._emit("cancel",t),t.setHSVA.apply(t,M((t._lastColor||t._color).toHSVA()).concat([!0]))}),c(e.interaction.save,"click",function(){!t.applyColor()&&!n.showAlways&&t.hide()}),c(e.interaction.result,["keyup","input"],function(e){t.setColor(e.target.value,!0)&&!t._initializingActive&&t._emit("change",t._color),e.stopImmediatePropagation()}),c(e.interaction.result,["focus","blur"],function(e){t._recalc="blur"===e.type,t._recalc&&t._updateOutput()}),c([e.palette.palette,e.palette.picker,e.hue.slider,e.hue.picker,e.opacity.slider,e.opacity.picker],["mousedown","touchstart"],function(){return t._recalc=!0})];if(!n.showAlways){var o=n.closeWithKey;r.push(c(e.button,"click",function(){return t.isOpen()?t.hide():t.show()}),c(document,"keyup",function(e){return t.isOpen()&&(e.key===o||e.code===o)&&t.hide()}),c(document,["touchstart","mousedown"],function(n){t.isOpen()&&!f(n).some(function(t){return t===e.app||t===e.button})&&t.hide()},{capture:!0}))}if(n.adjustableNumbers){var i={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};v(e.interaction.result,function(e,n,r){var o=i[t.getColorRepresentation().toLowerCase()];if(o){var a=o[r],c=e+(a>=100?1e3*n:n);return c<=0?0:Number((c0&&void 0!==arguments[0]&&arguments[0],e=this._root,n=this.options;n.useAsButton||(e.button.style.color="rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),n.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear",this))}},{key:"_parseLocalColor",value:function(t){var e=j(t),n=e.values,r=e.type,o=e.a,i=this.options.lockOpacity,a=void 0!==o&&1!==o;return n&&3===n.length&&(n[3]=void 0),{values:!n||i&&a?null:n,type:r}}},{key:"_emit",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o'));return o.swatches.appendChild(a),r.push({el:a,color:i}),this._eventBindings.push(c(a,"click",function(){e.setHSVA.apply(e,M(i.toHSVA()).concat([!0])),e._emit("swatchselect",i),e._emit("change",i)})),!0}return!1}},{key:"removeSwatch",value:function(t){var e=this._swatchColors[t];if(e){var n=e.el;return this._root.swatches.removeChild(n),this._swatchColors.splice(t,1),!0}return!1}},{key:"applyColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._root,n=e.preview,r=e.button,o=this._color.toRGBA().toString();n.lastColor.style.color=o,this.options.useAsButton||(r.style.color=o),r.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color)}},{key:"destroy",value:function(){var t=this;this._eventBindings.forEach(function(t){return l.apply(r,M(t))}),Object.keys(this._components).forEach(function(e){return t._components[e].destroy()})}},{key:"destroyAndRemove",value:function(){var t=this;this.destroy();var e=this._root,n=e.root,r=e.app;n.parentElement&&n.parentElement.removeChild(n),r.parentElement.removeChild(r),Object.keys(this).forEach(function(e){return t[e]=null})}},{key:"hide",value:function(){return this._root.app.classList.remove("visible"),this._emit("hide",this),this}},{key:"show",value:function(){return this.options.disabled||(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this)),this}},{key:"isOpen",value:function(){return this._root.app.classList.contains("visible")}},{key:"setHSVA",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:360,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||n<0||n>100||r<0||r>1)return!1;this._color=E(t,e,n,r);var a=this._components,c=a.hue,l=a.opacity,s=a.palette;return c.update(t/360),l.update(r),s.update(e/100,1-n/100),o||this.applyColor(),i&&this._updateOutput(),this._recalc=i,!0}},{key:"setColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(e),!0;var n=this._parseLocalColor(t),r=n.values,o=n.type;if(r){var i=o.toUpperCase(),a=this._root.interaction.options,c=a.find(function(t){return t.getAttribute("data-type")===i});if(c&&!c.hidden){var l=!0,s=!1,u=void 0;try{for(var p,h=a[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var f=p.value;f.classList[f===c?"add":"remove"]("active")}}catch(t){s=!0,u=t}finally{try{l||null==h.return||h.return()}finally{if(s)throw u}}}return this.setColorRepresentation(i),this.setHSVA.apply(this,M(r).concat([e]))}return!1}},{key:"setColorRepresentation",value:function(t){return t=t.toUpperCase(),!!this._root.interaction.options.find(function(e){return e.getAttribute("data-type").startsWith(t)&&!e.click()})}},{key:"getColorRepresentation",value:function(){return this._representation}},{key:"getColor",value:function(){return this._color}},{key:"getSelectedColor",value:function(){return this._lastColor}},{key:"getRoot",value:function(){return this._root}},{key:"disable",value:function(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}},{key:"enable",value:function(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}])&&N(e.prototype,n),o&&N(e,o),t}();F.utils=r,F.libs={HSVaColor:E,Moveable:P,Nanopop:D,Selectable:R},F.create=function(t){return new F(t)},F.version="1.4.1";e.default=F}]).default}); +/*! Pickr 1.4.2 MIT | https://github.com/Simonwep/pickr */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Pickr=e():t.Pickr=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);var r={};function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function i(t){for(var e=1;e4&&void 0!==arguments[4]?arguments[4]:{};e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(n)||(n=[n]);var a=!0,c=!1,l=void 0;try{for(var s,u=e[Symbol.iterator]();!(a=(s=u.next()).done);a=!0){var p=s.value,h=!0,f=!1,d=void 0;try{for(var v,y=n[Symbol.iterator]();!(h=(v=y.next()).done);h=!0){var m=v.value;p[t](m,r,i({capture:!1},o))}}catch(t){f=!0,d=t}finally{try{h||null==y.return||y.return()}finally{if(f)throw d}}}}catch(t){c=!0,l=t}finally{try{a||null==u.return||u.return()}finally{if(c)throw l}}return Array.prototype.slice.call(arguments,1)}function u(t){var e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function p(t,e){var n=t.getAttribute(e);return t.removeAttribute(e),n}function h(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=p(e,":obj"),o=p(e,":ref"),i=r?n[r]={}:n;o&&(n[o]=e);for(var a=0,c=Array.from(e.children);a>/g).reduce(function(t,e,n,r){return t=t.querySelector(e),n1&&void 0!==arguments[1]?arguments[1]:function(t){return t};function n(n){var r=[.001,.01,.1][Number(n.shiftKey||2*n.ctrlKey)]*(n.deltaY<0?1:-1),o=0,i=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,function(t,n){return n<=i&&n+t.length>=i?(i=n,e(Number(t),r,o)):(o++,t)}),t.focus(),t.setSelectionRange(i,i),n.preventDefault(),t.dispatchEvent(new Event("input"))}c(t,"focus",function(){return c(window,"wheel",n,{passive:!1})}),c(t,"blur",function(){return l(window,"wheel",n)})}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function m(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&(r-=1)}return[360*r,100*o,100*a]}function C(t,e,n,r){return e/=100,n/=100,m(k(255*(1-b(1,(t/=100)*(1-(r/=100))+r)),255*(1-b(1,e*(1-r)+r)),255*(1-b(1,n*(1-r)+r))))}function S(t,e,n){return e/=100,[t,2*(e*=(n/=100)<.5?n:1-n)/(n+e)*100,100*(n+e)]}function O(t){return k.apply(void 0,m(t.match(/.{2}/g).map(function(t){return parseInt(t,16)})))}function j(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000000";var e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000000"===e.fillStyle?null:e.fillStyle}(t):t;var e,n={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},r=function(t){return t.map(function(t){return/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0})};t:for(var o in n)if(e=n[o].exec(t)){var i=function(t){return!!e[2]==("number"==typeof t)};switch(o){case"cmyk":var a=y(r(e),5),c=a[1],l=a[2],s=a[3],u=a[4];if(c>100||l>100||s>100||u>100)break t;return{values:C(c,l,s,u),type:o};case"rgba":var p=y(r(e),7),h=p[3],f=p[4],d=p[5],v=p[6];if(h>255||f>255||d>255||v<0||v>1||!i(v))break t;return{values:[].concat(m(k(h,f,d)),[v]),a:v,type:o};case"hexa":var b=y(e,2)[1];4!==b.length&&3!==b.length||(b=b.split("").map(function(t){return t+t}).join(""));var g=b.substring(0,6),_=b.substring(6);return _=_?parseInt(_,16)/255:void 0,{values:[].concat(m(O(g)),[_]),a:_,type:o};case"hsla":var w=y(r(e),7),A=w[3],j=w[4],x=w[5],E=w[6];if(A>360||j>100||x>100||E<0||E>1||!i(E))break t;return{values:[].concat(m(S(A,j,x)),[E]),a:E,type:o};case"hsva":var L=y(r(e),7),P=L[3],B=L[4],R=L[5],H=L[6];if(P>360||B>100||R>100||H<0||H>1||!i(H))break t;return{values:[P,B,R,H],a:H,type:o}}}return{values:null,type:null}}function x(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=function(t,e){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return e(~n?t.map(function(t){return Number(t.toFixed(n))}):t)}},i={h:t,s:e,v:n,a:r,toHSVA:function(){var t=[i.h,i.s,i.v,i.a];return t.toString=o(t,function(t){return"hsva(".concat(t[0],", ").concat(t[1],"%, ").concat(t[2],"%, ").concat(i.a,")")}),t},toHSLA:function(){var t=[].concat(x(function(t,e,n){var r=(2-(e/=100))*(n/=100)/2;return 0!==r&&(e=1===r?0:r<.5?e*n/(2*r):e*n/(2-2*r)),[t,100*e,100*r]}(i.h,i.s,i.v)),[i.a]);return t.toString=o(t,function(t){return"hsla(".concat(t[0],", ").concat(t[1],"%, ").concat(t[2],"%, ").concat(i.a,")")}),t},toRGBA:function(){var t=[].concat(x(A(i.h,i.s,i.v)),[i.a]);return t.toString=o(t,function(t){return"rgba(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(i.a,")")}),t},toCMYK:function(){var t=function(t,e,n){var r,o=A(t,e,n),i=o[0]/255,a=o[1]/255,c=o[2]/255;return[100*(1===(r=b(1-i,1-a,1-c))?0:(1-i-r)/(1-r)),100*(1===r?0:(1-a-r)/(1-r)),100*(1===r?0:(1-c-r)/(1-r)),100*r]}(i.h,i.s,i.v);return t.toString=o(t,function(t){return"cmyk(".concat(t[0],"%, ").concat(t[1],"%, ").concat(t[2],"%, ").concat(t[3],"%)")}),t},toHEXA:function(){var t=function(t,e,n){return A(t,e,n).map(function(t){return w(t).toString(16).padStart(2,"0")})}(i.h,i.s,i.v),e=i.a>=1?"":Number((255*i.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=function(){return"#".concat(t.join("").toUpperCase())},t},clone:function(){return E(i.h,i.s,i.v,i.a)}};return i}var L=function(t){return Math.max(Math.min(t,1),0)};function P(t){var e={options:Object.assign({lock:null,onchange:function(){return 0},onstop:function(){return 0}},t),_keyboard:function(t){var r=t.type,o=t.key;if(document.activeElement===n.wrapper){var i=e.options.lock,a="ArrowUp"===o,c="ArrowRight"===o,l="ArrowDown"===o,s="ArrowLeft"===o;if("keydown"===r&&(a||c||l||s)){var u=0,p=0;"v"===i?u=a||c?1:-1:"h"===i?u=a||c?-1:1:(p=a?-1:l?1:0,u=s?-1:c?1:0),e.update(L(e.cache.x+.01*u),L(e.cache.y+.01*p))}else o.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault())}},_tapstart:function(t){c(document,["mouseup","touchend","touchcancel"],e._tapstop),c(document,["mousemove","touchmove"],e._tapmove),t.preventDefault(),e._tapmove(t)},_tapmove:function(t){var r=e.options.lock,o=e.cache,i=n.element,a=n.wrapper,c=a.getBoundingClientRect(),l=0,s=0;if(t){var u=t&&t.touches&&t.touches[0];l=t?(u||t).clientX:0,s=t?(u||t).clientY:0,lc.left+c.width&&(l=c.left+c.width),sc.top+c.height&&(s=c.top+c.height),l-=c.left,s-=c.top}else o&&(l=o.x*c.width,s=o.y*c.height);"h"!==r&&(i.style.left="calc(".concat(l/c.width*100,"% - ").concat(i.offsetWidth/2,"px)")),"v"!==r&&(i.style.top="calc(".concat(s/c.height*100,"% - ").concat(i.offsetHeight/2,"px)")),e.cache={x:l/c.width,y:s/c.height};var p=L(l/a.offsetWidth),h=L(s/a.offsetHeight);switch(r){case"v":return n.onchange(p);case"h":return n.onchange(h);default:return n.onchange(p,h)}},_tapstop:function(){e.options.onstop(),l(document,["mouseup","touchend","touchcancel"],e._tapstop),l(document,["mousemove","touchmove"],e._tapmove)},trigger:function(){e._tapmove()},update:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.options.wrapper.getBoundingClientRect(),o=r.left,i=r.top,a=r.width,c=r.height;"h"===e.options.lock&&(n=t),e._tapmove({clientX:o+a*t,clientY:i+c*n})},destroy:function(){var t=e.options,n=e._tapstart;l([t.wrapper,t.element],"mousedown",n),l([t.wrapper,t.element],"touchstart",n,{passive:!1})}},n=e.options,r=e._tapstart,o=e._keyboard;return c([n.wrapper,n.element],"mousedown",r),c([n.wrapper,n.element],"touchstart",r,{passive:!1}),c(document,["keydown","keyup"],o),e}function B(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};t=Object.assign({onchange:function(){return 0},className:"",elements:[]},t);var e=c(t.elements,"click",function(e){t.elements.forEach(function(n){return n.classList[e.target===n?"add":"remove"](t.className)}),t.onchange(e)});return{destroy:function(){return l.apply(r,B(e))}}}function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function D(t){var e=t.el,n=t.reference,r=t.padding,o=void 0===r?8:r,i={start:"sme",middle:"mse",end:"ems"},a={top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t[e];if(n)return n;var r=e.split("-"),o=H(r,2),i=o[0],a=o[1],c=void 0===a?"middle":a,l="top"===i||"bottom"===i;return t[e]={position:i,variant:c,isVertical:l}}}();return{update:function(t){var r=c(t),l=r.position,s=r.variant,u=r.isVertical,p=n.getBoundingClientRect(),h=e.getBoundingClientRect(),f=function(t){return t?{s:p.left+p.width-h.width,m:-h.width/2+(p.left+p.width/2),e:p.left}:{s:p.bottom-h.height,m:p.bottom-p.height/2-h.height/2,e:p.bottom-p.height}},d={};function v(t,n,r){var o="top"===r,i=o?h.height:h.width,a=window[o?"innerHeight":"innerWidth"],c=!0,l=!1,s=void 0;try{for(var u,p=t[Symbol.iterator]();!(c=(u=p.next()).done);c=!0){var f=n[u.value],v=d[r]="".concat(f,"px");if(f>0&&f+i\n\n '.concat(r?"":'','\n\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n\n
\n\n
\n \n\n \n \n \n \n \n\n \n \n \n
\n
\n \n ')),(u=s.interaction).options.find(function(t){return!t.hidden&&!t.classList.add("active")}),u.type=function(){return u.options.find(function(t){return t.classList.contains("active")})},s),p.useAsButton&&(this._root.button=p.el),p.container.appendChild(this._root.root)}},{key:"_finalBuild",value:function(){var t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){var n=t.el.parentElement;t.el.nextSibling?n.insertBefore(e.app,t.el.nextSibling):n.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}},{key:"_buildComponents",value:function(){var t=this,e=this,n=this.options.components,r=(e.options.sliders||"v").repeat(2),o=T(r.match(/^[vh]+$/g)?r:[],2),i=o[0],a=o[1],c=function(){return t._color||(t._color=t._lastColor.clone())},l={palette:P({element:e._root.palette.picker,wrapper:e._root.palette.palette,onstop:function(){return e._emit("changestop",e)},onchange:function(t,r){if(n.palette){var o=c(),i=e._root,a=e.options;e._recalc&&(o.s=100*t,o.v=100-100*r,o.v<0&&(o.v=0),e._updateOutput());var l=o.toRGBA().toString(0);this.element.style.background=l,this.wrapper.style.background="\n linear-gradient(to top, rgba(0, 0, 0, ".concat(o.a,"), transparent),\n linear-gradient(to left, hsla(").concat(o.h,", 100%, 50%, ").concat(o.a,"), rgba(255, 255, 255, ").concat(o.a,"))\n "),a.comparison?a.useAsButton||e._lastColor||(i.preview.lastColor.style.color=l):i.button.style.color=l;var s=o.toHEXA().toString(),u=!0,p=!1,h=void 0;try{for(var f,d=e._swatchColors[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var v=f.value,y=v.el,m=v.color;y.classList[s===m.toHEXA().toString()?"add":"remove"]("pcr-active")}}catch(t){p=!0,h=t}finally{try{u||null==d.return||d.return()}finally{if(p)throw h}}i.preview.currentColor.style.color=l,e.options.comparison||i.button.classList.remove("clear")}}}),hue:P({lock:"v"===a?"h":"v",element:e._root.hue.picker,wrapper:e._root.hue.slider,onstop:function(){return e._emit("changestop",e)},onchange:function(t){if(n.hue&&n.palette){var r=c();e._recalc&&(r.h=360*t),this.element.style.backgroundColor="hsl(".concat(r.h,", 100%, 50%)"),l.palette.trigger()}}}),opacity:P({lock:"v"===i?"h":"v",element:e._root.opacity.picker,wrapper:e._root.opacity.slider,onstop:function(){return e._emit("changestop",e)},onchange:function(t){if(n.opacity&&n.palette){var r=c();e._recalc&&(r.a=Math.round(100*t)/100),this.element.style.background="rgba(0, 0, 0, ".concat(r.a,")"),l.palette.trigger()}}}),selectable:R({elements:e._root.interaction.options,className:"active",onchange:function(t){e._representation=t.target.getAttribute("data-type").toUpperCase(),e._recalc&&e._updateOutput()}})};this._components=l}},{key:"_bindEvents",value:function(){var t=this,e=this._root,n=this.options,r=[c(e.interaction.clear,"click",function(){return t._clearColor()}),c([e.interaction.cancel,e.preview.lastColor],"click",function(){t._emit("cancel",t),t.setHSVA.apply(t,M((t._lastColor||t._color).toHSVA()).concat([!0]))}),c(e.interaction.save,"click",function(){!t.applyColor()&&!n.showAlways&&t.hide()}),c(e.interaction.result,["keyup","input"],function(e){t.setColor(e.target.value,!0)&&!t._initializingActive&&t._emit("change",t._color),e.stopImmediatePropagation()}),c(e.interaction.result,["focus","blur"],function(e){t._recalc="blur"===e.type,t._recalc&&t._updateOutput()}),c([e.palette.palette,e.palette.picker,e.hue.slider,e.hue.picker,e.opacity.slider,e.opacity.picker],["mousedown","touchstart"],function(){return t._recalc=!0})];if(!n.showAlways){var o=n.closeWithKey;r.push(c(e.button,"click",function(){return t.isOpen()?t.hide():t.show()}),c(document,"keyup",function(e){return t.isOpen()&&(e.key===o||e.code===o)&&t.hide()}),c(document,["touchstart","mousedown"],function(n){t.isOpen()&&!f(n).some(function(t){return t===e.app||t===e.button})&&t.hide()},{capture:!0}))}if(n.adjustableNumbers){var i={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};v(e.interaction.result,function(e,n,r){var o=i[t.getColorRepresentation().toLowerCase()];if(o){var a=o[r],c=e+(a>=100?1e3*n:n);return c<=0?0:Number((c0&&void 0!==arguments[0]&&arguments[0],e=this._root,n=this.options;n.useAsButton||(e.button.style.color="rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),n.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear",this))}},{key:"_parseLocalColor",value:function(t){var e=j(t),n=e.values,r=e.type,o=e.a,i=this.options.lockOpacity,a=void 0!==o&&1!==o;return n&&3===n.length&&(n[3]=void 0),{values:!n||i&&a?null:n,type:r}}},{key:"_emit",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o'));return o.swatches.appendChild(a),r.push({el:a,color:i}),this._eventBindings.push(c(a,"click",function(){e.setHSVA.apply(e,M(i.toHSVA()).concat([!0])),e._emit("swatchselect",i),e._emit("change",i)})),!0}return!1}},{key:"removeSwatch",value:function(t){var e=this._swatchColors[t];if(e){var n=e.el;return this._root.swatches.removeChild(n),this._swatchColors.splice(t,1),!0}return!1}},{key:"applyColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._root,n=e.preview,r=e.button,o=this._color.toRGBA().toString();n.lastColor.style.color=o,this.options.useAsButton||(r.style.color=o),r.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color)}},{key:"destroy",value:function(){var t=this;this._eventBindings.forEach(function(t){return l.apply(r,M(t))}),Object.keys(this._components).forEach(function(e){return t._components[e].destroy()})}},{key:"destroyAndRemove",value:function(){var t=this;this.destroy();var e=this._root,n=e.root,r=e.app;n.parentElement&&n.parentElement.removeChild(n),r.parentElement.removeChild(r),Object.keys(this).forEach(function(e){return t[e]=null})}},{key:"hide",value:function(){return this._root.app.classList.remove("visible"),this._emit("hide",this),this}},{key:"show",value:function(){return this.options.disabled||(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this)),this}},{key:"isOpen",value:function(){return this._root.app.classList.contains("visible")}},{key:"setHSVA",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:360,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||n<0||n>100||r<0||r>1)return!1;this._color=E(t,e,n,r);var a=this._components,c=a.hue,l=a.opacity,s=a.palette;return c.update(t/360),l.update(r),s.update(e/100,1-n/100),o||this.applyColor(),i&&this._updateOutput(),this._recalc=i,!0}},{key:"setColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(e),!0;var n=this._parseLocalColor(t),r=n.values,o=n.type;if(r){var i=o.toUpperCase(),a=this._root.interaction.options,c=a.find(function(t){return t.getAttribute("data-type")===i});if(c&&!c.hidden){var l=!0,s=!1,u=void 0;try{for(var p,h=a[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var f=p.value;f.classList[f===c?"add":"remove"]("active")}}catch(t){s=!0,u=t}finally{try{l||null==h.return||h.return()}finally{if(s)throw u}}}return this.setColorRepresentation(i),this.setHSVA.apply(this,M(r).concat([e]))}return!1}},{key:"setColorRepresentation",value:function(t){return t=t.toUpperCase(),!!this._root.interaction.options.find(function(e){return e.getAttribute("data-type").startsWith(t)&&!e.click()})}},{key:"getColorRepresentation",value:function(){return this._representation}},{key:"getColor",value:function(){return this._color}},{key:"getSelectedColor",value:function(){return this._lastColor}},{key:"getRoot",value:function(){return this._root}},{key:"disable",value:function(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}},{key:"enable",value:function(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}])&&N(e.prototype,n),o&&N(e,o),t}();F.utils=r,F.libs={HSVaColor:E,Moveable:P,Nanopop:D,Selectable:R},F.create=function(t){return new F(t)},F.version="1.4.2";e.default=F}]).default}); //# sourceMappingURL=pickr.es5.min.js.map \ No newline at end of file