import{jsx as r}from"react/jsx-runtime";import{useRef as o}from"react";import{makeStyles as e,Popover as n}from"@material-ui/core";import t from"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";var a={rgba:function(r){return"rgba(".concat(r.rgb.r,", ").concat(r.rgb.g,", ").concat(r.rgb.b,", ").concat(r.rgb.a,")")},rgb:function(r){return"rgb(".concat(r.rgb.r,", ").concat(r.rgb.g,", ").concat(r.rgb.b,")")},hex:function(r){return r.hex},rgba_rgb:function(r){return 1===r.rgb.a?a.rgb(r):a.rgba(r)},rgba_hex:function(r){return 1===r.rgb.a?a.hex(r):a.rgba(r)}},i=e({root:{position:"relative",display:"flex"},popper:{zIndex:1500},topLabel:{marginBottom:"8px",fontSize:"15px",lineHeight:"17px",letterSpacing:"0.4px",color:"#BDBDBD",whiteSpace:"nowrap"},rightLabel:{marginLeft:"8px",fontSize:"16px"}}),c=function(e){var c=e.color,l=e.onChange,g=e.anchorEl,p=void 0===g?null:g,b=e.handleClose,h=e.converter,f=void 0===h?"rgba_hex":h,u=e.popoverAnchorOrigin,m=void 0===u?{vertical:"bottom",horizontal:"left"}:u,v=e.popoverTransformOrigin,d=void 0===v?{vertical:"top",horizontal:"left"}:v,s=e.pickerComponent,x=void 0===s?t:s,C=e.enableTransparencyPalette,P=void 0!==C&&C,z=i(),B=o();return r("div",{className:z.root,children:r(n,{id:"colors-popper",action:B,open:Boolean(p),anchorEl:p,onClose:b,anchorOrigin:m,transformOrigin:d,children:r(x,{color:c,onChange:function(r){var o=a[f](r);l(o)},onSizeChange:function(){B.current&&B.current.updatePosition()},enableTransparencyPalette:P})})})};export{c as default};
