\n\n ${useAsButton ? '' : '
'}\n\n
\n
\n `);\n\n const int = root.interaction;\n\n // Select option which is not hidden\n int.options.find(o => !o.hidden && !o.classList.add('active'));\n\n // Create method to find currenlty active option\n int.type = () => int.options.find(e => e.classList.contains('active'));\n return root;\n}\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./src/js/utils/utils.js","webpack:///./src/js/utils/color.js","webpack:///./src/js/utils/hsvacolor.js","webpack:///./src/js/libs/moveable.js","webpack:///./src/js/libs/selectable.js","webpack:///./src/js/pickr.js","webpack:///./src/js/libs/nanopop.js","webpack:///./src/js/template.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","on","eventListener","off","method","elements","events","fn","options","arguments","length","undefined","HTMLCollection","NodeList","Array","from","isArray","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","next","done","el","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","ev","_objectSpread","capture","err","return","slice","createElementFromString","html","div","document","createElement","innerHTML","trim","firstElementChild","removeAttribute","getAttribute","createFromTemplate","str","resolve","element","base","con","subtree","_i","_Array$from","children","child","arr","push","eventPath","evt","path","composedPath","target","parentElement","adjustableInputNumbers","mapper","v","handleScroll","e","inc","Number","shiftKey","ctrlKey","deltaY","index","selectionStart","replace","focus","setSelectionRange","preventDefault","dispatchEvent","Event","passive","min","Math","max","floor","round","hsvToRgb","h","f","q","mod","rgbToHsv","g","b","minVal","maxVal","delta","dr","dg","db","cmykToHsv","y","k","_toConsumableArray","hslToHsv","hexToHsv","hex","apply","match","map","parseInt","parseToHSV","ctx","getContext","fillStyle","regex","cmyk","rgba","hsla","hsva","numarize","array","invalid","type","exec","_numarize2","_slicedToArray","values","concat","_numarize4","_numarize4$","a","split","join","_ref","substring","raw","alpha","_numarize6","_numarize6$","_numarize8","_numarize8$","HSVaColor","that","toHSVA","toString","toHSLA","hsvacolor_toConsumableArray","hsvToHsl","toFixed","toRGBA","toCMYK","rgb","hsvToCmyk","toHEXA","padStart","hsvToHex","toUpperCase","clone","clamp","Moveable","opt","assign","lock","onchange","_tapstart","_","_tapstop","_tapmove","cache","wrapper","getBoundingClientRect","x","touch","touches","clientX","clientY","left","width","top","height","style","offsetWidth","offsetHeight","cx","cy","trigger","update","_that$options$wrapper","destroy","Selectable","className","onTap","forEach","classList","selectable_toConsumableArray","Pickr","_this","this","_classCallCheck","pickr_defineProperty","swatchselect","change","save","init","appClass","theme","useAsButton","disabled","comparison","closeOnScroll","components","interaction","strings","swatches","inline","sliders","default","defaultRepresentation","position","adjustableNumbers","showAlways","closeWithKey","_opt","includes","reference","_ref$padding","padding","vBehaviour","hBehaviour","getInfo","preview","opacity","hue","palette","_preBuild","_buildComponents","_bindEvents","_finalBuild","color","addSwatch","_nanopop","_root","button","app","start","middle","end","right","bottom","pos","cached","_pos$split2","nanopop_slicedToArray","_pos$split2$","variant","isVertical","_getInfo","rb","eb","so","total","scrollTop","getScrollOffset","variants","vertical","bevs","vars","styleprop","adder","win","_i2","_arr2","rot","v2Ok","v1Ok","requestAnimationFrame","cb","offsetParent","body","setColor","_rePositioningPicker","_representation","setColorRepresentation","show","_initializingActive","_emit","hidden","int","reduce","pv","cv","ci","querySelector","shadowRoot","keys","input","cancel","clear","find","add","contains","appendChild","removeChild","lastChild","insertBefore","nextSibling","parentNode","replaceChild","disable","transition","lastColor","hide","inst","cs","sh","_sliders","pickr_slicedToArray","opposite","_ref2","picker","_color","_recalc","_updateOutput","cssRGBaString","background","currentColor","remove","slider","backgroundColor","selectable","_components","_this2","eventBindings","_clearColor","setHSVA","pickr_toConsumableArray","_lastColor","applyColor","result","stopImmediatePropagation","ck","isOpen","code","some","ranges","step","range","getColorRepresentation","toLowerCase","nv","toPrecision","timeout","setTimeout","rs","clearTimeout","_eventBindings","silent","event","_this3","_len","args","_key","_eventListener","callBacks","indexOf","splice","_this4","_swatchColors","hsvaColorObject","swatchColor","_this$_root","_this5","_this6","_this$_root2","recalc","_this$_components","string","_parseToHSV2","utype","startsWith","click","utils","version"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAAnB,EAAAmB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFAxB,EAAAgB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAA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KAAKoF,mDAOZ,OAAOpF,KAAK2H,yCAOZ,OAAO3H,KAAK4C,wCAUZ,OAHA5C,KAAKkH,OACLlH,KAAKlM,QAAQ4M,UAAW,EACxBV,KAAK4C,MAAMC,OAAOjD,UAAU0G,IAAI,YACzBtG,sCASP,OAFAA,KAAKlM,QAAQ4M,UAAW,EACxBV,KAAK4C,MAAMC,OAAOjD,UAAUqI,OAAO,YAC5BjI,0CAKfF,EAAM0L,MAAQxN,EAGd8B,EAAMjN,OAAS,SAAAiB,GAAO,OAAI,IAAIgM,EAAMhM,IAGpCgM,EAAM2L,QAAU,QACD3L","file":"pickr.es5.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pickr\"] = factory();\n\telse\n\t\troot[\"Pickr\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\r\n * Add event(s) to element(s).\r\n * @param elements DOM-Elements\r\n * @param events Event names\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const on = eventListener.bind(null, 'addEventListener');\r\n\r\n/**\r\n * Remove event(s) from element(s).\r\n * @param elements DOM-Elements\r\n * @param events Event names\r\n * @param fn Callback\r\n * @param options Optional options\r\n * @return Array passed arguments\r\n */\r\nexport const off = eventListener.bind(null, 'removeEventListener');\r\n\r\nfunction eventListener(method, elements, events, fn, options = {}) {\r\n\r\n // Normalize array\r\n if (elements instanceof HTMLCollection || elements instanceof NodeList) {\r\n elements = Array.from(elements);\r\n } else if (!Array.isArray(elements)) {\r\n elements = [elements];\r\n }\r\n\r\n if (!Array.isArray(events)) {\r\n events = [events];\r\n }\r\n\r\n for (const el of elements) {\r\n for (const ev of events) {\r\n el[method](ev, fn, {capture: false, ...options});\r\n }\r\n }\r\n\r\n return Array.prototype.slice.call(arguments, 1);\r\n}\r\n\r\n/**\r\n * Creates an DOM-Element out of a string (Single element).\r\n * @param html HTML representing a single element\r\n * @returns {Element | null} The element.\r\n */\r\nexport function createElementFromString(html) {\r\n const div = document.createElement('div');\r\n div.innerHTML = html.trim();\r\n return div.firstElementChild;\r\n}\r\n\r\n/**\r\n * Removes an attribute from a HTMLElement and returns the value.\r\n * @param el\r\n * @param name\r\n * @return {string}\r\n */\r\nexport function removeAttribute(el, name) {\r\n const value = el.getAttribute(name);\r\n el.removeAttribute(name);\r\n return value;\r\n}\r\n\r\n/**\r\n * Creates a new html element, every element which has\r\n * a 'data-key' attribute will be saved in a object (which will be returned)\r\n * where the value of 'data-key' ist the object-key and the value the HTMLElement.\r\n *\r\n * It's possible to create a hierarchy if you add a 'data-con' attribute. Every\r\n * sibling will be added to the object which will get the name from the 'data-con' attribute.\r\n *\r\n * If you want to create an Array out of multiple elements, you can use the 'data-arr' attribute,\r\n * the value defines the key and all elements, which has the same parent and the same 'data-arr' attribute,\r\n * would be added to it.\r\n *\r\n * @param str - The HTML String.\r\n */\r\nexport function createFromTemplate(str) {\r\n\r\n // Recursive function to resolve template\r\n function resolve(element, base = {}) {\r\n\r\n // Check key and container attribute\r\n const con = removeAttribute(element, 'data-con');\r\n const key = removeAttribute(element, 'data-key');\r\n\r\n // Check and save element\r\n if (key) {\r\n base[key] = element;\r\n }\r\n\r\n // Check all children\r\n const subtree = con ? (base[con] = {}) : base;\r\n for (let child of Array.from(element.children)) {\r\n\r\n // Check if element should be saved as array\r\n const arr = removeAttribute(child, 'data-arr');\r\n if (arr) {\r\n\r\n // Check if there is already an array and add element\r\n (subtree[arr] || (subtree[arr] = [])).push(child);\r\n } else {\r\n resolve(child, subtree);\r\n }\r\n }\r\n\r\n return base;\r\n }\r\n\r\n return resolve(createElementFromString(str));\r\n}\r\n\r\n/**\r\n * Polyfill for safari & firefox for the eventPath event property.\r\n * @param evt The event object.\r\n * @return [String] event path.\r\n */\r\nexport function eventPath(evt) {\r\n let path = evt.path || (evt.composedPath && evt.composedPath());\r\n if (path) return path;\r\n\r\n let el = evt.target.parentElement;\r\n path = [evt.target, el];\r\n while (el = el.parentElement) path.push(el);\r\n\r\n path.push(document, window);\r\n return path;\r\n}\r\n\r\n/**\r\n * Creates the ability to change numbers in an input field with the scroll-wheel.\r\n * @param el\r\n * @param mapper\r\n */\r\nexport function adjustableInputNumbers(el, mapper = v => v) {\r\n\r\n function handleScroll(e) {\r\n const inc = ([0.001, 0.01, 0.1])[Number(e.shiftKey || e.ctrlKey * 2)] * (e.deltaY < 0 ? 1 : -1);\r\n\r\n let index = 0;\r\n let off = el.selectionStart;\r\n el.value = el.value.replace(/[\\d.]+/g, (v, i) => {\r\n\r\n // Check if number is in cursor range and increase it\r\n if (i <= off && i + v.length >= off) {\r\n off = i;\r\n return mapper(Number(v), inc, index);\r\n }\r\n\r\n index++;\r\n return v;\r\n });\r\n\r\n el.focus();\r\n el.setSelectionRange(off, off);\r\n\r\n // Prevent default and trigger input event\r\n e.preventDefault();\r\n el.dispatchEvent(new Event('input'));\r\n }\r\n\r\n // Bind events\r\n on(el, 'focus', () => on(window, 'wheel', handleScroll, {passive: false}));\r\n on(el, 'blur', () => off(window, 'wheel', handleScroll));\r\n}\r\n","// Shorthands\nconst {min, max, floor, round} = Math;\n\n/**\n * Tries to convert a color name to rgb/a hex representation\n * @param name\n * @returns {string | CanvasGradient | CanvasPattern}\n */\nfunction standardizeColor(name) {\n const ctx = document.createElement('canvas').getContext('2d');\n ctx.fillStyle = name;\n return ctx.fillStyle;\n}\n\n/**\n * Convert HSV spectrum to RGB.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @returns {number[]} Array with rgb values.\n */\nexport function hsvToRgb(h, s, v) {\n h = (h / 360) * 6;\n s /= 100;\n v /= 100;\n\n let i = floor(h);\n\n let f = h - i;\n let p = v * (1 - s);\n let q = v * (1 - f * s);\n let t = v * (1 - (1 - f) * s);\n\n let mod = i % 6;\n let r = [v, q, p, p, t, v][mod];\n let g = [t, v, v, q, p, p][mod];\n let b = [p, p, t, v, v, q][mod];\n\n return [\n r * 255,\n g * 255,\n b * 255\n ];\n}\n\n/**\n * Convert HSV spectrum to Hex.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @returns {string[]} Hex values\n */\nexport function hsvToHex(h, s, v) {\n return hsvToRgb(h, s, v).map(v =>\n round(v).toString(16).padStart(2, '0')\n );\n}\n\n/**\n * Convert HSV spectrum to CMYK.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @returns {number[]} CMYK values\n */\nexport function hsvToCmyk(h, s, v) {\n const rgb = hsvToRgb(h, s, v);\n const r = rgb[0] / 255;\n const g = rgb[1] / 255;\n const b = rgb[2] / 255;\n\n let k, c, m, y;\n\n k = min(1 - r, 1 - g, 1 - b);\n\n c = k === 1 ? 0 : (1 - r - k) / (1 - k);\n m = k === 1 ? 0 : (1 - g - k) / (1 - k);\n y = k === 1 ? 0 : (1 - b - k) / (1 - k);\n\n return [\n c * 100,\n m * 100,\n y * 100,\n k * 100\n ];\n}\n\n/**\n * Convert HSV spectrum to HSL.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @returns {number[]} HSL values\n */\nexport function hsvToHsl(h, s, v) {\n s /= 100, v /= 100;\n\n let l = (2 - s) * v / 2;\n\n if (l !== 0) {\n if (l === 1) {\n s = 0;\n } else if (l < 0.5) {\n s = s * v / (l * 2);\n } else {\n s = s * v / (2 - l * 2);\n }\n }\n\n return [\n h,\n s * 100,\n l * 100\n ];\n}\n\n/**\n * Convert RGB to HSV.\n * @param r Red\n * @param g Green\n * @param b Blue\n * @return {number[]} HSV values.\n */\nfunction rgbToHsv(r, g, b) {\n r /= 255, g /= 255, b /= 255;\n\n let h, s, v;\n const minVal = min(r, g, b);\n const maxVal = max(r, g, b);\n const delta = maxVal - minVal;\n\n v = maxVal;\n if (delta === 0) {\n h = s = 0;\n } else {\n s = delta / maxVal;\n let dr = (((maxVal - r) / 6) + (delta / 2)) / delta;\n let dg = (((maxVal - g) / 6) + (delta / 2)) / delta;\n let db = (((maxVal - b) / 6) + (delta / 2)) / delta;\n\n if (r === maxVal) {\n h = db - dg;\n } else if (g === maxVal) {\n h = (1 / 3) + dr - db;\n } else if (b === maxVal) {\n h = (2 / 3) + dg - dr;\n }\n\n if (h < 0) {\n h += 1;\n } else if (h > 1) {\n h -= 1;\n }\n }\n\n return [\n h * 360,\n s * 100,\n v * 100\n ];\n}\n\n/**\n * Convert CMYK to HSV.\n * @param c Cyan\n * @param m Magenta\n * @param y Yellow\n * @param k Key (Black)\n * @return {number[]} HSV values.\n */\nfunction cmykToHsv(c, m, y, k) {\n c /= 100;\n m /= 100;\n y /= 100;\n k /= 100;\n\n const r = (1 - min(1, c * (1 - k) + k)) * 255;\n const g = (1 - min(1, m * (1 - k) + k)) * 255;\n const b = (1 - min(1, y * (1 - k) + k)) * 255;\n\n return [...rgbToHsv(r, g, b)];\n}\n\n/**\n * Convert HSL to HSV.\n * @param h Hue\n * @param s Saturation\n * @param l Lightness\n * @return {number[]} HSV values.\n */\nfunction hslToHsv(h, s, l) {\n s /= 100;\n l /= 100;\n s *= l < 0.5 ? l : 1 - l;\n\n let ns = (2 * s / (l + s)) * 100;\n let v = (l + s) * 100;\n return [h, ns, v];\n}\n\n/**\n * Convert HEX to HSV.\n * @param hex Hexadecimal string of rgb colors, can have length 3 or 6.\n * @return {number[]} HSV values.\n */\nfunction hexToHsv(hex) {\n return rgbToHsv(...hex.match(/.{2}/g).map(v => parseInt(v, 16)));\n}\n\n/**\n * Try's to parse a string which represents a color to a HSV array.\n * Current supported types are cmyk, rgba, hsla and hexadecimal.\n * @param str\n * @return {*}\n */\nexport function parseToHSV(str) {\n\n // Check if string is a color-name\n str = str.match(/^[a-zA-Z]+$/) ? standardizeColor(str) : str;\n\n // Regular expressions to match different types of color represention\n const regex = {\n cmyk: /^cmyk[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)/i,\n rgba: /^(rgb|rgba)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\n hsla: /^(hsl|hsla)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\n hsva: /^(hsv|hsva)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\n hex: /^#?(([\\dA-Fa-f]{3,4})|([\\dA-Fa-f]{6})|([\\dA-Fa-f]{8}))$/i\n };\n\n /**\n * Takes an Array of any type, convert strings which represents\n * a number to a number an anything else to undefined.\n * @param array\n * @return {*}\n */\n const numarize = array => array.map(Number);\n\n let match;\n invalid: for (const type in regex) {\n\n // Check if current scheme passed\n if (!(match = regex[type].exec(str)))\n continue;\n\n // Try to convert\n switch (type) {\n case 'cmyk': {\n let [, c, m, y, k] = numarize(match);\n\n if (c > 100 || m > 100 || y > 100 || k > 100)\n break invalid;\n\n return {values: [...cmykToHsv(c, m, y, k), 1], type};\n }\n case 'rgba': {\n let [, , r, g, b, a = 1] = numarize(match);\n\n if (r > 255 || g > 255 || b > 255 || a < 0 || a > 1)\n break invalid;\n\n return {values: [...rgbToHsv(r, g, b), a], type};\n }\n case 'hex': {\n let [, hex] = match;\n\n if (hex.length === 4 || hex.length === 3) {\n hex = hex.split('').map(v => v + v).join('');\n }\n\n if (hex.length === 6) {\n hex += 'ff';\n }\n\n let [raw, alpha] = [hex.substring(0, 6), hex.substring(6)];\n\n // Convert 0 - 255 to 0 - 1 for opacity\n alpha = parseInt(alpha, 16) / 255;\n return {values: [...hexToHsv(raw), alpha], type};\n }\n case 'hsla': {\n let [, , h, s, l, a = 1] = numarize(match);\n\n if (h > 360 || s > 100 || l > 100 || a < 0 || a > 1)\n break invalid;\n\n return {values: [...hslToHsv(h, s, l), a], type};\n }\n case 'hsva': {\n let [, , h, s, v, a = 1] = numarize(match);\n\n if (h > 360 || s > 100 || v > 100 || a < 0 || a > 1)\n break invalid;\n\n return {values: [h, s, v, a], type};\n }\n }\n }\n\n return {values: null, type: null};\n}\n","import {hsvToHsl, hsvToRgb, hsvToCmyk, hsvToHex} from './color';\n\n/**\n * Simple class which holds the properties\n * of the color represention model hsla (hue saturation lightness alpha)\n */\nexport function HSVaColor(h = 0, s = 0, v = 0, a = 1) {\n\n const that = {\n h, s, v, a,\n\n toHSVA() {\n const hsva = [that.h, that.s, that.v, that.a];\n hsva.toString = () => `hsva(${that.h}, ${that.s}%, ${that.v}%, ${that.a})`;\n return hsva;\n },\n\n toHSLA() {\n const hsla = [...hsvToHsl(that.h, that.s, that.v), that.a];\n hsla.toString = () => `hsla(${hsla[0]}, ${hsla[1]}%, ${hsla[2]}%, ${hsla[3].toFixed(1)})`;\n return hsla;\n },\n\n toRGBA() {\n const rgba = [...hsvToRgb(that.h, that.s, that.v), that.a];\n rgba.toString = () => `rgba(${rgba[0]}, ${rgba[1]}, ${rgba[2]}, ${rgba[3].toFixed(1)})`;\n return rgba;\n },\n\n toCMYK() {\n const cmyk = hsvToCmyk(that.h, that.s, that.v);\n cmyk.toString = () => `cmyk(${cmyk[0]}%, ${cmyk[1]}%, ${cmyk[2]}%, ${cmyk[3]}%)`;\n return cmyk;\n },\n\n toHEXA() {\n const hex = hsvToHex(that.h, that.s, that.v);\n\n // Check if alpha channel make sense, convert it to 255 number space, convert\n // to hex and pad it with zeros if needet.\n const alpha = that.a >= 1 ? '' : Number((that.a * 255).toFixed(0))\n .toString(16)\n .toUpperCase().padStart(2, '0');\n\n alpha && hex.push(alpha);\n hex.toString = () => `#${hex.join('').toUpperCase()}`;\n return hex;\n },\n\n clone: () => HSVaColor(that.h, that.s, that.v, that.a)\n };\n\n return that;\n}\n","import * as _ from '../utils/utils';\r\n\r\nconst clamp = v => Math.max(Math.min(v, 1), 0);\r\nexport default function Moveable(opt) {\r\n\r\n const that = {\r\n\r\n // Assign default values\r\n options: Object.assign({\r\n lock: null,\r\n onchange: () => 0\r\n }, opt),\r\n\r\n _tapstart(evt) {\r\n _.on(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.on(document, ['mousemove', 'touchmove'], that._tapmove);\r\n\r\n // Prevent default touch event\r\n evt.preventDefault();\r\n\r\n // Trigger\r\n that._tapmove(evt);\r\n },\r\n\r\n _tapmove(evt) {\r\n const {options: {lock}, cache} = that;\r\n const {element, wrapper} = options;\r\n const b = wrapper.getBoundingClientRect();\r\n\r\n let x = 0, y = 0;\r\n if (evt) {\r\n const touch = evt && evt.touches && evt.touches[0];\r\n x = evt ? (touch || evt).clientX : 0;\r\n y = evt ? (touch || evt).clientY : 0;\r\n\r\n // Reset to bounds\r\n if (x < b.left) x = b.left;\r\n else if (x > b.left + b.width) x = b.left + b.width;\r\n if (y < b.top) y = b.top;\r\n else if (y > b.top + b.height) y = b.top + b.height;\r\n\r\n // Normalize\r\n x -= b.left;\r\n y -= b.top;\r\n } else if (cache) {\r\n x = cache.x * b.width;\r\n y = cache.y * b.height;\r\n }\r\n\r\n if (lock !== 'h') {\r\n element.style.left = `calc(${x / b.width * 100}% - ${element.offsetWidth / 2}px)`;\r\n }\r\n\r\n if (lock !== 'v') {\r\n element.style.top = `calc(${y / b.height * 100}% - ${element.offsetHeight / 2}px)`;\r\n }\r\n\r\n that.cache = {x: x / b.width, y: y / b.height};\r\n const cx = clamp(x / wrapper.offsetWidth);\r\n const cy = clamp(y / wrapper.offsetHeight);\r\n\r\n switch (lock) {\r\n case 'v':\r\n return options.onchange(cx);\r\n case 'h':\r\n return options.onchange(cy);\r\n default:\r\n return options.onchange(cx, cy);\r\n }\r\n },\r\n\r\n _tapstop() {\r\n _.off(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.off(document, ['mousemove', 'touchmove'], that._tapmove);\r\n },\r\n\r\n trigger() {\r\n that._tapmove();\r\n },\r\n\r\n update(x = 0, y = 0) {\r\n const {left, top, width, height} = that.options.wrapper.getBoundingClientRect();\r\n\r\n if (that.options.lock === 'h') {\r\n y = x;\r\n }\r\n\r\n that._tapmove({\r\n clientX: left + width * x,\r\n clientY: top + height * y\r\n });\r\n },\r\n\r\n destroy() {\r\n const {options, _tapstart} = that;\r\n _.off([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.off([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n }\r\n };\r\n\r\n // Initilize\r\n const {options, _tapstart} = that;\r\n _.on([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.on([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n\r\n return that;\r\n}\r\n","import * as _ from '../utils/utils';\r\n\r\nexport default function Selectable(opt = {}) {\r\n opt = Object.assign({\r\n onchange: () => 0,\r\n className: '',\r\n elements: []\r\n }, opt);\r\n\r\n const onTap = _.on(opt.elements, 'click', evt => {\r\n opt.elements.forEach(e =>\r\n e.classList[evt.target === e ? 'add' : 'remove'](opt.className)\r\n );\r\n\r\n opt.onchange(evt);\r\n });\r\n\r\n return {\r\n destroy: () => _.off(...onTap)\r\n };\r\n}\r\n","// Import utils\nimport * as _ from './utils/utils';\nimport {parseToHSV} from './utils/color';\n\n// Import classes\nimport {HSVaColor} from './utils/hsvacolor';\nimport Moveable from './libs/moveable';\nimport Selectable from './libs/selectable';\nimport Nanopop from './libs/nanopop';\nimport buildPickr from './template';\n\nclass Pickr {\n\n // Will be used to prevent specific actions during initilization\n _initializingActive = true;\n\n // If the current color value should be recalculated\n _recalc = true;\n\n // Current and last color for comparison\n _color = HSVaColor();\n _lastColor = HSVaColor();\n _swatchColors = [];\n\n // Evenlistener name: [callbacks]\n _eventListener = {\n 'swatchselect': [],\n 'change': [],\n 'save': [],\n 'init': []\n };\n\n constructor(opt) {\n\n // Assign default values\n this.options = opt = Object.assign({\n appClass: null,\n theme: 'classic',\n useAsButton: false,\n disabled: false,\n comparison: true,\n closeOnScroll: false,\n\n components: {\n interaction: {}\n },\n\n strings: {},\n swatches: null,\n inline: false,\n sliders: null,\n\n default: '#42445a',\n defaultRepresentation: null,\n position: 'bottom-middle',\n adjustableNumbers: true,\n showAlways: false,\n\n closeWithKey: 'Escape'\n }, opt);\n\n const {swatches, inline, components, theme, sliders} = opt;\n\n if (['nano', 'monolith'].includes(theme) && !sliders) {\n opt.sliders = 'h';\n }\n\n // Check interaction section\n if (!components.interaction) {\n components.interaction = {};\n }\n\n // Overwrite palette if preview, opacity or hue are true\n const {preview, opacity, hue, palette} = components;\n components.palette = palette || preview || opacity || hue;\n\n // Per default enabled if inline\n if (inline) {\n opt.showAlways = true;\n }\n\n // Initialize picker\n this._preBuild();\n this._buildComponents();\n this._bindEvents();\n\n // Finalize build\n this._finalBuild();\n\n // Append pre-defined swatch colors\n if (swatches && swatches.length) {\n swatches.forEach(color => this.addSwatch(color));\n }\n\n // Initialize positioning engine\n this._nanopop = Nanopop({\n reference: this._root.button,\n el: this._root.app\n });\n\n // Initilization is finish, pickr is visible and ready for usage\n const {button} = this._root;\n const that = this;\n requestAnimationFrame((function cb() {\n\n // offsetParent of body is always 0. So check if it is the body\n if (button.offsetParent === null && button !== document.body) {\n return requestAnimationFrame(cb);\n }\n\n // Apply default color\n that.setColor(opt.default);\n that._rePositioningPicker();\n\n // Initialize color representation\n if (opt.defaultRepresentation) {\n that._representation = opt.defaultRepresentation;\n that.setColorRepresentation(that._representation);\n }\n\n // Show pickr if locked\n if (opt.showAlways) {\n that.show();\n }\n\n // Initialization is done - pickr is usable, fire init event\n that._initializingActive = false;\n that._emit('init');\n }));\n }\n\n // Does only the absolutly basic thing to initialize the components\n _preBuild() {\n const opt = this.options;\n\n // Check if element is selector\n if (typeof opt.el === 'string') {\n\n // Resolve possible shadow dom access\n opt.el = opt.el.split(/>>/g).reduce((pv, cv, ci, a) => {\n pv = pv.querySelector(cv);\n return ci < a.length - 1 ? pv.shadowRoot : pv;\n }, document);\n }\n\n // Create element and append it to body to\n // prevent initialization errors\n this._root = buildPickr(opt);\n\n // Check if a custom button is used\n if (opt.useAsButton) {\n this._root.button = opt.el; // Replace button with customized button\n }\n\n document.body.appendChild(this._root.root);\n }\n\n _finalBuild() {\n const opt = this.options;\n const root = this._root;\n\n // Remove from body\n document.body.removeChild(root.root);\n\n if (opt.inline) {\n const {parentElement} = opt.el;\n\n if (parentElement.lastChild === opt.el) {\n parentElement.appendChild(root.app);\n } else {\n parentElement.insertBefore(root.app, opt.el.nextSibling);\n }\n } else {\n document.body.appendChild(root.app);\n }\n\n // Don't replace the the element if a custom button is used\n if (!opt.useAsButton) {\n\n // Replace element with actual color-picker\n opt.el.parentNode.replaceChild(root.root, opt.el);\n }\n\n // Call disable to also add the disabled class\n if (opt.disabled) {\n this.disable();\n }\n\n // Check if color comparison is disabled, if yes - remove transitions so everything keeps smoothly\n if (!opt.comparison) {\n root.button.style.transition = 'none';\n if (!opt.useAsButton) {\n root.preview.lastColor.style.transition = 'none';\n }\n }\n\n this.hide();\n }\n\n _buildComponents() {\n\n // Instance reference\n const inst = this;\n const cs = this.options.components;\n const [so, sh] = (() => {\n const {sliders} = inst.options;\n let so = 'v', sh = 'v';\n\n if (sliders && sliders.match(/^[vh]+$/g)) {\n if (sliders.length > 1) {\n [so, sh] = sliders;\n } else {\n so = sh = sliders;\n }\n }\n\n const opposite = {v: 'h', h: 'v'};\n return [opposite[so], opposite[sh]];\n })();\n\n const components = {\n\n palette: Moveable({\n element: inst._root.palette.picker,\n wrapper: inst._root.palette.palette,\n\n onchange(x, y) {\n if (!cs.palette) return;\n const {_color, _root, options} = inst;\n\n // Update the input field only if the user is currently not typing\n if (inst._recalc) {\n\n // Calculate saturation based on the position\n _color.s = x * 100;\n\n // Calculate the value\n _color.v = 100 - y * 100;\n\n // Prevent falling under zero\n _color.v < 0 ? _color.v = 0 : 0;\n inst._updateOutput();\n }\n\n // Set picker and gradient color\n const cssRGBaString = _color.toRGBA().toString();\n this.element.style.background = cssRGBaString;\n this.wrapper.style.background = `\n linear-gradient(to top, rgba(0, 0, 0, ${_color.a}), transparent),\n linear-gradient(to left, hsla(${_color.h}, 100%, 50%, ${_color.a}), rgba(255, 255, 255, ${_color.a}))\n `;\n\n // Check if color is locked\n if (!options.comparison) {\n _root.button.style.color = cssRGBaString;\n\n if (!options.useAsButton) {\n _root.preview.lastColor.style.color = cssRGBaString;\n }\n }\n\n // Change current color\n _root.preview.currentColor.style.color = cssRGBaString;\n\n if (!inst.options.comparison) {\n\n // If the user changes the color, remove the cleared icon\n _root.button.classList.remove('clear');\n }\n }\n }),\n\n hue: Moveable({\n lock: sh,\n element: inst._root.hue.picker,\n wrapper: inst._root.hue.slider,\n\n onchange(v) {\n if (!cs.hue || !cs.palette) return;\n\n // Calculate hue\n if (inst._recalc) {\n inst._color.h = v * 360;\n }\n\n // Update color\n this.element.style.backgroundColor = `hsl(${inst._color.h}, 100%, 50%)`;\n components.palette.trigger();\n }\n }),\n\n opacity: Moveable({\n lock: so,\n element: inst._root.opacity.picker,\n wrapper: inst._root.opacity.slider,\n\n onchange(v) {\n if (!cs.opacity || !cs.palette) return;\n\n // Calculate opacity\n if (inst._recalc) {\n inst._color.a = Math.round(v * 1e2) / 100;\n }\n\n // Update color\n this.element.style.background = `rgba(0, 0, 0, ${inst._color.a})`;\n components.palette.trigger();\n }\n }),\n\n selectable: Selectable({\n elements: inst._root.interaction.options,\n className: 'active',\n onchange(e) {\n inst._representation = e.target.getAttribute('data-type').toUpperCase();\n inst._updateOutput();\n }\n })\n };\n\n this._components = components;\n }\n\n _bindEvents() {\n const {_root, options} = this;\n\n const eventBindings = [\n\n // Clear color\n _.on(_root.interaction.clear, 'click', () => this._clearColor()),\n\n // Select last color on click\n _.on([\n _root.interaction.cancel,\n _root.preview.lastColor\n ], 'click', () => this.setHSVA(...this._lastColor.toHSVA())),\n\n // Save color\n _.on(_root.interaction.save, 'click', () => {\n !this.applyColor() && !options.showAlways && this.hide();\n }),\n\n // Detect user input and disable auto-recalculation\n _.on(_root.interaction.result, ['keyup', 'input'], e => {\n this._recalc = false;\n\n // Fire listener if initialization is finish and changed color was valid\n if (this.setColor(e.target.value, true) && !this._initializingActive) {\n this._emit('change', this._color);\n }\n\n e.stopImmediatePropagation();\n }),\n\n // Cancel input detection on color change\n _.on([\n _root.palette.palette,\n _root.palette.picker,\n _root.hue.slider,\n _root.hue.picker,\n _root.opacity.slider,\n _root.opacity.picker\n ], ['mousedown', 'touchstart'], () => this._recalc = true)\n ];\n\n // Provide hiding / showing abilities only if showAlways is false\n if (!options.showAlways) {\n const ck = options.closeWithKey;\n\n eventBindings.push(\n // Save and hide / show picker\n _.on(_root.button, 'click', () => this.isOpen() ? this.hide() : this.show()),\n\n // Close with escape key\n _.on(document, 'keyup', e => this.isOpen() && (e.key === ck || e.code === ck) && this.hide()),\n\n // Cancel selecting if the user taps behind the color picker\n _.on(document, ['touchstart', 'mousedown'], e => {\n if (this.isOpen() && !_.eventPath(e).some(el => el === _root.app || el === _root.button)) {\n this.hide();\n }\n }, {capture: true})\n );\n }\n\n // Make input adjustable if enabled\n if (options.adjustableNumbers) {\n const ranges = {\n rgba: [255, 255, 255, 1],\n hsva: [360, 100, 100, 1],\n hsla: [360, 100, 100, 1],\n cmyk: [100, 100, 100, 100]\n };\n\n _.adjustableInputNumbers(_root.interaction.result, (o, step, index) => {\n const range = ranges[this.getColorRepresentation().toLowerCase()];\n\n if (range) {\n const max = range[index];\n\n // Calculate next reasonable number\n const nv = o + (max >= 100 ? step * 1000 : step);\n\n // Apply range of zero up to max, fix floating-point issues\n return nv <= 0 ? 0 : Number((nv < max ? nv : max).toPrecision(3));\n } else {\n return o;\n }\n });\n }\n\n if (!options.inline) {\n let timeout = null;\n const that = this;\n\n // Re-calc position on window resize, scroll and wheel\n eventBindings.push(\n _.on(window, ['scroll', 'resize'], () => {\n if (that.isOpen()) {\n\n if (options.closeOnScroll) {\n that.hide();\n }\n\n if (timeout === null) {\n timeout = setTimeout(() => timeout = null, 100);\n\n // Update position on every frame\n requestAnimationFrame(function rs() {\n that._rePositioningPicker();\n (timeout !== null) && requestAnimationFrame(rs);\n });\n } else {\n clearTimeout(timeout);\n timeout = setTimeout(() => timeout = null, 100);\n }\n }\n }, {capture: true})\n );\n }\n\n // Save bindings\n this._eventBindings = eventBindings;\n }\n\n _rePositioningPicker() {\n const {options} = this;\n\n // No repositioning needed if inline\n if (!options.inline) {\n this._nanopop.update(options.position);\n }\n }\n\n _updateOutput() {\n\n // Check if component is present\n if (this._root.interaction.type()) {\n\n // Construct function name and call if present\n const method = `to${this._root.interaction.type().getAttribute('data-type')}`;\n this._root.interaction.result.value = typeof this._color[method] === 'function' ? this._color[method]().toString() : '';\n }\n\n // Fire listener if initialization is finish\n if (!this._initializingActive) {\n this._emit('change', this._color);\n }\n }\n\n _clearColor(silent = false) {\n const {_root, options} = this;\n\n // Change only the button color if it isn't customized\n if (!options.useAsButton) {\n _root.button.style.color = 'rgba(0, 0, 0, 0.15)';\n }\n\n _root.button.classList.add('clear');\n\n if (!options.showAlways) {\n this.hide();\n }\n\n if (!this._initializingActive && !silent) {\n\n // Fire listener\n this._emit('save', null);\n }\n }\n\n _emit(event, ...args) {\n this._eventListener[event].forEach(cb => cb(...args, this));\n }\n\n on(event, cb) {\n\n // Validate\n if (typeof cb === 'function' && typeof event === 'string' && event in this._eventListener) {\n this._eventListener[event].push(cb);\n }\n\n return this;\n }\n\n off(event, cb) {\n const callBacks = this._eventListener[event];\n\n if (callBacks) {\n const index = callBacks.indexOf(cb);\n\n if (~index) {\n callBacks.splice(index, 1);\n }\n }\n\n return this;\n }\n\n /**\n * Appends a color to the swatch palette\n * @param color\n * @returns {boolean}\n */\n addSwatch(color) {\n const {values} = parseToHSV(color);\n\n if (values) {\n const {_swatchColors, _root} = this;\n const hsvaColorObject = HSVaColor(...values);\n\n // Create new swatch HTMLElement\n const element = _.createElementFromString(\n `