"use strict";var e=require('./../../../ext-esm/tslib/tslib.es6.js'),o=require("react/jsx-runtime"),s=require("react"),i=require("react-color"),n=require("classnames"),c=require("@material-ui/core"),r=require("./Palette/Palette.js"),t=require("../../IconButton/index.js"),a=require("../../../icons/iconParkIcons.js");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../icons/customIcons/icons/AddMessage.js"),require("../../../icons/customIcons/icons/Attention.js"),require("../../../icons/customIcons/icons/Collapse.js"),require("../../../icons/customIcons/icons/Dashboard.js"),require("../../../icons/customIcons/icons/Expand.js"),require("../../../icons/customIcons/icons/FolderClosed.js"),require("../../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../../icons/customIcons/icons/FolderOpened.js"),require("../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../icons/customIcons/icons/Search.js"),require("../../../icons/customIcons/icons/Wellhub.js"),require("../../../icons/customIcons/icons/MultiRuler.js"),require("../../../icons/customIcons/icons/Checkbox.js"),require("../../../icons/customIcons/icons/CheckboxChecked.js"),require("../../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../../icons/customIcons/icons/Radio.js"),require("../../../icons/customIcons/icons/RadioChecked.js"),require("../../../icons/customIcons/icons/SimulFrac.js"),require("../../../icons/customIcons/icons/ZipperFrac.js"),require("../../../icons/customIcons/icons/CautionFilled.js"),require("../../../icons/customIcons/icons/MoreApp.js");var l=u(n),d="PALETTE",p="CHROME_PICKER",m={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=c.makeStyles({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"}}),b=s.forwardRef((function(n,u){var b,h,j=n.color,q=n.onChange,f=n.onSizeChange,g=n.enableTransparencyPalette,I=x(),C=s.useState(d),k=C[0],P=C[1];return s.useLayoutEffect(f,[k]),o.jsxs("div",e.__assign({className:I.container,ref:u},{children:[k===d&&o.jsx(r,{className:I.chromePickerPalette,color:j,onChange:q,enableTransparencyPalette:g}),k===p&&o.jsx(i.ChromePicker,{styles:m,color:j,onChange:q}),o.jsxs("div",e.__assign({className:I.buttonsContainer},{children:[o.jsx(c.Tooltip,e.__assign({title:"Palette",classes:{tooltip:I.tooltip}},{children:o.jsx(t,e.__assign({"data-testid":"".concat("PaletteChromePicker","_palette"),onClick:function(){return P(d)}},{children:o.jsx(a.PaletteIcon,{className:l.default((b={},b[I.iconActive]=k===d,b)),size:24})}))})),o.jsx(c.Tooltip,e.__assign({title:"Pick your own",classes:{tooltip:I.tooltip}},{children:o.jsx(t,e.__assign({"data-testid":"".concat("PaletteChromePicker","_pickOwn"),onClick:function(){return P(p)}},{children:o.jsx(a.PickerIcon,{className:l.default((h={},h[I.iconActive]=k===p,h)),size:24})}))}))]}))]}))}));module.exports=b;
