1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4403],{4403:function(e,r,a){a.d(r,{Z:function(){return R}});var t=a(29947),n=a(42454),l=a(20132),o=e=>{var{r,g:a,b:t,a:n}=e,l=Math.max(r,a,t),o=l-Math.min(r,a,t),i=o?l===r?(a-t)/o:l===a?2+(t-r)/o:4+(r-a)/o:0;return{h:60*(i<0?i+6:i),s:l?o/l*100:0,v:l/255*100,a:n}},i=e=>{var{h:r,s:a,v:t,a:n}=e,l=(200-a)*t/100;return{h:r,s:l>0&&l<200?a*t/100/(l<=100?l:200-l)*100:0,l:l/2,a:n}},s=e=>{let r;var{r:a,g:t,b:n}=e;return"#"+(Array(7-(r=(a<<16|t<<8|n).toString(16)).length).join("0")+r)},c=e=>{var{r,g:a,b:t,a:n}=e,l="number"==typeof n&&(255*n|256).toString(16).slice(1);return""+s({r,g:a,b:t,a:n})+(l||"")},u=e=>o(d(e)),d=e=>{var r=e.replace("#","");/^#?/.test(e)&&3===r.length&&(e="#"+r.charAt(0)+r.charAt(0)+r.charAt(1)+r.charAt(1)+r.charAt(2)+r.charAt(2));var[a,t,n=0,l]=e.match(/[A-Za-z0-9]{2}/g).map(e=>parseInt(e,16));return{r:a,g:t,b:n,a:(null!=l?l:255)/255}},p=e=>{var{h:r,s:a,v:n,a:l}=e,o=r/60,i=a/100,s=n/100,c=o-Math.floor(o),u=255*s*(1-i),d=255*s*(1-i*c),p=255*s*(1-i*(1-c));s*=255;var f={};switch(Math.floor(o)%6){case 0:f.r=s,f.g=p,f.b=u;break;case 1:f.r=d,f.g=s,f.b=u;break;case 2:f.r=u,f.g=s,f.b=p;break;case 3:f.r=u,f.g=d,f.b=s;break;case 4:f.r=p,f.g=u,f.b=s;break;case 5:f.r=s,f.g=u,f.b=d}return f.r=Math.round(f.r),f.g=Math.round(f.g),f.b=Math.round(f.b),(0,t.Z)({},f,{a:l})},f=e=>{var{r,g:a,b:t}=e;return{r,g:a,b:t}},g=e=>{var{h:r,s:a,l:t}=e;return{h:r,s:a,l:t}},b=e=>s(p(e)),v=e=>{var{h:r,s:a,v:t}=e;return{h:r,s:a,v:t}},h=e=>{var r,a,t,n,l,o,s,d;return"string"==typeof e&&y(e)?(o=u(e),s=e):"string"!=typeof e&&(o=e),o&&(t=v(o),l=i(o),d=c(n=p(o)),s=b(o),a=g(l),r=f(n)),{rgb:r,hsl:a,hsv:t,rgba:n,hsla:l,hsva:o,hex:s,hexa:d}},m=e=>{if(!e)return"#ffffff";var r=h(e);return(299*r.rgb.r+587*r.rgb.g+114*r.rgb.b)/1e3>=128?"#000000":"#ffffff"},y=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),x=a(15311),C=["prefixCls","placement","label","value","className","style","labelStyle","inputStyle","onChange","onBlur"],Z=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e),w=e=>Number(String(e).replace(/%/g,"")),F=l.forwardRef((e,r)=>{var{prefixCls:a="w-color-editable-input",placement:o="bottom",label:i,value:s,className:c,style:u,labelStyle:d,inputStyle:p,onChange:f,onBlur:g}=e,b=(0,n.Z)(e,C),[v,h]=(0,l.useState)(s),m=(0,l.useRef)(!1);(0,l.useEffect)(()=>{e.value===v||m.current||h(e.value)},[e.value]);var y={};"bottom"===o&&(y.flexDirection="column"),"top"===o&&(y.flexDirection="column-reverse"),"left"===o&&(y.flexDirection="row-reverse");var F=(0,t.Z)({"--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},y,u),j=(0,t.Z)({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)"},p);return(0,x.jsxs)("div",{className:[a,c||""].filter(Boolean).join(" "),style:F,children:[(0,x.jsx)("input",(0,t.Z)({ref:r,value:v,onChange:function(e,r){var a=(r||e.target.value).trim().replace(/^#/,"");Z(a)&&f&&f(e,a);var t=w(a);!isNaN(t)&&f&&f(e,t),h(a)},onBlur:function(r){m.current=!1,h(e.value),g&&g(r)},autoComplete:"off",onFocus:()=>m.current=!0},b,{style:j})),i&&(0,x.jsx)("span",{style:(0,t.Z)({color:"var(--editable-input-label-color)",textTransform:"capitalize"},d),children:i})]})});F.displayName="EditableInput";var j=["prefixCls","hsva","placement","rProps","gProps","bProps","aProps","className","style","onChange"],B=l.forwardRef((e,r)=>{var{prefixCls:a="w-color-editable-input-rgba",hsva:l,placement:i="bottom",rProps:s={},gProps:c={},bProps:u={},aProps:d={},className:f,style:g,onChange:b}=e,v=(0,n.Z)(e,j),m=l?p(l):{};function y(e){var r=Number(e.target.value);r&&r>255&&(e.target.value="255"),r&&r<0&&(e.target.value="0")}var C=(e,r,a)=>{"number"==typeof e&&("a"===r&&(e<0&&(e=0),e>100&&(e=100),b&&b(h(o((0,t.Z)({},m,{a:e/100}))))),e>255&&(e=255,a.target.value="255"),e<0&&(e=0,a.target.value="0"),"r"===r&&b&&b(h(o((0,t.Z)({},m,{r:e})))),"g"===r&&b&&b(h(o((0,t.Z)({},m,{g:e})))),"b"===r&&b&&b(h(o((0,t.Z)({},m,{b:e})))))};return(0,x.jsxs)("div",(0,t.Z)({ref:r,className:[a,f||""].filter(
1Boolean).join(" ")},v,{style:(0,t.Z)({fontSize:11,display:"flex"},g),children:[(0,x.jsx)(F,(0,t.Z)({label:"R",value:m.r||0,onBlur:y,placement:i,onChange:(e,r)=>C(r,"r",e)},s,{style:(0,t.Z)({},s.style)})),(0,x.jsx)(F,(0,t.Z)({label:"G",value:m.g||0,onBlur:y,placement:i,onChange:(e,r)=>C(r,"g",e)},c,{style:(0,t.Z)({marginLeft:5},s.style)})),(0,x.jsx)(F,(0,t.Z)({label:"B",value:m.b||0,onBlur:y,placement:i,onChange:(e,r)=>C(r,"b",e)},u,{style:(0,t.Z)({marginLeft:5},u.style)})),d&&(0,x.jsx)(F,(0,t.Z)({label:"A",value:m.a?parseInt(String(100*m.a),10):0,onBlur:y,placement:i,onChange:(e,r)=>C(r,"a",e)},d,{style:(0,t.Z)({marginLeft:5},d.style)}))]}))});B.displayName="EditableInputRGBA";var k=["prefixCls","className","color","colors","style","rectProps","onChange","addonAfter","addonBefore","rectRender"],A=l.forwardRef((e,r)=>{var{prefixCls:a="w-color-swatch",className:o,color:i,colors:s=[],style:c,rectProps:d={},onChange:p,addonAfter:f,addonBefore:g,rectRender:b}=e,v=(0,n.Z)(e,k),m=(0,t.Z)({"--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},d.style),y=(e,r)=>{p&&p(u(e),h(u(e)),r)};return(0,x.jsxs)("div",(0,t.Z)({ref:r},v,{className:[a,o||""].filter(Boolean).join(" "),style:(0,t.Z)({display:"flex",flexWrap:"wrap",position:"relative"},c),children:[g&&l.isValidElement(g)&&g,s&&Array.isArray(s)&&s.map((e,r)=>{var a="",n="";"string"==typeof e&&(a=e,n=e),"object"==typeof e&&e.color&&(a=e.title||e.color,n=e.color);var o=i&&i.toLocaleLowerCase()===n.toLocaleLowerCase(),s=b&&b({title:a,color:n,checked:!!o,style:(0,t.Z)({},m,{background:n}),onClick:e=>y(n,e)});if(s)return(0,x.jsx)(l.Fragment,{children:s},r);var c=d.children&&l.isValidElement(d.children)?l.cloneElement(d.children,{color:n,checked:o}):null;return(0,x.jsx)("div",(0,t.Z)({tabIndex:0,title:a,onClick:e=>y(n,e)},d,{children:c,style:(0,t.Z)({},m,{background:n})}),r)}),f&&l.isValidElement(f)&&f]}))});A.displayName="Swatch";var S=["prefixCls","className","style","onChange","color","colors","rectProps","rectRender"],N=["#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 D(e){return e.checked?(0,x.jsx)("div",{style:{height:5,width:5,borderRadius:"50%",backgroundColor:m(e.color)}}):null}var E=l.forwardRef((e,r)=>{var{prefixCls:a="w-color-compact",className:o,style:i,onChange:s,color:c,colors:d=N,rectProps:p,rectRender:f}=e,g=(0,n.Z)(e,S),v="string"==typeof c&&y(c)?u(c):c,m=c?b(v).replace(/^#/,""):"",C=(0,l.useCallback)(e=>s&&s(h(e)),[]),Z=(e,r)=>{"string"==typeof e&&y(e)&&/(3|6)/.test(String(e.length))&&C(u(e))},w={style:{alignItems:"baseline"},inputStyle:{boxShadow:"none",backgroundColor:"transparent",outline:0}},j=(0,t.Z)({"--compact-background-color":"#f6f6f6",background:"var(--compact-background-color)",borderRadius:3,display:"flex",width:240,flexWrap:"wrap",paddingTop:5,paddingLeft:5},i);return(0,x.jsxs)("div",(0,t.Z)({ref:r,style:j,className:[a,o||""].filter(Boolean).join(" ")},g,{children:[(0,x.jsx)(A,{colors:d,color:c?b(v):void 0,rectRender:f,rectProps:(0,t.Z)({children:(0,x.jsx)(D,{})},p,{style:(0,t.Z)({display:"flex",alignItems:"center",justifyContent:"center"},null==p?void 0:p.style)}),onChange:e=>C(e)}),(0,x.jsxs)("div",{style:{display:"flex",margin:"0 4px 3px 0"},children:[(0,x.jsx)(F,{onChange:(e,r)=>Z(r,e),labelStyle:{paddingRight:5,marginTop:-1},value:m.toLocaleUpperCase(),label:(0,x.jsx)("div",{style:{width:8,height:8,backgroundColor:"#"+m}}),inputStyle:{outline:"none",boxShadow:"initial",background:"transparent"},style:{flexDirection:"row-reverse",flex:"1 1 0%",minWidth:80}}),(0,x.jsx)(B,{hsva:v,placement:"left",onChange:e=>C(e.hsva),aProps:!1,rProps:w,gProps:w,bProps:w})]})]}))});E.displayName="Compact";var R=E},29947:function(e,r,a){a.d(r,{Z:function(){return t}});function t(){return(t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var a=arguments[r];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e}).apply(null,arguments)}},42454:function(e,r,a){a.d(r,{Z:function(){return t}});function t(e,r){if(null==e)return{};var a={};for(var t in e)if(({}).hasOwnProperty.call(e,t)){if(r.includes(t))continue;a[t]=e[t]}return a}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.