pretty-color-picker 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ Saturation × value color plane with hue and alpha sliders, format tabs (Hex / R
14
14
 
15
15
  ## Install
16
16
 
17
- Published on npm as [`pretty-color-picker`](https://www.npmjs.com/package/pretty-color-picker) (v0.1.2).
17
+ Published on npm as [`pretty-color-picker`](https://www.npmjs.com/package/pretty-color-picker) (v0.1.3).
18
18
 
19
19
  ```bash
20
20
  npm install pretty-color-picker
@@ -2,8 +2,8 @@ var ii = (e) => {
2
2
  throw TypeError(e);
3
3
  };
4
4
  var Ot = (e, n, t) => n.has(e) || ii("Cannot " + t);
5
- var l = (e, n, t) => (Ot(e, n, "read from private field"), t ? t.call(e) : n.get(e)), w = (e, n, t) => n.has(e) ? ii("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, t), g = (e, n, t, i) => (Ot(e, n, "write to private field"), i ? i.call(e, t) : n.set(e, t), t), d = (e, n, t) => (Ot(e, n, "access private method"), t);
6
- const ri = '<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z" opacity="0.2"/><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"/></svg>', Qr = '<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z" opacity="0.2"/><path d="M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"/></svg>', ea = '@import"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap";:host{--pcp-width: 260px;--pcp-radius-sm: 4px;--pcp-radius: 6px;--pcp-radius-lg: 9px;--pcp-panel-padding: 9px;--pcp-section-gap: 6px;--pcp-history-cols: 8;--pcp-history-swatch-size: calc( (var(--pcp-width) - 2 * var(--pcp-panel-padding) - 7 * var(--pcp-history-gap)) / var(--pcp-history-cols) );--pcp-control-height: var(--pcp-history-swatch-size);--pcp-tab-row-height: 32px;--pcp-field-label-size: 10px;--pcp-field-label-line: 12px;--pcp-field-label-gap: 3px;--pcp-field-value-size: 11px;--pcp-field-value-line: 15px;--pcp-field-input-height: 20px;--pcp-input-panel-height: calc( var(--pcp-field-label-line) + var(--pcp-field-label-gap) + var(--pcp-field-input-height) );--pcp-input-row-padding-y: 6px;--pcp-input-row-padding-x: 7px;--pcp-alpha-col-width: 4ch;--pcp-value-col-width: minmax(0, 1fr);--pcp-swatch-code-gap: 8px;--pcp-history-gap: 6px;--pcp-checker-size: 6px;--pcp-slider-handle-height: calc(var(--pcp-control-height) * 20 / 36);--pcp-field-input-radius: var(--pcp-radius-sm);--pcp-icon-button-size: 26px;--pcp-icon-button-radius: var(--pcp-radius-sm);--pcp-title-size: 12px;--pcp-title-line: 17px;--pcp-title-weight: 600;--pcp-title-tracking: -.24px;--pcp-ease-out: cubic-bezier(.175, .885, .32, 1.1);--pcp-font: "Geist", system-ui, -apple-system, "SF Pro Display", sans-serif;--pcp-mono: "Geist Mono", ui-monospace, monospace;display:inline-block;font-family:var(--pcp-font);-webkit-font-smoothing:antialiased;color:var(--pcp-text-primary)}:host([mode="popover"]),:host([movable]){position:fixed;z-index:1000;margin:0}:host([mode="popover"]:not([open])){display:none}:host([mode="popover"]) .pcp-header,:host([movable]) .pcp-header{cursor:grab;touch-action:none}:host([mode="popover"]) .pcp-header[data-dragging=true],:host([movable]) .pcp-header[data-dragging=true]{cursor:grabbing}:host,:host([theme="dark"]){color-scheme:dark;--pcp-bg: #212121;--pcp-border: rgba(255, 255, 255, .1);--pcp-border-hover: rgba(255, 255, 255, .15);--pcp-surface: rgba(255, 255, 255, .05);--pcp-surface-hover: rgba(255, 255, 255, .1);--pcp-surface-active: rgba(255, 255, 255, .11);--pcp-tab-pill: rgba(255, 255, 255, .11);--pcp-divider: rgba(255, 255, 255, .06);--pcp-text-root: #ffffff;--pcp-text-primary: rgba(255, 255, 255, .95);--pcp-text-label: rgba(255, 255, 255, .7);--pcp-text-secondary: rgba(255, 255, 255, .6);--pcp-text-tertiary: rgba(255, 255, 255, .4);--pcp-text-focus: #ffffff;--pcp-slider-handle: rgba(255, 255, 255, .95);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #47a8ff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .35);--pcp-elevation: 0 8px 32px rgba(0, 0, 0, .5)}:host([theme="light"]){color-scheme:light;--pcp-bg: #fafafa;--pcp-border: rgba(0, 0, 0, .1);--pcp-border-hover: rgba(0, 0, 0, .15);--pcp-surface: rgba(0, 0, 0, .04);--pcp-surface-hover: rgba(0, 0, 0, .08);--pcp-surface-active: rgba(0, 0, 0, .1);--pcp-tab-pill: rgba(0, 0, 0, .1);--pcp-divider: rgba(0, 0, 0, .06);--pcp-text-root: #000000;--pcp-text-primary: rgba(0, 0, 0, .9);--pcp-text-label: rgba(0, 0, 0, .6);--pcp-text-secondary: rgba(0, 0, 0, .55);--pcp-text-tertiary: rgba(0, 0, 0, .35);--pcp-text-focus: #000000;--pcp-slider-handle: rgba(0, 0, 0, .9);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #006bff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .4);--pcp-elevation: 0 4px 20px rgba(0, 0, 0, .08)}@media(prefers-color-scheme:dark){:host([theme="system"]){color-scheme:dark;--pcp-bg: #212121;--pcp-border: rgba(255, 255, 255, .1);--pcp-border-hover: rgba(255, 255, 255, .15);--pcp-surface: rgba(255, 255, 255, .05);--pcp-surface-hover: rgba(255, 255, 255, .1);--pcp-surface-active: rgba(255, 255, 255, .11);--pcp-tab-pill: rgba(255, 255, 255, .11);--pcp-divider: rgba(255, 255, 255, .06);--pcp-text-root: #ffffff;--pcp-text-primary: rgba(255, 255, 255, .95);--pcp-text-label: rgba(255, 255, 255, .7);--pcp-text-secondary: rgba(255, 255, 255, .6);--pcp-text-tertiary: rgba(255, 255, 255, .4);--pcp-text-focus: #ffffff;--pcp-slider-handle: rgba(255, 255, 255, .95);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #47a8ff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .35);--pcp-elevation: 0 8px 32px rgba(0, 0, 0, .5)}}@media(prefers-color-scheme:light){:host([theme="system"]){color-scheme:light;--pcp-bg: #fafafa;--pcp-border: rgba(0, 0, 0, .1);--pcp-border-hover: rgba(0, 0, 0, .15);--pcp-surface: rgba(0, 0, 0, .04);--pcp-surface-hover: rgba(0, 0, 0, .08);--pcp-surface-active: rgba(0, 0, 0, .1);--pcp-tab-pill: rgba(0, 0, 0, .1);--pcp-divider: rgba(0, 0, 0, .06);--pcp-text-root: #000000;--pcp-text-primary: rgba(0, 0, 0, .9);--pcp-text-label: rgba(0, 0, 0, .6);--pcp-text-secondary: rgba(0, 0, 0, .55);--pcp-text-tertiary: rgba(0, 0, 0, .35);--pcp-text-focus: #000000;--pcp-slider-handle: rgba(0, 0, 0, .9);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #006bff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .4);--pcp-elevation: 0 4px 20px rgba(0, 0, 0, .08)}}*,*:before,*:after{box-sizing:border-box}.pcp-clip{overflow:hidden;border-radius:var(--pcp-clip-radius, var(--pcp-radius-sm))}.pcp-swatch-fill{display:block;box-sizing:border-box;width:calc(100% + 2px);height:calc(100% + 2px);margin:-1px;border-radius:inherit;background-color:var(--pcp-checker-base);background-image:linear-gradient(to right,var(--swatch-solid, #000) 50%,transparent 50%),linear-gradient(to right,transparent 50%,var(--swatch-alpha, rgba(0, 0, 0, .5)) 50%),linear-gradient(45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(-45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pcp-checker-tone) 75%),linear-gradient(-45deg,transparent 75%,var(--pcp-checker-tone) 75%);background-size:100% 100%,100% 100%,var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size);background-position:0 0,0 0,0 0,0 calc(var(--pcp-checker-size) / 2),calc(var(--pcp-checker-size) / 2) calc(var(--pcp-checker-size) / -2),calc(var(--pcp-checker-size) / -2) 0}@supports (background: -webkit-named-image(i)){.pcp-clip,.pcp-swatch-fill{clip-path:inset(0 round var(--pcp-clip-radius, var(--pcp-radius-sm)))}}.pcp{display:flex;flex-direction:column;gap:var(--pcp-section-gap);width:var(--pcp-width);background:var(--pcp-bg);border:1px solid var(--pcp-border);border-radius:var(--pcp-radius-lg);box-shadow:var(--pcp-elevation);padding:var(--pcp-panel-padding);-webkit-user-select:none;user-select:none}.pcp-header{display:flex;align-items:center;justify-content:space-between;gap:6px;padding-bottom:4px;margin-bottom:0;min-height:var(--pcp-icon-button-size);border-bottom:1px solid var(--pcp-divider)}.pcp-title[hidden]{display:none}.pcp-title{flex:1;min-width:0;font-family:var(--pcp-font);font-size:var(--pcp-title-size);font-weight:var(--pcp-title-weight);line-height:var(--pcp-title-line);letter-spacing:var(--pcp-title-tracking);color:var(--pcp-text-root);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pcp-header-btn{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--pcp-icon-button-size);height:var(--pcp-icon-button-size);padding:0;border:none;border-radius:var(--pcp-icon-button-radius);background:transparent;color:var(--pcp-text-focus);cursor:pointer;transition:background .15s var(--pcp-ease-out),color .15s var(--pcp-ease-out),transform .16s var(--pcp-ease-out)}.pcp-header-btn svg{width:13px;height:13px;flex-shrink:0}@media(hover:hover)and (pointer:fine){.pcp-header-btn:hover{background:var(--pcp-surface-hover);color:var(--pcp-text-primary)}}.pcp-header-btn:active{background:var(--pcp-surface-active);transform:scale(.97)}.pcp-header-btn:focus{outline:none}.pcp-header-btn:focus-visible{box-shadow:0 0 0 2px var(--pcp-bg),0 0 0 4px var(--pcp-focus-ring)}.pcp-plane-wrap{position:relative;width:100%;aspect-ratio:4 / 3;--pcp-clip-radius: var(--pcp-radius-sm);margin-bottom:0;cursor:crosshair;touch-action:none}.pcp-plane{display:block;width:100%;height:100%}.pcp-cursor{position:absolute;width:13px;height:13px;margin:-6.5px 0 0 -6.5px;border:2px solid var(--pcp-cursor-ring);border-radius:50%;box-shadow:0 0 0 1px var(--pcp-cursor-outline),inset 0 0 0 1px #0000001f;pointer-events:none}.pcp-cursor[data-dragging=true]{transition:none}.pcp-slider-wrapper{position:relative;height:var(--pcp-control-height);margin-bottom:0}.pcp-slider{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer;-webkit-user-select:none;user-select:none;--pcp-clip-radius: var(--pcp-radius-sm);background:transparent;touch-action:none}.pcp-slider-fill{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none}.pcp-slider-fill-hue{background:linear-gradient(to right,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.pcp-slider-fill-alpha{--pcp-alpha-gradient: linear-gradient(to right, rgba(0, 0, 0, 0), rgb(0, 0, 0));background-color:var(--pcp-checker-base);background-image:var(--pcp-alpha-gradient),linear-gradient(45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(-45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pcp-checker-tone) 75%),linear-gradient(-45deg,transparent 75%,var(--pcp-checker-tone) 75%);background-size:100% 100%,var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size);background-position:0 0,0 0,0 calc(var(--pcp-checker-size) / 2),calc(var(--pcp-checker-size) / 2) calc(var(--pcp-checker-size) / -2),calc(var(--pcp-checker-size) / -2) 0}.pcp-slider-handle{position:absolute;top:50%;left:0;z-index:1;width:3px;height:var(--pcp-slider-handle-height);border:none;outline:none;border-radius:999px;background-color:transparent;pointer-events:none;transform:translateY(-50%);opacity:.68;box-shadow:none;filter:none;transition:opacity .15s ease,background-color .12s ease,box-shadow .12s ease}.pcp-slider:hover .pcp-slider-handle,.pcp-slider[data-active=true] .pcp-slider-handle{opacity:.68}.pcp-slider-handle[data-dragging=true]{opacity:.95}.pcp-tabs{position:relative;display:flex;align-items:center;height:var(--pcp-tab-row-height);box-sizing:border-box;padding:2px;margin-bottom:0;background:transparent;border-radius:var(--pcp-radius)}.pcp-tabs-pill{position:absolute;top:2px;bottom:2px;left:0;width:0;background:var(--pcp-tab-pill);border-radius:5px;z-index:0;pointer-events:none;transition:left .2s var(--pcp-ease-out),width .2s var(--pcp-ease-out)}.pcp-tab{position:relative;z-index:1;flex:1;display:flex;align-items:center;justify-content:center;height:100%;padding:0 4px;font-family:inherit;font-size:11px;font-weight:500;line-height:1;text-align:center;background:transparent;border:none;color:var(--pcp-text-label);cursor:pointer;transition:color .15s var(--pcp-ease-out),transform .16s var(--pcp-ease-out)}.pcp-tab[data-active=true]{color:var(--pcp-text-primary)}.pcp-tab:active{transform:scale(.97)}.pcp-inputs{display:grid;width:100%;min-width:0;box-sizing:border-box;overflow:hidden;grid-template-columns:var(--pcp-input-panel-height) var(--pcp-swatch-code-gap) var(--pcp-value-col-width) var(--pcp-value-col-width) var(--pcp-value-col-width) var(--pcp-alpha-col-width);column-gap:3px;align-items:center;margin-bottom:0;padding:var(--pcp-input-row-padding-y) var(--pcp-input-row-padding-x);background:var(--pcp-surface);border-radius:var(--pcp-radius-sm)}.pcp-swatch{grid-column:1;flex-shrink:0;width:var(--pcp-input-panel-height);height:var(--pcp-input-panel-height);--pcp-clip-radius: var(--pcp-radius-sm);position:relative}.pcp-fields{grid-column:3 / 6;display:grid;min-width:0;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:3px}.pcp-fields[data-format=hex] .pcp-field-hex{grid-column:1 / -1;justify-self:center;width:fit-content;align-items:center}.pcp-fields[data-format=hex] .pcp-field-label{text-align:center;white-space:nowrap}.pcp-fields[data-format=hex] .pcp-field-input{width:8ch;min-width:8ch;padding:0 4px}.pcp-fields[data-format=rgb] .pcp-field-r{grid-column:1}.pcp-fields[data-format=rgb] .pcp-field-g{grid-column:2}.pcp-fields[data-format=rgb] .pcp-field-b{grid-column:3}.pcp-fields[data-format=hsl] .pcp-field-h{grid-column:1}.pcp-fields[data-format=hsl] .pcp-field-s{grid-column:2}.pcp-fields[data-format=hsl] .pcp-field-l{grid-column:3}.pcp-fields[data-format=oklch] .pcp-field-l{grid-column:1}.pcp-fields[data-format=oklch] .pcp-field-c{grid-column:2}.pcp-fields[data-format=oklch] .pcp-field-h{grid-column:3}.pcp-alpha-field{grid-column:6;box-sizing:border-box;width:var(--pcp-alpha-col-width);min-width:var(--pcp-alpha-col-width);max-width:var(--pcp-alpha-col-width);align-items:center}.pcp-alpha-field .pcp-field-input{width:100%;min-width:0;padding:0;box-sizing:border-box}.pcp-field{min-width:0;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:var(--pcp-field-label-gap)}.pcp-fields[data-format=oklch] .pcp-field-c .pcp-field-input{letter-spacing:-.02em;padding:0 1px}.pcp-field-label{display:block;font-size:var(--pcp-field-label-size);font-weight:500;line-height:var(--pcp-field-label-line);color:var(--pcp-text-label);margin:0;text-align:center}.pcp-fields:not([data-format=hex]) .pcp-field-label,.pcp-alpha-field .pcp-field-label{cursor:ew-resize;-webkit-user-select:none;user-select:none;touch-action:none;transition:color .15s var(--pcp-ease-out)}.pcp-field-label[data-scrubbing=true]{color:var(--pcp-text-primary)}.pcp-field-input{width:100%;min-width:0;min-height:var(--pcp-field-input-height);height:var(--pcp-field-input-height);padding:0 2px;font-family:var(--pcp-mono);font-size:var(--pcp-field-value-size);font-weight:500;line-height:var(--pcp-field-input-height);font-variant-numeric:tabular-nums;text-align:center;color:var(--pcp-text-secondary);background:transparent;border:none;border-radius:var(--pcp-field-input-radius);outline:none;box-shadow:none;transition:color .15s var(--pcp-ease-out),background .15s var(--pcp-ease-out)}@media(hover:hover)and (pointer:fine){.pcp-field-input:hover{background:var(--pcp-surface-hover)}}.pcp-field-input:focus{color:var(--pcp-text-focus);background:transparent;border-radius:var(--pcp-field-input-radius);box-shadow:none;outline:none}.pcp-field-input:active{background:var(--pcp-surface-active)}.pcp-history-section[hidden]{display:none}.pcp-history-label{font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--pcp-text-label);margin:0 0 5px}.pcp-history{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:var(--pcp-history-gap);width:100%}.pcp-history-swatch{-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block;width:100%;aspect-ratio:1;height:auto;flex-shrink:0;padding:0;border:none;background:none;--pcp-clip-radius: 4px;cursor:pointer;transition:opacity .15s var(--pcp-ease-out)}@media(hover:hover)and (pointer:fine){.pcp-history-swatch:hover{opacity:.85}}.pcp-history-swatch:active{opacity:.7}@media(prefers-reduced-motion:reduce){.pcp-header-btn,.pcp-tab,.pcp-tabs-pill,.pcp-cursor,.pcp-slider-handle,.pcp-history-swatch{transition:none}.pcp-tab:active,.pcp-header-btn:active{transform:none}}', Xi = (e, n) => {
5
+ var l = (e, n, t) => (Ot(e, n, "read from private field"), t ? t.call(e) : n.get(e)), k = (e, n, t) => n.has(e) ? ii("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(e) : n.set(e, t), g = (e, n, t, i) => (Ot(e, n, "write to private field"), i ? i.call(e, t) : n.set(e, t), t), d = (e, n, t) => (Ot(e, n, "access private method"), t);
6
+ const ri = '<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z" opacity="0.2"/><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"/></svg>', Qr = '<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z" opacity="0.2"/><path d="M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"/></svg>', ea = '@import"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap";:host{--pcp-width: 260px;--pcp-radius-sm: 4px;--pcp-radius: 6px;--pcp-radius-lg: 9px;--pcp-panel-padding: 9px;--pcp-section-gap: 6px;--pcp-history-cols: 8;--pcp-history-swatch-size: calc( (var(--pcp-width) - 2 * var(--pcp-panel-padding) - 7 * var(--pcp-history-gap)) / var(--pcp-history-cols) );--pcp-control-height: var(--pcp-history-swatch-size);--pcp-tab-row-height: 32px;--pcp-field-label-size: 11px;--pcp-field-label-line: 13.2px;--pcp-field-label-gap: 3px;--pcp-field-value-size: 11px;--pcp-field-value-line: 15px;--pcp-field-input-height: 20px;--pcp-input-panel-height: calc( var(--pcp-field-label-line) + var(--pcp-field-label-gap) + var(--pcp-field-input-height) );--pcp-input-row-padding-y: 6px;--pcp-input-row-padding-x: 7px;--pcp-alpha-col-width: 4ch;--pcp-value-col-width: minmax(0, 1fr);--pcp-swatch-code-gap: 8px;--pcp-history-gap: 6px;--pcp-checker-size: 6px;--pcp-slider-handle-height: calc(var(--pcp-control-height) * 20 / 36);--pcp-field-input-radius: var(--pcp-radius-sm);--pcp-icon-button-size: 26px;--pcp-icon-button-radius: var(--pcp-radius-sm);--pcp-kicker-size: 11px;--pcp-kicker-line: 1.2;--pcp-kicker-weight: 600;--pcp-kicker-tracking: .08em;--pcp-text-kicker: #8f8f8f;--pcp-ease-out: cubic-bezier(.175, .885, .32, 1.1);--pcp-font: "Geist", system-ui, -apple-system, "SF Pro Display", sans-serif;--pcp-mono: "Geist Mono", ui-monospace, monospace;display:inline-block;font-family:var(--pcp-font);-webkit-font-smoothing:antialiased;color:var(--pcp-text-primary)}:host([mode="popover"]),:host([movable]){position:fixed;z-index:1000;margin:0}:host([mode="popover"]:not([open])){display:none}:host([mode="popover"]) .pcp-header,:host([movable]) .pcp-header{cursor:grab;touch-action:none}:host([mode="popover"]) .pcp-header[data-dragging=true],:host([movable]) .pcp-header[data-dragging=true]{cursor:grabbing}:host,:host([theme="dark"]){color-scheme:dark;--pcp-bg: #212121;--pcp-border: rgba(255, 255, 255, .1);--pcp-border-hover: rgba(255, 255, 255, .15);--pcp-surface: rgba(255, 255, 255, .05);--pcp-surface-hover: rgba(255, 255, 255, .1);--pcp-surface-active: rgba(255, 255, 255, .11);--pcp-tab-pill: rgba(255, 255, 255, .11);--pcp-divider: rgba(255, 255, 255, .06);--pcp-text-root: #ffffff;--pcp-text-section: rgba(255, 255, 255, .7);--pcp-text-primary: rgba(255, 255, 255, .95);--pcp-text-label: rgba(255, 255, 255, .7);--pcp-text-muted: #a0a0a0;--pcp-text-secondary: rgba(255, 255, 255, .6);--pcp-text-tertiary: rgba(255, 255, 255, .4);--pcp-text-focus: #ffffff;--pcp-slider-handle: rgba(255, 255, 255, .95);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #47a8ff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .35);--pcp-elevation: 0 8px 32px rgba(0, 0, 0, .5)}:host([theme="light"]){color-scheme:light;--pcp-bg: #fafafa;--pcp-border: rgba(0, 0, 0, .1);--pcp-border-hover: rgba(0, 0, 0, .15);--pcp-surface: rgba(0, 0, 0, .04);--pcp-surface-hover: rgba(0, 0, 0, .08);--pcp-surface-active: rgba(0, 0, 0, .1);--pcp-tab-pill: rgba(0, 0, 0, .1);--pcp-divider: rgba(0, 0, 0, .06);--pcp-text-root: #000000;--pcp-text-section: rgba(0, 0, 0, .65);--pcp-text-primary: rgba(0, 0, 0, .9);--pcp-text-label: rgba(0, 0, 0, .6);--pcp-text-muted: #4d4d4d;--pcp-text-secondary: rgba(0, 0, 0, .55);--pcp-text-tertiary: rgba(0, 0, 0, .35);--pcp-text-focus: #000000;--pcp-slider-handle: rgba(0, 0, 0, .9);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #006bff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .4);--pcp-elevation: 0 4px 20px rgba(0, 0, 0, .08)}@media(prefers-color-scheme:dark){:host([theme="system"]){color-scheme:dark;--pcp-bg: #212121;--pcp-border: rgba(255, 255, 255, .1);--pcp-border-hover: rgba(255, 255, 255, .15);--pcp-surface: rgba(255, 255, 255, .05);--pcp-surface-hover: rgba(255, 255, 255, .1);--pcp-surface-active: rgba(255, 255, 255, .11);--pcp-tab-pill: rgba(255, 255, 255, .11);--pcp-divider: rgba(255, 255, 255, .06);--pcp-text-root: #ffffff;--pcp-text-section: rgba(255, 255, 255, .7);--pcp-text-primary: rgba(255, 255, 255, .95);--pcp-text-label: rgba(255, 255, 255, .7);--pcp-text-muted: #a0a0a0;--pcp-text-secondary: rgba(255, 255, 255, .6);--pcp-text-tertiary: rgba(255, 255, 255, .4);--pcp-text-focus: #ffffff;--pcp-slider-handle: rgba(255, 255, 255, .95);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #47a8ff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .35);--pcp-elevation: 0 8px 32px rgba(0, 0, 0, .5)}}@media(prefers-color-scheme:light){:host([theme="system"]){color-scheme:light;--pcp-bg: #fafafa;--pcp-border: rgba(0, 0, 0, .1);--pcp-border-hover: rgba(0, 0, 0, .15);--pcp-surface: rgba(0, 0, 0, .04);--pcp-surface-hover: rgba(0, 0, 0, .08);--pcp-surface-active: rgba(0, 0, 0, .1);--pcp-tab-pill: rgba(0, 0, 0, .1);--pcp-divider: rgba(0, 0, 0, .06);--pcp-text-root: #000000;--pcp-text-section: rgba(0, 0, 0, .65);--pcp-text-primary: rgba(0, 0, 0, .9);--pcp-text-label: rgba(0, 0, 0, .6);--pcp-text-muted: #4d4d4d;--pcp-text-secondary: rgba(0, 0, 0, .55);--pcp-text-tertiary: rgba(0, 0, 0, .35);--pcp-text-focus: #000000;--pcp-slider-handle: rgba(0, 0, 0, .9);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #006bff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .4);--pcp-elevation: 0 4px 20px rgba(0, 0, 0, .08)}}*,*:before,*:after{box-sizing:border-box}.pcp-clip{overflow:hidden;border-radius:var(--pcp-clip-radius, var(--pcp-radius-sm))}.pcp-swatch-fill{display:block;box-sizing:border-box;width:calc(100% + 2px);height:calc(100% + 2px);margin:-1px;border-radius:inherit;background-color:var(--pcp-checker-base);background-image:linear-gradient(to right,var(--swatch-solid, #000) 50%,transparent 50%),linear-gradient(to right,transparent 50%,var(--swatch-alpha, rgba(0, 0, 0, .5)) 50%),linear-gradient(45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(-45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pcp-checker-tone) 75%),linear-gradient(-45deg,transparent 75%,var(--pcp-checker-tone) 75%);background-size:100% 100%,100% 100%,var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size);background-position:0 0,0 0,0 0,0 calc(var(--pcp-checker-size) / 2),calc(var(--pcp-checker-size) / 2) calc(var(--pcp-checker-size) / -2),calc(var(--pcp-checker-size) / -2) 0}@supports (background: -webkit-named-image(i)){.pcp-clip,.pcp-swatch-fill{clip-path:inset(0 round var(--pcp-clip-radius, var(--pcp-radius-sm)))}}.pcp{display:flex;flex-direction:column;gap:var(--pcp-section-gap);width:var(--pcp-width);background:var(--pcp-bg);border:1px solid var(--pcp-border);border-radius:var(--pcp-radius-lg);box-shadow:var(--pcp-elevation);padding:var(--pcp-panel-padding);-webkit-user-select:none;user-select:none}.pcp-header{display:flex;align-items:center;justify-content:space-between;gap:6px;padding-bottom:4px;margin-bottom:0;min-height:var(--pcp-icon-button-size);border-bottom:1px solid var(--pcp-divider)}.pcp-title[hidden]{display:none}.pcp-title{flex:1;min-width:0;font-family:var(--pcp-font);font-size:var(--pcp-kicker-size);font-weight:var(--pcp-kicker-weight);line-height:var(--pcp-kicker-line);letter-spacing:var(--pcp-kicker-tracking);text-transform:uppercase;color:var(--pcp-text-kicker);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pcp-header-btn{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--pcp-icon-button-size);height:var(--pcp-icon-button-size);padding:0;border:none;border-radius:var(--pcp-icon-button-radius);background:transparent;color:var(--pcp-text-focus);cursor:pointer;transition:background .15s var(--pcp-ease-out),color .15s var(--pcp-ease-out),transform .16s var(--pcp-ease-out)}.pcp-header-btn svg{width:13px;height:13px;flex-shrink:0}@media(hover:hover)and (pointer:fine){.pcp-header-btn:hover{background:var(--pcp-surface-hover);color:var(--pcp-text-primary)}}.pcp-header-btn:active{background:var(--pcp-surface-active);transform:scale(.97)}.pcp-header-btn:focus{outline:none}.pcp-header-btn:focus-visible{box-shadow:0 0 0 2px var(--pcp-bg),0 0 0 4px var(--pcp-focus-ring)}.pcp-plane-wrap{position:relative;width:100%;aspect-ratio:4 / 3;--pcp-clip-radius: var(--pcp-radius-sm);margin-bottom:0;cursor:crosshair;touch-action:none}.pcp-plane{display:block;width:100%;height:100%}.pcp-cursor{position:absolute;width:13px;height:13px;margin:-6.5px 0 0 -6.5px;border:2px solid var(--pcp-cursor-ring);border-radius:50%;box-shadow:0 0 0 1px var(--pcp-cursor-outline),inset 0 0 0 1px #0000001f;pointer-events:none}.pcp-cursor[data-dragging=true]{transition:none}.pcp-slider-wrapper{position:relative;height:var(--pcp-control-height);margin-bottom:0}.pcp-slider{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer;-webkit-user-select:none;user-select:none;--pcp-clip-radius: var(--pcp-radius-sm);background:transparent;touch-action:none}.pcp-slider-fill{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none}.pcp-slider-fill-hue{background:linear-gradient(to right,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.pcp-slider-fill-alpha{--pcp-alpha-gradient: linear-gradient(to right, rgba(0, 0, 0, 0), rgb(0, 0, 0));background-color:var(--pcp-checker-base);background-image:var(--pcp-alpha-gradient),linear-gradient(45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(-45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pcp-checker-tone) 75%),linear-gradient(-45deg,transparent 75%,var(--pcp-checker-tone) 75%);background-size:100% 100%,var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size);background-position:0 0,0 0,0 calc(var(--pcp-checker-size) / 2),calc(var(--pcp-checker-size) / 2) calc(var(--pcp-checker-size) / -2),calc(var(--pcp-checker-size) / -2) 0}.pcp-slider-handle{position:absolute;top:50%;left:0;z-index:1;width:3px;height:var(--pcp-slider-handle-height);border:none;outline:none;border-radius:999px;background-color:transparent;pointer-events:none;transform:translateY(-50%);opacity:.68;box-shadow:none;filter:none;transition:opacity .15s ease,background-color .12s ease,box-shadow .12s ease}.pcp-slider:hover .pcp-slider-handle,.pcp-slider[data-active=true] .pcp-slider-handle{opacity:.68}.pcp-slider-handle[data-dragging=true]{opacity:.95}.pcp-tabs{position:relative;display:flex;align-items:center;height:var(--pcp-tab-row-height);box-sizing:border-box;padding:2px;margin-bottom:0;background:transparent;border-radius:var(--pcp-radius)}.pcp-tabs-pill{position:absolute;top:2px;bottom:2px;left:0;width:0;background:var(--pcp-tab-pill);border-radius:5px;z-index:0;pointer-events:none;transition:left .2s var(--pcp-ease-out),width .2s var(--pcp-ease-out)}.pcp-tab{position:relative;z-index:1;flex:1;display:flex;align-items:center;justify-content:center;height:100%;padding:0 4px;font-family:inherit;font-size:11px;font-weight:500;line-height:1;text-align:center;background:transparent;border:none;color:var(--pcp-text-label);cursor:pointer;transition:color .15s var(--pcp-ease-out),transform .16s var(--pcp-ease-out)}.pcp-tab[data-active=true]{color:var(--pcp-text-primary)}.pcp-tab:active{transform:scale(.97)}.pcp-inputs{display:grid;width:100%;min-width:0;box-sizing:border-box;overflow:hidden;grid-template-columns:var(--pcp-input-panel-height) var(--pcp-swatch-code-gap) var(--pcp-value-col-width) var(--pcp-value-col-width) var(--pcp-value-col-width) var(--pcp-alpha-col-width);column-gap:3px;align-items:center;margin-bottom:0;padding:var(--pcp-input-row-padding-y) var(--pcp-input-row-padding-x);background:var(--pcp-surface);border-radius:var(--pcp-radius-sm)}.pcp-swatch{grid-column:1;flex-shrink:0;width:var(--pcp-input-panel-height);height:var(--pcp-input-panel-height);--pcp-clip-radius: var(--pcp-radius-sm);position:relative}.pcp-fields{grid-column:3 / 6;display:grid;min-width:0;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:3px}.pcp-fields[data-format=hex] .pcp-field-hex{grid-column:1 / -1;justify-self:center;width:fit-content;align-items:center}.pcp-fields[data-format=hex] .pcp-field-label{text-align:center;white-space:nowrap}.pcp-fields[data-format=hex] .pcp-field-input{width:8ch;min-width:8ch;padding:0 4px}.pcp-fields[data-format=rgb] .pcp-field-r{grid-column:1}.pcp-fields[data-format=rgb] .pcp-field-g{grid-column:2}.pcp-fields[data-format=rgb] .pcp-field-b{grid-column:3}.pcp-fields[data-format=hsl] .pcp-field-h{grid-column:1}.pcp-fields[data-format=hsl] .pcp-field-s{grid-column:2}.pcp-fields[data-format=hsl] .pcp-field-l{grid-column:3}.pcp-fields[data-format=oklch] .pcp-field-l{grid-column:1}.pcp-fields[data-format=oklch] .pcp-field-c{grid-column:2}.pcp-fields[data-format=oklch] .pcp-field-h{grid-column:3}.pcp-alpha-field{grid-column:6;box-sizing:border-box;width:var(--pcp-alpha-col-width);min-width:var(--pcp-alpha-col-width);max-width:var(--pcp-alpha-col-width);align-items:center}.pcp-alpha-field .pcp-field-input{width:100%;min-width:0;padding:0;box-sizing:border-box}.pcp-field{min-width:0;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:var(--pcp-field-label-gap)}.pcp-fields[data-format=oklch] .pcp-field-c .pcp-field-input{letter-spacing:-.02em;padding:0 1px}.pcp-field-label{display:block;font-size:var(--pcp-kicker-size);font-weight:var(--pcp-kicker-weight);line-height:var(--pcp-kicker-line);letter-spacing:var(--pcp-kicker-tracking);text-transform:uppercase;color:var(--pcp-text-kicker);margin:0;text-align:center}.pcp-fields:not([data-format=hex]) .pcp-field-label,.pcp-alpha-field .pcp-field-label{cursor:ew-resize;-webkit-user-select:none;user-select:none;touch-action:none;transition:color .15s var(--pcp-ease-out)}.pcp-field-label[data-scrubbing=true]{color:var(--pcp-text-muted)}.pcp-field-input{width:100%;min-width:0;min-height:var(--pcp-field-input-height);height:var(--pcp-field-input-height);padding:0 2px;font-family:var(--pcp-mono);font-size:var(--pcp-field-value-size);font-weight:500;line-height:var(--pcp-field-input-height);font-variant-numeric:tabular-nums;text-align:center;color:var(--pcp-text-secondary);background:transparent;border:none;border-radius:var(--pcp-field-input-radius);outline:none;box-shadow:none;transition:color .15s var(--pcp-ease-out),background .15s var(--pcp-ease-out)}@media(hover:hover)and (pointer:fine){.pcp-field-input:hover{background:var(--pcp-surface-hover)}}.pcp-field-input:focus{color:var(--pcp-text-focus);background:transparent;border-radius:var(--pcp-field-input-radius);box-shadow:none;outline:none}.pcp-field-input:active{background:var(--pcp-surface-active)}.pcp-history-section[hidden]{display:none}.pcp-history-label{font-size:var(--pcp-kicker-size);font-weight:var(--pcp-kicker-weight);line-height:var(--pcp-kicker-line);letter-spacing:var(--pcp-kicker-tracking);text-transform:uppercase;color:var(--pcp-text-kicker);margin:0 0 5px}.pcp-history{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:var(--pcp-history-gap);width:100%}.pcp-history-swatch{-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block;width:100%;aspect-ratio:1;height:auto;flex-shrink:0;padding:0;border:none;background:none;--pcp-clip-radius: 4px;cursor:pointer;transition:opacity .15s var(--pcp-ease-out)}@media(hover:hover)and (pointer:fine){.pcp-history-swatch:hover{opacity:.85}}.pcp-history-swatch:active{opacity:.7}@media(prefers-reduced-motion:reduce){.pcp-header-btn,.pcp-tab,.pcp-tabs-pill,.pcp-cursor,.pcp-slider-handle,.pcp-history-swatch{transition:none}.pcp-tab:active,.pcp-header-btn:active{transform:none}}', Xi = (e, n) => {
7
7
  if (typeof e == "number") {
8
8
  if (n === 3)
9
9
  return {
@@ -226,7 +226,7 @@ const ri = '<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><p
226
226
  )
227
227
  )
228
228
  )
229
- ) : void 0, Y = {}, Di = {}, ut = [], Oi = {}, ca = (e) => e, k = (e) => (Y[e.mode] = {
229
+ ) : void 0, Y = {}, Di = {}, ut = [], Oi = {}, ca = (e) => e, w = (e) => (Y[e.mode] = {
230
230
  ...Y[e.mode],
231
231
  ...e.toMode
232
232
  }, Object.keys(e.fromMode || {}).forEach((n) => {
@@ -239,7 +239,7 @@ const ri = '<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><p
239
239
  }), e.interpolate[n].fixup || (e.interpolate[n].fixup = ca);
240
240
  }), Di[e.mode] = e, (e.parse || []).forEach((n) => {
241
241
  da(n, e.mode);
242
- }), X(e.mode)), wt = (e) => Di[e], da = (e, n) => {
242
+ }), X(e.mode)), kt = (e) => Di[e], da = (e, n) => {
243
243
  if (typeof e == "string") {
244
244
  if (!n)
245
245
  throw new Error("'mode' required when 'parser' is a string");
@@ -386,7 +386,7 @@ function ba(e) {
386
386
  const i = { mode: t }, r = ji(e, !1);
387
387
  if (!r)
388
388
  return;
389
- const a = wt(t).channels;
389
+ const a = kt(t).channels;
390
390
  for (let s = 0, c, p; s < a.length; s++)
391
391
  c = r[s], p = a[s], c.type !== h.None && (i[p] = c.type === h.Number ? c.value : c.value / 100, p === "alpha" && (i[p] = Math.max(0, Math.min(1, i[p]))));
392
392
  return i;
@@ -545,7 +545,7 @@ const va = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
545
545
  b: e * 0.0556300796969936 - n * 0.2039769588889765 + 1.0569715142428784 * t
546
546
  });
547
547
  return i !== void 0 && (r.alpha = i), r;
548
- }, wa = {
548
+ }, ka = {
549
549
  ...Ce,
550
550
  mode: "a98",
551
551
  parse: ["a98-rgb"],
@@ -558,12 +558,12 @@ const va = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
558
558
  rgb: (e) => ye(ai(e)),
559
559
  xyz65: ai
560
560
  }
561
- }, H = (e) => (e = e % 360) < 0 ? e + 360 : e, ka = (e, n) => e.map((t, i, r) => {
561
+ }, H = (e) => (e = e % 360) < 0 ? e + 360 : e, wa = (e, n) => e.map((t, i, r) => {
562
562
  if (t === void 0)
563
563
  return t;
564
564
  let a = H(t);
565
565
  return i === 0 || e[i - 1] === void 0 ? a : n(a - H(r[i - 1]));
566
- }).reduce((t, i) => !t.length || i === void 0 || t[t.length - 1] === void 0 ? (t.push(i), t) : (t.push(i + t[t.length - 1]), t), []), re = (e) => ka(e, (n) => Math.abs(n) <= 180 ? n : n - 360 * Math.sign(n)), P = [-0.14861, 1.78277, -0.29227, -0.90649, 1.97294, 0], $a = Math.PI / 180, za = 180 / Math.PI;
566
+ }).reduce((t, i) => !t.length || i === void 0 || t[t.length - 1] === void 0 ? (t.push(i), t) : (t.push(i + t[t.length - 1]), t), []), re = (e) => wa(e, (n) => Math.abs(n) <= 180 ? n : n - 360 * Math.sign(n)), P = [-0.14861, 1.78277, -0.29227, -0.90649, 1.97294, 0], $a = Math.PI / 180, za = 180 / Math.PI;
567
567
  let oi = P[3] * P[4], li = P[1] * P[4], ci = P[1] * P[2] - P[0] * P[3];
568
568
  const Aa = ({ r: e, g: n, b: t, alpha: i }) => {
569
569
  e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
@@ -578,7 +578,7 @@ const Aa = ({ r: e, g: n, b: t, alpha: i }) => {
578
578
  e = (e === void 0 ? 0 : e + 120) * $a, t === void 0 && (t = 0);
579
579
  let a = n === void 0 ? 0 : n * t * (1 - t), s = Math.cos(e), c = Math.sin(e);
580
580
  return r.r = t + a * (P[0] * s + P[1] * c), r.g = t + a * (P[2] * s + P[3] * c), r.b = t + a * (P[4] * s + P[5] * c), i !== void 0 && (r.alpha = i), r;
581
- }, kt = (e, n) => {
581
+ }, wt = (e, n) => {
582
582
  if (e.h === void 0 || n.h === void 0 || !e.s || !n.s)
583
583
  return 0;
584
584
  let t = H(e.h), i = H(n.h), r = Math.sin((i - t + 360) / 2 * Math.PI / 180);
@@ -634,7 +634,7 @@ const Aa = ({ r: e, g: n, b: t, alpha: i }) => {
634
634
  }
635
635
  },
636
636
  difference: {
637
- h: kt
637
+ h: wt
638
638
  },
639
639
  average: {
640
640
  h: ae
@@ -846,7 +846,7 @@ const Ha = {
846
846
  alpha: { use: u, fixup: T }
847
847
  },
848
848
  difference: {
849
- h: kt
849
+ h: wt
850
850
  },
851
851
  average: {
852
852
  h: ae
@@ -956,7 +956,7 @@ const Ui = {
956
956
  alpha: { use: u, fixup: T }
957
957
  },
958
958
  difference: {
959
- h: kt
959
+ h: wt
960
960
  },
961
961
  average: {
962
962
  h: ae
@@ -1020,7 +1020,7 @@ const er = {
1020
1020
  alpha: { use: u, fixup: T }
1021
1021
  },
1022
1022
  difference: {
1023
- h: kt
1023
+ h: wt
1024
1024
  },
1025
1025
  average: {
1026
1026
  h: ae
@@ -1457,7 +1457,7 @@ const Wn = {
1457
1457
  v: n ? n * Math.sin(t / 180 * Math.PI) : 0
1458
1458
  };
1459
1459
  return i !== void 0 && (r.alpha = i), r;
1460
- }, pr = (e, n, t) => 4 * e / (e + 15 * n + 3 * t), hr = (e, n, t) => 9 * n / (e + 15 * n + 3 * t), ts = pr(S.X, S.Y, S.Z), ns = hr(S.X, S.Y, S.Z), is = (e) => e <= jn ? Tt * e : 116 * Math.cbrt(e) - 16, wn = ({ x: e, y: n, z: t, alpha: i }) => {
1460
+ }, pr = (e, n, t) => 4 * e / (e + 15 * n + 3 * t), hr = (e, n, t) => 9 * n / (e + 15 * n + 3 * t), ts = pr(S.X, S.Y, S.Z), ns = hr(S.X, S.Y, S.Z), is = (e) => e <= jn ? Tt * e : 116 * Math.cbrt(e) - 16, kn = ({ x: e, y: n, z: t, alpha: i }) => {
1461
1461
  e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
1462
1462
  let r = is(n / S.Y), a = pr(e, n, t), s = hr(e, n, t);
1463
1463
  !isFinite(a) || !isFinite(s) ? r = a = s = 0 : (a = 13 * r * (a - ts), s = 13 * r * (s - ns));
@@ -1468,13 +1468,13 @@ const Wn = {
1468
1468
  v: s
1469
1469
  };
1470
1470
  return i !== void 0 && (c.alpha = i), c;
1471
- }, rs = (e, n, t) => 4 * e / (e + 15 * n + 3 * t), as = (e, n, t) => 9 * n / (e + 15 * n + 3 * t), ss = rs(S.X, S.Y, S.Z), os = as(S.X, S.Y, S.Z), kn = ({ l: e, u: n, v: t, alpha: i }) => {
1471
+ }, rs = (e, n, t) => 4 * e / (e + 15 * n + 3 * t), as = (e, n, t) => 9 * n / (e + 15 * n + 3 * t), ss = rs(S.X, S.Y, S.Z), os = as(S.X, S.Y, S.Z), wn = ({ l: e, u: n, v: t, alpha: i }) => {
1472
1472
  if (e === void 0 && (e = 0), e === 0)
1473
1473
  return { mode: "xyz50", x: 0, y: 0, z: 0 };
1474
1474
  n === void 0 && (n = 0), t === void 0 && (t = 0);
1475
1475
  let r = n / (13 * e) + ss, a = t / (13 * e) + os, s = S.Y * (e <= 8 ? e / Tt : Math.pow((e + 16) / 116, 3)), c = s * (9 * r) / (4 * a), p = s * (12 - 3 * r - 20 * a) / (4 * a), f = { mode: "xyz50", x: c, y: s, z: p };
1476
1476
  return i !== void 0 && (f.alpha = i), f;
1477
- }, ls = (e) => cr(wn(et(e))), cs = (e) => Qe(kn(dr(e))), ds = {
1477
+ }, ls = (e) => cr(kn(et(e))), cs = (e) => Qe(wn(dr(e))), ds = {
1478
1478
  mode: "lchuv",
1479
1479
  toMode: {
1480
1480
  luv: dr,
@@ -1518,12 +1518,12 @@ const Wn = {
1518
1518
  }, hs = {
1519
1519
  mode: "luv",
1520
1520
  toMode: {
1521
- xyz50: kn,
1522
- rgb: (e) => Qe(kn(e))
1521
+ xyz50: wn,
1522
+ rgb: (e) => Qe(wn(e))
1523
1523
  },
1524
1524
  fromMode: {
1525
- xyz50: wn,
1526
- rgb: (e) => wn(et(e))
1525
+ xyz50: kn,
1526
+ rgb: (e) => kn(et(e))
1527
1527
  },
1528
1528
  channels: ["l", "u", "v", "alpha"],
1529
1529
  parse: ["--luv"],
@@ -1787,7 +1787,7 @@ const ys = {
1787
1787
  z: 0 * n + 0.0451133818589026 * t + 1.043944368900976 * i
1788
1788
  };
1789
1789
  return r !== void 0 && (a.alpha = r), a;
1790
- }, wi = ({ x: e, y: n, z: t, alpha: i }) => {
1790
+ }, ki = ({ x: e, y: n, z: t, alpha: i }) => {
1791
1791
  e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
1792
1792
  let r = Pe(
1793
1793
  {
@@ -1804,8 +1804,8 @@ const ys = {
1804
1804
  parse: ["display-p3"],
1805
1805
  serialize: "display-p3",
1806
1806
  fromMode: {
1807
- rgb: (e) => wi(xe(e)),
1808
- xyz65: wi
1807
+ rgb: (e) => ki(xe(e)),
1808
+ xyz65: ki
1809
1809
  },
1810
1810
  toMode: {
1811
1811
  rgb: (e) => ye(Mi(e)),
@@ -1814,7 +1814,7 @@ const ys = {
1814
1814
  }, sn = (e) => {
1815
1815
  let n = Math.abs(e);
1816
1816
  return n >= 1 / 512 ? Math.sign(e) * Math.pow(n, 1 / 1.8) : 16 * e;
1817
- }, ki = ({ x: e, y: n, z: t, alpha: i }) => {
1817
+ }, wi = ({ x: e, y: n, z: t, alpha: i }) => {
1818
1818
  e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
1819
1819
  let r = {
1820
1820
  mode: "prophoto",
@@ -1838,22 +1838,22 @@ const ys = {
1838
1838
  z: 0 * n + 0 * t + 0.8251046025104602 * i
1839
1839
  };
1840
1840
  return e.alpha !== void 0 && (r.alpha = e.alpha), r;
1841
- }, ws = {
1841
+ }, ks = {
1842
1842
  ...Ce,
1843
1843
  mode: "prophoto",
1844
1844
  parse: ["prophoto-rgb"],
1845
1845
  serialize: "prophoto-rgb",
1846
1846
  fromMode: {
1847
- xyz50: ki,
1848
- rgb: (e) => ki(et(e))
1847
+ xyz50: wi,
1848
+ rgb: (e) => wi(et(e))
1849
1849
  },
1850
1850
  toMode: {
1851
1851
  xyz50: $i,
1852
1852
  rgb: (e) => Qe($i(e))
1853
1853
  }
1854
- }, zi = 1.09929682680944, ks = 0.018053968510807, ln = (e) => {
1854
+ }, zi = 1.09929682680944, ws = 0.018053968510807, ln = (e) => {
1855
1855
  const n = Math.abs(e);
1856
- return n > ks ? (Math.sign(e) || 1) * (zi * Math.pow(n, 0.45) - (zi - 1)) : 4.5 * e;
1856
+ return n > ws ? (Math.sign(e) || 1) * (zi * Math.pow(n, 0.45) - (zi - 1)) : 4.5 * e;
1857
1857
  }, Ai = ({ x: e, y: n, z: t, alpha: i }) => {
1858
1858
  e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
1859
1859
  let r = {
@@ -2059,14 +2059,14 @@ function Ds(e) {
2059
2059
  return vr(gr(e));
2060
2060
  }
2061
2061
  function xr(e = "rgb") {
2062
- const { gamut: n } = wt(e);
2062
+ const { gamut: n } = kt(e);
2063
2063
  if (!n)
2064
2064
  return (i) => !0;
2065
2065
  const t = X(typeof n == "string" ? n : e);
2066
2066
  return (i) => vr(t(i));
2067
2067
  }
2068
2068
  function Os(e = "rgb") {
2069
- const { gamut: n } = wt(e);
2069
+ const { gamut: n } = kt(e);
2070
2070
  if (!n)
2071
2071
  return (a) => ht(a);
2072
2072
  const t = typeof n == "string" ? n : e, i = X(t), r = xr(t);
@@ -2090,43 +2090,43 @@ function js(e, n = "lch", t = "rgb") {
2090
2090
  let s = { ...e, c: 0 };
2091
2091
  if (!i(s))
2092
2092
  return a(r(s));
2093
- let c = 0, p = e.c !== void 0 ? e.c : 0, f = wt(n).ranges.c, b = (f[1] - f[0]) / Math.pow(2, 13), x = s.c;
2093
+ let c = 0, p = e.c !== void 0 ? e.c : 0, f = kt(n).ranges.c, b = (f[1] - f[0]) / Math.pow(2, 13), x = s.c;
2094
2094
  for (; p - c > b; )
2095
2095
  s.c = c + (p - c) * 0.5, i(s) ? (x = s.c, c = s.c) : p = s.c;
2096
2096
  return a(
2097
2097
  i(s) ? s : { ...s, c: x }
2098
2098
  );
2099
2099
  }
2100
- k(wa);
2101
- k(Sa);
2102
- k(Ca);
2103
- k(Ta);
2104
- k(Ha);
2105
- k(Ui);
2106
- k(er);
2107
- k(Za);
2108
- k(Ya);
2109
- k(Va);
2110
- k(Ja);
2111
- k(Bn);
2112
- k(Ka);
2113
- k(Wn);
2114
- k(es);
2115
- k(ds);
2116
- k(ps);
2117
- k(hs);
2118
- k(bs);
2119
- k(gs);
2120
- k(vs);
2121
- const Jn = k(ys);
2122
- k(Ms);
2123
- k(ws);
2124
- k(zs);
2125
- k(Ce);
2126
- k(Ls);
2127
- k(Ss);
2128
- k(Ps);
2129
- k(Ns);
2100
+ w(ka);
2101
+ w(Sa);
2102
+ w(Ca);
2103
+ w(Ta);
2104
+ w(Ha);
2105
+ w(Ui);
2106
+ w(er);
2107
+ w(Za);
2108
+ w(Ya);
2109
+ w(Va);
2110
+ w(Ja);
2111
+ w(Bn);
2112
+ w(Ka);
2113
+ w(Wn);
2114
+ w(es);
2115
+ w(ds);
2116
+ w(ps);
2117
+ w(hs);
2118
+ w(bs);
2119
+ w(gs);
2120
+ w(vs);
2121
+ const Jn = w(ys);
2122
+ w(Ms);
2123
+ w(ks);
2124
+ w(zs);
2125
+ w(Ce);
2126
+ w(Ls);
2127
+ w(Ss);
2128
+ w(Ps);
2129
+ w(Ns);
2130
2130
  const Zs = X("rgb");
2131
2131
  function Si(e, n) {
2132
2132
  const t = e.getContext("2d", { willReadFrequently: !0 });
@@ -2218,7 +2218,7 @@ function Vs(e) {
2218
2218
  const n = Ht({ mode: "oklch", ...e, alpha: 1 });
2219
2219
  return D((n == null ? void 0 : n.h) ?? e.h);
2220
2220
  }
2221
- function wr(e, n) {
2221
+ function kr(e, n) {
2222
2222
  const t = D(n), i = Ht({ mode: "oklch", ...e, alpha: 1 }), r = Ee({
2223
2223
  mode: "hsv",
2224
2224
  h: t,
@@ -2304,7 +2304,7 @@ function Us(e, n, t, i) {
2304
2304
  return i != null ? xt(s, i) : s;
2305
2305
  }
2306
2306
  case "h":
2307
- return wr(e, t);
2307
+ return kr(e, t);
2308
2308
  }
2309
2309
  }
2310
2310
  function Ti(e, n, t) {
@@ -2384,13 +2384,13 @@ const Pi = {
2384
2384
  c: 0.24,
2385
2385
  h: 303,
2386
2386
  alpha: 0.8
2387
- }, kr = "pretty-color-picker-history", $r = 16, Ei = "Pretty Color Picker";
2387
+ }, wr = "pretty-color-picker-history", $r = 16, Ei = "Pretty Color Picker";
2388
2388
  function zr(e, n) {
2389
2389
  return Ve(e) === Ve(n) && e.alpha === n.alpha;
2390
2390
  }
2391
2391
  function eo() {
2392
2392
  try {
2393
- const e = localStorage.getItem(kr);
2393
+ const e = localStorage.getItem(wr);
2394
2394
  if (!e) return [];
2395
2395
  const n = JSON.parse(e);
2396
2396
  return Array.isArray(n) ? n.slice(0, $r) : [];
@@ -2401,7 +2401,7 @@ function eo() {
2401
2401
  function to(e, n) {
2402
2402
  const t = n.filter((r) => !zr(r, e)), i = [e, ...t].slice(0, $r);
2403
2403
  try {
2404
- localStorage.setItem(kr, JSON.stringify(i));
2404
+ localStorage.setItem(wr, JSON.stringify(i));
2405
2405
  } catch {
2406
2406
  }
2407
2407
  return i;
@@ -2538,7 +2538,7 @@ function Ar(e, n, t) {
2538
2538
  const i = e.offsetWidth, r = e.offsetHeight, a = window.innerWidth - rt, s = window.innerHeight - rt, c = rt - i, p = rt - r;
2539
2539
  e.style.left = `${Math.min(a, Math.max(c, n))}px`, e.style.top = `${Math.min(s, Math.max(p, t))}px`;
2540
2540
  }
2541
- const Fi = 8, we = 8;
2541
+ const Fi = 8, ke = 8;
2542
2542
  function po(e, n = document) {
2543
2543
  const t = e.trim();
2544
2544
  if (!t) return null;
@@ -2553,7 +2553,7 @@ function po(e, n = document) {
2553
2553
  function ho(e, n) {
2554
2554
  const t = n.getBoundingClientRect(), i = e.offsetWidth, r = e.offsetHeight, a = window.innerWidth, s = window.innerHeight;
2555
2555
  let c = t.bottom + Fi, p = t.left;
2556
- p + i > a - we && (p = t.right - i), p = Math.min(a - we - i, Math.max(we, p)), c + r > s - we && (c = t.top - r - Fi), c = Math.min(s - we - r, Math.max(we, c)), e.style.left = `${p}px`, e.style.top = `${c}px`;
2556
+ p + i > a - ke && (p = t.right - i), p = Math.min(a - ke - i, Math.max(ke, p)), c + r > s - ke && (c = t.top - r - Fi), c = Math.min(s - ke - r, Math.max(ke, c)), e.style.left = `${p}px`, e.style.top = `${c}px`;
2557
2557
  }
2558
2558
  const uo = ["hex", "rgb", "hsl", "oklch"], fo = {
2559
2559
  hex: "HEX",
@@ -2561,40 +2561,40 @@ const uo = ["hex", "rgb", "hsl", "oklch"], fo = {
2561
2561
  hsl: "HSL",
2562
2562
  oklch: "OKLCH"
2563
2563
  };
2564
- var $, y, N, V, ze, E, Ae, Je, R, J, I, U, Ue, F, _e, K, Ke, Z, le, Le, Q, ee, O, te, ne, ce, de, ie, j, o, _r, Lr, Sr, zn, An, Oe, _n, Ln, Sn, Cn, je, B, Tn, Cr, Ze, Pn, Tr, En, Pr, Er, Hr, Nr, st, Ye, Ir, qr, Rr, Fr, ot, Hn, Nn, Xr, Dr, Or, jr, Zr, Yr, Br, W, Be, In, qn, be, ke, lt, Rn, Fn, Wr, Xn, Gr, ct, dt, Dn, pt, G, Vr;
2564
+ var $, y, N, V, ze, E, Ae, Je, R, J, I, U, Ue, F, _e, K, Ke, Z, le, Le, Q, ee, O, te, ne, ce, de, ie, j, o, _r, Lr, Sr, zn, An, Oe, _n, Ln, Sn, Cn, je, B, Tn, Cr, Ze, Pn, Tr, En, Pr, Er, Hr, Nr, st, Ye, Ir, qr, Rr, Fr, ot, Hn, Nn, Xr, Dr, Or, jr, Zr, Yr, Br, W, Be, In, qn, be, we, lt, Rn, Fn, Wr, Xn, Gr, ct, dt, Dn, pt, G, Vr;
2565
2565
  class bo extends HTMLElement {
2566
2566
  constructor() {
2567
2567
  super();
2568
- w(this, o);
2569
- w(this, $);
2570
- w(this, y, { ...Pi });
2571
- w(this, N, "hsl");
2572
- w(this, V, eo());
2573
- w(this, ze, null);
2574
- w(this, E, []);
2575
- w(this, Ae);
2576
- w(this, Je);
2577
- w(this, R);
2578
- w(this, J);
2579
- w(this, I);
2580
- w(this, U);
2581
- w(this, Ue);
2582
- w(this, F);
2583
- w(this, _e);
2584
- w(this, K);
2585
- w(this, Ke);
2586
- w(this, Z);
2587
- w(this, le);
2588
- w(this, Le);
2589
- w(this, Q);
2590
- w(this, ee, null);
2591
- w(this, O, null);
2592
- w(this, te, null);
2593
- w(this, ne, null);
2594
- w(this, ce, null);
2595
- w(this, de, null);
2596
- w(this, ie, null);
2597
- w(this, j, Pi.h);
2568
+ k(this, o);
2569
+ k(this, $);
2570
+ k(this, y, { ...Pi });
2571
+ k(this, N, "hsl");
2572
+ k(this, V, eo());
2573
+ k(this, ze, null);
2574
+ k(this, E, []);
2575
+ k(this, Ae);
2576
+ k(this, Je);
2577
+ k(this, R);
2578
+ k(this, J);
2579
+ k(this, I);
2580
+ k(this, U);
2581
+ k(this, Ue);
2582
+ k(this, F);
2583
+ k(this, _e);
2584
+ k(this, K);
2585
+ k(this, Ke);
2586
+ k(this, Z);
2587
+ k(this, le);
2588
+ k(this, Le);
2589
+ k(this, Q);
2590
+ k(this, ee, null);
2591
+ k(this, O, null);
2592
+ k(this, te, null);
2593
+ k(this, ne, null);
2594
+ k(this, ce, null);
2595
+ k(this, de, null);
2596
+ k(this, ie, null);
2597
+ k(this, j, Pi.h);
2598
2598
  g(this, $, this.attachShadow({ mode: "open" }));
2599
2599
  }
2600
2600
  static get observedAttributes() {
@@ -2615,7 +2615,7 @@ class bo extends HTMLElement {
2615
2615
  return;
2616
2616
  }
2617
2617
  t === "theme" && d(this, o, Ze).call(this), t === "movable" && d(this, o, je).call(this), (t === "mode" || t === "anchor") && (d(this, o, Ln).call(this), d(this, o, je).call(this)), t === "open" && this.popoverMode && r != null && requestAnimationFrame(() => {
2618
- d(this, o, Oe).call(this), d(this, o, ke).call(this);
2618
+ d(this, o, Oe).call(this), d(this, o, we).call(this);
2619
2619
  }), t === "history" && d(this, o, Sn).call(this), t === "header-action" && d(this, o, Tr).call(this), t === "label" && d(this, o, Cn).call(this);
2620
2620
  }
2621
2621
  }
@@ -2687,7 +2687,7 @@ class bo extends HTMLElement {
2687
2687
  if (this.popoverMode) {
2688
2688
  if (this.open) {
2689
2689
  requestAnimationFrame(() => {
2690
- d(this, o, Oe).call(this), d(this, o, ke).call(this);
2690
+ d(this, o, Oe).call(this), d(this, o, we).call(this);
2691
2691
  });
2692
2692
  return;
2693
2693
  }
@@ -2794,7 +2794,7 @@ $ = new WeakMap(), y = new WeakMap(), N = new WeakMap(), V = new WeakMap(), ze =
2794
2794
  ), l(this, E).push(d(this, o, En).call(this, l(this, J))), l(this, E).push(d(this, o, En).call(this, l(this, U))), l(this, $).querySelectorAll(".pcp-tab").forEach((t) => {
2795
2795
  t.addEventListener("click", () => {
2796
2796
  const i = t.dataset.format;
2797
- i && i !== l(this, N) && (g(this, N, i), d(this, o, ke).call(this), d(this, o, Dn).call(this), d(this, o, dt).call(this), d(this, o, lt).call(this));
2797
+ i && i !== l(this, N) && (g(this, N, i), d(this, o, we).call(this), d(this, o, Dn).call(this), d(this, o, dt).call(this), d(this, o, lt).call(this));
2798
2798
  });
2799
2799
  }), l(this, Z).addEventListener("focus", () => d(this, o, B).call(this)), l(this, Z).addEventListener("change", () => d(this, o, Hn).call(this)), l(this, Z).addEventListener("keydown", (t) => {
2800
2800
  t.key === "Enter" && d(this, o, Hn).call(this);
@@ -2953,7 +2953,7 @@ $ = new WeakMap(), y = new WeakMap(), N = new WeakMap(), V = new WeakMap(), ze =
2953
2953
  syncPlaneHue: !1
2954
2954
  }), d(this, o, Rn).call(this, t, i);
2955
2955
  }, qr = function(t) {
2956
- l(this, J).dataset.active = "true", l(this, I).dataset.dragging = "true", g(this, j, t * 360), d(this, o, Ye).call(this, l(this, I), t, "hue"), d(this, o, W).call(this, wr(l(this, y), l(this, j)), !0, {
2956
+ l(this, J).dataset.active = "true", l(this, I).dataset.dragging = "true", g(this, j, t * 360), d(this, o, Ye).call(this, l(this, I), t, "hue"), d(this, o, W).call(this, kr(l(this, y), l(this, j)), !0, {
2957
2957
  refreshPlane: !0,
2958
2958
  refreshCursor: !1,
2959
2959
  refreshSliders: !1,
@@ -3067,7 +3067,7 @@ $ = new WeakMap(), y = new WeakMap(), N = new WeakMap(), V = new WeakMap(), ze =
3067
3067
  let a = q(t);
3068
3068
  oe(a) && (a = xt(a, l(this, j))), g(this, y, a), !(l(this, R).hasAttribute("data-dragging") || l(this, I).hasAttribute("data-dragging")) && (r == null ? void 0 : r.syncPlaneHue) !== !1 && !oe(a) && d(this, o, ot).call(this), d(this, o, In).call(this, i, r);
3069
3069
  }, Be = function(t = !0) {
3070
- oe(l(this, y)) || d(this, o, ot).call(this), d(this, o, ke).call(this), d(this, o, Dn).call(this), d(this, o, In).call(this, t), d(this, o, pt).call(this);
3070
+ oe(l(this, y)) || d(this, o, ot).call(this), d(this, o, we).call(this), d(this, o, Dn).call(this), d(this, o, In).call(this, t), d(this, o, pt).call(this);
3071
3071
  }, In = function(t, i) {
3072
3072
  (i == null ? void 0 : i.refreshFields) !== !1 && d(this, o, dt).call(this), d(this, o, Gr).call(this), (i == null ? void 0 : i.refreshSliders) !== !1 && d(this, o, Fn).call(this), (i == null ? void 0 : i.refreshCursor) !== !1 && !l(this, R).hasAttribute("data-dragging") && d(this, o, lt).call(this), (i == null ? void 0 : i.refreshPlane) === !0 ? d(this, o, qn).call(this) : (i == null ? void 0 : i.refreshPlane) !== !1 && !l(this, R).hasAttribute("data-dragging") && !l(this, I).hasAttribute("data-dragging") && l(this, de) !== d(this, o, be).call(this) && d(this, o, qn).call(this), t && d(this, o, Vr).call(this);
3073
3073
  }, qn = function() {
@@ -3078,7 +3078,7 @@ $ = new WeakMap(), y = new WeakMap(), N = new WeakMap(), V = new WeakMap(), ze =
3078
3078
  }));
3079
3079
  }, be = function() {
3080
3080
  return l(this, I).hasAttribute("data-dragging") ? d(this, o, Fr).call(this) : l(this, j);
3081
- }, ke = function() {
3081
+ }, we = function() {
3082
3082
  const t = d(this, o, be).call(this);
3083
3083
  Si(l(this, Ae), t), g(this, de, t);
3084
3084
  }, lt = function() {
@@ -3147,7 +3147,7 @@ $ = new WeakMap(), y = new WeakMap(), N = new WeakMap(), V = new WeakMap(), ze =
3147
3147
  }));
3148
3148
  }, G = function() {
3149
3149
  const t = l(this, R).hasAttribute("data-dragging"), i = l(this, I).hasAttribute("data-dragging");
3150
- delete l(this, R).dataset.dragging, delete l(this, I).dataset.dragging, delete l(this, F).dataset.dragging, delete l(this, J).dataset.active, delete l(this, U).dataset.active, (t || i) && (oe(l(this, y)) || d(this, o, ot).call(this), d(this, o, Fn).call(this), d(this, o, lt).call(this), l(this, de) !== d(this, o, be).call(this) && d(this, o, ke).call(this));
3150
+ delete l(this, R).dataset.dragging, delete l(this, I).dataset.dragging, delete l(this, F).dataset.dragging, delete l(this, J).dataset.active, delete l(this, U).dataset.active, (t || i) && (oe(l(this, y)) || d(this, o, ot).call(this), d(this, o, Fn).call(this), d(this, o, lt).call(this), l(this, de) !== d(this, o, be).call(this) && d(this, o, we).call(this));
3151
3151
  const r = l(this, ze);
3152
3152
  g(this, ze, null), this.history && r && !zr(r, l(this, y)) && (g(this, V, to(r, l(this, V))), d(this, o, pt).call(this));
3153
3153
  }, Vr = function() {
@@ -1,7 +1,7 @@
1
- (function(w,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(w=typeof globalThis<"u"?globalThis:w||self,L(w.PrettyColorPicker={}))})(this,(function(w){"use strict";var Cr=w=>{throw TypeError(w)};var On=(w,L,F)=>L.has(w)||Cr("Cannot "+F);var l=(w,L,F)=>(On(w,L,"read from private field"),F?F.call(w):L.get(w)),k=(w,L,F)=>L.has(w)?Cr("Cannot add the same private member more than once"):L instanceof WeakSet?L.add(w):L.set(w,F),g=(w,L,F,st)=>(On(w,L,"write to private field"),st?st.call(w,F):L.set(w,F),F),d=(w,L,F)=>(On(w,L,"access private method"),F);var $,y,R,J,Pe,I,Ee,Ze,j,K,q,Q,Be,Y,He,ee,We,G,fe,Ne,te,ne,Z,ie,re,be,ge,ae,B,o,Sr,Pr,Er,Dn,jn,tt,Yn,Zn,Bn,Wn,nt,se,Gn,Hr,it,Vn,Nr,Un,Ir,Rr,qr,Fr,Ht,rt,Xr,Or,Dr,jr,Nt,Jn,Kn,Yr,Zr,Br,Wr,Gr,Vr,Ur,oe,at,Qn,ei,ke,Re,It,ti,ni,Jr,ii,Kr,Rt,qt,ri,Ft,le,Qr;const L='<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z" opacity="0.2"/><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"/></svg>',F='<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z" opacity="0.2"/><path d="M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"/></svg>',st='@import"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap";:host{--pcp-width: 260px;--pcp-radius-sm: 4px;--pcp-radius: 6px;--pcp-radius-lg: 9px;--pcp-panel-padding: 9px;--pcp-section-gap: 6px;--pcp-history-cols: 8;--pcp-history-swatch-size: calc( (var(--pcp-width) - 2 * var(--pcp-panel-padding) - 7 * var(--pcp-history-gap)) / var(--pcp-history-cols) );--pcp-control-height: var(--pcp-history-swatch-size);--pcp-tab-row-height: 32px;--pcp-field-label-size: 10px;--pcp-field-label-line: 12px;--pcp-field-label-gap: 3px;--pcp-field-value-size: 11px;--pcp-field-value-line: 15px;--pcp-field-input-height: 20px;--pcp-input-panel-height: calc( var(--pcp-field-label-line) + var(--pcp-field-label-gap) + var(--pcp-field-input-height) );--pcp-input-row-padding-y: 6px;--pcp-input-row-padding-x: 7px;--pcp-alpha-col-width: 4ch;--pcp-value-col-width: minmax(0, 1fr);--pcp-swatch-code-gap: 8px;--pcp-history-gap: 6px;--pcp-checker-size: 6px;--pcp-slider-handle-height: calc(var(--pcp-control-height) * 20 / 36);--pcp-field-input-radius: var(--pcp-radius-sm);--pcp-icon-button-size: 26px;--pcp-icon-button-radius: var(--pcp-radius-sm);--pcp-title-size: 12px;--pcp-title-line: 17px;--pcp-title-weight: 600;--pcp-title-tracking: -.24px;--pcp-ease-out: cubic-bezier(.175, .885, .32, 1.1);--pcp-font: "Geist", system-ui, -apple-system, "SF Pro Display", sans-serif;--pcp-mono: "Geist Mono", ui-monospace, monospace;display:inline-block;font-family:var(--pcp-font);-webkit-font-smoothing:antialiased;color:var(--pcp-text-primary)}:host([mode="popover"]),:host([movable]){position:fixed;z-index:1000;margin:0}:host([mode="popover"]:not([open])){display:none}:host([mode="popover"]) .pcp-header,:host([movable]) .pcp-header{cursor:grab;touch-action:none}:host([mode="popover"]) .pcp-header[data-dragging=true],:host([movable]) .pcp-header[data-dragging=true]{cursor:grabbing}:host,:host([theme="dark"]){color-scheme:dark;--pcp-bg: #212121;--pcp-border: rgba(255, 255, 255, .1);--pcp-border-hover: rgba(255, 255, 255, .15);--pcp-surface: rgba(255, 255, 255, .05);--pcp-surface-hover: rgba(255, 255, 255, .1);--pcp-surface-active: rgba(255, 255, 255, .11);--pcp-tab-pill: rgba(255, 255, 255, .11);--pcp-divider: rgba(255, 255, 255, .06);--pcp-text-root: #ffffff;--pcp-text-primary: rgba(255, 255, 255, .95);--pcp-text-label: rgba(255, 255, 255, .7);--pcp-text-secondary: rgba(255, 255, 255, .6);--pcp-text-tertiary: rgba(255, 255, 255, .4);--pcp-text-focus: #ffffff;--pcp-slider-handle: rgba(255, 255, 255, .95);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #47a8ff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .35);--pcp-elevation: 0 8px 32px rgba(0, 0, 0, .5)}:host([theme="light"]){color-scheme:light;--pcp-bg: #fafafa;--pcp-border: rgba(0, 0, 0, .1);--pcp-border-hover: rgba(0, 0, 0, .15);--pcp-surface: rgba(0, 0, 0, .04);--pcp-surface-hover: rgba(0, 0, 0, .08);--pcp-surface-active: rgba(0, 0, 0, .1);--pcp-tab-pill: rgba(0, 0, 0, .1);--pcp-divider: rgba(0, 0, 0, .06);--pcp-text-root: #000000;--pcp-text-primary: rgba(0, 0, 0, .9);--pcp-text-label: rgba(0, 0, 0, .6);--pcp-text-secondary: rgba(0, 0, 0, .55);--pcp-text-tertiary: rgba(0, 0, 0, .35);--pcp-text-focus: #000000;--pcp-slider-handle: rgba(0, 0, 0, .9);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #006bff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .4);--pcp-elevation: 0 4px 20px rgba(0, 0, 0, .08)}@media(prefers-color-scheme:dark){:host([theme="system"]){color-scheme:dark;--pcp-bg: #212121;--pcp-border: rgba(255, 255, 255, .1);--pcp-border-hover: rgba(255, 255, 255, .15);--pcp-surface: rgba(255, 255, 255, .05);--pcp-surface-hover: rgba(255, 255, 255, .1);--pcp-surface-active: rgba(255, 255, 255, .11);--pcp-tab-pill: rgba(255, 255, 255, .11);--pcp-divider: rgba(255, 255, 255, .06);--pcp-text-root: #ffffff;--pcp-text-primary: rgba(255, 255, 255, .95);--pcp-text-label: rgba(255, 255, 255, .7);--pcp-text-secondary: rgba(255, 255, 255, .6);--pcp-text-tertiary: rgba(255, 255, 255, .4);--pcp-text-focus: #ffffff;--pcp-slider-handle: rgba(255, 255, 255, .95);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #47a8ff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .35);--pcp-elevation: 0 8px 32px rgba(0, 0, 0, .5)}}@media(prefers-color-scheme:light){:host([theme="system"]){color-scheme:light;--pcp-bg: #fafafa;--pcp-border: rgba(0, 0, 0, .1);--pcp-border-hover: rgba(0, 0, 0, .15);--pcp-surface: rgba(0, 0, 0, .04);--pcp-surface-hover: rgba(0, 0, 0, .08);--pcp-surface-active: rgba(0, 0, 0, .1);--pcp-tab-pill: rgba(0, 0, 0, .1);--pcp-divider: rgba(0, 0, 0, .06);--pcp-text-root: #000000;--pcp-text-primary: rgba(0, 0, 0, .9);--pcp-text-label: rgba(0, 0, 0, .6);--pcp-text-secondary: rgba(0, 0, 0, .55);--pcp-text-tertiary: rgba(0, 0, 0, .35);--pcp-text-focus: #000000;--pcp-slider-handle: rgba(0, 0, 0, .9);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #006bff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .4);--pcp-elevation: 0 4px 20px rgba(0, 0, 0, .08)}}*,*:before,*:after{box-sizing:border-box}.pcp-clip{overflow:hidden;border-radius:var(--pcp-clip-radius, var(--pcp-radius-sm))}.pcp-swatch-fill{display:block;box-sizing:border-box;width:calc(100% + 2px);height:calc(100% + 2px);margin:-1px;border-radius:inherit;background-color:var(--pcp-checker-base);background-image:linear-gradient(to right,var(--swatch-solid, #000) 50%,transparent 50%),linear-gradient(to right,transparent 50%,var(--swatch-alpha, rgba(0, 0, 0, .5)) 50%),linear-gradient(45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(-45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pcp-checker-tone) 75%),linear-gradient(-45deg,transparent 75%,var(--pcp-checker-tone) 75%);background-size:100% 100%,100% 100%,var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size);background-position:0 0,0 0,0 0,0 calc(var(--pcp-checker-size) / 2),calc(var(--pcp-checker-size) / 2) calc(var(--pcp-checker-size) / -2),calc(var(--pcp-checker-size) / -2) 0}@supports (background: -webkit-named-image(i)){.pcp-clip,.pcp-swatch-fill{clip-path:inset(0 round var(--pcp-clip-radius, var(--pcp-radius-sm)))}}.pcp{display:flex;flex-direction:column;gap:var(--pcp-section-gap);width:var(--pcp-width);background:var(--pcp-bg);border:1px solid var(--pcp-border);border-radius:var(--pcp-radius-lg);box-shadow:var(--pcp-elevation);padding:var(--pcp-panel-padding);-webkit-user-select:none;user-select:none}.pcp-header{display:flex;align-items:center;justify-content:space-between;gap:6px;padding-bottom:4px;margin-bottom:0;min-height:var(--pcp-icon-button-size);border-bottom:1px solid var(--pcp-divider)}.pcp-title[hidden]{display:none}.pcp-title{flex:1;min-width:0;font-family:var(--pcp-font);font-size:var(--pcp-title-size);font-weight:var(--pcp-title-weight);line-height:var(--pcp-title-line);letter-spacing:var(--pcp-title-tracking);color:var(--pcp-text-root);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pcp-header-btn{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--pcp-icon-button-size);height:var(--pcp-icon-button-size);padding:0;border:none;border-radius:var(--pcp-icon-button-radius);background:transparent;color:var(--pcp-text-focus);cursor:pointer;transition:background .15s var(--pcp-ease-out),color .15s var(--pcp-ease-out),transform .16s var(--pcp-ease-out)}.pcp-header-btn svg{width:13px;height:13px;flex-shrink:0}@media(hover:hover)and (pointer:fine){.pcp-header-btn:hover{background:var(--pcp-surface-hover);color:var(--pcp-text-primary)}}.pcp-header-btn:active{background:var(--pcp-surface-active);transform:scale(.97)}.pcp-header-btn:focus{outline:none}.pcp-header-btn:focus-visible{box-shadow:0 0 0 2px var(--pcp-bg),0 0 0 4px var(--pcp-focus-ring)}.pcp-plane-wrap{position:relative;width:100%;aspect-ratio:4 / 3;--pcp-clip-radius: var(--pcp-radius-sm);margin-bottom:0;cursor:crosshair;touch-action:none}.pcp-plane{display:block;width:100%;height:100%}.pcp-cursor{position:absolute;width:13px;height:13px;margin:-6.5px 0 0 -6.5px;border:2px solid var(--pcp-cursor-ring);border-radius:50%;box-shadow:0 0 0 1px var(--pcp-cursor-outline),inset 0 0 0 1px #0000001f;pointer-events:none}.pcp-cursor[data-dragging=true]{transition:none}.pcp-slider-wrapper{position:relative;height:var(--pcp-control-height);margin-bottom:0}.pcp-slider{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer;-webkit-user-select:none;user-select:none;--pcp-clip-radius: var(--pcp-radius-sm);background:transparent;touch-action:none}.pcp-slider-fill{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none}.pcp-slider-fill-hue{background:linear-gradient(to right,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.pcp-slider-fill-alpha{--pcp-alpha-gradient: linear-gradient(to right, rgba(0, 0, 0, 0), rgb(0, 0, 0));background-color:var(--pcp-checker-base);background-image:var(--pcp-alpha-gradient),linear-gradient(45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(-45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pcp-checker-tone) 75%),linear-gradient(-45deg,transparent 75%,var(--pcp-checker-tone) 75%);background-size:100% 100%,var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size);background-position:0 0,0 0,0 calc(var(--pcp-checker-size) / 2),calc(var(--pcp-checker-size) / 2) calc(var(--pcp-checker-size) / -2),calc(var(--pcp-checker-size) / -2) 0}.pcp-slider-handle{position:absolute;top:50%;left:0;z-index:1;width:3px;height:var(--pcp-slider-handle-height);border:none;outline:none;border-radius:999px;background-color:transparent;pointer-events:none;transform:translateY(-50%);opacity:.68;box-shadow:none;filter:none;transition:opacity .15s ease,background-color .12s ease,box-shadow .12s ease}.pcp-slider:hover .pcp-slider-handle,.pcp-slider[data-active=true] .pcp-slider-handle{opacity:.68}.pcp-slider-handle[data-dragging=true]{opacity:.95}.pcp-tabs{position:relative;display:flex;align-items:center;height:var(--pcp-tab-row-height);box-sizing:border-box;padding:2px;margin-bottom:0;background:transparent;border-radius:var(--pcp-radius)}.pcp-tabs-pill{position:absolute;top:2px;bottom:2px;left:0;width:0;background:var(--pcp-tab-pill);border-radius:5px;z-index:0;pointer-events:none;transition:left .2s var(--pcp-ease-out),width .2s var(--pcp-ease-out)}.pcp-tab{position:relative;z-index:1;flex:1;display:flex;align-items:center;justify-content:center;height:100%;padding:0 4px;font-family:inherit;font-size:11px;font-weight:500;line-height:1;text-align:center;background:transparent;border:none;color:var(--pcp-text-label);cursor:pointer;transition:color .15s var(--pcp-ease-out),transform .16s var(--pcp-ease-out)}.pcp-tab[data-active=true]{color:var(--pcp-text-primary)}.pcp-tab:active{transform:scale(.97)}.pcp-inputs{display:grid;width:100%;min-width:0;box-sizing:border-box;overflow:hidden;grid-template-columns:var(--pcp-input-panel-height) var(--pcp-swatch-code-gap) var(--pcp-value-col-width) var(--pcp-value-col-width) var(--pcp-value-col-width) var(--pcp-alpha-col-width);column-gap:3px;align-items:center;margin-bottom:0;padding:var(--pcp-input-row-padding-y) var(--pcp-input-row-padding-x);background:var(--pcp-surface);border-radius:var(--pcp-radius-sm)}.pcp-swatch{grid-column:1;flex-shrink:0;width:var(--pcp-input-panel-height);height:var(--pcp-input-panel-height);--pcp-clip-radius: var(--pcp-radius-sm);position:relative}.pcp-fields{grid-column:3 / 6;display:grid;min-width:0;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:3px}.pcp-fields[data-format=hex] .pcp-field-hex{grid-column:1 / -1;justify-self:center;width:fit-content;align-items:center}.pcp-fields[data-format=hex] .pcp-field-label{text-align:center;white-space:nowrap}.pcp-fields[data-format=hex] .pcp-field-input{width:8ch;min-width:8ch;padding:0 4px}.pcp-fields[data-format=rgb] .pcp-field-r{grid-column:1}.pcp-fields[data-format=rgb] .pcp-field-g{grid-column:2}.pcp-fields[data-format=rgb] .pcp-field-b{grid-column:3}.pcp-fields[data-format=hsl] .pcp-field-h{grid-column:1}.pcp-fields[data-format=hsl] .pcp-field-s{grid-column:2}.pcp-fields[data-format=hsl] .pcp-field-l{grid-column:3}.pcp-fields[data-format=oklch] .pcp-field-l{grid-column:1}.pcp-fields[data-format=oklch] .pcp-field-c{grid-column:2}.pcp-fields[data-format=oklch] .pcp-field-h{grid-column:3}.pcp-alpha-field{grid-column:6;box-sizing:border-box;width:var(--pcp-alpha-col-width);min-width:var(--pcp-alpha-col-width);max-width:var(--pcp-alpha-col-width);align-items:center}.pcp-alpha-field .pcp-field-input{width:100%;min-width:0;padding:0;box-sizing:border-box}.pcp-field{min-width:0;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:var(--pcp-field-label-gap)}.pcp-fields[data-format=oklch] .pcp-field-c .pcp-field-input{letter-spacing:-.02em;padding:0 1px}.pcp-field-label{display:block;font-size:var(--pcp-field-label-size);font-weight:500;line-height:var(--pcp-field-label-line);color:var(--pcp-text-label);margin:0;text-align:center}.pcp-fields:not([data-format=hex]) .pcp-field-label,.pcp-alpha-field .pcp-field-label{cursor:ew-resize;-webkit-user-select:none;user-select:none;touch-action:none;transition:color .15s var(--pcp-ease-out)}.pcp-field-label[data-scrubbing=true]{color:var(--pcp-text-primary)}.pcp-field-input{width:100%;min-width:0;min-height:var(--pcp-field-input-height);height:var(--pcp-field-input-height);padding:0 2px;font-family:var(--pcp-mono);font-size:var(--pcp-field-value-size);font-weight:500;line-height:var(--pcp-field-input-height);font-variant-numeric:tabular-nums;text-align:center;color:var(--pcp-text-secondary);background:transparent;border:none;border-radius:var(--pcp-field-input-radius);outline:none;box-shadow:none;transition:color .15s var(--pcp-ease-out),background .15s var(--pcp-ease-out)}@media(hover:hover)and (pointer:fine){.pcp-field-input:hover{background:var(--pcp-surface-hover)}}.pcp-field-input:focus{color:var(--pcp-text-focus);background:transparent;border-radius:var(--pcp-field-input-radius);box-shadow:none;outline:none}.pcp-field-input:active{background:var(--pcp-surface-active)}.pcp-history-section[hidden]{display:none}.pcp-history-label{font-size:10px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--pcp-text-label);margin:0 0 5px}.pcp-history{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:var(--pcp-history-gap);width:100%}.pcp-history-swatch{-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block;width:100%;aspect-ratio:1;height:auto;flex-shrink:0;padding:0;border:none;background:none;--pcp-clip-radius: 4px;cursor:pointer;transition:opacity .15s var(--pcp-ease-out)}@media(hover:hover)and (pointer:fine){.pcp-history-swatch:hover{opacity:.85}}.pcp-history-swatch:active{opacity:.7}@media(prefers-reduced-motion:reduce){.pcp-header-btn,.pcp-tab,.pcp-tabs-pill,.pcp-cursor,.pcp-slider-handle,.pcp-history-swatch{transition:none}.pcp-tab:active,.pcp-header-btn:active{transform:none}}',ai=(e,n)=>{if(typeof e=="number"){if(n===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(n===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(n===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(n===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},ea={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ta=e=>ai(ea[e.toLowerCase()],6),na=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,ia=e=>{let n;return(n=e.match(na))?ai(parseInt(n[1],16),n[1].length):void 0},ce="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",qe=`${ce}%`,Xt=`(?:${ce}%|${ce})`,ra=`(?:${ce}(deg|grad|rad|turn)|${ce})`,ze="\\s*,\\s*",aa=new RegExp(`^rgba?\\(\\s*${ce}${ze}${ce}${ze}${ce}\\s*(?:,\\s*${Xt}\\s*)?\\)$`),sa=new RegExp(`^rgba?\\(\\s*${qe}${ze}${qe}${ze}${qe}\\s*(?:,\\s*${Xt}\\s*)?\\)$`),oa=e=>{let n={mode:"rgb"},t;if(t=e.match(aa))t[1]!==void 0&&(n.r=t[1]/255),t[2]!==void 0&&(n.g=t[2]/255),t[3]!==void 0&&(n.b=t[3]/255);else if(t=e.match(sa))t[1]!==void 0&&(n.r=t[1]/100),t[2]!==void 0&&(n.g=t[2]/100),t[3]!==void 0&&(n.b=t[3]/100);else return;return t[4]!==void 0?n.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(n.alpha=Math.max(0,Math.min(1,+t[5]))),n},ot=(e,n)=>e===void 0?void 0:typeof e!="object"?ci(e):e.mode!==void 0?e:n?{...e,mode:n}:void 0,O=(e="rgb")=>n=>(n=ot(n,e))!==void 0?n.mode===e?n:W[n.mode][e]?W[n.mode][e](n):e==="rgb"?W[n.mode].rgb(n):W.rgb[e](W[n.mode].rgb(n)):void 0,W={},si={},lt=[],oi={},la=e=>e,z=e=>(W[e.mode]={...W[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(n=>{W[n]||(W[n]={}),W[n][e.mode]=e.fromMode[n]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(n=>{if(e.ranges[n]===void 0&&(e.ranges[n]=[0,1]),!e.interpolate[n])throw new Error(`Missing interpolator for: ${n}`);typeof e.interpolate[n]=="function"&&(e.interpolate[n]={use:e.interpolate[n]}),e.interpolate[n].fixup||(e.interpolate[n].fixup=la)}),si[e.mode]=e,(e.parse||[]).forEach(n=>{ca(n,e.mode)}),O(e.mode)),ct=e=>si[e],ca=(e,n)=>{if(typeof e=="string"){if(!n)throw new Error("'mode' required when 'parser' is a string");oi[e]=n}else typeof e=="function"&&lt.indexOf(e)<0&&lt.push(e)},Ot=/[^\x00-\x7F]|[a-zA-Z_]/,da=/[^\x00-\x7F]|[-\w]/,h={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let m=0;function dt(e){let n=e[m],t=e[m+1];return n==="-"||n==="+"?/\d/.test(t)||t==="."&&/\d/.test(e[m+2]):n==="."?/\d/.test(t):/\d/.test(n)}function Dt(e){if(m>=e.length)return!1;let n=e[m];if(Ot.test(n))return!0;if(n==="-"){if(e.length-m<2)return!1;let t=e[m+1];return!!(t==="-"||Ot.test(t))}return!1}const pa={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function Fe(e){let n="";if((e[m]==="-"||e[m]==="+")&&(n+=e[m++]),n+=pt(e),e[m]==="."&&/\d/.test(e[m+1])&&(n+=e[m++]+pt(e)),(e[m]==="e"||e[m]==="E")&&((e[m+1]==="-"||e[m+1]==="+")&&/\d/.test(e[m+2])?n+=e[m++]+e[m++]+pt(e):/\d/.test(e[m+1])&&(n+=e[m++]+pt(e))),Dt(e)){let t=ht(e);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:h.Hue,value:n*pa[t]}:void 0}return e[m]==="%"?(m++,{type:h.Percentage,value:+n}):{type:h.Number,value:+n}}function pt(e){let n="";for(;/\d/.test(e[m]);)n+=e[m++];return n}function ht(e){let n="";for(;m<e.length&&da.test(e[m]);)n+=e[m++];return n}function ha(e){let n=ht(e);return e[m]==="("?(m++,{type:h.Function,value:n}):n==="none"?{type:h.None,value:void 0}:{type:h.Ident,value:n}}function ua(e=""){let n=e.trim(),t=[],i;for(m=0;m<n.length;){if(i=n[m++],i===`
1
+ (function(k,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(k=typeof globalThis<"u"?globalThis:k||self,L(k.PrettyColorPicker={}))})(this,(function(k){"use strict";var Cr=k=>{throw TypeError(k)};var On=(k,L,F)=>L.has(k)||Cr("Cannot "+F);var l=(k,L,F)=>(On(k,L,"read from private field"),F?F.call(k):L.get(k)),w=(k,L,F)=>L.has(k)?Cr("Cannot add the same private member more than once"):L instanceof WeakSet?L.add(k):L.set(k,F),g=(k,L,F,st)=>(On(k,L,"write to private field"),st?st.call(k,F):L.set(k,F),F),d=(k,L,F)=>(On(k,L,"access private method"),F);var $,y,R,J,Pe,I,Ee,Ze,j,K,q,Q,Be,Y,He,ee,We,G,fe,Ne,te,ne,Z,ie,re,be,ge,ae,B,o,Sr,Pr,Er,Dn,jn,tt,Yn,Zn,Bn,Wn,nt,se,Gn,Hr,it,Vn,Nr,Un,Ir,Rr,qr,Fr,Ht,rt,Xr,Or,Dr,jr,Nt,Jn,Kn,Yr,Zr,Br,Wr,Gr,Vr,Ur,oe,at,Qn,ei,we,Re,It,ti,ni,Jr,ii,Kr,Rt,qt,ri,Ft,le,Qr;const L='<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z" opacity="0.2"/><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"/></svg>',F='<svg viewBox="0 0 256 256" fill="currentColor" aria-hidden="true"><path d="M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z" opacity="0.2"/><path d="M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"/></svg>',st='@import"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap";:host{--pcp-width: 260px;--pcp-radius-sm: 4px;--pcp-radius: 6px;--pcp-radius-lg: 9px;--pcp-panel-padding: 9px;--pcp-section-gap: 6px;--pcp-history-cols: 8;--pcp-history-swatch-size: calc( (var(--pcp-width) - 2 * var(--pcp-panel-padding) - 7 * var(--pcp-history-gap)) / var(--pcp-history-cols) );--pcp-control-height: var(--pcp-history-swatch-size);--pcp-tab-row-height: 32px;--pcp-field-label-size: 11px;--pcp-field-label-line: 13.2px;--pcp-field-label-gap: 3px;--pcp-field-value-size: 11px;--pcp-field-value-line: 15px;--pcp-field-input-height: 20px;--pcp-input-panel-height: calc( var(--pcp-field-label-line) + var(--pcp-field-label-gap) + var(--pcp-field-input-height) );--pcp-input-row-padding-y: 6px;--pcp-input-row-padding-x: 7px;--pcp-alpha-col-width: 4ch;--pcp-value-col-width: minmax(0, 1fr);--pcp-swatch-code-gap: 8px;--pcp-history-gap: 6px;--pcp-checker-size: 6px;--pcp-slider-handle-height: calc(var(--pcp-control-height) * 20 / 36);--pcp-field-input-radius: var(--pcp-radius-sm);--pcp-icon-button-size: 26px;--pcp-icon-button-radius: var(--pcp-radius-sm);--pcp-kicker-size: 11px;--pcp-kicker-line: 1.2;--pcp-kicker-weight: 600;--pcp-kicker-tracking: .08em;--pcp-text-kicker: #8f8f8f;--pcp-ease-out: cubic-bezier(.175, .885, .32, 1.1);--pcp-font: "Geist", system-ui, -apple-system, "SF Pro Display", sans-serif;--pcp-mono: "Geist Mono", ui-monospace, monospace;display:inline-block;font-family:var(--pcp-font);-webkit-font-smoothing:antialiased;color:var(--pcp-text-primary)}:host([mode="popover"]),:host([movable]){position:fixed;z-index:1000;margin:0}:host([mode="popover"]:not([open])){display:none}:host([mode="popover"]) .pcp-header,:host([movable]) .pcp-header{cursor:grab;touch-action:none}:host([mode="popover"]) .pcp-header[data-dragging=true],:host([movable]) .pcp-header[data-dragging=true]{cursor:grabbing}:host,:host([theme="dark"]){color-scheme:dark;--pcp-bg: #212121;--pcp-border: rgba(255, 255, 255, .1);--pcp-border-hover: rgba(255, 255, 255, .15);--pcp-surface: rgba(255, 255, 255, .05);--pcp-surface-hover: rgba(255, 255, 255, .1);--pcp-surface-active: rgba(255, 255, 255, .11);--pcp-tab-pill: rgba(255, 255, 255, .11);--pcp-divider: rgba(255, 255, 255, .06);--pcp-text-root: #ffffff;--pcp-text-section: rgba(255, 255, 255, .7);--pcp-text-primary: rgba(255, 255, 255, .95);--pcp-text-label: rgba(255, 255, 255, .7);--pcp-text-muted: #a0a0a0;--pcp-text-secondary: rgba(255, 255, 255, .6);--pcp-text-tertiary: rgba(255, 255, 255, .4);--pcp-text-focus: #ffffff;--pcp-slider-handle: rgba(255, 255, 255, .95);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #47a8ff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .35);--pcp-elevation: 0 8px 32px rgba(0, 0, 0, .5)}:host([theme="light"]){color-scheme:light;--pcp-bg: #fafafa;--pcp-border: rgba(0, 0, 0, .1);--pcp-border-hover: rgba(0, 0, 0, .15);--pcp-surface: rgba(0, 0, 0, .04);--pcp-surface-hover: rgba(0, 0, 0, .08);--pcp-surface-active: rgba(0, 0, 0, .1);--pcp-tab-pill: rgba(0, 0, 0, .1);--pcp-divider: rgba(0, 0, 0, .06);--pcp-text-root: #000000;--pcp-text-section: rgba(0, 0, 0, .65);--pcp-text-primary: rgba(0, 0, 0, .9);--pcp-text-label: rgba(0, 0, 0, .6);--pcp-text-muted: #4d4d4d;--pcp-text-secondary: rgba(0, 0, 0, .55);--pcp-text-tertiary: rgba(0, 0, 0, .35);--pcp-text-focus: #000000;--pcp-slider-handle: rgba(0, 0, 0, .9);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #006bff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .4);--pcp-elevation: 0 4px 20px rgba(0, 0, 0, .08)}@media(prefers-color-scheme:dark){:host([theme="system"]){color-scheme:dark;--pcp-bg: #212121;--pcp-border: rgba(255, 255, 255, .1);--pcp-border-hover: rgba(255, 255, 255, .15);--pcp-surface: rgba(255, 255, 255, .05);--pcp-surface-hover: rgba(255, 255, 255, .1);--pcp-surface-active: rgba(255, 255, 255, .11);--pcp-tab-pill: rgba(255, 255, 255, .11);--pcp-divider: rgba(255, 255, 255, .06);--pcp-text-root: #ffffff;--pcp-text-section: rgba(255, 255, 255, .7);--pcp-text-primary: rgba(255, 255, 255, .95);--pcp-text-label: rgba(255, 255, 255, .7);--pcp-text-muted: #a0a0a0;--pcp-text-secondary: rgba(255, 255, 255, .6);--pcp-text-tertiary: rgba(255, 255, 255, .4);--pcp-text-focus: #ffffff;--pcp-slider-handle: rgba(255, 255, 255, .95);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #47a8ff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .35);--pcp-elevation: 0 8px 32px rgba(0, 0, 0, .5)}}@media(prefers-color-scheme:light){:host([theme="system"]){color-scheme:light;--pcp-bg: #fafafa;--pcp-border: rgba(0, 0, 0, .1);--pcp-border-hover: rgba(0, 0, 0, .15);--pcp-surface: rgba(0, 0, 0, .04);--pcp-surface-hover: rgba(0, 0, 0, .08);--pcp-surface-active: rgba(0, 0, 0, .1);--pcp-tab-pill: rgba(0, 0, 0, .1);--pcp-divider: rgba(0, 0, 0, .06);--pcp-text-root: #000000;--pcp-text-section: rgba(0, 0, 0, .65);--pcp-text-primary: rgba(0, 0, 0, .9);--pcp-text-label: rgba(0, 0, 0, .6);--pcp-text-muted: #4d4d4d;--pcp-text-secondary: rgba(0, 0, 0, .55);--pcp-text-tertiary: rgba(0, 0, 0, .35);--pcp-text-focus: #000000;--pcp-slider-handle: rgba(0, 0, 0, .9);--pcp-checker-base: #ffffff;--pcp-checker-tone: #cccccc;--pcp-focus-ring: #006bff;--pcp-cursor-ring: #ffffff;--pcp-cursor-outline: rgba(0, 0, 0, .4);--pcp-elevation: 0 4px 20px rgba(0, 0, 0, .08)}}*,*:before,*:after{box-sizing:border-box}.pcp-clip{overflow:hidden;border-radius:var(--pcp-clip-radius, var(--pcp-radius-sm))}.pcp-swatch-fill{display:block;box-sizing:border-box;width:calc(100% + 2px);height:calc(100% + 2px);margin:-1px;border-radius:inherit;background-color:var(--pcp-checker-base);background-image:linear-gradient(to right,var(--swatch-solid, #000) 50%,transparent 50%),linear-gradient(to right,transparent 50%,var(--swatch-alpha, rgba(0, 0, 0, .5)) 50%),linear-gradient(45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(-45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pcp-checker-tone) 75%),linear-gradient(-45deg,transparent 75%,var(--pcp-checker-tone) 75%);background-size:100% 100%,100% 100%,var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size);background-position:0 0,0 0,0 0,0 calc(var(--pcp-checker-size) / 2),calc(var(--pcp-checker-size) / 2) calc(var(--pcp-checker-size) / -2),calc(var(--pcp-checker-size) / -2) 0}@supports (background: -webkit-named-image(i)){.pcp-clip,.pcp-swatch-fill{clip-path:inset(0 round var(--pcp-clip-radius, var(--pcp-radius-sm)))}}.pcp{display:flex;flex-direction:column;gap:var(--pcp-section-gap);width:var(--pcp-width);background:var(--pcp-bg);border:1px solid var(--pcp-border);border-radius:var(--pcp-radius-lg);box-shadow:var(--pcp-elevation);padding:var(--pcp-panel-padding);-webkit-user-select:none;user-select:none}.pcp-header{display:flex;align-items:center;justify-content:space-between;gap:6px;padding-bottom:4px;margin-bottom:0;min-height:var(--pcp-icon-button-size);border-bottom:1px solid var(--pcp-divider)}.pcp-title[hidden]{display:none}.pcp-title{flex:1;min-width:0;font-family:var(--pcp-font);font-size:var(--pcp-kicker-size);font-weight:var(--pcp-kicker-weight);line-height:var(--pcp-kicker-line);letter-spacing:var(--pcp-kicker-tracking);text-transform:uppercase;color:var(--pcp-text-kicker);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pcp-header-btn{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--pcp-icon-button-size);height:var(--pcp-icon-button-size);padding:0;border:none;border-radius:var(--pcp-icon-button-radius);background:transparent;color:var(--pcp-text-focus);cursor:pointer;transition:background .15s var(--pcp-ease-out),color .15s var(--pcp-ease-out),transform .16s var(--pcp-ease-out)}.pcp-header-btn svg{width:13px;height:13px;flex-shrink:0}@media(hover:hover)and (pointer:fine){.pcp-header-btn:hover{background:var(--pcp-surface-hover);color:var(--pcp-text-primary)}}.pcp-header-btn:active{background:var(--pcp-surface-active);transform:scale(.97)}.pcp-header-btn:focus{outline:none}.pcp-header-btn:focus-visible{box-shadow:0 0 0 2px var(--pcp-bg),0 0 0 4px var(--pcp-focus-ring)}.pcp-plane-wrap{position:relative;width:100%;aspect-ratio:4 / 3;--pcp-clip-radius: var(--pcp-radius-sm);margin-bottom:0;cursor:crosshair;touch-action:none}.pcp-plane{display:block;width:100%;height:100%}.pcp-cursor{position:absolute;width:13px;height:13px;margin:-6.5px 0 0 -6.5px;border:2px solid var(--pcp-cursor-ring);border-radius:50%;box-shadow:0 0 0 1px var(--pcp-cursor-outline),inset 0 0 0 1px #0000001f;pointer-events:none}.pcp-cursor[data-dragging=true]{transition:none}.pcp-slider-wrapper{position:relative;height:var(--pcp-control-height);margin-bottom:0}.pcp-slider{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer;-webkit-user-select:none;user-select:none;--pcp-clip-radius: var(--pcp-radius-sm);background:transparent;touch-action:none}.pcp-slider-fill{position:absolute;top:0;right:0;bottom:0;left:0;border-radius:inherit;pointer-events:none}.pcp-slider-fill-hue{background:linear-gradient(to right,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.pcp-slider-fill-alpha{--pcp-alpha-gradient: linear-gradient(to right, rgba(0, 0, 0, 0), rgb(0, 0, 0));background-color:var(--pcp-checker-base);background-image:var(--pcp-alpha-gradient),linear-gradient(45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(-45deg,var(--pcp-checker-tone) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--pcp-checker-tone) 75%),linear-gradient(-45deg,transparent 75%,var(--pcp-checker-tone) 75%);background-size:100% 100%,var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size),var(--pcp-checker-size) var(--pcp-checker-size);background-position:0 0,0 0,0 calc(var(--pcp-checker-size) / 2),calc(var(--pcp-checker-size) / 2) calc(var(--pcp-checker-size) / -2),calc(var(--pcp-checker-size) / -2) 0}.pcp-slider-handle{position:absolute;top:50%;left:0;z-index:1;width:3px;height:var(--pcp-slider-handle-height);border:none;outline:none;border-radius:999px;background-color:transparent;pointer-events:none;transform:translateY(-50%);opacity:.68;box-shadow:none;filter:none;transition:opacity .15s ease,background-color .12s ease,box-shadow .12s ease}.pcp-slider:hover .pcp-slider-handle,.pcp-slider[data-active=true] .pcp-slider-handle{opacity:.68}.pcp-slider-handle[data-dragging=true]{opacity:.95}.pcp-tabs{position:relative;display:flex;align-items:center;height:var(--pcp-tab-row-height);box-sizing:border-box;padding:2px;margin-bottom:0;background:transparent;border-radius:var(--pcp-radius)}.pcp-tabs-pill{position:absolute;top:2px;bottom:2px;left:0;width:0;background:var(--pcp-tab-pill);border-radius:5px;z-index:0;pointer-events:none;transition:left .2s var(--pcp-ease-out),width .2s var(--pcp-ease-out)}.pcp-tab{position:relative;z-index:1;flex:1;display:flex;align-items:center;justify-content:center;height:100%;padding:0 4px;font-family:inherit;font-size:11px;font-weight:500;line-height:1;text-align:center;background:transparent;border:none;color:var(--pcp-text-label);cursor:pointer;transition:color .15s var(--pcp-ease-out),transform .16s var(--pcp-ease-out)}.pcp-tab[data-active=true]{color:var(--pcp-text-primary)}.pcp-tab:active{transform:scale(.97)}.pcp-inputs{display:grid;width:100%;min-width:0;box-sizing:border-box;overflow:hidden;grid-template-columns:var(--pcp-input-panel-height) var(--pcp-swatch-code-gap) var(--pcp-value-col-width) var(--pcp-value-col-width) var(--pcp-value-col-width) var(--pcp-alpha-col-width);column-gap:3px;align-items:center;margin-bottom:0;padding:var(--pcp-input-row-padding-y) var(--pcp-input-row-padding-x);background:var(--pcp-surface);border-radius:var(--pcp-radius-sm)}.pcp-swatch{grid-column:1;flex-shrink:0;width:var(--pcp-input-panel-height);height:var(--pcp-input-panel-height);--pcp-clip-radius: var(--pcp-radius-sm);position:relative}.pcp-fields{grid-column:3 / 6;display:grid;min-width:0;grid-template-columns:repeat(3,minmax(0,1fr));column-gap:3px}.pcp-fields[data-format=hex] .pcp-field-hex{grid-column:1 / -1;justify-self:center;width:fit-content;align-items:center}.pcp-fields[data-format=hex] .pcp-field-label{text-align:center;white-space:nowrap}.pcp-fields[data-format=hex] .pcp-field-input{width:8ch;min-width:8ch;padding:0 4px}.pcp-fields[data-format=rgb] .pcp-field-r{grid-column:1}.pcp-fields[data-format=rgb] .pcp-field-g{grid-column:2}.pcp-fields[data-format=rgb] .pcp-field-b{grid-column:3}.pcp-fields[data-format=hsl] .pcp-field-h{grid-column:1}.pcp-fields[data-format=hsl] .pcp-field-s{grid-column:2}.pcp-fields[data-format=hsl] .pcp-field-l{grid-column:3}.pcp-fields[data-format=oklch] .pcp-field-l{grid-column:1}.pcp-fields[data-format=oklch] .pcp-field-c{grid-column:2}.pcp-fields[data-format=oklch] .pcp-field-h{grid-column:3}.pcp-alpha-field{grid-column:6;box-sizing:border-box;width:var(--pcp-alpha-col-width);min-width:var(--pcp-alpha-col-width);max-width:var(--pcp-alpha-col-width);align-items:center}.pcp-alpha-field .pcp-field-input{width:100%;min-width:0;padding:0;box-sizing:border-box}.pcp-field{min-width:0;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:var(--pcp-field-label-gap)}.pcp-fields[data-format=oklch] .pcp-field-c .pcp-field-input{letter-spacing:-.02em;padding:0 1px}.pcp-field-label{display:block;font-size:var(--pcp-kicker-size);font-weight:var(--pcp-kicker-weight);line-height:var(--pcp-kicker-line);letter-spacing:var(--pcp-kicker-tracking);text-transform:uppercase;color:var(--pcp-text-kicker);margin:0;text-align:center}.pcp-fields:not([data-format=hex]) .pcp-field-label,.pcp-alpha-field .pcp-field-label{cursor:ew-resize;-webkit-user-select:none;user-select:none;touch-action:none;transition:color .15s var(--pcp-ease-out)}.pcp-field-label[data-scrubbing=true]{color:var(--pcp-text-muted)}.pcp-field-input{width:100%;min-width:0;min-height:var(--pcp-field-input-height);height:var(--pcp-field-input-height);padding:0 2px;font-family:var(--pcp-mono);font-size:var(--pcp-field-value-size);font-weight:500;line-height:var(--pcp-field-input-height);font-variant-numeric:tabular-nums;text-align:center;color:var(--pcp-text-secondary);background:transparent;border:none;border-radius:var(--pcp-field-input-radius);outline:none;box-shadow:none;transition:color .15s var(--pcp-ease-out),background .15s var(--pcp-ease-out)}@media(hover:hover)and (pointer:fine){.pcp-field-input:hover{background:var(--pcp-surface-hover)}}.pcp-field-input:focus{color:var(--pcp-text-focus);background:transparent;border-radius:var(--pcp-field-input-radius);box-shadow:none;outline:none}.pcp-field-input:active{background:var(--pcp-surface-active)}.pcp-history-section[hidden]{display:none}.pcp-history-label{font-size:var(--pcp-kicker-size);font-weight:var(--pcp-kicker-weight);line-height:var(--pcp-kicker-line);letter-spacing:var(--pcp-kicker-tracking);text-transform:uppercase;color:var(--pcp-text-kicker);margin:0 0 5px}.pcp-history{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:var(--pcp-history-gap);width:100%}.pcp-history-swatch{-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block;width:100%;aspect-ratio:1;height:auto;flex-shrink:0;padding:0;border:none;background:none;--pcp-clip-radius: 4px;cursor:pointer;transition:opacity .15s var(--pcp-ease-out)}@media(hover:hover)and (pointer:fine){.pcp-history-swatch:hover{opacity:.85}}.pcp-history-swatch:active{opacity:.7}@media(prefers-reduced-motion:reduce){.pcp-header-btn,.pcp-tab,.pcp-tabs-pill,.pcp-cursor,.pcp-slider-handle,.pcp-history-swatch{transition:none}.pcp-tab:active,.pcp-header-btn:active{transform:none}}',ai=(e,n)=>{if(typeof e=="number"){if(n===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(n===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(n===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(n===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},ea={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},ta=e=>ai(ea[e.toLowerCase()],6),na=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,ia=e=>{let n;return(n=e.match(na))?ai(parseInt(n[1],16),n[1].length):void 0},ce="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",qe=`${ce}%`,Xt=`(?:${ce}%|${ce})`,ra=`(?:${ce}(deg|grad|rad|turn)|${ce})`,ze="\\s*,\\s*",aa=new RegExp(`^rgba?\\(\\s*${ce}${ze}${ce}${ze}${ce}\\s*(?:,\\s*${Xt}\\s*)?\\)$`),sa=new RegExp(`^rgba?\\(\\s*${qe}${ze}${qe}${ze}${qe}\\s*(?:,\\s*${Xt}\\s*)?\\)$`),oa=e=>{let n={mode:"rgb"},t;if(t=e.match(aa))t[1]!==void 0&&(n.r=t[1]/255),t[2]!==void 0&&(n.g=t[2]/255),t[3]!==void 0&&(n.b=t[3]/255);else if(t=e.match(sa))t[1]!==void 0&&(n.r=t[1]/100),t[2]!==void 0&&(n.g=t[2]/100),t[3]!==void 0&&(n.b=t[3]/100);else return;return t[4]!==void 0?n.alpha=Math.max(0,Math.min(1,t[4]/100)):t[5]!==void 0&&(n.alpha=Math.max(0,Math.min(1,+t[5]))),n},ot=(e,n)=>e===void 0?void 0:typeof e!="object"?ci(e):e.mode!==void 0?e:n?{...e,mode:n}:void 0,O=(e="rgb")=>n=>(n=ot(n,e))!==void 0?n.mode===e?n:W[n.mode][e]?W[n.mode][e](n):e==="rgb"?W[n.mode].rgb(n):W.rgb[e](W[n.mode].rgb(n)):void 0,W={},si={},lt=[],oi={},la=e=>e,z=e=>(W[e.mode]={...W[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(n=>{W[n]||(W[n]={}),W[n][e.mode]=e.fromMode[n]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(n=>{if(e.ranges[n]===void 0&&(e.ranges[n]=[0,1]),!e.interpolate[n])throw new Error(`Missing interpolator for: ${n}`);typeof e.interpolate[n]=="function"&&(e.interpolate[n]={use:e.interpolate[n]}),e.interpolate[n].fixup||(e.interpolate[n].fixup=la)}),si[e.mode]=e,(e.parse||[]).forEach(n=>{ca(n,e.mode)}),O(e.mode)),ct=e=>si[e],ca=(e,n)=>{if(typeof e=="string"){if(!n)throw new Error("'mode' required when 'parser' is a string");oi[e]=n}else typeof e=="function"&&lt.indexOf(e)<0&&lt.push(e)},Ot=/[^\x00-\x7F]|[a-zA-Z_]/,da=/[^\x00-\x7F]|[-\w]/,h={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let m=0;function dt(e){let n=e[m],t=e[m+1];return n==="-"||n==="+"?/\d/.test(t)||t==="."&&/\d/.test(e[m+2]):n==="."?/\d/.test(t):/\d/.test(n)}function Dt(e){if(m>=e.length)return!1;let n=e[m];if(Ot.test(n))return!0;if(n==="-"){if(e.length-m<2)return!1;let t=e[m+1];return!!(t==="-"||Ot.test(t))}return!1}const pa={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function Fe(e){let n="";if((e[m]==="-"||e[m]==="+")&&(n+=e[m++]),n+=pt(e),e[m]==="."&&/\d/.test(e[m+1])&&(n+=e[m++]+pt(e)),(e[m]==="e"||e[m]==="E")&&((e[m+1]==="-"||e[m+1]==="+")&&/\d/.test(e[m+2])?n+=e[m++]+e[m++]+pt(e):/\d/.test(e[m+1])&&(n+=e[m++]+pt(e))),Dt(e)){let t=ht(e);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:h.Hue,value:n*pa[t]}:void 0}return e[m]==="%"?(m++,{type:h.Percentage,value:+n}):{type:h.Number,value:+n}}function pt(e){let n="";for(;/\d/.test(e[m]);)n+=e[m++];return n}function ht(e){let n="";for(;m<e.length&&da.test(e[m]);)n+=e[m++];return n}function ha(e){let n=ht(e);return e[m]==="("?(m++,{type:h.Function,value:n}):n==="none"?{type:h.None,value:void 0}:{type:h.Ident,value:n}}function ua(e=""){let n=e.trim(),t=[],i;for(m=0;m<n.length;){if(i=n[m++],i===`
2
2
  `||i===" "||i===" "){for(;m<n.length&&(n[m]===`
3
3
  `||n[m]===" "||n[m]===" ");)m++;continue}if(i===",")return;if(i===")"){t.push({type:h.ParenClose});continue}if(i==="+"){if(m--,dt(n)){t.push(Fe(n));continue}return}if(i==="-"){if(m--,dt(n)){t.push(Fe(n));continue}if(Dt(n)){t.push({type:h.Ident,value:ht(n)});continue}return}if(i==="."){if(m--,dt(n)){t.push(Fe(n));continue}return}if(i==="/"){for(;m<n.length&&(n[m]===`
4
- `||n[m]===" "||n[m]===" ");)m++;let r;if(dt(n)&&(r=Fe(n),r.type!==h.Hue)){t.push({type:h.Alpha,value:r});continue}if(Dt(n)&&ht(n)==="none"){t.push({type:h.Alpha,value:{type:h.None,value:void 0}});continue}return}if(/\d/.test(i)){m--,t.push(Fe(n));continue}if(Ot.test(i)){m--,t.push(ha(n));continue}return}return t}function fa(e){e._i=0;let n=e[e._i++];if(!n||n.type!==h.Function||n.value!=="color"||(n=e[e._i++],n.type!==h.Ident))return;const t=oi[n.value];if(!t)return;const i={mode:t},r=li(e,!1);if(!r)return;const a=ct(t).channels;for(let s=0,c,p;s<a.length;s++)c=r[s],p=a[s],c.type!==h.None&&(i[p]=c.type===h.Number?c.value:c.value/100,p==="alpha"&&(i[p]=Math.max(0,Math.min(1,i[p]))));return i}function li(e,n){const t=[];let i;for(;e._i<e.length;){if(i=e[e._i++],i.type===h.None||i.type===h.Number||i.type===h.Alpha||i.type===h.Percentage||n&&i.type===h.Hue){t.push(i);continue}if(i.type===h.ParenClose){if(e._i<e.length)return;continue}return}if(!(t.length<3||t.length>4)){if(t.length===4){if(t[3].type!==h.Alpha)return;t[3]=t[3].value}return t.length===3&&t.push({type:h.None,value:void 0}),t.every(r=>r.type!==h.Alpha)?t:void 0}}function ba(e,n){e._i=0;let t=e[e._i++];if(!t||t.type!==h.Function)return;let i=li(e,n);if(i)return i.unshift(t.value),i}const ci=e=>{if(typeof e!="string")return;const n=ua(e),t=n?ba(n,!0):void 0;let i,r=0,a=lt.length;for(;r<a;)if((i=lt[r++](e,t))!==void 0)return i;return n?fa(n):void 0};function ga(e,n){if(!n||n[0]!=="rgb"&&n[0]!=="rgba")return;const t={mode:"rgb"},[,i,r,a,s]=n;if(!(i.type===h.Hue||r.type===h.Hue||a.type===h.Hue))return i.type!==h.None&&(t.r=i.type===h.Number?i.value/255:i.value/100),r.type!==h.None&&(t.g=r.type===h.Number?r.value/255:r.value/100),a.type!==h.None&&(t.b=a.type===h.Number?a.value/255:a.value/100),s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const ma=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,va=(e,n,t)=>e+t*(n-e),xa=e=>{let n=[];for(let t=0;t<e.length-1;t++){let i=e[t],r=e[t+1];i===void 0&&r===void 0?n.push(void 0):i!==void 0&&r!==void 0?n.push([i,r]):n.push(i!==void 0?[i,i]:[r,r])}return n},u=(e=>n=>{let t=xa(n);return i=>{let r=i*t.length,a=i>=1?t.length-1:Math.max(Math.floor(r),0),s=t[a];return s===void 0?void 0:e(s[0],s[1],r-a)}})(va),P=e=>{let n=!1,t=e.map(i=>i!==void 0?(n=!0,i):1);return n?t:e},$e={mode:"rgb",channels:["r","g","b","alpha"],parse:[ga,ia,oa,ta,ma,"srgb"],serialize:"srgb",interpolate:{r:u,g:u,b:u,alpha:{use:u,fixup:P}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},jt=(e=0)=>Math.pow(Math.abs(e),563/256)*Math.sign(e),di=e=>{let n=jt(e.r),t=jt(e.g),i=jt(e.b),r={mode:"xyz65",x:.5766690429101305*n+.1855582379065463*t+.1882286462349947*i,y:.297344975250536*n+.6273635662554661*t+.0752914584939979*i,z:.0270313613864123*n+.0706888525358272*t+.9913375368376386*i};return e.alpha!==void 0&&(r.alpha=e.alpha),r},Yt=e=>Math.pow(Math.abs(e),256/563)*Math.sign(e),pi=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r={mode:"a98",r:Yt(e*2.0415879038107465-n*.5650069742788597-.3447313507783297*t),g:Yt(e*-.9692436362808798+n*1.8759675015077206+.0415550574071756*t),b:Yt(e*.0134442806320312-n*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(r.alpha=i),r},Zt=(e=0)=>{const n=Math.abs(e);return n<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((n+.055)/1.055,2.4)},Ae=({r:e,g:n,b:t,alpha:i})=>{let r={mode:"lrgb",r:Zt(e),g:Zt(n),b:Zt(t)};return i!==void 0&&(r.alpha=i),r},ve=e=>{let{r:n,g:t,b:i,alpha:r}=Ae(e),a={mode:"xyz65",x:.4123907992659593*n+.357584339383878*t+.1804807884018343*i,y:.2126390058715102*n+.715168678767756*t+.0721923153607337*i,z:.0193308187155918*n+.119194779794626*t+.9505321522496607*i};return r!==void 0&&(a.alpha=r),a},Bt=(e=0)=>{const n=Math.abs(e);return n>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(n,1/2.4)-.055):e*12.92},_e=({r:e,g:n,b:t,alpha:i},r="rgb")=>{let a={mode:r,r:Bt(e),g:Bt(n),b:Bt(t)};return i!==void 0&&(a.alpha=i),a},xe=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=_e({r:e*3.2409699419045226-n*1.537383177570094-.4986107602930034*t,g:e*-.9692436362808796+n*1.8759675015077204+.0415550574071756*t,b:e*.0556300796969936-n*.2039769588889765+1.0569715142428784*t});return i!==void 0&&(r.alpha=i),r},ya={...$e,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>pi(ve(e)),xyz65:pi},toMode:{rgb:e=>xe(di(e)),xyz65:di}},N=e=>(e=e%360)<0?e+360:e,Ma=(e,n)=>e.map((t,i,r)=>{if(t===void 0)return t;let a=N(t);return i===0||e[i-1]===void 0?a:n(a-N(r[i-1]))}).reduce((t,i)=>!t.length||i===void 0||t[t.length-1]===void 0?(t.push(i),t):(t.push(i+t[t.length-1]),t),[]),V=e=>Ma(e,n=>Math.abs(n)<=180?n:n-360*Math.sign(n)),H=[-.14861,1.78277,-.29227,-.90649,1.97294,0],wa=Math.PI/180,ka=180/Math.PI;let hi=H[3]*H[4],ui=H[1]*H[4],fi=H[1]*H[2]-H[0]*H[3];const za=({r:e,g:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=(fi*t+e*hi-n*ui)/(fi+hi-ui),a=t-r,s=(H[4]*(n-r)-H[2]*a)/H[3],c={mode:"cubehelix",l:r,s:r===0||r===1?void 0:Math.sqrt(a*a+s*s)/(H[4]*r*(1-r))};return c.s&&(c.h=Math.atan2(s,a)*ka-120),i!==void 0&&(c.alpha=i),c},$a=({h:e,s:n,l:t,alpha:i})=>{let r={mode:"rgb"};e=(e===void 0?0:e+120)*wa,t===void 0&&(t=0);let a=n===void 0?0:n*t*(1-t),s=Math.cos(e),c=Math.sin(e);return r.r=t+a*(H[0]*s+H[1]*c),r.g=t+a*(H[2]*s+H[3]*c),r.b=t+a*(H[4]*s+H[5]*c),i!==void 0&&(r.alpha=i),r},ut=(e,n)=>{if(e.h===void 0||n.h===void 0||!e.s||!n.s)return 0;let t=N(e.h),i=N(n.h),r=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*n.s)*r},Aa=(e,n)=>{if(e.h===void 0||n.h===void 0)return 0;let t=N(e.h),i=N(n.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},ft=(e,n)=>{if(e.h===void 0||n.h===void 0||!e.c||!n.c)return 0;let t=N(e.h),i=N(n.h),r=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*n.c)*r},U=e=>{let n=e.reduce((i,r)=>{if(r!==void 0){let a=r*Math.PI/180;i.sin+=Math.sin(a),i.cos+=Math.cos(a)}return i},{sin:0,cos:0}),t=Math.atan2(n.sin,n.cos)*180/Math.PI;return t<0?360+t:t},_a={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:za},toMode:{rgb:$a},interpolate:{h:{use:u,fixup:V},s:u,l:u,alpha:{use:u,fixup:P}},difference:{h:ut},average:{h:U}},de=({l:e,a:n,b:t,alpha:i},r="lch")=>{n===void 0&&(n=0),t===void 0&&(t=0);let a=Math.sqrt(n*n+t*t),s={mode:r,l:e,c:a};return a&&(s.h=N(Math.atan2(t,n)*180/Math.PI)),i!==void 0&&(s.alpha=i),s},pe=({l:e,c:n,h:t,alpha:i},r="lab")=>{t===void 0&&(t=0);let a={mode:r,l:e,a:n?n*Math.cos(t/180*Math.PI):0,b:n?n*Math.sin(t/180*Math.PI):0};return i!==void 0&&(a.alpha=i),a},bi=Math.pow(29,3)/Math.pow(3,3),gi=Math.pow(6,3)/Math.pow(29,3),T={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},Le={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Wt=e=>Math.pow(e,3)>gi?Math.pow(e,3):(116*e-16)/bi;const mi=({l:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=(e+16)/116,a=n/500+r,s=r-t/200,c={mode:"xyz65",x:Wt(a)*Le.X,y:Wt(r)*Le.Y,z:Wt(s)*Le.Z};return i!==void 0&&(c.alpha=i),c},bt=e=>xe(mi(e)),Gt=e=>e>gi?Math.cbrt(e):(bi*e+16)/116,vi=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Gt(e/Le.X),a=Gt(n/Le.Y),s=Gt(t/Le.Z),c={mode:"lab65",l:116*a-16,a:500*(r-a),b:200*(a-s)};return i!==void 0&&(c.alpha=i),c},gt=e=>{let n=vi(ve(e));return e.r===e.b&&e.b===e.g&&(n.a=n.b=0),n},mt=1,xi=1,Xe=26/180*Math.PI,vt=Math.cos(Xe),xt=Math.sin(Xe),yi=100/Math.log(139/100),Vt=({l:e,c:n,h:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r={mode:"lab65",l:(Math.exp(e*mt/yi)-1)/.0039},a=(Math.exp(.0435*n*xi*mt)-1)/.075,s=a*Math.cos(t/180*Math.PI-Xe),c=a*Math.sin(t/180*Math.PI-Xe);return r.a=s*vt-c/.83*xt,r.b=s*xt+c/.83*vt,i!==void 0&&(r.alpha=i),r},Ut=({l:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=n*vt+t*xt,a=.83*(t*vt-n*xt),s=Math.sqrt(r*r+a*a),c={mode:"dlch",l:yi/mt*Math.log(1+.0039*e),c:Math.log(1+.075*s)/(.0435*xi*mt)};return c.c&&(c.h=N((Math.atan2(a,r)+Xe)/Math.PI*180)),i!==void 0&&(c.alpha=i),c},Mi=e=>Vt(de(e,"dlch")),wi=e=>pe(Ut(e),"dlab"),La={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Mi,rgb:e=>bt(Mi(e))},fromMode:{lab65:wi,rgb:e=>wi(gt(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:u,a:u,b:u,alpha:{use:u,fixup:P}}},Ta={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Vt,dlab:e=>pe(e,"dlab"),rgb:e=>bt(Vt(e))},fromMode:{lab65:Ut,dlab:e=>de(e,"dlch"),rgb:e=>Ut(gt(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:u,c:u,h:{use:u,fixup:V},alpha:{use:u,fixup:P}},difference:{h:ft},average:{h:U}};function Ca({h:e,s:n,i:t,alpha:i}){e=N(e!==void 0?e:0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:t*(1+n*(3/(2-r)-1)),g:t*(1+n*(3*(1-r)/(2-r)-1)),b:t*(1-n)};break;case 1:a={r:t*(1+n*(3*(1-r)/(2-r)-1)),g:t*(1+n*(3/(2-r)-1)),b:t*(1-n)};break;case 2:a={r:t*(1-n),g:t*(1+n*(3/(2-r)-1)),b:t*(1+n*(3*(1-r)/(2-r)-1))};break;case 3:a={r:t*(1-n),g:t*(1+n*(3*(1-r)/(2-r)-1)),b:t*(1+n*(3/(2-r)-1))};break;case 4:a={r:t*(1+n*(3*(1-r)/(2-r)-1)),g:t*(1-n),b:t*(1+n*(3/(2-r)-1))};break;case 5:a={r:t*(1+n*(3/(2-r)-1)),g:t*(1-n),b:t*(1+n*(3*(1-r)/(2-r)-1))};break;default:a={r:t*(1-n),g:t*(1-n),b:t*(1-n)}}return a.mode="rgb",i!==void 0&&(a.alpha=i),a}function Sa({r:e,g:n,b:t,alpha:i}){e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.max(e,n,t),a=Math.min(e,n,t),s={mode:"hsi",s:e+n+t===0?0:1-3*a/(e+n+t),i:(e+n+t)/3};return r-a!==0&&(s.h=(r===e?(n-t)/(r-a)+(n<t)*6:r===n?(t-e)/(r-a)+2:(e-n)/(r-a)+4)*60),i!==void 0&&(s.alpha=i),s}const Pa={mode:"hsi",toMode:{rgb:Ca},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Sa},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:u,fixup:V},s:u,i:u,alpha:{use:u,fixup:P}},difference:{h:ut},average:{h:U}};function Ea({h:e,s:n,l:t,alpha:i}){e=N(e!==void 0?e:0),n===void 0&&(n=0),t===void 0&&(t=0);let r=t+n*(t<.5?t:1-t),a=r-(r-t)*2*Math.abs(e/60%2-1),s;switch(Math.floor(e/60)){case 0:s={r,g:a,b:2*t-r};break;case 1:s={r:a,g:r,b:2*t-r};break;case 2:s={r:2*t-r,g:r,b:a};break;case 3:s={r:2*t-r,g:a,b:r};break;case 4:s={r:a,g:2*t-r,b:r};break;case 5:s={r,g:2*t-r,b:a};break;default:s={r:2*t-r,g:2*t-r,b:2*t-r}}return s.mode="rgb",i!==void 0&&(s.alpha=i),s}function Ha({r:e,g:n,b:t,alpha:i}){e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.max(e,n,t),a=Math.min(e,n,t),s={mode:"hsl",s:r===a?0:(r-a)/(1-Math.abs(r+a-1)),l:.5*(r+a)};return r-a!==0&&(s.h=(r===e?(n-t)/(r-a)+(n<t)*6:r===n?(t-e)/(r-a)+2:(e-n)/(r-a)+4)*60),i!==void 0&&(s.alpha=i),s}const Na=(e,n)=>{switch(n){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},Ia=new RegExp(`^hsla?\\(\\s*${ra}${ze}${qe}${ze}${qe}\\s*(?:,\\s*${Xt}\\s*)?\\)$`),Ra=e=>{let n=e.match(Ia);if(!n)return;let t={mode:"hsl"};return n[3]!==void 0?t.h=+n[3]:n[1]!==void 0&&n[2]!==void 0&&(t.h=Na(n[1],n[2])),n[4]!==void 0&&(t.s=Math.min(Math.max(0,n[4]/100),1)),n[5]!==void 0&&(t.l=Math.min(Math.max(0,n[5]/100),1)),n[6]!==void 0?t.alpha=Math.max(0,Math.min(1,n[6]/100)):n[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+n[7]))),t};function qa(e,n){if(!n||n[0]!=="hsl"&&n[0]!=="hsla")return;const t={mode:"hsl"},[,i,r,a,s]=n;if(i.type!==h.None){if(i.type===h.Percentage)return;t.h=i.value}if(r.type!==h.None){if(r.type===h.Hue)return;t.s=r.value/100}if(a.type!==h.None){if(a.type===h.Hue)return;t.l=a.value/100}return s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const ki={mode:"hsl",toMode:{rgb:Ea},fromMode:{rgb:Ha},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[qa,Ra],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:u,fixup:V},s:u,l:u,alpha:{use:u,fixup:P}},difference:{h:ut},average:{h:U}};function zi({h:e,s:n,v:t,alpha:i}){e=N(e!==void 0?e:0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:t,g:t*(1-n*r),b:t*(1-n)};break;case 1:a={r:t*(1-n*r),g:t,b:t*(1-n)};break;case 2:a={r:t*(1-n),g:t,b:t*(1-n*r)};break;case 3:a={r:t*(1-n),g:t*(1-n*r),b:t};break;case 4:a={r:t*(1-n*r),g:t*(1-n),b:t};break;case 5:a={r:t,g:t*(1-n),b:t*(1-n*r)};break;default:a={r:t*(1-n),g:t*(1-n),b:t*(1-n)}}return a.mode="rgb",i!==void 0&&(a.alpha=i),a}function $i({r:e,g:n,b:t,alpha:i}){e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.max(e,n,t),a=Math.min(e,n,t),s={mode:"hsv",s:r===0?0:1-a/r,v:r};return r-a!==0&&(s.h=(r===e?(n-t)/(r-a)+(n<t)*6:r===n?(t-e)/(r-a)+2:(e-n)/(r-a)+4)*60),i!==void 0&&(s.alpha=i),s}const Ai={mode:"hsv",toMode:{rgb:zi},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:$i},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:u,fixup:V},s:u,v:u,alpha:{use:u,fixup:P}},difference:{h:ut},average:{h:U}};function Fa({h:e,w:n,b:t,alpha:i}){if(n===void 0&&(n=0),t===void 0&&(t=0),n+t>1){let r=n+t;n/=r,t/=r}return zi({h:e,s:t===1?1:1-n/(1-t),v:1-t,alpha:i})}function Xa(e){let n=$i(e);if(n===void 0)return;let t=n.s!==void 0?n.s:0,i=n.v!==void 0?n.v:0,r={mode:"hwb",w:(1-t)*i,b:1-i};return n.h!==void 0&&(r.h=n.h),n.alpha!==void 0&&(r.alpha=n.alpha),r}function Oa(e,n){if(!n||n[0]!=="hwb")return;const t={mode:"hwb"},[,i,r,a,s]=n;if(i.type!==h.None){if(i.type===h.Percentage)return;t.h=i.value}if(r.type!==h.None){if(r.type===h.Hue)return;t.w=r.value/100}if(a.type!==h.None){if(a.type===h.Hue)return;t.b=a.value/100}return s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const Da={mode:"hwb",toMode:{rgb:Fa},fromMode:{rgb:Xa},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Oa],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:u,fixup:V},w:u,b:u,alpha:{use:u,fixup:P}},difference:{h:Aa},average:{h:U}},_i=203,yt=.1593017578125,Li=78.84375,Mt=.8359375,wt=18.8515625,kt=18.6875;function Jt(e){if(e<0)return 0;const n=Math.pow(e,1/Li);return 1e4*Math.pow(Math.max(0,n-Mt)/(wt-kt*n),1/yt)}function Kt(e){if(e<0)return 0;const n=Math.pow(e/1e4,yt);return Math.pow((Mt+wt*n)/(1+kt*n),Li)}const Qt=e=>Math.max(e/_i,0),Ti=({i:e,t:n,p:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);const r=Jt(e+.008609037037932761*n+.11102962500302593*t),a=Jt(e-.00860903703793275*n-.11102962500302599*t),s=Jt(e+.5600313357106791*n-.32062717498731885*t),c={mode:"xyz65",x:Qt(2.070152218389422*r-1.3263473389671556*a+.2066510476294051*s),y:Qt(.3647385209748074*r+.680566024947227*a-.0453045459220346*s),z:Qt(-.049747207535812*r-.0492609666966138*a+1.1880659249923042*s)};return i!==void 0&&(c.alpha=i),c},en=(e=0)=>Math.max(e*_i,0),Ci=({x:e,y:n,z:t,alpha:i})=>{const r=en(e),a=en(n),s=en(t),c=Kt(.3592832590121217*r+.6976051147779502*a-.0358915932320289*s),p=Kt(-.1920808463704995*r+1.1004767970374323*a+.0753748658519118*s),f=Kt(.0070797844607477*r+.0748396662186366*a+.8433265453898765*s),b=.5*c+.5*p,x=1.61376953125*c-3.323486328125*p+1.709716796875*f,v=4.378173828125*c-4.24560546875*p-.132568359375*f,M={mode:"itp",i:b,t:x,p:v};return i!==void 0&&(M.alpha=i),M},ja={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Ti,rgb:e=>xe(Ti(e))},fromMode:{xyz65:Ci,rgb:e=>Ci(ve(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:u,t:u,p:u,alpha:{use:u,fixup:P}}},Ya=134.03437499999998,Za=16295499532821565e-27,tn=e=>{if(e<0)return 0;let n=Math.pow(e/1e4,yt);return Math.pow((Mt+wt*n)/(1+kt*n),Ya)},nn=(e=0)=>Math.max(e*203,0),Si=({x:e,y:n,z:t,alpha:i})=>{e=nn(e),n=nn(n),t=nn(t);let r=1.15*e-.15*t,a=.66*n+.34*e,s=tn(.41478972*r+.579999*a+.014648*t),c=tn(-.20151*r+1.120649*a+.0531008*t),p=tn(-.0166008*r+.2648*a+.6684799*t),f=(s+c)/2,b={mode:"jab",j:.44*f/(1-.56*f)-Za,a:3.524*s-4.066708*c+.542708*p,b:.199076*s+1.096799*c-1.295875*p};return i!==void 0&&(b.alpha=i),b},Ba=134.03437499999998,Pi=16295499532821565e-27,rn=e=>{if(e<0)return 0;let n=Math.pow(e,1/Ba);return 1e4*Math.pow((Mt-n)/(kt*n-wt),1/yt)},an=e=>e/203,Ei=({j:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=(e+Pi)/(.44+.56*(e+Pi)),a=rn(r+.13860504*n+.058047316*t),s=rn(r-.13860504*n-.058047316*t),c=rn(r-.096019242*n-.8118919*t),p={mode:"xyz65",x:an(1.661373024652174*a-.914523081304348*s+.23136208173913045*c),y:an(-.3250758611844533*a+1.571847026732543*s-.21825383453227928*c),z:an(-.090982811*a-.31272829*s+1.5227666*c)};return i!==void 0&&(p.alpha=i),p},Hi=e=>{let n=Si(ve(e));return e.r===e.b&&e.b===e.g&&(n.a=n.b=0),n},Ni=e=>xe(Ei(e)),Wa={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:Hi,xyz65:Si},toMode:{rgb:Ni,xyz65:Ei},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:u,a:u,b:u,alpha:{use:u,fixup:P}}},Ii=({j:e,a:n,b:t,alpha:i})=>{n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.sqrt(n*n+t*t),a={mode:"jch",j:e,c:r};return r&&(a.h=N(Math.atan2(t,n)*180/Math.PI)),i!==void 0&&(a.alpha=i),a},Ri=({j:e,c:n,h:t,alpha:i})=>{t===void 0&&(t=0);let r={mode:"jab",j:e,a:n?n*Math.cos(t/180*Math.PI):0,b:n?n*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Ga={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Ri,rgb:e=>Ni(Ri(e))},fromMode:{rgb:e=>Ii(Hi(e)),jab:Ii},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:u,fixup:V},c:u,j:u,alpha:{use:u,fixup:P}},difference:{h:ft},average:{h:U}},zt=Math.pow(29,3)/Math.pow(3,3),sn=Math.pow(6,3)/Math.pow(29,3);let on=e=>Math.pow(e,3)>sn?Math.pow(e,3):(116*e-16)/zt;const ln=({l:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=(e+16)/116,a=n/500+r,s=r-t/200,c={mode:"xyz50",x:on(a)*T.X,y:on(r)*T.Y,z:on(s)*T.Z};return i!==void 0&&(c.alpha=i),c},Oe=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=_e({r:e*3.1341359569958707-n*1.6173863321612538-.4906619460083532*t,g:e*-.978795502912089+n*1.916254567259524+.03344273116131949*t,b:e*.07195537988411677-n*.2289768264158322+1.405386058324125*t});return i!==void 0&&(r.alpha=i),r},qi=e=>Oe(ln(e)),De=e=>{let{r:n,g:t,b:i,alpha:r}=Ae(e),a={mode:"xyz50",x:.436065742824811*n+.3851514688337912*t+.14307845442264197*i,y:.22249319175623702*n+.7168870538238823*t+.06061979053616537*i,z:.013923904500943465*n+.09708128566574634*t+.7140993584005155*i};return r!==void 0&&(a.alpha=r),a},cn=e=>e>sn?Math.cbrt(e):(zt*e+16)/116,dn=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=cn(e/T.X),a=cn(n/T.Y),s=cn(t/T.Z),c={mode:"lab",l:116*a-16,a:500*(r-a),b:200*(a-s)};return i!==void 0&&(c.alpha=i),c},Fi=e=>{let n=dn(De(e));return e.r===e.b&&e.b===e.g&&(n.a=n.b=0),n};function Va(e,n){if(!n||n[0]!=="lab")return;const t={mode:"lab"},[,i,r,a,s]=n;if(!(i.type===h.Hue||r.type===h.Hue||a.type===h.Hue))return i.type!==h.None&&(t.l=Math.min(Math.max(0,i.value),100)),r.type!==h.None&&(t.a=r.type===h.Number?r.value:r.value*125/100),a.type!==h.None&&(t.b=a.type===h.Number?a.value:a.value*125/100),s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const pn={mode:"lab",toMode:{xyz50:ln,rgb:qi},fromMode:{xyz50:dn,rgb:Fi},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[Va],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:u,a:u,b:u,alpha:{use:u,fixup:P}}},Ua={...pn,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:mi,rgb:bt},fromMode:{xyz65:vi,rgb:gt},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}};function Ja(e,n){if(!n||n[0]!=="lch")return;const t={mode:"lch"},[,i,r,a,s]=n;if(i.type!==h.None){if(i.type===h.Hue)return;t.l=Math.min(Math.max(0,i.value),100)}if(r.type!==h.None&&(t.c=Math.max(0,r.type===h.Number?r.value:r.value*150/100)),a.type!==h.None){if(a.type===h.Percentage)return;t.h=a.value}return s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const hn={mode:"lch",toMode:{lab:pe,rgb:e=>qi(pe(e))},fromMode:{rgb:e=>de(Fi(e)),lab:de},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[Ja],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:u,fixup:V},c:u,l:u,alpha:{use:u,fixup:P}},difference:{h:ft},average:{h:U}},Ka={...hn,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>pe(e,"lab65"),rgb:e=>bt(pe(e,"lab65"))},fromMode:{rgb:e=>de(gt(e),"lch65"),lab65:e=>de(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},Xi=({l:e,u:n,v:t,alpha:i})=>{n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.sqrt(n*n+t*t),a={mode:"lchuv",l:e,c:r};return r&&(a.h=N(Math.atan2(t,n)*180/Math.PI)),i!==void 0&&(a.alpha=i),a},Oi=({l:e,c:n,h:t,alpha:i})=>{t===void 0&&(t=0);let r={mode:"luv",l:e,u:n?n*Math.cos(t/180*Math.PI):0,v:n?n*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Di=(e,n,t)=>4*e/(e+15*n+3*t),ji=(e,n,t)=>9*n/(e+15*n+3*t),Qa=Di(T.X,T.Y,T.Z),es=ji(T.X,T.Y,T.Z),ts=e=>e<=sn?zt*e:116*Math.cbrt(e)-16,un=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=ts(n/T.Y),a=Di(e,n,t),s=ji(e,n,t);!isFinite(a)||!isFinite(s)?r=a=s=0:(a=13*r*(a-Qa),s=13*r*(s-es));let c={mode:"luv",l:r,u:a,v:s};return i!==void 0&&(c.alpha=i),c},ns=(e,n,t)=>4*e/(e+15*n+3*t),is=(e,n,t)=>9*n/(e+15*n+3*t),rs=ns(T.X,T.Y,T.Z),as=is(T.X,T.Y,T.Z),fn=({l:e,u:n,v:t,alpha:i})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};n===void 0&&(n=0),t===void 0&&(t=0);let r=n/(13*e)+rs,a=t/(13*e)+as,s=T.Y*(e<=8?e/zt:Math.pow((e+16)/116,3)),c=s*(9*r)/(4*a),p=s*(12-3*r-20*a)/(4*a),f={mode:"xyz50",x:c,y:s,z:p};return i!==void 0&&(f.alpha=i),f},ss={mode:"lchuv",toMode:{luv:Oi,rgb:e=>Oe(fn(Oi(e)))},fromMode:{rgb:e=>Xi(un(De(e))),luv:Xi},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:u,fixup:V},c:u,l:u,alpha:{use:u,fixup:P}},difference:{h:ft},average:{h:U}},os={...$e,mode:"lrgb",toMode:{rgb:_e},fromMode:{rgb:Ae},parse:["srgb-linear"],serialize:"srgb-linear"},ls={mode:"luv",toMode:{xyz50:fn,rgb:e=>Oe(fn(e))},fromMode:{xyz50:un,rgb:e=>un(De(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:u,u,v:u,alpha:{use:u,fixup:P}}},Yi=({r:e,g:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.cbrt(.412221469470763*e+.5363325372617348*n+.0514459932675022*t),a=Math.cbrt(.2119034958178252*e+.6806995506452344*n+.1073969535369406*t),s=Math.cbrt(.0883024591900564*e+.2817188391361215*n+.6299787016738222*t),c={mode:"oklab",l:.210454268309314*r+.7936177747023054*a-.0040720430116193*s,a:1.9779985324311684*r-2.42859224204858*a+.450593709617411*s,b:.0259040424655478*r+.7827717124575296*a-.8086757549230774*s};return i!==void 0&&(c.alpha=i),c},$t=e=>{let n=Yi(Ae(e));return e.r===e.b&&e.b===e.g&&(n.a=n.b=0),n},je=({l:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.pow(e+.3963377773761749*n+.2158037573099136*t,3),a=Math.pow(e-.1055613458156586*n-.0638541728258133*t,3),s=Math.pow(e-.0894841775298119*n-1.2914855480194092*t,3),c={mode:"lrgb",r:4.076741636075957*r-3.3077115392580616*a+.2309699031821044*s,g:-1.2684379732850317*r+2.6097573492876887*a-.3413193760026573*s,b:-.0041960761386756*r-.7034186179359362*a+1.7076146940746117*s};return i!==void 0&&(c.alpha=i),c},At=e=>_e(je(e));function bn(e){const i=1.170873786407767;return .5*(i*e-.206+Math.sqrt((i*e-.206)*(i*e-.206)+4*.03*i*e))}function _t(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function cs(e,n){let t,i,r,a,s,c,p,f;-1.88170328*e-.80936493*n>1?(t=1.19086277,i=1.76576728,r=.59662641,a=.75515197,s=.56771245,c=4.0767416621,p=-3.3077115913,f=.2309699292):1.81444104*e-1.19445276*n>1?(t=.73956515,i=-.45954404,r=.08285427,a=.1254107,s=.14503204,c=-1.2684380046,p=2.6097574011,f=-.3413193965):(t=1.35733652,i=-.00915799,r=-1.1513021,a=-.50559606,s=.00692167,c=-.0041960863,p=-.7034186147,f=1.707614701);let b=t+i*e+r*n+a*e*e+s*e*n,x=.3963377774*e+.2158037573*n,v=-.1055613458*e-.0638541728*n,M=-.0894841775*e-1.291485548*n;{let _=1+b*x,A=1+b*v,C=1+b*M,E=_*_*_,S=A*A*A,me=C*C*C,Ge=3*x*_*_,Ve=3*v*A*A,Ue=3*M*C*C,Je=6*x*x*_,Ke=6*v*v*A,Qe=6*M*M*C,Ie=c*E+p*S+f*me,we=c*Ge+p*Ve+f*Ue,et=c*Je+p*Ke+f*Qe;b=b-Ie*we/(we*we-.5*Ie*et)}return b}function gn(e,n){let t=cs(e,n),i=je({l:1,a:t*e,b:t*n}),r=Math.cbrt(1/Math.max(i.r,i.g,i.b)),a=r*t;return[r,a]}function ds(e,n,t,i,r,a=null){a||(a=gn(e,n));let s;if((t-r)*a[1]-(a[0]-r)*i<=0)s=a[1]*r/(i*a[0]+a[1]*(r-t));else{s=a[1]*(r-1)/(i*(a[0]-1)+a[1]*(r-t));{let c=t-r,p=i,f=.3963377774*e+.2158037573*n,b=-.1055613458*e-.0638541728*n,x=-.0894841775*e-1.291485548*n,v=c+p*f,M=c+p*b,_=c+p*x;{let A=r*(1-s)+s*t,C=s*i,E=A+C*f,S=A+C*b,me=A+C*x,Ge=E*E*E,Ve=S*S*S,Ue=me*me*me,Je=3*v*E*E,Ke=3*M*S*S,Qe=3*_*me*me,Ie=6*v*v*E,we=6*M*M*S,et=6*_*_*me,zr=4.0767416621*Ge-3.3077115913*Ve+.2309699292*Ue-1,Nn=4.0767416621*Je-3.3077115913*Ke+.2309699292*Qe,so=4.0767416621*Ie-3.3077115913*we+.2309699292*et,$r=Nn/(Nn*Nn-.5*zr*so),In=-zr*$r,Ar=-1.2684380046*Ge+2.6097574011*Ve-.3413193965*Ue-1,Rn=-1.2684380046*Je+2.6097574011*Ke-.3413193965*Qe,oo=-1.2684380046*Ie+2.6097574011*we-.3413193965*et,_r=Rn/(Rn*Rn-.5*Ar*oo),qn=-Ar*_r,Lr=-.0041960863*Ge-.7034186147*Ve+1.707614701*Ue-1,Fn=-.0041960863*Je-.7034186147*Ke+1.707614701*Qe,lo=-.0041960863*Ie-.7034186147*we+1.707614701*et,Tr=Fn/(Fn*Fn-.5*Lr*lo),Xn=-Lr*Tr;In=$r>=0?In:1e6,qn=_r>=0?qn:1e6,Xn=Tr>=0?Xn:1e6,s+=Math.min(In,Math.min(qn,Xn))}}}return s}function mn(e,n,t=null){t||(t=gn(e,n));let i=t[0],r=t[1];return[r/i,r/(1-i)]}function Zi(e,n,t){let i=gn(n,t),r=ds(n,t,e,1,e,i),a=mn(n,t,i),s=.11516993+1/(7.4477897+4.1590124*t+n*(-2.19557347+1.75198401*t+n*(-2.13704948-10.02301043*t+n*(-4.24894561+5.38770819*t+4.69891013*n)))),c=.11239642+1/(1.6132032-.68124379*t+n*(.40370612+.90148123*t+n*(-.27087943+.6122399*t+n*(.00299215-.45399568*t-.14661872*n)))),p=r/Math.min(e*a[0],(1-e)*a[1]),f=e*s,b=(1-e)*c,x=.9*p*Math.sqrt(Math.sqrt(1/(1/(f*f*f*f)+1/(b*b*b*b))));return f=e*.4,b=(1-e)*.8,[Math.sqrt(1/(1/(f*f)+1/(b*b))),x,r]}function Bi(e){const n=e.l!==void 0?e.l:0,t=e.a!==void 0?e.a:0,i=e.b!==void 0?e.b:0,r={mode:"okhsl",l:bn(n)};e.alpha!==void 0&&(r.alpha=e.alpha);let a=Math.sqrt(t*t+i*i);if(!a)return r.s=0,r;let[s,c,p]=Zi(n,t/a,i/a),f;if(a<c){let b=0,x=.8*s,v=1-x/c;f=(a-b)/(x+v*(a-b))*.8}else{let b=c,x=.2*c*c*1.25*1.25/s,v=1-x/(p-c);f=.8+.2*((a-b)/(x+v*(a-b)))}return f&&(r.s=f,r.h=N(Math.atan2(i,t)*180/Math.PI)),r}function Wi(e){let n=e.h!==void 0?e.h:0,t=e.s!==void 0?e.s:0,i=e.l!==void 0?e.l:0;const r={mode:"oklab",l:_t(i)};if(e.alpha!==void 0&&(r.alpha=e.alpha),!t||i===1)return r.a=r.b=0,r;let a=Math.cos(n/180*Math.PI),s=Math.sin(n/180*Math.PI),[c,p,f]=Zi(r.l,a,s),b,x,v,M;t<.8?(b=1.25*t,x=0,v=.8*c,M=1-v/p):(b=5*(t-.8),x=p,v=.2*p*p*1.25*1.25/c,M=1-v/(f-p));let _=x+b*v/(1-M*b);return r.a=_*a,r.b=_*s,r}const ps={...ki,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:Bi,rgb:e=>Bi($t(e))},toMode:{oklab:Wi,rgb:e=>At(Wi(e))}};function Gi(e){let n=e.l!==void 0?e.l:0,t=e.a!==void 0?e.a:0,i=e.b!==void 0?e.b:0,r=Math.sqrt(t*t+i*i),a=r?t/r:1,s=r?i/r:1,[c,p]=mn(a,s),f=.5,b=1-f/c,x=p/(r+n*p),v=x*n,M=x*r,_=_t(v),A=M*_/v,C=je({l:_,a:a*A,b:s*A}),E=Math.cbrt(1/Math.max(C.r,C.g,C.b,0));n=n/E,r=r/E*bn(n)/n,n=bn(n);const S={mode:"okhsv",s:r?(f+p)*M/(p*f+p*b*M):0,v:n?n/v:0};return S.s&&(S.h=N(Math.atan2(i,t)*180/Math.PI)),e.alpha!==void 0&&(S.alpha=e.alpha),S}function Vi(e){const n={mode:"oklab"};e.alpha!==void 0&&(n.alpha=e.alpha);const t=e.h!==void 0?e.h:0,i=e.s!==void 0?e.s:0,r=e.v!==void 0?e.v:0,a=Math.cos(t/180*Math.PI),s=Math.sin(t/180*Math.PI),[c,p]=mn(a,s),f=.5,b=1-f/c,x=1-i*f/(f+p-p*b*i),v=i*p*f/(f+p-p*b*i),M=_t(x),_=v*M/x,A=je({l:M,a:a*_,b:s*_}),C=Math.cbrt(1/Math.max(A.r,A.g,A.b,0)),E=_t(r*x),S=v*E/x;return n.l=E*C,n.a=S*a*C,n.b=S*s*C,n}const hs={...Ai,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Gi,rgb:e=>Gi($t(e))},toMode:{oklab:Vi,rgb:e=>At(Vi(e))}};function us(e,n){if(!n||n[0]!=="oklab")return;const t={mode:"oklab"},[,i,r,a,s]=n;if(!(i.type===h.Hue||r.type===h.Hue||a.type===h.Hue))return i.type!==h.None&&(t.l=Math.min(Math.max(0,i.type===h.Number?i.value:i.value/100),1)),r.type!==h.None&&(t.a=r.type===h.Number?r.value:r.value*.4/100),a.type!==h.None&&(t.b=a.type===h.Number?a.value:a.value*.4/100),s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const fs={...pn,mode:"oklab",toMode:{lrgb:je,rgb:At},fromMode:{lrgb:Yi,rgb:$t},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[us],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`};function bs(e,n){if(!n||n[0]!=="oklch")return;const t={mode:"oklch"},[,i,r,a,s]=n;if(i.type!==h.None){if(i.type===h.Hue)return;t.l=Math.min(Math.max(0,i.type===h.Number?i.value:i.value/100),1)}if(r.type!==h.None&&(t.c=Math.max(0,r.type===h.Number?r.value:r.value*.4/100)),a.type!==h.None){if(a.type===h.Percentage)return;t.h=a.value}return s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const gs={...hn,mode:"oklch",toMode:{oklab:e=>pe(e,"oklab"),rgb:e=>At(pe(e,"oklab"))},fromMode:{rgb:e=>de($t(e),"oklch"),oklab:e=>de(e,"oklch")},parse:[bs],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},Ui=e=>{let{r:n,g:t,b:i,alpha:r}=Ae(e),a={mode:"xyz65",x:.486570948648216*n+.265667693169093*t+.1982172852343625*i,y:.2289745640697487*n+.6917385218365062*t+.079286914093745*i,z:0*n+.0451133818589026*t+1.043944368900976*i};return r!==void 0&&(a.alpha=r),a},Ji=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=_e({r:e*2.4934969119414263-n*.9313836179191242-.402710784450717*t,g:e*-.8294889695615749+n*1.7626640603183465+.0236246858419436*t,b:e*.0358458302437845-n*.0761723892680418+.9568845240076871*t},"p3");return i!==void 0&&(r.alpha=i),r},ms={...$e,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>Ji(ve(e)),xyz65:Ji},toMode:{rgb:e=>xe(Ui(e)),xyz65:Ui}},vn=e=>{let n=Math.abs(e);return n>=1/512?Math.sign(e)*Math.pow(n,1/1.8):16*e},Ki=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r={mode:"prophoto",r:vn(e*1.3457868816471585-n*.2555720873797946-.0511018649755453*t),g:vn(e*-.5446307051249019+n*1.5082477428451466+.0205274474364214*t),b:vn(e*0+n*0+1.2119675456389452*t)};return i!==void 0&&(r.alpha=i),r},xn=(e=0)=>{let n=Math.abs(e);return n>=16/512?Math.sign(e)*Math.pow(n,1.8):e/16},Qi=e=>{let n=xn(e.r),t=xn(e.g),i=xn(e.b),r={mode:"xyz50",x:.7977666449006423*n+.1351812974005331*t+.0313477341283922*i,y:.2880748288194013*n+.7118352342418731*t+899369387256e-16*i,z:0*n+0*t+.8251046025104602*i};return e.alpha!==void 0&&(r.alpha=e.alpha),r},vs={...$e,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:Ki,rgb:e=>Ki(De(e))},toMode:{xyz50:Qi,rgb:e=>Oe(Qi(e))}},er=1.09929682680944,xs=.018053968510807,yn=e=>{const n=Math.abs(e);return n>xs?(Math.sign(e)||1)*(er*Math.pow(n,.45)-(er-1)):4.5*e},tr=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r={mode:"rec2020",r:yn(e*1.7166511879712683-n*.3556707837763925-.2533662813736599*t),g:yn(e*-.6666843518324893+n*1.6164812366349395+.0157685458139111*t),b:yn(e*.0176398574453108-n*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(r.alpha=i),r},nr=1.09929682680944,ys=.018053968510807,Mn=(e=0)=>{let n=Math.abs(e);return n<ys*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((n+nr-1)/nr,1/.45)},ir=e=>{let n=Mn(e.r),t=Mn(e.g),i=Mn(e.b),r={mode:"xyz65",x:.6369580483012911*n+.1446169035862083*t+.1688809751641721*i,y:.262700212011267*n+.6779980715188708*t+.059301716469862*i,z:0*n+.0280726930490874*t+1.0609850577107909*i};return e.alpha!==void 0&&(r.alpha=e.alpha),r},Ms={...$e,mode:"rec2020",fromMode:{xyz65:tr,rgb:e=>tr(ve(e))},toMode:{xyz65:ir,rgb:e=>xe(ir(e))},parse:["rec2020"],serialize:"rec2020"},ye=.0037930732552754493,rr=Math.cbrt(ye),wn=e=>Math.cbrt(e)-rr,ws=e=>{const{r:n,g:t,b:i,alpha:r}=Ae(e),a=wn(.3*n+.622*t+.078*i+ye),s=wn(.23*n+.692*t+.078*i+ye),c=wn(.2434226892454782*n+.2047674442449682*t+.5518098665095535*i+ye),p={mode:"xyb",x:(a-s)/2,y:(a+s)/2,b:c-(a+s)/2};return r!==void 0&&(p.alpha=r),p},kn=e=>Math.pow(e+rr,3),ks={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:({x:e,y:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);const r=kn(e+n)-ye,a=kn(n-e)-ye,s=kn(t+n)-ye,c=_e({r:11.031566904639861*r-9.866943908131562*a-.16462299650829934*s,g:-3.2541473810744237*r+4.418770377582723*a-.16462299650829934*s,b:-3.6588512867136815*r+2.7129230459360922*a+1.9459282407775895*s});return i!==void 0&&(c.alpha=i),c}},fromMode:{rgb:ws},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:u,y:u,b:u,alpha:{use:u,fixup:P}}},zs={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Oe,lab:dn},fromMode:{rgb:De,lab:ln},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:u,y:u,z:u,alpha:{use:u,fixup:P}}},$s={mode:"xyz65",toMode:{rgb:xe,xyz50:e=>{let{x:n,y:t,z:i,alpha:r}=e;n===void 0&&(n=0),t===void 0&&(t=0),i===void 0&&(i=0);let a={mode:"xyz50",x:1.0479298208405488*n+.0229467933410191*t-.0501922295431356*i,y:.0296278156881593*n+.990434484573249*t-.0170738250293851*i,z:-.0092430581525912*n+.0150551448965779*t+.7518742899580008*i};return r!==void 0&&(a.alpha=r),a}},fromMode:{rgb:ve,xyz50:e=>{let{x:n,y:t,z:i,alpha:r}=e;n===void 0&&(n=0),t===void 0&&(t=0),i===void 0&&(i=0);let a={mode:"xyz65",x:.9554734527042182*n-.0230985368742614*t+.0632593086610217*i,y:-.0283697069632081*n+1.0099954580058226*t+.021041398966943*i,z:.0123140016883199*n-.0205076964334779*t+1.3303659366080753*i};return r!==void 0&&(a.alpha=r),a}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:u,y:u,z:u,alpha:{use:u,fixup:P}}},As={mode:"yiq",toMode:{rgb:({y:e,i:n,q:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);const r={mode:"rgb",r:e+.95608445*n+.6208885*t,g:e-.27137664*n-.6486059*t,b:e-1.10561724*n+1.70250126*t};return i!==void 0&&(r.alpha=i),r}},fromMode:{rgb:({r:e,g:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);const r={mode:"yiq",y:.29889531*e+.58662247*n+.11448223*t,i:.59597799*e-.2741761*n-.32180189*t,q:.21147017*e-.52261711*n+.31114694*t};return i!==void 0&&(r.alpha=i),r}},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:u,i:u,q:u,alpha:{use:u,fixup:P}}},_s=e=>Math.max(0,Math.min(1,e||0)),zn=e=>Math.round(_s(e)*255),Ls=O("rgb"),Ts=e=>{if(e===void 0)return;let n=zn(e.r),t=zn(e.g),i=zn(e.b);return"#"+(1<<24|n<<16|t<<8|i).toString(16).slice(1)},Cs=e=>Ts(Ls(e)),ar=O("rgb"),sr=e=>{const n={mode:e.mode,r:Math.max(0,Math.min(e.r!==void 0?e.r:0,1)),g:Math.max(0,Math.min(e.g!==void 0?e.g:0,1)),b:Math.max(0,Math.min(e.b!==void 0?e.b:0,1))};return e.alpha!==void 0&&(n.alpha=e.alpha),n},Ss=e=>sr(ar(e)),or=e=>e!==void 0&&(e.r===void 0||e.r>=0&&e.r<=1)&&(e.g===void 0||e.g>=0&&e.g<=1)&&(e.b===void 0||e.b>=0&&e.b<=1);function Ps(e){return or(ar(e))}function lr(e="rgb"){const{gamut:n}=ct(e);if(!n)return i=>!0;const t=O(typeof n=="string"?n:e);return i=>or(t(i))}function Es(e="rgb"){const{gamut:n}=ct(e);if(!n)return a=>ot(a);const t=typeof n=="string"?n:e,i=O(t),r=lr(t);return a=>{const s=ot(a);if(!s)return;const c=i(s);if(r(c))return s;const p=sr(c);return s.mode===p.mode?p:O(s.mode)(p)}}function Hs(e,n="lch",t="rgb"){e=ot(e);let i=t==="rgb"?Ps:lr(t),r=t==="rgb"?Ss:Es(t);if(e===void 0||i(e))return e;let a=O(e.mode);e=O(n)(e);let s={...e,c:0};if(!i(s))return a(r(s));let c=0,p=e.c!==void 0?e.c:0,f=ct(n).ranges.c,b=(f[1]-f[0])/Math.pow(2,13),x=s.c;for(;p-c>b;)s.c=c+(p-c)*.5,i(s)?(x=s.c,c=s.c):p=s.c;return a(i(s)?s:{...s,c:x})}z(ya),z(_a),z(La),z(Ta),z(Pa),z(ki),z(Ai),z(Da),z(ja),z(Wa),z(Ga),z(pn),z(Ua),z(hn),z(Ka),z(ss),z(os),z(ls),z(ps),z(hs),z(fs);const $n=z(gs);z(ms),z(vs),z(Ms),z($e),z(ks),z(zs),z($s),z(As);const Ns=O("rgb");function cr(e,n){const t=e.getContext("2d",{willReadFrequently:!0});if(!t)return;const{width:i,height:r}=e,a=t.createImageData(i,r),s=a.data;for(let c=0;c<r;c++){const p=1-c/(r-1||1);for(let f=0;f<i;f++){const b=f/(i-1||1),x=Ns({mode:"hsv",h:n,s:b,v:p,alpha:1}),v=(c*i+f)*4;if(!x){s[v]=s[v+1]=s[v+2]=0,s[v+3]=255;continue}s[v]=Math.round(An((x.r??0)*255)),s[v+1]=Math.round(An((x.g??0)*255)),s[v+2]=Math.round(An((x.b??0)*255)),s[v+3]=255}}t.putImageData(a,0,0)}function An(e){return Math.min(255,Math.max(0,e))}const Te=O("rgb"),Lt=O("hsv"),Is=O("hsl"),dr=.002,pr=.004;function Tt(e){return e.c<=dr}function Rs(e){const n=Lt({mode:"oklch",...e,alpha:1});return Math.max(0,(n==null?void 0:n.s)??0)}function he(e){return Tt(e)?!0:Rs(e)<pr}function Ct(e,n){return he(e)?{...e,h:D(n)}:e}function X(e){const n=Me(e.l??0),t=Math.max(0,e.c??0),i=D(e.h??0),r=Me(e.alpha??1),a=Hs({mode:"oklch",l:n,c:t,h:i,alpha:r},"rgb"),s=Tt({c:t});return{l:a.l??n,c:s?0:a.c??0,h:s?D(i):i,alpha:a.alpha??r}}function ue(e){const n=ci(e.trim());if(!n)return null;const t=$n(n);return(t==null?void 0:t.l)==null?null:X({l:t.l,c:t.c??0,h:t.h??0,alpha:t.alpha??1})}function _n(e){const{l:n,c:t,h:i,alpha:r}=e;return r>=1?`oklch(${(n*100).toFixed(1)}% ${t.toFixed(4)} ${i.toFixed(1)})`:`oklch(${(n*100).toFixed(1)}% ${t.toFixed(4)} ${i.toFixed(1)} / ${Math.round(r*100)}%)`}function Ce(e){return Cs(Te({mode:"oklch",...e}))??"#000000"}function qs(e){const{r:n,g:t,b:i}=St(e);return e.alpha<1?`rgba(${n}, ${t}, ${i}, ${e.alpha.toFixed(2)})`:`rgb(${n}, ${t}, ${i})`}function St(e){const n=Te({mode:"oklch",...e,alpha:1});return n?{r:Math.round((n.r??0)*255),g:Math.round((n.g??0)*255),b:Math.round((n.b??0)*255)}:{r:0,g:0,b:0}}function Fs(e){const n=D(Math.max(0,Math.min(1,e))*360),t=Te({mode:"hsv",h:n,s:1,v:1,alpha:1});return t?{r:Math.round((t.r??0)*255),g:Math.round((t.g??0)*255),b:Math.round((t.b??0)*255)}:{r:255,g:0,b:0}}function Xs(e){const{r:n,g:t,b:i}=St(e);return`linear-gradient(to right, rgba(${n}, ${t}, ${i}, 0), rgb(${n}, ${t}, ${i}))`}function Os(e){if(he(e))return D(e.h);const n=Lt({mode:"oklch",...e,alpha:1});return D((n==null?void 0:n.h)??e.h)}function hr(e,n){const t=D(n),i=Lt({mode:"oklch",...e,alpha:1}),r=Te({mode:"hsv",h:t,s:(i==null?void 0:i.s)??0,v:(i==null?void 0:i.v)??1,alpha:1}),a=$n(r??{mode:"hsv",h:t,s:(i==null?void 0:i.s)??0,v:(i==null?void 0:i.v)??1});if((a==null?void 0:a.l)!=null){const s=a.c??0;return Ct(X({l:a.l,c:s,h:a.h??t,alpha:e.alpha}),t)}return X({...e,h:t})}function Ye(e,n){switch(n){case"hex":return[{key:"hex",label:"HEX CODE",value:Ce(e).replace("#","").toUpperCase()}];case"rgb":{const t=Te({mode:"oklch",...e});return[{key:"r",label:"R",value:String(Math.round((t.r??0)*255)),min:0,max:255},{key:"g",label:"G",value:String(Math.round((t.g??0)*255)),min:0,max:255},{key:"b",label:"B",value:String(Math.round((t.b??0)*255)),min:0,max:255}]}case"hsl":{const t=Is({mode:"oklch",...e});return[{key:"h",label:"H",value:String(Math.round((t==null?void 0:t.h)??0)),min:0,max:360},{key:"s",label:"S",value:String(Math.round(((t==null?void 0:t.s)??0)*100)),min:0,max:100,suffix:"%"},{key:"l",label:"L",value:String(Math.round(((t==null?void 0:t.l)??0)*100)),min:0,max:100,suffix:"%"}]}case"oklch":return[{key:"l",label:"L",value:String(Math.round(e.l*100)),min:0,max:100,suffix:"%"},{key:"c",label:"C",value:e.c.toFixed(3),min:0,max:.4,step:.001},{key:"h",label:"H",value:String(Math.round(e.h)),min:0,max:360}]}}function Ds(e,n,t){var f,b,x;const i=e.alpha,r=Ye(e,"hsl"),a=n==="h"?D(t):Number(((f=r.find(v=>v.key==="h"))==null?void 0:f.value)??0);let s=n==="s"?t:Number(((b=r.find(v=>v.key==="s"))==null?void 0:b.value)??0);const c=n==="l"?t:Number(((x=r.find(v=>v.key==="l"))==null?void 0:x.value)??0);n==="h"&&s<1&&(s=1);const p=ue(`hsl(${a}, ${Pt(s)}%, ${Pt(c)}%)`);return p?{...p,alpha:i}:e}function js(e,n,t,i){switch(n){case"l":{const r=X({...e,l:t/100});return i!=null?Ct(r,i):r}case"c":{const r=Math.max(0,t),a=r<=dr||he(e)?i!=null?D(i):D(e.h):e.h,s=X({...e,c:r,h:a});return i!=null?Ct(s,i):s}case"h":return hr(e,t)}}function Ln(e,n,t){switch(e){case"hex":{const i=(n.hex??"").trim().replace(/^#/,"");if(!/^[0-9a-fA-F]{3,8}$/.test(i))return null;const r=ue(`#${i}`);return r?Tn(r,t.alpha):null}case"rgb":{const i=Number(n.r),r=Number(n.g),a=Number(n.b);if([i,r,a].some(c=>Number.isNaN(c)))return null;const s=ue(`rgb(${Cn(i)}, ${Cn(r)}, ${Cn(a)})`);return s?Tn(s,t.alpha):null}case"hsl":{const i=Sn(n.h),r=Sn(n.s),a=Sn(n.l);if([i,r,a].some(c=>Number.isNaN(c)))return null;const s=ue(`hsl(${i}, ${Pt(r)}%, ${Pt(a)}%)`);return s?Tn(s,t.alpha):null}case"oklch":{const i=Number(n.l);let r=Number(n.c),a=Number(n.h);return[i,r,a].some(s=>Number.isNaN(s))?null:(r<=0&&(r=0,Tt(t)||(a=t.h)),X({l:i/100,c:r,h:a,alpha:t.alpha}))}}}function Ys(e){const n=Lt({mode:"oklch",...e,alpha:1});return{x:Me((n==null?void 0:n.s)??0),y:Me(1-((n==null?void 0:n.v)??0))}}function Zs(e,n,t,i){const r=Me(e),a=Me(n),s=D(t),c=$n(Te({mode:"hsv",h:s,s:r,v:1-a,alpha:1})??{mode:"hsv",h:s,s:r,v:1-a});if((c==null?void 0:c.l)!=null){const p=c.c??0,f=r<pr||Tt({c:p});return X({l:c.l,c:p,h:f?s:c.h??s,alpha:i})}return X({l:.5,c:0,h:s,alpha:i})}function Tn(e,n){return{...e,alpha:Me(n)}}function Me(e){return Math.min(1,Math.max(0,e))}function Cn(e){return Math.min(255,Math.max(0,Math.round(e)))}function Pt(e){return Math.min(100,Math.max(0,e))}function Sn(e){return Number(e.replace(/%/g,"").trim())}function D(e){return Math.min(360,Math.max(0,e))}const Pn={l:.62,c:.24,h:303,alpha:.8},ur="pretty-color-picker-history",fr=16,En="Pretty Color Picker";function br(e,n){return Ce(e)===Ce(n)&&e.alpha===n.alpha}function Bs(){try{const e=localStorage.getItem(ur);if(!e)return[];const n=JSON.parse(e);return Array.isArray(n)?n.slice(0,fr):[]}catch{return[]}}function Ws(e,n){const t=n.filter(r=>!br(r,e)),i=[e,...t].slice(0,fr);try{localStorage.setItem(ur,JSON.stringify(i))}catch{}return i}const Gs="#ededed",Vs="#171717",Us=.52;function Js(e,n,t){const i=[e,n,t].map(r=>{const a=r/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4});return .2126*i[0]+.7152*i[1]+.0722*i[2]}function Ks(e,n,t){return Js(e,n,t)>Us?Vs:Gs}function Qs(e,n,t){return{backgroundColor:Ks(e,n,t),boxShadow:"none"}}function gr(e){const n=e.replace("#","").trim();return n?n.length===3?{r:Number.parseInt(n[0]+n[0],16),g:Number.parseInt(n[1]+n[1],16),b:Number.parseInt(n[2]+n[2],16)}:n.length===6?{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}:null:null}function eo(e,n,t,i){const r=Math.max(0,Math.min(1,n)),a={r:Math.round((t.r+i.r)/2),g:Math.round((t.g+i.g)/2),b:Math.round((t.b+i.b)/2)};return{r:Math.round(r*e.r+(1-r)*a.r),g:Math.round(r*e.g+(1-r)*a.g),b:Math.round(r*e.b+(1-r)*a.b)}}function mr(e,n){const t=n.getBoundingClientRect(),i=xr((e.clientX-t.left)/t.width),r=xr((e.clientY-t.top)/t.height);return{x:i,y:r}}function vr(e,n){let t=!1,i=null;const r=c=>{if(!t||i==null)return;const p=c.clientX-i;i=c.clientX,p!==0&&n.onDelta(p,c)},a=c=>{var p;if(t){if(t=!1,i=null,c.pointerId!=null)try{e.releasePointerCapture(c.pointerId)}catch{}window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),(p=n.onEnd)==null||p.call(n,c)}},s=c=>{var p;c.button===0&&(c.preventDefault(),t=!0,i=c.clientX,e.setPointerCapture(c.pointerId),(p=n.onStart)==null||p.call(n,c),window.addEventListener("pointermove",r),window.addEventListener("pointerup",a),window.addEventListener("pointercancel",a))};return e.addEventListener("pointerdown",s),()=>{e.removeEventListener("pointerdown",s),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a)}}function Hn(e,n,t,i){let r=!1;const a=p=>{if(!r)return;const{x:f,y:b}=mr(p,e);n(f,b)},s=p=>{if(r){if(r=!1,(p==null?void 0:p.pointerId)!=null)try{e.releasePointerCapture(p.pointerId)}catch{}window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),t==null||t()}},c=p=>{if(p.button!==0)return;r=!0,e.setPointerCapture(p.pointerId),i==null||i();const{x:f,y:b}=mr(p,e);n(f,b),window.addEventListener("pointermove",a),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s)};return e.addEventListener("pointerdown",c),()=>{e.removeEventListener("pointerdown",c),window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}}function xr(e){return Math.min(1,Math.max(0,e))}const Et=48;function to(e,n){const t=i=>{if(i.button!==0||i.target.closest(".pcp-header-btn"))return;i.preventDefault();const a=n.getBoundingClientRect(),s=i.clientX-a.left,c=i.clientY-a.top;e.dataset.dragging="true",e.setPointerCapture(i.pointerId);const p=b=>{Mr(n,b.clientX-s,b.clientY-c)},f=b=>{e.removeAttribute("data-dragging");try{e.releasePointerCapture(b.pointerId)}catch{}window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)};window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f)};return e.addEventListener("pointerdown",t),()=>{e.removeEventListener("pointerdown",t),e.removeAttribute("data-dragging")}}function yr(e){const n=e.offsetWidth,t=e.offsetHeight;Mr(e,(window.innerWidth-n)/2,(window.innerHeight-t)/2)}function Mr(e,n,t){const i=e.offsetWidth,r=e.offsetHeight,a=window.innerWidth-Et,s=window.innerHeight-Et,c=Et-i,p=Et-r;e.style.left=`${Math.min(a,Math.max(c,n))}px`,e.style.top=`${Math.min(s,Math.max(p,t))}px`}const wr=8,Se=8;function no(e,n=document){const t=e.trim();if(!t)return null;if(t.startsWith("#"))return n.getElementById(t.slice(1));try{return n.querySelector(t)}catch{return n.getElementById(t)}}function io(e,n){const t=n.getBoundingClientRect(),i=e.offsetWidth,r=e.offsetHeight,a=window.innerWidth,s=window.innerHeight;let c=t.bottom+wr,p=t.left;p+i>a-Se&&(p=t.right-i),p=Math.min(a-Se-i,Math.max(Se,p)),c+r>s-Se&&(c=t.top-r-wr),c=Math.min(s-Se-r,Math.max(Se,c)),e.style.left=`${p}px`,e.style.top=`${c}px`}const ro=["hex","rgb","hsl","oklch"],ao={hex:"HEX",rgb:"RGB",hsl:"HSL",oklch:"OKLCH"};class kr extends HTMLElement{constructor(){super();k(this,o);k(this,$);k(this,y,{...Pn});k(this,R,"hsl");k(this,J,Bs());k(this,Pe,null);k(this,I,[]);k(this,Ee);k(this,Ze);k(this,j);k(this,K);k(this,q);k(this,Q);k(this,Be);k(this,Y);k(this,He);k(this,ee);k(this,We);k(this,G);k(this,fe);k(this,Ne);k(this,te);k(this,ne,null);k(this,Z,null);k(this,ie,null);k(this,re,null);k(this,be,null);k(this,ge,null);k(this,ae,null);k(this,B,Pn.h);g(this,$,this.attachShadow({mode:"open"}))}static get observedAttributes(){return["value","theme","label","header-action","movable","mode","anchor","open","history"]}connectedCallback(){d(this,o,Pr).call(this),d(this,o,Er).call(this),d(this,o,Sr).call(this),d(this,o,at).call(this,!1),d(this,o,Zn).call(this),d(this,o,nt).call(this),this.popoverMode&&this.open&&requestAnimationFrame(()=>d(this,o,tt).call(this))}disconnectedCallback(){var t;l(this,ae)!=null&&(cancelAnimationFrame(l(this,ae)),g(this,ae,null)),(t=l(this,Z))==null||t.call(this),g(this,Z,null),d(this,o,Yn).call(this),l(this,I).forEach(i=>i()),g(this,I,[])}attributeChangedCallback(t,i,r){if(this.isConnected){if(t==="value"&&r!=null){const a=ue(r);a&&(g(this,y,a),d(this,o,at).call(this,!1));return}t==="theme"&&d(this,o,it).call(this),t==="movable"&&d(this,o,nt).call(this),(t==="mode"||t==="anchor")&&(d(this,o,Zn).call(this),d(this,o,nt).call(this)),t==="open"&&this.popoverMode&&r!=null&&requestAnimationFrame(()=>{d(this,o,tt).call(this),d(this,o,Re).call(this)}),t==="history"&&d(this,o,Bn).call(this),t==="header-action"&&d(this,o,Nr).call(this),t==="label"&&d(this,o,Wn).call(this)}}get value(){return _n(l(this,y))}set value(t){const i=ue(t);i&&(g(this,y,i),d(this,o,at).call(this))}get color(){return{...l(this,y)}}set color(t){g(this,y,X(t)),d(this,o,at).call(this)}get theme(){const t=this.getAttribute("theme");return t==="light"||t==="system"?t:"dark"}set theme(t){this.setAttribute("theme",t)}get headerAction(){const t=this.getAttribute("header-action");return t==="theme"?"theme":t==="none"?"none":"close"}set headerAction(t){this.setAttribute("header-action",t)}get label(){const t=this.getAttribute("label");return t===null?En:t}set label(t){t===En?this.removeAttribute("label"):this.setAttribute("label",t)}get movable(){return this.hasAttribute("movable")}set movable(t){t?this.setAttribute("movable",""):this.removeAttribute("movable")}get mode(){return this.getAttribute("mode")==="popover"?"popover":"inline"}set mode(t){t==="popover"?this.setAttribute("mode","popover"):this.removeAttribute("mode")}get popoverMode(){return this.mode==="popover"}get anchor(){return this.getAttribute("anchor")}set anchor(t){t?this.setAttribute("anchor",t):this.removeAttribute("anchor")}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.hide()}show(){if(this.popoverMode){if(this.open){requestAnimationFrame(()=>{d(this,o,tt).call(this),d(this,o,Re).call(this)});return}this.setAttribute("open","")}}hide(){!this.popoverMode||!this.open||this.removeAttribute("open")}toggle(){this.open?this.hide():this.show()}get history(){const t=this.getAttribute("history");return t===null?!0:t!=="false"&&t!=="0"}set history(t){t?this.removeAttribute("history"):this.setAttribute("history","false")}}$=new WeakMap,y=new WeakMap,R=new WeakMap,J=new WeakMap,Pe=new WeakMap,I=new WeakMap,Ee=new WeakMap,Ze=new WeakMap,j=new WeakMap,K=new WeakMap,q=new WeakMap,Q=new WeakMap,Be=new WeakMap,Y=new WeakMap,He=new WeakMap,ee=new WeakMap,We=new WeakMap,G=new WeakMap,fe=new WeakMap,Ne=new WeakMap,te=new WeakMap,ne=new WeakMap,Z=new WeakMap,ie=new WeakMap,re=new WeakMap,be=new WeakMap,ge=new WeakMap,ae=new WeakMap,B=new WeakMap,o=new WeakSet,Sr=function(){const t=this.getAttribute("value");if(t){const i=ue(t);i&&g(this,y,i)}},Pr=function(){const t=this.headerAction==="none"?"":this.headerAction==="theme"?`<button type="button" class="pcp-header-btn pcp-theme-toggle" aria-label="Switch to light mode">${L}</button>`:`<button type="button" class="pcp-header-btn pcp-close" aria-label="Close">
4
+ `||n[m]===" "||n[m]===" ");)m++;let r;if(dt(n)&&(r=Fe(n),r.type!==h.Hue)){t.push({type:h.Alpha,value:r});continue}if(Dt(n)&&ht(n)==="none"){t.push({type:h.Alpha,value:{type:h.None,value:void 0}});continue}return}if(/\d/.test(i)){m--,t.push(Fe(n));continue}if(Ot.test(i)){m--,t.push(ha(n));continue}return}return t}function fa(e){e._i=0;let n=e[e._i++];if(!n||n.type!==h.Function||n.value!=="color"||(n=e[e._i++],n.type!==h.Ident))return;const t=oi[n.value];if(!t)return;const i={mode:t},r=li(e,!1);if(!r)return;const a=ct(t).channels;for(let s=0,c,p;s<a.length;s++)c=r[s],p=a[s],c.type!==h.None&&(i[p]=c.type===h.Number?c.value:c.value/100,p==="alpha"&&(i[p]=Math.max(0,Math.min(1,i[p]))));return i}function li(e,n){const t=[];let i;for(;e._i<e.length;){if(i=e[e._i++],i.type===h.None||i.type===h.Number||i.type===h.Alpha||i.type===h.Percentage||n&&i.type===h.Hue){t.push(i);continue}if(i.type===h.ParenClose){if(e._i<e.length)return;continue}return}if(!(t.length<3||t.length>4)){if(t.length===4){if(t[3].type!==h.Alpha)return;t[3]=t[3].value}return t.length===3&&t.push({type:h.None,value:void 0}),t.every(r=>r.type!==h.Alpha)?t:void 0}}function ba(e,n){e._i=0;let t=e[e._i++];if(!t||t.type!==h.Function)return;let i=li(e,n);if(i)return i.unshift(t.value),i}const ci=e=>{if(typeof e!="string")return;const n=ua(e),t=n?ba(n,!0):void 0;let i,r=0,a=lt.length;for(;r<a;)if((i=lt[r++](e,t))!==void 0)return i;return n?fa(n):void 0};function ga(e,n){if(!n||n[0]!=="rgb"&&n[0]!=="rgba")return;const t={mode:"rgb"},[,i,r,a,s]=n;if(!(i.type===h.Hue||r.type===h.Hue||a.type===h.Hue))return i.type!==h.None&&(t.r=i.type===h.Number?i.value/255:i.value/100),r.type!==h.None&&(t.g=r.type===h.Number?r.value/255:r.value/100),a.type!==h.None&&(t.b=a.type===h.Number?a.value/255:a.value/100),s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const ma=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,va=(e,n,t)=>e+t*(n-e),xa=e=>{let n=[];for(let t=0;t<e.length-1;t++){let i=e[t],r=e[t+1];i===void 0&&r===void 0?n.push(void 0):i!==void 0&&r!==void 0?n.push([i,r]):n.push(i!==void 0?[i,i]:[r,r])}return n},u=(e=>n=>{let t=xa(n);return i=>{let r=i*t.length,a=i>=1?t.length-1:Math.max(Math.floor(r),0),s=t[a];return s===void 0?void 0:e(s[0],s[1],r-a)}})(va),P=e=>{let n=!1,t=e.map(i=>i!==void 0?(n=!0,i):1);return n?t:e},$e={mode:"rgb",channels:["r","g","b","alpha"],parse:[ga,ia,oa,ta,ma,"srgb"],serialize:"srgb",interpolate:{r:u,g:u,b:u,alpha:{use:u,fixup:P}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},jt=(e=0)=>Math.pow(Math.abs(e),563/256)*Math.sign(e),di=e=>{let n=jt(e.r),t=jt(e.g),i=jt(e.b),r={mode:"xyz65",x:.5766690429101305*n+.1855582379065463*t+.1882286462349947*i,y:.297344975250536*n+.6273635662554661*t+.0752914584939979*i,z:.0270313613864123*n+.0706888525358272*t+.9913375368376386*i};return e.alpha!==void 0&&(r.alpha=e.alpha),r},Yt=e=>Math.pow(Math.abs(e),256/563)*Math.sign(e),pi=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r={mode:"a98",r:Yt(e*2.0415879038107465-n*.5650069742788597-.3447313507783297*t),g:Yt(e*-.9692436362808798+n*1.8759675015077206+.0415550574071756*t),b:Yt(e*.0134442806320312-n*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(r.alpha=i),r},Zt=(e=0)=>{const n=Math.abs(e);return n<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((n+.055)/1.055,2.4)},Ae=({r:e,g:n,b:t,alpha:i})=>{let r={mode:"lrgb",r:Zt(e),g:Zt(n),b:Zt(t)};return i!==void 0&&(r.alpha=i),r},ve=e=>{let{r:n,g:t,b:i,alpha:r}=Ae(e),a={mode:"xyz65",x:.4123907992659593*n+.357584339383878*t+.1804807884018343*i,y:.2126390058715102*n+.715168678767756*t+.0721923153607337*i,z:.0193308187155918*n+.119194779794626*t+.9505321522496607*i};return r!==void 0&&(a.alpha=r),a},Bt=(e=0)=>{const n=Math.abs(e);return n>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(n,1/2.4)-.055):e*12.92},_e=({r:e,g:n,b:t,alpha:i},r="rgb")=>{let a={mode:r,r:Bt(e),g:Bt(n),b:Bt(t)};return i!==void 0&&(a.alpha=i),a},xe=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=_e({r:e*3.2409699419045226-n*1.537383177570094-.4986107602930034*t,g:e*-.9692436362808796+n*1.8759675015077204+.0415550574071756*t,b:e*.0556300796969936-n*.2039769588889765+1.0569715142428784*t});return i!==void 0&&(r.alpha=i),r},ya={...$e,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>pi(ve(e)),xyz65:pi},toMode:{rgb:e=>xe(di(e)),xyz65:di}},N=e=>(e=e%360)<0?e+360:e,Ma=(e,n)=>e.map((t,i,r)=>{if(t===void 0)return t;let a=N(t);return i===0||e[i-1]===void 0?a:n(a-N(r[i-1]))}).reduce((t,i)=>!t.length||i===void 0||t[t.length-1]===void 0?(t.push(i),t):(t.push(i+t[t.length-1]),t),[]),V=e=>Ma(e,n=>Math.abs(n)<=180?n:n-360*Math.sign(n)),H=[-.14861,1.78277,-.29227,-.90649,1.97294,0],ka=Math.PI/180,wa=180/Math.PI;let hi=H[3]*H[4],ui=H[1]*H[4],fi=H[1]*H[2]-H[0]*H[3];const za=({r:e,g:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=(fi*t+e*hi-n*ui)/(fi+hi-ui),a=t-r,s=(H[4]*(n-r)-H[2]*a)/H[3],c={mode:"cubehelix",l:r,s:r===0||r===1?void 0:Math.sqrt(a*a+s*s)/(H[4]*r*(1-r))};return c.s&&(c.h=Math.atan2(s,a)*wa-120),i!==void 0&&(c.alpha=i),c},$a=({h:e,s:n,l:t,alpha:i})=>{let r={mode:"rgb"};e=(e===void 0?0:e+120)*ka,t===void 0&&(t=0);let a=n===void 0?0:n*t*(1-t),s=Math.cos(e),c=Math.sin(e);return r.r=t+a*(H[0]*s+H[1]*c),r.g=t+a*(H[2]*s+H[3]*c),r.b=t+a*(H[4]*s+H[5]*c),i!==void 0&&(r.alpha=i),r},ut=(e,n)=>{if(e.h===void 0||n.h===void 0||!e.s||!n.s)return 0;let t=N(e.h),i=N(n.h),r=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*n.s)*r},Aa=(e,n)=>{if(e.h===void 0||n.h===void 0)return 0;let t=N(e.h),i=N(n.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},ft=(e,n)=>{if(e.h===void 0||n.h===void 0||!e.c||!n.c)return 0;let t=N(e.h),i=N(n.h),r=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*n.c)*r},U=e=>{let n=e.reduce((i,r)=>{if(r!==void 0){let a=r*Math.PI/180;i.sin+=Math.sin(a),i.cos+=Math.cos(a)}return i},{sin:0,cos:0}),t=Math.atan2(n.sin,n.cos)*180/Math.PI;return t<0?360+t:t},_a={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:za},toMode:{rgb:$a},interpolate:{h:{use:u,fixup:V},s:u,l:u,alpha:{use:u,fixup:P}},difference:{h:ut},average:{h:U}},de=({l:e,a:n,b:t,alpha:i},r="lch")=>{n===void 0&&(n=0),t===void 0&&(t=0);let a=Math.sqrt(n*n+t*t),s={mode:r,l:e,c:a};return a&&(s.h=N(Math.atan2(t,n)*180/Math.PI)),i!==void 0&&(s.alpha=i),s},pe=({l:e,c:n,h:t,alpha:i},r="lab")=>{t===void 0&&(t=0);let a={mode:r,l:e,a:n?n*Math.cos(t/180*Math.PI):0,b:n?n*Math.sin(t/180*Math.PI):0};return i!==void 0&&(a.alpha=i),a},bi=Math.pow(29,3)/Math.pow(3,3),gi=Math.pow(6,3)/Math.pow(29,3),T={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},Le={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Wt=e=>Math.pow(e,3)>gi?Math.pow(e,3):(116*e-16)/bi;const mi=({l:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=(e+16)/116,a=n/500+r,s=r-t/200,c={mode:"xyz65",x:Wt(a)*Le.X,y:Wt(r)*Le.Y,z:Wt(s)*Le.Z};return i!==void 0&&(c.alpha=i),c},bt=e=>xe(mi(e)),Gt=e=>e>gi?Math.cbrt(e):(bi*e+16)/116,vi=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Gt(e/Le.X),a=Gt(n/Le.Y),s=Gt(t/Le.Z),c={mode:"lab65",l:116*a-16,a:500*(r-a),b:200*(a-s)};return i!==void 0&&(c.alpha=i),c},gt=e=>{let n=vi(ve(e));return e.r===e.b&&e.b===e.g&&(n.a=n.b=0),n},mt=1,xi=1,Xe=26/180*Math.PI,vt=Math.cos(Xe),xt=Math.sin(Xe),yi=100/Math.log(139/100),Vt=({l:e,c:n,h:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r={mode:"lab65",l:(Math.exp(e*mt/yi)-1)/.0039},a=(Math.exp(.0435*n*xi*mt)-1)/.075,s=a*Math.cos(t/180*Math.PI-Xe),c=a*Math.sin(t/180*Math.PI-Xe);return r.a=s*vt-c/.83*xt,r.b=s*xt+c/.83*vt,i!==void 0&&(r.alpha=i),r},Ut=({l:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=n*vt+t*xt,a=.83*(t*vt-n*xt),s=Math.sqrt(r*r+a*a),c={mode:"dlch",l:yi/mt*Math.log(1+.0039*e),c:Math.log(1+.075*s)/(.0435*xi*mt)};return c.c&&(c.h=N((Math.atan2(a,r)+Xe)/Math.PI*180)),i!==void 0&&(c.alpha=i),c},Mi=e=>Vt(de(e,"dlch")),ki=e=>pe(Ut(e),"dlab"),La={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Mi,rgb:e=>bt(Mi(e))},fromMode:{lab65:ki,rgb:e=>ki(gt(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:u,a:u,b:u,alpha:{use:u,fixup:P}}},Ta={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Vt,dlab:e=>pe(e,"dlab"),rgb:e=>bt(Vt(e))},fromMode:{lab65:Ut,dlab:e=>de(e,"dlch"),rgb:e=>Ut(gt(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:u,c:u,h:{use:u,fixup:V},alpha:{use:u,fixup:P}},difference:{h:ft},average:{h:U}};function Ca({h:e,s:n,i:t,alpha:i}){e=N(e!==void 0?e:0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:t*(1+n*(3/(2-r)-1)),g:t*(1+n*(3*(1-r)/(2-r)-1)),b:t*(1-n)};break;case 1:a={r:t*(1+n*(3*(1-r)/(2-r)-1)),g:t*(1+n*(3/(2-r)-1)),b:t*(1-n)};break;case 2:a={r:t*(1-n),g:t*(1+n*(3/(2-r)-1)),b:t*(1+n*(3*(1-r)/(2-r)-1))};break;case 3:a={r:t*(1-n),g:t*(1+n*(3*(1-r)/(2-r)-1)),b:t*(1+n*(3/(2-r)-1))};break;case 4:a={r:t*(1+n*(3*(1-r)/(2-r)-1)),g:t*(1-n),b:t*(1+n*(3/(2-r)-1))};break;case 5:a={r:t*(1+n*(3/(2-r)-1)),g:t*(1-n),b:t*(1+n*(3*(1-r)/(2-r)-1))};break;default:a={r:t*(1-n),g:t*(1-n),b:t*(1-n)}}return a.mode="rgb",i!==void 0&&(a.alpha=i),a}function Sa({r:e,g:n,b:t,alpha:i}){e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.max(e,n,t),a=Math.min(e,n,t),s={mode:"hsi",s:e+n+t===0?0:1-3*a/(e+n+t),i:(e+n+t)/3};return r-a!==0&&(s.h=(r===e?(n-t)/(r-a)+(n<t)*6:r===n?(t-e)/(r-a)+2:(e-n)/(r-a)+4)*60),i!==void 0&&(s.alpha=i),s}const Pa={mode:"hsi",toMode:{rgb:Ca},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Sa},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:u,fixup:V},s:u,i:u,alpha:{use:u,fixup:P}},difference:{h:ut},average:{h:U}};function Ea({h:e,s:n,l:t,alpha:i}){e=N(e!==void 0?e:0),n===void 0&&(n=0),t===void 0&&(t=0);let r=t+n*(t<.5?t:1-t),a=r-(r-t)*2*Math.abs(e/60%2-1),s;switch(Math.floor(e/60)){case 0:s={r,g:a,b:2*t-r};break;case 1:s={r:a,g:r,b:2*t-r};break;case 2:s={r:2*t-r,g:r,b:a};break;case 3:s={r:2*t-r,g:a,b:r};break;case 4:s={r:a,g:2*t-r,b:r};break;case 5:s={r,g:2*t-r,b:a};break;default:s={r:2*t-r,g:2*t-r,b:2*t-r}}return s.mode="rgb",i!==void 0&&(s.alpha=i),s}function Ha({r:e,g:n,b:t,alpha:i}){e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.max(e,n,t),a=Math.min(e,n,t),s={mode:"hsl",s:r===a?0:(r-a)/(1-Math.abs(r+a-1)),l:.5*(r+a)};return r-a!==0&&(s.h=(r===e?(n-t)/(r-a)+(n<t)*6:r===n?(t-e)/(r-a)+2:(e-n)/(r-a)+4)*60),i!==void 0&&(s.alpha=i),s}const Na=(e,n)=>{switch(n){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},Ia=new RegExp(`^hsla?\\(\\s*${ra}${ze}${qe}${ze}${qe}\\s*(?:,\\s*${Xt}\\s*)?\\)$`),Ra=e=>{let n=e.match(Ia);if(!n)return;let t={mode:"hsl"};return n[3]!==void 0?t.h=+n[3]:n[1]!==void 0&&n[2]!==void 0&&(t.h=Na(n[1],n[2])),n[4]!==void 0&&(t.s=Math.min(Math.max(0,n[4]/100),1)),n[5]!==void 0&&(t.l=Math.min(Math.max(0,n[5]/100),1)),n[6]!==void 0?t.alpha=Math.max(0,Math.min(1,n[6]/100)):n[7]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+n[7]))),t};function qa(e,n){if(!n||n[0]!=="hsl"&&n[0]!=="hsla")return;const t={mode:"hsl"},[,i,r,a,s]=n;if(i.type!==h.None){if(i.type===h.Percentage)return;t.h=i.value}if(r.type!==h.None){if(r.type===h.Hue)return;t.s=r.value/100}if(a.type!==h.None){if(a.type===h.Hue)return;t.l=a.value/100}return s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const wi={mode:"hsl",toMode:{rgb:Ea},fromMode:{rgb:Ha},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[qa,Ra],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:u,fixup:V},s:u,l:u,alpha:{use:u,fixup:P}},difference:{h:ut},average:{h:U}};function zi({h:e,s:n,v:t,alpha:i}){e=N(e!==void 0?e:0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:t,g:t*(1-n*r),b:t*(1-n)};break;case 1:a={r:t*(1-n*r),g:t,b:t*(1-n)};break;case 2:a={r:t*(1-n),g:t,b:t*(1-n*r)};break;case 3:a={r:t*(1-n),g:t*(1-n*r),b:t};break;case 4:a={r:t*(1-n*r),g:t*(1-n),b:t};break;case 5:a={r:t,g:t*(1-n),b:t*(1-n*r)};break;default:a={r:t*(1-n),g:t*(1-n),b:t*(1-n)}}return a.mode="rgb",i!==void 0&&(a.alpha=i),a}function $i({r:e,g:n,b:t,alpha:i}){e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.max(e,n,t),a=Math.min(e,n,t),s={mode:"hsv",s:r===0?0:1-a/r,v:r};return r-a!==0&&(s.h=(r===e?(n-t)/(r-a)+(n<t)*6:r===n?(t-e)/(r-a)+2:(e-n)/(r-a)+4)*60),i!==void 0&&(s.alpha=i),s}const Ai={mode:"hsv",toMode:{rgb:zi},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:$i},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:u,fixup:V},s:u,v:u,alpha:{use:u,fixup:P}},difference:{h:ut},average:{h:U}};function Fa({h:e,w:n,b:t,alpha:i}){if(n===void 0&&(n=0),t===void 0&&(t=0),n+t>1){let r=n+t;n/=r,t/=r}return zi({h:e,s:t===1?1:1-n/(1-t),v:1-t,alpha:i})}function Xa(e){let n=$i(e);if(n===void 0)return;let t=n.s!==void 0?n.s:0,i=n.v!==void 0?n.v:0,r={mode:"hwb",w:(1-t)*i,b:1-i};return n.h!==void 0&&(r.h=n.h),n.alpha!==void 0&&(r.alpha=n.alpha),r}function Oa(e,n){if(!n||n[0]!=="hwb")return;const t={mode:"hwb"},[,i,r,a,s]=n;if(i.type!==h.None){if(i.type===h.Percentage)return;t.h=i.value}if(r.type!==h.None){if(r.type===h.Hue)return;t.w=r.value/100}if(a.type!==h.None){if(a.type===h.Hue)return;t.b=a.value/100}return s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const Da={mode:"hwb",toMode:{rgb:Fa},fromMode:{rgb:Xa},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Oa],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:u,fixup:V},w:u,b:u,alpha:{use:u,fixup:P}},difference:{h:Aa},average:{h:U}},_i=203,yt=.1593017578125,Li=78.84375,Mt=.8359375,kt=18.8515625,wt=18.6875;function Jt(e){if(e<0)return 0;const n=Math.pow(e,1/Li);return 1e4*Math.pow(Math.max(0,n-Mt)/(kt-wt*n),1/yt)}function Kt(e){if(e<0)return 0;const n=Math.pow(e/1e4,yt);return Math.pow((Mt+kt*n)/(1+wt*n),Li)}const Qt=e=>Math.max(e/_i,0),Ti=({i:e,t:n,p:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);const r=Jt(e+.008609037037932761*n+.11102962500302593*t),a=Jt(e-.00860903703793275*n-.11102962500302599*t),s=Jt(e+.5600313357106791*n-.32062717498731885*t),c={mode:"xyz65",x:Qt(2.070152218389422*r-1.3263473389671556*a+.2066510476294051*s),y:Qt(.3647385209748074*r+.680566024947227*a-.0453045459220346*s),z:Qt(-.049747207535812*r-.0492609666966138*a+1.1880659249923042*s)};return i!==void 0&&(c.alpha=i),c},en=(e=0)=>Math.max(e*_i,0),Ci=({x:e,y:n,z:t,alpha:i})=>{const r=en(e),a=en(n),s=en(t),c=Kt(.3592832590121217*r+.6976051147779502*a-.0358915932320289*s),p=Kt(-.1920808463704995*r+1.1004767970374323*a+.0753748658519118*s),f=Kt(.0070797844607477*r+.0748396662186366*a+.8433265453898765*s),b=.5*c+.5*p,x=1.61376953125*c-3.323486328125*p+1.709716796875*f,v=4.378173828125*c-4.24560546875*p-.132568359375*f,M={mode:"itp",i:b,t:x,p:v};return i!==void 0&&(M.alpha=i),M},ja={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Ti,rgb:e=>xe(Ti(e))},fromMode:{xyz65:Ci,rgb:e=>Ci(ve(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:u,t:u,p:u,alpha:{use:u,fixup:P}}},Ya=134.03437499999998,Za=16295499532821565e-27,tn=e=>{if(e<0)return 0;let n=Math.pow(e/1e4,yt);return Math.pow((Mt+kt*n)/(1+wt*n),Ya)},nn=(e=0)=>Math.max(e*203,0),Si=({x:e,y:n,z:t,alpha:i})=>{e=nn(e),n=nn(n),t=nn(t);let r=1.15*e-.15*t,a=.66*n+.34*e,s=tn(.41478972*r+.579999*a+.014648*t),c=tn(-.20151*r+1.120649*a+.0531008*t),p=tn(-.0166008*r+.2648*a+.6684799*t),f=(s+c)/2,b={mode:"jab",j:.44*f/(1-.56*f)-Za,a:3.524*s-4.066708*c+.542708*p,b:.199076*s+1.096799*c-1.295875*p};return i!==void 0&&(b.alpha=i),b},Ba=134.03437499999998,Pi=16295499532821565e-27,rn=e=>{if(e<0)return 0;let n=Math.pow(e,1/Ba);return 1e4*Math.pow((Mt-n)/(wt*n-kt),1/yt)},an=e=>e/203,Ei=({j:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=(e+Pi)/(.44+.56*(e+Pi)),a=rn(r+.13860504*n+.058047316*t),s=rn(r-.13860504*n-.058047316*t),c=rn(r-.096019242*n-.8118919*t),p={mode:"xyz65",x:an(1.661373024652174*a-.914523081304348*s+.23136208173913045*c),y:an(-.3250758611844533*a+1.571847026732543*s-.21825383453227928*c),z:an(-.090982811*a-.31272829*s+1.5227666*c)};return i!==void 0&&(p.alpha=i),p},Hi=e=>{let n=Si(ve(e));return e.r===e.b&&e.b===e.g&&(n.a=n.b=0),n},Ni=e=>xe(Ei(e)),Wa={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:Hi,xyz65:Si},toMode:{rgb:Ni,xyz65:Ei},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:u,a:u,b:u,alpha:{use:u,fixup:P}}},Ii=({j:e,a:n,b:t,alpha:i})=>{n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.sqrt(n*n+t*t),a={mode:"jch",j:e,c:r};return r&&(a.h=N(Math.atan2(t,n)*180/Math.PI)),i!==void 0&&(a.alpha=i),a},Ri=({j:e,c:n,h:t,alpha:i})=>{t===void 0&&(t=0);let r={mode:"jab",j:e,a:n?n*Math.cos(t/180*Math.PI):0,b:n?n*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Ga={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Ri,rgb:e=>Ni(Ri(e))},fromMode:{rgb:e=>Ii(Hi(e)),jab:Ii},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:u,fixup:V},c:u,j:u,alpha:{use:u,fixup:P}},difference:{h:ft},average:{h:U}},zt=Math.pow(29,3)/Math.pow(3,3),sn=Math.pow(6,3)/Math.pow(29,3);let on=e=>Math.pow(e,3)>sn?Math.pow(e,3):(116*e-16)/zt;const ln=({l:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=(e+16)/116,a=n/500+r,s=r-t/200,c={mode:"xyz50",x:on(a)*T.X,y:on(r)*T.Y,z:on(s)*T.Z};return i!==void 0&&(c.alpha=i),c},Oe=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=_e({r:e*3.1341359569958707-n*1.6173863321612538-.4906619460083532*t,g:e*-.978795502912089+n*1.916254567259524+.03344273116131949*t,b:e*.07195537988411677-n*.2289768264158322+1.405386058324125*t});return i!==void 0&&(r.alpha=i),r},qi=e=>Oe(ln(e)),De=e=>{let{r:n,g:t,b:i,alpha:r}=Ae(e),a={mode:"xyz50",x:.436065742824811*n+.3851514688337912*t+.14307845442264197*i,y:.22249319175623702*n+.7168870538238823*t+.06061979053616537*i,z:.013923904500943465*n+.09708128566574634*t+.7140993584005155*i};return r!==void 0&&(a.alpha=r),a},cn=e=>e>sn?Math.cbrt(e):(zt*e+16)/116,dn=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=cn(e/T.X),a=cn(n/T.Y),s=cn(t/T.Z),c={mode:"lab",l:116*a-16,a:500*(r-a),b:200*(a-s)};return i!==void 0&&(c.alpha=i),c},Fi=e=>{let n=dn(De(e));return e.r===e.b&&e.b===e.g&&(n.a=n.b=0),n};function Va(e,n){if(!n||n[0]!=="lab")return;const t={mode:"lab"},[,i,r,a,s]=n;if(!(i.type===h.Hue||r.type===h.Hue||a.type===h.Hue))return i.type!==h.None&&(t.l=Math.min(Math.max(0,i.value),100)),r.type!==h.None&&(t.a=r.type===h.Number?r.value:r.value*125/100),a.type!==h.None&&(t.b=a.type===h.Number?a.value:a.value*125/100),s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const pn={mode:"lab",toMode:{xyz50:ln,rgb:qi},fromMode:{xyz50:dn,rgb:Fi},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[Va],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:u,a:u,b:u,alpha:{use:u,fixup:P}}},Ua={...pn,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:mi,rgb:bt},fromMode:{xyz65:vi,rgb:gt},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}};function Ja(e,n){if(!n||n[0]!=="lch")return;const t={mode:"lch"},[,i,r,a,s]=n;if(i.type!==h.None){if(i.type===h.Hue)return;t.l=Math.min(Math.max(0,i.value),100)}if(r.type!==h.None&&(t.c=Math.max(0,r.type===h.Number?r.value:r.value*150/100)),a.type!==h.None){if(a.type===h.Percentage)return;t.h=a.value}return s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const hn={mode:"lch",toMode:{lab:pe,rgb:e=>qi(pe(e))},fromMode:{rgb:e=>de(Fi(e)),lab:de},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[Ja],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:u,fixup:V},c:u,l:u,alpha:{use:u,fixup:P}},difference:{h:ft},average:{h:U}},Ka={...hn,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>pe(e,"lab65"),rgb:e=>bt(pe(e,"lab65"))},fromMode:{rgb:e=>de(gt(e),"lch65"),lab65:e=>de(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},Xi=({l:e,u:n,v:t,alpha:i})=>{n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.sqrt(n*n+t*t),a={mode:"lchuv",l:e,c:r};return r&&(a.h=N(Math.atan2(t,n)*180/Math.PI)),i!==void 0&&(a.alpha=i),a},Oi=({l:e,c:n,h:t,alpha:i})=>{t===void 0&&(t=0);let r={mode:"luv",l:e,u:n?n*Math.cos(t/180*Math.PI):0,v:n?n*Math.sin(t/180*Math.PI):0};return i!==void 0&&(r.alpha=i),r},Di=(e,n,t)=>4*e/(e+15*n+3*t),ji=(e,n,t)=>9*n/(e+15*n+3*t),Qa=Di(T.X,T.Y,T.Z),es=ji(T.X,T.Y,T.Z),ts=e=>e<=sn?zt*e:116*Math.cbrt(e)-16,un=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=ts(n/T.Y),a=Di(e,n,t),s=ji(e,n,t);!isFinite(a)||!isFinite(s)?r=a=s=0:(a=13*r*(a-Qa),s=13*r*(s-es));let c={mode:"luv",l:r,u:a,v:s};return i!==void 0&&(c.alpha=i),c},ns=(e,n,t)=>4*e/(e+15*n+3*t),is=(e,n,t)=>9*n/(e+15*n+3*t),rs=ns(T.X,T.Y,T.Z),as=is(T.X,T.Y,T.Z),fn=({l:e,u:n,v:t,alpha:i})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};n===void 0&&(n=0),t===void 0&&(t=0);let r=n/(13*e)+rs,a=t/(13*e)+as,s=T.Y*(e<=8?e/zt:Math.pow((e+16)/116,3)),c=s*(9*r)/(4*a),p=s*(12-3*r-20*a)/(4*a),f={mode:"xyz50",x:c,y:s,z:p};return i!==void 0&&(f.alpha=i),f},ss={mode:"lchuv",toMode:{luv:Oi,rgb:e=>Oe(fn(Oi(e)))},fromMode:{rgb:e=>Xi(un(De(e))),luv:Xi},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:u,fixup:V},c:u,l:u,alpha:{use:u,fixup:P}},difference:{h:ft},average:{h:U}},os={...$e,mode:"lrgb",toMode:{rgb:_e},fromMode:{rgb:Ae},parse:["srgb-linear"],serialize:"srgb-linear"},ls={mode:"luv",toMode:{xyz50:fn,rgb:e=>Oe(fn(e))},fromMode:{xyz50:un,rgb:e=>un(De(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:u,u,v:u,alpha:{use:u,fixup:P}}},Yi=({r:e,g:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.cbrt(.412221469470763*e+.5363325372617348*n+.0514459932675022*t),a=Math.cbrt(.2119034958178252*e+.6806995506452344*n+.1073969535369406*t),s=Math.cbrt(.0883024591900564*e+.2817188391361215*n+.6299787016738222*t),c={mode:"oklab",l:.210454268309314*r+.7936177747023054*a-.0040720430116193*s,a:1.9779985324311684*r-2.42859224204858*a+.450593709617411*s,b:.0259040424655478*r+.7827717124575296*a-.8086757549230774*s};return i!==void 0&&(c.alpha=i),c},$t=e=>{let n=Yi(Ae(e));return e.r===e.b&&e.b===e.g&&(n.a=n.b=0),n},je=({l:e,a:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=Math.pow(e+.3963377773761749*n+.2158037573099136*t,3),a=Math.pow(e-.1055613458156586*n-.0638541728258133*t,3),s=Math.pow(e-.0894841775298119*n-1.2914855480194092*t,3),c={mode:"lrgb",r:4.076741636075957*r-3.3077115392580616*a+.2309699031821044*s,g:-1.2684379732850317*r+2.6097573492876887*a-.3413193760026573*s,b:-.0041960761386756*r-.7034186179359362*a+1.7076146940746117*s};return i!==void 0&&(c.alpha=i),c},At=e=>_e(je(e));function bn(e){const i=1.170873786407767;return .5*(i*e-.206+Math.sqrt((i*e-.206)*(i*e-.206)+4*.03*i*e))}function _t(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function cs(e,n){let t,i,r,a,s,c,p,f;-1.88170328*e-.80936493*n>1?(t=1.19086277,i=1.76576728,r=.59662641,a=.75515197,s=.56771245,c=4.0767416621,p=-3.3077115913,f=.2309699292):1.81444104*e-1.19445276*n>1?(t=.73956515,i=-.45954404,r=.08285427,a=.1254107,s=.14503204,c=-1.2684380046,p=2.6097574011,f=-.3413193965):(t=1.35733652,i=-.00915799,r=-1.1513021,a=-.50559606,s=.00692167,c=-.0041960863,p=-.7034186147,f=1.707614701);let b=t+i*e+r*n+a*e*e+s*e*n,x=.3963377774*e+.2158037573*n,v=-.1055613458*e-.0638541728*n,M=-.0894841775*e-1.291485548*n;{let _=1+b*x,A=1+b*v,C=1+b*M,E=_*_*_,S=A*A*A,me=C*C*C,Ge=3*x*_*_,Ve=3*v*A*A,Ue=3*M*C*C,Je=6*x*x*_,Ke=6*v*v*A,Qe=6*M*M*C,Ie=c*E+p*S+f*me,ke=c*Ge+p*Ve+f*Ue,et=c*Je+p*Ke+f*Qe;b=b-Ie*ke/(ke*ke-.5*Ie*et)}return b}function gn(e,n){let t=cs(e,n),i=je({l:1,a:t*e,b:t*n}),r=Math.cbrt(1/Math.max(i.r,i.g,i.b)),a=r*t;return[r,a]}function ds(e,n,t,i,r,a=null){a||(a=gn(e,n));let s;if((t-r)*a[1]-(a[0]-r)*i<=0)s=a[1]*r/(i*a[0]+a[1]*(r-t));else{s=a[1]*(r-1)/(i*(a[0]-1)+a[1]*(r-t));{let c=t-r,p=i,f=.3963377774*e+.2158037573*n,b=-.1055613458*e-.0638541728*n,x=-.0894841775*e-1.291485548*n,v=c+p*f,M=c+p*b,_=c+p*x;{let A=r*(1-s)+s*t,C=s*i,E=A+C*f,S=A+C*b,me=A+C*x,Ge=E*E*E,Ve=S*S*S,Ue=me*me*me,Je=3*v*E*E,Ke=3*M*S*S,Qe=3*_*me*me,Ie=6*v*v*E,ke=6*M*M*S,et=6*_*_*me,zr=4.0767416621*Ge-3.3077115913*Ve+.2309699292*Ue-1,Nn=4.0767416621*Je-3.3077115913*Ke+.2309699292*Qe,so=4.0767416621*Ie-3.3077115913*ke+.2309699292*et,$r=Nn/(Nn*Nn-.5*zr*so),In=-zr*$r,Ar=-1.2684380046*Ge+2.6097574011*Ve-.3413193965*Ue-1,Rn=-1.2684380046*Je+2.6097574011*Ke-.3413193965*Qe,oo=-1.2684380046*Ie+2.6097574011*ke-.3413193965*et,_r=Rn/(Rn*Rn-.5*Ar*oo),qn=-Ar*_r,Lr=-.0041960863*Ge-.7034186147*Ve+1.707614701*Ue-1,Fn=-.0041960863*Je-.7034186147*Ke+1.707614701*Qe,lo=-.0041960863*Ie-.7034186147*ke+1.707614701*et,Tr=Fn/(Fn*Fn-.5*Lr*lo),Xn=-Lr*Tr;In=$r>=0?In:1e6,qn=_r>=0?qn:1e6,Xn=Tr>=0?Xn:1e6,s+=Math.min(In,Math.min(qn,Xn))}}}return s}function mn(e,n,t=null){t||(t=gn(e,n));let i=t[0],r=t[1];return[r/i,r/(1-i)]}function Zi(e,n,t){let i=gn(n,t),r=ds(n,t,e,1,e,i),a=mn(n,t,i),s=.11516993+1/(7.4477897+4.1590124*t+n*(-2.19557347+1.75198401*t+n*(-2.13704948-10.02301043*t+n*(-4.24894561+5.38770819*t+4.69891013*n)))),c=.11239642+1/(1.6132032-.68124379*t+n*(.40370612+.90148123*t+n*(-.27087943+.6122399*t+n*(.00299215-.45399568*t-.14661872*n)))),p=r/Math.min(e*a[0],(1-e)*a[1]),f=e*s,b=(1-e)*c,x=.9*p*Math.sqrt(Math.sqrt(1/(1/(f*f*f*f)+1/(b*b*b*b))));return f=e*.4,b=(1-e)*.8,[Math.sqrt(1/(1/(f*f)+1/(b*b))),x,r]}function Bi(e){const n=e.l!==void 0?e.l:0,t=e.a!==void 0?e.a:0,i=e.b!==void 0?e.b:0,r={mode:"okhsl",l:bn(n)};e.alpha!==void 0&&(r.alpha=e.alpha);let a=Math.sqrt(t*t+i*i);if(!a)return r.s=0,r;let[s,c,p]=Zi(n,t/a,i/a),f;if(a<c){let b=0,x=.8*s,v=1-x/c;f=(a-b)/(x+v*(a-b))*.8}else{let b=c,x=.2*c*c*1.25*1.25/s,v=1-x/(p-c);f=.8+.2*((a-b)/(x+v*(a-b)))}return f&&(r.s=f,r.h=N(Math.atan2(i,t)*180/Math.PI)),r}function Wi(e){let n=e.h!==void 0?e.h:0,t=e.s!==void 0?e.s:0,i=e.l!==void 0?e.l:0;const r={mode:"oklab",l:_t(i)};if(e.alpha!==void 0&&(r.alpha=e.alpha),!t||i===1)return r.a=r.b=0,r;let a=Math.cos(n/180*Math.PI),s=Math.sin(n/180*Math.PI),[c,p,f]=Zi(r.l,a,s),b,x,v,M;t<.8?(b=1.25*t,x=0,v=.8*c,M=1-v/p):(b=5*(t-.8),x=p,v=.2*p*p*1.25*1.25/c,M=1-v/(f-p));let _=x+b*v/(1-M*b);return r.a=_*a,r.b=_*s,r}const ps={...wi,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:Bi,rgb:e=>Bi($t(e))},toMode:{oklab:Wi,rgb:e=>At(Wi(e))}};function Gi(e){let n=e.l!==void 0?e.l:0,t=e.a!==void 0?e.a:0,i=e.b!==void 0?e.b:0,r=Math.sqrt(t*t+i*i),a=r?t/r:1,s=r?i/r:1,[c,p]=mn(a,s),f=.5,b=1-f/c,x=p/(r+n*p),v=x*n,M=x*r,_=_t(v),A=M*_/v,C=je({l:_,a:a*A,b:s*A}),E=Math.cbrt(1/Math.max(C.r,C.g,C.b,0));n=n/E,r=r/E*bn(n)/n,n=bn(n);const S={mode:"okhsv",s:r?(f+p)*M/(p*f+p*b*M):0,v:n?n/v:0};return S.s&&(S.h=N(Math.atan2(i,t)*180/Math.PI)),e.alpha!==void 0&&(S.alpha=e.alpha),S}function Vi(e){const n={mode:"oklab"};e.alpha!==void 0&&(n.alpha=e.alpha);const t=e.h!==void 0?e.h:0,i=e.s!==void 0?e.s:0,r=e.v!==void 0?e.v:0,a=Math.cos(t/180*Math.PI),s=Math.sin(t/180*Math.PI),[c,p]=mn(a,s),f=.5,b=1-f/c,x=1-i*f/(f+p-p*b*i),v=i*p*f/(f+p-p*b*i),M=_t(x),_=v*M/x,A=je({l:M,a:a*_,b:s*_}),C=Math.cbrt(1/Math.max(A.r,A.g,A.b,0)),E=_t(r*x),S=v*E/x;return n.l=E*C,n.a=S*a*C,n.b=S*s*C,n}const hs={...Ai,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Gi,rgb:e=>Gi($t(e))},toMode:{oklab:Vi,rgb:e=>At(Vi(e))}};function us(e,n){if(!n||n[0]!=="oklab")return;const t={mode:"oklab"},[,i,r,a,s]=n;if(!(i.type===h.Hue||r.type===h.Hue||a.type===h.Hue))return i.type!==h.None&&(t.l=Math.min(Math.max(0,i.type===h.Number?i.value:i.value/100),1)),r.type!==h.None&&(t.a=r.type===h.Number?r.value:r.value*.4/100),a.type!==h.None&&(t.b=a.type===h.Number?a.value:a.value*.4/100),s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const fs={...pn,mode:"oklab",toMode:{lrgb:je,rgb:At},fromMode:{lrgb:Yi,rgb:$t},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[us],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`};function bs(e,n){if(!n||n[0]!=="oklch")return;const t={mode:"oklch"},[,i,r,a,s]=n;if(i.type!==h.None){if(i.type===h.Hue)return;t.l=Math.min(Math.max(0,i.type===h.Number?i.value:i.value/100),1)}if(r.type!==h.None&&(t.c=Math.max(0,r.type===h.Number?r.value:r.value*.4/100)),a.type!==h.None){if(a.type===h.Percentage)return;t.h=a.value}return s.type!==h.None&&(t.alpha=Math.min(1,Math.max(0,s.type===h.Number?s.value:s.value/100))),t}const gs={...hn,mode:"oklch",toMode:{oklab:e=>pe(e,"oklab"),rgb:e=>At(pe(e,"oklab"))},fromMode:{rgb:e=>de($t(e),"oklch"),oklab:e=>de(e,"oklch")},parse:[bs],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},Ui=e=>{let{r:n,g:t,b:i,alpha:r}=Ae(e),a={mode:"xyz65",x:.486570948648216*n+.265667693169093*t+.1982172852343625*i,y:.2289745640697487*n+.6917385218365062*t+.079286914093745*i,z:0*n+.0451133818589026*t+1.043944368900976*i};return r!==void 0&&(a.alpha=r),a},Ji=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r=_e({r:e*2.4934969119414263-n*.9313836179191242-.402710784450717*t,g:e*-.8294889695615749+n*1.7626640603183465+.0236246858419436*t,b:e*.0358458302437845-n*.0761723892680418+.9568845240076871*t},"p3");return i!==void 0&&(r.alpha=i),r},ms={...$e,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>Ji(ve(e)),xyz65:Ji},toMode:{rgb:e=>xe(Ui(e)),xyz65:Ui}},vn=e=>{let n=Math.abs(e);return n>=1/512?Math.sign(e)*Math.pow(n,1/1.8):16*e},Ki=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r={mode:"prophoto",r:vn(e*1.3457868816471585-n*.2555720873797946-.0511018649755453*t),g:vn(e*-.5446307051249019+n*1.5082477428451466+.0205274474364214*t),b:vn(e*0+n*0+1.2119675456389452*t)};return i!==void 0&&(r.alpha=i),r},xn=(e=0)=>{let n=Math.abs(e);return n>=16/512?Math.sign(e)*Math.pow(n,1.8):e/16},Qi=e=>{let n=xn(e.r),t=xn(e.g),i=xn(e.b),r={mode:"xyz50",x:.7977666449006423*n+.1351812974005331*t+.0313477341283922*i,y:.2880748288194013*n+.7118352342418731*t+899369387256e-16*i,z:0*n+0*t+.8251046025104602*i};return e.alpha!==void 0&&(r.alpha=e.alpha),r},vs={...$e,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:Ki,rgb:e=>Ki(De(e))},toMode:{xyz50:Qi,rgb:e=>Oe(Qi(e))}},er=1.09929682680944,xs=.018053968510807,yn=e=>{const n=Math.abs(e);return n>xs?(Math.sign(e)||1)*(er*Math.pow(n,.45)-(er-1)):4.5*e},tr=({x:e,y:n,z:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);let r={mode:"rec2020",r:yn(e*1.7166511879712683-n*.3556707837763925-.2533662813736599*t),g:yn(e*-.6666843518324893+n*1.6164812366349395+.0157685458139111*t),b:yn(e*.0176398574453108-n*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(r.alpha=i),r},nr=1.09929682680944,ys=.018053968510807,Mn=(e=0)=>{let n=Math.abs(e);return n<ys*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((n+nr-1)/nr,1/.45)},ir=e=>{let n=Mn(e.r),t=Mn(e.g),i=Mn(e.b),r={mode:"xyz65",x:.6369580483012911*n+.1446169035862083*t+.1688809751641721*i,y:.262700212011267*n+.6779980715188708*t+.059301716469862*i,z:0*n+.0280726930490874*t+1.0609850577107909*i};return e.alpha!==void 0&&(r.alpha=e.alpha),r},Ms={...$e,mode:"rec2020",fromMode:{xyz65:tr,rgb:e=>tr(ve(e))},toMode:{xyz65:ir,rgb:e=>xe(ir(e))},parse:["rec2020"],serialize:"rec2020"},ye=.0037930732552754493,rr=Math.cbrt(ye),kn=e=>Math.cbrt(e)-rr,ks=e=>{const{r:n,g:t,b:i,alpha:r}=Ae(e),a=kn(.3*n+.622*t+.078*i+ye),s=kn(.23*n+.692*t+.078*i+ye),c=kn(.2434226892454782*n+.2047674442449682*t+.5518098665095535*i+ye),p={mode:"xyb",x:(a-s)/2,y:(a+s)/2,b:c-(a+s)/2};return r!==void 0&&(p.alpha=r),p},wn=e=>Math.pow(e+rr,3),ws={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:({x:e,y:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);const r=wn(e+n)-ye,a=wn(n-e)-ye,s=wn(t+n)-ye,c=_e({r:11.031566904639861*r-9.866943908131562*a-.16462299650829934*s,g:-3.2541473810744237*r+4.418770377582723*a-.16462299650829934*s,b:-3.6588512867136815*r+2.7129230459360922*a+1.9459282407775895*s});return i!==void 0&&(c.alpha=i),c}},fromMode:{rgb:ks},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:u,y:u,b:u,alpha:{use:u,fixup:P}}},zs={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Oe,lab:dn},fromMode:{rgb:De,lab:ln},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:u,y:u,z:u,alpha:{use:u,fixup:P}}},$s={mode:"xyz65",toMode:{rgb:xe,xyz50:e=>{let{x:n,y:t,z:i,alpha:r}=e;n===void 0&&(n=0),t===void 0&&(t=0),i===void 0&&(i=0);let a={mode:"xyz50",x:1.0479298208405488*n+.0229467933410191*t-.0501922295431356*i,y:.0296278156881593*n+.990434484573249*t-.0170738250293851*i,z:-.0092430581525912*n+.0150551448965779*t+.7518742899580008*i};return r!==void 0&&(a.alpha=r),a}},fromMode:{rgb:ve,xyz50:e=>{let{x:n,y:t,z:i,alpha:r}=e;n===void 0&&(n=0),t===void 0&&(t=0),i===void 0&&(i=0);let a={mode:"xyz65",x:.9554734527042182*n-.0230985368742614*t+.0632593086610217*i,y:-.0283697069632081*n+1.0099954580058226*t+.021041398966943*i,z:.0123140016883199*n-.0205076964334779*t+1.3303659366080753*i};return r!==void 0&&(a.alpha=r),a}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:u,y:u,z:u,alpha:{use:u,fixup:P}}},As={mode:"yiq",toMode:{rgb:({y:e,i:n,q:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);const r={mode:"rgb",r:e+.95608445*n+.6208885*t,g:e-.27137664*n-.6486059*t,b:e-1.10561724*n+1.70250126*t};return i!==void 0&&(r.alpha=i),r}},fromMode:{rgb:({r:e,g:n,b:t,alpha:i})=>{e===void 0&&(e=0),n===void 0&&(n=0),t===void 0&&(t=0);const r={mode:"yiq",y:.29889531*e+.58662247*n+.11448223*t,i:.59597799*e-.2741761*n-.32180189*t,q:.21147017*e-.52261711*n+.31114694*t};return i!==void 0&&(r.alpha=i),r}},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:u,i:u,q:u,alpha:{use:u,fixup:P}}},_s=e=>Math.max(0,Math.min(1,e||0)),zn=e=>Math.round(_s(e)*255),Ls=O("rgb"),Ts=e=>{if(e===void 0)return;let n=zn(e.r),t=zn(e.g),i=zn(e.b);return"#"+(1<<24|n<<16|t<<8|i).toString(16).slice(1)},Cs=e=>Ts(Ls(e)),ar=O("rgb"),sr=e=>{const n={mode:e.mode,r:Math.max(0,Math.min(e.r!==void 0?e.r:0,1)),g:Math.max(0,Math.min(e.g!==void 0?e.g:0,1)),b:Math.max(0,Math.min(e.b!==void 0?e.b:0,1))};return e.alpha!==void 0&&(n.alpha=e.alpha),n},Ss=e=>sr(ar(e)),or=e=>e!==void 0&&(e.r===void 0||e.r>=0&&e.r<=1)&&(e.g===void 0||e.g>=0&&e.g<=1)&&(e.b===void 0||e.b>=0&&e.b<=1);function Ps(e){return or(ar(e))}function lr(e="rgb"){const{gamut:n}=ct(e);if(!n)return i=>!0;const t=O(typeof n=="string"?n:e);return i=>or(t(i))}function Es(e="rgb"){const{gamut:n}=ct(e);if(!n)return a=>ot(a);const t=typeof n=="string"?n:e,i=O(t),r=lr(t);return a=>{const s=ot(a);if(!s)return;const c=i(s);if(r(c))return s;const p=sr(c);return s.mode===p.mode?p:O(s.mode)(p)}}function Hs(e,n="lch",t="rgb"){e=ot(e);let i=t==="rgb"?Ps:lr(t),r=t==="rgb"?Ss:Es(t);if(e===void 0||i(e))return e;let a=O(e.mode);e=O(n)(e);let s={...e,c:0};if(!i(s))return a(r(s));let c=0,p=e.c!==void 0?e.c:0,f=ct(n).ranges.c,b=(f[1]-f[0])/Math.pow(2,13),x=s.c;for(;p-c>b;)s.c=c+(p-c)*.5,i(s)?(x=s.c,c=s.c):p=s.c;return a(i(s)?s:{...s,c:x})}z(ya),z(_a),z(La),z(Ta),z(Pa),z(wi),z(Ai),z(Da),z(ja),z(Wa),z(Ga),z(pn),z(Ua),z(hn),z(Ka),z(ss),z(os),z(ls),z(ps),z(hs),z(fs);const $n=z(gs);z(ms),z(vs),z(Ms),z($e),z(ws),z(zs),z($s),z(As);const Ns=O("rgb");function cr(e,n){const t=e.getContext("2d",{willReadFrequently:!0});if(!t)return;const{width:i,height:r}=e,a=t.createImageData(i,r),s=a.data;for(let c=0;c<r;c++){const p=1-c/(r-1||1);for(let f=0;f<i;f++){const b=f/(i-1||1),x=Ns({mode:"hsv",h:n,s:b,v:p,alpha:1}),v=(c*i+f)*4;if(!x){s[v]=s[v+1]=s[v+2]=0,s[v+3]=255;continue}s[v]=Math.round(An((x.r??0)*255)),s[v+1]=Math.round(An((x.g??0)*255)),s[v+2]=Math.round(An((x.b??0)*255)),s[v+3]=255}}t.putImageData(a,0,0)}function An(e){return Math.min(255,Math.max(0,e))}const Te=O("rgb"),Lt=O("hsv"),Is=O("hsl"),dr=.002,pr=.004;function Tt(e){return e.c<=dr}function Rs(e){const n=Lt({mode:"oklch",...e,alpha:1});return Math.max(0,(n==null?void 0:n.s)??0)}function he(e){return Tt(e)?!0:Rs(e)<pr}function Ct(e,n){return he(e)?{...e,h:D(n)}:e}function X(e){const n=Me(e.l??0),t=Math.max(0,e.c??0),i=D(e.h??0),r=Me(e.alpha??1),a=Hs({mode:"oklch",l:n,c:t,h:i,alpha:r},"rgb"),s=Tt({c:t});return{l:a.l??n,c:s?0:a.c??0,h:s?D(i):i,alpha:a.alpha??r}}function ue(e){const n=ci(e.trim());if(!n)return null;const t=$n(n);return(t==null?void 0:t.l)==null?null:X({l:t.l,c:t.c??0,h:t.h??0,alpha:t.alpha??1})}function _n(e){const{l:n,c:t,h:i,alpha:r}=e;return r>=1?`oklch(${(n*100).toFixed(1)}% ${t.toFixed(4)} ${i.toFixed(1)})`:`oklch(${(n*100).toFixed(1)}% ${t.toFixed(4)} ${i.toFixed(1)} / ${Math.round(r*100)}%)`}function Ce(e){return Cs(Te({mode:"oklch",...e}))??"#000000"}function qs(e){const{r:n,g:t,b:i}=St(e);return e.alpha<1?`rgba(${n}, ${t}, ${i}, ${e.alpha.toFixed(2)})`:`rgb(${n}, ${t}, ${i})`}function St(e){const n=Te({mode:"oklch",...e,alpha:1});return n?{r:Math.round((n.r??0)*255),g:Math.round((n.g??0)*255),b:Math.round((n.b??0)*255)}:{r:0,g:0,b:0}}function Fs(e){const n=D(Math.max(0,Math.min(1,e))*360),t=Te({mode:"hsv",h:n,s:1,v:1,alpha:1});return t?{r:Math.round((t.r??0)*255),g:Math.round((t.g??0)*255),b:Math.round((t.b??0)*255)}:{r:255,g:0,b:0}}function Xs(e){const{r:n,g:t,b:i}=St(e);return`linear-gradient(to right, rgba(${n}, ${t}, ${i}, 0), rgb(${n}, ${t}, ${i}))`}function Os(e){if(he(e))return D(e.h);const n=Lt({mode:"oklch",...e,alpha:1});return D((n==null?void 0:n.h)??e.h)}function hr(e,n){const t=D(n),i=Lt({mode:"oklch",...e,alpha:1}),r=Te({mode:"hsv",h:t,s:(i==null?void 0:i.s)??0,v:(i==null?void 0:i.v)??1,alpha:1}),a=$n(r??{mode:"hsv",h:t,s:(i==null?void 0:i.s)??0,v:(i==null?void 0:i.v)??1});if((a==null?void 0:a.l)!=null){const s=a.c??0;return Ct(X({l:a.l,c:s,h:a.h??t,alpha:e.alpha}),t)}return X({...e,h:t})}function Ye(e,n){switch(n){case"hex":return[{key:"hex",label:"HEX CODE",value:Ce(e).replace("#","").toUpperCase()}];case"rgb":{const t=Te({mode:"oklch",...e});return[{key:"r",label:"R",value:String(Math.round((t.r??0)*255)),min:0,max:255},{key:"g",label:"G",value:String(Math.round((t.g??0)*255)),min:0,max:255},{key:"b",label:"B",value:String(Math.round((t.b??0)*255)),min:0,max:255}]}case"hsl":{const t=Is({mode:"oklch",...e});return[{key:"h",label:"H",value:String(Math.round((t==null?void 0:t.h)??0)),min:0,max:360},{key:"s",label:"S",value:String(Math.round(((t==null?void 0:t.s)??0)*100)),min:0,max:100,suffix:"%"},{key:"l",label:"L",value:String(Math.round(((t==null?void 0:t.l)??0)*100)),min:0,max:100,suffix:"%"}]}case"oklch":return[{key:"l",label:"L",value:String(Math.round(e.l*100)),min:0,max:100,suffix:"%"},{key:"c",label:"C",value:e.c.toFixed(3),min:0,max:.4,step:.001},{key:"h",label:"H",value:String(Math.round(e.h)),min:0,max:360}]}}function Ds(e,n,t){var f,b,x;const i=e.alpha,r=Ye(e,"hsl"),a=n==="h"?D(t):Number(((f=r.find(v=>v.key==="h"))==null?void 0:f.value)??0);let s=n==="s"?t:Number(((b=r.find(v=>v.key==="s"))==null?void 0:b.value)??0);const c=n==="l"?t:Number(((x=r.find(v=>v.key==="l"))==null?void 0:x.value)??0);n==="h"&&s<1&&(s=1);const p=ue(`hsl(${a}, ${Pt(s)}%, ${Pt(c)}%)`);return p?{...p,alpha:i}:e}function js(e,n,t,i){switch(n){case"l":{const r=X({...e,l:t/100});return i!=null?Ct(r,i):r}case"c":{const r=Math.max(0,t),a=r<=dr||he(e)?i!=null?D(i):D(e.h):e.h,s=X({...e,c:r,h:a});return i!=null?Ct(s,i):s}case"h":return hr(e,t)}}function Ln(e,n,t){switch(e){case"hex":{const i=(n.hex??"").trim().replace(/^#/,"");if(!/^[0-9a-fA-F]{3,8}$/.test(i))return null;const r=ue(`#${i}`);return r?Tn(r,t.alpha):null}case"rgb":{const i=Number(n.r),r=Number(n.g),a=Number(n.b);if([i,r,a].some(c=>Number.isNaN(c)))return null;const s=ue(`rgb(${Cn(i)}, ${Cn(r)}, ${Cn(a)})`);return s?Tn(s,t.alpha):null}case"hsl":{const i=Sn(n.h),r=Sn(n.s),a=Sn(n.l);if([i,r,a].some(c=>Number.isNaN(c)))return null;const s=ue(`hsl(${i}, ${Pt(r)}%, ${Pt(a)}%)`);return s?Tn(s,t.alpha):null}case"oklch":{const i=Number(n.l);let r=Number(n.c),a=Number(n.h);return[i,r,a].some(s=>Number.isNaN(s))?null:(r<=0&&(r=0,Tt(t)||(a=t.h)),X({l:i/100,c:r,h:a,alpha:t.alpha}))}}}function Ys(e){const n=Lt({mode:"oklch",...e,alpha:1});return{x:Me((n==null?void 0:n.s)??0),y:Me(1-((n==null?void 0:n.v)??0))}}function Zs(e,n,t,i){const r=Me(e),a=Me(n),s=D(t),c=$n(Te({mode:"hsv",h:s,s:r,v:1-a,alpha:1})??{mode:"hsv",h:s,s:r,v:1-a});if((c==null?void 0:c.l)!=null){const p=c.c??0,f=r<pr||Tt({c:p});return X({l:c.l,c:p,h:f?s:c.h??s,alpha:i})}return X({l:.5,c:0,h:s,alpha:i})}function Tn(e,n){return{...e,alpha:Me(n)}}function Me(e){return Math.min(1,Math.max(0,e))}function Cn(e){return Math.min(255,Math.max(0,Math.round(e)))}function Pt(e){return Math.min(100,Math.max(0,e))}function Sn(e){return Number(e.replace(/%/g,"").trim())}function D(e){return Math.min(360,Math.max(0,e))}const Pn={l:.62,c:.24,h:303,alpha:.8},ur="pretty-color-picker-history",fr=16,En="Pretty Color Picker";function br(e,n){return Ce(e)===Ce(n)&&e.alpha===n.alpha}function Bs(){try{const e=localStorage.getItem(ur);if(!e)return[];const n=JSON.parse(e);return Array.isArray(n)?n.slice(0,fr):[]}catch{return[]}}function Ws(e,n){const t=n.filter(r=>!br(r,e)),i=[e,...t].slice(0,fr);try{localStorage.setItem(ur,JSON.stringify(i))}catch{}return i}const Gs="#ededed",Vs="#171717",Us=.52;function Js(e,n,t){const i=[e,n,t].map(r=>{const a=r/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4});return .2126*i[0]+.7152*i[1]+.0722*i[2]}function Ks(e,n,t){return Js(e,n,t)>Us?Vs:Gs}function Qs(e,n,t){return{backgroundColor:Ks(e,n,t),boxShadow:"none"}}function gr(e){const n=e.replace("#","").trim();return n?n.length===3?{r:Number.parseInt(n[0]+n[0],16),g:Number.parseInt(n[1]+n[1],16),b:Number.parseInt(n[2]+n[2],16)}:n.length===6?{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}:null:null}function eo(e,n,t,i){const r=Math.max(0,Math.min(1,n)),a={r:Math.round((t.r+i.r)/2),g:Math.round((t.g+i.g)/2),b:Math.round((t.b+i.b)/2)};return{r:Math.round(r*e.r+(1-r)*a.r),g:Math.round(r*e.g+(1-r)*a.g),b:Math.round(r*e.b+(1-r)*a.b)}}function mr(e,n){const t=n.getBoundingClientRect(),i=xr((e.clientX-t.left)/t.width),r=xr((e.clientY-t.top)/t.height);return{x:i,y:r}}function vr(e,n){let t=!1,i=null;const r=c=>{if(!t||i==null)return;const p=c.clientX-i;i=c.clientX,p!==0&&n.onDelta(p,c)},a=c=>{var p;if(t){if(t=!1,i=null,c.pointerId!=null)try{e.releasePointerCapture(c.pointerId)}catch{}window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a),(p=n.onEnd)==null||p.call(n,c)}},s=c=>{var p;c.button===0&&(c.preventDefault(),t=!0,i=c.clientX,e.setPointerCapture(c.pointerId),(p=n.onStart)==null||p.call(n,c),window.addEventListener("pointermove",r),window.addEventListener("pointerup",a),window.addEventListener("pointercancel",a))};return e.addEventListener("pointerdown",s),()=>{e.removeEventListener("pointerdown",s),window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",a)}}function Hn(e,n,t,i){let r=!1;const a=p=>{if(!r)return;const{x:f,y:b}=mr(p,e);n(f,b)},s=p=>{if(r){if(r=!1,(p==null?void 0:p.pointerId)!=null)try{e.releasePointerCapture(p.pointerId)}catch{}window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s),t==null||t()}},c=p=>{if(p.button!==0)return;r=!0,e.setPointerCapture(p.pointerId),i==null||i();const{x:f,y:b}=mr(p,e);n(f,b),window.addEventListener("pointermove",a),window.addEventListener("pointerup",s),window.addEventListener("pointercancel",s)};return e.addEventListener("pointerdown",c),()=>{e.removeEventListener("pointerdown",c),window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",s)}}function xr(e){return Math.min(1,Math.max(0,e))}const Et=48;function to(e,n){const t=i=>{if(i.button!==0||i.target.closest(".pcp-header-btn"))return;i.preventDefault();const a=n.getBoundingClientRect(),s=i.clientX-a.left,c=i.clientY-a.top;e.dataset.dragging="true",e.setPointerCapture(i.pointerId);const p=b=>{Mr(n,b.clientX-s,b.clientY-c)},f=b=>{e.removeAttribute("data-dragging");try{e.releasePointerCapture(b.pointerId)}catch{}window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)};window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f)};return e.addEventListener("pointerdown",t),()=>{e.removeEventListener("pointerdown",t),e.removeAttribute("data-dragging")}}function yr(e){const n=e.offsetWidth,t=e.offsetHeight;Mr(e,(window.innerWidth-n)/2,(window.innerHeight-t)/2)}function Mr(e,n,t){const i=e.offsetWidth,r=e.offsetHeight,a=window.innerWidth-Et,s=window.innerHeight-Et,c=Et-i,p=Et-r;e.style.left=`${Math.min(a,Math.max(c,n))}px`,e.style.top=`${Math.min(s,Math.max(p,t))}px`}const kr=8,Se=8;function no(e,n=document){const t=e.trim();if(!t)return null;if(t.startsWith("#"))return n.getElementById(t.slice(1));try{return n.querySelector(t)}catch{return n.getElementById(t)}}function io(e,n){const t=n.getBoundingClientRect(),i=e.offsetWidth,r=e.offsetHeight,a=window.innerWidth,s=window.innerHeight;let c=t.bottom+kr,p=t.left;p+i>a-Se&&(p=t.right-i),p=Math.min(a-Se-i,Math.max(Se,p)),c+r>s-Se&&(c=t.top-r-kr),c=Math.min(s-Se-r,Math.max(Se,c)),e.style.left=`${p}px`,e.style.top=`${c}px`}const ro=["hex","rgb","hsl","oklch"],ao={hex:"HEX",rgb:"RGB",hsl:"HSL",oklch:"OKLCH"};class wr extends HTMLElement{constructor(){super();w(this,o);w(this,$);w(this,y,{...Pn});w(this,R,"hsl");w(this,J,Bs());w(this,Pe,null);w(this,I,[]);w(this,Ee);w(this,Ze);w(this,j);w(this,K);w(this,q);w(this,Q);w(this,Be);w(this,Y);w(this,He);w(this,ee);w(this,We);w(this,G);w(this,fe);w(this,Ne);w(this,te);w(this,ne,null);w(this,Z,null);w(this,ie,null);w(this,re,null);w(this,be,null);w(this,ge,null);w(this,ae,null);w(this,B,Pn.h);g(this,$,this.attachShadow({mode:"open"}))}static get observedAttributes(){return["value","theme","label","header-action","movable","mode","anchor","open","history"]}connectedCallback(){d(this,o,Pr).call(this),d(this,o,Er).call(this),d(this,o,Sr).call(this),d(this,o,at).call(this,!1),d(this,o,Zn).call(this),d(this,o,nt).call(this),this.popoverMode&&this.open&&requestAnimationFrame(()=>d(this,o,tt).call(this))}disconnectedCallback(){var t;l(this,ae)!=null&&(cancelAnimationFrame(l(this,ae)),g(this,ae,null)),(t=l(this,Z))==null||t.call(this),g(this,Z,null),d(this,o,Yn).call(this),l(this,I).forEach(i=>i()),g(this,I,[])}attributeChangedCallback(t,i,r){if(this.isConnected){if(t==="value"&&r!=null){const a=ue(r);a&&(g(this,y,a),d(this,o,at).call(this,!1));return}t==="theme"&&d(this,o,it).call(this),t==="movable"&&d(this,o,nt).call(this),(t==="mode"||t==="anchor")&&(d(this,o,Zn).call(this),d(this,o,nt).call(this)),t==="open"&&this.popoverMode&&r!=null&&requestAnimationFrame(()=>{d(this,o,tt).call(this),d(this,o,Re).call(this)}),t==="history"&&d(this,o,Bn).call(this),t==="header-action"&&d(this,o,Nr).call(this),t==="label"&&d(this,o,Wn).call(this)}}get value(){return _n(l(this,y))}set value(t){const i=ue(t);i&&(g(this,y,i),d(this,o,at).call(this))}get color(){return{...l(this,y)}}set color(t){g(this,y,X(t)),d(this,o,at).call(this)}get theme(){const t=this.getAttribute("theme");return t==="light"||t==="system"?t:"dark"}set theme(t){this.setAttribute("theme",t)}get headerAction(){const t=this.getAttribute("header-action");return t==="theme"?"theme":t==="none"?"none":"close"}set headerAction(t){this.setAttribute("header-action",t)}get label(){const t=this.getAttribute("label");return t===null?En:t}set label(t){t===En?this.removeAttribute("label"):this.setAttribute("label",t)}get movable(){return this.hasAttribute("movable")}set movable(t){t?this.setAttribute("movable",""):this.removeAttribute("movable")}get mode(){return this.getAttribute("mode")==="popover"?"popover":"inline"}set mode(t){t==="popover"?this.setAttribute("mode","popover"):this.removeAttribute("mode")}get popoverMode(){return this.mode==="popover"}get anchor(){return this.getAttribute("anchor")}set anchor(t){t?this.setAttribute("anchor",t):this.removeAttribute("anchor")}get open(){return this.hasAttribute("open")}set open(t){t?this.show():this.hide()}show(){if(this.popoverMode){if(this.open){requestAnimationFrame(()=>{d(this,o,tt).call(this),d(this,o,Re).call(this)});return}this.setAttribute("open","")}}hide(){!this.popoverMode||!this.open||this.removeAttribute("open")}toggle(){this.open?this.hide():this.show()}get history(){const t=this.getAttribute("history");return t===null?!0:t!=="false"&&t!=="0"}set history(t){t?this.removeAttribute("history"):this.setAttribute("history","false")}}$=new WeakMap,y=new WeakMap,R=new WeakMap,J=new WeakMap,Pe=new WeakMap,I=new WeakMap,Ee=new WeakMap,Ze=new WeakMap,j=new WeakMap,K=new WeakMap,q=new WeakMap,Q=new WeakMap,Be=new WeakMap,Y=new WeakMap,He=new WeakMap,ee=new WeakMap,We=new WeakMap,G=new WeakMap,fe=new WeakMap,Ne=new WeakMap,te=new WeakMap,ne=new WeakMap,Z=new WeakMap,ie=new WeakMap,re=new WeakMap,be=new WeakMap,ge=new WeakMap,ae=new WeakMap,B=new WeakMap,o=new WeakSet,Sr=function(){const t=this.getAttribute("value");if(t){const i=ue(t);i&&g(this,y,i)}},Pr=function(){const t=this.headerAction==="none"?"":this.headerAction==="theme"?`<button type="button" class="pcp-header-btn pcp-theme-toggle" aria-label="Switch to light mode">${L}</button>`:`<button type="button" class="pcp-header-btn pcp-close" aria-label="Close">
5
5
  <svg viewBox="0 0 16 16" fill="none" aria-hidden="true">
6
6
  <path
7
7
  d="M4.25 4.25L11.75 11.75M11.75 4.25L4.25 11.75"
@@ -59,7 +59,7 @@
59
59
  stroke-width="1.5"
60
60
  stroke-linecap="round"
61
61
  />
62
- </svg>`),d(this,o,Vn).call(this)},Un=function(t){const i=()=>{t.dataset.active="true"},r=()=>{const a=t.querySelector(".pcp-slider-handle");a!=null&&a.hasAttribute("data-dragging")||delete t.dataset.active};return t.addEventListener("pointerenter",i),t.addEventListener("pointerleave",r),()=>{t.removeEventListener("pointerenter",i),t.removeEventListener("pointerleave",r)}},Ir=function(t,i){const r=Math.max(0,Math.min(1,i))*100;t.style.left=`max(1px, calc(${r}% - 1.5px))`},Rr=function(){const t=getComputedStyle(this),i=gr(t.getPropertyValue("--pcp-checker-base").trim())??{r:255,g:255,b:255},r=gr(t.getPropertyValue("--pcp-checker-tone").trim())??{r:204,g:204,b:204};return{base:i,tone:r}},qr=function(t,i){const r=t.style.left.match(/calc\(([\d.]+)%/);return r?parseFloat(r[1])/100:i},Fr=function(t,i){if(i==="hue")return Fs(t);const{base:r,tone:a}=d(this,o,Rr).call(this);return eo(St(l(this,y)),t,r,a)},Ht=function(t,i,r){const a=d(this,o,Fr).call(this,i,r),{backgroundColor:s,boxShadow:c}=Qs(a.r,a.g,a.b);t.style.backgroundColor=s,t.style.boxShadow=c},rt=function(t,i,r){d(this,o,Ir).call(this,t,i),d(this,o,Ht).call(this,t,i,r)},Xr=function(t,i){l(this,j).dataset.dragging="true";const r=d(this,o,ke).call(this);d(this,o,oe).call(this,Zs(t,i,r,l(this,y).alpha),!0,{refreshPlane:!1,refreshCursor:!1,refreshSliders:!1,syncPlaneHue:!1}),d(this,o,ti).call(this,t,i)},Or=function(t){l(this,K).dataset.active="true",l(this,q).dataset.dragging="true",g(this,B,t*360),d(this,o,rt).call(this,l(this,q),t,"hue"),d(this,o,oe).call(this,hr(l(this,y),l(this,B)),!0,{refreshPlane:!0,refreshCursor:!1,refreshSliders:!1,syncPlaneHue:!1})},Dr=function(t){l(this,Q).dataset.active="true",l(this,Y).dataset.dragging="true",d(this,o,oe).call(this,X({...l(this,y),alpha:t}),!0,{refreshPlane:!1,refreshSliders:!1,syncPlaneHue:!1}),d(this,o,rt).call(this,l(this,Y),t,"alpha")},jr=function(){const i=l(this,q).style.left.match(/calc\(([\d.]+)%/);return i?parseFloat(i[1])/100*360:l(this,B)},Nt=function(){he(l(this,y))||g(this,B,Os(l(this,y)))},Jn=function(){const t=l(this,G).value.replace(/%/g,"").trim(),i=Number(t);if(Number.isNaN(i)){d(this,o,Rt).call(this);return}d(this,o,oe).call(this,X({...l(this,y),alpha:i/100}),!0),d(this,o,le).call(this)},Kn=function(t,i){d(this,o,Yr).call(this,{[t]:i},!0)},Yr=function(t,i=!0){const r={};Ye(l(this,y),l(this,R)).forEach(s=>{r[s.key]=t[s.key]??s.value});const a=Ln(l(this,R),r,l(this,y));a&&(d(this,o,oe).call(this,a,!0),i&&d(this,o,le).call(this))},Zr=function(t,i){if(t.scrubStep!=null)return i?t.scrubStep*.1:t.scrubStep;const r=t.min??0,s=(t.max??100)-r,c=t.step!=null&&t.step<1?s/120:t.step??1;return i?c*.1:c},Br=function(t,i){return t.step!=null&&t.step<1?i.toFixed(3):String(Math.round(i))},Wr=function(t,i,r,a){const s=l(this,ee).querySelector(`.pcp-field-input[data-key="${t}"]`),c=Ye(l(this,y),l(this,R)),p=c.find(E=>E.key===t);if(!p)return;const f=i.min??0,b=i.max??100,x=d(this,o,Zr).call(this,i,a),v=Number(s?s.value.replace(/%/g,"").trim():p.value);let M=v+r*x;if(i.step!=null&&i.step<1?(M=Math.round(M/i.step)*i.step,M=Math.min(b,Math.max(f,M))):M=Math.min(b,Math.max(f,Math.round(M))),Math.abs(M-v)<(i.step!=null&&i.step<1?i.step/2:.5))return;const _=d(this,o,Br).call(this,i,M);let A=null;if(l(this,R)==="hsl"&&(t==="h"||t==="s"||t==="l"))A=Ds(l(this,y),t,M);else if(l(this,R)==="oklch"&&(t==="l"||t==="c"||t==="h"))A=js(l(this,y),t,M,l(this,B));else{const E={};c.forEach(S=>{E[S.key]=S.key===t?_:S.value}),A=Ln(l(this,R),E,l(this,y))}if(!A)return;t==="h"&&g(this,B,D(M));const C=t==="h"||l(this,R)==="oklch"&&(t==="c"||t==="l");d(this,o,oe).call(this,A,!0,{refreshFields:!1,refreshCursor:!0,refreshSliders:!0,syncPlaneHue:!C}),s&&(s.value=_)},Gr=function(t,i){const r=i?.05:.5,a=l(this,y).alpha*100;let s=a+t*r;if(s=Math.min(100,Math.max(0,i?s:Math.round(s))),Math.abs(s-a)<.01)return;const c=s/100;d(this,o,oe).call(this,X({...l(this,y),alpha:c}),!0,{refreshFields:!1,refreshPlane:!1,refreshSliders:!1,syncPlaneHue:!1}),l(this,G).value=`${Math.round(s)}%`},Vr=function(){const t=l(this,$).querySelector(".pcp-alpha-field .pcp-field-label");return t?vr(t,{onStart:()=>{d(this,o,se).call(this),t.setAttribute("data-scrubbing","true"),document.body.style.cursor="ew-resize"},onDelta:(i,r)=>d(this,o,Gr).call(this,i,r.shiftKey),onEnd:()=>{t.removeAttribute("data-scrubbing"),document.body.style.cursor="",d(this,o,le).call(this),d(this,o,Rt).call(this)}}):()=>{}},Ur=function(t){l(this,R)!=="hex"&&l(this,ee).querySelectorAll(".pcp-field-label").forEach(i=>{var c;const r=i.closest(".pcp-field");if(!r)return;const a=(c=[...r.classList].find(p=>p.startsWith("pcp-field-")&&p!=="pcp-field"))==null?void 0:c.slice(10);if(!a)return;const s=t.find(p=>p.key===a);!s||s.min==null||s.max==null||vr(i,{onStart:()=>{d(this,o,se).call(this),i.setAttribute("data-scrubbing","true"),document.body.style.cursor="ew-resize"},onDelta:(p,f)=>d(this,o,Wr).call(this,a,s,p,f.shiftKey),onEnd:()=>{i.removeAttribute("data-scrubbing"),document.body.style.cursor="",d(this,o,le).call(this),d(this,o,qt).call(this)}})})},oe=function(t,i=!0,r){let a=X(t);he(a)&&(a=Ct(a,l(this,B))),g(this,y,a),!(l(this,j).hasAttribute("data-dragging")||l(this,q).hasAttribute("data-dragging"))&&(r==null?void 0:r.syncPlaneHue)!==!1&&!he(a)&&d(this,o,Nt).call(this),d(this,o,Qn).call(this,i,r)},at=function(t=!0){he(l(this,y))||d(this,o,Nt).call(this),d(this,o,Re).call(this),d(this,o,ri).call(this),d(this,o,Qn).call(this,t),d(this,o,Ft).call(this)},Qn=function(t,i){(i==null?void 0:i.refreshFields)!==!1&&d(this,o,qt).call(this),d(this,o,Kr).call(this),(i==null?void 0:i.refreshSliders)!==!1&&d(this,o,ni).call(this),(i==null?void 0:i.refreshCursor)!==!1&&!l(this,j).hasAttribute("data-dragging")&&d(this,o,It).call(this),(i==null?void 0:i.refreshPlane)===!0?d(this,o,ei).call(this):(i==null?void 0:i.refreshPlane)!==!1&&!l(this,j).hasAttribute("data-dragging")&&!l(this,q).hasAttribute("data-dragging")&&l(this,ge)!==d(this,o,ke).call(this)&&d(this,o,ei).call(this),t&&d(this,o,Qr).call(this)},ei=function(){l(this,ae)==null&&g(this,ae,requestAnimationFrame(()=>{g(this,ae,null);const t=d(this,o,ke).call(this);l(this,ge)!==t&&(cr(l(this,Ee),t),g(this,ge,t))}))},ke=function(){return l(this,q).hasAttribute("data-dragging")?d(this,o,jr).call(this):l(this,B)},Re=function(){const t=d(this,o,ke).call(this);cr(l(this,Ee),t),g(this,ge,t)},It=function(){const{x:t,y:i}=Ys(l(this,y));d(this,o,ti).call(this,t,i)},ti=function(t,i){l(this,j).style.left=`${t*100}%`,l(this,j).style.top=`${i*100}%`},ni=function(){const i=d(this,o,ke).call(this)/360;l(this,q).hasAttribute("data-dragging")?d(this,o,Ht).call(this,l(this,q),i,"hue"):d(this,o,rt).call(this,l(this,q),i,"hue");const r=l(this,Y).hasAttribute("data-dragging")?d(this,o,qr).call(this,l(this,Y),l(this,y).alpha):l(this,y).alpha;l(this,Y).hasAttribute("data-dragging")?d(this,o,Ht).call(this,l(this,Y),r,"alpha"):d(this,o,rt).call(this,l(this,Y),r,"alpha"),d(this,o,Jr).call(this)},Jr=function(){l(this,Be).style.setProperty("--pcp-alpha-gradient",Xs(l(this,y)))},ii=function(t,i){const{r,g:a,b:s}=St(i);t.style.setProperty("--swatch-solid",`rgb(${r}, ${a}, ${s})`),t.style.setProperty("--swatch-alpha",`rgba(${r}, ${a}, ${s}, ${i.alpha})`)},Kr=function(){d(this,o,ii).call(this,l(this,We),l(this,y))},Rt=function(){l(this,G).value=`${Math.round(l(this,y).alpha*100)}%`},qt=function(){const t=Ye(l(this,y),l(this,R));l(this,ee).dataset.format=l(this,R),l(this,ee).innerHTML=t.map(i=>`
62
+ </svg>`),d(this,o,Vn).call(this)},Un=function(t){const i=()=>{t.dataset.active="true"},r=()=>{const a=t.querySelector(".pcp-slider-handle");a!=null&&a.hasAttribute("data-dragging")||delete t.dataset.active};return t.addEventListener("pointerenter",i),t.addEventListener("pointerleave",r),()=>{t.removeEventListener("pointerenter",i),t.removeEventListener("pointerleave",r)}},Ir=function(t,i){const r=Math.max(0,Math.min(1,i))*100;t.style.left=`max(1px, calc(${r}% - 1.5px))`},Rr=function(){const t=getComputedStyle(this),i=gr(t.getPropertyValue("--pcp-checker-base").trim())??{r:255,g:255,b:255},r=gr(t.getPropertyValue("--pcp-checker-tone").trim())??{r:204,g:204,b:204};return{base:i,tone:r}},qr=function(t,i){const r=t.style.left.match(/calc\(([\d.]+)%/);return r?parseFloat(r[1])/100:i},Fr=function(t,i){if(i==="hue")return Fs(t);const{base:r,tone:a}=d(this,o,Rr).call(this);return eo(St(l(this,y)),t,r,a)},Ht=function(t,i,r){const a=d(this,o,Fr).call(this,i,r),{backgroundColor:s,boxShadow:c}=Qs(a.r,a.g,a.b);t.style.backgroundColor=s,t.style.boxShadow=c},rt=function(t,i,r){d(this,o,Ir).call(this,t,i),d(this,o,Ht).call(this,t,i,r)},Xr=function(t,i){l(this,j).dataset.dragging="true";const r=d(this,o,we).call(this);d(this,o,oe).call(this,Zs(t,i,r,l(this,y).alpha),!0,{refreshPlane:!1,refreshCursor:!1,refreshSliders:!1,syncPlaneHue:!1}),d(this,o,ti).call(this,t,i)},Or=function(t){l(this,K).dataset.active="true",l(this,q).dataset.dragging="true",g(this,B,t*360),d(this,o,rt).call(this,l(this,q),t,"hue"),d(this,o,oe).call(this,hr(l(this,y),l(this,B)),!0,{refreshPlane:!0,refreshCursor:!1,refreshSliders:!1,syncPlaneHue:!1})},Dr=function(t){l(this,Q).dataset.active="true",l(this,Y).dataset.dragging="true",d(this,o,oe).call(this,X({...l(this,y),alpha:t}),!0,{refreshPlane:!1,refreshSliders:!1,syncPlaneHue:!1}),d(this,o,rt).call(this,l(this,Y),t,"alpha")},jr=function(){const i=l(this,q).style.left.match(/calc\(([\d.]+)%/);return i?parseFloat(i[1])/100*360:l(this,B)},Nt=function(){he(l(this,y))||g(this,B,Os(l(this,y)))},Jn=function(){const t=l(this,G).value.replace(/%/g,"").trim(),i=Number(t);if(Number.isNaN(i)){d(this,o,Rt).call(this);return}d(this,o,oe).call(this,X({...l(this,y),alpha:i/100}),!0),d(this,o,le).call(this)},Kn=function(t,i){d(this,o,Yr).call(this,{[t]:i},!0)},Yr=function(t,i=!0){const r={};Ye(l(this,y),l(this,R)).forEach(s=>{r[s.key]=t[s.key]??s.value});const a=Ln(l(this,R),r,l(this,y));a&&(d(this,o,oe).call(this,a,!0),i&&d(this,o,le).call(this))},Zr=function(t,i){if(t.scrubStep!=null)return i?t.scrubStep*.1:t.scrubStep;const r=t.min??0,s=(t.max??100)-r,c=t.step!=null&&t.step<1?s/120:t.step??1;return i?c*.1:c},Br=function(t,i){return t.step!=null&&t.step<1?i.toFixed(3):String(Math.round(i))},Wr=function(t,i,r,a){const s=l(this,ee).querySelector(`.pcp-field-input[data-key="${t}"]`),c=Ye(l(this,y),l(this,R)),p=c.find(E=>E.key===t);if(!p)return;const f=i.min??0,b=i.max??100,x=d(this,o,Zr).call(this,i,a),v=Number(s?s.value.replace(/%/g,"").trim():p.value);let M=v+r*x;if(i.step!=null&&i.step<1?(M=Math.round(M/i.step)*i.step,M=Math.min(b,Math.max(f,M))):M=Math.min(b,Math.max(f,Math.round(M))),Math.abs(M-v)<(i.step!=null&&i.step<1?i.step/2:.5))return;const _=d(this,o,Br).call(this,i,M);let A=null;if(l(this,R)==="hsl"&&(t==="h"||t==="s"||t==="l"))A=Ds(l(this,y),t,M);else if(l(this,R)==="oklch"&&(t==="l"||t==="c"||t==="h"))A=js(l(this,y),t,M,l(this,B));else{const E={};c.forEach(S=>{E[S.key]=S.key===t?_:S.value}),A=Ln(l(this,R),E,l(this,y))}if(!A)return;t==="h"&&g(this,B,D(M));const C=t==="h"||l(this,R)==="oklch"&&(t==="c"||t==="l");d(this,o,oe).call(this,A,!0,{refreshFields:!1,refreshCursor:!0,refreshSliders:!0,syncPlaneHue:!C}),s&&(s.value=_)},Gr=function(t,i){const r=i?.05:.5,a=l(this,y).alpha*100;let s=a+t*r;if(s=Math.min(100,Math.max(0,i?s:Math.round(s))),Math.abs(s-a)<.01)return;const c=s/100;d(this,o,oe).call(this,X({...l(this,y),alpha:c}),!0,{refreshFields:!1,refreshPlane:!1,refreshSliders:!1,syncPlaneHue:!1}),l(this,G).value=`${Math.round(s)}%`},Vr=function(){const t=l(this,$).querySelector(".pcp-alpha-field .pcp-field-label");return t?vr(t,{onStart:()=>{d(this,o,se).call(this),t.setAttribute("data-scrubbing","true"),document.body.style.cursor="ew-resize"},onDelta:(i,r)=>d(this,o,Gr).call(this,i,r.shiftKey),onEnd:()=>{t.removeAttribute("data-scrubbing"),document.body.style.cursor="",d(this,o,le).call(this),d(this,o,Rt).call(this)}}):()=>{}},Ur=function(t){l(this,R)!=="hex"&&l(this,ee).querySelectorAll(".pcp-field-label").forEach(i=>{var c;const r=i.closest(".pcp-field");if(!r)return;const a=(c=[...r.classList].find(p=>p.startsWith("pcp-field-")&&p!=="pcp-field"))==null?void 0:c.slice(10);if(!a)return;const s=t.find(p=>p.key===a);!s||s.min==null||s.max==null||vr(i,{onStart:()=>{d(this,o,se).call(this),i.setAttribute("data-scrubbing","true"),document.body.style.cursor="ew-resize"},onDelta:(p,f)=>d(this,o,Wr).call(this,a,s,p,f.shiftKey),onEnd:()=>{i.removeAttribute("data-scrubbing"),document.body.style.cursor="",d(this,o,le).call(this),d(this,o,qt).call(this)}})})},oe=function(t,i=!0,r){let a=X(t);he(a)&&(a=Ct(a,l(this,B))),g(this,y,a),!(l(this,j).hasAttribute("data-dragging")||l(this,q).hasAttribute("data-dragging"))&&(r==null?void 0:r.syncPlaneHue)!==!1&&!he(a)&&d(this,o,Nt).call(this),d(this,o,Qn).call(this,i,r)},at=function(t=!0){he(l(this,y))||d(this,o,Nt).call(this),d(this,o,Re).call(this),d(this,o,ri).call(this),d(this,o,Qn).call(this,t),d(this,o,Ft).call(this)},Qn=function(t,i){(i==null?void 0:i.refreshFields)!==!1&&d(this,o,qt).call(this),d(this,o,Kr).call(this),(i==null?void 0:i.refreshSliders)!==!1&&d(this,o,ni).call(this),(i==null?void 0:i.refreshCursor)!==!1&&!l(this,j).hasAttribute("data-dragging")&&d(this,o,It).call(this),(i==null?void 0:i.refreshPlane)===!0?d(this,o,ei).call(this):(i==null?void 0:i.refreshPlane)!==!1&&!l(this,j).hasAttribute("data-dragging")&&!l(this,q).hasAttribute("data-dragging")&&l(this,ge)!==d(this,o,we).call(this)&&d(this,o,ei).call(this),t&&d(this,o,Qr).call(this)},ei=function(){l(this,ae)==null&&g(this,ae,requestAnimationFrame(()=>{g(this,ae,null);const t=d(this,o,we).call(this);l(this,ge)!==t&&(cr(l(this,Ee),t),g(this,ge,t))}))},we=function(){return l(this,q).hasAttribute("data-dragging")?d(this,o,jr).call(this):l(this,B)},Re=function(){const t=d(this,o,we).call(this);cr(l(this,Ee),t),g(this,ge,t)},It=function(){const{x:t,y:i}=Ys(l(this,y));d(this,o,ti).call(this,t,i)},ti=function(t,i){l(this,j).style.left=`${t*100}%`,l(this,j).style.top=`${i*100}%`},ni=function(){const i=d(this,o,we).call(this)/360;l(this,q).hasAttribute("data-dragging")?d(this,o,Ht).call(this,l(this,q),i,"hue"):d(this,o,rt).call(this,l(this,q),i,"hue");const r=l(this,Y).hasAttribute("data-dragging")?d(this,o,qr).call(this,l(this,Y),l(this,y).alpha):l(this,y).alpha;l(this,Y).hasAttribute("data-dragging")?d(this,o,Ht).call(this,l(this,Y),r,"alpha"):d(this,o,rt).call(this,l(this,Y),r,"alpha"),d(this,o,Jr).call(this)},Jr=function(){l(this,Be).style.setProperty("--pcp-alpha-gradient",Xs(l(this,y)))},ii=function(t,i){const{r,g:a,b:s}=St(i);t.style.setProperty("--swatch-solid",`rgb(${r}, ${a}, ${s})`),t.style.setProperty("--swatch-alpha",`rgba(${r}, ${a}, ${s}, ${i.alpha})`)},Kr=function(){d(this,o,ii).call(this,l(this,We),l(this,y))},Rt=function(){l(this,G).value=`${Math.round(l(this,y).alpha*100)}%`},qt=function(){const t=Ye(l(this,y),l(this,R));l(this,ee).dataset.format=l(this,R),l(this,ee).innerHTML=t.map(i=>`
63
63
  <div class="pcp-field pcp-field-${i.key}">
64
64
  <span class="pcp-field-label">${i.label}</span>
65
65
  <input
@@ -74,4 +74,4 @@
74
74
  <button type="button" class="pcp-history-swatch pcp-clip" data-index="${i}" aria-label="Color ${Ce(t)}">
75
75
  <span class="pcp-swatch-fill" data-history-fill="${i}"></span>
76
76
  </button>
77
- `).join(""),l(this,fe).querySelectorAll("[data-history-fill]").forEach(t=>{const i=Number(t.dataset.historyFill),r=l(this,J)[i];r&&d(this,o,ii).call(this,t,r)}),l(this,fe).querySelectorAll(".pcp-history-swatch").forEach(t=>{t.addEventListener("click",()=>{const i=Number(t.dataset.index),r=l(this,J)[i];r&&(d(this,o,se).call(this),d(this,o,oe).call(this,{...r},!0,{refreshFields:!0}),d(this,o,le).call(this))})}))},le=function(){const t=l(this,j).hasAttribute("data-dragging"),i=l(this,q).hasAttribute("data-dragging");delete l(this,j).dataset.dragging,delete l(this,q).dataset.dragging,delete l(this,Y).dataset.dragging,delete l(this,K).dataset.active,delete l(this,Q).dataset.active,(t||i)&&(he(l(this,y))||d(this,o,Nt).call(this),d(this,o,ni).call(this),d(this,o,It).call(this),l(this,ge)!==d(this,o,ke).call(this)&&d(this,o,Re).call(this));const r=l(this,Pe);g(this,Pe,null),this.history&&r&&!br(r,l(this,y))&&(g(this,J,Ws(r,l(this,J))),d(this,o,Ft).call(this))},Qr=function(){const t={color:{...l(this,y)},css:_n(l(this,y)),hex:Ce(l(this,y))};this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))},customElements.get("pretty-color-picker")||customElements.define("pretty-color-picker",kr),w.DEFAULT_COLOR=Pn,w.DEFAULT_PICKER_LABEL=En,w.PrettyColorPicker=kr,w.formatFieldsFor=Ye,w.normalizeOklch=X,w.oklchFromCss=ue,w.oklchToCss=_n,w.oklchToHex=Ce,w.oklchToRgbString=qs,w.parseFormatFields=Ln,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}));
77
+ `).join(""),l(this,fe).querySelectorAll("[data-history-fill]").forEach(t=>{const i=Number(t.dataset.historyFill),r=l(this,J)[i];r&&d(this,o,ii).call(this,t,r)}),l(this,fe).querySelectorAll(".pcp-history-swatch").forEach(t=>{t.addEventListener("click",()=>{const i=Number(t.dataset.index),r=l(this,J)[i];r&&(d(this,o,se).call(this),d(this,o,oe).call(this,{...r},!0,{refreshFields:!0}),d(this,o,le).call(this))})}))},le=function(){const t=l(this,j).hasAttribute("data-dragging"),i=l(this,q).hasAttribute("data-dragging");delete l(this,j).dataset.dragging,delete l(this,q).dataset.dragging,delete l(this,Y).dataset.dragging,delete l(this,K).dataset.active,delete l(this,Q).dataset.active,(t||i)&&(he(l(this,y))||d(this,o,Nt).call(this),d(this,o,ni).call(this),d(this,o,It).call(this),l(this,ge)!==d(this,o,we).call(this)&&d(this,o,Re).call(this));const r=l(this,Pe);g(this,Pe,null),this.history&&r&&!br(r,l(this,y))&&(g(this,J,Ws(r,l(this,J))),d(this,o,Ft).call(this))},Qr=function(){const t={color:{...l(this,y)},css:_n(l(this,y)),hex:Ce(l(this,y))};this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))},customElements.get("pretty-color-picker")||customElements.define("pretty-color-picker",wr),k.DEFAULT_COLOR=Pn,k.DEFAULT_PICKER_LABEL=En,k.PrettyColorPicker=wr,k.formatFieldsFor=Ye,k.normalizeOklch=X,k.oklchFromCss=ue,k.oklchToCss=_n,k.oklchToHex=Ce,k.oklchToRgbString=qs,k.parseFormatFields=Ln,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pretty-color-picker",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A perceptually accurate color picker. OKLCH storage, classic saturation × value plane.",
5
5
  "type": "module",
6
6
  "main": "./dist/pretty-color-picker.umd.cjs",