"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require('./../../../ext-esm/tslib/tslib.es6.js'),o=require("react/jsx-runtime"),e=require("react"),c=require("react-color"),i=require("@material-ui/core"),n=require("../../../icons/iconParkIcons.js");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 r=require("./style.css.js"),u=function(u){var t=u.onChange,l=u.currentValue,a=u.defaultValue,d=void 0===a?"#FF0000":a,j=u.condensed,m=u.colors,q=void 0===m?["#FF0000","#00FF00","#0000FF"]:m,I=u.lensColor,h=void 0===I?"#fff":I,C=e.useState(!1),x=C[0],F=C[1],k=e.useState(l||d),f=k[0],p=k[1],v=function(){return t(f)};return o.jsxs("div",s.__assign({className:r.colorEditor},{children:[o.jsx(i.Button,s.__assign({variant:"contained",color:"primary",onClick:function(){return F(!0)},className:r.button,style:{backgroundColor:f,color:h},size:"small"},{children:o.jsx(n.PaletteIcon,{size:16})})),x&&o.jsx(i.ClickAwayListener,s.__assign({mouseEvent:"onMouseDown",touchEvent:"onTouchStart",onClickAway:function(){F(!1),v()}},{children:o.jsx("div",s.__assign({className:r.colorEditorPickerContainer},{children:j?o.jsx(c.GithubPicker,{color:f,onChange:function(s){p(s.hex),F(!1),v()},colors:q,triangle:"hide"}):o.jsx(c.ChromePicker,{color:f,onChange:function(s){p(s.hex),v()}})}))}))]}))};exports.ColorEditor=u,exports.default=u;
