import{jsxs as o,jsx as i}from"react/jsx-runtime";import{forwardRef as s,useState as c,useLayoutEffect as n}from"react";import{ChromePicker as t}from"react-color";import e from"classnames";import{makeStyles as r,Tooltip as a}from"@material-ui/core";import p from"./Palette/Palette.js";import m from"../../IconButton/index.js";import{PaletteIcon as l,PickerIcon as d}from"../../../icons/iconParkIcons.js";import"../../../icons/customIcons/icons/AddMessage.js";import"../../../icons/customIcons/icons/Attention.js";import"../../../icons/customIcons/icons/Collapse.js";import"../../../icons/customIcons/icons/Dashboard.js";import"../../../icons/customIcons/icons/Expand.js";import"../../../icons/customIcons/icons/FolderClosed.js";import"../../../icons/customIcons/icons/FolderClosedFilled.js";import"../../../icons/customIcons/icons/FolderOpened.js";import"../../../icons/customIcons/icons/GreaterOrEqual.js";import"../../../icons/customIcons/icons/LessOrEqual.js";import"../../../icons/customIcons/icons/Search.js";import"../../../icons/customIcons/icons/Wellhub.js";import"../../../icons/customIcons/icons/MultiRuler.js";import"../../../icons/customIcons/icons/Checkbox.js";import"../../../icons/customIcons/icons/CheckboxChecked.js";import"../../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../../icons/customIcons/icons/Radio.js";import"../../../icons/customIcons/icons/RadioChecked.js";import"../../../icons/customIcons/icons/SimulFrac.js";import"../../../icons/customIcons/icons/ZipperFrac.js";import"../../../icons/customIcons/icons/CautionFilled.js";import"../../../icons/customIcons/icons/MoreApp.js";var u="PALETTE",h="CHROME_PICKER",b={default:{picker:{width:"100%",boxShadow:"none"},body:{backgroundColor:"#3b3b3b",padding:"16px 16px 0"},color:{width:"32px",height:"32px",marginRight:"16px",borderRadius:"2px"},swatch:{marginTop:0,width:"100%",height:"100%",borderRadius:0,position:"relative",overflow:"hidden"},toggles:{display:"flex",flexDirection:"column",justifyContent:"space-between"},Alpha:{checkboard:{display:"none"},gradient:{borderRadius:"5px"}}}},x=r({container:{backgroundColor:"#3b3b3b",boxShadow:"0px 3px 10px rgba(0, 0, 0, 0.4)",width:"250px",paddingBottom:"8px",borderRadius:"4px","& input":{border:"1px solid #616161 !important",backgroundColor:"#3b3b3b",color:"#fff !important",boxShadow:"none !important",outline:"none"}},chromePickerPalette:{margin:"0 8px",paddingTop:"8px"},buttonsContainer:{display:"flex",justifyContent:"center",marginTop:"8px"},iconActive:{color:"#fff"},tooltip:{background:"#414141",color:"#fff",boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.12)",borderRadius:"4px",opacity:1,fontSize:"11px"}}),f=s((function(s,r){var f,j,C=s.color,I=s.onChange,g=s.onSizeChange,k=s.enableTransparencyPalette,P=x(),w=c(u),y=w[0],R=w[1];return n(g,[y]),o("div",{className:P.container,ref:r,children:[y===u&&i(p,{className:P.chromePickerPalette,color:C,onChange:I,enableTransparencyPalette:k}),y===h&&i(t,{styles:b,color:C,onChange:I}),o("div",{className:P.buttonsContainer,children:[i(a,{title:"Palette",classes:{tooltip:P.tooltip},children:i(m,{"data-testid":"".concat("PaletteChromePicker","_palette"),onClick:function(){return R(u)},children:i(l,{className:e((f={},f[P.iconActive]=y===u,f)),size:24})})}),i(a,{title:"Pick your own",classes:{tooltip:P.tooltip},children:i(m,{"data-testid":"".concat("PaletteChromePicker","_pickOwn"),onClick:function(){return R(h)},children:i(d,{className:e((j={},j[P.iconActive]=y===h,j)),size:24})})})]})]})}));export{f as default};
