{"version":3,"file":"pickr.min.mjs","names":["_.on","_.off","_.createFromTemplate","_","createPopper","_.resolveElement","buildPickr","_.on","_.eventPath","_.createElementFromString","_.off"],"sources":["../src/js/utils/utils.js","../src/js/utils/color.js","../src/js/utils/hsvacolor.js","../src/js/libs/moveable.js","../src/js/libs/selectable.js","../src/js/template.js","../node_modules/.pnpm/nanopop@2.4.2/node_modules/nanopop/dist/nanopop.mjs","../src/js/pickr.js"],"sourcesContent":["function eventListener(method, elements, events, fn, options = {}) {\n\n    // Normalize array\n    if (elements instanceof HTMLCollection || elements instanceof NodeList) {\n        elements = Array.from(elements);\n    } else if (!Array.isArray(elements)) {\n        elements = [elements];\n    }\n\n    if (!Array.isArray(events)) {\n        events = [events];\n    }\n\n    for (const el of elements) {\n        for (const ev of events) {\n            el[method](ev, fn, {capture: false, ...options});\n        }\n    }\n\n    return Array.prototype.slice.call(arguments, 1);\n}\n\n/**\n * Add event(s) to element(s).\n * @param elements DOM-Elements\n * @param events Event names\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const on = eventListener.bind(null, 'addEventListener');\n\n/**\n * Remove event(s) from element(s).\n * @param elements DOM-Elements\n * @param events Event names\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const off = eventListener.bind(null, 'removeEventListener');\n\n/**\n * Creates an DOM-Element out of a string (Single element).\n * @param html HTML representing a single element\n * @returns {Element | null} The element.\n */\nexport function createElementFromString(html) {\n    const div = document.createElement('div');\n    div.innerHTML = html.trim();\n    return div.firstElementChild;\n}\n\n/**\n * Creates a new html element, every element which has\n * a ':ref' attribute will be saved in a object (which will be returned)\n * where the value of ':ref' is the object-key and the value the HTMLElement.\n *\n * It's possible to create a hierarchy if you add a ':obj' attribute. Every\n * sibling will be added to the object which will get the name from the 'data-con' attribute.\n *\n * If you want to create an Array out of multiple elements, you can use the ':arr' attribute,\n * the value defines the key and all elements, which has the same parent and the same 'data-arr' attribute,\n * would be added to it.\n *\n * @param str - The HTML String.\n */\n\nexport function createFromTemplate(str) {\n\n    // Removes an attribute from a HTMLElement and returns the value.\n    const removeAttribute = (el, name) => {\n        const value = el.getAttribute(name);\n        el.removeAttribute(name);\n        return value;\n    };\n\n    // Recursive function to resolve template\n    const resolve = (element, base = {}) => {\n\n        // Check key and container attribute\n        const con = removeAttribute(element, ':obj');\n        const key = removeAttribute(element, ':ref');\n        const subtree = con ? (base[con] = {}) : base;\n\n        // Check and save element\n        key && (base[key] = element);\n        for (const child of Array.from(element.children)) {\n            const arr = removeAttribute(child, ':arr');\n            const sub = resolve(child, arr ? {} : subtree);\n\n            if (arr) {\n\n                // Check if there is already an array and add element\n                (subtree[arr] || (subtree[arr] = []))\n                    .push(Object.keys(sub).length ? sub : child);\n            }\n        }\n\n        return base;\n    };\n\n    return resolve(createElementFromString(str));\n}\n\n/**\n * Polyfill for safari & firefox for the eventPath event property.\n * @param evt The event object.\n * @return [String] event path.\n */\nexport function eventPath(evt) {\n    let path = evt.path || (evt.composedPath && evt.composedPath());\n    if (path) {\n        return path;\n    }\n\n    let el = evt.target.parentElement;\n    path = [evt.target, el];\n    while ((el = el.parentElement)) {\n        path.push(el);\n    }\n\n    path.push(document, window);\n    return path;\n}\n\n/**\n * Resolves a HTMLElement by query.\n * @param val\n * @returns {null|Document|Element}\n */\nexport function resolveElement(val) {\n    if (val instanceof Element) {\n        return val;\n    } else if (typeof val === 'string') {\n        return val.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    return null;\n}\n\n/**\n * Creates the ability to change numbers in an input field with the scroll-wheel.\n * @param el\n * @param mapper\n */\nexport function adjustableInputNumbers(el, mapper = v => v) {\n\n    function handleScroll(e) {\n        const inc = ([0.001, 0.01, 0.1])[Number(e.shiftKey || e.ctrlKey * 2)] * (e.deltaY < 0 ? 1 : -1);\n\n        let index = 0;\n        let off = el.selectionStart;\n        el.value = el.value.replace(/[\\d.]+/g, (v, i) => {\n\n            // Check if number is in cursor range and increase it\n            if (i <= off && i + v.length >= off) {\n                off = i;\n                return mapper(Number(v), inc, index);\n            }\n\n            index++;\n            return v;\n        });\n\n        el.focus();\n        el.setSelectionRange(off, off);\n\n        // Prevent default and trigger input event\n        e.preventDefault();\n        el.dispatchEvent(new Event('input'));\n    }\n\n    // Bind events\n    on(el, 'focus', () => on(window, 'wheel', handleScroll, {passive: false}));\n    on(el, 'blur', () => off(window, 'wheel', handleScroll));\n}\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\n    // Since invalid colors will be parsed as black, filter them out\n    if (name.toLowerCase() === 'black') {\n        return '#000';\n    }\n\n    const ctx = document.createElement('canvas').getContext('2d');\n    ctx.fillStyle = name;\n    return /^#0{3,6}$/.test(ctx.fillStyle) ? null : 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    const i = floor(h);\n\n    const f = h - i;\n    const p = v * (1 - s);\n    const q = v * (1 - f * s);\n    const t = v * (1 - (1 - f) * s);\n\n    const mod = i % 6;\n    const r = [v, q, p, p, t, v][mod];\n    const g = [t, v, v, q, p, p][mod];\n    const 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    const k = min(1 - r, 1 - g, 1 - b);\n    const c = k === 1 ? 0 : (1 - r - k) / (1 - k);\n    const m = k === 1 ? 0 : (1 - g - k) / (1 - k);\n    const 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;\n    v /= 100;\n\n    const 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;\n    g /= 255;\n    b /= 255;\n\n    const minVal = min(r, g, b);\n    const maxVal = max(r, g, b);\n    const delta = maxVal - minVal;\n\n    let h, s;\n    const v = maxVal;\n    if (delta === 0) {\n        h = s = 0;\n    } else {\n        s = delta / maxVal;\n        const dr = (((maxVal - r) / 6) + (delta / 2)) / delta;\n        const dg = (((maxVal - g) / 6) + (delta / 2)) / delta;\n        const 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    const ns = (2 * s / (l + s)) * 100;\n    const v = (l + s) * 100;\n    return [h, isNaN(ns) ? 0 : 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 * Tries 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 parseToHSVA(str) {\n\n    // Check if string is a color-name\n    str = str.match(/^[a-zA-Z]+$/) ? standardizeColor(str) || str : str;\n\n    // Regular expressions to match different types of color representation\n    const regex = {\n        cmyk: /^cmyk\\D+([\\d.]+)\\D+([\\d.]+)\\D+([\\d.]+)\\D+([\\d.]+)/i,\n        rgba: /^rgba?\\D+([\\d.]+)(%?)\\D+([\\d.]+)(%?)\\D+([\\d.]+)(%?)\\D*?(([\\d.]+)(%?)|$)/i,\n        hsla: /^hsla?\\D+([\\d.]+)\\D+([\\d.]+)\\D+([\\d.]+)\\D*?(([\\d.]+)(%?)|$)/i,\n        hsva: /^hsva?\\D+([\\d.]+)\\D+([\\d.]+)\\D+([\\d.]+)\\D*?(([\\d.]+)(%?)|$)/i,\n        hexa: /^#?(([\\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 numerize = array => array.map(v => /^(|\\d+)\\.\\d+|\\d+$/.test(v) ? Number(v) : undefined);\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\n        // Try to convert\n        switch (type) {\n            case 'cmyk': {\n                const [, c, m, y, k] = numerize(match);\n\n                if (c > 100 || m > 100 || y > 100 || k > 100) {\n                    break invalid;\n                }\n\n                return {values: cmykToHsv(c, m, y, k), type};\n            }\n            case 'rgba': {\n                let [, r, , g, , b, , , a] = numerize(match);\n\n                r = match[2] === '%' ? (r / 100) * 255 : r;\n                g = match[4] === '%' ? (g / 100) * 255 : g;\n                b = match[6] === '%' ? (b / 100) * 255 : b;\n                a = match[9] === '%' ? (a / 100) : a;\n\n                if (r > 255 || g > 255 || b > 255 || a < 0 || a > 1) {\n                    break invalid;\n                }\n\n                return {values: [...rgbToHsv(r, g, b), a], a, type};\n            }\n            case 'hexa': {\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                const raw = hex.substring(0, 6);\n                let a = hex.substring(6);\n\n                // Convert 0 - 255 to 0 - 1 for opacity\n                a = a ? (parseInt(a, 16) / 255) : undefined;\n\n                return {values: [...hexToHsv(raw), a], a, type};\n            }\n            case 'hsla': {\n                let [, h, s, l, , a] = numerize(match);\n                a = match[6] === '%' ? (a / 100) : a;\n\n                if (h > 360 || s > 100 || l > 100 || a < 0 || a > 1) {\n                    break invalid;\n                }\n\n                return {values: [...hslToHsv(h, s, l), a], a, type};\n            }\n            case 'hsva': {\n                let [, h, s, v, , a] = numerize(match);\n                a = match[6] === '%' ? (a / 100) : a;\n\n                if (h > 360 || s > 100 || v > 100 || a < 0 || a > 1) {\n                    break invalid;\n                }\n\n                return {values: [h, s, v, a], a, type};\n            }\n        }\n    }\n\n    return {values: null, type: null};\n}\n","import {hsvToCmyk, hsvToHex, hsvToHsl, hsvToRgb} from './color';\n\n/**\n * Simple class which holds the properties\n * of the color representation model hsla (hue saturation lightness alpha)\n */\nexport function HSVaColor(h = 0, s = 0, v = 0, a = 1) {\n    const mapper = (original, next) => (precision = -1) => {\n        return next(~precision ? original.map(v => Number(v.toFixed(precision))) : original);\n    };\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 = mapper(hsva, arr => `hsva(${arr[0]}, ${arr[1]}%, ${arr[2]}%, ${that.a})`);\n            return hsva;\n        },\n\n        toHSLA() {\n            const hsla = [...hsvToHsl(that.h, that.s, that.v), that.a];\n            hsla.toString = mapper(hsla, arr => `hsla(${arr[0]}, ${arr[1]}%, ${arr[2]}%, ${that.a})`);\n            return hsla;\n        },\n\n        toRGBA() {\n            const rgba = [...hsvToRgb(that.h, that.s, that.v), that.a];\n            rgba.toString = mapper(rgba, arr => `rgba(${arr[0]}, ${arr[1]}, ${arr[2]}, ${that.a})`);\n            return rgba;\n        },\n\n        toCMYK() {\n            const cmyk = hsvToCmyk(that.h, that.s, that.v);\n            cmyk.toString = mapper(cmyk, arr => `cmyk(${arr[0]}%, ${arr[1]}%, ${arr[2]}%, ${arr[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 needed.\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';\n\nconst clamp = v => Math.max(Math.min(v, 1), 0);\nexport default function Moveable(opt) {\n\n    const that = {\n\n        // Assign default values\n        options: Object.assign({\n            lock: null,\n            onchange: () => 0,\n            onstop: () => 0\n        }, opt),\n\n        _keyboard(e) {\n            const {options} = that;\n            const {type, key} = e;\n\n            // Check to see if the Movable is focused and then move it based on arrow key inputs\n            // For improved accessibility\n            if (document.activeElement === options.wrapper) {\n                const {lock} = that.options;\n                const up = key === 'ArrowUp';\n                const right = key === 'ArrowRight';\n                const down = key === 'ArrowDown';\n                const left = key === 'ArrowLeft';\n\n                if (type === 'keydown' && (up || right || down || left)) {\n                    let xm, ym = 0;\n\n                    if (lock === 'v') {\n                        xm = (up || right) ? 1 : -1;\n                    } else if (lock === 'h') {\n                        xm = (up || right) ? -1 : 1;\n                    } else {\n                        ym = up ? -1 : (down ? 1 : 0);\n                        xm = left ? -1 : (right ? 1 : 0);\n                    }\n\n                    that.update(\n                        clamp(that.cache.x + (0.01 * xm)),\n                        clamp(that.cache.y + (0.01 * ym))\n                    );\n                    e.preventDefault();\n                } else if (key.startsWith('Arrow')) {\n                    that.options.onstop();\n                    e.preventDefault();\n                }\n            }\n        },\n\n        _tapstart(evt) {\n            _.on(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\n            _.on(document, ['mousemove', 'touchmove'], that._tapmove);\n\n            if (evt.cancelable) {\n                evt.preventDefault();\n            }\n\n            // Trigger\n            that._tapmove(evt);\n        },\n\n        _tapmove(evt) {\n            const {options, cache} = that;\n            const {lock, element, wrapper} = options;\n            const b = wrapper.getBoundingClientRect();\n\n            let x = 0, y = 0;\n            if (evt) {\n                const touch = evt && evt.touches && evt.touches[0];\n                x = evt ? (touch || evt).clientX : 0;\n                y = evt ? (touch || evt).clientY : 0;\n\n                // Reset to bounds\n                if (x < b.left) {\n                    x = b.left;\n                } else if (x > b.left + b.width) {\n                    x = b.left + b.width;\n                }\n                if (y < b.top) {\n                    y = b.top;\n                } else if (y > b.top + b.height) {\n                    y = b.top + b.height;\n                }\n\n                // Normalize\n                x -= b.left;\n                y -= b.top;\n            } else if (cache) {\n                x = cache.x * b.width;\n                y = cache.y * b.height;\n            }\n\n            if (lock !== 'h') {\n                element.style.left = `calc(${x / b.width * 100}% - ${element.offsetWidth / 2}px)`;\n            }\n\n            if (lock !== 'v') {\n                element.style.top = `calc(${y / b.height * 100}% - ${element.offsetHeight / 2}px)`;\n            }\n\n            that.cache = {x: x / b.width, y: y / b.height};\n            const cx = clamp(x / b.width);\n            const cy = clamp(y / b.height);\n\n            switch (lock) {\n                case 'v':\n                    return options.onchange(cx);\n                case 'h':\n                    return options.onchange(cy);\n                default:\n                    return options.onchange(cx, cy);\n            }\n        },\n\n        _tapstop() {\n            that.options.onstop();\n            _.off(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\n            _.off(document, ['mousemove', 'touchmove'], that._tapmove);\n        },\n\n        trigger() {\n            that._tapmove();\n        },\n\n        update(x = 0, y = 0) {\n            const {left, top, width, height} = that.options.wrapper.getBoundingClientRect();\n\n            if (that.options.lock === 'h') {\n                y = x;\n            }\n\n            that._tapmove({\n                clientX: left + width * x,\n                clientY: top + height * y\n            });\n        },\n\n        destroy() {\n            const {options, _tapstart, _keyboard} = that;\n            _.off(document, ['keydown', 'keyup'], _keyboard);\n            _.off([options.wrapper, options.element], 'mousedown', _tapstart);\n            _.off([options.wrapper, options.element], 'touchstart', _tapstart, {\n                passive: false\n            });\n        }\n    };\n\n    // Initialize\n    const {options, _tapstart, _keyboard} = that;\n    _.on([options.wrapper, options.element], 'mousedown', _tapstart);\n    _.on([options.wrapper, options.element], 'touchstart', _tapstart, {\n        passive: false\n    });\n\n    _.on(document, ['keydown', 'keyup'], _keyboard);\n\n    return that;\n}\n","import * as _ from '../utils/utils';\n\nexport default function Selectable(opt = {}) {\n    opt = Object.assign({\n        onchange: () => 0,\n        className: '',\n        elements: []\n    }, opt);\n\n    const onTap = _.on(opt.elements, 'click', evt => {\n        opt.elements.forEach(e =>\n            e.classList[evt.target === e ? 'add' : 'remove'](opt.className)\n        );\n\n        opt.onchange(evt);\n\n        // Fix for https://github.com/Simonwep/pickr/issues/243\n        evt.stopPropagation();\n    });\n\n    return {\n        destroy: () => _.off(...onTap)\n    };\n}\n","import * as _ from './utils/utils';\n\nexport default instance => {\n\n    const {\n        components,\n        useAsButton,\n        inline,\n        appClass,\n        theme,\n        lockOpacity\n    } = instance.options;\n\n    // Utils\n    const hidden = con => con ? '' : 'style=\"display:none\" hidden';\n    const t = str => instance._t(str);\n\n    const root = _.createFromTemplate(`\n      <div :ref=\"root\" class=\"pickr\">\n\n        ${useAsButton ? '' : '<button type=\"button\" :ref=\"button\" class=\"pcr-button\"></button>'}\n\n        <div :ref=\"app\" class=\"pcr-app ${appClass || ''}\" data-theme=\"${theme}\" ${inline ? 'style=\"position: unset\"' : ''} aria-label=\"${t('ui:dialog', 'color picker dialog')}\" role=\"window\">\n          <div class=\"pcr-selection\" ${hidden(components.palette)}>\n            <div :obj=\"preview\" class=\"pcr-color-preview\" ${hidden(components.preview)}>\n              <button type=\"button\" :ref=\"lastColor\" class=\"pcr-last-color\" aria-label=\"${t('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=\"${t('aria:palette')}\" role=\"listbox\"></div>\n            </div>\n\n            <div :obj=\"hue\" class=\"pcr-color-chooser\" ${hidden(components.hue)}>\n              <div :ref=\"picker\" class=\"pcr-picker\"></div>\n              <div :ref=\"slider\" class=\"pcr-hue pcr-slider\" tabindex=\"0\" aria-label=\"${t('aria:hue')}\" role=\"slider\"></div>\n            </div>\n\n            <div :obj=\"opacity\" class=\"pcr-color-opacity\" ${hidden(components.opacity)}>\n              <div :ref=\"picker\" class=\"pcr-picker\"></div>\n              <div :ref=\"slider\" class=\"pcr-opacity pcr-slider\" tabindex=\"0\" aria-label=\"${t('aria:opacity', 'opacity selection slider')}\" role=\"slider\"></div>\n            </div>\n          </div>\n\n          <div class=\"pcr-swatches ${components.palette ? '' : 'pcr-last'}\" :ref=\"swatches\"></div>\n\n          <div :obj=\"interaction\" class=\"pcr-interaction\" ${hidden(Object.keys(components.interaction).length)}>\n            <input :ref=\"result\" class=\"pcr-result\" type=\"text\" spellcheck=\"false\" ${hidden(components.interaction.input)} aria-label=\"${t('aria:input', 'color input field')}\">\n\n            <input :arr=\"options\" class=\"pcr-type\" data-type=\"HEXA\" value=\"${lockOpacity ? 'HEX' : 'HEXA'}\" type=\"button\" ${hidden(components.interaction.hex)}>\n            <input :arr=\"options\" class=\"pcr-type\" data-type=\"RGBA\" value=\"${lockOpacity ? 'RGB' : 'RGBA'}\" type=\"button\" ${hidden(components.interaction.rgba)}>\n            <input :arr=\"options\" class=\"pcr-type\" data-type=\"HSLA\" value=\"${lockOpacity ? 'HSL' : 'HSLA'}\" type=\"button\" ${hidden(components.interaction.hsla)}>\n            <input :arr=\"options\" class=\"pcr-type\" data-type=\"HSVA\" value=\"${lockOpacity ? 'HSV' : 'HSVA'}\" type=\"button\" ${hidden(components.interaction.hsva)}>\n            <input :arr=\"options\" class=\"pcr-type\" data-type=\"CMYK\" value=\"CMYK\" type=\"button\" ${hidden(components.interaction.cmyk)}>\n\n            <input :ref=\"save\" class=\"pcr-save\" value=\"${t('btn:save')}\" type=\"button\" ${hidden(components.interaction.save)} aria-label=\"${t('aria:btn:save')}\">\n            <input :ref=\"cancel\" class=\"pcr-cancel\" value=\"${t('btn:cancel')}\" type=\"button\" ${hidden(components.interaction.cancel)} aria-label=\"${t('aria:btn:cancel')}\">\n            <input :ref=\"clear\" class=\"pcr-clear\" value=\"${t('btn:clear')}\" type=\"button\" ${hidden(components.interaction.clear)} aria-label=\"${t('aria:btn:clear')}\">\n          </div>\n        </div>\n      </div>\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    // Append method to find currently active option\n    int.type = () => int.options.find(e => e.classList.contains('active'));\n    return root;\n};\n","/*! NanoPop 2.4.2 MIT | https://github.com/Simonwep/nanopop */\nconst N = \"2.4.2\", I = {\n  variantFlipOrder: { start: \"sme\", middle: \"mse\", end: \"ems\" },\n  positionFlipOrder: { top: \"tbrl\", right: \"rltb\", bottom: \"btrl\", left: \"lrbt\" },\n  position: \"bottom\",\n  margin: 8,\n  padding: 0\n}, J = (n, i, m) => {\n  const {\n    container: r,\n    arrow: a,\n    margin: e,\n    padding: l,\n    position: V,\n    variantFlipOrder: C,\n    positionFlipOrder: M\n  } = {\n    container: document.documentElement.getBoundingClientRect(),\n    ...I,\n    ...m\n  }, { left: F, top: K } = i.style;\n  i.style.left = \"0\", i.style.top = \"0\";\n  const t = n.getBoundingClientRect(), o = i.getBoundingClientRect(), P = {\n    t: t.top - o.height - e,\n    b: t.bottom + e,\n    r: t.right + e,\n    l: t.left - o.width - e\n  }, R = {\n    vs: t.left,\n    vm: t.left + t.width / 2 - o.width / 2,\n    ve: t.left + t.width - o.width,\n    hs: t.top,\n    hm: t.bottom - t.height / 2 - o.height / 2,\n    he: t.bottom - o.height\n  }, [$, E = \"middle\"] = V.split(\"-\"), L = M[$], j = C[E], { top: y, left: x, bottom: B, right: O } = r;\n  for (const c of L) {\n    const s = c === \"t\" || c === \"b\";\n    let p = P[c];\n    const [d, g] = s ? [\"top\", \"left\"] : [\"left\", \"top\"], [u, v] = s ? [o.height, o.width] : [o.width, o.height], [z, T] = s ? [B, O] : [O, B], [H, k] = s ? [y, x] : [x, y];\n    if (!(p < H || p + u + l > z))\n      for (const b of j) {\n        let f = R[(s ? \"v\" : \"h\") + b];\n        if (!(f < k || f + v + l > T)) {\n          if (f -= o[g], p -= o[d], i.style[g] = `${f}px`, i.style[d] = `${p}px`, a) {\n            const w = s ? t.width / 2 : t.height / 2, h = v / 2, S = w > h, q = {\n              s: S ? h : w,\n              m: h,\n              e: S ? h : v - w\n            }, A = {\n              t: u,\n              b: 0,\n              r: 0,\n              l: u\n            }, D = f + q[b], G = p + A[c];\n            a.style[g] = `${D}px`, a.style[d] = `${G}px`;\n          }\n          return c + b;\n        }\n      }\n  }\n  return i.style.left = F, i.style.top = K, null;\n}, Q = (n, i, m) => {\n  const r = typeof n == \"object\" && !(n instanceof HTMLElement) ? n : { reference: n, popper: i, ...m };\n  return {\n    /**\n     * Repositions the current popper.\n     * @param options Optional options which get merged with the current ones.\n     */\n    update(a = r) {\n      const { reference: e, popper: l } = Object.assign(r, a);\n      if (!l || !e)\n        throw new Error(\"Popper- or reference-element missing.\");\n      return J(e, l, r);\n    }\n  };\n};\nexport {\n  Q as createPopper,\n  I as defaults,\n  J as reposition,\n  N as version\n};\n//# sourceMappingURL=nanopop.mjs.map\n","import * as _ from './utils/utils';\nimport {parseToHSVA} from './utils/color';\nimport {HSVaColor} from './utils/hsvacolor';\nimport Moveable from './libs/moveable';\nimport Selectable from './libs/selectable';\nimport buildPickr from './template';\nimport {createPopper} from 'nanopop';\n\nexport default class Pickr {\n\n    // Expose pickr utils\n    static utils = _;\n\n    // Assign version and export\n    static version = VERSION;\n\n    // Default strings\n    static I18N_DEFAULTS = {\n\n        // Strings visible in the UI\n        'ui:dialog': 'color picker dialog',\n        'btn:toggle': 'toggle color picker dialog',\n        'btn:swatch': 'color swatch',\n        'btn:last-color': 'use previous color',\n        'btn:save': 'Save',\n        'btn:cancel': 'Cancel',\n        'btn:clear': 'Clear',\n\n        // Strings used for aria-labels\n        'aria:btn:save': 'save and close',\n        'aria:btn:cancel': 'cancel and close',\n        'aria:btn:clear': 'clear and close',\n        'aria:input': 'color input field',\n        'aria:palette': 'color selection area',\n        'aria:hue': 'hue selection slider',\n        'aria:opacity': 'selection slider'\n    };\n\n    // Default options\n    static DEFAULT_OPTIONS = {\n        appClass: null,\n        theme: 'classic',\n        useAsButton: false,\n        padding: 8,\n        disabled: false,\n        comparison: true,\n        closeOnScroll: false,\n        outputPrecision: 0,\n        lockOpacity: false,\n        autoReposition: true,\n        container: 'body',\n\n        components: {\n            interaction: {}\n        },\n\n        i18n: {},\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    };\n\n    // Will be used to prevent specific actions during initialization\n    _initializingActive = true;\n\n    // If the current color value should be recalculated\n    _recalc = true;\n\n    // Positioning engine and DOM-Tree\n    _nanopop = null;\n    _root = null;\n\n    // Current and last color for comparison\n    _color = HSVaColor();\n    _lastColor = HSVaColor();\n    _swatchColors = [];\n\n    // Animation frame used for setup.\n    // Will be cancelled in case of destruction.\n    _setupAnimationFrame = null;\n\n    // UI Components\n    _components = null;\n\n    // Evenlistener name: [callbacks]\n    _eventBindings = [];\n    _eventListener = {\n        init: [],\n        save: [],\n        hide: [],\n        show: [],\n        clear: [],\n        change: [],\n        changestop: [],\n        cancel: [],\n        swatchselect: []\n    };\n\n    constructor(opt) {\n\n        // Assign default values\n        this.options = opt = Object.assign({...Pickr.DEFAULT_OPTIONS}, opt);\n\n        const {swatches, components, theme, sliders, lockOpacity, padding} = 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.opacity = (!lockOpacity && opacity);\n        components.palette = palette || preview || opacity || hue;\n\n        // Initialize picker\n        this._preBuild();\n        this._buildComponents();\n        this._bindEvents();\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        const {button, app} = this._root;\n        this._nanopop = createPopper(button, app, {\n            margin: padding\n        });\n\n        // Initialize accessibility\n        button.setAttribute('role', 'button');\n        button.setAttribute('aria-label', this._t('btn:toggle'));\n\n        // Initialization is finished, pickr is visible and ready for usage\n        const that = this;\n        this._setupAnimationFrame = requestAnimationFrame((function cb() {\n\n            // TODO: Performance issue due to high call-rate?\n            if (!app.offsetWidth) {\n                return requestAnimationFrame(cb);\n            }\n\n            // Apply default color, or the color set via setColor before initialization finished\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    // Create instance via method\n    static create = options => new Pickr(options);\n\n    // Does only the absolutely basic thing to initialize the components\n    _preBuild() {\n        const {options} = this;\n\n        // Resolve elements\n        for (const type of ['el', 'container']) {\n            options[type] = _.resolveElement(options[type]);\n        }\n\n        // Create element and append it to body to\n        // Prevent initialization errors\n        this._root = buildPickr(this);\n\n        // Check if a custom button is used\n        if (options.useAsButton) {\n            this._root.button = options.el; // Replace button with customized button\n        }\n\n        options.container.appendChild(this._root.root);\n    }\n\n    _finalBuild() {\n        const opt = this.options;\n        const root = this._root;\n\n        // Remove from body\n        opt.container.removeChild(root.root);\n\n        if (opt.inline) {\n            const parent = opt.el.parentElement;\n\n            if (opt.el.nextSibling) {\n                parent.insertBefore(root.app, opt.el.nextSibling);\n            } else {\n                parent.appendChild(root.app);\n            }\n        } else {\n            opt.container.appendChild(root.app);\n        }\n\n        // Don't replace 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        } else if (opt.inline) {\n            opt.el.remove();\n        }\n\n        // Check if it should be immediately disabled\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\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 sliders = (inst.options.sliders || 'v').repeat(2);\n        const [so, sh] = sliders.match(/^[vh]+$/g) ? sliders : [];\n\n        // Re-assign if null\n        const getColor = () =>\n            this._color || (this._color = this._lastColor.clone());\n\n        const components = {\n\n            palette: Moveable({\n                element: inst._root.palette.picker,\n                wrapper: inst._root.palette.palette,\n\n                onstop: () => inst._emit('changestop', 'slider', inst),\n                onchange(x, y) {\n                    if (!cs.palette) {\n                        return;\n                    }\n\n                    const color = getColor();\n                    const {_root, options} = inst;\n                    const {lastColor, currentColor} = _root.preview;\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('slider');\n                    }\n\n                    // Set picker and gradient color\n                    const cssRGBaString = color.toRGBA().toString(0);\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.setProperty('--pcr-color', cssRGBaString);\n\n                        // If the user changes the color, remove the cleared icon\n                        _root.button.classList.remove('clear');\n                    } else if (!options.useAsButton && !inst._lastColor) {\n\n                        // Apply color to both the last and current color since the current state is cleared\n                        lastColor.style.setProperty('--pcr-color', cssRGBaString);\n                    }\n\n                    // Check if there's a swatch which color matches the current one\n                    const hexa = color.toHEXA().toString();\n                    for (const {el, color} of inst._swatchColors) {\n                        el.classList[hexa === color.toHEXA().toString() ? 'add' : 'remove']('pcr-active');\n                    }\n\n                    // Change current color\n                    currentColor.style.setProperty('--pcr-color', cssRGBaString);\n                }\n            }),\n\n            hue: Moveable({\n                lock: sh === 'v' ? 'h' : 'v',\n                element: inst._root.hue.picker,\n                wrapper: inst._root.hue.slider,\n\n                onstop: () => inst._emit('changestop', 'slider', inst),\n                onchange(v) {\n                    if (!cs.hue || !cs.palette) {\n                        return;\n                    }\n\n                    const color = getColor();\n\n                    // Calculate hue\n                    if (inst._recalc) {\n                        color.h = v * 360;\n                    }\n\n                    // Update color\n                    this.element.style.backgroundColor = `hsl(${color.h}, 100%, 50%)`;\n                    components.palette.trigger();\n                }\n            }),\n\n            opacity: Moveable({\n                lock: so === 'v' ? 'h' : 'v',\n                element: inst._root.opacity.picker,\n                wrapper: inst._root.opacity.slider,\n\n                onstop: () => inst._emit('changestop', 'slider', inst),\n                onchange(v) {\n                    if (!cs.opacity || !cs.palette) {\n                        return;\n                    }\n\n                    const color = getColor();\n\n                    // Calculate opacity\n                    if (inst._recalc) {\n                        color.a = Math.round(v * 1e2) / 100;\n                    }\n\n                    // Update color\n                    this.element.style.background = `rgba(0, 0, 0, ${color.a})`;\n                    components.palette.trigger();\n                }\n            }),\n\n            selectable: Selectable({\n                elements: inst._root.interaction.options,\n                className: 'active',\n\n                onchange(e) {\n                    inst._representation = e.target.getAttribute('data-type').toUpperCase();\n                    inst._recalc && inst._updateOutput('swatch');\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', () => {\n                this.setHSVA(...(this._lastColor || this._color).toHSVA(), true);\n                this._emit('cancel');\n            }),\n\n            // Save color\n            _.on(_root.interaction.save, 'click', () => {\n                !this.applyColor() && !options.showAlways && this.hide();\n            }),\n\n            // User input\n            _.on(_root.interaction.result, ['keyup', 'input'], e => {\n\n                // Fire listener if initialization is finished and changed color was valid\n                if (this.setColor(e.target.value, true) && !this._initializingActive) {\n                    this._emit('change', this._color, 'input', this);\n                    this._emit('changestop', 'input', this);\n                }\n\n                e.stopImmediatePropagation();\n            }),\n\n            // Detect user input and disable auto-recalculation\n            _.on(_root.interaction.result, ['focus', 'blur'], e => {\n                this._recalc = e.type === 'blur';\n                this._recalc && this._updateOutput(null);\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'], () => {\n                // Using the inputs will change the value of it\n                this._root.interaction.result.blur();\n                this._recalc = true\n            }, {passive: 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\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                }\n\n                return o;\n            });\n        }\n\n        if ((options.autoReposition || options.closeOnScroll) && !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            const success = this._nanopop.update({\n                container: document.body.getBoundingClientRect(),\n                position: options.position\n            });\n\n            if (!success) {\n                const el = this._root.app;\n                const eb = el.getBoundingClientRect();\n                el.style.top = `${(window.innerHeight - eb.height) / 2}px`;\n                el.style.left = `${(window.innerWidth - eb.width) / 2}px`;\n            }\n        }\n    }\n\n    _updateOutput(eventSource) {\n        const {_root, _color, options} = this;\n\n        // Check if component is present\n        if (_root.interaction.type()) {\n\n            // Construct function name and call if present\n            const method = `to${_root.interaction.type().getAttribute('data-type')}`;\n            _root.interaction.result.value = typeof _color[method] === 'function' ?\n                _color[method]().toString(options.outputPrecision) : '';\n        }\n\n        // Fire listener if initialization is finished\n        if (!this._initializingActive && this._recalc) {\n            this._emit('change', _color, eventSource, this);\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.setProperty('--pcr-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        this._lastColor = null;\n        if (!this._initializingActive && !silent) {\n\n            // Fire listener\n            this._emit('save', null);\n            this._emit('clear');\n        }\n    }\n\n    _parseLocalColor(str) {\n        const {values, type, a} = parseToHSVA(str);\n        const {lockOpacity} = this.options;\n        const alphaMakesAChange = a !== undefined && a !== 1;\n\n        // If no opacity is applied, add undefined at the very end which gets\n        // Set to 1 in setHSVA\n        if (values && values.length === 3) {\n            values[3] = undefined;\n        }\n\n        return {\n            values: (!values || (lockOpacity && alphaMakesAChange)) ? null : values,\n            type\n        };\n    }\n\n    _t(key) {\n        return this.options.i18n[key] || Pickr.I18N_DEFAULTS[key];\n    }\n\n    _emit(event, ...args) {\n        this._eventListener[event].forEach(cb => cb(...args, this));\n    }\n\n    on(event, cb) {\n        this._eventListener[event].push(cb);\n        return this;\n    }\n\n    off(event, cb) {\n        const callBacks = (this._eventListener[event] || []);\n        const index = callBacks.indexOf(cb);\n\n        if (~index) {\n            callBacks.splice(index, 1);\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} = this._parseLocalColor(color);\n\n        if (values) {\n            const {_swatchColors, _root} = this;\n            const color = HSVaColor(...values);\n\n            // Create new swatch HTMLElement\n            const el = _.createElementFromString(\n                `<button type=\"button\" style=\"--pcr-color: ${color.toRGBA().toString(0)}\" aria-label=\"${this._t('btn:swatch')}\"/>`\n            );\n\n            // Append element and save swatch data\n            _root.swatches.appendChild(el);\n            _swatchColors.push({el, color});\n\n            // Bind event\n            this._eventBindings.push(\n                _.on(el, 'click', () => {\n                    this.setHSVA(...color.toHSVA(), true);\n                    this._emit('swatchselect', color);\n                    this._emit('change', color, 'swatch', this);\n                })\n            );\n\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Removes a swatch color by it's index\n     * @param index\n     * @returns {boolean}\n     */\n    removeSwatch(index) {\n        const swatchColor = this._swatchColors[index];\n\n        // Check swatch data\n        if (swatchColor) {\n            const {el} = swatchColor;\n\n            // Remove HTML child and swatch data\n            this._root.swatches.removeChild(el);\n            this._swatchColors.splice(index, 1);\n            return true;\n        }\n\n        return false;\n    }\n\n    applyColor(silent = false) {\n        const {preview, button} = this._root;\n\n        // Change preview and current color\n        const cssRGBaString = this._color.toRGBA().toString(0);\n        preview.lastColor.style.setProperty('--pcr-color', cssRGBaString);\n\n        // Change only the button color if it isn't customized\n        if (!this.options.useAsButton) {\n            button.style.setProperty('--pcr-color', cssRGBaString);\n        }\n\n        // User changed the color so remove the clear class\n        button.classList.remove('clear');\n\n        // Save last color\n        this._lastColor = this._color.clone();\n\n        // Fire listener\n        if (!this._initializingActive && !silent) {\n            this._emit('save', this._color);\n        }\n\n        return this;\n    }\n\n    /**\n     * Destroys all functionalities\n     */\n    destroy() {\n\n        // Cancel setup-frame if set\n        cancelAnimationFrame(this._setupAnimationFrame);\n\n        // Unbind events\n        this._eventBindings.forEach(args => _.off(...args));\n\n        // Destroy sub-components\n        if (this._components) {\n            Object.keys(this._components)\n                .forEach(key => this._components[key].destroy());\n        }\n    }\n\n    /**\n     * Destroys all functionalities and removes\n     * the pickr element.\n     */\n    destroyAndRemove() {\n        this.destroy();\n        const {root, app} = this._root;\n\n        // Remove element\n        if (root.parentElement) {\n            root.parentElement.removeChild(root);\n        }\n\n        // Remove .pcr-app\n        app.parentElement.removeChild(app);\n\n        // There are references to various DOM elements stored in the pickr instance\n        // This cleans all of them to avoid detached DOMs\n        Object.keys(this)\n            .forEach(key => this[key] = null);\n    }\n\n    /**\n     * Hides the color-picker ui.\n     */\n    hide() {\n        if (this.isOpen()) {\n            this._root.app.classList.remove('visible');\n            this._emit('hide');\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Shows the color-picker ui.\n     */\n    show() {\n        if (!this.options.disabled && !this.isOpen()) {\n            this._root.app.classList.add('visible');\n            this._rePositioningPicker();\n            this._emit('show', this._color);\n            return this;\n        }\n\n        return false;\n    }\n\n    /**\n     * @return {boolean} If the color picker is currently open\n     */\n    isOpen() {\n        return this._root.app.classList.contains('visible');\n    }\n\n    /**\n     * Set a specific color.\n     * @param h Hue\n     * @param s Saturation\n     * @param v Value\n     * @param a Alpha channel (0 - 1)\n     * @param silent If the button should not change the color\n     * @return boolean if the color has been accepted\n     */\n    setHSVA(h = 360, s = 0, v = 0, a = 1, silent = false) {\n\n        // Deactivate color calculation\n        const recalc = this._recalc; // Save state\n        this._recalc = false;\n\n        // Validate input\n        if (h < 0 || h > 360 || s < 0 || s > 100 || v < 0 || v > 100 || a < 0 || a > 1) {\n            return false;\n        }\n\n        // Override current color and re-active color calculation\n        this._color = HSVaColor(h, s, v, a);\n\n        // Update slider and palette\n        if (this._components) {\n            const {hue, opacity, palette} = this._components;\n            hue.update((h / 360));\n            opacity.update(a);\n            palette.update(s / 100, 1 - (v / 100));\n        }\n\n        // Check if call is silent\n        if (!silent) {\n            this.applyColor();\n        }\n\n        // Update output if recalculation is enabled\n        if (recalc) {\n            this._updateOutput();\n        }\n\n        // Restore old state\n        this._recalc = recalc;\n        return true;\n    }\n\n    /**\n     * Tries to parse a string which represents a color.\n     * Examples: #fff\n     *           rgb 10 10 200\n     *           hsva 10 20 5 0.5\n     * @param string\n     * @param silent\n     */\n    setColor(string, silent = false) {\n\n        // Remember colors set before initialization finished, otherwise\n        // the setup frame would override them with the default color\n        if (this._initializingActive) {\n            this.options.default = string;\n        }\n\n        // Check if null\n        if (string === null) {\n            this._clearColor(silent);\n            return true;\n        }\n\n        const {values, type} = this._parseLocalColor(string);\n\n        // Check if color is ok\n        if (values) {\n\n            // Change selected color format\n            const utype = type.toUpperCase();\n            const {options} = this._root.interaction;\n            const target = options.find(el => el.getAttribute('data-type') === utype);\n\n            // Auto select only if not hidden\n            if (target && !target.hidden) {\n                for (const el of options) {\n                    el.classList[el === target ? 'add' : 'remove']('active');\n                }\n            }\n\n            // Update color (fires 'save' event if silent is 'false')\n            if (!this.setHSVA(...values, silent)) {\n                return false;\n            }\n\n            // Update representation (fires 'change' event)\n            return this.setColorRepresentation(utype);\n        }\n\n        return false;\n    }\n\n    /**\n     * Changes the color _representation.\n     * Allowed values are HEX, RGB, HSV, HSL and CMYK\n     * @param type\n     * @returns {boolean} if the selected type was valid.\n     */\n    setColorRepresentation(type) {\n\n         // Force uppercase to allow a case-sensitive comparison\n        type = type.toUpperCase();\n\n        // Find button with given type and trigger click event\n        return !!this._root.interaction.options\n            .find(v => v.getAttribute('data-type').startsWith(type) && !v.click());\n    }\n\n    /**\n     * Returns the current color representation. See setColorRepresentation\n     * @returns {*}\n     */\n    getColorRepresentation() {\n        return this._representation;\n    }\n\n    /**\n     * @returns HSVaColor Current HSVaColor object.\n     */\n    getColor() {\n        return this._color;\n    }\n\n    /**\n     * Returns the currently selected color.\n     * @returns {{a, toHSVA, toHEXA, s, v, h, clone, toCMYK, toHSLA, toRGBA}}\n     */\n    getSelectedColor() {\n        return this._lastColor;\n    }\n\n    /**\n     * @returns The root HTMLElement with all his components.\n     */\n    getRoot() {\n        return this._root;\n    }\n\n    /**\n     * Disable pickr\n     */\n    disable() {\n        this.hide();\n        this.options.disabled = true;\n        this._root.button.classList.add('disabled');\n        return this;\n    }\n\n    /**\n     * Enable pickr\n     */\n    enable() {\n        this.options.disabled = false;\n        this._root.button.classList.remove('disabled');\n        return this;\n    }\n}\n"],"x_google_ignoreList":[6],"mappings":";;;;;;;;;;;;;;;;;AAAA,SAAS,EAAc,GAAQ,GAAU,GAAQ,GAAI,IAAU,CAAC,GAAG;CAS/D,AANI,aAAoB,kBAAkB,aAAoB,WAC1D,IAAW,MAAM,KAAK,CAAQ,IACtB,MAAM,QAAQ,CAAQ,MAC9B,IAAW,CAAC,CAAQ,IAGnB,MAAM,QAAQ,CAAM,MACrB,IAAS,CAAC,CAAM;CAGpB,KAAK,IAAM,KAAM,GACb,KAAK,IAAM,K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