Socket
Socket
Sign inDemoInstall

mui-color-input

Package Overview
Dependencies
88
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.4 to 1.0.5

127

dist/mui-color-input.es.js

@@ -5,8 +5,8 @@ import d from "react";

import { styled as F } from "@mui/material/styles";
import { jsx as c, jsxs as ft, Fragment as St } from "react/jsx-runtime";
import { jsx as c, jsxs as ut, Fragment as St } from "react/jsx-runtime";
import wt from "@mui/material/Popover";
import U from "@mui/material/Box";
import ht from "@mui/material/Slider";
import Mt from "@mui/material/TextField";
const Ct = "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(135deg, transparent 75%, #ccc 75%) /*! @noflip */", At = "linear-gradient(to top, #000000, transparent), linear-gradient(to right, #ffffff, transparent) /*! @noflip */", kt = {
import Ct from "@mui/material/TextField";
const Mt = "linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(135deg, transparent 75%, #ccc 75%) /*! @noflip */", At = "linear-gradient(to top, #000000, transparent), linear-gradient(to right, #ffffff, transparent) /*! @noflip */", kt = {
Button: F(xt)(() => ({

@@ -36,3 +36,3 @@ backgroundSize: "8px 8px",

backgroundColor: o ? t : void 0,
backgroundImage: o ? void 0 : Ct,
backgroundImage: o ? void 0 : Mt,
cursor: n ? "default" : void 0

@@ -187,3 +187,3 @@ },

currentHue: n
} = e, o = d.useRef(!1), a = d.useRef(null), [i, s] = d.useState(!1), u = Nt((l, S) => {
} = e, o = d.useRef(!1), a = d.useRef(null), [i, s] = d.useState(!1), f = Nt((l, S) => {
if (!a.current)

@@ -202,9 +202,9 @@ return;

}, []), v = d.useCallback((l) => {
o.current && u(l.clientX, l.clientY);
o.current && f(l.clientX, l.clientY);
}, []);
d.useEffect(() => (document.addEventListener("mousemove", v, !1), document.addEventListener("mouseup", x, !1), () => {
document.removeEventListener("mousemove", v, !1), document.removeEventListener("mouseup", x, !1);
d.useEffect(() => (document.addEventListener("pointermove", v, !1), document.addEventListener("pointerup", x, !1), () => {
document.removeEventListener("pointermove", v, !1), document.removeEventListener("pointerup", x, !1);
}), [x, v]);
const p = (l) => {
l.preventDefault(), o.current = !0, u(l.clientX, l.clientY), s(!0);
l.preventDefault(), o.current = !0, f(l.clientX, l.clientY), s(!0);
}, m = (l) => {

@@ -222,12 +222,13 @@ if (Ft(l.key)) {

}
}, C = t.s * 100, H = t.v * 100;
}, M = t.s * 100, H = t.v * 100;
return /* @__PURE__ */ c(rt.Space, {
onMouseDown: p,
onPointerDown: p,
ref: a,
className: "MuiColorInput-ColorSpace",
style: {
backgroundColor: `hsl(${n} 100% 50%)`
backgroundColor: `hsl(${n} 100% 50%)`,
touchAction: "none"
},
role: "slider",
"aria-valuetext": `Saturation ${et(C, 0, 0)}%, Brightness ${et(H, 0, 0)}%`,
"aria-valuetext": `Saturation ${et(M, 0, 0)}%, Brightness ${et(H, 0, 0)}%`,
onKeyDown: m,

@@ -239,3 +240,3 @@ tabIndex: 0,

style: {
left: `${C}%`,
left: `${M}%`,
bottom: `${H}%`

@@ -307,12 +308,12 @@ }

else {
var u = n - o;
switch (i = s > 0.5 ? u / (2 - n - o) : u / (n + o), n) {
var f = n - o;
switch (i = s > 0.5 ? f / (2 - n - o) : f / (n + o), n) {
case e:
a = (t - r) / u + (t < r ? 6 : 0);
a = (t - r) / f + (t < r ? 6 : 0);
break;
case t:
a = (r - e) / u + 2;
a = (r - e) / f + 2;
break;
case r:
a = (e - t) / u + 4;
a = (e - t) / f + 4;
break;

@@ -339,3 +340,3 @@ }

e = g(e, 255), t = g(t, 255), r = g(r, 255);
var n = Math.max(e, t, r), o = Math.min(e, t, r), a = 0, i = n, s = n - o, u = n === 0 ? 0 : s / n;
var n = Math.max(e, t, r), o = Math.min(e, t, r), a = 0, i = n, s = n - o, f = n === 0 ? 0 : s / n;
if (n === o)

@@ -357,7 +358,7 @@ a = 0;

}
return { h: a, s: u, v: i };
return { h: a, s: f, v: i };
}
function Gt(e, t, r) {
e = g(e, 360) * 6, t = g(t, 100), r = g(r, 100);
var n = Math.floor(e), o = e - n, a = r * (1 - t), i = r * (1 - o * t), s = r * (1 - (1 - o) * t), u = n % 6, x = [r, i, a, a, s, r][u], v = [s, r, r, i, a, a][u], p = [a, a, s, r, r, i][u];
var n = Math.floor(e), o = e - n, a = r * (1 - t), i = r * (1 - o * t), s = r * (1 - (1 - o) * t), f = n % 6, x = [r, i, a, a, s, r][f], v = [s, r, r, i, a, a][f], p = [a, a, s, r, r, i][f];
return { r: x * 255, g: v * 255, b: p * 255 };

@@ -608,3 +609,3 @@ }

}
var M = function() {
var C = function() {
function e(t, r) {

@@ -783,6 +784,6 @@ t === void 0 && (t = ""), r === void 0 && (r = {});

function st(e, t, r) {
return new M(e, r);
return new C(e, r);
}
function Jt(e) {
return Zt(e) ? e : new M(e).toString();
return Zt(e) ? e : new C(e).toString();
}

@@ -803,3 +804,3 @@ const Qt = (e) => {

}));
const C = new M({
const M = new C({
...a,

@@ -809,4 +810,4 @@ a: t.toHsv().a,

});
n?.(B(C, r));
}, u = (v, p) => {
n?.(B(M, r));
}, f = (v, p) => {
if (!tt(p))

@@ -820,3 +821,3 @@ return;

}) => {
const m = new M({
const m = new C({
h: a.h,

@@ -827,4 +828,4 @@ a: t.toHsv().a,

});
i((C) => ({
...C,
i((M) => ({
...M,
s: v,

@@ -834,3 +835,3 @@ v: p

};
return /* @__PURE__ */ ft(U, {
return /* @__PURE__ */ ut(U, {
className: "MuiColorInput-PopoverBody",

@@ -861,3 +862,3 @@ children: [/* @__PURE__ */ c(Vt, {

rgbColor: t.toRgb(),
onChange: u,
onChange: f,
value: t.getAlpha()

@@ -872,3 +873,3 @@ })

} = e;
return /* @__PURE__ */ c(Mt, {
return /* @__PURE__ */ c(Ct, {
className: `MuiColorInput-TextField ${r || ""}`,

@@ -882,7 +883,7 @@ ref: t,

}
function ut(e, t) {
function ft(e, t) {
typeof t == "function" ? t(e) : t && ne(t) && "current" in t && (t.current = e);
}
function de(e) {
return new M(e).isValid;
return new C(e).isValid;
}

@@ -897,3 +898,3 @@ const ge = d.forwardRef((e, t) => {

isAlphaHidden: s,
disablePopover: u,
disablePopover: f,
...x

@@ -905,11 +906,11 @@ } = e, {

} = x, {
onClose: C,
onClose: M,
...H
} = a || {}, l = i || ee, S = m.disabled || p?.disabled || !1, I = d.useRef(null), A = d.useRef(null), [$, E] = d.useState(null), P = n || re, W = st(r, l, {
format: P
}), [L, N] = d.useState(r), [Z, V] = d.useState(r), lt = (f) => {
f.preventDefault(), f.stopPropagation(), !S && !u && E(I.current);
}, O = (f) => {
const h = new M(f);
o?.(f, {
}), [L, N] = d.useState(r), [Z, V] = d.useState(r), lt = (u) => {
u.preventDefault(), u.stopPropagation(), !S && !f && E(I.current);
}, O = (u) => {
const h = new C(u);
o?.(u, {
hex: h.isValid ? h.toHexString() : "",

@@ -921,17 +922,17 @@ hsv: h.isValid ? h.toHsvString() : "",

});
}, dt = (f) => {
const h = f.target.value;
}, dt = (u) => {
const h = u.target.value;
if (N(h), h === "")
V(""), O("");
else {
const K = new M(h), T = B(K, P);
const K = new C(h), T = B(K, P);
V(T), O(T);
}
}, gt = (...f) => {
C?.(...f), E(null), queueMicrotask(() => {
}, gt = (...u) => {
M?.(...u), E(null), queueMicrotask(() => {
A.current?.focus();
});
}, pt = (f) => {
v?.(f);
const h = new M(L);
}, pt = (u) => {
v?.(u);
const h = new C(L);
if (h.isValid)

@@ -942,3 +943,3 @@ h.format !== P && N(B(h, P));

return;
const K = new M(l), T = B(K, P);
const K = new C(l), T = B(K, P);
N(T), V(T), O(T);

@@ -953,10 +954,10 @@ }

}, [r, Z, l]);
const bt = (f) => {
N(f), V(f), O(f);
}, vt = (f) => {
I.current = f, t && ut(f, t);
}, mt = (f) => {
A.current = f, A && ut(f, A);
const bt = (u) => {
N(u), V(u), O(u);
}, vt = (u) => {
I.current = u, t && ft(u, t);
}, mt = (u) => {
A.current = u, A && ft(u, A);
}, J = Boolean($), Q = J ? "color-popover" : void 0;
return /* @__PURE__ */ ft(St, {
return /* @__PURE__ */ ut(St, {
children: [/* @__PURE__ */ c(te, {

@@ -978,7 +979,7 @@ ref: vt,

"aria-describedby": Q,
disablePopover: u || !1,
component: u ? "span" : void 0,
disablePopover: f || !1,
component: f ? "span" : void 0,
bgColor: W.toString(),
isBgColorValid: Boolean(L !== "" && W.isValid),
onClick: u ? void 0 : lt
onClick: f ? void 0 : lt
})

@@ -989,3 +990,3 @@ }),

...m
}), u ? null : /* @__PURE__ */ c(It, {
}), f ? null : /* @__PURE__ */ c(It, {
id: Q,

@@ -992,0 +993,0 @@ open: J,

@@ -1,1 +0,1 @@

(function(p,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("react"),require("@mui/material/InputAdornment"),require("@mui/material/Button"),require("@mui/material/styles"),require("react/jsx-runtime"),require("@mui/material/Popover"),require("@mui/material/Box"),require("@mui/material/Slider"),require("@mui/material/TextField")):typeof define=="function"&&define.amd?define(["exports","react","@mui/material/InputAdornment","@mui/material/Button","@mui/material/styles","react/jsx-runtime","@mui/material/Popover","@mui/material/Box","@mui/material/Slider","@mui/material/TextField"],V):(p=typeof globalThis<"u"?globalThis:p||self,V(p["Mui-color-input"]={},p.React,p.InputAdornment,p.Button,p.styles,p.jsxRuntime,p.Popover,p.Box,p.Slider,p.TextField))})(this,function(p,V,gt,pt,P,l,bt,vt,mt,yt){"use strict";const I=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},h=I(V),xt=I(gt),St=I(pt),wt=I(bt),U=I(vt),tt=I(mt),Mt=I(yt),Ct="linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(135deg, transparent 75%, #ccc 75%) /*! @noflip */",At="linear-gradient(to top, #000000, transparent), linear-gradient(to right, #ffffff, transparent) /*! @noflip */",kt={Button:P.styled(St.default)(()=>({backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 0, 4px -4px, 0px 4px",transition:"none",boxShadow:"0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08)",border:0,borderRadius:4,width:"24px",aspectRatio:"1 / 1",height:"24px",minWidth:0}))},Ht=e=>{const{bgColor:t,className:r,disablePopover:n,isBgColorValid:o,...a}=e;return l.jsx(kt.Button,{disableTouchRipple:!0,style:{backgroundColor:o?t:void 0,backgroundImage:o?void 0:Ct,cursor:n?"default":void 0},className:`MuiColorInput-Button ${r||""}`,...a})},It={Container:P.styled("div")(()=>({width:300,padding:8}))},Tt=e=>{const{children:t,className:r,...n}=e;return l.jsx(wt.default,{className:`MuiColorInput-Popover ${r||""}`,anchorOrigin:{vertical:"bottom",horizontal:"left"},...n,children:l.jsx(It.Container,{children:t})})},Pt={Slider:P.styled(tt.default,{shouldForwardProp:e=>e!=="$rgbaFrom"&&e!=="$rgbaTo"})(()=>({height:8,"& .MuiSlider-rail":{opacity:1,background:"linear-gradient(to right, rgba(var(--rgb-r), var(--rgb-g), var(--rgb-b), 0) 0%, rgba(var(--rgb-r), var(--rgb-g), var(--rgb-b), 1) 100%)"},"& .MuiSlider-track":{color:"transparent",border:0},"& .MuiSlider-thumb":{backgroundColor:"#ffffff",border:"3px solid currentColor"}}))},Rt=e=>{const{rgbColor:t,style:r,className:n,...o}=e,a={"--rgb-r":t.r,"--rgb-g":t.g,"--rgb-b":t.b,...r};return l.jsx(Pt.Slider,{className:`MuiColorInput-AlphaSlider ${n||""}`,style:a,...o})},$={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"},Bt={ArrowUp:{type:"hsvV",value:1},ArrowDown:{type:"hsvV",value:-1},ArrowLeft:{type:"hsvS",value:-1},ArrowRight:{type:"hsvS",value:1}};function Ft(e){return e===$.up||e===$.down||e===$.left||e===$.right}function D(e,t,r){return Math.max(t,Math.min(e,r))}function et(e){return typeof e=="number"}function rt(e,t,r){const n=e.toLocaleString("en",{useGrouping:!1,minimumFractionDigits:t,maximumFractionDigits:r});return Number(n)}function Et(e,t,r){const n=e.getBoundingClientRect(),o=t-n.left,a=r-n.top;return{x:D(o/n.width,0,1),y:D(1-a/n.height,0,1)}}function _t(e){const t=h.default.useRef();return t.current=e,h.default.useCallback((...r)=>t.current?.(...r),[])}const nt={Space:P.styled("div")(()=>({width:"100%",height:"180px",boxSizing:"border-box",outline:0,position:"relative",backgroundImage:At})),Thumb:P.styled("div")(()=>({position:"absolute",border:"3px solid #ffffff",borderRadius:"50%",width:"20px",height:"20px",marginLeft:"-10px /*! @noflip */",marginBottom:"-10px /*! @noflip */",outline:0,boxSizing:"border-box",willChange:"left, bottom",transition:"box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&:hover":{boxShadow:"0px 0px 0px 4px rgba(255 255 255 / 0.16)"},"&.MuiColorInput-Thumb-active":{boxShadow:"0px 0px 0px 8px rgba(255 255 255 / 0.16)"},"@media (hover: none)":{boxShadow:"none"}}))},Vt=e=>{const{hsv:t,onChange:r,currentHue:n}=e,o=h.default.useRef(!1),a=h.default.useRef(null),[i,s]=h.default.useState(!1),u=_t((g,C)=>{if(!a.current)return;const{x:F,y:H}=Et(a.current,g,C);r({s:F,v:H}),a.current&&document.activeElement!==a.current&&a.current.focus()}),M=h.default.useCallback(()=>{o.current&&(o.current=!1,s(!1))},[]),m=h.default.useCallback(g=>{o.current&&u(g.clientX,g.clientY)},[]);h.default.useEffect(()=>(document.addEventListener("mousemove",m,!1),document.addEventListener("mouseup",M,!1),()=>{document.removeEventListener("mousemove",m,!1),document.removeEventListener("mouseup",M,!1)}),[M,m]);const b=g=>{g.preventDefault(),o.current=!0,u(g.clientX,g.clientY),s(!0)},x=g=>{if(Ft(g.key)){g.preventDefault();const{type:C,value:F}=Bt[g.key],H=g.shiftKey?10:1,G=C==="hsvS"?t.s:t.v,N=D(G+F*H*.01,0,1);s(!0),r({s:C==="hsvS"?N:t.s,v:C==="hsvV"?N:t.v})}},k=t.s*100,B=t.v*100;return l.jsx(nt.Space,{onMouseDown:b,ref:a,className:"MuiColorInput-ColorSpace",style:{backgroundColor:`hsl(${n} 100% 50%)`},role:"slider","aria-valuetext":`Saturation ${rt(k,0,0)}%, Brightness ${rt(B,0,0)}%`,onKeyDown:x,tabIndex:0,children:l.jsx(nt.Thumb,{"aria-label":"Color space thumb",className:i?"MuiColorInput-Thumb-active":"",style:{left:`${k}%`,bottom:`${B}%`}})})},Nt={Slider:P.styled(tt.default)(()=>({height:8,"& .MuiSlider-rail":{opacity:1,background:"linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%) /*! @noflip */"},"& .MuiSlider-track":{color:"transparent",border:0},"& .MuiSlider-thumb":{backgroundColor:"#ffffff",border:"3px solid currentColor"}}))},Lt=e=>{const{className:t,...r}=e;return l.jsx(Nt.Slider,{className:`MuiColorInput-HueSlider ${t||""}`,...r})};function d(e,t){Ot(e)&&(e="100%");var r=$t(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function j(e){return Math.min(1,Math.max(0,e))}function Ot(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function $t(e){return typeof e=="string"&&e.indexOf("%")!==-1}function at(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function q(e){return e<=1?"".concat(Number(e)*100,"%"):e}function T(e){return e.length===1?"0"+e:String(e)}function Dt(e,t,r){return{r:d(e,255)*255,g:d(t,255)*255,b:d(r,255)*255}}function ot(e,t,r){e=d(e,255),t=d(t,255),r=d(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),a=0,i=0,s=(n+o)/2;if(n===o)i=0,a=0;else{var u=n-o;switch(i=s>.5?u/(2-n-o):u/(n+o),n){case e:a=(t-r)/u+(t<r?6:0);break;case t:a=(r-e)/u+2;break;case r:a=(e-t)/u+4;break}a/=6}return{h:a,s:i,l:s}}function z(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function jt(e,t,r){var n,o,a;if(e=d(e,360),t=d(t,100),r=d(r,100),t===0)o=r,a=r,n=r;else{var i=r<.5?r*(1+t):r+t-r*t,s=2*r-i;n=z(s,i,e+1/3),o=z(s,i,e),a=z(s,i,e-1/3)}return{r:n*255,g:o*255,b:a*255}}function it(e,t,r){e=d(e,255),t=d(t,255),r=d(r,255);var n=Math.max(e,t,r),o=Math.min(e,t,r),a=0,i=n,s=n-o,u=n===0?0:s/n;if(n===o)a=0;else{switch(n){case e:a=(t-r)/s+(t<r?6:0);break;case t:a=(r-e)/s+2;break;case r:a=(e-t)/s+4;break}a/=6}return{h:a,s:u,v:i}}function qt(e,t,r){e=d(e,360)*6,t=d(t,100),r=d(r,100);var n=Math.floor(e),o=e-n,a=r*(1-t),i=r*(1-o*t),s=r*(1-(1-o)*t),u=n%6,M=[r,i,a,a,s,r][u],m=[s,r,r,i,a,a][u],b=[a,a,s,r,r,i][u];return{r:M*255,g:m*255,b:b*255}}function st(e,t,r,n){var o=[T(Math.round(e).toString(16)),T(Math.round(t).toString(16)),T(Math.round(r).toString(16))];return n&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function Gt(e,t,r,n,o){var a=[T(Math.round(e).toString(16)),T(Math.round(t).toString(16)),T(Math.round(r).toString(16)),T(Wt(n))];return o&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function Wt(e){return Math.round(parseFloat(e)*255).toString(16)}function ut(e){return v(e)/255}function v(e){return parseInt(e,16)}function Kt(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var Y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ut(e){var t={r:0,g:0,b:0},r=1,n=null,o=null,a=null,i=!1,s=!1;return typeof e=="string"&&(e=Xt(e)),typeof e=="object"&&(S(e.r)&&S(e.g)&&S(e.b)?(t=Dt(e.r,e.g,e.b),i=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):S(e.h)&&S(e.s)&&S(e.v)?(n=q(e.s),o=q(e.v),t=qt(e.h,n,o),i=!0,s="hsv"):S(e.h)&&S(e.s)&&S(e.l)&&(n=q(e.s),a=q(e.l),t=jt(e.h,n,a),i=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=at(r),{ok:i,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var zt="[-\\+]?\\d+%?",Yt="[-\\+]?\\d*\\.\\d+%?",A="(?:".concat(Yt,")|(?:").concat(zt,")"),X="[\\s|\\(]+(".concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")\\s*\\)?"),Z="[\\s|\\(]+(".concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")\\s*\\)?"),y={CSS_UNIT:new RegExp(A),rgb:new RegExp("rgb"+X),rgba:new RegExp("rgba"+Z),hsl:new RegExp("hsl"+X),hsla:new RegExp("hsla"+Z),hsv:new RegExp("hsv"+X),hsva:new RegExp("hsva"+Z),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Xt(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Y[e])e=Y[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=y.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=y.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=y.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=y.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=y.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=y.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=y.hex8.exec(e),r?{r:v(r[1]),g:v(r[2]),b:v(r[3]),a:ut(r[4]),format:t?"name":"hex8"}:(r=y.hex6.exec(e),r?{r:v(r[1]),g:v(r[2]),b:v(r[3]),format:t?"name":"hex"}:(r=y.hex4.exec(e),r?{r:v(r[1]+r[1]),g:v(r[2]+r[2]),b:v(r[3]+r[3]),a:ut(r[4]+r[4]),format:t?"name":"hex8"}:(r=y.hex3.exec(e),r?{r:v(r[1]+r[1]),g:v(r[2]+r[2]),b:v(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function S(e){return Boolean(y.CSS_UNIT.exec(String(e)))}var w=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=Kt(t)),this.originalInput=t;var o=Ut(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:o.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,n,o,a=t.r/255,i=t.g/255,s=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),s<=.03928?o=s/12.92:o=Math.pow((s+.055)/1.055,2.4),.2126*r+.7152*n+.0722*o},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=at(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=it(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=it(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(o,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=ot(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=ot(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),o=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(o,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(o,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),st(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Gt(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(d(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(d(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+st(this.r,this.g,this.b,!1),r=0,n=Object.entries(Y);r<n.length;r++){var o=n[r],a=o[0],i=o[1];if(t===i)return a}return!1},e.prototype.toString=function(t){var r=Boolean(t);t=t??this.format;var n=!1,o=this.a<1&&this.a>=0,a=!r&&o&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=j(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=j(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=j(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=j(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),o=new e(t).toRgb(),a=r/100,i={r:(o.r-n.r)*a+n.r,g:(o.g-n.g)*a+n.g,b:(o.b-n.b)*a+n.b,a:(o.a-n.a)*a+n.a};return new e(i)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),o=360/r,a=[this];for(n.h=(n.h-(o*t>>1)+720)%360;--t;)n.h=(n.h+o)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),n=r.h,o=r.s,a=r.v,i=[],s=1/t;t--;)i.push(new e({h:n,s:o,v:a})),a=(a+s)%1;return i},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb();return new e({r:n.r+(r.r-n.r)*r.a,g:n.g+(r.g-n.g)*r.a,b:n.b+(r.b-n.b)*r.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,o=[this],a=360/t,i=1;i<t;i++)o.push(new e({h:(n+i*a)%360,s:r.s,l:r.l}));return o},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function Zt(e){return typeof e=="string"}function R(e,t){return e.toString(t)}function ft(e,t,r){return new w(e,r)}function Jt(e){return Zt(e)?e:new w(e).toString()}const Qt=e=>{const{currentColor:t,format:r,onChange:n,isAlphaHidden:o}=e,[a,i]=h.default.useState(t.toHsv()),s=(m,b)=>{if(!et(b))return;const x=D(360*b/100,0,359);i(B=>({...B,h:x}));const k=new w({...a,a:t.toHsv().a,h:x});n?.(R(k,r))},u=(m,b)=>{if(!et(b))return;const x=t.clone().setAlpha(b);n?.(R(x,r))},M=({s:m,v:b})=>{const x=new w({h:a.h,a:t.toHsv().a,s:m,v:b});i(k=>({...k,s:m,v:b})),n?.(R(x,r))};return l.jsxs(U.default,{className:"MuiColorInput-PopoverBody",children:[l.jsx(Vt,{currentHue:a.h,hsv:a,onChange:M}),l.jsx(U.default,{mt:"10px",px:"3px",children:l.jsx(Lt,{min:0,max:100,step:1,onChange:s,"aria-label":"hue",value:a.h*100/360})}),o?null:l.jsx(U.default,{mt:"10px",px:"3px",children:l.jsx(Rt,{min:0,max:1,step:.01,"aria-label":"alpha",rgbColor:t.toRgb(),onChange:u,value:t.getAlpha()})})]})},te=h.default.forwardRef((e,t)=>{const{className:r,...n}=e;return l.jsx(Mt.default,{className:`MuiColorInput-TextField ${r||""}`,ref:t,...n})}),ee="black",re="rgb";function ne(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}function lt(e,t){typeof t=="function"?t(e):t&&ne(t)&&"current"in t&&(t.current=e)}function ae(e){return new w(e).isValid}const oe=h.default.forwardRef((e,t)=>{const{value:r,format:n,onChange:o,PopoverProps:a,fallbackValue:i,isAlphaHidden:s,disablePopover:u,...M}=e,{onBlur:m,InputProps:b,...x}=M,{onClose:k,...B}=a||{},g=i||ee,C=x.disabled||b?.disabled||!1,F=h.default.useRef(null),H=h.default.useRef(null),[G,N]=h.default.useState(null),E=n||re,J=ft(r,g,{format:E}),[W,L]=h.default.useState(r),[ct,O]=h.default.useState(r),ie=f=>{f.preventDefault(),f.stopPropagation(),!C&&!u&&N(F.current)},K=f=>{const c=new w(f);o?.(f,{hex:c.isValid?c.toHexString():"",hsv:c.isValid?c.toHsvString():"",hsl:c.isValid?c.toHslString():"",rgb:c.isValid?c.toRgbString():"",hex8:c.isValid?c.toHex8String():""})},se=f=>{const c=f.target.value;if(L(c),c==="")O(""),K("");else{const Q=new w(c),_=R(Q,E);O(_),K(_)}},ue=(...f)=>{k?.(...f),N(null),queueMicrotask(()=>{H.current?.focus()})},fe=f=>{m?.(f);const c=new w(W);if(c.isValid)c.format!==E&&L(R(c,E));else{if(W==="")return;const Q=new w(g),_=R(Q,E);L(_),O(_),K(_)}};h.default.useEffect(()=>{if(r!==ct){const c=ft(r).originalInput;O(c),L(c)}},[r,ct,g]);const le=f=>{L(f),O(f),K(f)},ce=f=>{F.current=f,t&&lt(f,t)},he=f=>{H.current=f,H&&lt(f,H)},ht=Boolean(G),dt=ht?"color-popover":void 0;return l.jsxs(l.Fragment,{children:[l.jsx(te,{ref:ce,spellCheck:"false",type:"text",autoComplete:"off",onChange:se,value:Jt(W),onBlur:fe,inputRef:he,disabled:C,InputProps:{startAdornment:l.jsx(xt.default,{position:"start",children:l.jsx(Ht,{disabled:C,"aria-describedby":dt,disablePopover:u||!1,component:u?"span":void 0,bgColor:J.toString(),isBgColorValid:Boolean(W!==""&&J.isValid),onClick:u?void 0:ie})}),...b},...x}),u?null:l.jsx(Tt,{id:dt,open:ht,anchorEl:G,onClose:ue,...B,children:l.jsx(Qt,{onChange:le,currentColor:J,format:E,isAlphaHidden:s})})]})});p.MuiColorInput=oe,p.matchIsValidColor=ae,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
(function(p,V){typeof exports=="object"&&typeof module<"u"?V(exports,require("react"),require("@mui/material/InputAdornment"),require("@mui/material/Button"),require("@mui/material/styles"),require("react/jsx-runtime"),require("@mui/material/Popover"),require("@mui/material/Box"),require("@mui/material/Slider"),require("@mui/material/TextField")):typeof define=="function"&&define.amd?define(["exports","react","@mui/material/InputAdornment","@mui/material/Button","@mui/material/styles","react/jsx-runtime","@mui/material/Popover","@mui/material/Box","@mui/material/Slider","@mui/material/TextField"],V):(p=typeof globalThis<"u"?globalThis:p||self,V(p["Mui-color-input"]={},p.React,p.InputAdornment,p.Button,p.styles,p.jsxRuntime,p.Popover,p.Box,p.Slider,p.TextField))})(this,function(p,V,gt,pt,T,l,bt,vt,mt,yt){"use strict";const I=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},h=I(V),xt=I(gt),St=I(pt),wt=I(bt),U=I(vt),tt=I(mt),Ct=I(yt),Mt="linear-gradient(45deg, #ccc 25%, transparent 25%), linear-gradient(135deg, #ccc 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #ccc 75%), linear-gradient(135deg, transparent 75%, #ccc 75%) /*! @noflip */",At="linear-gradient(to top, #000000, transparent), linear-gradient(to right, #ffffff, transparent) /*! @noflip */",kt={Button:T.styled(St.default)(()=>({backgroundSize:"8px 8px",backgroundPosition:"0 0, 4px 0, 4px -4px, 0px 4px",transition:"none",boxShadow:"0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08)",border:0,borderRadius:4,width:"24px",aspectRatio:"1 / 1",height:"24px",minWidth:0}))},Ht=e=>{const{bgColor:t,className:r,disablePopover:n,isBgColorValid:i,...a}=e;return l.jsx(kt.Button,{disableTouchRipple:!0,style:{backgroundColor:i?t:void 0,backgroundImage:i?void 0:Mt,cursor:n?"default":void 0},className:`MuiColorInput-Button ${r||""}`,...a})},It={Container:T.styled("div")(()=>({width:300,padding:8}))},Pt=e=>{const{children:t,className:r,...n}=e;return l.jsx(wt.default,{className:`MuiColorInput-Popover ${r||""}`,anchorOrigin:{vertical:"bottom",horizontal:"left"},...n,children:l.jsx(It.Container,{children:t})})},Tt={Slider:T.styled(tt.default,{shouldForwardProp:e=>e!=="$rgbaFrom"&&e!=="$rgbaTo"})(()=>({height:8,"& .MuiSlider-rail":{opacity:1,background:"linear-gradient(to right, rgba(var(--rgb-r), var(--rgb-g), var(--rgb-b), 0) 0%, rgba(var(--rgb-r), var(--rgb-g), var(--rgb-b), 1) 100%)"},"& .MuiSlider-track":{color:"transparent",border:0},"& .MuiSlider-thumb":{backgroundColor:"#ffffff",border:"3px solid currentColor"}}))},Rt=e=>{const{rgbColor:t,style:r,className:n,...i}=e,a={"--rgb-r":t.r,"--rgb-g":t.g,"--rgb-b":t.b,...r};return l.jsx(Tt.Slider,{className:`MuiColorInput-AlphaSlider ${n||""}`,style:a,...i})},$={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight"},Bt={ArrowUp:{type:"hsvV",value:1},ArrowDown:{type:"hsvV",value:-1},ArrowLeft:{type:"hsvS",value:-1},ArrowRight:{type:"hsvS",value:1}};function Ft(e){return e===$.up||e===$.down||e===$.left||e===$.right}function D(e,t,r){return Math.max(t,Math.min(e,r))}function et(e){return typeof e=="number"}function rt(e,t,r){const n=e.toLocaleString("en",{useGrouping:!1,minimumFractionDigits:t,maximumFractionDigits:r});return Number(n)}function Et(e,t,r){const n=e.getBoundingClientRect(),i=t-n.left,a=r-n.top;return{x:D(i/n.width,0,1),y:D(1-a/n.height,0,1)}}function _t(e){const t=h.default.useRef();return t.current=e,h.default.useCallback((...r)=>t.current?.(...r),[])}const nt={Space:T.styled("div")(()=>({width:"100%",height:"180px",boxSizing:"border-box",outline:0,position:"relative",backgroundImage:At})),Thumb:T.styled("div")(()=>({position:"absolute",border:"3px solid #ffffff",borderRadius:"50%",width:"20px",height:"20px",marginLeft:"-10px /*! @noflip */",marginBottom:"-10px /*! @noflip */",outline:0,boxSizing:"border-box",willChange:"left, bottom",transition:"box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms","&:hover":{boxShadow:"0px 0px 0px 4px rgba(255 255 255 / 0.16)"},"&.MuiColorInput-Thumb-active":{boxShadow:"0px 0px 0px 8px rgba(255 255 255 / 0.16)"},"@media (hover: none)":{boxShadow:"none"}}))},Vt=e=>{const{hsv:t,onChange:r,currentHue:n}=e,i=h.default.useRef(!1),a=h.default.useRef(null),[o,s]=h.default.useState(!1),u=_t((g,M)=>{if(!a.current)return;const{x:F,y:H}=Et(a.current,g,M);r({s:F,v:H}),a.current&&document.activeElement!==a.current&&a.current.focus()}),C=h.default.useCallback(()=>{i.current&&(i.current=!1,s(!1))},[]),m=h.default.useCallback(g=>{i.current&&u(g.clientX,g.clientY)},[]);h.default.useEffect(()=>(document.addEventListener("pointermove",m,!1),document.addEventListener("pointerup",C,!1),()=>{document.removeEventListener("pointermove",m,!1),document.removeEventListener("pointerup",C,!1)}),[C,m]);const b=g=>{g.preventDefault(),i.current=!0,u(g.clientX,g.clientY),s(!0)},x=g=>{if(Ft(g.key)){g.preventDefault();const{type:M,value:F}=Bt[g.key],H=g.shiftKey?10:1,G=M==="hsvS"?t.s:t.v,N=D(G+F*H*.01,0,1);s(!0),r({s:M==="hsvS"?N:t.s,v:M==="hsvV"?N:t.v})}},k=t.s*100,B=t.v*100;return l.jsx(nt.Space,{onPointerDown:b,ref:a,className:"MuiColorInput-ColorSpace",style:{backgroundColor:`hsl(${n} 100% 50%)`,touchAction:"none"},role:"slider","aria-valuetext":`Saturation ${rt(k,0,0)}%, Brightness ${rt(B,0,0)}%`,onKeyDown:x,tabIndex:0,children:l.jsx(nt.Thumb,{"aria-label":"Color space thumb",className:o?"MuiColorInput-Thumb-active":"",style:{left:`${k}%`,bottom:`${B}%`}})})},Nt={Slider:T.styled(tt.default)(()=>({height:8,"& .MuiSlider-rail":{opacity:1,background:"linear-gradient(to right, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%) /*! @noflip */"},"& .MuiSlider-track":{color:"transparent",border:0},"& .MuiSlider-thumb":{backgroundColor:"#ffffff",border:"3px solid currentColor"}}))},Lt=e=>{const{className:t,...r}=e;return l.jsx(Nt.Slider,{className:`MuiColorInput-HueSlider ${t||""}`,...r})};function d(e,t){Ot(e)&&(e="100%");var r=$t(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function j(e){return Math.min(1,Math.max(0,e))}function Ot(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function $t(e){return typeof e=="string"&&e.indexOf("%")!==-1}function at(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function q(e){return e<=1?"".concat(Number(e)*100,"%"):e}function P(e){return e.length===1?"0"+e:String(e)}function Dt(e,t,r){return{r:d(e,255)*255,g:d(t,255)*255,b:d(r,255)*255}}function it(e,t,r){e=d(e,255),t=d(t,255),r=d(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,o=0,s=(n+i)/2;if(n===i)o=0,a=0;else{var u=n-i;switch(o=s>.5?u/(2-n-i):u/(n+i),n){case e:a=(t-r)/u+(t<r?6:0);break;case t:a=(r-e)/u+2;break;case r:a=(e-t)/u+4;break}a/=6}return{h:a,s:o,l:s}}function z(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*(6*r):r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function jt(e,t,r){var n,i,a;if(e=d(e,360),t=d(t,100),r=d(r,100),t===0)i=r,a=r,n=r;else{var o=r<.5?r*(1+t):r+t-r*t,s=2*r-o;n=z(s,o,e+1/3),i=z(s,o,e),a=z(s,o,e-1/3)}return{r:n*255,g:i*255,b:a*255}}function ot(e,t,r){e=d(e,255),t=d(t,255),r=d(r,255);var n=Math.max(e,t,r),i=Math.min(e,t,r),a=0,o=n,s=n-i,u=n===0?0:s/n;if(n===i)a=0;else{switch(n){case e:a=(t-r)/s+(t<r?6:0);break;case t:a=(r-e)/s+2;break;case r:a=(e-t)/s+4;break}a/=6}return{h:a,s:u,v:o}}function qt(e,t,r){e=d(e,360)*6,t=d(t,100),r=d(r,100);var n=Math.floor(e),i=e-n,a=r*(1-t),o=r*(1-i*t),s=r*(1-(1-i)*t),u=n%6,C=[r,o,a,a,s,r][u],m=[s,r,r,o,a,a][u],b=[a,a,s,r,r,o][u];return{r:C*255,g:m*255,b:b*255}}function st(e,t,r,n){var i=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16))];return n&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Gt(e,t,r,n,i){var a=[P(Math.round(e).toString(16)),P(Math.round(t).toString(16)),P(Math.round(r).toString(16)),P(Wt(n))];return i&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function Wt(e){return Math.round(parseFloat(e)*255).toString(16)}function ut(e){return v(e)/255}function v(e){return parseInt(e,16)}function Kt(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var Y={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ut(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,o=!1,s=!1;return typeof e=="string"&&(e=Xt(e)),typeof e=="object"&&(S(e.r)&&S(e.g)&&S(e.b)?(t=Dt(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):S(e.h)&&S(e.s)&&S(e.v)?(n=q(e.s),i=q(e.v),t=qt(e.h,n,i),o=!0,s="hsv"):S(e.h)&&S(e.s)&&S(e.l)&&(n=q(e.s),a=q(e.l),t=jt(e.h,n,a),o=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(r=e.a)),r=at(r),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}var zt="[-\\+]?\\d+%?",Yt="[-\\+]?\\d*\\.\\d+%?",A="(?:".concat(Yt,")|(?:").concat(zt,")"),X="[\\s|\\(]+(".concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")\\s*\\)?"),Z="[\\s|\\(]+(".concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")[,|\\s]+(").concat(A,")\\s*\\)?"),y={CSS_UNIT:new RegExp(A),rgb:new RegExp("rgb"+X),rgba:new RegExp("rgba"+Z),hsl:new RegExp("hsl"+X),hsla:new RegExp("hsla"+Z),hsv:new RegExp("hsv"+X),hsva:new RegExp("hsva"+Z),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Xt(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(Y[e])e=Y[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r=y.rgb.exec(e);return r?{r:r[1],g:r[2],b:r[3]}:(r=y.rgba.exec(e),r?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=y.hsl.exec(e),r?{h:r[1],s:r[2],l:r[3]}:(r=y.hsla.exec(e),r?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=y.hsv.exec(e),r?{h:r[1],s:r[2],v:r[3]}:(r=y.hsva.exec(e),r?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=y.hex8.exec(e),r?{r:v(r[1]),g:v(r[2]),b:v(r[3]),a:ut(r[4]),format:t?"name":"hex8"}:(r=y.hex6.exec(e),r?{r:v(r[1]),g:v(r[2]),b:v(r[3]),format:t?"name":"hex"}:(r=y.hex4.exec(e),r?{r:v(r[1]+r[1]),g:v(r[2]+r[2]),b:v(r[3]+r[3]),a:ut(r[4]+r[4]),format:t?"name":"hex8"}:(r=y.hex3.exec(e),r?{r:v(r[1]+r[1]),g:v(r[2]+r[2]),b:v(r[3]+r[3]),format:t?"name":"hex"}:!1)))))))))}function S(e){return Boolean(y.CSS_UNIT.exec(String(e)))}var w=function(){function e(t,r){t===void 0&&(t=""),r===void 0&&(r={});var n;if(t instanceof e)return t;typeof t=="number"&&(t=Kt(t)),this.originalInput=t;var i=Ut(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=r.format)!==null&&n!==void 0?n:i.format,this.gradientType=r.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),r,n,i,a=t.r/255,o=t.g/255,s=t.b/255;return a<=.03928?r=a/12.92:r=Math.pow((a+.055)/1.055,2.4),o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?i=s/12.92:i=Math.pow((s+.055)/1.055,2.4),.2126*r+.7152*n+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=at(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var t=ot(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=ot(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsva(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=it(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=it(this.r,this.g,this.b),r=Math.round(t.h*360),n=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(r,", ").concat(n,"%, ").concat(i,"%)"):"hsla(".concat(r,", ").concat(n,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),st(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),Gt(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),r=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(r,", ").concat(n,")"):"rgba(".concat(t,", ").concat(r,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(r){return"".concat(Math.round(d(r,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(r){return Math.round(d(r,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+st(this.r,this.g,this.b,!1),r=0,n=Object.entries(Y);r<n.length;r++){var i=n[r],a=i[0],o=i[1];if(t===o)return a}return!1},e.prototype.toString=function(t){var r=Boolean(t);t=t??this.format;var n=!1,i=this.a<1&&this.a>=0,a=!r&&i&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l+=t/100,r.l=j(r.l),new e(r)},e.prototype.brighten=function(t){t===void 0&&(t=10);var r=this.toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),new e(r)},e.prototype.darken=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.l-=t/100,r.l=j(r.l),new e(r)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s-=t/100,r.s=j(r.s),new e(r)},e.prototype.saturate=function(t){t===void 0&&(t=10);var r=this.toHsl();return r.s+=t/100,r.s=j(r.s),new e(r)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var r=this.toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,new e(r)},e.prototype.mix=function(t,r){r===void 0&&(r=50);var n=this.toRgb(),i=new e(t).toRgb(),a=r/100,o={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return new e(o)},e.prototype.analogous=function(t,r){t===void 0&&(t=6),r===void 0&&(r=30);var n=this.toHsl(),i=360/r,a=[this];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(new e(n));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var r=this.toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(new e({h:n,s:i,v:a})),a=(a+s)%1;return o},e.prototype.splitcomplement=function(){var t=this.toHsl(),r=t.h;return[this,new e({h:(r+72)%360,s:t.s,l:t.l}),new e({h:(r+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var r=this.toRgb(),n=new e(t).toRgb();return new e({r:n.r+(r.r-n.r)*r.a,g:n.g+(r.g-n.g)*r.a,b:n.b+(r.b-n.b)*r.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var r=this.toHsl(),n=r.h,i=[this],a=360/t,o=1;o<t;o++)i.push(new e({h:(n+o*a)%360,s:r.s,l:r.l}));return i},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function Zt(e){return typeof e=="string"}function R(e,t){return e.toString(t)}function ft(e,t,r){return new w(e,r)}function Jt(e){return Zt(e)?e:new w(e).toString()}const Qt=e=>{const{currentColor:t,format:r,onChange:n,isAlphaHidden:i}=e,[a,o]=h.default.useState(t.toHsv()),s=(m,b)=>{if(!et(b))return;const x=D(360*b/100,0,359);o(B=>({...B,h:x}));const k=new w({...a,a:t.toHsv().a,h:x});n?.(R(k,r))},u=(m,b)=>{if(!et(b))return;const x=t.clone().setAlpha(b);n?.(R(x,r))},C=({s:m,v:b})=>{const x=new w({h:a.h,a:t.toHsv().a,s:m,v:b});o(k=>({...k,s:m,v:b})),n?.(R(x,r))};return l.jsxs(U.default,{className:"MuiColorInput-PopoverBody",children:[l.jsx(Vt,{currentHue:a.h,hsv:a,onChange:C}),l.jsx(U.default,{mt:"10px",px:"3px",children:l.jsx(Lt,{min:0,max:100,step:1,onChange:s,"aria-label":"hue",value:a.h*100/360})}),i?null:l.jsx(U.default,{mt:"10px",px:"3px",children:l.jsx(Rt,{min:0,max:1,step:.01,"aria-label":"alpha",rgbColor:t.toRgb(),onChange:u,value:t.getAlpha()})})]})},te=h.default.forwardRef((e,t)=>{const{className:r,...n}=e;return l.jsx(Ct.default,{className:`MuiColorInput-TextField ${r||""}`,ref:t,...n})}),ee="black",re="rgb";function ne(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}function lt(e,t){typeof t=="function"?t(e):t&&ne(t)&&"current"in t&&(t.current=e)}function ae(e){return new w(e).isValid}const ie=h.default.forwardRef((e,t)=>{const{value:r,format:n,onChange:i,PopoverProps:a,fallbackValue:o,isAlphaHidden:s,disablePopover:u,...C}=e,{onBlur:m,InputProps:b,...x}=C,{onClose:k,...B}=a||{},g=o||ee,M=x.disabled||b?.disabled||!1,F=h.default.useRef(null),H=h.default.useRef(null),[G,N]=h.default.useState(null),E=n||re,J=ft(r,g,{format:E}),[W,L]=h.default.useState(r),[ct,O]=h.default.useState(r),oe=f=>{f.preventDefault(),f.stopPropagation(),!M&&!u&&N(F.current)},K=f=>{const c=new w(f);i?.(f,{hex:c.isValid?c.toHexString():"",hsv:c.isValid?c.toHsvString():"",hsl:c.isValid?c.toHslString():"",rgb:c.isValid?c.toRgbString():"",hex8:c.isValid?c.toHex8String():""})},se=f=>{const c=f.target.value;if(L(c),c==="")O(""),K("");else{const Q=new w(c),_=R(Q,E);O(_),K(_)}},ue=(...f)=>{k?.(...f),N(null),queueMicrotask(()=>{H.current?.focus()})},fe=f=>{m?.(f);const c=new w(W);if(c.isValid)c.format!==E&&L(R(c,E));else{if(W==="")return;const Q=new w(g),_=R(Q,E);L(_),O(_),K(_)}};h.default.useEffect(()=>{if(r!==ct){const c=ft(r).originalInput;O(c),L(c)}},[r,ct,g]);const le=f=>{L(f),O(f),K(f)},ce=f=>{F.current=f,t&&lt(f,t)},he=f=>{H.current=f,H&&lt(f,H)},ht=Boolean(G),dt=ht?"color-popover":void 0;return l.jsxs(l.Fragment,{children:[l.jsx(te,{ref:ce,spellCheck:"false",type:"text",autoComplete:"off",onChange:se,value:Jt(W),onBlur:fe,inputRef:he,disabled:M,InputProps:{startAdornment:l.jsx(xt.default,{position:"start",children:l.jsx(Ht,{disabled:M,"aria-describedby":dt,disablePopover:u||!1,component:u?"span":void 0,bgColor:J.toString(),isBgColorValid:Boolean(W!==""&&J.isValid),onClick:u?void 0:oe})}),...b},...x}),u?null:l.jsx(Pt,{id:dt,open:ht,anchorEl:G,onClose:ue,...B,children:l.jsx(Qt,{onChange:le,currentColor:J,format:E,isAlphaHidden:s})})]})});p.MuiColorInput=ie,p.matchIsValidColor=ae,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});

@@ -10,3 +10,3 @@ {

"homepage": "https://viclafouch.github.io/mui-color-input/",
"version": "1.0.4",
"version": "1.0.5",
"files": [

@@ -13,0 +13,0 @@ "dist"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc