Socket
Socket
Sign inDemoInstall

@simonwep/pickr

Package Overview
Dependencies
0
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.2 to 0.6.3

st/favicon.png

4

dist/pickr.es5.min.js

@@ -1,3 +0,3 @@

/*! Pickr 0.6.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=1)}([function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"on",function(){return a}),n.d(r,"off",function(){return c}),n.d(r,"createElementFromString",function(){return l}),n.d(r,"removeAttribute",function(){return u}),n.d(r,"createFromTemplate",function(){return p}),n.d(r,"eventPath",function(){return h}),n.d(r,"adjustableInputNumbers",function(){return d});n(0);function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){i(t,e,n[e])})}return t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=s.bind(null,"addEventListener"),c=s.bind(null,"removeEventListener");function s(t,e,n,r){var i=arguments.length>4&&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,s=void 0;try{for(var l,u=e[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var p=l.value,h=!0,d=!1,f=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,o({capture:!1},i))}}catch(t){d=!0,f=t}finally{try{h||null==y.return||y.return()}finally{if(d)throw f}}}}catch(t){c=!0,s=t}finally{try{a||null==u.return||u.return()}finally{if(c)throw s}}return Array.prototype.slice.call(arguments,1)}function l(t){var e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function u(t,e){var n=t.getAttribute(e);return t.removeAttribute(e),n}function p(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=u(e,"data-con"),o=u(e,"data-key");o&&(n[o]=e);for(var i=r?n[r]={}:n,a=0,c=Array.from(e.children);a<c.length;a++){var s=c[a],l=u(s,"data-arr");l?(i[l]||(i[l]=[])).push(s):t(s,i)}return n}(l(t))}function h(t){var e=t.path||t.composedPath&&t.composedPath();if(e)return e;var n=t.target.parentElement;for(e=[t.target,n];n=n.parentElement;)e.push(n);return e.push(document,window),e}function d(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=function(t){return t>="0"&&t<="9"||"-"===t||"."===t};function r(r){for(var o=t.value,i=t.selectionStart,a=i,c="",s=i-1;s>0&&n(o[s]);s--)c=o[s]+c,a--;for(var l=i,u=o.length;l<u&&n(o[l]);l++)c+=o[l];if(c.length>0&&!isNaN(c)&&isFinite(c)){var p=r.deltaY<0?1:-1,h=[1,10,100][Number(r.shiftKey||2*r.ctrlKey)]*p,d=Number(c)+h;!e&&d<0&&(d=0);var f=o.substr(0,a)+d+o.substring(a+c.length,o.length),v=a+String(d).length;t.value=f,t.focus(),t.setSelectionRange(v,v)}r.preventDefault(),t.dispatchEvent(new Event("input"))}a(t,"focus",function(){return a(window,"wheel",r,{passive:!1})}),a(t,"blur",function(){return c(window,"wheel",r)})}function f(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 v(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var y=Math.min,m=Math.max,g=Math.floor,b=Math.round;function _(t,e,n){e/=100,n/=100;var r=g(t=t/360*6),o=t-r,i=n*(1-e),a=n*(1-o*e),c=n*(1-(1-o)*e),s=r%6;return[255*[n,a,i,i,c,n][s],255*[c,n,n,a,i,i][s],255*[i,i,c,n,n,a][s]]}function w(t,e,n){var r,o,i=y(t/=255,e/=255,n/=255),a=m(t,e,n),c=a-i;if(0===c)r=o=0;else{o=c/a;var s=((a-t)/6+c/2)/c,l=((a-e)/6+c/2)/c,u=((a-n)/6+c/2)/c;t===a?r=u-l:e===a?r=1/3+s-u:n===a&&(r=2/3+l-s),r<0?r+=1:r>1&&(r-=1)}return[360*r,100*o,100*a]}function k(t,e,n,r){return e/=100,n/=100,v(w(255*(1-y(1,(t/=100)*(1-(r/=100))+r)),255*(1-y(1,e*(1-r)+r)),255*(1-y(1,n*(1-r)+r))))}function A(t,e,n){return e/=100,[t,2*(e*=(n/=100)<.5?n:1-n)/(n+e)*100,100*(n+e)]}function C(t){return w.apply(void 0,v(t.match(/.{2}/g).map(function(t){return parseInt(t,16)})))}function S(t){var e,n;t=t.match(/^[a-zA-Z]+$/)?(e=t,(n=document.createElement("canvas").getContext("2d")).fillStyle=e,n.fillStyle):t;var r,o={cmyk:/^cmyk[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)/i,rgba:/^(rgb|rgba)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsla:/^(hsl|hsla)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsva:/^(hsv|hsva)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hex:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},i=function(t){return t.map(function(t){return/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0})};for(var a in o)if(r=o[a].exec(t))switch(a){case"cmyk":var c=f(i(r),5),s=c[1],l=c[2],u=c[3],p=c[4];if(s>100||l>100||u>100||p>100)break;return{values:[].concat(v(k(s,l,u,p)),[1]),type:a};case"rgba":var h=f(i(r),6),d=h[2],y=h[3],m=h[4],g=h[5],b=void 0===g?1:g;if(d>255||y>255||m>255||b<0||b>1)break;return{values:[].concat(v(w(d,y,m)),[b]),type:a};case"hex":var _=function(t,e){return[t.substring(0,e),t.substring(e,t.length)]},S=f(r,2)[1];3===S.length?S+="F":6===S.length&&(S+="FF");var O=void 0;if(4===S.length){var j=f(_(S,3).map(function(t){return t+t}),2);S=j[0],O=j[1]}else if(8===S.length){var x=f(_(S,6),2);S=x[0],O=x[1]}return O=parseInt(O,16)/255,{values:[].concat(v(C(S)),[O]),type:a};case"hsla":var E=f(i(r),6),B=E[2],P=E[3],L=E[4],H=E[5],R=void 0===H?1:H;if(B>360||P>100||L>100||R<0||R>1)break;return{values:[].concat(v(A(B,P,L)),[R]),type:a};case"hsva":var D=f(i(r),6),F=D[2],M=D[3],N=D[4],T=D[5],I=void 0===T?1:T;if(F>360||M>100||N>100||I<0||I>1)break;return{values:[F,M,N,I],type:a}}return{values:null,type:null}}function O(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=Math.ceil,i={h:t,s:e,v:n,a:r,toHSVA:function(){var t=[i.h,i.s,i.v],e=t.map(o);return t.push(i.a),t.toString=function(){return"hsva(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%, ").concat(i.a.toFixed(1),")")},t},toHSLA:function(){var t,e,n,r,a=(t=i.h,e=i.s,n=i.v,0!==(r=(2-(e/=100))*(n/=100)/2)&&(e=1===r?0:r<.5?e*n/(2*r):e*n/(2-2*r)),[t,100*e,100*r]),c=a.map(o);return a.push(i.a),a.toString=function(){return"hsla(".concat(c[0],", ").concat(c[1],"%, ").concat(c[2],"%, ").concat(i.a.toFixed(1),")")},a},toRGBA:function(){var t=_(i.h,i.s,i.v),e=t.map(o);return t.push(i.a),t.toString=function(){return"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(i.a.toFixed(1),")")},t},toCMYK:function(){var t,e,n,r,a,c,s,l,u=(t=i.h,e=i.s,n=i.v,a=_(t,e,n),c=a[0]/255,s=a[1]/255,l=a[2]/255,[100*(1===(r=y(1-c,1-s,1-l))?0:(1-c-r)/(1-r)),100*(1===r?0:(1-s-r)/(1-r)),100*(1===r?0:(1-l-r)/(1-r)),100*r]),p=u.map(o);return u.toString=function(){return"cmyk(".concat(p[0],"%, ").concat(p[1],"%, ").concat(p[2],"%, ").concat(p[3],"%)")},u},toHEXA:function(){var t,e,n,r=(t=i.h,e=i.s,n=i.v,_(t,e,n).map(function(t){return b(t).toString(16).padStart(2,"0")}));return r.toString=function(){var t=i.a>=1?"":Number((255*i.a).toFixed(0).toString(16).toUpperCase(),2,"0");return"#".concat(r.join("").toUpperCase()+t)},r},clone:function(){return O(i.h,i.s,i.v,i.a)}};return i}function j(t){var e={options:Object.assign({lockX:!1,lockY:!1,onchange:function(){return 0}},t),_tapstart:function(t){a(document,["mouseup","touchend","touchcancel"],e._tapstop),a(document,["mousemove","touchmove"],e._tapmove),t.preventDefault(),e._tapmove(t)},_tapmove:function(t){var n=e.options,r=e.cache,o=n.element,i=e.options.wrapper.getBoundingClientRect(),a=0,c=0;if(t){var s=t&&t.touches&&t.touches[0];a=t?(s||t).clientX:0,c=t?(s||t).clientY:0,a<i.left?a=i.left:a>i.left+i.width&&(a=i.left+i.width),c<i.top?c=i.top:c>i.top+i.height&&(c=i.top+i.height),a-=i.left,c-=i.top}else r&&(a=r.x*i.width,c=r.y*i.height);n.lockX||(o.style.left="calc(".concat(a/i.width*100,"% - ").concat(o.offsetWidth/2,"px)")),n.lockY||(o.style.top="calc(".concat(c/i.height*100,"% - ").concat(o.offsetWidth/2,"px)")),e.cache={x:a/i.width,y:c/i.height},n.onchange(a,c)},_tapstop:function(){c(document,["mouseup","touchend","touchcancel"],e._tapstop),c(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();e._tapmove({clientX:r.left+t,clientY:r.top+n})},destroy:function(){var t=e.options,n=e._tapstart;c([t.wrapper,t.element],"mousedown",n),c([t.wrapper,t.element],"touchstart",n,{passive:!1})}},n=e.options,r=e._tapstart;return a([n.wrapper,n.element],"mousedown",r),a([n.wrapper,n.element],"touchstart",r,{passive:!1}),e}function x(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function E(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Object.assign({onchange:function(){return 0},className:"",elements:[]},t);var e=a(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 c.apply(r,x(e))}}}function B(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 P(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function L(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 H(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var R=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),H(this,"_initializingActive",!0),H(this,"_recalc",!0),H(this,"_color",O()),H(this,"_lastColor",O()),H(this,"_swatchColors",[]),H(this,"_eventListener",{swatchselect:[],change:[],save:[],init:[]}),this.options=e=Object.assign({appClass:null,useAsButton:!1,disabled:!1,comparison:!0,components:{interaction:{}},strings:{},swatches:null,inline:!1,default:"#42445A",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"},e);var r=e,o=r.swatches,i=r.inline,a=r.components,c=r.position;a.interaction||(a.interaction={});var s=a.preview,l=a.opacity,u=a.hue,p=a.palette;a.palette=p||s||l||u,i&&(e.showAlways=!0),this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),o&&o.length&&o.forEach(function(t){return n.addSwatch(t)}),this._nanopop=function(t){var e=t.el,n=t.reference,r=t.pos,o=t.padding,i=void 0===o?8:o,a={start:"sme",middle:"mse",end:"ems"},c={top:"tb",right:"rl",bottom:"bt",left:"lr"},s=B(r.split("-"),2),l=s[0],u=s[1],p=void 0===u?"middle":u,h="top"===l||"bottom"===l;return{update:function(){var t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),o=h?{t:t.top-r.height-i,b:t.bottom+i}:{r:t.right+i,l:t.left-r.width-i},s=h?{s:t.left+t.width-r.width,m:-r.width/2+(t.left+t.width/2),e:t.left}:{s:t.bottom-r.height,m:t.bottom-t.height/2-r.height/2,e:t.bottom-t.height};function u(t,n,o){var i="top"===o,a=i?r.height:r.width,c=window[i?"innerHeight":"innerWidth"],s=!0,l=!1,u=void 0;try{for(var p,h=t[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){var d=n[p.value];if(d>0&&d+a<c){e.style[o]="".concat(d,"px");break}}}catch(t){l=!0,u=t}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}u(a[p],s,h?"left":"top"),u(c[l],o,h?"top":"left")}}}({reference:this._root.button,el:this._root.app,pos:c});var h=this._root.button,d=this;requestAnimationFrame(function t(){if(null===h.offsetParent&&h!==document.body)return requestAnimationFrame(t);d.setColor(e.default),d._rePositioningPicker(),e.defaultRepresentation&&(d._representation=e.defaultRepresentation,d.setColorRepresentation(d._representation)),e.showAlways&&d.show(),d._initializingActive=!1,d._emit("init")})}var e,n,o;return e=t,(n=[{key:"_preBuild",value:function(){var t,e,n,r,o,i,a,c,s,l=this.options;"string"==typeof l.el&&(l.el=l.el.split(/>>/g).reduce(function(t,e,n,r){return t=t.querySelector(e),n<r.length-1?t.shadowRoot:t},document)),this._root=(e=(t=l).components,n=t.strings,r=t.useAsButton,o=t.inline,i=t.appClass,a=function(t){return t?"":'style="display:none" hidden'},c=p('\n <div data-key="root" class="pickr">\n\n '.concat(r?"":'<button type="button" data-key="button" class="pcr-button"></button>','\n\n <div data-key="app" class="pcr-app ').concat(i||"",'" ').concat(o?'style="position: unset"':"",'>\n <div class="pcr-selection" ').concat(a(e.palette),'>\n <div data-con="preview" class="pcr-color-preview" ').concat(a(e.preview),'>\n <button type="button" data-key="lastColor" class="pcr-last-color"></button>\n <div data-key="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div data-con="palette" class="pcr-color-palette">\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="palette" class="pcr-palette"></div>\n </div>\n\n <div data-con="hue" class="pcr-color-chooser" ').concat(a(e.hue),'>\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="slider" class="pcr-hue pcr-slider"></div>\n </div>\n\n <div data-con="opacity" class="pcr-color-opacity" ').concat(a(e.opacity),'>\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="slider" class="pcr-opacity pcr-slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ').concat(e.palette?"":" pcr-last",'" data-key="swatches"></div> \n\n <div data-con="interaction" class="pcr-interaction" ').concat(a(Object.keys(e.interaction).length),'>\n <input data-key="result" class="pcr-result" type="text" spellcheck="false" ').concat(a(e.interaction.input),'>\n\n <input data-arr="options" class="pcr-type" data-type="HEXA" value="HEXA" type="button" ').concat(a(e.interaction.hex),'>\n <input data-arr="options" class="pcr-type" data-type="RGBA" value="RGBA" type="button" ').concat(a(e.interaction.rgba),'>\n <input data-arr="options" class="pcr-type" data-type="HSLA" value="HSLA" type="button" ').concat(a(e.interaction.hsla),'>\n <input data-arr="options" class="pcr-type" data-type="HSVA" value="HSVA" type="button" ').concat(a(e.interaction.hsva),'>\n <input data-arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ').concat(a(e.interaction.cmyk),'>\n\n <input data-key="save" class="pcr-save" value="').concat(n.save||"Save",'" type="button" ').concat(a(e.interaction.save),'>\n <input data-key="clear" class="pcr-clear" value="').concat(n.clear||"Clear",'" type="button" ').concat(a(e.interaction.clear),">\n </div>\n </div>\n </div>\n ")),(s=c.interaction).options.find(function(t){return!t.hidden&&!t.classList.add("active")}),s.type=function(){return s.options.find(function(t){return t.classList.contains("active")})},c),l.useAsButton&&(this._root.button=l.el),document.body.appendChild(this._root.root)}},{key:"_finalBuild",value:function(){var t=this.options,e=this._root;if(document.body.removeChild(e.root),t.inline){var n=t.el.parentElement;n.lastChild===t.el?n.appendChild(e.app):n.insertBefore(e.app,t.el.nextSibling)}else document.body.appendChild(e.app);t.useAsButton||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.options.components,n={palette:j({element:t._root.palette.picker,wrapper:t._root.palette.palette,onchange:function(n,r){if(e.palette){var o=t._color,i=t._root,a=t.options;o.s=n/this.wrapper.offsetWidth*100,o.v=100-r/this.wrapper.offsetHeight*100,o.v<0&&(o.v=0);var c=o.toRGBA().toString();this.element.style.background=c,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||(i.button.style.color=c,a.useAsButton||(i.preview.lastColor.style.color=c)),i.preview.currentColor.style.color=c,t._recalc&&t._updateOutput(),i.button.classList.remove("clear")}}}),hue:j({lockX:!0,element:t._root.hue.picker,wrapper:t._root.hue.slider,onchange:function(r,o){e.hue&&e.palette&&(t._color.h=o/this.wrapper.offsetHeight*360,this.element.style.backgroundColor="hsl(".concat(t._color.h,", 100%, 50%)"),n.palette.trigger())}}),opacity:j({lockX:!0,element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onchange:function(n,r){e.opacity&&e.palette&&(t._color.a=Math.round(r/this.wrapper.offsetHeight*100)/100,this.element.style.background="rgba(0, 0, 0, ".concat(t._color.a,")"),t.components.palette.trigger())}}),selectable:E({elements:t._root.interaction.options,className:"active",onchange:function(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._updateOutput()}})};this.components=n}},{key:"_bindEvents",value:function(){var t=this,e=this._root,n=this.options,r=[a(e.interaction.clear,"click",function(){return t._clearColor()}),a(e.preview.lastColor,"click",function(){return t.setHSVA.apply(t,P(t._lastColor.toHSVA()))}),a(e.interaction.save,"click",function(){!t.applyColor()&&!n.showAlways&&t.hide()}),a(e.interaction.result,["keyup","input"],function(e){t._recalc=!1,t.setColor(e.target.value,!0)&&!t._initializingActive&&t._emit("change",t._color),e.stopImmediatePropagation()}),a([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(a(e.button,"click",function(){return t.isOpen()?t.hide():t.show()}),a(document,"keyup",function(e){return t.isOpen()&&(e.key===o||e.code===o)&&t.hide()}),a(document,["touchstart","mousedown"],function(n){t.isOpen()&&!h(n).some(function(t){return t===e.app||t===e.button})&&t.hide()},{capture:!0}))}if(n.adjustableNumbers&&d(e.interaction.result,!1),!n.inline){var i=null,c=this;r.push(a(window,["scroll","resize"],function(){c.isOpen()&&(null===i?(i=setTimeout(function(){return i=null},100),requestAnimationFrame(function t(){c._rePositioningPicker(),null!==i&&requestAnimationFrame(t)})):(clearTimeout(i),i=setTimeout(function(){return i=null},100)))}))}this._eventBindings=r}},{key:"_rePositioningPicker",value:function(){this.options.inline||this._nanopop.update()}},{key:"_updateOutput",value:function(){if(this._root.interaction.type()){var t="to".concat(this._root.interaction.type().getAttribute("data-type"));this._root.interaction.result.value="function"==typeof this._color[t]?this._color[t]().toString():""}this._initializingActive||this._emit("change",this._color)}},{key:"_clearColor",value:function(){var t=this._root,e=this.options;e.useAsButton||(t.button.style.color="rgba(0, 0, 0, 0.15)"),t.button.classList.add("clear"),e.showAlways||this.hide(),this._initializingActive||this._emit("save",null)}},{key:"_emit",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this._eventListener[t].forEach(function(t){return t.apply(void 0,r.concat([e]))})}},{key:"on",value:function(t,e){return"function"==typeof e&&"string"==typeof t&&t in this._eventListener&&this._eventListener[t].push(e),this}},{key:"off",value:function(t,e){var n=this._eventListener[t];if(n){var r=n.indexOf(e);~r&&n.splice(r,1)}return this}},{key:"addSwatch",value:function(t){var e=this,n=S(t).values;if(n){var r=this._swatchColors,o=this._root,i=O.apply(void 0,P(n)),c=l('<button type="button" style="color: '.concat(i.toRGBA(),'"></button>'));return o.swatches.appendChild(c),r.push({element:c,hsvaColorObject:i}),this._eventBindings.push(a(c,"click",function(){e.setHSVA.apply(e,P(i.toHSVA()).concat([!0])),e._emit("swatchselect",i)})),!0}return!1}},{key:"removeSwatch",value:function(t){if("number"==typeof t){var e=this._swatchColors[t];if(e){var n=e.element;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 c.apply(r,P(t))}),Object.keys(this.components).forEach(function(e){return t.components[e].destroy()})}},{key:"destroyAndRemove",value:function(){this.destroy();var t=this._root.root;t.parentElement.removeChild(t);var e=this._root.app;e.parentElement.removeChild(e);var n=this;Object.keys(n).forEach(function(t){return n[t]=null})}},{key:"hide",value:function(){return this._root.app.classList.remove("visible"),this}},{key:"show",value:function(){if(!this.options.disabled)return this._root.app.classList.add("visible"),this._rePositioningPicker(),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=O(t,e,n,r);var a=this.components,c=a.hue,s=a.opacity,l=a.palette,u=c.options.wrapper.offsetHeight*(t/360);c.update(0,u);var p=s.options.wrapper.offsetHeight*r;s.update(0,p);var h=l.options.wrapper,d=h.offsetWidth*(e/100),f=h.offsetHeight*(1-n/100);return l.update(d,f),this._recalc=i,this._recalc&&this._updateOutput(),o||this.applyColor(),!0}},{key:"setColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(),!0;var n=S(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").startsWith(i)});if(c&&!c.hidden){var s=!0,l=!1,u=void 0;try{for(var p,h=a[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){var d=p.value;d.classList[d===c?"add":"remove"]("active")}}catch(t){l=!0,u=t}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}return this.setHSVA.apply(this,P(r).concat([e]))}}},{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:"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}}])&&L(e.prototype,n),o&&L(e,o),t}();R.utils=r,R.create=function(t){return new R(t)},R.version="0.6.2";e.default=R}]).default});
/*! Pickr 0.6.3 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=1)}([function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"on",function(){return a}),n.d(r,"off",function(){return c}),n.d(r,"createElementFromString",function(){return l}),n.d(r,"removeAttribute",function(){return u}),n.d(r,"createFromTemplate",function(){return p}),n.d(r,"eventPath",function(){return h}),n.d(r,"adjustableInputNumbers",function(){return d});n(0);function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),r.forEach(function(e){i(t,e,n[e])})}return t}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=s.bind(null,"addEventListener"),c=s.bind(null,"removeEventListener");function s(t,e,n,r){var i=arguments.length>4&&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,s=void 0;try{for(var l,u=e[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var p=l.value,h=!0,d=!1,f=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,o({capture:!1},i))}}catch(t){d=!0,f=t}finally{try{h||null==y.return||y.return()}finally{if(d)throw f}}}}catch(t){c=!0,s=t}finally{try{a||null==u.return||u.return()}finally{if(c)throw s}}return Array.prototype.slice.call(arguments,1)}function l(t){var e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function u(t,e){var n=t.getAttribute(e);return t.removeAttribute(e),n}function p(t){return function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=u(e,"data-con"),o=u(e,"data-key");o&&(n[o]=e);for(var i=r?n[r]={}:n,a=0,c=Array.from(e.children);a<c.length;a++){var s=c[a],l=u(s,"data-arr");l?(i[l]||(i[l]=[])).push(s):t(s,i)}return n}(l(t))}function h(t){var e=t.path||t.composedPath&&t.composedPath();if(e)return e;var n=t.target.parentElement;for(e=[t.target,n];n=n.parentElement;)e.push(n);return e.push(document,window),e}function d(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=function(t){return t>="0"&&t<="9"||"-"===t||"."===t};function r(r){for(var o=t.value,i=t.selectionStart,a=i,c="",s=i-1;s>0&&n(o[s]);s--)c=o[s]+c,a--;for(var l=i,u=o.length;l<u&&n(o[l]);l++)c+=o[l];if(c.length>0&&!isNaN(c)&&isFinite(c)){var p=r.deltaY<0?1:-1,h=[1,10,100][Number(r.shiftKey||2*r.ctrlKey)]*p,d=Number(c)+h;!e&&d<0&&(d=0);var f=o.substr(0,a)+d+o.substring(a+c.length,o.length),v=a+String(d).length;t.value=f,t.focus(),t.setSelectionRange(v,v)}r.preventDefault(),t.dispatchEvent(new Event("input"))}a(t,"focus",function(){return a(window,"wheel",r,{passive:!1})}),a(t,"blur",function(){return c(window,"wheel",r)})}function f(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 v(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var y=Math.min,m=Math.max,g=Math.floor,b=Math.round;function _(t,e,n){e/=100,n/=100;var r=g(t=t/360*6),o=t-r,i=n*(1-e),a=n*(1-o*e),c=n*(1-(1-o)*e),s=r%6;return[255*[n,a,i,i,c,n][s],255*[c,n,n,a,i,i][s],255*[i,i,c,n,n,a][s]]}function w(t,e,n){var r,o,i=y(t/=255,e/=255,n/=255),a=m(t,e,n),c=a-i;if(0===c)r=o=0;else{o=c/a;var s=((a-t)/6+c/2)/c,l=((a-e)/6+c/2)/c,u=((a-n)/6+c/2)/c;t===a?r=u-l:e===a?r=1/3+s-u:n===a&&(r=2/3+l-s),r<0?r+=1:r>1&&(r-=1)}return[360*r,100*o,100*a]}function k(t,e,n,r){return e/=100,n/=100,v(w(255*(1-y(1,(t/=100)*(1-(r/=100))+r)),255*(1-y(1,e*(1-r)+r)),255*(1-y(1,n*(1-r)+r))))}function A(t,e,n){return e/=100,[t,2*(e*=(n/=100)<.5?n:1-n)/(n+e)*100,100*(n+e)]}function C(t){return w.apply(void 0,v(t.match(/.{2}/g).map(function(t){return parseInt(t,16)})))}function S(t){var e,n;t=t.match(/^[a-zA-Z]+$/)?(e=t,(n=document.createElement("canvas").getContext("2d")).fillStyle=e,n.fillStyle):t;var r,o={cmyk:/^cmyk[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)/i,rgba:/^(rgb|rgba)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsla:/^(hsl|hsla)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsva:/^(hsv|hsva)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hex:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},i=function(t){return t.map(function(t){return/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0})};for(var a in o)if(r=o[a].exec(t))switch(a){case"cmyk":var c=f(i(r),5),s=c[1],l=c[2],u=c[3],p=c[4];if(s>100||l>100||u>100||p>100)break;return{values:[].concat(v(k(s,l,u,p)),[1]),type:a};case"rgba":var h=f(i(r),6),d=h[2],y=h[3],m=h[4],g=h[5],b=void 0===g?1:g;if(d>255||y>255||m>255||b<0||b>1)break;return{values:[].concat(v(w(d,y,m)),[b]),type:a};case"hex":var _=function(t,e){return[t.substring(0,e),t.substring(e,t.length)]},S=f(r,2)[1];3===S.length?S+="F":6===S.length&&(S+="FF");var O=void 0;if(4===S.length){var j=f(_(S,3).map(function(t){return t+t}),2);S=j[0],O=j[1]}else if(8===S.length){var x=f(_(S,6),2);S=x[0],O=x[1]}return O=parseInt(O,16)/255,{values:[].concat(v(C(S)),[O]),type:a};case"hsla":var E=f(i(r),6),B=E[2],P=E[3],L=E[4],H=E[5],R=void 0===H?1:H;if(B>360||P>100||L>100||R<0||R>1)break;return{values:[].concat(v(A(B,P,L)),[R]),type:a};case"hsva":var D=f(i(r),6),F=D[2],M=D[3],N=D[4],T=D[5],I=void 0===T?1:T;if(F>360||M>100||N>100||I<0||I>1)break;return{values:[F,M,N,I],type:a}}return{values:null,type:null}}function O(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=Math.ceil,i={h:t,s:e,v:n,a:r,toHSVA:function(){var t=[i.h,i.s,i.v],e=t.map(o);return t.push(i.a),t.toString=function(){return"hsva(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%, ").concat(i.a.toFixed(1),")")},t},toHSLA:function(){var t,e,n,r,a=(t=i.h,e=i.s,n=i.v,0!==(r=(2-(e/=100))*(n/=100)/2)&&(e=1===r?0:r<.5?e*n/(2*r):e*n/(2-2*r)),[t,100*e,100*r]),c=a.map(o);return a.push(i.a),a.toString=function(){return"hsla(".concat(c[0],", ").concat(c[1],"%, ").concat(c[2],"%, ").concat(i.a.toFixed(1),")")},a},toRGBA:function(){var t=_(i.h,i.s,i.v),e=t.map(o);return t.push(i.a),t.toString=function(){return"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(i.a.toFixed(1),")")},t},toCMYK:function(){var t,e,n,r,a,c,s,l,u=(t=i.h,e=i.s,n=i.v,a=_(t,e,n),c=a[0]/255,s=a[1]/255,l=a[2]/255,[100*(1===(r=y(1-c,1-s,1-l))?0:(1-c-r)/(1-r)),100*(1===r?0:(1-s-r)/(1-r)),100*(1===r?0:(1-l-r)/(1-r)),100*r]),p=u.map(o);return u.toString=function(){return"cmyk(".concat(p[0],"%, ").concat(p[1],"%, ").concat(p[2],"%, ").concat(p[3],"%)")},u},toHEXA:function(){var t,e,n,r=(t=i.h,e=i.s,n=i.v,_(t,e,n).map(function(t){return b(t).toString(16).padStart(2,"0")}));return r.toString=function(){var t=i.a>=1?"":Number((255*i.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return"#".concat(r.join("").toUpperCase()+t)},r},clone:function(){return O(i.h,i.s,i.v,i.a)}};return i}var j=function(t){return Math.max(Math.min(t,1),0)};function x(t){var e={options:Object.assign({lockX:!1,lockY:!1,onchange:function(){return 0}},t),_tapstart:function(t){a(document,["mouseup","touchend","touchcancel"],e._tapstop),a(document,["mousemove","touchmove"],e._tapmove),t.preventDefault(),e._tapmove(t)},_tapmove:function(t){var n=e.options,r=e.cache,o=n.element,i=n.wrapper,a=i.getBoundingClientRect(),c=0,s=0;if(t){var l=t&&t.touches&&t.touches[0];c=t?(l||t).clientX:0,s=t?(l||t).clientY:0,c<a.left?c=a.left:c>a.left+a.width&&(c=a.left+a.width),s<a.top?s=a.top:s>a.top+a.height&&(s=a.top+a.height),c-=a.left,s-=a.top}else r&&(c=r.x*a.width,s=r.y*a.height);n.lockX||(o.style.left="calc(".concat(c/a.width*100,"% - ").concat(o.offsetWidth/2,"px)")),n.lockY||(o.style.top="calc(".concat(s/a.height*100,"% - ").concat(o.offsetHeight/2,"px)")),e.cache={x:c/a.width,y:s/a.height},n.onchange(j(c/i.offsetWidth),j(s/i.offsetHeight))},_tapstop:function(){c(document,["mouseup","touchend","touchcancel"],e._tapstop),c(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();e._tapmove({clientX:r.left+t,clientY:r.top+n})},destroy:function(){var t=e.options,n=e._tapstart;c([t.wrapper,t.element],"mousedown",n),c([t.wrapper,t.element],"touchstart",n,{passive:!1})}},n=e.options,r=e._tapstart;return a([n.wrapper,n.element],"mousedown",r),a([n.wrapper,n.element],"touchstart",r,{passive:!1}),e}function E(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Object.assign({onchange:function(){return 0},className:"",elements:[]},t);var e=a(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 c.apply(r,E(e))}}}function P(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 L(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function H(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 R(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var D=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),R(this,"_initializingActive",!0),R(this,"_recalc",!0),R(this,"_color",O()),R(this,"_lastColor",O()),R(this,"_swatchColors",[]),R(this,"_eventListener",{swatchselect:[],change:[],save:[],init:[]}),this.options=e=Object.assign({appClass:null,useAsButton:!1,disabled:!1,comparison:!0,components:{interaction:{}},strings:{},swatches:null,inline:!1,default:"#42445A",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"},e);var r=e,o=r.swatches,i=r.inline,a=r.components,c=r.position;a.interaction||(a.interaction={});var s=a.preview,l=a.opacity,u=a.hue,p=a.palette;a.palette=p||s||l||u,i&&(e.showAlways=!0),this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),o&&o.length&&o.forEach(function(t){return n.addSwatch(t)}),this._nanopop=function(t){var e=t.el,n=t.reference,r=t.pos,o=t.padding,i=void 0===o?8:o,a={start:"sme",middle:"mse",end:"ems"},c={top:"tb",right:"rl",bottom:"bt",left:"lr"},s=P(r.split("-"),2),l=s[0],u=s[1],p=void 0===u?"middle":u,h="top"===l||"bottom"===l;return{update:function(){var t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),o=h?{t:t.top-r.height-i,b:t.bottom+i}:{r:t.right+i,l:t.left-r.width-i},s=h?{s:t.left+t.width-r.width,m:-r.width/2+(t.left+t.width/2),e:t.left}:{s:t.bottom-r.height,m:t.bottom-t.height/2-r.height/2,e:t.bottom-t.height};function u(t,n,o){var i="top"===o,a=i?r.height:r.width,c=window[i?"innerHeight":"innerWidth"],s=!0,l=!1,u=void 0;try{for(var p,h=t[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){var d=n[p.value];if(d>0&&d+a<c){e.style[o]="".concat(d,"px");break}}}catch(t){l=!0,u=t}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}u(a[p],s,h?"left":"top"),u(c[l],o,h?"top":"left")}}}({reference:this._root.button,el:this._root.app,pos:c});var h=this._root.button,d=this;requestAnimationFrame(function t(){if(null===h.offsetParent&&h!==document.body)return requestAnimationFrame(t);d.setColor(e.default),d._rePositioningPicker(),e.defaultRepresentation&&(d._representation=e.defaultRepresentation,d.setColorRepresentation(d._representation)),e.showAlways&&d.show(),d._initializingActive=!1,d._emit("init")})}var e,n,o;return e=t,(n=[{key:"_preBuild",value:function(){var t,e,n,r,o,i,a,c,s,l=this.options;"string"==typeof l.el&&(l.el=l.el.split(/>>/g).reduce(function(t,e,n,r){return t=t.querySelector(e),n<r.length-1?t.shadowRoot:t},document)),this._root=(e=(t=l).components,n=t.strings,r=t.useAsButton,o=t.inline,i=t.appClass,a=function(t){return t?"":'style="display:none" hidden'},c=p('\n <div data-key="root" class="pickr">\n\n '.concat(r?"":'<button type="button" data-key="button" class="pcr-button"></button>','\n\n <div data-key="app" class="pcr-app ').concat(i||"",'" ').concat(o?'style="position: unset"':"",'>\n <div class="pcr-selection" ').concat(a(e.palette),'>\n <div data-con="preview" class="pcr-color-preview" ').concat(a(e.preview),'>\n <button type="button" data-key="lastColor" class="pcr-last-color"></button>\n <div data-key="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div data-con="palette" class="pcr-color-palette">\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="palette" class="pcr-palette"></div>\n </div>\n\n <div data-con="hue" class="pcr-color-chooser" ').concat(a(e.hue),'>\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="slider" class="pcr-hue pcr-slider"></div>\n </div>\n\n <div data-con="opacity" class="pcr-color-opacity" ').concat(a(e.opacity),'>\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="slider" class="pcr-opacity pcr-slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ').concat(e.palette?"":" pcr-last",'" data-key="swatches"></div> \n\n <div data-con="interaction" class="pcr-interaction" ').concat(a(Object.keys(e.interaction).length),'>\n <input data-key="result" class="pcr-result" type="text" spellcheck="false" ').concat(a(e.interaction.input),'>\n\n <input data-arr="options" class="pcr-type" data-type="HEXA" value="HEXA" type="button" ').concat(a(e.interaction.hex),'>\n <input data-arr="options" class="pcr-type" data-type="RGBA" value="RGBA" type="button" ').concat(a(e.interaction.rgba),'>\n <input data-arr="options" class="pcr-type" data-type="HSLA" value="HSLA" type="button" ').concat(a(e.interaction.hsla),'>\n <input data-arr="options" class="pcr-type" data-type="HSVA" value="HSVA" type="button" ').concat(a(e.interaction.hsva),'>\n <input data-arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ').concat(a(e.interaction.cmyk),'>\n\n <input data-key="save" class="pcr-save" value="').concat(n.save||"Save",'" type="button" ').concat(a(e.interaction.save),'>\n <input data-key="clear" class="pcr-clear" value="').concat(n.clear||"Clear",'" type="button" ').concat(a(e.interaction.clear),">\n </div>\n </div>\n </div>\n ")),(s=c.interaction).options.find(function(t){return!t.hidden&&!t.classList.add("active")}),s.type=function(){return s.options.find(function(t){return t.classList.contains("active")})},c),l.useAsButton&&(this._root.button=l.el),document.body.appendChild(this._root.root)}},{key:"_finalBuild",value:function(){var t=this.options,e=this._root;if(document.body.removeChild(e.root),t.inline){var n=t.el.parentElement;n.lastChild===t.el?n.appendChild(e.app):n.insertBefore(e.app,t.el.nextSibling)}else document.body.appendChild(e.app);t.useAsButton||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.options.components,n={palette:x({element:t._root.palette.picker,wrapper:t._root.palette.palette,onchange:function(n,r){if(e.palette){var o=t._color,i=t._root,a=t.options;o.s=100*n,o.v=100-100*r,o.v<0&&(o.v=0);var c=o.toRGBA().toString();this.element.style.background=c,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||(i.button.style.color=c,a.useAsButton||(i.preview.lastColor.style.color=c)),i.preview.currentColor.style.color=c,t._recalc&&t._updateOutput(),t.options.comparison||i.button.classList.remove("clear")}}}),hue:x({lockX:!0,element:t._root.hue.picker,wrapper:t._root.hue.slider,onchange:function(r,o){e.hue&&e.palette&&(t._color.h=360*o,this.element.style.backgroundColor="hsl(".concat(t._color.h,", 100%, 50%)"),n.palette.trigger())}}),opacity:x({lockX:!0,element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onchange:function(n,r){e.opacity&&e.palette&&(t._color.a=Math.round(100*r)/100,this.element.style.background="rgba(0, 0, 0, ".concat(t._color.a,")"),t.components.palette.trigger())}}),selectable:B({elements:t._root.interaction.options,className:"active",onchange:function(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._updateOutput()}})};this.components=n}},{key:"_bindEvents",value:function(){var t=this,e=this._root,n=this.options,r=[a(e.interaction.clear,"click",function(){return t._clearColor()}),a(e.preview.lastColor,"click",function(){return t.setHSVA.apply(t,L(t._lastColor.toHSVA()))}),a(e.interaction.save,"click",function(){!t.applyColor()&&!n.showAlways&&t.hide()}),a(e.interaction.result,["keyup","input"],function(e){t._recalc=!1,t.setColor(e.target.value,!0)&&!t._initializingActive&&t._emit("change",t._color),e.stopImmediatePropagation()}),a([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(a(e.button,"click",function(){return t.isOpen()?t.hide():t.show()}),a(document,"keyup",function(e){return t.isOpen()&&(e.key===o||e.code===o)&&t.hide()}),a(document,["touchstart","mousedown"],function(n){t.isOpen()&&!h(n).some(function(t){return t===e.app||t===e.button})&&t.hide()},{capture:!0}))}if(n.adjustableNumbers&&d(e.interaction.result,!1),!n.inline){var i=null,c=this;r.push(a(window,["scroll","resize"],function(){c.isOpen()&&(null===i?(i=setTimeout(function(){return i=null},100),requestAnimationFrame(function t(){c._rePositioningPicker(),null!==i&&requestAnimationFrame(t)})):(clearTimeout(i),i=setTimeout(function(){return i=null},100)))}))}this._eventBindings=r}},{key:"_rePositioningPicker",value:function(){this.options.inline||this._nanopop.update()}},{key:"_updateOutput",value:function(){if(this._root.interaction.type()){var t="to".concat(this._root.interaction.type().getAttribute("data-type"));this._root.interaction.result.value="function"==typeof this._color[t]?this._color[t]().toString():""}this._initializingActive||this._emit("change",this._color)}},{key:"_clearColor",value:function(){var t=this._root,e=this.options;e.useAsButton||(t.button.style.color="rgba(0, 0, 0, 0.15)"),t.button.classList.add("clear"),e.showAlways||this.hide(),this._initializingActive||this._emit("save",null)}},{key:"_emit",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this._eventListener[t].forEach(function(t){return t.apply(void 0,r.concat([e]))})}},{key:"on",value:function(t,e){return"function"==typeof e&&"string"==typeof t&&t in this._eventListener&&this._eventListener[t].push(e),this}},{key:"off",value:function(t,e){var n=this._eventListener[t];if(n){var r=n.indexOf(e);~r&&n.splice(r,1)}return this}},{key:"addSwatch",value:function(t){var e=this,n=S(t).values;if(n){var r=this._swatchColors,o=this._root,i=O.apply(void 0,L(n)),c=l('<button type="button" style="color: '.concat(i.toRGBA(),'"></button>'));return o.swatches.appendChild(c),r.push({element:c,hsvaColorObject:i}),this._eventBindings.push(a(c,"click",function(){e.setHSVA.apply(e,L(i.toHSVA()).concat([!0])),e._emit("swatchselect",i)})),!0}return!1}},{key:"removeSwatch",value:function(t){if("number"==typeof t){var e=this._swatchColors[t];if(e){var n=e.element;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 c.apply(r,L(t))}),Object.keys(this.components).forEach(function(e){return t.components[e].destroy()})}},{key:"destroyAndRemove",value:function(){this.destroy();var t=this._root.root;t.parentElement.removeChild(t);var e=this._root.app;e.parentElement.removeChild(e);var n=this;Object.keys(n).forEach(function(t){return n[t]=null})}},{key:"hide",value:function(){return this._root.app.classList.remove("visible"),this}},{key:"show",value:function(){if(!this.options.disabled)return this._root.app.classList.add("visible"),this._rePositioningPicker(),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=O(t,e,n,r);var a=this.components,c=a.hue,s=a.opacity,l=a.palette,u=c.options.wrapper.offsetHeight*(t/360);c.update(0,u);var p=s.options.wrapper.offsetHeight*r;s.update(0,p);var h=l.options.wrapper,d=h.offsetWidth*(e/100),f=h.offsetHeight*(1-n/100);return l.update(d,f),this._recalc=i,this._recalc&&this._updateOutput(),o||this.applyColor(),!0}},{key:"setColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(),!0;var n=S(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").startsWith(i)});if(c&&!c.hidden){var s=!0,l=!1,u=void 0;try{for(var p,h=a[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){var d=p.value;d.classList[d===c?"add":"remove"]("active")}}catch(t){l=!0,u=t}finally{try{s||null==h.return||h.return()}finally{if(l)throw u}}}return this.setHSVA.apply(this,L(r).concat([e]))}}},{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:"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}}])&&H(e.prototype,n),o&&H(e,o),t}();D.utils=r,D.create=function(t){return new D(t)},D.version="0.6.3";e.default=D}]).default});
//# sourceMappingURL=pickr.es5.min.js.map

@@ -1,3 +0,3 @@

/*! Pickr 0.6.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(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){},function(t,e,n){"use strict";n.r(e);var o={};n.r(o),n.d(o,"on",function(){return s}),n.d(o,"off",function(){return a}),n.d(o,"createElementFromString",function(){return l}),n.d(o,"removeAttribute",function(){return p}),n.d(o,"createFromTemplate",function(){return u}),n.d(o,"eventPath",function(){return h}),n.d(o,"adjustableInputNumbers",function(){return d});n(0);function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){r(t,e,n[e])})}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const s=c.bind(null,"addEventListener"),a=c.bind(null,"removeEventListener");function c(t,e,n,o){let r=arguments.length>4&&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]);for(const s of e)for(const e of n)s[t](e,o,i({capture:!1},r));return Array.prototype.slice.call(arguments,1)}function l(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function p(t,e){const n=t.getAttribute(e);return t.removeAttribute(e),n}function u(t){return function t(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=p(e,"data-con"),i=p(e,"data-key");i&&(n[i]=e);const r=o?n[o]={}:n;for(let n of Array.from(e.children)){const e=p(n,"data-arr");e?(r[e]||(r[e]=[])).push(n):t(n,r)}return n}(l(t))}function h(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let n=t.target.parentElement;for(e=[t.target,n];n=n.parentElement;)e.push(n);return e.push(document,window),e}function d(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t=>t>="0"&&t<="9"||"-"===t||"."===t;function o(o){const i=t.value,r=t.selectionStart;let s=r,a="";for(let t=r-1;t>0&&n(i[t]);t--)a=i[t]+a,s--;for(let t=r,e=i.length;t<e&&n(i[t]);t++)a+=i[t];if(a.length>0&&!isNaN(a)&&isFinite(a)){const n=o.deltaY<0?1:-1,r=[1,10,100][Number(o.shiftKey||2*o.ctrlKey)]*n;let c=Number(a)+r;!e&&c<0&&(c=0);const l=i.substr(0,s)+c+i.substring(s+a.length,i.length),p=s+String(c).length;t.value=l,t.focus(),t.setSelectionRange(p,p)}o.preventDefault(),t.dispatchEvent(new Event("input"))}s(t,"focus",()=>s(window,"wheel",o,{passive:!1})),s(t,"blur",()=>a(window,"wheel",o))}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],o=!0,i=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(o=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);o=!0);}catch(t){i=!0,r=t}finally{try{o||null==a.return||a.return()}finally{if(i)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const v=Math.min,m=Math.max,y=Math.floor,g=Math.round;function b(t,e,n){e/=100,n/=100;let o=y(t=t/360*6),i=t-o,r=n*(1-e),s=n*(1-i*e),a=n*(1-(1-i)*e),c=o%6;return[255*[n,s,r,r,a,n][c],255*[a,n,n,s,r,r][c],255*[r,r,a,n,n,s][c]]}function _(t,e,n){let o,i,r;const s=v(t/=255,e/=255,n/=255),a=m(t,e,n),c=a-s;if(0===c)o=i=0;else{i=c/a;let r=((a-t)/6+c/2)/c,s=((a-e)/6+c/2)/c,l=((a-n)/6+c/2)/c;t===a?o=l-s:e===a?o=1/3+r-l:n===a&&(o=2/3+s-r),o<0?o+=1:o>1&&(o-=1)}return[360*o,100*i,100*(r=a)]}function w(t,e,n,o){return e/=100,n/=100,[..._(255*(1-v(1,(t/=100)*(1-(o/=100))+o)),255*(1-v(1,e*(1-o)+o)),255*(1-v(1,n*(1-o)+o)))]}function k(t,e,n){return e/=100,[t,2*(e*=(n/=100)<.5?n:1-n)/(n+e)*100,100*(n+e)]}function A(t){return _(...t.match(/.{2}/g).map(t=>parseInt(t,16)))}function C(t){t=t.match(/^[a-zA-Z]+$/)?function(t){const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,e.fillStyle}(t):t;const e={cmyk:/^cmyk[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)/i,rgba:/^(rgb|rgba)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsla:/^(hsl|hsla)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsva:/^(hsv|hsva)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hex:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},n=t=>t.map(t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0);let o;for(const s in e)if(o=e[s].exec(t))switch(s){case"cmyk":{let t=f(n(o),5),e=t[1],i=t[2],r=t[3],a=t[4];if(e>100||i>100||r>100||a>100)break;return{values:[...w(e,i,r,a),1],type:s}}case"rgba":{let t=f(n(o),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>255||i>255||r>255||c<0||c>1)break;return{values:[..._(e,i,r),c],type:s}}case"hex":{const t=(t,e)=>[t.substring(0,e),t.substring(e,t.length)];let e,n=f(o,2)[1];if(3===n.length?n+="F":6===n.length&&(n+="FF"),4===n.length){var i=f(t(n,3).map(t=>t+t),2);n=i[0],e=i[1]}else if(8===n.length){var r=f(t(n,6),2);n=r[0],e=r[1]}return e=parseInt(e,16)/255,{values:[...A(n),e],type:s}}case"hsla":{let t=f(n(o),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>360||i>100||r>100||c<0||c>1)break;return{values:[...k(e,i,r),c],type:s}}case"hsva":{let t=f(n(o),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>360||i>100||r>100||c<0||c>1)break;return{values:[e,i,r,c],type:s}}}return{values:null,type:null}}function S(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=Math.ceil,r={h:t,s:e,v:n,a:o,toHSVA(){const t=[r.h,r.s,r.v],e=t.map(i);return t.push(r.a),t.toString=(()=>"hsva(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%, ").concat(r.a.toFixed(1),")")),t},toHSLA(){const t=function(t,e,n){let o=(2-(e/=100))*(n/=100)/2;return 0!==o&&(e=1===o?0:o<.5?e*n/(2*o):e*n/(2-2*o)),[t,100*e,100*o]}(r.h,r.s,r.v),e=t.map(i);return t.push(r.a),t.toString=(()=>"hsla(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%, ").concat(r.a.toFixed(1),")")),t},toRGBA(){const t=b(r.h,r.s,r.v),e=t.map(i);return t.push(r.a),t.toString=(()=>"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(r.a.toFixed(1),")")),t},toCMYK(){const t=function(t,e,n){const o=b(t,e,n),i=o[0]/255,r=o[1]/255,s=o[2]/255;let a,c,l,p;return[100*(c=1===(a=v(1-i,1-r,1-s))?0:(1-i-a)/(1-a)),100*(l=1===a?0:(1-r-a)/(1-a)),100*(p=1===a?0:(1-s-a)/(1-a)),100*a]}(r.h,r.s,r.v),e=t.map(i);return t.toString=(()=>"cmyk(".concat(e[0],"%, ").concat(e[1],"%, ").concat(e[2],"%, ").concat(e[3],"%)")),t},toHEXA(){const t=(e=r.h,n=r.s,o=r.v,b(e,n,o).map(t=>g(t).toString(16).padStart(2,"0")));var e,n,o;return t.toString=(()=>{const e=r.a>=1?"":Number((255*r.a).toFixed(0).toString(16).toUpperCase(),2,"0");return"#".concat(t.join("").toUpperCase()+e)}),t},clone:()=>S(r.h,r.s,r.v,r.a)};return r}function O(t){const e={options:Object.assign({lockX:!1,lockY:!1,onchange:()=>0},t),_tapstart(t){s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove),t.preventDefault(),e._tapmove(t)},_tapmove(t){const n=e.options,o=e.cache,i=n.element,r=e.options.wrapper.getBoundingClientRect();let s=0,a=0;if(t){const e=t&&t.touches&&t.touches[0];s=t?(e||t).clientX:0,a=t?(e||t).clientY:0,s<r.left?s=r.left:s>r.left+r.width&&(s=r.left+r.width),a<r.top?a=r.top:a>r.top+r.height&&(a=r.top+r.height),s-=r.left,a-=r.top}else o&&(s=o.x*r.width,a=o.y*r.height);n.lockX||(i.style.left="calc(".concat(s/r.width*100,"% - ").concat(i.offsetWidth/2,"px)")),n.lockY||(i.style.top="calc(".concat(a/r.height*100,"% - ").concat(i.offsetWidth/2,"px)")),e.cache={x:s/r.width,y:a/r.height},n.onchange(s,a)},_tapstop(){a(document,["mouseup","touchend","touchcancel"],e._tapstop),a(document,["mousemove","touchmove"],e._tapmove)},trigger(){e._tapmove()},update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const o=e.options.wrapper.getBoundingClientRect();e._tapmove({clientX:o.left+t,clientY:o.top+n})},destroy(){const t=e.options,n=e._tapstart;a([t.wrapper,t.element],"mousedown",n),a([t.wrapper,t.element],"touchstart",n,{passive:!1})}},n=e.options,o=e._tapstart;return s([n.wrapper,n.element],"mousedown",o),s([n.wrapper,n.element],"touchstart",o,{passive:!1}),e}function x(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=s(t.elements,"click",e=>{t.elements.forEach(n=>n.classList[e.target===n?"add":"remove"](t.className)),t.onchange(e)});return{destroy:()=>a(...e)}}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],o=!0,i=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(o=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);o=!0);}catch(t){i=!0,r=t}finally{try{o||null==a.return||a.return()}finally{if(i)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var j=t=>{let e=t.components,n=t.strings,o=t.useAsButton,i=t.inline,r=t.appClass;const s=t=>t?"":'style="display:none" hidden',a=u('\n <div data-key="root" class="pickr">\n\n '.concat(o?"":'<button type="button" data-key="button" class="pcr-button"></button>','\n\n <div data-key="app" class="pcr-app ').concat(r||"",'" ').concat(i?'style="position: unset"':"",'>\n <div class="pcr-selection" ').concat(s(e.palette),'>\n <div data-con="preview" class="pcr-color-preview" ').concat(s(e.preview),'>\n <button type="button" data-key="lastColor" class="pcr-last-color"></button>\n <div data-key="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div data-con="palette" class="pcr-color-palette">\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="palette" class="pcr-palette"></div>\n </div>\n\n <div data-con="hue" class="pcr-color-chooser" ').concat(s(e.hue),'>\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="slider" class="pcr-hue pcr-slider"></div>\n </div>\n\n <div data-con="opacity" class="pcr-color-opacity" ').concat(s(e.opacity),'>\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="slider" class="pcr-opacity pcr-slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ').concat(e.palette?"":" pcr-last",'" data-key="swatches"></div> \n\n <div data-con="interaction" class="pcr-interaction" ').concat(s(Object.keys(e.interaction).length),'>\n <input data-key="result" class="pcr-result" type="text" spellcheck="false" ').concat(s(e.interaction.input),'>\n\n <input data-arr="options" class="pcr-type" data-type="HEXA" value="HEXA" type="button" ').concat(s(e.interaction.hex),'>\n <input data-arr="options" class="pcr-type" data-type="RGBA" value="RGBA" type="button" ').concat(s(e.interaction.rgba),'>\n <input data-arr="options" class="pcr-type" data-type="HSLA" value="HSLA" type="button" ').concat(s(e.interaction.hsla),'>\n <input data-arr="options" class="pcr-type" data-type="HSVA" value="HSVA" type="button" ').concat(s(e.interaction.hsva),'>\n <input data-arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ').concat(s(e.interaction.cmyk),'>\n\n <input data-key="save" class="pcr-save" value="').concat(n.save||"Save",'" type="button" ').concat(s(e.interaction.save),'>\n <input data-key="clear" class="pcr-clear" value="').concat(n.clear||"Clear",'" type="button" ').concat(s(e.interaction.clear),">\n </div>\n </div>\n </div>\n ")),c=a.interaction;return c.options.find(t=>!t.hidden&&!t.classList.add("active")),c.type=(()=>c.options.find(t=>t.classList.contains("active"))),a};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}class L{constructor(t){B(this,"_initializingActive",!0),B(this,"_recalc",!0),B(this,"_color",S()),B(this,"_lastColor",S()),B(this,"_swatchColors",[]),B(this,"_eventListener",{swatchselect:[],change:[],save:[],init:[]}),this.options=t=Object.assign({appClass:null,useAsButton:!1,disabled:!1,comparison:!0,components:{interaction:{}},strings:{},swatches:null,inline:!1,default:"#42445A",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"},t);const e=t,n=e.swatches,o=e.inline,i=e.components,r=e.position;i.interaction||(i.interaction={});const s=i.preview,a=i.opacity,c=i.hue,l=i.palette;i.palette=l||s||a||c,o&&(t.showAlways=!0),this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),n&&n.length&&n.forEach(t=>this.addSwatch(t)),this._nanopop=function(t){let e=t.el,n=t.reference,o=t.pos,i=t.padding,r=void 0===i?8:i;const s={start:"sme",middle:"mse",end:"ems"},a={top:"tb",right:"rl",bottom:"bt",left:"lr"},c=E(o.split("-"),2),l=c[0],p=c[1],u=void 0===p?"middle":p,h="top"===l||"bottom"===l;return{update(){const t=n.getBoundingClientRect(),o=e.getBoundingClientRect(),i=h?{t:t.top-o.height-r,b:t.bottom+r}:{r:t.right+r,l:t.left-o.width-r},c=h?{s:t.left+t.width-o.width,m:-o.width/2+(t.left+t.width/2),e:t.left}:{s:t.bottom-o.height,m:t.bottom-t.height/2-o.height/2,e:t.bottom-t.height};function p(t,n,i){const r="top"===i,s=r?o.height:o.width,a=window[r?"innerHeight":"innerWidth"];for(const o of t){const t=n[o];if(t>0&&t+s<a){e.style[i]="".concat(t,"px");break}}}p(s[u],c,h?"left":"top"),p(a[l],i,h?"top":"left")}}}({reference:this._root.button,el:this._root.app,pos:r});const p=this._root.button,u=this;requestAnimationFrame(function e(){if(null===p.offsetParent&&p!==document.body)return requestAnimationFrame(e);u.setColor(t.default),u._rePositioningPicker(),t.defaultRepresentation&&(u._representation=t.defaultRepresentation,u.setColorRepresentation(u._representation)),t.showAlways&&u.show(),u._initializingActive=!1,u._emit("init")})}_preBuild(){const t=this.options;"string"==typeof t.el&&(t.el=t.el.split(/>>/g).reduce((t,e,n,o)=>(t=t.querySelector(e),n<o.length-1?t.shadowRoot:t),document)),this._root=j(t),t.useAsButton&&(this._root.button=t.el),document.body.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(document.body.removeChild(e.root),t.inline){const n=t.el.parentElement;n.lastChild===t.el?n.appendChild(e.app):n.insertBefore(e.app,t.el.nextSibling)}else document.body.appendChild(e.app);t.useAsButton||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()}_buildComponents(){const t=this,e=this.options.components,n={palette:O({element:t._root.palette.picker,wrapper:t._root.palette.palette,onchange(n,o){if(!e.palette)return;const i=t._color,r=t._root,s=t.options;i.s=n/this.wrapper.offsetWidth*100,i.v=100-o/this.wrapper.offsetHeight*100,i.v<0&&(i.v=0);const a=i.toRGBA().toString();this.element.style.background=a,this.wrapper.style.background="\n linear-gradient(to top, rgba(0, 0, 0, ".concat(i.a,"), transparent),\n linear-gradient(to left, hsla(").concat(i.h,", 100%, 50%, ").concat(i.a,"), rgba(255, 255, 255, ").concat(i.a,"))\n "),s.comparison||(r.button.style.color=a,s.useAsButton||(r.preview.lastColor.style.color=a)),r.preview.currentColor.style.color=a,t._recalc&&t._updateOutput(),r.button.classList.remove("clear")}}),hue:O({lockX:!0,element:t._root.hue.picker,wrapper:t._root.hue.slider,onchange(o,i){e.hue&&e.palette&&(t._color.h=i/this.wrapper.offsetHeight*360,this.element.style.backgroundColor="hsl(".concat(t._color.h,", 100%, 50%)"),n.palette.trigger())}}),opacity:O({lockX:!0,element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onchange(n,o){e.opacity&&e.palette&&(t._color.a=Math.round(o/this.wrapper.offsetHeight*100)/100,this.element.style.background="rgba(0, 0, 0, ".concat(t._color.a,")"),t.components.palette.trigger())}}),selectable:x({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._updateOutput()}})};this.components=n}_bindEvents(){const t=this._root,e=this.options,n=[s(t.interaction.clear,"click",()=>this._clearColor()),s(t.preview.lastColor,"click",()=>this.setHSVA(...this._lastColor.toHSVA())),s(t.interaction.save,"click",()=>{!this.applyColor()&&!e.showAlways&&this.hide()}),s(t.interaction.result,["keyup","input"],t=>{this._recalc=!1,this.setColor(t.target.value,!0)&&!this._initializingActive&&this._emit("change",this._color),t.stopImmediatePropagation()}),s([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],()=>this._recalc=!0)];if(!e.showAlways){const o=e.closeWithKey;n.push(s(t.button,"click",()=>this.isOpen()?this.hide():this.show()),s(document,"keyup",t=>this.isOpen()&&(t.key===o||t.code===o)&&this.hide()),s(document,["touchstart","mousedown"],e=>{this.isOpen()&&!h(e).some(e=>e===t.app||e===t.button)&&this.hide()},{capture:!0}))}if(e.adjustableNumbers&&d(t.interaction.result,!1),!e.inline){let t=null;const e=this;n.push(s(window,["scroll","resize"],()=>{e.isOpen()&&(null===t?(t=setTimeout(()=>t=null,100),requestAnimationFrame(function n(){e._rePositioningPicker(),null!==t&&requestAnimationFrame(n)})):(clearTimeout(t),t=setTimeout(()=>t=null,100)))}))}this._eventBindings=n}_rePositioningPicker(){this.options.inline||this._nanopop.update()}_updateOutput(){if(this._root.interaction.type()){const t="to".concat(this._root.interaction.type().getAttribute("data-type"));this._root.interaction.result.value="function"==typeof this._color[t]?this._color[t]().toString():""}this._initializingActive||this._emit("change",this._color)}_clearColor(){const t=this._root,e=this.options;e.useAsButton||(t.button.style.color="rgba(0, 0, 0, 0.15)"),t.button.classList.add("clear"),e.showAlways||this.hide(),this._initializingActive||this._emit("save",null)}_emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];this._eventListener[t].forEach(t=>t(...n,this))}on(t,e){return"function"==typeof e&&"string"==typeof t&&t in this._eventListener&&this._eventListener[t].push(e),this}off(t,e){const n=this._eventListener[t];if(n){const t=n.indexOf(e);~t&&n.splice(t,1)}return this}addSwatch(t){const e=C(t).values;if(e){const t=this._swatchColors,n=this._root,o=S(...e),i=l('<button type="button" style="color: '.concat(o.toRGBA(),'"></button>'));return n.swatches.appendChild(i),t.push({element:i,hsvaColorObject:o}),this._eventBindings.push(s(i,"click",()=>{this.setHSVA(...o.toHSVA(),!0),this._emit("swatchselect",o)})),!0}return!1}removeSwatch(t){if("number"==typeof t){const e=this._swatchColors[t];if(e){const n=e.element;return this._root.swatches.removeChild(n),this._swatchColors.splice(t,1),!0}}return!1}applyColor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=this._root,n=e.preview,o=e.button,i=this._color.toRGBA().toString();n.lastColor.style.color=i,this.options.useAsButton||(o.style.color=i),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color)}destroy(){this._eventBindings.forEach(t=>a(...t)),Object.keys(this.components).forEach(t=>this.components[t].destroy())}destroyAndRemove(){this.destroy();const t=this._root.root;t.parentElement.removeChild(t);const e=this._root.app;e.parentElement.removeChild(e);const n=this;Object.keys(n).forEach(t=>n[t]=null)}hide(){return this._root.app.classList.remove("visible"),this}show(){if(!this.options.disabled)return this._root.app.classList.add("visible"),this._rePositioningPicker(),this}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(){let 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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||n<0||n>100||o<0||o>1)return!1;this._color=S(t,e,n,o);const s=this.components,a=s.hue,c=s.opacity,l=s.palette,p=a.options.wrapper.offsetHeight*(t/360);a.update(0,p);const u=c.options.wrapper.offsetHeight*o;c.update(0,u);const h=l.options.wrapper,d=h.offsetWidth*(e/100),f=h.offsetHeight*(1-n/100);return l.update(d,f),this._recalc=r,this._recalc&&this._updateOutput(),i||this.applyColor(),!0}setColor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(),!0;const n=C(t),o=n.values,i=n.type;if(o){const t=i.toUpperCase(),n=this._root.interaction.options,r=n.find(e=>e.getAttribute("data-type").startsWith(t));if(r&&!r.hidden)for(const t of n)t.classList[t===r?"add":"remove"]("active");return this.setHSVA(...o,e)}}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find(e=>e.getAttribute("data-type").startsWith(t)&&!e.click())}getColorRepresentation(){return this._representation}getColor(){return this._color}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}L.utils=o,L.create=(t=>new L(t)),L.version="0.6.2";e.default=L}]).default});
/*! Pickr 0.6.3 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(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},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 o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){},function(t,e,n){"use strict";n.r(e);var o={};n.r(o),n.d(o,"on",function(){return s}),n.d(o,"off",function(){return a}),n.d(o,"createElementFromString",function(){return l}),n.d(o,"removeAttribute",function(){return u}),n.d(o,"createFromTemplate",function(){return p}),n.d(o,"eventPath",function(){return h}),n.d(o,"adjustableInputNumbers",function(){return d});n(0);function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){r(t,e,n[e])})}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const s=c.bind(null,"addEventListener"),a=c.bind(null,"removeEventListener");function c(t,e,n,o){let r=arguments.length>4&&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]);for(const s of e)for(const e of n)s[t](e,o,i({capture:!1},r));return Array.prototype.slice.call(arguments,1)}function l(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function u(t,e){const n=t.getAttribute(e);return t.removeAttribute(e),n}function p(t){return function t(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=u(e,"data-con"),i=u(e,"data-key");i&&(n[i]=e);const r=o?n[o]={}:n;for(let n of Array.from(e.children)){const e=u(n,"data-arr");e?(r[e]||(r[e]=[])).push(n):t(n,r)}return n}(l(t))}function h(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let n=t.target.parentElement;for(e=[t.target,n];n=n.parentElement;)e.push(n);return e.push(document,window),e}function d(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t=>t>="0"&&t<="9"||"-"===t||"."===t;function o(o){const i=t.value,r=t.selectionStart;let s=r,a="";for(let t=r-1;t>0&&n(i[t]);t--)a=i[t]+a,s--;for(let t=r,e=i.length;t<e&&n(i[t]);t++)a+=i[t];if(a.length>0&&!isNaN(a)&&isFinite(a)){const n=o.deltaY<0?1:-1,r=[1,10,100][Number(o.shiftKey||2*o.ctrlKey)]*n;let c=Number(a)+r;!e&&c<0&&(c=0);const l=i.substr(0,s)+c+i.substring(s+a.length,i.length),u=s+String(c).length;t.value=l,t.focus(),t.setSelectionRange(u,u)}o.preventDefault(),t.dispatchEvent(new Event("input"))}s(t,"focus",()=>s(window,"wheel",o,{passive:!1})),s(t,"blur",()=>a(window,"wheel",o))}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],o=!0,i=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(o=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);o=!0);}catch(t){i=!0,r=t}finally{try{o||null==a.return||a.return()}finally{if(i)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}const v=Math.min,m=Math.max,y=Math.floor,g=Math.round;function b(t,e,n){e/=100,n/=100;let o=y(t=t/360*6),i=t-o,r=n*(1-e),s=n*(1-i*e),a=n*(1-(1-i)*e),c=o%6;return[255*[n,s,r,r,a,n][c],255*[a,n,n,s,r,r][c],255*[r,r,a,n,n,s][c]]}function _(t,e,n){let o,i,r;const s=v(t/=255,e/=255,n/=255),a=m(t,e,n),c=a-s;if(0===c)o=i=0;else{i=c/a;let r=((a-t)/6+c/2)/c,s=((a-e)/6+c/2)/c,l=((a-n)/6+c/2)/c;t===a?o=l-s:e===a?o=1/3+r-l:n===a&&(o=2/3+s-r),o<0?o+=1:o>1&&(o-=1)}return[360*o,100*i,100*(r=a)]}function w(t,e,n,o){return e/=100,n/=100,[..._(255*(1-v(1,(t/=100)*(1-(o/=100))+o)),255*(1-v(1,e*(1-o)+o)),255*(1-v(1,n*(1-o)+o)))]}function k(t,e,n){return e/=100,[t,2*(e*=(n/=100)<.5?n:1-n)/(n+e)*100,100*(n+e)]}function A(t){return _(...t.match(/.{2}/g).map(t=>parseInt(t,16)))}function C(t){t=t.match(/^[a-zA-Z]+$/)?function(t){const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,e.fillStyle}(t):t;const e={cmyk:/^cmyk[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)/i,rgba:/^(rgb|rgba)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsla:/^(hsl|hsla)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hsva:/^(hsv|hsva)[\D]+(\d+)[\D]+(\d+)[\D]+(\d+)[\D]*?([\d.]+|$)/i,hex:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},n=t=>t.map(t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0);let o;for(const s in e)if(o=e[s].exec(t))switch(s){case"cmyk":{let t=f(n(o),5),e=t[1],i=t[2],r=t[3],a=t[4];if(e>100||i>100||r>100||a>100)break;return{values:[...w(e,i,r,a),1],type:s}}case"rgba":{let t=f(n(o),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>255||i>255||r>255||c<0||c>1)break;return{values:[..._(e,i,r),c],type:s}}case"hex":{const t=(t,e)=>[t.substring(0,e),t.substring(e,t.length)];let e,n=f(o,2)[1];if(3===n.length?n+="F":6===n.length&&(n+="FF"),4===n.length){var i=f(t(n,3).map(t=>t+t),2);n=i[0],e=i[1]}else if(8===n.length){var r=f(t(n,6),2);n=r[0],e=r[1]}return e=parseInt(e,16)/255,{values:[...A(n),e],type:s}}case"hsla":{let t=f(n(o),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>360||i>100||r>100||c<0||c>1)break;return{values:[...k(e,i,r),c],type:s}}case"hsva":{let t=f(n(o),6),e=t[2],i=t[3],r=t[4],a=t[5],c=void 0===a?1:a;if(e>360||i>100||r>100||c<0||c>1)break;return{values:[e,i,r,c],type:s}}}return{values:null,type:null}}function S(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=Math.ceil,r={h:t,s:e,v:n,a:o,toHSVA(){const t=[r.h,r.s,r.v],e=t.map(i);return t.push(r.a),t.toString=(()=>"hsva(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%, ").concat(r.a.toFixed(1),")")),t},toHSLA(){const t=function(t,e,n){let o=(2-(e/=100))*(n/=100)/2;return 0!==o&&(e=1===o?0:o<.5?e*n/(2*o):e*n/(2-2*o)),[t,100*e,100*o]}(r.h,r.s,r.v),e=t.map(i);return t.push(r.a),t.toString=(()=>"hsla(".concat(e[0],", ").concat(e[1],"%, ").concat(e[2],"%, ").concat(r.a.toFixed(1),")")),t},toRGBA(){const t=b(r.h,r.s,r.v),e=t.map(i);return t.push(r.a),t.toString=(()=>"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(r.a.toFixed(1),")")),t},toCMYK(){const t=function(t,e,n){const o=b(t,e,n),i=o[0]/255,r=o[1]/255,s=o[2]/255;let a,c,l,u;return[100*(c=1===(a=v(1-i,1-r,1-s))?0:(1-i-a)/(1-a)),100*(l=1===a?0:(1-r-a)/(1-a)),100*(u=1===a?0:(1-s-a)/(1-a)),100*a]}(r.h,r.s,r.v),e=t.map(i);return t.toString=(()=>"cmyk(".concat(e[0],"%, ").concat(e[1],"%, ").concat(e[2],"%, ").concat(e[3],"%)")),t},toHEXA(){const t=(e=r.h,n=r.s,o=r.v,b(e,n,o).map(t=>g(t).toString(16).padStart(2,"0")));var e,n,o;return t.toString=(()=>{const e=r.a>=1?"":Number((255*r.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return"#".concat(t.join("").toUpperCase()+e)}),t},clone:()=>S(r.h,r.s,r.v,r.a)};return r}const O=t=>Math.max(Math.min(t,1),0);function x(t){const e={options:Object.assign({lockX:!1,lockY:!1,onchange:()=>0},t),_tapstart(t){s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove),t.preventDefault(),e._tapmove(t)},_tapmove(t){const n=e.options,o=e.cache,i=n.element,r=n.wrapper,s=r.getBoundingClientRect();let a=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];a=t?(e||t).clientX:0,c=t?(e||t).clientY:0,a<s.left?a=s.left:a>s.left+s.width&&(a=s.left+s.width),c<s.top?c=s.top:c>s.top+s.height&&(c=s.top+s.height),a-=s.left,c-=s.top}else o&&(a=o.x*s.width,c=o.y*s.height);n.lockX||(i.style.left="calc(".concat(a/s.width*100,"% - ").concat(i.offsetWidth/2,"px)")),n.lockY||(i.style.top="calc(".concat(c/s.height*100,"% - ").concat(i.offsetHeight/2,"px)")),e.cache={x:a/s.width,y:c/s.height},n.onchange(O(a/r.offsetWidth),O(c/r.offsetHeight))},_tapstop(){a(document,["mouseup","touchend","touchcancel"],e._tapstop),a(document,["mousemove","touchmove"],e._tapmove)},trigger(){e._tapmove()},update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const o=e.options.wrapper.getBoundingClientRect();e._tapmove({clientX:o.left+t,clientY:o.top+n})},destroy(){const t=e.options,n=e._tapstart;a([t.wrapper,t.element],"mousedown",n),a([t.wrapper,t.element],"touchstart",n,{passive:!1})}},n=e.options,o=e._tapstart;return s([n.wrapper,n.element],"mousedown",o),s([n.wrapper,n.element],"touchstart",o,{passive:!1}),e}function E(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=s(t.elements,"click",e=>{t.elements.forEach(n=>n.classList[e.target===n?"add":"remove"](t.className)),t.onchange(e)});return{destroy:()=>a(...e)}}function j(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],o=!0,i=!1,r=void 0;try{for(var s,a=t[Symbol.iterator]();!(o=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);o=!0);}catch(t){i=!0,r=t}finally{try{o||null==a.return||a.return()}finally{if(i)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var B=t=>{let e=t.components,n=t.strings,o=t.useAsButton,i=t.inline,r=t.appClass;const s=t=>t?"":'style="display:none" hidden',a=p('\n <div data-key="root" class="pickr">\n\n '.concat(o?"":'<button type="button" data-key="button" class="pcr-button"></button>','\n\n <div data-key="app" class="pcr-app ').concat(r||"",'" ').concat(i?'style="position: unset"':"",'>\n <div class="pcr-selection" ').concat(s(e.palette),'>\n <div data-con="preview" class="pcr-color-preview" ').concat(s(e.preview),'>\n <button type="button" data-key="lastColor" class="pcr-last-color"></button>\n <div data-key="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div data-con="palette" class="pcr-color-palette">\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="palette" class="pcr-palette"></div>\n </div>\n\n <div data-con="hue" class="pcr-color-chooser" ').concat(s(e.hue),'>\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="slider" class="pcr-hue pcr-slider"></div>\n </div>\n\n <div data-con="opacity" class="pcr-color-opacity" ').concat(s(e.opacity),'>\n <div data-key="picker" class="pcr-picker"></div>\n <div data-key="slider" class="pcr-opacity pcr-slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ').concat(e.palette?"":" pcr-last",'" data-key="swatches"></div> \n\n <div data-con="interaction" class="pcr-interaction" ').concat(s(Object.keys(e.interaction).length),'>\n <input data-key="result" class="pcr-result" type="text" spellcheck="false" ').concat(s(e.interaction.input),'>\n\n <input data-arr="options" class="pcr-type" data-type="HEXA" value="HEXA" type="button" ').concat(s(e.interaction.hex),'>\n <input data-arr="options" class="pcr-type" data-type="RGBA" value="RGBA" type="button" ').concat(s(e.interaction.rgba),'>\n <input data-arr="options" class="pcr-type" data-type="HSLA" value="HSLA" type="button" ').concat(s(e.interaction.hsla),'>\n <input data-arr="options" class="pcr-type" data-type="HSVA" value="HSVA" type="button" ').concat(s(e.interaction.hsva),'>\n <input data-arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ').concat(s(e.interaction.cmyk),'>\n\n <input data-key="save" class="pcr-save" value="').concat(n.save||"Save",'" type="button" ').concat(s(e.interaction.save),'>\n <input data-key="clear" class="pcr-clear" value="').concat(n.clear||"Clear",'" type="button" ').concat(s(e.interaction.clear),">\n </div>\n </div>\n </div>\n ")),c=a.interaction;return c.options.find(t=>!t.hidden&&!t.classList.add("active")),c.type=(()=>c.options.find(t=>t.classList.contains("active"))),a};function L(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class P{constructor(t){L(this,"_initializingActive",!0),L(this,"_recalc",!0),L(this,"_color",S()),L(this,"_lastColor",S()),L(this,"_swatchColors",[]),L(this,"_eventListener",{swatchselect:[],change:[],save:[],init:[]}),this.options=t=Object.assign({appClass:null,useAsButton:!1,disabled:!1,comparison:!0,components:{interaction:{}},strings:{},swatches:null,inline:!1,default:"#42445A",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"},t);const e=t,n=e.swatches,o=e.inline,i=e.components,r=e.position;i.interaction||(i.interaction={});const s=i.preview,a=i.opacity,c=i.hue,l=i.palette;i.palette=l||s||a||c,o&&(t.showAlways=!0),this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),n&&n.length&&n.forEach(t=>this.addSwatch(t)),this._nanopop=function(t){let e=t.el,n=t.reference,o=t.pos,i=t.padding,r=void 0===i?8:i;const s={start:"sme",middle:"mse",end:"ems"},a={top:"tb",right:"rl",bottom:"bt",left:"lr"},c=j(o.split("-"),2),l=c[0],u=c[1],p=void 0===u?"middle":u,h="top"===l||"bottom"===l;return{update(){const t=n.getBoundingClientRect(),o=e.getBoundingClientRect(),i=h?{t:t.top-o.height-r,b:t.bottom+r}:{r:t.right+r,l:t.left-o.width-r},c=h?{s:t.left+t.width-o.width,m:-o.width/2+(t.left+t.width/2),e:t.left}:{s:t.bottom-o.height,m:t.bottom-t.height/2-o.height/2,e:t.bottom-t.height};function u(t,n,i){const r="top"===i,s=r?o.height:o.width,a=window[r?"innerHeight":"innerWidth"];for(const o of t){const t=n[o];if(t>0&&t+s<a){e.style[i]="".concat(t,"px");break}}}u(s[p],c,h?"left":"top"),u(a[l],i,h?"top":"left")}}}({reference:this._root.button,el:this._root.app,pos:r});const u=this._root.button,p=this;requestAnimationFrame(function e(){if(null===u.offsetParent&&u!==document.body)return requestAnimationFrame(e);p.setColor(t.default),p._rePositioningPicker(),t.defaultRepresentation&&(p._representation=t.defaultRepresentation,p.setColorRepresentation(p._representation)),t.showAlways&&p.show(),p._initializingActive=!1,p._emit("init")})}_preBuild(){const t=this.options;"string"==typeof t.el&&(t.el=t.el.split(/>>/g).reduce((t,e,n,o)=>(t=t.querySelector(e),n<o.length-1?t.shadowRoot:t),document)),this._root=B(t),t.useAsButton&&(this._root.button=t.el),document.body.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(document.body.removeChild(e.root),t.inline){const n=t.el.parentElement;n.lastChild===t.el?n.appendChild(e.app):n.insertBefore(e.app,t.el.nextSibling)}else document.body.appendChild(e.app);t.useAsButton||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()}_buildComponents(){const t=this,e=this.options.components,n={palette:x({element:t._root.palette.picker,wrapper:t._root.palette.palette,onchange(n,o){if(!e.palette)return;const i=t._color,r=t._root,s=t.options;i.s=100*n,i.v=100-100*o,i.v<0&&(i.v=0);const a=i.toRGBA().toString();this.element.style.background=a,this.wrapper.style.background="\n linear-gradient(to top, rgba(0, 0, 0, ".concat(i.a,"), transparent),\n linear-gradient(to left, hsla(").concat(i.h,", 100%, 50%, ").concat(i.a,"), rgba(255, 255, 255, ").concat(i.a,"))\n "),s.comparison||(r.button.style.color=a,s.useAsButton||(r.preview.lastColor.style.color=a)),r.preview.currentColor.style.color=a,t._recalc&&t._updateOutput(),t.options.comparison||r.button.classList.remove("clear")}}),hue:x({lockX:!0,element:t._root.hue.picker,wrapper:t._root.hue.slider,onchange(o,i){e.hue&&e.palette&&(t._color.h=360*i,this.element.style.backgroundColor="hsl(".concat(t._color.h,", 100%, 50%)"),n.palette.trigger())}}),opacity:x({lockX:!0,element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onchange(n,o){e.opacity&&e.palette&&(t._color.a=Math.round(100*o)/100,this.element.style.background="rgba(0, 0, 0, ".concat(t._color.a,")"),t.components.palette.trigger())}}),selectable:E({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._updateOutput()}})};this.components=n}_bindEvents(){const t=this._root,e=this.options,n=[s(t.interaction.clear,"click",()=>this._clearColor()),s(t.preview.lastColor,"click",()=>this.setHSVA(...this._lastColor.toHSVA())),s(t.interaction.save,"click",()=>{!this.applyColor()&&!e.showAlways&&this.hide()}),s(t.interaction.result,["keyup","input"],t=>{this._recalc=!1,this.setColor(t.target.value,!0)&&!this._initializingActive&&this._emit("change",this._color),t.stopImmediatePropagation()}),s([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],()=>this._recalc=!0)];if(!e.showAlways){const o=e.closeWithKey;n.push(s(t.button,"click",()=>this.isOpen()?this.hide():this.show()),s(document,"keyup",t=>this.isOpen()&&(t.key===o||t.code===o)&&this.hide()),s(document,["touchstart","mousedown"],e=>{this.isOpen()&&!h(e).some(e=>e===t.app||e===t.button)&&this.hide()},{capture:!0}))}if(e.adjustableNumbers&&d(t.interaction.result,!1),!e.inline){let t=null;const e=this;n.push(s(window,["scroll","resize"],()=>{e.isOpen()&&(null===t?(t=setTimeout(()=>t=null,100),requestAnimationFrame(function n(){e._rePositioningPicker(),null!==t&&requestAnimationFrame(n)})):(clearTimeout(t),t=setTimeout(()=>t=null,100)))}))}this._eventBindings=n}_rePositioningPicker(){this.options.inline||this._nanopop.update()}_updateOutput(){if(this._root.interaction.type()){const t="to".concat(this._root.interaction.type().getAttribute("data-type"));this._root.interaction.result.value="function"==typeof this._color[t]?this._color[t]().toString():""}this._initializingActive||this._emit("change",this._color)}_clearColor(){const t=this._root,e=this.options;e.useAsButton||(t.button.style.color="rgba(0, 0, 0, 0.15)"),t.button.classList.add("clear"),e.showAlways||this.hide(),this._initializingActive||this._emit("save",null)}_emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];this._eventListener[t].forEach(t=>t(...n,this))}on(t,e){return"function"==typeof e&&"string"==typeof t&&t in this._eventListener&&this._eventListener[t].push(e),this}off(t,e){const n=this._eventListener[t];if(n){const t=n.indexOf(e);~t&&n.splice(t,1)}return this}addSwatch(t){const e=C(t).values;if(e){const t=this._swatchColors,n=this._root,o=S(...e),i=l('<button type="button" style="color: '.concat(o.toRGBA(),'"></button>'));return n.swatches.appendChild(i),t.push({element:i,hsvaColorObject:o}),this._eventBindings.push(s(i,"click",()=>{this.setHSVA(...o.toHSVA(),!0),this._emit("swatchselect",o)})),!0}return!1}removeSwatch(t){if("number"==typeof t){const e=this._swatchColors[t];if(e){const n=e.element;return this._root.swatches.removeChild(n),this._swatchColors.splice(t,1),!0}}return!1}applyColor(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=this._root,n=e.preview,o=e.button,i=this._color.toRGBA().toString();n.lastColor.style.color=i,this.options.useAsButton||(o.style.color=i),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color)}destroy(){this._eventBindings.forEach(t=>a(...t)),Object.keys(this.components).forEach(t=>this.components[t].destroy())}destroyAndRemove(){this.destroy();const t=this._root.root;t.parentElement.removeChild(t);const e=this._root.app;e.parentElement.removeChild(e);const n=this;Object.keys(n).forEach(t=>n[t]=null)}hide(){return this._root.app.classList.remove("visible"),this}show(){if(!this.options.disabled)return this._root.app.classList.add("visible"),this._rePositioningPicker(),this}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(){let 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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||n<0||n>100||o<0||o>1)return!1;this._color=S(t,e,n,o);const s=this.components,a=s.hue,c=s.opacity,l=s.palette,u=a.options.wrapper.offsetHeight*(t/360);a.update(0,u);const p=c.options.wrapper.offsetHeight*o;c.update(0,p);const h=l.options.wrapper,d=h.offsetWidth*(e/100),f=h.offsetHeight*(1-n/100);return l.update(d,f),this._recalc=r,this._recalc&&this._updateOutput(),i||this.applyColor(),!0}setColor(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(),!0;const n=C(t),o=n.values,i=n.type;if(o){const t=i.toUpperCase(),n=this._root.interaction.options,r=n.find(e=>e.getAttribute("data-type").startsWith(t));if(r&&!r.hidden)for(const t of n)t.classList[t===r?"add":"remove"]("active");return this.setHSVA(...o,e)}}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find(e=>e.getAttribute("data-type").startsWith(t)&&!e.click())}getColorRepresentation(){return this._representation}getColor(){return this._color}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}P.utils=o,P.create=(t=>new P(t)),P.version="0.6.3";e.default=P}]).default});
//# sourceMappingURL=pickr.min.js.map
{
"name": "@simonwep/pickr",
"version": "0.6.2",
"version": "0.6.3",
"license": "MIT",

@@ -5,0 +5,0 @@ "author": "Simon Reinisch <toports@gmx.de>",

@@ -23,3 +23,3 @@ <h1 align="center">

<img alt="Current version"
src="https://img.shields.io/badge/version-0.6.2-f1c40f.svg?style=popout-square">
src="https://img.shields.io/badge/version-0.6.3-f1c40f.svg?style=popout-square">
<a href="https://www.patreon.com/simonwep"><img

@@ -26,0 +26,0 @@ alt="Support me"

@@ -0,0 +0,0 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');

import * as _ from '../utils/utils';
const clamp = v => Math.max(Math.min(v, 1), 0);
export default function Moveable(opt) {

@@ -27,4 +28,4 @@

const {options, cache} = that;
const {element} = options;
const b = that.options.wrapper.getBoundingClientRect();
const {element, wrapper} = options;
const b = wrapper.getBoundingClientRect();

@@ -56,7 +57,10 @@ let x = 0, y = 0;

if (!options.lockY) {
element.style.top = `calc(${y / b.height * 100}% - ${element.offsetWidth / 2}px)`;
element.style.top = `calc(${y / b.height * 100}% - ${element.offsetHeight / 2}px)`;
}
that.cache = {x: x / b.width, y: y / b.height};
options.onchange(x, y);
options.onchange(
clamp(x / wrapper.offsetWidth),
clamp(y / wrapper.offsetHeight)
);
},

@@ -63,0 +67,0 @@

@@ -0,0 +0,0 @@ /**

@@ -214,6 +214,6 @@ // Import styles

// Calculate saturation based on the position
_color.s = (x / this.wrapper.offsetWidth) * 100;
_color.s = x * 100;
// Calculate the value
_color.v = 100 - (y / this.wrapper.offsetHeight) * 100;
_color.v = 100 - y * 100;

@@ -248,4 +248,7 @@ // Prevent falling under zero

// If the user changes the color, remove the cleared icon
_root.button.classList.remove('clear');
if (!inst.options.comparison) {
// If the user changes the color, remove the cleared icon
_root.button.classList.remove('clear');
}
}

@@ -263,3 +266,3 @@ }),

// Calculate hue
inst._color.h = (y / this.wrapper.offsetHeight) * 360;
inst._color.h = y * 360;

@@ -281,3 +284,3 @@ // Update color

// Calculate opacity
inst._color.a = Math.round(((y / this.wrapper.offsetHeight)) * 1e2) / 100;
inst._color.a = Math.round(y * 1e2) / 100;

@@ -766,3 +769,3 @@ // Update color

// Assign version and export
Pickr.version = '0.6.2';
Pickr.version = '0.6.3';
export default Pickr;

@@ -55,5 +55,5 @@ import {hsvToHsl, hsvToRgb, hsvToCmyk, hsvToHex} from './color';

// to hex and pad it with zeros if needet.
const alpha = that.a >= 1 ? '' : Number((that.a * 255).toFixed(0)
const alpha = that.a >= 1 ? '' : Number((that.a * 255).toFixed(0))
.toString(16)
.toUpperCase(), 2, '0');
.toUpperCase().padStart(2, '0');

@@ -60,0 +60,0 @@ return `#${hex.join('').toUpperCase() + alpha}`;

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc