import{__assign as r}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as o}from"react/jsx-runtime";import{useRef as e}from"react";import{withStyles as n,Popover as t}from"@material-ui/core";import a from"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";var i={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?i.rgb(r):i.rgba(r)},rgba_hex:function(r){return 1===r.rgb.a?i.hex(r):i.rgba(r)}},c=function(n){var a=n.color,c=n.onChange,l=n.anchorEl,p=n.handleClose,g=n.converter,b=n.popoverAnchorOrigin,s=n.popoverTransformOrigin,m=n.pickerComponent,f=n.classes,h=n.enableTransparencyPalette,u=e();return o("div",r({className:f.root},{children:o(t,r({id:"colors-popper",action:u,open:Boolean(l),anchorEl:l,onClose:p,anchorOrigin:b,transformOrigin:s},{children:o(m,{color:a,onChange:function(r){var o=i[g](r);c(o)},onSizeChange:function(){u.current&&u.current.updatePosition()},enableTransparencyPalette:h})}))}))};c.defaultProps={converter:"rgba_hex",pickerComponent:a,popoverAnchorOrigin:{vertical:"bottom",horizontal:"left"},popoverTransformOrigin:{vertical:"top",horizontal:"left"},enableTransparencyPalette:!1,anchorEl:null};var l=n({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);export{l as default};
