Socket
Socket
Sign inDemoInstall

@uiw/react-color

Package Overview
Dependencies
Maintainers
2
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uiw/react-color - npm Package Compare versions

Comparing version 2.0.9 to 2.1.0

2

dist/color.min.js
/*! For license information please see color.min.js.LICENSE.txt */
!function(e,r){"object"===typeof exports&&"object"===typeof module?module.exports=r(require("react")):"function"===typeof define&&define.amd?define(["react"],r):"object"===typeof exports?exports["@uiw/react-color"]=r(require("react")):e["@uiw/react-color"]=r(e.React)}(self,(e=>(()=>{"use strict";var r={335:(e,r,o)=>{var t=o(442),a=Symbol.for("react.element"),l=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function d(e,r,o){var t,l={},d=null,c=null;for(t in void 0!==o&&(d=""+o),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(c=r.ref),r)s.call(r,t)&&!i.hasOwnProperty(t)&&(l[t]=r[t]);if(e&&e.defaultProps)for(t in r=e.defaultProps)void 0===l[t]&&(l[t]=r[t]);return{$$typeof:a,type:e,key:d,ref:c,props:l,_owner:n.current}}r.jsx=d,r.jsxs=d},85:(e,r,o)=>{e.exports=o(335)},442:r=>{r.exports=e}},o={};function t(e){var a=o[e];if(void 0!==a)return a.exports;var l=o[e]={exports:{}};return r[e](l,l.exports,t),l.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{function e(){return e=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},e.apply(this,arguments)}t.r(a),t.d(a,{Alpha:()=>oe,BACKGROUND_IMG:()=>ee,Block:()=>he,Chrome:()=>ze,Circle:()=>qe,Colorful:()=>Ve,Compact:()=>Je,EditableInput:()=>le,EditableInputHSLA:()=>Pe,EditableInputRGBA:()=>Ne,Github:()=>ye,Hue:()=>je,Material:()=>tr,Pointer:()=>$,Saturation:()=>ke,ShadeSlider:()=>pr,Sketch:()=>fr,Slider:()=>mr,Swatch:()=>ie,Wheel:()=>Sr,baseNamed:()=>sr,color:()=>P,colorKeywords:()=>lr,colorKeywordsBase:()=>nr,colorNameToHex:()=>ir,equalColorObjects:()=>L,equalColorString:()=>M,equalHex:()=>H,getContrastingColor:()=>T,hexToHsva:()=>w,hexToRgba:()=>k,hslStringToHsla:()=>c,hslStringToHsva:()=>h,hslaStringToHsva:()=>p,hslaToHsl:()=>S,hslaToHsva:()=>g,hsvStringToHsva:()=>v,hsvaStringToHsva:()=>b,hsvaToHex:()=>N,hsvaToHexa:()=>E,hsvaToHslString:()=>s,hsvaToHsla:()=>u,hsvaToHslaString:()=>d,hsvaToHsv:()=>D,hsvaToHsvString:()=>n,hsvaToHsvaString:()=>i,hsvaToRgbString:()=>A,hsvaToRgba:()=>B,hsvaToRgbaString:()=>j,parseHue:()=>x,rgbStringToHsva:()=>y,rgbaStringToHsva:()=>m,rgbaToHex:()=>C,rgbaToHexa:()=>F,rgbaToHsva:()=>l,rgbaToRgb:()=>R,validHex:()=>I});var r=255,o=100,l=e=>{var{r:t,g:a,b:l,a:s}=e,n=Math.max(t,a,l),i=n-Math.min(t,a,l),d=i?n===t?(a-l)/i:n===a?2+(l-t)/i:4+(t-a)/i:0;return{h:60*(d<0?d+6:d),s:n?i/n*o:0,v:n/r*o,a:s}},s=e=>{var{h:r,s:o,l:t}=u(e);return"hsl("+r+", "+Math.round(o)+"%, "+Math.round(t)+"%)"},n=e=>{var{h:r,s:o,v:t}=e;return"hsv("+r+", "+o+"%, "+t+"%)"},i=e=>{var{h:r,s:o,v:t,a:a}=e;return"hsva("+r+", "+o+"%, "+t+"%, "+a+")"},d=e=>{var{h:r,s:o,l:t,a:a}=u(e);return"hsla("+r+", "+o+"%, "+t+"%, "+a+")"},c=e=>{var[r,o,t,a]=(e.match(/\d+/g)||[]).map(Number);return{h:r,s:o,l:t,a:a}},p=e=>{var r=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?g({h:x(r[1],r[2]),s:Number(r[3]),l:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},h=p,g=e=>{var{h:r,s:t,l:a,a:l}=e;return{h:r,s:(t*=(a<50?a:o-a)/o)>0?2*t/(a+t)*o:0,v:a+t,a:l}},u=e=>{var{h:r,s:t,v:a,a:l}=e,s=(200-t)*a/o;return{h:r,s:s>0&&s<200?t*a/o/(s<=o?s:200-s)*o:0,l:s/2,a:l}},b=e=>{var r=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?{h:x(r[1],r[2]),s:Number(r[3]),v:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?o:1)}:{h:0,s:0,v:0,a:1}},f={grad:.9,turn:360,rad:360/(2*Math.PI)},x=function(e,r){return void 0===r&&(r="deg"),Number(e)*(f[r]||1)},v=b,m=e=>{var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?l({r:Number(t[1])/(t[2]?o/r:1),g:Number(t[3])/(t[4]?o/r:1),b:Number(t[5])/(t[6]?o/r:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?o:1)}):{h:0,s:0,v:0,a:1}},y=m,C=e=>{var r,{r:o,g:t,b:a}=e;return"#"+(r=(o<<16|t<<8|a).toString(16),new Array(7-r.length).join("0")+r)},F=e=>{var{r:r,g:o,b:t,a:a}=e,l="number"===typeof a&&(255*a|256).toString(16).slice(1);return""+C({r:r,g:o,b:t,a:a})+(l||"")},w=e=>l(k(e)),k=e=>{var o=e.replace("#","");/^#?/.test(e)&&3===o.length&&(e="#"+o.charAt(0)+o.charAt(0)+o.charAt(1)+o.charAt(1)+o.charAt(2)+o.charAt(2));var t=new RegExp("[A-Za-z0-9]{2}","g"),[a,l,s=0,n]=e.match(t).map((e=>parseInt(e,16)));return{r:a,g:l,b:s,a:(null!=n?n:255)/r}},B=t=>{var{h:a,s:l,v:s,a:n}=t,i=a/60,d=l/o,c=s/o,p=Math.floor(i)%6,h=i-Math.floor(i),g=r*c*(1-d),u=r*c*(1-d*h),b=r*c*(1-d*(1-h));c*=r;var f={};switch(p){case 0:f.r=c,f.g=b,f.b=g;break;case 1:f.r=u,f.g=c,f.b=g;break;case 2:f.r=g,f.g=c,f.b=b;break;case 3:f.r=g,f.g=u,f.b=c;break;case 4:f.r=b,f.g=g,f.b=c;break;case 5:f.r=c,f.g=g,f.b=u}return f.r=Math.round(f.r),f.g=Math.round(f.g),f.b=Math.round(f.b),e({},f,{a:n})},A=e=>{var{r:r,g:o,b:t}=B(e);return"rgb("+r+", "+o+", "+t+")"},j=e=>{var{r:r,g:o,b:t,a:a}=B(e);return"rgba("+r+", "+o+", "+t+", "+a+")"},R=e=>{var{r:r,g:o,b:t}=e;return{r:r,g:o,b:t}},S=e=>{var{h:r,s:o,l:t}=e;return{h:r,s:o,l:t}},N=e=>C(B(e)),E=e=>F(B(e)),D=e=>{var{h:r,s:o,v:t}=e;return{h:r,s:o,v:t}},P=e=>{var r,o,t,a,l,s,n,i;return"string"===typeof e&&I(e)?(s=w(e),n=e):"string"!==typeof e&&(s=e),s&&(t=D(s),l=u(s),a=B(s),i=F(a),n=N(s),o=S(l),r=R(a)),{rgb:r,hsl:o,hsv:t,rgba:a,hsla:l,hsva:s,hex:n,hexa:i}},T=e=>{if(!e)return"#ffffff";var r=P(e);return(299*r.rgb.r+587*r.rgb.g+114*r.rgb.b)/1e3>=128?"#000000":"#ffffff"},L=(e,r)=>{if(e===r)return!0;for(var o in e)if(e[o]!==r[o])return!1;return!0},M=(e,r)=>e.replace(/\s/g,"")===r.replace(/\s/g,""),H=(e,r)=>e.toLowerCase()===r.toLowerCase()||L(k(e),k(r)),I=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function z(e,r){if(null==e)return{};var o,t,a={},l=Object.keys(e);for(t=0;t<l.length;t++)o=l[t],r.indexOf(o)>=0||(a[o]=e[o]);return a}var O=t(442),_=t.n(O);function W(e){var r=(0,O.useRef)(e);return(0,O.useEffect)((()=>{r.current=e})),(0,O.useCallback)(((e,o)=>r.current&&r.current(e,o)),[])}var q=e=>"touches"in e,G=e=>{!q(e)&&e.preventDefault&&e.preventDefault()},U=function(e,r,o){return void 0===r&&(r=0),void 0===o&&(o=1),e>o?o:e<r?r:e},X=(e,r)=>{var o=e.getBoundingClientRect(),t=q(r)?r.touches[0]:r;return{left:U((t.pageX-(o.left+window.pageXOffset))/o.width),top:U((t.pageY-(o.top+window.pageYOffset))/o.height),width:o.width,height:o.height,x:t.pageX-(o.left+window.pageXOffset),y:t.pageY-(o.top+window.pageYOffset)}},Y=t(85),V=["prefixCls","className","onMove","onDown"],K=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-interactive",className:a,onMove:l,onDown:s}=r,n=z(r,V),i=(0,O.useRef)(null),d=(0,O.useRef)(!1),[c,p]=(0,O.useState)(!1),h=W(l),g=W(s),u=(0,O.useCallback)((e=>{G(e),(q(e)?e.touches.length>0:e.buttons>0)&&i.current?h&&h(X(i.current,e),e):p(!1)}),[h]),b=(0,O.useCallback)((()=>p(!1)),[]),f=(0,O.useCallback)((e=>{var r=e?window.addEventListener:window.removeEventListener;r(d.current?"touchmove":"mousemove",u),r(d.current?"touchend":"mouseup",b)}),[]);(0,O.useEffect)((()=>(f(c),()=>{c&&f(!1)})),[c,f]);var x=(0,O.useCallback)((e=>{G(e.nativeEvent),(e=>!(d.current&&!q(e))&&(d.current=q(e),!0))(e.nativeEvent)&&(g&&g(X(i.current,e.nativeEvent),e.nativeEvent),p(!0))}),[g]);return(0,Y.jsx)("div",e({},n,{className:[t,a||""].filter(Boolean).join(" "),style:e({},n.style,{touchAction:"none"}),ref:i,tabIndex:0,onMouseDown:x,onTouchStart:x}))}));K.displayName="Interactive";const Q=K;var Z=["className","prefixCls","left","top","style","fillProps"],$=r=>{var{className:o,prefixCls:t,left:a,top:l,style:s,fillProps:n}=r,i=z(r,Z),d=e({},s,{position:"absolute",left:a,top:l}),c=e({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},null==n?void 0:n.style,{transform:a?"translate(-9px, -1px)":"translate(-1px, -9px)"});return(0,Y.jsx)("div",e({className:t+"-pointer "+(o||""),style:d},i,{children:(0,Y.jsx)("div",e({className:t+"-fill"},n,{style:c}))}))},J=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],ee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",re=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-alpha",className:a,hsva:l,background:s,bgProps:n={},innerProps:i={},pointerProps:c={},radius:p=0,width:h,height:g=16,direction:u="horizontal",style:b,onChange:f,pointer:x}=r,v=z(r,J),m=r=>{f&&f(e({},l,{a:"horizontal"===u?r.left:r.top}),r)},y=d(Object.assign({},l,{a:1})),C="linear-gradient(to "+("horizontal"===u?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+y+" 100%)",F={};"horizontal"===u?F.left=100*l.a+"%":F.top=100*l.a+"%";var w=e({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:p,background:"url("+ee+") left center",backgroundColor:"var(--alpha-background-color)"},{width:h,height:g},b,{position:"relative"}),k=x&&"function"===typeof x?x(e({prefixCls:t},c,F)):(0,Y.jsx)($,e({},c,{prefixCls:t},F));return(0,Y.jsxs)("div",e({},v,{className:[t,t+"-"+u,a||""].filter(Boolean).join(" "),style:w,ref:o,children:[(0,Y.jsx)("div",e({},n,{style:e({inset:0,position:"absolute",background:s||C,borderRadius:p},n.style)})),(0,Y.jsx)(Q,e({},i,{style:e({},i.style,{inset:0,zIndex:1,position:"absolute"}),onMove:m,onDown:m,children:k}))]}))}));re.displayName="Alpha";const oe=re;var te=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur"],ae=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-editable-input",placement:a="bottom",label:l,value:s,className:n,style:i,labelStyle:d,inputStyle:c,onChange:p,onBlur:h}=r,g=z(r,te),[u,b]=(0,O.useState)(s),f=(0,O.useRef)(!1);(0,O.useEffect)((()=>{r.value!==u&&(f.current||b(r.value))}),[r.value]);var x={};"bottom"===a&&(x.flexDirection="column"),"top"===a&&(x.flexDirection="column-reverse"),"left"===a&&(x.flexDirection="row-reverse");var v=e({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},x,i),m=e({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},c);return(0,Y.jsxs)("div",{className:[t,n||""].filter(Boolean).join(" "),style:v,children:[(0,Y.jsx)("input",e({ref:o,value:u,onChange:function(e,r){var o=(r||e.target.value).trim().replace(/^#/,"");/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(o)&&p&&p(e,o);var t=(e=>Number(String(e).replace(/%/g,"")))(o);isNaN(t)||p&&p(e,t),b(o)},onBlur:function(e){f.current=!1,b(r.value),h&&h(e)},autoComplete:"off",onFocus:()=>f.current=!0},g,{style:m})),l&&(0,Y.jsx)("span",{style:e({color:"var(--editable-input-label-color)",textTransform:"capitalize"},d),children:l})]})}));ae.displayName="EditableInput";const le=ae;var se=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],ne=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-swatch",className:a,color:l,colors:s=[],style:n,rectProps:i={},onChange:d,addonAfter:c,addonBefore:p,rectRender:h}=r,g=z(r,se),u=e({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},i.style),b=(e,r)=>{d&&d(w(e),P(w(e)),r)};return(0,Y.jsxs)("div",e({ref:o},g,{className:[t,a||""].filter(Boolean).join(" "),style:e({display:"flex",flexWrap:"wrap",position:"relative"},n),children:[p&&_().isValidElement(p)&&p,s&&Array.isArray(s)&&s.map(((r,o)=>{var t="",a="";"string"===typeof r&&(t=r,a=r),"object"===typeof r&&r.color&&(t=r.title||r.color,a=r.color);var s=l&&l.toLocaleLowerCase()===a.toLocaleLowerCase(),n=h&&h({title:t,color:a,checked:!!s,style:e({},u,{background:a}),onClick:e=>b(a,e)});if(n)return(0,Y.jsx)(O.Fragment,{children:n},o);var d=i.children&&_().isValidElement(i.children)?_().cloneElement(i.children,{color:a,checked:s}):null;return(0,Y.jsx)("div",e({tabIndex:0,title:t,onClick:e=>b(a,e)},i,{children:d,style:e({},u,{background:a})}),o)})),c&&_().isValidElement(c)&&c]}))}));ne.displayName="Swatch";const ie=ne;var de=["prefixCls","className","style","color","colors","onChange"],ce=["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],pe=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-block",className:a,style:l,color:s,colors:n=ce,onChange:i}=r,d=z(r,de),c="string"===typeof s&&I(s)?w(s):s,p=s?N(c):"",h=(e,r)=>{"string"===typeof e&&I(e)&&/(3|6)/.test(String(e.replace(/^#/,"").length))&&i&&i(P(w(e)))},g=e({"--block-background-color":"rgb(255, 255, 255)","--block-box-shadow":"rgb(0 0 0 / 10%) 0 1px",width:170,borderRadius:6,background:"var(--block-background-color)",boxShadow:"var(--block-box-shadow)",position:"relative"},l);return(0,Y.jsxs)("div",e({ref:o,className:[t,a].filter(Boolean).join(" "),style:g},d,{children:[(0,Y.jsx)("div",{style:{width:0,height:0,borderStyle:"solid",borderWidth:"0 10px 10px",borderColor:"transparent transparent "+p,position:"absolute",top:-10,left:"50%",marginLeft:-10}}),(0,Y.jsx)("div",{title:p,style:{backgroundColor:""+p,color:T(p),height:110,fontSize:18,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center"},children:p.toLocaleUpperCase()}),(0,Y.jsx)(ie,{colors:n,color:p,style:{paddingLeft:10,paddingTop:10},rectProps:{style:{marginRight:10,marginBottom:10,borderRadius:4,height:22,width:22}},onChange:e=>{i&&i(P(e))}}),(0,Y.jsx)(le,{value:p.toLocaleUpperCase(),onChange:(e,r)=>h(r),onBlur:e=>{var r=e.target.value;e.target.value=r.slice(0,6),h(r.slice(0,6))},inputStyle:{height:22,outline:0,borderRadius:3,padding:"0 7px"},style:{padding:10,paddingTop:0,borderRadius:"0 0 6px 6px"}})]}))}));pe.displayName="Block";const he=pe;function ge(e){if(null==e)throw new TypeError("Cannot destructure "+e)}var ue={marginRight:0,marginBottom:0,borderRadius:0,boxSizing:"border-box",height:25,width:25};function be(r){var{style:o,title:t,checked:a,color:l,onClick:s,rectProps:n}=r,i=(0,O.useRef)(null),d=(0,O.useCallback)((()=>{i.current.style.zIndex="2",i.current.style.outline="#fff solid 2px",i.current.style.boxShadow="rgb(0 0 0 / 25%) 0 0 5px 2px"}),[]),c=(0,O.useCallback)((()=>{a||(i.current.style.zIndex="0",i.current.style.outline="initial",i.current.style.boxShadow="initial")}),[a]),p=a?{zIndex:1,outline:"#fff solid 2px",boxShadow:"rgb(0 0 0 / 25%) 0 0 5px 2px"}:{zIndex:0};return(0,Y.jsx)("div",e({ref:i,title:t},n,{onClick:s,onMouseEnter:d,onMouseLeave:c,style:e({},o,{marginRight:0,marginBottom:0,borderRadius:0,boxSizing:"border-box",height:25,width:25},ue,p,null==n?void 0:n.style)}))}var fe=["prefixCls","placement","className","style","color","colors","rectProps","onChange","rectRender"],xe=["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],ve=function(e){return e.Left="L",e.LeftTop="LT",e.LeftBottom="LB",e.Right="R",e.RightTop="RT",e.RightBottom="RB",e.Top="T",e.TopRight="TR",e.TopLeft="TL",e.Bottom="B",e.BottomLeft="BL",e.BottomRight="BR",e}({}),me=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-github",placement:a=ve.TopRight,className:l,style:s,color:n,colors:i=xe,rectProps:d={},onChange:c,rectRender:p}=r,h=z(r,fe),g="string"===typeof n&&I(n)?w(n):n,u=n?N(g):"",b=e({"--github-border":"1px solid rgba(0, 0, 0, 0.2)","--github-background-color":"#fff","--github-box-shadow":"rgb(0 0 0 / 15%) 0px 3px 12px","--github-arrow-border-color":"rgba(0, 0, 0, 0.15)",width:200,borderRadius:4,background:"var(--github-background-color)",boxShadow:"var(--github-box-shadow)",border:"var(--github-border)",position:"relative",padding:5},s),f={borderStyle:"solid",position:"absolute"},x=e({},f),v=e({},f);/^T/.test(a)&&(x.borderWidth="0 8px 8px",x.borderColor="transparent transparent var(--github-arrow-border-color)",v.borderWidth="0 7px 7px",v.borderColor="transparent transparent var(--github-background-color)"),a===ve.TopRight&&(x.top=-8,v.top=-7),a===ve.Top&&(x.top=-8,v.top=-7),a===ve.TopLeft&&(x.top=-8,v.top=-7),/^B/.test(a)&&(x.borderWidth="8px 8px 0",x.borderColor="var(--github-arrow-border-color) transparent transparent",v.borderWidth="7px 7px 0",v.borderColor="var(--github-background-color) transparent transparent",a===ve.BottomRight&&(x.top="100%",v.top="100%"),a===ve.Bottom&&(x.top="100%",v.top="100%"),a===ve.BottomLeft&&(x.top="100%",v.top="100%")),/^(B|T)/.test(a)&&(a!==ve.Top&&a!==ve.Bottom||(x.left="50%",x.marginLeft=-8,v.left="50%",v.marginLeft=-7),a!==ve.TopRight&&a!==ve.BottomRight||(x.right=10,v.right=11),a!==ve.TopLeft&&a!==ve.BottomLeft||(x.left=7,v.left=8)),/^L/.test(a)&&(x.borderWidth="8px 8px 8px 0",x.borderColor="transparent var(--github-arrow-border-color) transparent transparent",v.borderWidth="7px 7px 7px 0",v.borderColor="transparent var(--github-background-color) transparent transparent",x.left=-8,v.left=-7),/^R/.test(a)&&(x.borderWidth="8px 0 8px 8px",x.borderColor="transparent transparent transparent var(--github-arrow-border-color)",v.borderWidth="7px 0 7px 7px",v.borderColor="transparent transparent transparent var(--github-background-color)",x.right=-8,v.right=-7),/^(L|R)/.test(a)&&(a!==ve.RightTop&&a!==ve.LeftTop||(x.top=5,v.top=6),a!==ve.Left&&a!==ve.Right||(x.top="50%",v.top="50%",x.marginTop=-8,v.marginTop=-7),a!==ve.LeftBottom&&a!==ve.RightBottom||(x.top="100%",v.top="100%",x.marginTop=-21,v.marginTop=-20));return(0,Y.jsx)(ie,e({ref:o,className:[t,l].filter(Boolean).join(" "),colors:i,color:u,rectRender:r=>{var o=e({},(ge(r),r)),t=p&&p(e({},o));return t||(0,Y.jsx)(be,e({},o,{rectProps:d}))}},h,{onChange:e=>c&&c(P(e)),style:b,rectProps:{style:{marginRight:0,marginBottom:0,borderRadius:0,height:25,width:25}},addonBefore:(0,Y.jsxs)(O.Fragment,{children:[(0,Y.jsx)("div",{style:x}),(0,Y.jsx)("div",{style:v})]})}))}));me.displayName="Github";const ye=me;var Ce=e=>{var{className:r,color:o,left:t,top:a,prefixCls:l}=e,s={position:"absolute",top:a,left:t},n={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:o};return(0,O.useMemo)((()=>(0,Y.jsx)("div",{className:l+"-pointer "+(r||""),style:s,children:(0,Y.jsx)("div",{className:l+"-fill",style:n})})),[a,t,o,r,l])},Fe=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],we=_().forwardRef(((r,o)=>{var t,{prefixCls:a="w-color-saturation",radius:l=0,pointer:s,className:n,hue:i=0,style:c,hsva:p,onChange:h}=r,g=z(r,Fe),u=e({width:200,height:200,borderRadius:l},c,{position:"relative"}),b=(e,r)=>{h&&p&&h({h:p.h,s:100*e.left,v:100*(1-e.top),a:p.a})},f=(0,O.useMemo)((()=>{if(!p)return null;var r={top:100-p.v+"%",left:p.s+"%",color:d(p)};return s&&"function"===typeof s?s(e({prefixCls:a},r)):(0,Y.jsx)(Ce,e({prefixCls:a},r))}),[p,s,a]);return(0,Y.jsx)(Q,e({className:[a,n||""].filter(Boolean).join(" ")},g,{style:e({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+(null!=(t=null==p?void 0:p.h)?t:i)+", 100%, 50%))"},u),ref:o,onMove:b,onDown:b,children:f}))}));we.displayName="Saturation";const ke=we;var Be=["prefixCls","className","hue","onChange","direction"],Ae=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-hue",className:a,hue:l=0,onChange:s,direction:n="horizontal"}=r,i=z(r,Be);return(0,Y.jsx)(oe,e({ref:o,className:t+" "+(a||"")},i,{direction:n,background:"linear-gradient(to "+("horizontal"===n?"right":"bottom")+", 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%)",hsva:{h:l,s:100,v:100,a:l/360},onChange:(e,r)=>{s&&s({h:"horizontal"===n?360*r.left:360*r.top})}}))}));Ae.displayName="Hue";const je=Ae;var Re=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],Se=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-editable-input-rgba",hsva:a,placement:s="bottom",rProps:n={},gProps:i={},bProps:d={},aProps:c={},className:p,style:h,onChange:g}=r,u=z(r,Re),b=a?B(a):{};function f(e){var r=Number(e.target.value);r&&r>255&&(e.target.value="255"),r&&r<0&&(e.target.value="0")}var x=(r,o,t)=>{"number"===typeof r&&("a"===o&&(r<0&&(r=0),r>100&&(r=100),g&&g(P(l(e({},b,{a:r/100}))))),r>255&&(r=255,t.target.value="255"),r<0&&(r=0,t.target.value="0"),"r"===o&&g&&g(P(l(e({},b,{r:r})))),"g"===o&&g&&g(P(l(e({},b,{g:r})))),"b"===o&&g&&g(P(l(e({},b,{b:r})))))};return(0,Y.jsxs)("div",e({ref:o,className:[t,p||""].filter(Boolean).join(" ")},u,{style:e({fontSize:11,display:"flex"},h),children:[(0,Y.jsx)(le,e({label:"R",value:b.r||0,onBlur:f,placement:s,onChange:(e,r)=>x(r,"r",e)},n,{style:e({},n.style)})),(0,Y.jsx)(le,e({label:"G",value:b.g||0,onBlur:f,placement:s,onChange:(e,r)=>x(r,"g",e)},i,{style:e({marginLeft:5},n.style)})),(0,Y.jsx)(le,e({label:"B",value:b.b||0,onBlur:f,placement:s,onChange:(e,r)=>x(r,"b",e)},d,{style:e({marginLeft:5},d.style)})),c&&(0,Y.jsx)(le,e({label:"A",value:b.a?parseInt(String(100*b.a),10):0,onBlur:f,placement:s,onChange:(e,r)=>x(r,"a",e)},c,{style:e({marginLeft:5},c.style)}))]}))}));Se.displayName="EditableInputRGBA";const Ne=Se;var Ee=["prefixCls","hsva","hProps","sProps","lProps","aProps","className","onChange"],De=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-editable-input-hsla",hsva:a,hProps:l={},sProps:s={},lProps:n={},aProps:i={},className:d,onChange:c}=r,p=z(r,Ee),h=a?u(a):{h:0,s:0,l:0,a:0},b=(r,o,t)=>{"number"===typeof r&&("h"===o&&(r<0&&(r=0),r>360&&(r=360),c&&c(P(g(e({},h,{h:r}))))),"s"===o&&(r<0&&(r=0),r>100&&(r=100),c&&c(P(g(e({},h,{s:r}))))),"l"===o&&(r<0&&(r=0),r>100&&(r=100),c&&c(P(g(e({},h,{l:r}))))),"a"===o&&(r<0&&(r=0),r>1&&(r=1),c&&c(P(g(e({},h,{a:r}))))))};return(0,Y.jsx)(Ne,e({ref:o,hsva:a,rProps:e({label:"H",value:Math.round(h.h)},l,{onChange:(e,r)=>b(r,"h")}),gProps:e({label:"S",value:Math.round(h.s)+"%"},s,{onChange:(e,r)=>b(r,"s")}),bProps:e({label:"L",value:Math.round(h.l)+"%"},n,{onChange:(e,r)=>b(r,"l")}),aProps:e({label:"A",value:Math.round(100*h.a)/100},i,{onChange:(e,r)=>b(r,"a")}),className:[t,d||""].filter(Boolean).join(" ")},p))}));De.displayName="EditableInputHSLA";const Pe=De;var Te=["style"];function Le(r){var{style:o}=r,t=z(r,Te),a=(0,O.useRef)(null),l=(0,O.useCallback)((()=>{a.current.style.backgroundColor="var(--chrome-arrow-background-color)"}),[]),s=(0,O.useCallback)((()=>{a.current.style.backgroundColor="transparent"}),[]);return(0,Y.jsx)("div",e({ref:a,style:e({marginLeft:5,cursor:"pointer",transition:"background-color .3s",borderRadius:2},o)},t,{onMouseEnter:l,onMouseLeave:s,children:(0,Y.jsx)("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",style:{display:"block"},children:(0,Y.jsx)("path",{d:"M373.888 576h276.224c9.322667 0 14.293333 11.178667 9.173333 18.773333l-1.258666 1.557334-138.112 146.858666a10.709333 10.709333 0 0 1-14.293334 1.365334l-1.536-1.365334-138.112-146.858666c-6.592-6.997333-2.666667-18.645333 5.973334-20.16l1.941333-0.170667h276.224-276.224z m146.026667-295.189333l138.112 146.858666c7.04 7.509333 2.069333 20.330667-7.914667 20.330667H373.888c-9.984 0-14.976-12.821333-7.914667-20.330667l138.112-146.858666a10.730667 10.730667 0 0 1 15.829334 0z",fill:"var(--chrome-arrow-fill)"})})}))}var Me=["prefixCls","className","style","color","inputType","rectProps","onChange"],He=function(e){return e.HEXA="hexa",e.RGBA="rgba",e.HSLA="hsla",e}({}),Ie=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-chrome",className:a,style:l,color:s,inputType:n=He.RGBA,rectProps:i={},onChange:d}=r,c=z(r,Me),p="string"===typeof s&&I(s)?w(s):s||{h:0,s:0,l:0,a:0},h=e=>d&&d(P(e)),[g,u]=(0,O.useState)(n),b={paddingTop:6},f={textAlign:"center",paddingTop:4,paddingBottom:4},x=e({"--chrome-arrow-fill":"#333","--chrome-arrow-background-color":"#e8e8e8",borderRadius:0,flexDirection:"column",width:230,padding:0},l),v={"--chrome-alpha-box-shadow":"rgb(0 0 0 / 25%) 0px 0px 1px inset",borderRadius:"50%",background:j(p),boxShadow:"var(--chrome-alpha-box-shadow)"};return(0,Y.jsx)(ye,e({ref:o,color:p,style:x,colors:void 0,className:[t,a].filter(Boolean).join(" "),placement:ve.TopLeft},c,{addonAfter:(0,Y.jsxs)(O.Fragment,{children:[(0,Y.jsx)(ke,{hsva:p,style:{width:"100%",height:130},onChange:r=>{h(e({},p,r,{a:p.a}))}}),(0,Y.jsxs)("div",{style:{padding:15,display:"flex",alignItems:"center"},children:[(0,Y.jsx)(oe,{width:24,height:24,hsva:p,radius:2,style:{marginRight:15,borderRadius:"50%"},bgProps:{style:{background:"transparent"}},innerProps:{style:v},pointer:()=>(0,Y.jsx)(O.Fragment,{})}),(0,Y.jsxs)("div",{style:{flex:1},children:[(0,Y.jsx)(je,{hue:p.h,style:{width:"100%"},bgProps:{style:{borderRadius:2}},onChange:r=>{h(e({},p,r))}}),(0,Y.jsx)(oe,{hsva:p,style:{marginTop:10},bgProps:{style:{borderRadius:2}},onChange:r=>{h(e({},p,r))}})]})]}),(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",padding:"0 15px 15px 15px",userSelect:"none"},children:[(0,Y.jsxs)("div",{style:{flex:1},children:[g==He.RGBA&&(0,Y.jsx)(Ne,{hsva:p,rProps:{labelStyle:b,inputStyle:f},gProps:{labelStyle:b,inputStyle:f},bProps:{labelStyle:b,inputStyle:f},aProps:{labelStyle:b,inputStyle:f},onChange:e=>h(e.hsva)}),g===He.HEXA&&(0,Y.jsx)(le,{label:"HEX",labelStyle:b,inputStyle:f,value:p.a>0&&p.a<1?E(p).toLocaleUpperCase():N(p).toLocaleUpperCase(),onChange:(e,r)=>{"string"===typeof r&&h(w(/^#/.test(r)?r:"#"+r))}}),g===He.HSLA&&(0,Y.jsx)(Pe,{hsva:p,hProps:{labelStyle:b,inputStyle:f},sProps:{labelStyle:b,inputStyle:f},lProps:{labelStyle:b,inputStyle:f},aProps:{labelStyle:b,inputStyle:f},onChange:e=>h(e.hsva)})]}),(0,Y.jsx)(Le,{onClick:()=>{g===He.RGBA&&u(He.HSLA),g===He.HSLA&&u(He.HEXA),g===He.HEXA&&u(He.RGBA)}})]})]}),rectRender:()=>(0,Y.jsx)(O.Fragment,{})}))}));Ie.displayName="Chrome";const ze=Ie;function Oe(r){var{style:o,className:t,title:a,checked:l,color:s,onClick:n,rectProps:i}=r,d=(0,O.useRef)(null),c=(0,O.useCallback)((()=>{d.current.style.transform="scale(1.2)"}),[]),p=(0,O.useCallback)((()=>{d.current.style.transform="scale(1)"}),[]),h=e({"--circle-point-background-color":"#fff",height:l?"100%":0,width:l?"100%":0,borderRadius:"50%",backgroundColor:"var(--circle-point-background-color)",boxSizing:"border-box",transition:"height 100ms ease 0s, width 100ms ease 0s"},i.style);return(0,Y.jsx)("div",{ref:d,onClick:n,onMouseEnter:c,onMouseLeave:p,title:a,className:t,style:e({},o,{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:3,borderRadius:"50%",marginRight:12,marginBottom:12,boxSizing:"border-box",transform:"scale(1)",boxShadow:s+" 0px 0px "+(l?5:0)+"px",transition:"transform 100ms ease 0s, box-shadow 100ms ease 0s"}),children:(0,Y.jsx)("div",e({},i,{style:h}))})}var _e=["prefixCls","className","color","colors","rectProps","onChange"],We=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-circle",className:a,color:l,colors:s=[],rectProps:n={},onChange:i}=r,d=z(r,_e),c="string"===typeof l&&I(l)?w(l):l||{},p=l?N(c):"",h=[t,a].filter(Boolean).join(" ");return(0,Y.jsx)(ie,e({ref:o,colors:s,color:p},d,{className:h,rectRender:r=>{var o=e({},(ge(r),r));return(0,Y.jsx)(Oe,e({},o,{className:t+"-point",rectProps:n}))},onChange:e=>{i&&i(P(e))}}))}));We.displayName="Circle";const qe=We;var Ge=["style","color"],Ue=["prefixCls","className","onChange","color","style","disableAlpha"],Xe=r=>{var{style:o,color:t}=r,a=z(r,Ge),l=e({"--colorful-pointer-background-color":"#fff","--colorful-pointer-border":"2px solid #fff",height:28,width:28,position:"absolute",transform:"translate(-14px, -4px)",boxShadow:"0 2px 4px rgb(0 0 0 / 20%)",borderRadius:"50%",background:"url("+ee+")",backgroundColor:"var(--colorful-pointer-background-color)",border:"var(--colorful-pointer-border)",zIndex:1},o);return(0,Y.jsx)("div",e({},a,{style:l,children:(0,Y.jsx)("div",{style:{backgroundColor:t,borderRadius:"50%",height:" 100%",width:"100%"}})}))},Ye=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-colorful",className:a,onChange:l,color:s,style:n,disableAlpha:i}=r,d=z(r,Ue),c="string"===typeof s&&I(s)?w(s):s||{},p=e=>l&&l(P(e));return(0,Y.jsxs)("div",e({ref:o,style:e({width:200,position:"relative"},n)},d,{className:t+" "+(a||""),children:[(0,Y.jsx)(ke,{hsva:c,className:t,radius:"8px 8px 0 0",style:{width:"auto",height:150,minWidth:120,borderBottom:"12px solid #000"},pointer:e=>{var{left:r,top:o,color:t}=e;return(0,Y.jsx)(Xe,{style:{left:r,top:o,transform:"translate(-16px, -16px)"},color:N(c)})},onChange:r=>p(e({},c,r))}),(0,Y.jsx)(je,{hue:c.h,height:24,radius:i?"0 0 8px 8px":0,className:t,onChange:r=>p(e({},c,r)),pointer:e=>{var{left:r}=e;return(0,Y.jsx)(Xe,{style:{left:r},color:"hsl("+(c.h||0)+"deg 100% 50%)"})}}),!i&&(0,Y.jsx)(oe,{hsva:c,height:24,className:t,radius:"0 0 8px 8px",pointer:e=>{var{left:r}=e;return(0,Y.jsx)(Xe,{style:{left:r},color:j(c)})},onChange:r=>p(e({},c,r))})]}))}));Ye.displayName="Colorful";const Ve=Ye;var Ke=["prefixCls","className","style","onChange","color","colors","rectProps","rectRender"],Qe=["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"];function Ze(e){return e.checked?(0,Y.jsx)("div",{style:{height:5,width:5,borderRadius:"50%",backgroundColor:T(e.color)}}):null}var $e=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-compact",className:a,style:l,onChange:s,color:n,colors:i=Qe,rectProps:d,rectRender:c}=r,p=z(r,Ke),h="string"===typeof n&&I(n)?w(n):n,g=n?N(h).replace(/^#/,""):"",u=(0,O.useCallback)((e=>s&&s(P(e))),[]),b={style:{alignItems:"baseline"},inputStyle:{boxShadow:"none",backgroundColor:"transparent",outline:0}},f=e({"--compact-background-color":"#f6f6f6",background:"var(--compact-background-color)",borderRadius:3,display:"flex",width:240,flexWrap:"wrap",paddingTop:5,paddingLeft:5},l);return(0,Y.jsxs)("div",e({ref:o,style:f,className:[t,a||""].filter(Boolean).join(" ")},p,{children:[(0,Y.jsx)(ie,{colors:i,color:n?N(h):void 0,rectRender:c,rectProps:e({children:(0,Y.jsx)(Ze,{})},d,{style:e({display:"flex",alignItems:"center",justifyContent:"center"},null==d?void 0:d.style)}),onChange:e=>u(e)}),(0,Y.jsxs)("div",{style:{display:"flex",margin:"0 4px 3px 0"},children:[(0,Y.jsx)(le,{onChange:(e,r)=>{var o;"string"===typeof(o=r)&&I(o)&&/(3|6)/.test(String(o.length))&&u(w(o))},labelStyle:{paddingRight:5,marginTop:-1},value:g.toLocaleUpperCase(),label:(0,Y.jsx)("div",{style:{width:8,height:8,backgroundColor:"#"+g}}),inputStyle:{outline:"none",boxShadow:"initial",background:"transparent"},style:{flexDirection:"row-reverse",flex:"1 1 0%",minWidth:80}}),(0,Y.jsx)(Ne,{hsva:h,placement:"left",onChange:e=>u(e.hsva),aProps:!1,rProps:b,gProps:b,bProps:b})]})]}))}));$e.displayName="Compact";const Je=$e;var er=["prefixCls","className","style","color","onChange"],rr={boxShadow:"initial",borderWidth:"0 0 1px 0",borderBottomColor:"var(--material-border-bottom-color)",borderBottomStyle:"solid",height:30,outline:0,fontSize:15,padding:0},or=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-material",className:a,style:l,color:s,onChange:n}=r,i=z(r,er),d="string"===typeof s&&I(s)?w(s):s,c=s?N(d).replace(/^#/,""):"",p=(e,r)=>{"string"===typeof e&&I(e)&&/(3|6)/.test(String(e.length))&&n&&n(P(w(e)))},h=e({"--material-border-bottom-color":"#eee","--material-background-color":"#fff",padding:16,width:98,fontFamily:"Roboto",backgroundColor:"var(--material-background-color)"},l);return(0,Y.jsxs)("div",e({ref:o,className:[t,a||""].filter(Boolean).join(" "),style:h},i,{children:[(0,Y.jsx)(le,{label:"Hex",value:c.toLocaleUpperCase(),onChange:(e,r)=>p(r),onBlur:e=>{var r=e.target.value;e.target.value=r.slice(0,6),p(r.slice(0,6))},inputStyle:{outline:0,border:0,height:30,fontSize:15,padding:0,boxShadow:"initial",borderWidth:"0 0 2px 0",borderBottomColor:c?"#"+c:"var(--material-border-bottom-color)",borderBottomStyle:"solid",background:"transparent"},style:{flexDirection:"column-reverse",alignItems:"flex-start"}}),(0,Y.jsx)(Ne,{hsva:d,placement:"top",style:{marginTop:11},rProps:{style:{alignItems:"flex-start"},inputStyle:e({},rr)},gProps:{style:{alignItems:"flex-start"},inputStyle:e({},rr)},bProps:{style:{alignItems:"flex-start"},inputStyle:e({},rr)},aProps:!1,onChange:e=>{return r=e.hsva,void(n&&n(P(r)));var r}})]}))}));or.displayName="Material";const tr=or,ar=["#F0F8FF","#FAEBD7","#00FFFF","#7FFFD4","#F0FFFF","#F5F5DC","#FFE4C4","#000000","#FFEBCD","#0000FF","#8A2BE2","#A52A2A","#DEB887","#5F9EA0","#7FFF00","#D2691E","#FF7F50","#6495ED","#FFF8DC","#DC143C","#00FFFF","#00008B","#008B8B","#B8860B","#A9A9A9","#006400","#A9A9A9","#BDB76B","#8B008B","#556B2F","#FF8C00","#9932CC","#8B0000","#E9967A","#8FBC8F","#483D8B","#2F4F4F","#2F4F4F","#00CED1","#9400D3","#FF1493","#00BFFF","#696969","#696969","#1E90FF","#B22222","#FFFAF0","#228B22","#FF00FF","#DCDCDC","#F8F8FF","#FFD700","#DAA520","#808080","#008000","#ADFF2F","#808080","#F0FFF0","#FF69B4","#CD5C5C","#4B0082","#FFFFF0","#F0E68C","#E6E6FA","#FFF0F5","#7CFC00","#FFFACD","#ADD8E6","#F08080","#E0FFFF","#FAFAD2","#D3D3D3","#90EE90","#D3D3D3","#FFB6C1","#FFA07A","#20B2AA","#87CEFA","#778899","#778899","#B0C4DE","#FFFFE0","#00FF00","#32CD32","#FAF0E6","#FF00FF","#800000","#66CDAA","#0000CD","#BA55D3","#9370DB","#3CB371","#7B68EE","#00FA9A","#48D1CC","#C71585","#191970","#F5FFFA","#FFE4E1","#FFE4B5","#FFDEAD","#000080","#FDF5E6","#808000","#6B8E23","#FFA500","#FF4500","#DA70D6","#EEE8AA","#98FB98","#AFEEEE","#DB7093","#FFEFD5","#FFDAB9","#CD853F","#FFC0CB","#DDA0DD","#B0E0E6","#800080","#663399","#FF0000","#BC8F8F","#4169E1","#8B4513","#FA8072","#F4A460","#2E8B57","#FFF5EE","#A0522D","#C0C0C0","#87CEEB","#6A5ACD","#708090","#708090","#FFFAFA","#00FF7F","#4682B4","#D2B48C","#008080","#D8BFD8","#FF6347","#40E0D0","#EE82EE","#F5DEB3","#FFFFFF","#F5F5F5","#FFFF00","#9ACD32"];var lr=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].reduce(((e,r,o)=>(e[r]=ar[o],e)),{}),sr=["aqua","black","blue","fuchsia","gray","green","lime","maroon","navy","olive","purple","red","silver","teal","white","yellow"],nr=sr.reduce(((e,r)=>(e[r]=lr[r],e)),{});function ir(e){return lr[e]}var dr=["prefixCls","className","onChange","direction","hsva"],cr=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-saturation",className:a,onChange:l,direction:s="horizontal",hsva:n}=r,i=z(r,dr),c=d(e({},n,{a:1,v:100}));return(0,Y.jsx)(oe,e({ref:o},i,{className:t+" "+(a||""),hsva:{h:n.h,s:n.s,v:n.v,a:1-n.v/100},direction:s,background:"linear-gradient(to "+("horizontal"===s?"right":"bottom")+", "+c+", rgb(0, 0, 0))",onChange:(e,r)=>{l&&l({v:"horizontal"===s?100-100*r.left:100-100*r.top})}}))}));cr.displayName="ShadeSlider";const pr=cr;var hr=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],gr=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],ur=e=>(0,Y.jsx)("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),br=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-sketch",className:a,onChange:l,width:s=218,presetColors:n=gr,color:i,editableDisable:d=!0,disableAlpha:c=!1,style:p}=r,h=z(r,hr),[g,u]=(0,O.useState)({h:209,s:36,v:90,a:1});(0,O.useEffect)((()=>{"string"===typeof i&&I(i)&&u(w(i)),"object"===typeof i&&u(i)}),[i]);var b=e=>{u(e),l&&l(P(e))},f=e({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:s},p),x={borderRadius:2,background:j(g),boxShadow:"var(--sketch-alpha-box-shadow)"};return(0,Y.jsxs)("div",e({},h,{className:t+" "+(a||""),ref:o,style:f,children:[(0,Y.jsxs)("div",{style:{padding:"10px 10px 8px"},children:[(0,Y.jsx)(ke,{hsva:g,style:{width:"auto",height:150},onChange:r=>b(e({},g,r,{a:g.a}))}),(0,Y.jsxs)("div",{style:{display:"flex",marginTop:4},children:[(0,Y.jsxs)("div",{style:{flex:1},children:[(0,Y.jsx)(je,{width:"auto",height:10,hue:g.h,pointer:ur,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:r=>b(e({},g,r))}),!c&&(0,Y.jsx)(oe,{width:"auto",height:10,hsva:g,pointer:ur,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:r=>b(e({},g,{a:r.a}))})]}),!c&&(0,Y.jsx)(oe,{width:24,height:24,hsva:g,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:x},pointer:()=>(0,Y.jsx)(O.Fragment,{})})]})]}),d&&(0,Y.jsxs)("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[(0,Y.jsx)(le,{label:"Hex",value:N(g).replace(/^#/,"").toLocaleUpperCase(),onChange:(e,r)=>{var o;"string"===typeof(o=r)&&I(o)&&/(3|6)/.test(String(o.length))&&b(w(o))},style:{minWidth:58}}),(0,Y.jsx)(Ne,{hsva:g,style:{marginLeft:6},aProps:!c&&{},onChange:e=>b(e.hsva)})]}),n&&n.length>0&&(0,Y.jsx)(ie,{style:{borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},colors:n,color:N(g),onChange:e=>b(e),rectProps:{style:{marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"}}})]}))}));br.displayName="Sketch";const fr=br;var xr=["prefixCls","className","style","onChange","color","lightness"],vr=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-slider",className:a,style:l,onChange:n,color:i,lightness:d=[80,65,50,35,20]}=r,c=z(r,xr),p="string"===typeof i&&I(i)?w(i):i||{};return(0,Y.jsx)("div",e({ref:o,style:e({display:"flex"},l),className:[t,a||""].filter(Boolean).join(" ")},c,{children:d.map(((r,o)=>{var t="hsl("+u(p).h+", 50%, "+r+"%)",a=t===s(p);return(0,Y.jsx)("div",{style:{paddingLeft:1,width:100/d.length+"%",boxSizing:"border-box"},children:(0,Y.jsx)("div",{onClick:e=>((e,r)=>{n&&n(P(h(e)),r)})(t,e),style:e({backgroundColor:t,height:12,cursor:"pointer"},a?{borderRadius:2,transform:"scale(1, 1.5)"}:{})})},o)}))}))}));vr.displayName="Slider";const mr=vr;var yr=r=>{var{className:o,color:t,left:a,top:l,style:s,prefixCls:n}=r,i=e({},s,{position:"absolute",top:l,left:a}),d=n+"-pointer "+(o||"");return(0,Y.jsx)("div",{className:d,style:i,children:(0,Y.jsx)("div",{className:n+"-fill",style:{width:10,height:10,transform:"translate(-5px, -5px)",boxShadow:"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",borderRadius:"50%",backgroundColor:"#fff"},children:(0,Y.jsx)("div",{style:{inset:0,borderRadius:"50%",position:"absolute",backgroundColor:t}})})})},Cr=2*Math.PI,Fr=(e,r)=>(e%r+r)%r,wr=(e,r)=>Math.sqrt(e*e+r*r);function kr(e){var{width:r=0}=e,o=r/2;return{width:r,radius:o,cx:o,cy:o}}function Br(e){var{width:r=0}=e;return r/2}function Ar(e,r,o){var t=e.angle||0,a=e.direction;return o&&"clockwise"===a?r=t+r:"clockwise"===a?r=360-t+r:o&&"anticlockwise"===a?r=t+180-r:"anticlockwise"===a&&(r=t-r),Fr(r,360)}var jr=["prefixCls","radius","pointer","className","style","width","height","oval","direction","angle","color","onChange"],Rr=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-wheel",radius:a=0,pointer:l,className:s,style:n,width:i=200,height:d=200,oval:c,direction:p="anticlockwise",angle:h=180,color:g,onChange:u}=r,b=z(r,jr),f="string"===typeof g&&I(g)?w(g):g||{},x=g?N(f):"",v=function(e,r){var{cx:o,cy:t}=kr(e),a=Br(e),l=(180+Ar(e,r.h,!0))*(Cr/360),s=r.s/100*a,n="clockwise"===e.direction?-1:1;return{x:o+s*Math.cos(l)*n,y:t+s*Math.sin(l)*n}}({width:i},f),m={top:"0",left:"0",color:x},y=(e,r)=>{var o=function(e,r,o){var{cx:t,cy:a}=kr(e),l=Br(e);r=t-r,o=a-o;var s=Ar(e,Math.atan2(-o,-r)*(360/Cr)),n=Math.min(wr(r,o),l);return{h:Math.round(s),s:Math.round(100/l*n)}}({width:i},i-e.x,d-e.y),t={h:o.h,s:o.s,v:f.v,a:f.a};u&&u(P(t))},C={zIndex:1,transform:"translate("+v.x+"px, "+v.y+"px) "+("x"===c||"X"===c?"scaleY(2)":"y"===c||"Y"===c?"scaleX(2)":"")},F=l&&"function"===typeof l?l(e({prefixCls:t,style:C},m)):(0,Y.jsx)(yr,e({prefixCls:t,style:C},m));return(0,Y.jsxs)(Q,e({className:[t,s||""].filter(Boolean).join(" ")},b,{style:e({position:"relative",width:i,transform:"x"===c||"X"===c?"scaleY(0.5)":"y"===c||"Y"===c?"scaleX(0.5)":"",height:d},n),ref:o,onMove:y,onDown:y,children:[F,(0,Y.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:"anticlockwise"===p?"conic-gradient(red, yellow, lime, aqua, blue, magenta, red)":"conic-gradient(red, magenta, blue, aqua, lime, yellow, red)",transform:"rotateZ("+(h+90)+"deg)",inset:0}}),(0,Y.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:"radial-gradient(circle closest-side, #fff, transparent)",inset:0}}),(0,Y.jsx)("div",{style:{backgroundColor:"#000",borderRadius:"50%",position:"absolute",inset:0,opacity:"number"===typeof f.v?1-f.v/100:0}})]}))}));Rr.displayName="Wheel";const Sr=Rr})(),a})()));
!function(e,r){"object"===typeof exports&&"object"===typeof module?module.exports=r(require("react")):"function"===typeof define&&define.amd?define(["react"],r):"object"===typeof exports?exports["@uiw/react-color"]=r(require("react")):e["@uiw/react-color"]=r(e.React)}(self,(e=>(()=>{"use strict";var r={335:(e,r,o)=>{var t=o(442),a=Symbol.for("react.element"),l=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function d(e,r,o){var t,l={},d=null,c=null;for(t in void 0!==o&&(d=""+o),void 0!==r.key&&(d=""+r.key),void 0!==r.ref&&(c=r.ref),r)s.call(r,t)&&!i.hasOwnProperty(t)&&(l[t]=r[t]);if(e&&e.defaultProps)for(t in r=e.defaultProps)void 0===l[t]&&(l[t]=r[t]);return{$$typeof:a,type:e,key:d,ref:c,props:l,_owner:n.current}}r.jsx=d,r.jsxs=d},85:(e,r,o)=>{e.exports=o(335)},442:r=>{r.exports=e}},o={};function t(e){var a=o[e];if(void 0!==a)return a.exports;var l=o[e]={exports:{}};return r[e](l,l.exports,t),l.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{function e(){return e=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])}return e},e.apply(this,arguments)}t.r(a),t.d(a,{Alpha:()=>oe,BACKGROUND_IMG:()=>ee,Block:()=>he,Chrome:()=>ze,Circle:()=>qe,Colorful:()=>Ve,Compact:()=>Je,EditableInput:()=>le,EditableInputHSLA:()=>Pe,EditableInputRGBA:()=>Ne,Github:()=>ye,Hue:()=>je,Material:()=>tr,Pointer:()=>$,Saturation:()=>ke,ShadeSlider:()=>pr,Sketch:()=>fr,Slider:()=>mr,Swatch:()=>ie,Wheel:()=>Sr,baseNamed:()=>sr,color:()=>P,colorKeywords:()=>lr,colorKeywordsBase:()=>nr,colorNameToHex:()=>ir,equalColorObjects:()=>L,equalColorString:()=>M,equalHex:()=>H,getContrastingColor:()=>T,hexToHsva:()=>w,hexToRgba:()=>k,hslStringToHsla:()=>c,hslStringToHsva:()=>h,hslaStringToHsva:()=>p,hslaToHsl:()=>S,hslaToHsva:()=>g,hsvStringToHsva:()=>v,hsvaStringToHsva:()=>b,hsvaToHex:()=>N,hsvaToHexa:()=>E,hsvaToHslString:()=>s,hsvaToHsla:()=>u,hsvaToHslaString:()=>d,hsvaToHsv:()=>D,hsvaToHsvString:()=>n,hsvaToHsvaString:()=>i,hsvaToRgbString:()=>A,hsvaToRgba:()=>B,hsvaToRgbaString:()=>j,parseHue:()=>x,rgbStringToHsva:()=>y,rgbaStringToHsva:()=>m,rgbaToHex:()=>C,rgbaToHexa:()=>F,rgbaToHsva:()=>l,rgbaToRgb:()=>R,validHex:()=>I});var r=255,o=100,l=e=>{var{r:t,g:a,b:l,a:s}=e,n=Math.max(t,a,l),i=n-Math.min(t,a,l),d=i?n===t?(a-l)/i:n===a?2+(l-t)/i:4+(t-a)/i:0;return{h:60*(d<0?d+6:d),s:n?i/n*o:0,v:n/r*o,a:s}},s=e=>{var{h:r,s:o,l:t}=u(e);return"hsl("+r+", "+Math.round(o)+"%, "+Math.round(t)+"%)"},n=e=>{var{h:r,s:o,v:t}=e;return"hsv("+r+", "+o+"%, "+t+"%)"},i=e=>{var{h:r,s:o,v:t,a:a}=e;return"hsva("+r+", "+o+"%, "+t+"%, "+a+")"},d=e=>{var{h:r,s:o,l:t,a:a}=u(e);return"hsla("+r+", "+o+"%, "+t+"%, "+a+")"},c=e=>{var[r,o,t,a]=(e.match(/\d+/g)||[]).map(Number);return{h:r,s:o,l:t,a:a}},p=e=>{var r=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?g({h:x(r[1],r[2]),s:Number(r[3]),l:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?100:1)}):{h:0,s:0,v:0,a:1}},h=p,g=e=>{var{h:r,s:t,l:a,a:l}=e;return{h:r,s:(t*=(a<50?a:o-a)/o)>0?2*t/(a+t)*o:0,v:a+t,a:l}},u=e=>{var{h:r,s:t,v:a,a:l}=e,s=(200-t)*a/o;return{h:r,s:s>0&&s<200?t*a/o/(s<=o?s:200-s)*o:0,l:s/2,a:l}},b=e=>{var r=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return r?{h:x(r[1],r[2]),s:Number(r[3]),v:Number(r[4]),a:void 0===r[5]?1:Number(r[5])/(r[6]?o:1)}:{h:0,s:0,v:0,a:1}},f={grad:.9,turn:360,rad:360/(2*Math.PI)},x=function(e,r){return void 0===r&&(r="deg"),Number(e)*(f[r]||1)},v=b,m=e=>{var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?l({r:Number(t[1])/(t[2]?o/r:1),g:Number(t[3])/(t[4]?o/r:1),b:Number(t[5])/(t[6]?o/r:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?o:1)}):{h:0,s:0,v:0,a:1}},y=m,C=e=>{var r,{r:o,g:t,b:a}=e;return"#"+(r=(o<<16|t<<8|a).toString(16),new Array(7-r.length).join("0")+r)},F=e=>{var{r:r,g:o,b:t,a:a}=e,l="number"===typeof a&&(255*a|256).toString(16).slice(1);return""+C({r:r,g:o,b:t,a:a})+(l||"")},w=e=>l(k(e)),k=e=>{var o=e.replace("#","");/^#?/.test(e)&&3===o.length&&(e="#"+o.charAt(0)+o.charAt(0)+o.charAt(1)+o.charAt(1)+o.charAt(2)+o.charAt(2));var t=new RegExp("[A-Za-z0-9]{2}","g"),[a,l,s=0,n]=e.match(t).map((e=>parseInt(e,16)));return{r:a,g:l,b:s,a:(null!=n?n:255)/r}},B=t=>{var{h:a,s:l,v:s,a:n}=t,i=a/60,d=l/o,c=s/o,p=Math.floor(i)%6,h=i-Math.floor(i),g=r*c*(1-d),u=r*c*(1-d*h),b=r*c*(1-d*(1-h));c*=r;var f={};switch(p){case 0:f.r=c,f.g=b,f.b=g;break;case 1:f.r=u,f.g=c,f.b=g;break;case 2:f.r=g,f.g=c,f.b=b;break;case 3:f.r=g,f.g=u,f.b=c;break;case 4:f.r=b,f.g=g,f.b=c;break;case 5:f.r=c,f.g=g,f.b=u}return f.r=Math.round(f.r),f.g=Math.round(f.g),f.b=Math.round(f.b),e({},f,{a:n})},A=e=>{var{r:r,g:o,b:t}=B(e);return"rgb("+r+", "+o+", "+t+")"},j=e=>{var{r:r,g:o,b:t,a:a}=B(e);return"rgba("+r+", "+o+", "+t+", "+a+")"},R=e=>{var{r:r,g:o,b:t}=e;return{r:r,g:o,b:t}},S=e=>{var{h:r,s:o,l:t}=e;return{h:r,s:o,l:t}},N=e=>C(B(e)),E=e=>F(B(e)),D=e=>{var{h:r,s:o,v:t}=e;return{h:r,s:o,v:t}},P=e=>{var r,o,t,a,l,s,n,i;return"string"===typeof e&&I(e)?(s=w(e),n=e):"string"!==typeof e&&(s=e),s&&(t=D(s),l=u(s),a=B(s),i=F(a),n=N(s),o=S(l),r=R(a)),{rgb:r,hsl:o,hsv:t,rgba:a,hsla:l,hsva:s,hex:n,hexa:i}},T=e=>{if(!e)return"#ffffff";var r=P(e);return(299*r.rgb.r+587*r.rgb.g+114*r.rgb.b)/1e3>=128?"#000000":"#ffffff"},L=(e,r)=>{if(e===r)return!0;for(var o in e)if(e[o]!==r[o])return!1;return!0},M=(e,r)=>e.replace(/\s/g,"")===r.replace(/\s/g,""),H=(e,r)=>e.toLowerCase()===r.toLowerCase()||L(k(e),k(r)),I=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);function z(e,r){if(null==e)return{};var o,t,a={},l=Object.keys(e);for(t=0;t<l.length;t++)o=l[t],r.indexOf(o)>=0||(a[o]=e[o]);return a}var O=t(442),_=t.n(O);function W(e){var r=(0,O.useRef)(e);return(0,O.useEffect)((()=>{r.current=e})),(0,O.useCallback)(((e,o)=>r.current&&r.current(e,o)),[])}var q=e=>"touches"in e,G=e=>{!q(e)&&e.preventDefault&&e.preventDefault()},U=function(e,r,o){return void 0===r&&(r=0),void 0===o&&(o=1),e>o?o:e<r?r:e},X=(e,r)=>{var o=e.getBoundingClientRect(),t=q(r)?r.touches[0]:r;return{left:U((t.pageX-(o.left+window.pageXOffset))/o.width),top:U((t.pageY-(o.top+window.pageYOffset))/o.height),width:o.width,height:o.height,x:t.pageX-(o.left+window.pageXOffset),y:t.pageY-(o.top+window.pageYOffset)}},Y=t(85),V=["prefixCls","className","onMove","onDown"],K=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-interactive",className:a,onMove:l,onDown:s}=r,n=z(r,V),i=(0,O.useRef)(null),d=(0,O.useRef)(!1),[c,p]=(0,O.useState)(!1),h=W(l),g=W(s),u=(0,O.useCallback)((e=>{G(e),(q(e)?e.touches.length>0:e.buttons>0)&&i.current?h&&h(X(i.current,e),e):p(!1)}),[h]),b=(0,O.useCallback)((()=>p(!1)),[]),f=(0,O.useCallback)((e=>{var r=e?window.addEventListener:window.removeEventListener;r(d.current?"touchmove":"mousemove",u),r(d.current?"touchend":"mouseup",b)}),[]);(0,O.useEffect)((()=>(f(c),()=>{c&&f(!1)})),[c,f]);var x=(0,O.useCallback)((e=>{G(e.nativeEvent),(e=>!(d.current&&!q(e))&&(d.current=q(e),!0))(e.nativeEvent)&&(g&&g(X(i.current,e.nativeEvent),e.nativeEvent),p(!0))}),[g]);return(0,Y.jsx)("div",e({},n,{className:[t,a||""].filter(Boolean).join(" "),style:e({},n.style,{touchAction:"none"}),ref:i,tabIndex:0,onMouseDown:x,onTouchStart:x}))}));K.displayName="Interactive";const Q=K;var Z=["className","prefixCls","left","top","style","fillProps"],$=r=>{var{className:o,prefixCls:t,left:a,top:l,style:s,fillProps:n}=r,i=z(r,Z),d=e({},s,{position:"absolute",left:a,top:l}),c=e({width:18,height:18,boxShadow:"var(--alpha-pointer-box-shadow)",borderRadius:"50%",backgroundColor:"var(--alpha-pointer-background-color)"},null==n?void 0:n.style,{transform:a?"translate(-9px, -1px)":"translate(-1px, -9px)"});return(0,Y.jsx)("div",e({className:t+"-pointer "+(o||""),style:d},i,{children:(0,Y.jsx)("div",e({className:t+"-fill"},n,{style:c}))}))},J=["prefixCls","className","hsva","background","bgProps","innerProps","pointerProps","radius","width","height","direction","style","onChange","pointer"],ee="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==",re=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-alpha",className:a,hsva:l,background:s,bgProps:n={},innerProps:i={},pointerProps:c={},radius:p=0,width:h,height:g=16,direction:u="horizontal",style:b,onChange:f,pointer:x}=r,v=z(r,J),m=r=>{f&&f(e({},l,{a:"horizontal"===u?r.left:r.top}),r)},y=d(Object.assign({},l,{a:1})),C="linear-gradient(to "+("horizontal"===u?"right":"bottom")+", rgba(244, 67, 54, 0) 0%, "+y+" 100%)",F={};"horizontal"===u?F.left=100*l.a+"%":F.top=100*l.a+"%";var w=e({"--alpha-background-color":"#fff","--alpha-pointer-background-color":"rgb(248, 248, 248)","--alpha-pointer-box-shadow":"rgb(0 0 0 / 37%) 0px 1px 4px 0px",borderRadius:p,background:"url("+ee+") left center",backgroundColor:"var(--alpha-background-color)"},{width:h,height:g},b,{position:"relative"}),k=x&&"function"===typeof x?x(e({prefixCls:t},c,F)):(0,Y.jsx)($,e({},c,{prefixCls:t},F));return(0,Y.jsxs)("div",e({},v,{className:[t,t+"-"+u,a||""].filter(Boolean).join(" "),style:w,ref:o,children:[(0,Y.jsx)("div",e({},n,{style:e({inset:0,position:"absolute",background:s||C,borderRadius:p},n.style)})),(0,Y.jsx)(Q,e({},i,{style:e({},i.style,{inset:0,zIndex:1,position:"absolute"}),onMove:m,onDown:m,children:k}))]}))}));re.displayName="Alpha";const oe=re;var te=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur"],ae=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-editable-input",placement:a="bottom",label:l,value:s,className:n,style:i,labelStyle:d,inputStyle:c,onChange:p,onBlur:h}=r,g=z(r,te),[u,b]=(0,O.useState)(s),f=(0,O.useRef)(!1);(0,O.useEffect)((()=>{r.value!==u&&(f.current||b(r.value))}),[r.value]);var x={};"bottom"===a&&(x.flexDirection="column"),"top"===a&&(x.flexDirection="column-reverse"),"left"===a&&(x.flexDirection="row-reverse");var v=e({"--editable-input-label-color":"rgb(153, 153, 153)","--editable-input-box-shadow":"rgb(204 204 204) 0px 0px 0px 1px inset","--editable-input-color":"#666",position:"relative",alignItems:"center",display:"flex",fontSize:11},x,i),m=e({width:"100%",paddingTop:2,paddingBottom:2,paddingLeft:3,paddingRight:3,fontSize:11,background:"transparent",boxSizing:"border-box",border:"none",color:"var(--editable-input-color)",boxShadow:"var(--editable-input-box-shadow)"},c);return(0,Y.jsxs)("div",{className:[t,n||""].filter(Boolean).join(" "),style:v,children:[(0,Y.jsx)("input",e({ref:o,value:u,onChange:function(e,r){var o=(r||e.target.value).trim().replace(/^#/,"");/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(o)&&p&&p(e,o);var t=(e=>Number(String(e).replace(/%/g,"")))(o);isNaN(t)||p&&p(e,t),b(o)},onBlur:function(e){f.current=!1,b(r.value),h&&h(e)},autoComplete:"off",onFocus:()=>f.current=!0},g,{style:m})),l&&(0,Y.jsx)("span",{style:e({color:"var(--editable-input-label-color)",textTransform:"capitalize"},d),children:l})]})}));ae.displayName="EditableInput";const le=ae;var se=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],ne=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-swatch",className:a,color:l,colors:s=[],style:n,rectProps:i={},onChange:d,addonAfter:c,addonBefore:p,rectRender:h}=r,g=z(r,se),u=e({"--swatch-background-color":"rgb(144, 19, 254)",background:"var(--swatch-background-color)",height:15,width:15,marginRight:5,marginBottom:5,cursor:"pointer",position:"relative",outline:"none",borderRadius:2},i.style),b=(e,r)=>{d&&d(w(e),P(w(e)),r)};return(0,Y.jsxs)("div",e({ref:o},g,{className:[t,a||""].filter(Boolean).join(" "),style:e({display:"flex",flexWrap:"wrap",position:"relative"},n),children:[p&&_().isValidElement(p)&&p,s&&Array.isArray(s)&&s.map(((r,o)=>{var t="",a="";"string"===typeof r&&(t=r,a=r),"object"===typeof r&&r.color&&(t=r.title||r.color,a=r.color);var s=l&&l.toLocaleLowerCase()===a.toLocaleLowerCase(),n=h&&h({title:t,color:a,checked:!!s,style:e({},u,{background:a}),onClick:e=>b(a,e)});if(n)return(0,Y.jsx)(O.Fragment,{children:n},o);var d=i.children&&_().isValidElement(i.children)?_().cloneElement(i.children,{color:a,checked:s}):null;return(0,Y.jsx)("div",e({tabIndex:0,title:t,onClick:e=>b(a,e)},i,{children:d,style:e({},u,{background:a})}),o)})),c&&_().isValidElement(c)&&c]}))}));ne.displayName="Swatch";const ie=ne;var de=["prefixCls","className","style","color","colors","onChange"],ce=["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],pe=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-block",className:a,style:l,color:s,colors:n=ce,onChange:i}=r,d=z(r,de),c="string"===typeof s&&I(s)?w(s):s,p=s?N(c):"",h=(e,r)=>{"string"===typeof e&&I(e)&&/(3|6)/.test(String(e.replace(/^#/,"").length))&&i&&i(P(w(e)))},g=e({"--block-background-color":"rgb(255, 255, 255)","--block-box-shadow":"rgb(0 0 0 / 10%) 0 1px",width:170,borderRadius:6,background:"var(--block-background-color)",boxShadow:"var(--block-box-shadow)",position:"relative"},l);return(0,Y.jsxs)("div",e({ref:o,className:[t,a].filter(Boolean).join(" "),style:g},d,{children:[(0,Y.jsx)("div",{style:{width:0,height:0,borderStyle:"solid",borderWidth:"0 10px 10px",borderColor:"transparent transparent "+p,position:"absolute",top:-10,left:"50%",marginLeft:-10}}),(0,Y.jsx)("div",{title:p,style:{backgroundColor:""+p,color:T(p),height:110,fontSize:18,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center"},children:p.toLocaleUpperCase()}),(0,Y.jsx)(ie,{colors:n,color:p,style:{paddingLeft:10,paddingTop:10},rectProps:{style:{marginRight:10,marginBottom:10,borderRadius:4,height:22,width:22}},onChange:e=>{i&&i(P(e))}}),(0,Y.jsx)(le,{value:p.toLocaleUpperCase(),onChange:(e,r)=>h(r),onBlur:e=>{var r=e.target.value;e.target.value=r.slice(0,6),h(r.slice(0,6))},inputStyle:{height:22,outline:0,borderRadius:3,padding:"0 7px"},style:{padding:10,paddingTop:0,borderRadius:"0 0 6px 6px"}})]}))}));pe.displayName="Block";const he=pe;function ge(e){if(null==e)throw new TypeError("Cannot destructure "+e)}var ue={marginRight:0,marginBottom:0,borderRadius:0,boxSizing:"border-box",height:25,width:25};function be(r){var{style:o,title:t,checked:a,color:l,onClick:s,rectProps:n}=r,i=(0,O.useRef)(null),d=(0,O.useCallback)((()=>{i.current.style.zIndex="2",i.current.style.outline="#fff solid 2px",i.current.style.boxShadow="rgb(0 0 0 / 25%) 0 0 5px 2px"}),[]),c=(0,O.useCallback)((()=>{a||(i.current.style.zIndex="0",i.current.style.outline="initial",i.current.style.boxShadow="initial")}),[a]),p=a?{zIndex:1,outline:"#fff solid 2px",boxShadow:"rgb(0 0 0 / 25%) 0 0 5px 2px"}:{zIndex:0};return(0,Y.jsx)("div",e({ref:i,title:t},n,{onClick:s,onMouseEnter:d,onMouseLeave:c,style:e({},o,{marginRight:0,marginBottom:0,borderRadius:0,boxSizing:"border-box",height:25,width:25},ue,p,null==n?void 0:n.style)}))}var fe=["prefixCls","placement","className","style","color","colors","rectProps","onChange","rectRender"],xe=["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],ve=function(e){return e.Left="L",e.LeftTop="LT",e.LeftBottom="LB",e.Right="R",e.RightTop="RT",e.RightBottom="RB",e.Top="T",e.TopRight="TR",e.TopLeft="TL",e.Bottom="B",e.BottomLeft="BL",e.BottomRight="BR",e}({}),me=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-github",placement:a=ve.TopRight,className:l,style:s,color:n,colors:i=xe,rectProps:d={},onChange:c,rectRender:p}=r,h=z(r,fe),g="string"===typeof n&&I(n)?w(n):n,u=n?N(g):"",b=e({"--github-border":"1px solid rgba(0, 0, 0, 0.2)","--github-background-color":"#fff","--github-box-shadow":"rgb(0 0 0 / 15%) 0px 3px 12px","--github-arrow-border-color":"rgba(0, 0, 0, 0.15)",width:200,borderRadius:4,background:"var(--github-background-color)",boxShadow:"var(--github-box-shadow)",border:"var(--github-border)",position:"relative",padding:5},s),f={borderStyle:"solid",position:"absolute"},x=e({},f),v=e({},f);/^T/.test(a)&&(x.borderWidth="0 8px 8px",x.borderColor="transparent transparent var(--github-arrow-border-color)",v.borderWidth="0 7px 7px",v.borderColor="transparent transparent var(--github-background-color)"),a===ve.TopRight&&(x.top=-8,v.top=-7),a===ve.Top&&(x.top=-8,v.top=-7),a===ve.TopLeft&&(x.top=-8,v.top=-7),/^B/.test(a)&&(x.borderWidth="8px 8px 0",x.borderColor="var(--github-arrow-border-color) transparent transparent",v.borderWidth="7px 7px 0",v.borderColor="var(--github-background-color) transparent transparent",a===ve.BottomRight&&(x.top="100%",v.top="100%"),a===ve.Bottom&&(x.top="100%",v.top="100%"),a===ve.BottomLeft&&(x.top="100%",v.top="100%")),/^(B|T)/.test(a)&&(a!==ve.Top&&a!==ve.Bottom||(x.left="50%",x.marginLeft=-8,v.left="50%",v.marginLeft=-7),a!==ve.TopRight&&a!==ve.BottomRight||(x.right=10,v.right=11),a!==ve.TopLeft&&a!==ve.BottomLeft||(x.left=7,v.left=8)),/^L/.test(a)&&(x.borderWidth="8px 8px 8px 0",x.borderColor="transparent var(--github-arrow-border-color) transparent transparent",v.borderWidth="7px 7px 7px 0",v.borderColor="transparent var(--github-background-color) transparent transparent",x.left=-8,v.left=-7),/^R/.test(a)&&(x.borderWidth="8px 0 8px 8px",x.borderColor="transparent transparent transparent var(--github-arrow-border-color)",v.borderWidth="7px 0 7px 7px",v.borderColor="transparent transparent transparent var(--github-background-color)",x.right=-8,v.right=-7),/^(L|R)/.test(a)&&(a!==ve.RightTop&&a!==ve.LeftTop||(x.top=5,v.top=6),a!==ve.Left&&a!==ve.Right||(x.top="50%",v.top="50%",x.marginTop=-8,v.marginTop=-7),a!==ve.LeftBottom&&a!==ve.RightBottom||(x.top="100%",v.top="100%",x.marginTop=-21,v.marginTop=-20));return(0,Y.jsx)(ie,e({ref:o,className:[t,l].filter(Boolean).join(" "),colors:i,color:u,rectRender:r=>{var o=e({},(ge(r),r)),t=p&&p(e({},o));return t||(0,Y.jsx)(be,e({},o,{rectProps:d}))}},h,{onChange:e=>c&&c(P(e)),style:b,rectProps:{style:{marginRight:0,marginBottom:0,borderRadius:0,height:25,width:25}},addonBefore:(0,Y.jsxs)(O.Fragment,{children:[(0,Y.jsx)("div",{style:x}),(0,Y.jsx)("div",{style:v})]})}))}));me.displayName="Github";const ye=me;var Ce=e=>{var{className:r,color:o,left:t,top:a,prefixCls:l}=e,s={position:"absolute",top:a,left:t},n={"--saturation-pointer-box-shadow":"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",width:6,height:6,transform:"translate(-3px, -3px)",boxShadow:"var(--saturation-pointer-box-shadow)",borderRadius:"50%",backgroundColor:o};return(0,O.useMemo)((()=>(0,Y.jsx)("div",{className:l+"-pointer "+(r||""),style:s,children:(0,Y.jsx)("div",{className:l+"-fill",style:n})})),[a,t,o,r,l])},Fe=["prefixCls","radius","pointer","className","hue","style","hsva","onChange"],we=_().forwardRef(((r,o)=>{var t,{prefixCls:a="w-color-saturation",radius:l=0,pointer:s,className:n,hue:i=0,style:c,hsva:p,onChange:h}=r,g=z(r,Fe),u=e({width:200,height:200,borderRadius:l},c,{position:"relative"}),b=(e,r)=>{h&&p&&h({h:p.h,s:100*e.left,v:100*(1-e.top),a:p.a})},f=(0,O.useMemo)((()=>{if(!p)return null;var r={top:100-p.v+"%",left:p.s+"%",color:d(p)};return s&&"function"===typeof s?s(e({prefixCls:a},r)):(0,Y.jsx)(Ce,e({prefixCls:a},r))}),[p,s,a]);return(0,Y.jsx)(Q,e({className:[a,n||""].filter(Boolean).join(" ")},g,{style:e({position:"absolute",inset:0,cursor:"crosshair",backgroundImage:"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsl("+(null!=(t=null==p?void 0:p.h)?t:i)+", 100%, 50%))"},u),ref:o,onMove:b,onDown:b,children:f}))}));we.displayName="Saturation";const ke=we;var Be=["prefixCls","className","hue","onChange","direction"],Ae=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-hue",className:a,hue:l=0,onChange:s,direction:n="horizontal"}=r,i=z(r,Be);return(0,Y.jsx)(oe,e({ref:o,className:t+" "+(a||"")},i,{direction:n,background:"linear-gradient(to "+("horizontal"===n?"right":"bottom")+", 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%)",hsva:{h:l,s:100,v:100,a:l/360},onChange:(e,r)=>{s&&s({h:"horizontal"===n?360*r.left:360*r.top})}}))}));Ae.displayName="Hue";const je=Ae;var Re=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],Se=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-editable-input-rgba",hsva:a,placement:s="bottom",rProps:n={},gProps:i={},bProps:d={},aProps:c={},className:p,style:h,onChange:g}=r,u=z(r,Re),b=a?B(a):{};function f(e){var r=Number(e.target.value);r&&r>255&&(e.target.value="255"),r&&r<0&&(e.target.value="0")}var x=(r,o,t)=>{"number"===typeof r&&("a"===o&&(r<0&&(r=0),r>100&&(r=100),g&&g(P(l(e({},b,{a:r/100}))))),r>255&&(r=255,t.target.value="255"),r<0&&(r=0,t.target.value="0"),"r"===o&&g&&g(P(l(e({},b,{r:r})))),"g"===o&&g&&g(P(l(e({},b,{g:r})))),"b"===o&&g&&g(P(l(e({},b,{b:r})))))};return(0,Y.jsxs)("div",e({ref:o,className:[t,p||""].filter(Boolean).join(" ")},u,{style:e({fontSize:11,display:"flex"},h),children:[(0,Y.jsx)(le,e({label:"R",value:b.r||0,onBlur:f,placement:s,onChange:(e,r)=>x(r,"r",e)},n,{style:e({},n.style)})),(0,Y.jsx)(le,e({label:"G",value:b.g||0,onBlur:f,placement:s,onChange:(e,r)=>x(r,"g",e)},i,{style:e({marginLeft:5},n.style)})),(0,Y.jsx)(le,e({label:"B",value:b.b||0,onBlur:f,placement:s,onChange:(e,r)=>x(r,"b",e)},d,{style:e({marginLeft:5},d.style)})),c&&(0,Y.jsx)(le,e({label:"A",value:b.a?parseInt(String(100*b.a),10):0,onBlur:f,placement:s,onChange:(e,r)=>x(r,"a",e)},c,{style:e({marginLeft:5},c.style)}))]}))}));Se.displayName="EditableInputRGBA";const Ne=Se;var Ee=["prefixCls","hsva","hProps","sProps","lProps","aProps","className","onChange"],De=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-editable-input-hsla",hsva:a,hProps:l={},sProps:s={},lProps:n={},aProps:i={},className:d,onChange:c}=r,p=z(r,Ee),h=a?u(a):{h:0,s:0,l:0,a:0},b=(r,o,t)=>{"number"===typeof r&&("h"===o&&(r<0&&(r=0),r>360&&(r=360),c&&c(P(g(e({},h,{h:r}))))),"s"===o&&(r<0&&(r=0),r>100&&(r=100),c&&c(P(g(e({},h,{s:r}))))),"l"===o&&(r<0&&(r=0),r>100&&(r=100),c&&c(P(g(e({},h,{l:r}))))),"a"===o&&(r<0&&(r=0),r>1&&(r=1),c&&c(P(g(e({},h,{a:r}))))))};return(0,Y.jsx)(Ne,e({ref:o,hsva:a,rProps:e({label:"H",value:Math.round(h.h)},l,{onChange:(e,r)=>b(r,"h")}),gProps:e({label:"S",value:Math.round(h.s)+"%"},s,{onChange:(e,r)=>b(r,"s")}),bProps:e({label:"L",value:Math.round(h.l)+"%"},n,{onChange:(e,r)=>b(r,"l")}),aProps:e({label:"A",value:Math.round(100*h.a)/100},i,{onChange:(e,r)=>b(r,"a")}),className:[t,d||""].filter(Boolean).join(" ")},p))}));De.displayName="EditableInputHSLA";const Pe=De;var Te=["style"];function Le(r){var{style:o}=r,t=z(r,Te),a=(0,O.useRef)(null),l=(0,O.useCallback)((()=>{a.current.style.backgroundColor="var(--chrome-arrow-background-color)"}),[]),s=(0,O.useCallback)((()=>{a.current.style.backgroundColor="transparent"}),[]);return(0,Y.jsx)("div",e({ref:a,style:e({marginLeft:5,cursor:"pointer",transition:"background-color .3s",borderRadius:2},o)},t,{onMouseEnter:l,onMouseLeave:s,children:(0,Y.jsx)("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",style:{display:"block"},children:(0,Y.jsx)("path",{d:"M373.888 576h276.224c9.322667 0 14.293333 11.178667 9.173333 18.773333l-1.258666 1.557334-138.112 146.858666a10.709333 10.709333 0 0 1-14.293334 1.365334l-1.536-1.365334-138.112-146.858666c-6.592-6.997333-2.666667-18.645333 5.973334-20.16l1.941333-0.170667h276.224-276.224z m146.026667-295.189333l138.112 146.858666c7.04 7.509333 2.069333 20.330667-7.914667 20.330667H373.888c-9.984 0-14.976-12.821333-7.914667-20.330667l138.112-146.858666a10.730667 10.730667 0 0 1 15.829334 0z",fill:"var(--chrome-arrow-fill)"})})}))}var Me=["prefixCls","className","style","color","inputType","rectProps","onChange"],He=function(e){return e.HEXA="hexa",e.RGBA="rgba",e.HSLA="hsla",e}({}),Ie=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-chrome",className:a,style:l,color:s,inputType:n=He.RGBA,rectProps:i={},onChange:d}=r,c=z(r,Me),p="string"===typeof s&&I(s)?w(s):s||{h:0,s:0,l:0,a:0},h=e=>d&&d(P(e)),[g,u]=(0,O.useState)(n),b={paddingTop:6},f={textAlign:"center",paddingTop:4,paddingBottom:4},x=e({"--chrome-arrow-fill":"#333","--chrome-arrow-background-color":"#e8e8e8",borderRadius:0,flexDirection:"column",width:230,padding:0},l),v={"--chrome-alpha-box-shadow":"rgb(0 0 0 / 25%) 0px 0px 1px inset",borderRadius:"50%",background:j(p),boxShadow:"var(--chrome-alpha-box-shadow)"};return(0,Y.jsx)(ye,e({ref:o,color:p,style:x,colors:void 0,className:[t,a].filter(Boolean).join(" "),placement:ve.TopLeft},c,{addonAfter:(0,Y.jsxs)(O.Fragment,{children:[(0,Y.jsx)(ke,{hsva:p,style:{width:"100%",height:130},onChange:r=>{h(e({},p,r,{a:p.a}))}}),(0,Y.jsxs)("div",{style:{padding:15,display:"flex",alignItems:"center"},children:[(0,Y.jsx)(oe,{width:24,height:24,hsva:p,radius:2,style:{marginRight:15,borderRadius:"50%"},bgProps:{style:{background:"transparent"}},innerProps:{style:v},pointer:()=>(0,Y.jsx)(O.Fragment,{})}),(0,Y.jsxs)("div",{style:{flex:1},children:[(0,Y.jsx)(je,{hue:p.h,style:{width:"100%"},bgProps:{style:{borderRadius:2}},onChange:r=>{h(e({},p,r))}}),(0,Y.jsx)(oe,{hsva:p,style:{marginTop:10},bgProps:{style:{borderRadius:2}},onChange:r=>{h(e({},p,r))}})]})]}),(0,Y.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",padding:"0 15px 15px 15px",userSelect:"none"},children:[(0,Y.jsxs)("div",{style:{flex:1},children:[g==He.RGBA&&(0,Y.jsx)(Ne,{hsva:p,rProps:{labelStyle:b,inputStyle:f},gProps:{labelStyle:b,inputStyle:f},bProps:{labelStyle:b,inputStyle:f},aProps:{labelStyle:b,inputStyle:f},onChange:e=>h(e.hsva)}),g===He.HEXA&&(0,Y.jsx)(le,{label:"HEX",labelStyle:b,inputStyle:f,value:p.a>0&&p.a<1?E(p).toLocaleUpperCase():N(p).toLocaleUpperCase(),onChange:(e,r)=>{"string"===typeof r&&h(w(/^#/.test(r)?r:"#"+r))}}),g===He.HSLA&&(0,Y.jsx)(Pe,{hsva:p,hProps:{labelStyle:b,inputStyle:f},sProps:{labelStyle:b,inputStyle:f},lProps:{labelStyle:b,inputStyle:f},aProps:{labelStyle:b,inputStyle:f},onChange:e=>h(e.hsva)})]}),(0,Y.jsx)(Le,{onClick:()=>{g===He.RGBA&&u(He.HSLA),g===He.HSLA&&u(He.HEXA),g===He.HEXA&&u(He.RGBA)}})]})]}),rectRender:()=>(0,Y.jsx)(O.Fragment,{})}))}));Ie.displayName="Chrome";const ze=Ie;function Oe(r){var{style:o,className:t,title:a,checked:l,color:s,onClick:n,rectProps:i}=r,d=(0,O.useRef)(null),c=(0,O.useCallback)((()=>{d.current.style.transform="scale(1.2)"}),[]),p=(0,O.useCallback)((()=>{d.current.style.transform="scale(1)"}),[]),h=e({"--circle-point-background-color":"#fff",height:l?"100%":0,width:l?"100%":0,borderRadius:"50%",backgroundColor:"var(--circle-point-background-color)",boxSizing:"border-box",transition:"height 100ms ease 0s, width 100ms ease 0s"},i.style);return(0,Y.jsx)("div",{ref:d,onClick:n,onMouseEnter:c,onMouseLeave:p,title:a,className:t,style:e({},o,{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,padding:3,borderRadius:"50%",marginRight:12,marginBottom:12,boxSizing:"border-box",transform:"scale(1)",boxShadow:s+" 0px 0px "+(l?5:0)+"px",transition:"transform 100ms ease 0s, box-shadow 100ms ease 0s"}),children:(0,Y.jsx)("div",e({},i,{style:h}))})}var _e=["prefixCls","className","color","colors","rectProps","pointProps","onChange"],We=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-circle",className:a,color:l,colors:s=[],rectProps:n={},pointProps:i,onChange:d}=r,c=z(r,_e),p="string"===typeof l&&I(l)?w(l):l||{},h=l?N(p):"",g=[t,a].filter(Boolean).join(" "),u=[t+"-point",null==i?void 0:i.className].filter(Boolean).join(" ");return(0,Y.jsx)(ie,e({ref:o,colors:s,color:h},c,{className:g,rectRender:r=>{var o=e({},(ge(r),r));return(0,Y.jsx)(Oe,e({},o,i,{className:u,rectProps:n}))},onChange:e=>{d&&d(P(e))}}))}));We.displayName="Circle";const qe=We;var Ge=["style","color"],Ue=["prefixCls","className","onChange","color","style","disableAlpha"],Xe=r=>{var{style:o,color:t}=r,a=z(r,Ge),l=e({"--colorful-pointer-background-color":"#fff","--colorful-pointer-border":"2px solid #fff",height:28,width:28,position:"absolute",transform:"translate(-14px, -4px)",boxShadow:"0 2px 4px rgb(0 0 0 / 20%)",borderRadius:"50%",background:"url("+ee+")",backgroundColor:"var(--colorful-pointer-background-color)",border:"var(--colorful-pointer-border)",zIndex:1},o);return(0,Y.jsx)("div",e({},a,{style:l,children:(0,Y.jsx)("div",{style:{backgroundColor:t,borderRadius:"50%",height:" 100%",width:"100%"}})}))},Ye=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-colorful",className:a,onChange:l,color:s,style:n,disableAlpha:i}=r,d=z(r,Ue),c="string"===typeof s&&I(s)?w(s):s||{},p=e=>l&&l(P(e));return(0,Y.jsxs)("div",e({ref:o,style:e({width:200,position:"relative"},n)},d,{className:t+" "+(a||""),children:[(0,Y.jsx)(ke,{hsva:c,className:t,radius:"8px 8px 0 0",style:{width:"auto",height:150,minWidth:120,borderBottom:"12px solid #000"},pointer:e=>{var{left:r,top:o,color:t}=e;return(0,Y.jsx)(Xe,{style:{left:r,top:o,transform:"translate(-16px, -16px)"},color:N(c)})},onChange:r=>p(e({},c,r))}),(0,Y.jsx)(je,{hue:c.h,height:24,radius:i?"0 0 8px 8px":0,className:t,onChange:r=>p(e({},c,r)),pointer:e=>{var{left:r}=e;return(0,Y.jsx)(Xe,{style:{left:r},color:"hsl("+(c.h||0)+"deg 100% 50%)"})}}),!i&&(0,Y.jsx)(oe,{hsva:c,height:24,className:t,radius:"0 0 8px 8px",pointer:e=>{var{left:r}=e;return(0,Y.jsx)(Xe,{style:{left:r},color:j(c)})},onChange:r=>p(e({},c,r))})]}))}));Ye.displayName="Colorful";const Ve=Ye;var Ke=["prefixCls","className","style","onChange","color","colors","rectProps","rectRender"],Qe=["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"];function Ze(e){return e.checked?(0,Y.jsx)("div",{style:{height:5,width:5,borderRadius:"50%",backgroundColor:T(e.color)}}):null}var $e=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-compact",className:a,style:l,onChange:s,color:n,colors:i=Qe,rectProps:d,rectRender:c}=r,p=z(r,Ke),h="string"===typeof n&&I(n)?w(n):n,g=n?N(h).replace(/^#/,""):"",u=(0,O.useCallback)((e=>s&&s(P(e))),[]),b={style:{alignItems:"baseline"},inputStyle:{boxShadow:"none",backgroundColor:"transparent",outline:0}},f=e({"--compact-background-color":"#f6f6f6",background:"var(--compact-background-color)",borderRadius:3,display:"flex",width:240,flexWrap:"wrap",paddingTop:5,paddingLeft:5},l);return(0,Y.jsxs)("div",e({ref:o,style:f,className:[t,a||""].filter(Boolean).join(" ")},p,{children:[(0,Y.jsx)(ie,{colors:i,color:n?N(h):void 0,rectRender:c,rectProps:e({children:(0,Y.jsx)(Ze,{})},d,{style:e({display:"flex",alignItems:"center",justifyContent:"center"},null==d?void 0:d.style)}),onChange:e=>u(e)}),(0,Y.jsxs)("div",{style:{display:"flex",margin:"0 4px 3px 0"},children:[(0,Y.jsx)(le,{onChange:(e,r)=>{var o;"string"===typeof(o=r)&&I(o)&&/(3|6)/.test(String(o.length))&&u(w(o))},labelStyle:{paddingRight:5,marginTop:-1},value:g.toLocaleUpperCase(),label:(0,Y.jsx)("div",{style:{width:8,height:8,backgroundColor:"#"+g}}),inputStyle:{outline:"none",boxShadow:"initial",background:"transparent"},style:{flexDirection:"row-reverse",flex:"1 1 0%",minWidth:80}}),(0,Y.jsx)(Ne,{hsva:h,placement:"left",onChange:e=>u(e.hsva),aProps:!1,rProps:b,gProps:b,bProps:b})]})]}))}));$e.displayName="Compact";const Je=$e;var er=["prefixCls","className","style","color","onChange"],rr={boxShadow:"initial",borderWidth:"0 0 1px 0",borderBottomColor:"var(--material-border-bottom-color)",borderBottomStyle:"solid",height:30,outline:0,fontSize:15,padding:0},or=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-material",className:a,style:l,color:s,onChange:n}=r,i=z(r,er),d="string"===typeof s&&I(s)?w(s):s,c=s?N(d).replace(/^#/,""):"",p=(e,r)=>{"string"===typeof e&&I(e)&&/(3|6)/.test(String(e.length))&&n&&n(P(w(e)))},h=e({"--material-border-bottom-color":"#eee","--material-background-color":"#fff",padding:16,width:98,fontFamily:"Roboto",backgroundColor:"var(--material-background-color)"},l);return(0,Y.jsxs)("div",e({ref:o,className:[t,a||""].filter(Boolean).join(" "),style:h},i,{children:[(0,Y.jsx)(le,{label:"Hex",value:c.toLocaleUpperCase(),onChange:(e,r)=>p(r),onBlur:e=>{var r=e.target.value;e.target.value=r.slice(0,6),p(r.slice(0,6))},inputStyle:{outline:0,border:0,height:30,fontSize:15,padding:0,boxShadow:"initial",borderWidth:"0 0 2px 0",borderBottomColor:c?"#"+c:"var(--material-border-bottom-color)",borderBottomStyle:"solid",background:"transparent"},style:{flexDirection:"column-reverse",alignItems:"flex-start"}}),(0,Y.jsx)(Ne,{hsva:d,placement:"top",style:{marginTop:11},rProps:{style:{alignItems:"flex-start"},inputStyle:e({},rr)},gProps:{style:{alignItems:"flex-start"},inputStyle:e({},rr)},bProps:{style:{alignItems:"flex-start"},inputStyle:e({},rr)},aProps:!1,onChange:e=>{return r=e.hsva,void(n&&n(P(r)));var r}})]}))}));or.displayName="Material";const tr=or,ar=["#F0F8FF","#FAEBD7","#00FFFF","#7FFFD4","#F0FFFF","#F5F5DC","#FFE4C4","#000000","#FFEBCD","#0000FF","#8A2BE2","#A52A2A","#DEB887","#5F9EA0","#7FFF00","#D2691E","#FF7F50","#6495ED","#FFF8DC","#DC143C","#00FFFF","#00008B","#008B8B","#B8860B","#A9A9A9","#006400","#A9A9A9","#BDB76B","#8B008B","#556B2F","#FF8C00","#9932CC","#8B0000","#E9967A","#8FBC8F","#483D8B","#2F4F4F","#2F4F4F","#00CED1","#9400D3","#FF1493","#00BFFF","#696969","#696969","#1E90FF","#B22222","#FFFAF0","#228B22","#FF00FF","#DCDCDC","#F8F8FF","#FFD700","#DAA520","#808080","#008000","#ADFF2F","#808080","#F0FFF0","#FF69B4","#CD5C5C","#4B0082","#FFFFF0","#F0E68C","#E6E6FA","#FFF0F5","#7CFC00","#FFFACD","#ADD8E6","#F08080","#E0FFFF","#FAFAD2","#D3D3D3","#90EE90","#D3D3D3","#FFB6C1","#FFA07A","#20B2AA","#87CEFA","#778899","#778899","#B0C4DE","#FFFFE0","#00FF00","#32CD32","#FAF0E6","#FF00FF","#800000","#66CDAA","#0000CD","#BA55D3","#9370DB","#3CB371","#7B68EE","#00FA9A","#48D1CC","#C71585","#191970","#F5FFFA","#FFE4E1","#FFE4B5","#FFDEAD","#000080","#FDF5E6","#808000","#6B8E23","#FFA500","#FF4500","#DA70D6","#EEE8AA","#98FB98","#AFEEEE","#DB7093","#FFEFD5","#FFDAB9","#CD853F","#FFC0CB","#DDA0DD","#B0E0E6","#800080","#663399","#FF0000","#BC8F8F","#4169E1","#8B4513","#FA8072","#F4A460","#2E8B57","#FFF5EE","#A0522D","#C0C0C0","#87CEEB","#6A5ACD","#708090","#708090","#FFFAFA","#00FF7F","#4682B4","#D2B48C","#008080","#D8BFD8","#FF6347","#40E0D0","#EE82EE","#F5DEB3","#FFFFFF","#F5F5F5","#FFFF00","#9ACD32"];var lr=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].reduce(((e,r,o)=>(e[r]=ar[o],e)),{}),sr=["aqua","black","blue","fuchsia","gray","green","lime","maroon","navy","olive","purple","red","silver","teal","white","yellow"],nr=sr.reduce(((e,r)=>(e[r]=lr[r],e)),{});function ir(e){return lr[e]}var dr=["prefixCls","className","onChange","direction","hsva"],cr=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-saturation",className:a,onChange:l,direction:s="horizontal",hsva:n}=r,i=z(r,dr),c=d(e({},n,{a:1,v:100}));return(0,Y.jsx)(oe,e({ref:o},i,{className:t+" "+(a||""),hsva:{h:n.h,s:n.s,v:n.v,a:1-n.v/100},direction:s,background:"linear-gradient(to "+("horizontal"===s?"right":"bottom")+", "+c+", rgb(0, 0, 0))",onChange:(e,r)=>{l&&l({v:"horizontal"===s?100-100*r.left:100-100*r.top})}}))}));cr.displayName="ShadeSlider";const pr=cr;var hr=["prefixCls","className","onChange","width","presetColors","color","editableDisable","disableAlpha","style"],gr=["#D0021B","#F5A623","#f8e61b","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],ur=e=>(0,Y.jsx)("div",{style:{boxShadow:"rgb(0 0 0 / 60%) 0px 0px 2px",width:4,top:1,bottom:1,left:e.left,borderRadius:1,position:"absolute",backgroundColor:"#fff"}}),br=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-sketch",className:a,onChange:l,width:s=218,presetColors:n=gr,color:i,editableDisable:d=!0,disableAlpha:c=!1,style:p}=r,h=z(r,hr),[g,u]=(0,O.useState)({h:209,s:36,v:90,a:1});(0,O.useEffect)((()=>{"string"===typeof i&&I(i)&&u(w(i)),"object"===typeof i&&u(i)}),[i]);var b=e=>{u(e),l&&l(P(e))},f=e({"--sketch-background":"rgb(255, 255, 255)","--sketch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px","--sketch-swatch-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset","--sketch-alpha-box-shadow":"rgb(0 0 0 / 15%) 0px 0px 0px 1px inset, rgb(0 0 0 / 25%) 0px 0px 4px inset","--sketch-swatch-border-top":"1px solid rgb(238, 238, 238)",background:"var(--sketch-background)",borderRadius:4,boxShadow:"var(--sketch-box-shadow)",width:s},p),x={borderRadius:2,background:j(g),boxShadow:"var(--sketch-alpha-box-shadow)"};return(0,Y.jsxs)("div",e({},h,{className:t+" "+(a||""),ref:o,style:f,children:[(0,Y.jsxs)("div",{style:{padding:"10px 10px 8px"},children:[(0,Y.jsx)(ke,{hsva:g,style:{width:"auto",height:150},onChange:r=>b(e({},g,r,{a:g.a}))}),(0,Y.jsxs)("div",{style:{display:"flex",marginTop:4},children:[(0,Y.jsxs)("div",{style:{flex:1},children:[(0,Y.jsx)(je,{width:"auto",height:10,hue:g.h,pointer:ur,innerProps:{style:{marginLeft:1,marginRight:5}},onChange:r=>b(e({},g,r))}),!c&&(0,Y.jsx)(oe,{width:"auto",height:10,hsva:g,pointer:ur,style:{marginTop:4},innerProps:{style:{marginLeft:1,marginRight:5}},onChange:r=>b(e({},g,{a:r.a}))})]}),!c&&(0,Y.jsx)(oe,{width:24,height:24,hsva:g,radius:2,style:{marginLeft:4},bgProps:{style:{background:"transparent"}},innerProps:{style:x},pointer:()=>(0,Y.jsx)(O.Fragment,{})})]})]}),d&&(0,Y.jsxs)("div",{style:{display:"flex",margin:"0 10px 3px 10px"},children:[(0,Y.jsx)(le,{label:"Hex",value:N(g).replace(/^#/,"").toLocaleUpperCase(),onChange:(e,r)=>{var o;"string"===typeof(o=r)&&I(o)&&/(3|6)/.test(String(o.length))&&b(w(o))},style:{minWidth:58}}),(0,Y.jsx)(Ne,{hsva:g,style:{marginLeft:6},aProps:!c&&{},onChange:e=>b(e.hsva)})]}),n&&n.length>0&&(0,Y.jsx)(ie,{style:{borderTop:"var(--sketch-swatch-border-top)",paddingTop:10,paddingLeft:10},colors:n,color:N(g),onChange:e=>b(e),rectProps:{style:{marginRight:10,marginBottom:10,borderRadius:3,boxShadow:"var(--sketch-swatch-box-shadow)"}}})]}))}));br.displayName="Sketch";const fr=br;var xr=["prefixCls","className","style","onChange","color","lightness"],vr=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-slider",className:a,style:l,onChange:n,color:i,lightness:d=[80,65,50,35,20]}=r,c=z(r,xr),p="string"===typeof i&&I(i)?w(i):i||{};return(0,Y.jsx)("div",e({ref:o,style:e({display:"flex"},l),className:[t,a||""].filter(Boolean).join(" ")},c,{children:d.map(((r,o)=>{var t="hsl("+u(p).h+", 50%, "+r+"%)",a=t===s(p);return(0,Y.jsx)("div",{style:{paddingLeft:1,width:100/d.length+"%",boxSizing:"border-box"},children:(0,Y.jsx)("div",{onClick:e=>((e,r)=>{n&&n(P(h(e)),r)})(t,e),style:e({backgroundColor:t,height:12,cursor:"pointer"},a?{borderRadius:2,transform:"scale(1, 1.5)"}:{})})},o)}))}))}));vr.displayName="Slider";const mr=vr;var yr=r=>{var{className:o,color:t,left:a,top:l,style:s,prefixCls:n}=r,i=e({},s,{position:"absolute",top:l,left:a}),d=n+"-pointer "+(o||"");return(0,Y.jsx)("div",{className:d,style:i,children:(0,Y.jsx)("div",{className:n+"-fill",style:{width:10,height:10,transform:"translate(-5px, -5px)",boxShadow:"rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",borderRadius:"50%",backgroundColor:"#fff"},children:(0,Y.jsx)("div",{style:{inset:0,borderRadius:"50%",position:"absolute",backgroundColor:t}})})})},Cr=2*Math.PI,Fr=(e,r)=>(e%r+r)%r,wr=(e,r)=>Math.sqrt(e*e+r*r);function kr(e){var{width:r=0}=e,o=r/2;return{width:r,radius:o,cx:o,cy:o}}function Br(e){var{width:r=0}=e;return r/2}function Ar(e,r,o){var t=e.angle||0,a=e.direction;return o&&"clockwise"===a?r=t+r:"clockwise"===a?r=360-t+r:o&&"anticlockwise"===a?r=t+180-r:"anticlockwise"===a&&(r=t-r),Fr(r,360)}var jr=["prefixCls","radius","pointer","className","style","width","height","oval","direction","angle","color","onChange"],Rr=_().forwardRef(((r,o)=>{var{prefixCls:t="w-color-wheel",radius:a=0,pointer:l,className:s,style:n,width:i=200,height:d=200,oval:c,direction:p="anticlockwise",angle:h=180,color:g,onChange:u}=r,b=z(r,jr),f="string"===typeof g&&I(g)?w(g):g||{},x=g?N(f):"",v=function(e,r){var{cx:o,cy:t}=kr(e),a=Br(e),l=(180+Ar(e,r.h,!0))*(Cr/360),s=r.s/100*a,n="clockwise"===e.direction?-1:1;return{x:o+s*Math.cos(l)*n,y:t+s*Math.sin(l)*n}}({width:i},f),m={top:"0",left:"0",color:x},y=(e,r)=>{var o=function(e,r,o){var{cx:t,cy:a}=kr(e),l=Br(e);r=t-r,o=a-o;var s=Ar(e,Math.atan2(-o,-r)*(360/Cr)),n=Math.min(wr(r,o),l);return{h:Math.round(s),s:Math.round(100/l*n)}}({width:i},i-e.x,d-e.y),t={h:o.h,s:o.s,v:f.v,a:f.a};u&&u(P(t))},C={zIndex:1,transform:"translate("+v.x+"px, "+v.y+"px) "+("x"===c||"X"===c?"scaleY(2)":"y"===c||"Y"===c?"scaleX(2)":"")},F=l&&"function"===typeof l?l(e({prefixCls:t,style:C},m)):(0,Y.jsx)(yr,e({prefixCls:t,style:C},m));return(0,Y.jsxs)(Q,e({className:[t,s||""].filter(Boolean).join(" ")},b,{style:e({position:"relative",width:i,transform:"x"===c||"X"===c?"scaleY(0.5)":"y"===c||"Y"===c?"scaleX(0.5)":"",height:d},n),ref:o,onMove:y,onDown:y,children:[F,(0,Y.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:"anticlockwise"===p?"conic-gradient(red, yellow, lime, aqua, blue, magenta, red)":"conic-gradient(red, magenta, blue, aqua, lime, yellow, red)",transform:"rotateZ("+(h+90)+"deg)",inset:0}}),(0,Y.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:"radial-gradient(circle closest-side, #fff, transparent)",inset:0}}),(0,Y.jsx)("div",{style:{backgroundColor:"#000",borderRadius:"50%",position:"absolute",inset:0,opacity:"number"===typeof f.v?1-f.v/100:0}})]}))}));Rr.displayName="Wheel";const Sr=Rr})(),a})()));
{
"name": "@uiw/react-color",
"version": "2.0.9",
"version": "2.1.0",
"description": "Color Picker component for React.",

@@ -51,22 +51,22 @@ "homepage": "https://uiwjs.github.io/react-color",

"dependencies": {
"@uiw/color-convert": "2.0.9",
"@uiw/react-color-alpha": "2.0.9",
"@uiw/react-color-block": "2.0.9",
"@uiw/react-color-chrome": "2.0.9",
"@uiw/react-color-circle": "2.0.9",
"@uiw/react-color-colorful": "2.0.9",
"@uiw/react-color-compact": "2.0.9",
"@uiw/react-color-editable-input": "2.0.9",
"@uiw/react-color-editable-input-hsla": "2.0.9",
"@uiw/react-color-editable-input-rgba": "2.0.9",
"@uiw/react-color-github": "2.0.9",
"@uiw/react-color-hue": "2.0.9",
"@uiw/react-color-material": "2.0.9",
"@uiw/react-color-name": "2.0.9",
"@uiw/react-color-saturation": "2.0.9",
"@uiw/react-color-shade-slider": "2.0.9",
"@uiw/react-color-sketch": "2.0.9",
"@uiw/react-color-slider": "2.0.9",
"@uiw/react-color-swatch": "2.0.9",
"@uiw/react-color-wheel": "2.0.9"
"@uiw/color-convert": "2.1.0",
"@uiw/react-color-alpha": "2.1.0",
"@uiw/react-color-block": "2.1.0",
"@uiw/react-color-chrome": "2.1.0",
"@uiw/react-color-circle": "2.1.0",
"@uiw/react-color-colorful": "2.1.0",
"@uiw/react-color-compact": "2.1.0",
"@uiw/react-color-editable-input": "2.1.0",
"@uiw/react-color-editable-input-hsla": "2.1.0",
"@uiw/react-color-editable-input-rgba": "2.1.0",
"@uiw/react-color-github": "2.1.0",
"@uiw/react-color-hue": "2.1.0",
"@uiw/react-color-material": "2.1.0",
"@uiw/react-color-name": "2.1.0",
"@uiw/react-color-saturation": "2.1.0",
"@uiw/react-color-shade-slider": "2.1.0",
"@uiw/react-color-sketch": "2.1.0",
"@uiw/react-color-slider": "2.1.0",
"@uiw/react-color-swatch": "2.1.0",
"@uiw/react-color-wheel": "2.1.0"
},

@@ -73,0 +73,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc