⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.19
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Server Software:
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
crm.dev-unit.com
/
public
/
assets
/
js
/
View File Name :
pickr.min.js
function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(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 _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),t}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,c=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){c=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return i}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach((function(e){_defineProperty(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _defineProperty(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _createForOfIteratorHelper(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=_unsupportedIterableToArray(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"object"==("undefined"==typeof module?"undefined":_typeof(module))?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==("undefined"==typeof exports?"undefined":_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){t.exports=JSON.parse('{"a":"1.7.4"}')},function(t,e,n){"use strict";n.r(e);var r={};function o(t,e,n,r){var o=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 i,a=_createForOfIteratorHelper(e);try{for(a.s();!(i=a.n()).done;){var c,l=i.value,s=_createForOfIteratorHelper(n);try{for(s.s();!(c=s.n()).done;){var u=c.value;l[t](u,r,_objectSpread({capture:!1},o))}}catch(t){s.e(t)}finally{s.f()}}}catch(t){a.e(t)}finally{a.f()}return Array.prototype.slice.call(arguments,1)}n.r(r),n.d(r,"on",(function(){return i})),n.d(r,"off",(function(){return a})),n.d(r,"createElementFromString",(function(){return c})),n.d(r,"createFromTemplate",(function(){return l})),n.d(r,"eventPath",(function(){return s})),n.d(r,"resolveElement",(function(){return u})),n.d(r,"adjustableInputNumbers",(function(){return p}));var i=o.bind(null,"addEventListener"),a=o.bind(null,"removeEventListener");function c(t){var e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function l(t){var e=function(t,e){var n=t.getAttribute(e);return t.removeAttribute(e),n};return function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e(n,":obj"),i=e(n,":ref"),a=o?r[o]={}:r;i&&(r[i]=n);for(var c=0,l=Array.from(n.children);c<l.length;c++){var s=l[c],u=e(s,":arr"),p=t(s,u?{}:a);u&&(a[u]||(a[u]=[])).push(Object.keys(p).length?p:s)}return r}(c(t))}function s(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 u(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce((function(t,e,n,r){return t=t.querySelector(e),n<r.length-1?t.shadowRoot:t}),document):null}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t){return t};function n(n){var r=[.001,.01,.1][Number(n.shiftKey||2*n.ctrlKey)]*(n.deltaY<0?1:-1),o=0,i=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,(function(t,n){return n<=i&&n+t.length>=i?(i=n,e(Number(t),r,o)):(o++,t)})),t.focus(),t.setSelectionRange(i,i),n.preventDefault(),t.dispatchEvent(new Event("input"))}i(t,"focus",(function(){return i(window,"wheel",n,{passive:!1})})),i(t,"blur",(function(){return a(window,"wheel",n)}))}var d=n(0),f=Math.min,h=Math.max,v=Math.floor,y=Math.round;function b(t,e,n){e/=100,n/=100;var r=v(t=t/360*6),o=t-r,i=n*(1-e),a=n*(1-o*e),c=n*(1-(1-o)*e),l=r%6;return[255*[n,a,i,i,c,n][l],255*[c,n,n,a,i,i][l],255*[i,i,c,n,n,a][l]]}function m(t,e,n){var r=(2-(e/=100))*(n/=100)/2;return 0!==r&&(e=1===r?0:r<.5?e*n/(2*r):e*n/(2-2*r)),[t,100*e,100*r]}function _(t,e,n){var r,o,i=f(t/=255,e/=255,n/=255),a=h(t,e,n),c=a-i;if(0===c)r=o=0;else{o=c/a;var l=((a-t)/6+c/2)/c,s=((a-e)/6+c/2)/c,u=((a-n)/6+c/2)/c;t===a?r=u-s:e===a?r=1/3+l-u:n===a&&(r=2/3+s-l),r<0?r+=1:r>1&&(r-=1)}return[360*r,100*o,100*a]}function g(t,e,n,r){return e/=100,n/=100,_toConsumableArray(_(255*(1-f(1,(t/=100)*(1-(r/=100))+r)),255*(1-f(1,e*(1-r)+r)),255*(1-f(1,n*(1-r)+r))))}function w(t,e,n){e/=100;var r=2*(e*=(n/=100)<.5?n:1-n)/(n+e)*100,o=100*(n+e);return[t,isNaN(r)?0:r,o]}function A(t){return _.apply(void 0,_toConsumableArray(t.match(/.{2}/g).map((function(t){return parseInt(t,16)}))))}function k(){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=function(t,e){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;return e(~n?t.map((function(t){return Number(t.toFixed(n))})):t)}},i={h:t,s:e,v:n,a:r,toHSVA:function(){var t=[i.h,i.s,i.v,i.a];return t.toString=o(t,(function(t){return"hsva(".concat(t[0],", ").concat(t[1],"%, ").concat(t[2],"%, ").concat(i.a,")")})),t},toHSLA:function(){var t=[].concat(_toConsumableArray(m(i.h,i.s,i.v)),[i.a]);return t.toString=o(t,(function(t){return"hsla(".concat(t[0],", ").concat(t[1],"%, ").concat(t[2],"%, ").concat(i.a,")")})),t},toRGBA:function(){var t=[].concat(_toConsumableArray(b(i.h,i.s,i.v)),[i.a]);return t.toString=o(t,(function(t){return"rgba(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(i.a,")")})),t},toCMYK:function(){var t=function(t,e,n){var r=b(t,e,n),o=r[0]/255,i=r[1]/255,a=r[2]/255,c=f(1-o,1-i,1-a);return[100*(1===c?0:(1-o-c)/(1-c)),100*(1===c?0:(1-i-c)/(1-c)),100*(1===c?0:(1-a-c)/(1-c)),100*c]}(i.h,i.s,i.v);return t.toString=o(t,(function(t){return"cmyk(".concat(t[0],"%, ").concat(t[1],"%, ").concat(t[2],"%, ").concat(t[3],"%)")})),t},toHEXA:function(){var t=function(t,e,n){return b(t,e,n).map((function(t){return y(t).toString(16).padStart(2,"0")}))}(i.h,i.s,i.v),e=i.a>=1?"":Number((255*i.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=function(){return"#".concat(t.join("").toUpperCase())},t},clone:function(){return k(i.h,i.s,i.v,i.a)}};return i}var C=function(t){return Math.max(Math.min(t,1),0)};function S(t){var e={options:Object.assign({lock:null,onchange:function(){return 0},onstop:function(){return 0}},t),_keyboard:function(t){var n=e.options,r=t.type,o=t.key;if(document.activeElement===n.wrapper){var i=e.options.lock,a="ArrowUp"===o,c="ArrowRight"===o,l="ArrowDown"===o,s="ArrowLeft"===o;if("keydown"===r&&(a||c||l||s)){var u=0,p=0;"v"===i?u=a||c?1:-1:"h"===i?u=a||c?-1:1:(p=a?-1:l?1:0,u=s?-1:c?1:0),e.update(C(e.cache.x+.01*u),C(e.cache.y+.01*p)),t.preventDefault()}else o.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault())}},_tapstart:function(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t)},_tapmove:function(t){var n=e.options,r=e.cache,o=n.lock,i=n.element,a=n.wrapper.getBoundingClientRect(),c=0,l=0;if(t){var s=t&&t.touches&&t.touches[0];c=t?(s||t).clientX:0,l=t?(s||t).clientY:0,c<a.left?c=a.left:c>a.left+a.width&&(c=a.left+a.width),l<a.top?l=a.top:l>a.top+a.height&&(l=a.top+a.height),c-=a.left,l-=a.top}else r&&(c=r.x*a.width,l=r.y*a.height);"h"!==o&&(i.style.left="calc(".concat(c/a.width*100,"% - ").concat(i.offsetWidth/2,"px)")),"v"!==o&&(i.style.top="calc(".concat(l/a.height*100,"% - ").concat(i.offsetHeight/2,"px)")),e.cache={x:c/a.width,y:l/a.height};var u=C(c/a.width),p=C(l/a.height);switch(o){case"v":return n.onchange(u);case"h":return n.onchange(p);default:return n.onchange(u,p)}},_tapstop:function(){e.options.onstop(),a(document,["mouseup","touchend","touchcancel"],e._tapstop),a(document,["mousemove","touchmove"],e._tapmove)},trigger:function(){e._tapmove()},update:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=e.options.wrapper.getBoundingClientRect(),o=r.left,i=r.top,a=r.width,c=r.height;"h"===e.options.lock&&(n=t),e._tapmove({clientX:o+a*t,clientY:i+c*n})},destroy:function(){var t=e.options,n=e._tapstart,r=e._keyboard;a(document,["keydown","keyup"],r),a([t.wrapper,t.element],"mousedown",n),a([t.wrapper,t.element],"touchstart",n,{passive:!1})}},n=e.options,r=e._tapstart,o=e._keyboard;return i([n.wrapper,n.element],"mousedown",r),i([n.wrapper,n.element],"touchstart",r,{passive:!1}),i(document,["keydown","keyup"],o),e}function O(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Object.assign({onchange:function(){return 0},className:"",elements:[]},t);var e=i(t.elements,"click",(function(e){t.elements.forEach((function(n){return n.classList[e.target===n?"add":"remove"](t.className)})),t.onchange(e),e.stopPropagation()}));return{destroy:function(){return a.apply(void 0,_toConsumableArray(e))}}}var j={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8};function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var L=function(){function t(e){var n=this;_classCallCheck(this,t),E(this,"_initializingActive",!0),E(this,"_recalc",!0),E(this,"_nanopop",null),E(this,"_root",null),E(this,"_color",k()),E(this,"_lastColor",k()),E(this,"_swatchColors",[]),E(this,"_eventListener",{init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]}),this.options=e=Object.assign(_objectSpread({},t.DEFAULT_OPTIONS),e);var r=e,o=r.swatches,i=r.components,a=r.theme,c=r.sliders,l=r.lockOpacity,s=r.padding;["nano","monolith"].includes(a)&&!c&&(e.sliders="h"),i.interaction||(i.interaction={});var u=i.preview,p=i.opacity,d=i.hue,f=i.palette;i.opacity=!l&&p,i.palette=f||u||p||d,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),o&&o.length&&o.forEach((function(t){return n.addSwatch(t)}));var h=this._root,v=h.button,y=h.app;this._nanopop=function(t,e,n){var r="object"!=_typeof(t)||t instanceof HTMLElement?_objectSpread({reference:t,popper:e},n):t;return{update:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,e=Object.assign(r,t),n=e.reference,o=e.popper;if(!o||!n)throw new Error("Popper- or reference-element missing.");return function(t,e,n){var r=_objectSpread(_objectSpread({container:document.documentElement.getBoundingClientRect()},j),n),o=r.container,i=r.margin,a=r.position,c=r.variantFlipOrder,l=r.positionFlipOrder,s=e.style,u=s.left,p=s.top;e.style.left="0",e.style.top="0";var d,f=t.getBoundingClientRect(),h=e.getBoundingClientRect(),v={t:f.top-h.height-i,b:f.bottom+i,r:f.right+i,l:f.left-h.width-i},y={vs:f.left,vm:f.left+f.width/2+-h.width/2,ve:f.left+f.width-h.width,hs:f.top,hm:f.bottom-f.height/2-h.height/2,he:f.bottom-h.height},b=_slicedToArray(a.split("-"),2),m=b[0],_=b[1],g=void 0===_?"middle":_,w=l[m],A=c[g],k=o.top,C=o.left,S=o.bottom,O=o.right,E=_createForOfIteratorHelper(w);try{for(E.s();!(d=E.n()).done;){var L=d.value,T="t"===L||"b"===L,P=v[L],x=_slicedToArray(T?["top","left"]:["left","top"],2),H=x[0],R=x[1],B=_slicedToArray(T?[h.height,h.width]:[h.width,h.height],2),I=B[0],D=B[1],F=_slicedToArray(T?[S,O]:[O,S],2),N=F[0],M=F[1],U=_slicedToArray(T?[k,C]:[C,k],2),W=U[0],K=U[1];if(!(P<W||P+I>N)){var V,z=_createForOfIteratorHelper(A);try{for(z.s();!(V=z.n()).done;){var X=V.value,$=y[(T?"v":"h")+X];if(!($<K||$+D>M))return e.style[R]=$-h[R]+"px",e.style[H]=P-h[H]+"px",L+X}}catch(t){z.e(t)}finally{z.f()}}}}catch(t){E.e(t)}finally{E.f()}return e.style.left=u,e.style.top=p,null}(n,o,r)}}}(v,y,{margin:s}),v.setAttribute("role","button"),v.setAttribute("aria-label",this._t("btn:toggle"));var b=this;requestAnimationFrame((function t(){if(!y.offsetWidth)return requestAnimationFrame(t);b.setColor(e.default),b._rePositioningPicker(),e.defaultRepresentation&&(b._representation=e.defaultRepresentation,b.setColorRepresentation(b._representation)),e.showAlways&&b.show(),b._initializingActive=!1,b._emit("init")}))}return _createClass(t,[{key:"_preBuild",value:function(){for(var t=this.options,e=0,n=["el","container"];e<n.length;e++){var r=n[e];t[r]=u(t[r])}this._root=function(t){var e=t.options,n=e.components,r=e.useAsButton,o=e.inline,i=e.appClass,a=e.theme,c=e.lockOpacity,s=function(t){return t?"":'style="display:none" hidden'},u=function(e){return t._t(e)},p=l('\n <div :ref="root" class="pickr">\n\n '.concat(r?"":'<button type="button" :ref="button" class="pcr-button"></button>','\n\n <div :ref="app" class="pcr-app ').concat(i||"",'" data-theme="').concat(a,'" ').concat(o?'style="position: unset"':"",' aria-label="').concat(u("ui:dialog"),'" role="window">\n <div class="pcr-selection" ').concat(s(n.palette),'>\n <div :obj="preview" class="pcr-color-preview" ').concat(s(n.preview),'>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="').concat(u("btn:last-color"),'"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="').concat(u("aria:palette"),'" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ').concat(s(n.hue),'>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="').concat(u("aria:hue"),'" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ').concat(s(n.opacity),'>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="').concat(u("aria:opacity"),'" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ').concat(n.palette?"":"pcr-last",'" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ').concat(s(Object.keys(n.interaction).length),'>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ').concat(s(n.interaction.input),' aria-label="').concat(u("aria:input"),'">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="').concat(c?"HEX":"HEXA",'" type="button" ').concat(s(n.interaction.hex),'>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="').concat(c?"RGB":"RGBA",'" type="button" ').concat(s(n.interaction.rgba),'>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="').concat(c?"HSL":"HSLA",'" type="button" ').concat(s(n.interaction.hsla),'>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="').concat(c?"HSV":"HSVA",'" type="button" ').concat(s(n.interaction.hsva),'>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ').concat(s(n.interaction.cmyk),'>\n\n <input :ref="save" class="pcr-save" value="').concat(u("btn:save"),'" type="button" ').concat(s(n.interaction.save),' aria-label="').concat(u("aria:btn:save"),'">\n <input :ref="cancel" class="pcr-cancel" value="').concat(u("btn:cancel"),'" type="button" ').concat(s(n.interaction.cancel),' aria-label="').concat(u("aria:btn:cancel"),'">\n <input :ref="clear" class="pcr-clear" value="').concat(u("btn:clear"),'" type="button" ').concat(s(n.interaction.clear),' aria-label="').concat(u("aria:btn:clear"),'">\n </div>\n </div>\n </div>\n ')),d=p.interaction;return d.options.find((function(t){return!t.hidden&&!t.classList.add("active")})),d.type=function(){return d.options.find((function(t){return t.classList.contains("active")}))},p}(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}},{key:"_finalBuild",value:function(){var t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){var n=t.el.parentElement;t.el.nextSibling?n.insertBefore(e.app,t.el.nextSibling):n.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}},{key:"_buildComponents",value:function(){var t=this,e=this,n=this.options.components,r=(e.options.sliders||"v").repeat(2),o=_slicedToArray(r.match(/^[vh]+$/g)?r:[],2),i=o[0],a=o[1],c=function(){return t._color||(t._color=t._lastColor.clone())},l={palette:S({element:e._root.palette.picker,wrapper:e._root.palette.palette,onstop:function(){return e._emit("changestop",e)},onchange:function(t,r){if(n.palette){var o=c(),i=e._root,a=e.options,l=i.preview,s=l.lastColor,u=l.currentColor;e._recalc&&(o.s=100*t,o.v=100-100*r,o.v<0&&(o.v=0),e._updateOutput());var p=o.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background="\n linear-gradient(to top, rgba(0, 0, 0, ".concat(o.a,"), transparent),\n linear-gradient(to left, hsla(").concat(o.h,", 100%, 50%, ").concat(o.a,"), rgba(255, 255, 255, ").concat(o.a,"))\n "),a.comparison?a.useAsButton||e._lastColor||(s.style.color=p):(i.button.style.color=p,i.button.classList.remove("clear"));var d,f=o.toHEXA().toString(),h=_createForOfIteratorHelper(e._swatchColors);try{for(h.s();!(d=h.n()).done;){var v=d.value,y=v.el,b=v.color;y.classList[f===b.toHEXA().toString()?"add":"remove"]("pcr-active")}}catch(t){h.e(t)}finally{h.f()}u.style.color=p}}}),hue:S({lock:"v"===a?"h":"v",element:e._root.hue.picker,wrapper:e._root.hue.slider,onstop:function(){return e._emit("changestop",e)},onchange:function(t){if(n.hue&&n.palette){var r=c();e._recalc&&(r.h=360*t),this.element.style.backgroundColor="hsl(".concat(r.h,", 100%, 50%)"),l.palette.trigger()}}}),opacity:S({lock:"v"===i?"h":"v",element:e._root.opacity.picker,wrapper:e._root.opacity.slider,onstop:function(){return e._emit("changestop",e)},onchange:function(t){if(n.opacity&&n.palette){var r=c();e._recalc&&(r.a=Math.round(100*t)/100),this.element.style.background="rgba(0, 0, 0, ".concat(r.a,")"),l.palette.trigger()}}}),selectable:O({elements:e._root.interaction.options,className:"active",onchange:function(t){e._representation=t.target.getAttribute("data-type").toUpperCase(),e._recalc&&e._updateOutput()}})};this._components=l}},{key:"_bindEvents",value:function(){var t=this,e=this._root,n=this.options,r=[i(e.interaction.clear,"click",(function(){return t._clearColor()})),i([e.interaction.cancel,e.preview.lastColor],"click",(function(){t._emit("cancel",t),t.setHSVA.apply(t,_toConsumableArray((t._lastColor||t._color).toHSVA()).concat([!0]))})),i(e.interaction.save,"click",(function(){!t.applyColor()&&!n.showAlways&&t.hide()})),i(e.interaction.result,["keyup","input"],(function(e){t.setColor(e.target.value,!0)&&!t._initializingActive&&t._emit("change",t._color),e.stopImmediatePropagation()})),i(e.interaction.result,["focus","blur"],(function(e){t._recalc="blur"===e.type,t._recalc&&t._updateOutput()})),i([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}),{passive:!0})];if(!n.showAlways){var o=n.closeWithKey;r.push(i(e.button,"click",(function(){return t.isOpen()?t.hide():t.show()})),i(document,"keyup",(function(e){return t.isOpen()&&(e.key===o||e.code===o)&&t.hide()})),i(document,["touchstart","mousedown"],(function(n){t.isOpen()&&!s(n).some((function(t){return t===e.app||t===e.button}))&&t.hide()}),{capture:!0}))}if(n.adjustableNumbers){var a={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(e.interaction.result,(function(e,n,r){var o=a[t.getColorRepresentation().toLowerCase()];if(o){var i=o[r],c=e+(i>=100?1e3*n:n);return c<=0?0:Number((c<i?c:i).toPrecision(3))}return e}))}if(n.autoReposition&&!n.inline){var c=null,l=this;r.push(i(window,["scroll","resize"],(function(){l.isOpen()&&(n.closeOnScroll&&l.hide(),null===c?(c=setTimeout((function(){return c=null}),100),requestAnimationFrame((function t(){l._rePositioningPicker(),null!==c&&requestAnimationFrame(t)}))):(clearTimeout(c),c=setTimeout((function(){return c=null}),100)))}),{capture:!0}))}this._eventBindings=r}},{key:"_rePositioningPicker",value:function(){var t=this.options;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){var e=this._root.app,n=e.getBoundingClientRect();e.style.top="".concat((window.innerHeight-n.height)/2,"px"),e.style.left="".concat((window.innerWidth-n.width)/2,"px")}}},{key:"_updateOutput",value:function(){var t=this._root,e=this._color,n=this.options;if(t.interaction.type()){var r="to".concat(t.interaction.type().getAttribute("data-type"));t.interaction.result.value="function"==typeof e[r]?e[r]().toString(n.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",e)}},{key:"_clearColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._root,n=this.options;n.useAsButton||(e.button.style.color="rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),n.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear",this))}},{key:"_parseLocalColor",value:function(t){var e=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";var e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;var e,n={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},r=function(t){return t.map((function(t){return/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0}))};t:for(var o in n)if(e=n[o].exec(t)){var i=function(t){return!!e[2]==("number"==typeof t)};switch(o){case"cmyk":var a=_slicedToArray(r(e),5),c=a[1],l=a[2],s=a[3],u=a[4];if(c>100||l>100||s>100||u>100)break t;return{values:g(c,l,s,u),type:o};case"rgba":var p=_slicedToArray(r(e),7),d=p[3],f=p[4],h=p[5],v=p[6];if(d>255||f>255||h>255||v<0||v>1||!i(v))break t;return{values:[].concat(_toConsumableArray(_(d,f,h)),[v]),a:v,type:o};case"hexa":var y=_slicedToArray(e,2)[1];4!==y.length&&3!==y.length||(y=y.split("").map((function(t){return t+t})).join(""));var b=y.substring(0,6),m=y.substring(6);return m=m?parseInt(m,16)/255:void 0,{values:[].concat(_toConsumableArray(A(b)),[m]),a:m,type:o};case"hsla":var k=_slicedToArray(r(e),7),C=k[3],S=k[4],O=k[5],j=k[6];if(C>360||S>100||O>100||j<0||j>1||!i(j))break t;return{values:[].concat(_toConsumableArray(w(C,S,O)),[j]),a:j,type:o};case"hsva":var E=_slicedToArray(r(e),7),L=E[3],T=E[4],P=E[5],x=E[6];if(L>360||T>100||P>100||x<0||x>1||!i(x))break t;return{values:[L,T,P,x],a:x,type:o}}}return{values:null,type:null}}(t),n=e.values,r=e.type,o=e.a,i=this.options.lockOpacity,a=void 0!==o&&1!==o;return n&&3===n.length&&(n[3]=void 0),{values:!n||i&&a?null:n,type:r}}},{key:"_t",value:function(e){return this.options.i18n[e]||t.I18N_DEFAULTS[e]}},{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 this._eventListener[t].push(e),this}},{key:"off",value:function(t,e){var n=this._eventListener[t]||[],r=n.indexOf(e);return~r&&n.splice(r,1),this}},{key:"addSwatch",value:function(t){var e=this,n=this._parseLocalColor(t).values;if(n){var r=this._swatchColors,o=this._root,a=k.apply(void 0,_toConsumableArray(n)),l=c('<button type="button" style="color: '.concat(a.toRGBA().toString(0),'" aria-label="').concat(this._t("btn:swatch"),'"/>'));return o.swatches.appendChild(l),r.push({el:l,color:a}),this._eventBindings.push(i(l,"click",(function(){e.setHSVA.apply(e,_toConsumableArray(a.toHSVA()).concat([!0])),e._emit("swatchselect",a),e._emit("change",a)}))),!0}return!1}},{key:"removeSwatch",value:function(t){var e=this._swatchColors[t];if(e){var n=e.el;return this._root.swatches.removeChild(n),this._swatchColors.splice(t,1),!0}return!1}},{key:"applyColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this._root,n=e.preview,r=e.button,o=this._color.toRGBA().toString(0);return 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),this}},{key:"destroy",value:function(){var t=this;this._eventBindings.forEach((function(t){return a.apply(void 0,_toConsumableArray(t))})),Object.keys(this._components).forEach((function(e){return t._components[e].destroy()}))}},{key:"destroyAndRemove",value:function(){var t=this;this.destroy();var e=this._root,n=e.root,r=e.app;n.parentElement&&n.parentElement.removeChild(n),r.parentElement.removeChild(r),Object.keys(this).forEach((function(e){return t[e]=null}))}},{key:"hide",value:function(){return this._root.app.classList.remove("visible"),this._emit("hide",this),this}},{key:"show",value:function(){return this.options.disabled||(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this)),this}},{key:"isOpen",value:function(){return this._root.app.classList.contains("visible")}},{key:"setHSVA",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:360,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||n<0||n>100||r<0||r>1)return!1;this._color=k(t,e,n,r);var a=this._components,c=a.hue,l=a.opacity,s=a.palette;return c.update(t/360),l.update(r),s.update(e/100,1-n/100),o||this.applyColor(),i&&this._updateOutput(),this._recalc=i,!0}},{key:"setColor",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===t)return this._clearColor(e),!0;var n=this._parseLocalColor(t),r=n.values,o=n.type;if(r){var i=o.toUpperCase(),a=this._root.interaction.options,c=a.find((function(t){return t.getAttribute("data-type")===i}));if(c&&!c.hidden){var l,s=_createForOfIteratorHelper(a);try{for(s.s();!(l=s.n()).done;){var u=l.value;u.classList[u===c?"add":"remove"]("active")}}catch(t){s.e(t)}finally{s.f()}}return!!this.setHSVA.apply(this,_toConsumableArray(r).concat([e]))&&this.setColorRepresentation(i)}return!1}},{key:"setColorRepresentation",value:function(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((function(e){return e.getAttribute("data-type").startsWith(t)&&!e.click()}))}},{key:"getColorRepresentation",value:function(){return this._representation}},{key:"getColor",value:function(){return this._color}},{key:"getSelectedColor",value:function(){return this._lastColor}},{key:"getRoot",value:function(){return this._root}},{key:"disable",value:function(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}},{key:"enable",value:function(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}]),t}();E(L,"utils",r),E(L,"version",d.a),E(L,"I18N_DEFAULTS",{"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"}),E(L,"DEFAULT_OPTIONS",{appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"}),E(L,"create",(function(t){return new L(t)})),e.default=L}]).default}));