\r\n\r\n ${useAsButton ? '' : '
'}\r\n\r\n
\r\n
\r\n `);\r\n\r\n const int = root.interaction;\r\n\r\n // Select option which is not hidden\r\n int.options.find(o => !o.hidden && !o.classList.add('active'));\r\n\r\n // Create method to find currenlty active option\r\n int.type = () => int.options.find(e => e.classList.contains('active'));\r\n return root;\r\n}\r\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","test","type","exec","_numarize2","_slicedToArray","values","concat","_numarize4","_numarize4$","a","splitAt","substring","alpha","_splitAt$map2","_splitAt2","_numarize6","_numarize6$","_numarize8","_numarize8$","HSVaColor","ceil","that","toHSVA","rhsva","toString","toFixed","toHSLA","hsvToHsl","rhsla","toRGBA","rrgba","toCMYK","rgb","hsvToCmyk","rcmyk","toHEXA","padStart","hsvToHex","toUpperCase","join","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","useAsButton","disabled","comparison","components","interaction","strings","swatches","inline","sliders","default","defaultRepresentation","position","adjustableNumbers","showAlways","closeWithKey","_opt","_ref","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","split","_pos$split2$","variant","isVertical","_getInfo","rb","eb","positions","variants","bevs","vars","styleprop","vertical","adder","win","v1Ok","v2Ok","margin","requestAnimationFrame","cb","offsetParent","body","setColor","_rePositioningPicker","_representation","setColorRepresentation","show","_initializingActive","_emit","hidden","int","reduce","pv","cv","ci","querySelector","shadowRoot","keys","input","clear","find","add","contains","appendChild","removeChild","lastChild","insertBefore","nextSibling","parentNode","replaceChild","disable","transition","lastColor","hide","inst","comp","so","sh","_sliders","pickr_slicedToArray","opposite","_ref2","picker","_color","cssRGBaString","background","currentColor","_recalc","_updateOutput","remove","slider","backgroundColor","selectable","_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","event","_this3","_len","args","_key","_eventListener","callBacks","indexOf","splice","_this4","Color","_swatchColors","hsvaColorObject","swatchColor","silent","_this$_root","_this5","pickr","recalc","_this$components","string","_Color$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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OAAO/C,UAAU+H,OAAO,YAC5B3H,0CAKfF,EAAMmL,MAAQjN,EAGd8B,EAAMrN,OAAS,SAAAiB,GAAO,OAAI,IAAIoM,EAAMpM,IAGpCoM,EAAMoL,QAAU,QACDpL","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\r\nconst {min, max, floor, round} = Math;\r\n\r\n/**\r\n * Tries to convert a color name to rgb/a hex representation\r\n * @param name\r\n * @returns {string | CanvasGradient | CanvasPattern}\r\n */\r\nfunction standardizeColor(name) {\r\n const ctx = document.createElement('canvas').getContext('2d');\r\n ctx.fillStyle = name;\r\n return ctx.fillStyle;\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to RGB.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} Array with rgb values.\r\n */\r\nexport function hsvToRgb(h, s, v) {\r\n h = (h / 360) * 6;\r\n s /= 100;\r\n v /= 100;\r\n\r\n let i = floor(h);\r\n\r\n let f = h - i;\r\n let p = v * (1 - s);\r\n let q = v * (1 - f * s);\r\n let t = v * (1 - (1 - f) * s);\r\n\r\n let mod = i % 6;\r\n let r = [v, q, p, p, t, v][mod];\r\n let g = [t, v, v, q, p, p][mod];\r\n let b = [p, p, t, v, v, q][mod];\r\n\r\n return [\r\n r * 255,\r\n g * 255,\r\n b * 255\r\n ];\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to Hex.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {string[]} Hex values\r\n */\r\nexport function hsvToHex(h, s, v) {\r\n return hsvToRgb(h, s, v).map(v =>\r\n round(v).toString(16).padStart(2, '0')\r\n );\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to CMYK.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} CMYK values\r\n */\r\nexport function hsvToCmyk(h, s, v) {\r\n const rgb = hsvToRgb(h, s, v);\r\n const r = rgb[0] / 255;\r\n const g = rgb[1] / 255;\r\n const b = rgb[2] / 255;\r\n\r\n let k, c, m, y;\r\n\r\n k = min(1 - r, 1 - g, 1 - b);\r\n\r\n c = k === 1 ? 0 : (1 - r - k) / (1 - k);\r\n m = k === 1 ? 0 : (1 - g - k) / (1 - k);\r\n y = k === 1 ? 0 : (1 - b - k) / (1 - k);\r\n\r\n return [\r\n c * 100,\r\n m * 100,\r\n y * 100,\r\n k * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert HSV spectrum to HSL.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param v Value\r\n * @returns {number[]} HSL values\r\n */\r\nexport function hsvToHsl(h, s, v) {\r\n s /= 100, v /= 100;\r\n\r\n let l = (2 - s) * v / 2;\r\n\r\n if (l !== 0) {\r\n if (l === 1) {\r\n s = 0;\r\n } else if (l < 0.5) {\r\n s = s * v / (l * 2);\r\n } else {\r\n s = s * v / (2 - l * 2);\r\n }\r\n }\r\n\r\n return [\r\n h,\r\n s * 100,\r\n l * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert RGB to HSV.\r\n * @param r Red\r\n * @param g Green\r\n * @param b Blue\r\n * @return {number[]} HSV values.\r\n */\r\nfunction rgbToHsv(r, g, b) {\r\n r /= 255, g /= 255, b /= 255;\r\n\r\n let h, s, v;\r\n const minVal = min(r, g, b);\r\n const maxVal = max(r, g, b);\r\n const delta = maxVal - minVal;\r\n\r\n v = maxVal;\r\n if (delta === 0) {\r\n h = s = 0;\r\n } else {\r\n s = delta / maxVal;\r\n let dr = (((maxVal - r) / 6) + (delta / 2)) / delta;\r\n let dg = (((maxVal - g) / 6) + (delta / 2)) / delta;\r\n let db = (((maxVal - b) / 6) + (delta / 2)) / delta;\r\n\r\n if (r === maxVal) {\r\n h = db - dg;\r\n } else if (g === maxVal) {\r\n h = (1 / 3) + dr - db;\r\n } else if (b === maxVal) {\r\n h = (2 / 3) + dg - dr;\r\n }\r\n\r\n if (h < 0) {\r\n h += 1;\r\n } else if (h > 1) {\r\n h -= 1;\r\n }\r\n }\r\n\r\n return [\r\n h * 360,\r\n s * 100,\r\n v * 100\r\n ];\r\n}\r\n\r\n/**\r\n * Convert CMYK to HSV.\r\n * @param c Cyan\r\n * @param m Magenta\r\n * @param y Yellow\r\n * @param k Key (Black)\r\n * @return {number[]} HSV values.\r\n */\r\nfunction cmykToHsv(c, m, y, k) {\r\n c /= 100, m /= 100, y /= 100, k /= 100;\r\n\r\n const r = (1 - min(1, c * (1 - k) + k)) * 255;\r\n const g = (1 - min(1, m * (1 - k) + k)) * 255;\r\n const b = (1 - min(1, y * (1 - k) + k)) * 255;\r\n\r\n return [...rgbToHsv(r, g, b)];\r\n}\r\n\r\n/**\r\n * Convert HSL to HSV.\r\n * @param h Hue\r\n * @param s Saturation\r\n * @param l Lightness\r\n * @return {number[]} HSV values.\r\n */\r\nfunction hslToHsv(h, s, l) {\r\n s /= 100, l /= 100;\r\n s *= l < 0.5 ? l : 1 - l;\r\n\r\n let ns = (2 * s / (l + s)) * 100;\r\n let v = (l + s) * 100;\r\n return [h, ns, v];\r\n}\r\n\r\n/**\r\n * Convert HEX to HSV.\r\n * @param hex Hexadecimal string of rgb colors, can have length 3 or 6.\r\n * @return {number[]} HSV values.\r\n */\r\nfunction hexToHsv(hex) {\r\n return rgbToHsv(...hex.match(/.{2}/g).map(v => parseInt(v, 16)));\r\n}\r\n\r\n/**\r\n * Try's to parse a string which represents a color to a HSV array.\r\n * Current supported types are cmyk, rgba, hsla and hexadecimal.\r\n * @param str\r\n * @return {*}\r\n */\r\nexport function parseToHSV(str) {\r\n\r\n // Check if string is a color-name\r\n str = str.match(/^[a-zA-Z]+$/) ? standardizeColor(str) : str;\r\n\r\n // Regular expressions to match different types of color represention\r\n const regex = {\r\n cmyk: /^cmyk[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)/i,\r\n rgba: /^(rgb|rgba)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hsla: /^(hsl|hsla)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hsva: /^(hsv|hsva)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\r\n hex: /^#?(([\\dA-Fa-f]{3,4})|([\\dA-Fa-f]{6})|([\\dA-Fa-f]{8}))$/i\r\n };\r\n\r\n /**\r\n * Takes an Array of any type, convert strings which represents\r\n * a number to a number an anything else to undefined.\r\n * @param array\r\n * @return {*}\r\n */\r\n const numarize = array => array.map(v => /^(|\\d+)\\.\\d+|\\d+$/.test(v) ? Number(v) : undefined);\r\n\r\n let match;\r\n for (const type in regex) {\r\n\r\n // Check if current scheme passed\r\n if (!(match = regex[type].exec(str)))\r\n continue;\r\n\r\n // Try to convert\r\n switch (type) {\r\n case 'cmyk': {\r\n let [, c, m, y, k] = numarize(match);\r\n\r\n if (c > 100 || m > 100 || y > 100 || k > 100)\r\n break;\r\n\r\n return {values: [...cmykToHsv(c, m, y, k), 1], type};\r\n }\r\n case 'rgba': {\r\n let [, , r, g, b, a = 1] = numarize(match);\r\n\r\n if (r > 255 || g > 255 || b > 255 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [...rgbToHsv(r, g, b), a], type};\r\n }\r\n case 'hex': {\r\n const splitAt = (s, i) => [s.substring(0, i), s.substring(i, s.length)];\r\n let [, hex] = match;\r\n\r\n // Fill up opacity if not declared\r\n if (hex.length === 3) {\r\n hex += 'F';\r\n } else if (hex.length === 6) {\r\n hex += 'FF';\r\n }\r\n\r\n let alpha;\r\n if (hex.length === 4) {\r\n [hex, alpha] = splitAt(hex, 3).map(v => v + v);\r\n } else if (hex.length === 8) {\r\n [hex, alpha] = splitAt(hex, 6);\r\n }\r\n\r\n // Convert 0 - 255 to 0 - 1 for opacity\r\n alpha = parseInt(alpha, 16) / 255;\r\n return {values: [...hexToHsv(hex), alpha], type};\r\n }\r\n case 'hsla': {\r\n let [, , h, s, l, a = 1] = numarize(match);\r\n\r\n if (h > 360 || s > 100 || l > 100 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [...hslToHsv(h, s, l), a], type};\r\n }\r\n case 'hsva': {\r\n let [, , h, s, v, a = 1] = numarize(match);\r\n\r\n if (h > 360 || s > 100 || v > 100 || a < 0 || a > 1)\r\n break;\r\n\r\n return {values: [h, s, v, a], type};\r\n }\r\n }\r\n }\r\n\r\n return {values: null, type: null};\r\n}\r\n","import {hsvToHsl, hsvToRgb, hsvToCmyk, hsvToHex} from './color';\r\n\r\n/**\r\n * Simple class which holds the properties\r\n * of the color represention model hsla (hue saturation lightness alpha)\r\n */\r\nexport function HSVaColor(h = 0, s = 0, v = 0, a = 1) {\r\n const {ceil} = Math;\r\n\r\n const that = {\r\n h, s, v, a,\r\n\r\n toHSVA() {\r\n const hsva = [that.h, that.s, that.v];\r\n const rhsva = hsva.map(ceil);\r\n\r\n hsva.push(that.a);\r\n hsva.toString = () => `hsva(${rhsva[0]}, ${rhsva[1]}%, ${rhsva[2]}%, ${that.a.toFixed(1)})`;\r\n return hsva;\r\n },\r\n\r\n toHSLA() {\r\n const hsla = hsvToHsl(that.h, that.s, that.v);\r\n const rhsla = hsla.map(ceil);\r\n\r\n hsla.push(that.a);\r\n hsla.toString = () => `hsla(${rhsla[0]}, ${rhsla[1]}%, ${rhsla[2]}%, ${that.a.toFixed(1)})`;\r\n return hsla;\r\n },\r\n\r\n toRGBA() {\r\n const rgba = hsvToRgb(that.h, that.s, that.v);\r\n const rrgba = rgba.map(ceil);\r\n\r\n rgba.push(that.a);\r\n rgba.toString = () => `rgba(${rrgba[0]}, ${rrgba[1]}, ${rrgba[2]}, ${that.a.toFixed(1)})`;\r\n return rgba;\r\n },\r\n\r\n toCMYK() {\r\n const cmyk = hsvToCmyk(that.h, that.s, that.v);\r\n const rcmyk = cmyk.map(ceil);\r\n\r\n cmyk.toString = () => `cmyk(${rcmyk[0]}%, ${rcmyk[1]}%, ${rcmyk[2]}%, ${rcmyk[3]}%)`;\r\n return cmyk;\r\n },\r\n\r\n toHEXA() {\r\n const hex = hsvToHex(that.h, that.s, that.v);\r\n\r\n hex.toString = () => {\r\n\r\n // Check if alpha channel make sense, convert it to 255 number space, convert\r\n // to hex and pad it with zeros if needet.\r\n const alpha = that.a >= 1 ? '' : Number((that.a * 255).toFixed(0))\r\n .toString(16)\r\n .toUpperCase().padStart(2, '0');\r\n\r\n return `#${hex.join('').toUpperCase() + alpha}`;\r\n };\r\n\r\n return hex;\r\n },\r\n\r\n clone() {\r\n return HSVaColor(that.h, that.s, that.v, that.a);\r\n }\r\n };\r\n\r\n return that;\r\n}\r\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 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 * as Color 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 // Replace element with color picker\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 useAsButton: false,\n disabled: false,\n comparison: true,\n\n components: {\n interaction: {}\n },\n\n strings: {},\n swatches: null,\n inline: false,\n sliders: 'v',\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} = opt;\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 comp = this.options.components;\n const [so, sh] = (() => {\n const {sliders} = inst.options;\n let so = 'v', sh = 'v';\n\n if (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 (!comp.palette) return;\n const {_color, _root, options} = inst;\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\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 // Update the input field only if the user is currently not typing\n if (inst._recalc) {\n inst._updateOutput();\n }\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 (!comp.hue || !comp.palette) return;\n\n // Calculate hue\n inst._color.h = v * 360;\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 (!comp.opacity || !comp.palette) return;\n\n // Calculate opacity\n inst._color.a = Math.round(v * 1e2) / 100;\n\n // Update color\n this.element.style.background = `rgba(0, 0, 0, ${inst._color.a})`;\n inst.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(_root.preview.lastColor, '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 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 })\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() {\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) {\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} = Color.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 `