(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[5613],{101414:e=>{e.exports={button:"button-D4RPB3ZC",content:"content-D4RPB3ZC","icon-only":"icon-only-D4RPB3ZC",link:"link-D4RPB3ZC","color-brand":"color-brand-D4RPB3ZC","variant-primary":"variant-primary-D4RPB3ZC","variant-secondary":"variant-secondary-D4RPB3ZC","color-gray":"color-gray-D4RPB3ZC","color-green":"color-green-D4RPB3ZC","color-red":"color-red-D4RPB3ZC","color-black":"color-black-D4RPB3ZC","color-black-friday":"color-black-friday-D4RPB3ZC","color-cyber-monday":"color-cyber-monday-D4RPB3ZC","size-xsmall":"size-xsmall-D4RPB3ZC","start-icon-wrap":"start-icon-wrap-D4RPB3ZC","end-icon-wrap":"end-icon-wrap-D4RPB3ZC","with-start-icon":"with-start-icon-D4RPB3ZC","with-end-icon":"with-end-icon-D4RPB3ZC","size-small":"size-small-D4RPB3ZC","size-medium":"size-medium-D4RPB3ZC","size-large":"size-large-D4RPB3ZC","size-xlarge":"size-xlarge-D4RPB3ZC",animated:"animated-D4RPB3ZC",stretch:"stretch-D4RPB3ZC",grouped:"grouped-D4RPB3ZC","adjust-position":"adjust-position-D4RPB3ZC","first-row":"first-row-D4RPB3ZC","first-col":"first-col-D4RPB3ZC","no-corner-top-left":"no-corner-top-left-D4RPB3ZC","no-corner-top-right":"no-corner-top-right-D4RPB3ZC","no-corner-bottom-right":"no-corner-bottom-right-D4RPB3ZC","no-corner-bottom-left":"no-corner-bottom-left-D4RPB3ZC","text-wrap":"text-wrap-D4RPB3ZC","multiline-content":"multiline-content-D4RPB3ZC","secondary-text":"secondary-text-D4RPB3ZC","primary-text":"primary-text-D4RPB3ZC"}},470048:e=>{e.exports={wrapper:"wrapper-GZajBGIm",input:"input-GZajBGIm",box:"box-GZajBGIm",icon:"icon-GZajBGIm",noOutline:"noOutline-GZajBGIm","intent-danger":"intent-danger-GZajBGIm",check:"check-GZajBGIm",dot:"dot-GZajBGIm"}},993402:e=>{e.exports={container:"container-mdcOkvbj",sectionTitle:"sectionTitle-mdcOkvbj",separator:"separator-mdcOkvbj",customButton:"customButton-mdcOkvbj",accessible:"accessible-mdcOkvbj"}},580679:e=>{e.exports={container:"container-iiEYaqPD",form:"form-iiEYaqPD",swatch:"swatch-iiEYaqPD",inputWrap:"inputWrap-iiEYaqPD",inputHash:"inputHash-iiEYaqPD",input:"input-iiEYaqPD",buttonWrap:"buttonWrap-iiEYaqPD",hueSaturationWrap:"hueSaturationWrap-iiEYaqPD",saturation:"saturation-iiEYaqPD",hue:"hue-iiEYaqPD"}},901369:e=>{e.exports={hue:"hue-r4uo5Wn6",pointer:"pointer-r4uo5Wn6",accessible:"accessible-r4uo5Wn6",pointerContainer:"pointerContainer-r4uo5Wn6"}},130099:e=>{e.exports={opacity:"opacity-EnWts7Xu",opacitySlider:"opacitySlider-EnWts7Xu",opacitySliderGradient:"opacitySliderGradient-EnWts7Xu",pointer:"pointer-EnWts7Xu",dragged:"dragged-EnWts7Xu",opacityPointerWrap:"opacityPointerWrap-EnWts7Xu",opacityInputWrap:"opacityInputWrap-EnWts7Xu",opacityInput:"opacityInput-EnWts7Xu",opacityInputPercent:"opacityInputPercent-EnWts7Xu",accessible:"accessible-EnWts7Xu"}},135257:e=>{e.exports={saturation:"saturation-NFNfqP2w",pointer:"pointer-NFNfqP2w",accessible:"accessible-NFNfqP2w"}},487466:e=>{e.exports={swatches:"swatches-sfn7Lezv",swatch:"swatch-sfn7Lezv",hover:"hover-sfn7Lezv",empty:"empty-sfn7Lezv",
white:"white-sfn7Lezv",selected:"selected-sfn7Lezv",contextItem:"contextItem-sfn7Lezv",row:"row-sfn7Lezv"}},805184:(e,t,n)=>{"use strict";n.d(t,{Button:()=>l});var o=n(50959),r=n(171529);function a(e="default"){switch(e){case"default":return"primary";case"stroke":return"secondary"}}function i(e="primary"){switch(e){case"primary":return"brand";case"success":return"green";case"default":return"gray";case"danger":return"red"}}function s(e="m"){switch(e){case"s":return"xsmall";case"m":return"small";case"l":return"large"}}function c(e){const{intent:t,size:n,appearance:o,useFullWidth:r,icon:c,...l}=e;return{...l,color:i(t),size:s(n),variant:a(o),stretch:r,startIcon:c}}function l(e){return o.createElement(r.SquareButton,{...c(e)})}},171529:(e,t,n)=>{"use strict";n.d(t,{SquareButton:()=>f});var o=n(50959),r=n(497754),a=n(331774),i=n(72571),s=n(101414),c=n.n(s);const l="apply-overflow-tooltip apply-overflow-tooltip--check-children-recursively apply-overflow-tooltip--allow-text";function u(e){const{color:t="brand",size:n="medium",variant:o="primary",stretch:i=!1,icon:s,startIcon:u,endIcon:d,iconOnly:h=!1,className:m,isGrouped:p,cellState:v,disablePositionAdjustment:f=!1,primaryText:E,secondaryText:C,isAnchor:b=!1}=e,g=function(e){let t="";return 0!==e&&(1&e&&(t=r(t,c()["no-corner-top-left"])),2&e&&(t=r(t,c()["no-corner-top-right"])),4&e&&(t=r(t,c()["no-corner-bottom-right"])),8&e&&(t=r(t,c()["no-corner-bottom-left"]))),t}((0,a.getGroupCellRemoveRoundBorders)(v));return r(m,c().button,c()[`size-${n}`],c()[`color-${t}`],c()[`variant-${o}`],i&&c().stretch,(s||u)&&c()["with-start-icon"],d&&c()["with-end-icon"],h&&c()["icon-only"],g,p&&c().grouped,p&&!f&&c()["adjust-position"],p&&v.isTop&&c()["first-row"],p&&v.isLeft&&c()["first-col"],E&&C&&c()["multiline-content"],b&&c().link,l)}function d(e){const{startIcon:t,icon:n,iconOnly:a,children:s,endIcon:u,primaryText:d,secondaryText:h}=e,m=null!=t?t:n,p=!(t||n||u||a)&&!s&&d&&h;return o.createElement(o.Fragment,null,m&&o.createElement(i.Icon,{icon:m,className:c()["start-icon-wrap"]}),s&&o.createElement("span",{className:c().content},s),u&&!a&&o.createElement(i.Icon,{icon:u,className:c()["end-icon-wrap"]}),p&&function(e){return e.primaryText&&e.secondaryText&&o.createElement("div",{className:r(c()["text-wrap"],l)},o.createElement("span",{className:c()["primary-text"]}," ",e.primaryText," "),"string"==typeof e.secondaryText?o.createElement("span",{className:c()["secondary-text"]}," ",e.secondaryText," "):o.createElement("span",{className:c()["secondary-text"]},o.createElement("span",null,e.secondaryText.firstLine),o.createElement("span",null,e.secondaryText.secondLine)))}(e))}var h=n(601198),m=n(380327),p=n(800417);function v(e){const{className:t,color:n,variant:o,size:r,stretch:a,animated:i,icon:s,iconOnly:c,startIcon:l,endIcon:u,primaryText:d,secondaryText:h,...m}=e;return{...m,...(0,p.filterDataProps)(e),...(0,p.filterAriaProps)(e)}}function f(e){const{reference:t,tooltipText:n,...r}=e,{isGrouped:a,cellState:i,disablePositionAdjustment:s}=(0,o.useContext)(m.ControlGroupContext),c=u({...r,
isGrouped:a,cellState:i,disablePositionAdjustment:s});return o.createElement("button",{...v(r),className:c,ref:t,"data-overflow-tooltip-text":null!=n?n:e.primaryText?[e.primaryText,e.secondaryText].join(" "):(0,h.getTextForTooltip)(e.children)},o.createElement(d,{...r}))}},408323:(e,t,n)=>{"use strict";n.d(t,{CheckboxInput:()=>u});var o=n(50959),r=n(497754),a=n(800417),i=n(72571),s=n(465890),c=n(470048),l=n.n(c);function u(e){const t=r(l().box,l()[`intent-${e.intent}`],{[l().check]:!Boolean(e.indeterminate),[l().dot]:Boolean(e.indeterminate),[l().noOutline]:-1===e.tabIndex}),n=r(l().wrapper,e.className);return o.createElement("span",{className:n,title:e.title,style:e.style},o.createElement("input",{id:e.id,tabIndex:e.tabIndex,className:l().input,type:"checkbox",name:e.name,checked:e.checked,disabled:e.disabled,value:e.value,autoFocus:e.autoFocus,role:e.role,onChange:function(){e.onChange&&e.onChange(e.value)},ref:e.reference,"aria-required":e["aria-required"],"aria-describedby":e["aria-describedby"],"aria-invalid":e["aria-invalid"],...(0,a.filterDataProps)(e)}),o.createElement("span",{className:t},o.createElement(i.Icon,{icon:s,className:l().icon})))}},331774:(e,t,n)=>{"use strict";function o(e){let t=0;return e.isTop&&e.isLeft||(t+=1),e.isTop&&e.isRight||(t+=2),e.isBottom&&e.isLeft||(t+=8),e.isBottom&&e.isRight||(t+=4),t}n.d(t,{getGroupCellRemoveRoundBorders:()=>o})},738036:(e,t,n)=>{"use strict";n.d(t,{OutsideEvent:()=>r});var o=n(908783);function r(e){const{children:t,...n}=e;return t((0,o.useOutsideEvent)(n))}},865266:(e,t,n)=>{"use strict";n.d(t,{useRovingTabindexElement:()=>i});var o=n(50959),r=n(718736),a=n(892932);function i(e,t=[]){const[n,i]=(0,o.useState)(!1),s=(0,r.useFunctionalRefObject)(e);return(0,o.useLayoutEffect)((()=>{if(!a.PLATFORM_ACCESSIBILITY_ENABLED)return;const e=s.current;if(null===e)return;const t=e=>{switch(e.type){case"roving-tabindex:main-element":i(!0);break;case"roving-tabindex:secondary-element":i(!1)}};return e.addEventListener("roving-tabindex:main-element",t),e.addEventListener("roving-tabindex:secondary-element",t),()=>{e.removeEventListener("roving-tabindex:main-element",t),e.removeEventListener("roving-tabindex:secondary-element",t)}}),t),[s,a.PLATFORM_ACCESSIBILITY_ENABLED?n?0:-1:void 0]}},578601:(e,t,n)=>{"use strict";n.d(t,{useRowsNavigation:()=>l});var o=n(50959),r=n(650151),a=n(892932),i=n(180185),s=n(27164);const c=[37,39,38,40];function l(e){const t=(0,o.useRef)(null);return(0,o.useLayoutEffect)((()=>{if(!a.PLATFORM_ACCESSIBILITY_ENABLED)return;const e=(0,r.ensureNotNull)(t.current),n=()=>{const n=(0,a.queryTabbableElements)(e).sort(a.navigationOrderComparator);if(0===n.length||n[0].parentElement&&!h(n[0].parentElement,(0,r.ensureNotNull)(t.current))){const o=function(e){const n=d(e).sort(a.navigationOrderComparator).find((e=>h(e,(0,r.ensureNotNull)(t.current))));if(!n)return null;const o=Array.from(n.children);if(!o.length)return null;return o[0]}(e);if(null===o)return;if((0,s.becomeMainElement)(o),n.length>0)for(const e of n)(0,s.becomeSecondaryElement)(e)}}
;return window.addEventListener("keyboard-navigation-activation",n),n(),()=>window.removeEventListener("keyboard-navigation-activation",n)}),[]),[t,function(t){if(!a.PLATFORM_ACCESSIBILITY_ENABLED)return;if(t.defaultPrevented)return;const n=(0,i.hashFromEvent)(t);if(!c.includes(n))return;const o=document.activeElement;if(!(o instanceof HTMLElement))return;const r=t.currentTarget;let s,l;if(e){const e=o.parentElement;s=e?Array.from(e.children):[],l=s.indexOf(o)}else s=(h=r,Array.from(h.querySelectorAll("button:not([disabled]):not([aria-disabled])")).filter((0,a.createScopedVisibleElementFilter)(h))).sort(a.navigationOrderComparator),l=s.indexOf(o);var h;if(0===s.length||-1===l)return;const p=(0,a.mapKeyCodeToDirection)(n);switch(p){case"inlinePrev":if(t.preventDefault(),!e&&0===l)break;m(u(s,l,-1));break;case"inlineNext":if(t.preventDefault(),!e&&l===s.length-1)break;m(u(s,l,1));break;case"blockPrev":case"blockNext":(n=>{if(!document.activeElement)return;const o=d(r),a=document.activeElement.parentElement;if(!a)return;const i=Array.from(a.children).indexOf(document.activeElement);if(-1===i)return;const s=o["blockNext"===n?o.indexOf(a)+1:o.indexOf(a)-1];if(!s)return;t.preventDefault();const c=Array.from(s.children);c.length&&(!e&&i<=c.length-1?m(c[i]):m(c[0]))})(p)}}]}function u(e,t,n){return e[(t+e.length+n)%e.length]}function d(e){return Array.from(e.querySelectorAll('[data-role="row"]')).filter((0,a.createScopedVisibleElementFilter)(e))}function h(e,t){const n=(0,r.ensureNotNull)(e.parentElement).offsetTop,o=n+(0,r.ensureNotNull)(e.parentElement).clientHeight,a=t.scrollTop,i=a+t.clientHeight;return n>=a&&o<=i}function m(e){document.activeElement&&(0,s.becomeSecondaryElement)(document.activeElement),(0,s.becomeMainElement)(e),e.focus()}},972646:(e,t,n)=>{"use strict";n.d(t,{ColorPicker:()=>j});var o=n(50959),r=n(497754),a=n.n(r),i=n(609838),s=n(892932),c=n(578601),l=n(43688),u=n(793532),d=n(745582),h=Math.ceil,m=Math.max;const p=function(e,t,n){t=(n?(0,u.default)(e,t,n):void 0===t)?1:m((0,d.default)(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var r=0,a=0,i=Array(h(o/t));r<o;)i[a++]=(0,l.default)(e,r,r+=t);return i};var v=n(724377),f=n(650151),E=n(601227),C=n(624216),b=n(192063),g=n(860184),y=n(865266),_=n(535149),w=n(487466);function P(e){const{color:t,selected:a,onSelect:c,onSwatchRemove:l}=e,[u,d]=(0,o.useState)(!1),[h,m]=(0,y.useRovingTabindexElement)(null),p=Boolean(l)&&!E.CheckMobile.any();return o.createElement(o.Fragment,null,o.createElement("button",{ref:h,style:t?{color:t}:void 0,className:r(w.swatch,s.PLATFORM_ACCESSIBILITY_ENABLED&&w.accessible,u&&w.hover,a&&w.selected,!t&&w.empty,String(t).toLowerCase()===g.white&&w.white),onClick:function(){c(t)},onContextMenu:p?v:void 0,tabIndex:m,"data-role":"swatch"}),p&&o.createElement(C.PopupMenu,{isOpened:u,onClose:v,position:function(){const e=(0,f.ensureNotNull)(h.current).getBoundingClientRect();return{x:e.left,y:e.top+e.height+4}},onClickOutside:v},o.createElement(b.PopupMenuItem,{className:w.contextItem,label:i.t(null,void 0,n(854336)),icon:_,
onClick:function(){v(),(0,f.ensureDefined)(l)()},dontClosePopup:!0})));function v(){d(!u)}}function N(e){const{colors:t,color:n,children:r,onSelect:a,onRemoveCustomColor:i}=e;if(!t)return null;const s=n?(0,v.parseRgb)(String(n)):void 0,c=p(t,10);return o.createElement("div",{className:w.swatches},c.map(((e,t)=>o.createElement("div",{className:w.row,"data-role":"row",key:t},e.map(((e,n)=>o.createElement(P,{key:String(e)+n,color:e,selected:s&&(0,v.areEqualRgb)(s,(0,v.parseRgb)(String(e))),onSelect:l,onSwatchRemove:i?()=>function(e,t){const n=10*e+t;null==i||i(n)}(t,n):void 0})))))),r);function l(e){a&&a(e)}}var x=n(939075),S=n(805184);function D(e){const t=`Invalid RGB color: ${e}`;if(null===e)throw new Error(t);const n=e.match(/^#?([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i);if(null===n)throw new Error(t);const[,o,r,a]=n;if(!o||!r||!a)throw new Error(t);const i=parseInt(o,16)/255,s=parseInt(r,16)/255,c=parseInt(a,16)/255,l=Math.max(i,s,c),u=Math.min(i,s,c);let d;const h=l,m=l-u,p=0===l?0:m/l;if(l===u)d=0;else{switch(l){case i:d=(s-c)/m+(s<c?6:0);break;case s:d=(c-i)/m+2;break;case c:d=(i-s)/m+4;break;default:d=0}d/=6}return{h:d,s:p,v:h}}var B=n(343370),I=n(180185),R=n(44681),T=n(135257);const L=[37,39,38,40],k=.01;class A extends o.PureComponent{constructor(){super(...arguments),this._container=null,this._refContainer=e=>{this._container=e},this._handlePosition=e=>{const{hsv:{h:t},onChange:n}=this.props;if(!n)return;const o=(0,f.ensureNotNull)(this._container).getBoundingClientRect(),r=e.clientX-o.left,a=e.clientY-o.top;n({h:t,s:(0,R.clamp)(r/o.width,0,1),v:(0,R.clamp)(1-a/o.height,0,1)})},this._handleKeyDown=e=>{const{hsv:{h:t,s:n,v:o},onChange:r}=this.props,a=(0,I.hashFromEvent)(e);if(!r||!L.includes(a))return;if(37===a||39===a){return void r({h:t,s:(0,R.clamp)(37===a?n-k:n+k,0,1),v:o})}r({h:t,s:n,v:(0,R.clamp)(40===a?o-k:o+k,0,1)})},this._mouseDown=e=>{window.addEventListener("mouseup",this._mouseUp),window.addEventListener("mousemove",this._mouseMove)},this._mouseUp=e=>{window.removeEventListener("mousemove",this._mouseMove),window.removeEventListener("mouseup",this._mouseUp),this._handlePosition(e)},this._mouseMove=(0,B.default)(this._handlePosition,100),this._handleTouch=e=>{this._handlePosition(e.nativeEvent.touches[0])}}render(){const{className:e,hsv:{h:t,s:n,v:r}}=this.props,i=`hsl(${360*t}, 100%, 50%)`;return o.createElement("div",{tabIndex:s.PLATFORM_ACCESSIBILITY_ENABLED?0:-1,className:a()(s.PLATFORM_ACCESSIBILITY_ENABLED&&T.accessible,e),onKeyDown:this._handleKeyDown},o.createElement("div",{className:T.saturation,style:{backgroundColor:i},ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},o.createElement("div",{className:T.pointer,style:{left:100*n+"%",top:100*(1-r)+"%"}})))}}var O=n(901369);class M extends o.PureComponent{constructor(){super(...arguments),this._container=null,this._refContainer=e=>{this._container=e},this._handlePosition=e=>{const{hsv:{s:t,v:n},onChange:o}=this.props;if(!o)return;const r=(0,
f.ensureNotNull)(this._container).getBoundingClientRect(),a=e.clientY-r.top;o({h:(0,R.clamp)(a/r.height,0,1),s:t,v:n})},this._handleKeyDown=e=>{const{hsv:{h:t,s:n,v:o},onChange:r}=this.props,a=(0,I.hashFromEvent)(e);if(!r||38!==a&&40!==a)return;r({h:(0,R.clamp)(38===a?t-.01:t+.01,0,1),s:n,v:o})},this._mouseDown=e=>{window.addEventListener("mouseup",this._mouseUp),window.addEventListener("mousemove",this._mouseMove)},this._mouseUp=e=>{window.removeEventListener("mousemove",this._mouseMove),window.removeEventListener("mouseup",this._mouseUp),this._handlePosition(e)},this._mouseMove=(0,B.default)(this._handlePosition,100),this._handleTouch=e=>{this._handlePosition(e.nativeEvent.touches[0])}}render(){const{className:e,hsv:{h:t}}=this.props;return o.createElement("div",{className:a()(O.hue,s.PLATFORM_ACCESSIBILITY_ENABLED&&O.accessible,e),tabIndex:s.PLATFORM_ACCESSIBILITY_ENABLED?0:-1,onKeyDown:this._handleKeyDown},o.createElement("div",{className:O.pointerContainer,ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},o.createElement("div",{className:O.pointer,style:{top:100*t+"%"}})))}}var Z=n(580679);const F="#000000",W=i.t(null,{context:"Color Picker"},n(340276));class G extends o.PureComponent{constructor(e){super(e),this._inputRef=o.createRef(),this._handleHSV=e=>{const t=function(e){const{h:t,s:n,v:o}=e;let r,a,i;const s=Math.floor(6*t),c=6*t-s,l=o*(1-n),u=o*(1-c*n),d=o*(1-(1-c)*n);switch(s%6){case 0:r=o,a=d,i=l;break;case 1:r=u,a=o,i=l;break;case 2:r=l,a=o,i=d;break;case 3:r=l,a=u,i=o;break;case 4:r=d,a=l,i=o;break;case 5:r=o,a=l,i=u;break;default:r=0,a=0,i=0}return"#"+[255*r,255*a,255*i].map((e=>("0"+Math.round(e).toString(16)).replace(/.+?([a-f0-9]{2})$/i,"$1"))).join("")}(e)||F;this.setState({color:t,inputColor:t.replace(/^#/,""),hsv:e}),this.props.onSelect(t)},this._handleInput=e=>{const t=e.currentTarget.value;try{const e=D(t),n=`#${t}`;this.setState({color:n,inputColor:t,hsv:e}),this.props.onSelect(n)}catch(e){this.setState({inputColor:t})}},this._handleAddColor=()=>this.props.onAdd(this.state.color);const t=e.color||F;this.state={color:t,inputColor:t.replace(/^#/,""),hsv:D(t)}}componentDidMount(){var e;s.PLATFORM_ACCESSIBILITY_ENABLED&&!E.CheckMobile.any()&&(null===(e=this._inputRef.current)||void 0===e||e.focus())}render(){const{color:e,hsv:t,inputColor:n}=this.state;return o.createElement("div",{className:Z.container},o.createElement("div",{className:Z.form},o.createElement("div",{className:Z.swatch,style:{backgroundColor:e}}),o.createElement("div",{className:Z.inputWrap},o.createElement("span",{className:Z.inputHash},"#"),o.createElement("input",{ref:this._inputRef,type:"text",className:Z.input,value:n,onChange:this._handleInput})),o.createElement("div",{className:Z.buttonWrap},o.createElement(S.Button,{size:"s",onClick:this._handleAddColor},W))),o.createElement("div",{className:Z.hueSaturationWrap},o.createElement(A,{className:Z.saturation,hsv:t,onChange:this._handleHSV}),o.createElement(M,{className:Z.hue,hsv:t,onChange:this._handleHSV})))}}
var z=n(993402);const Y=i.t(null,{context:"Color Picker"},n(453585)),q=i.t(null,{context:"Color Picker"},n(681865));function j(e){const{color:t,opacity:n,selectCustom:r,selectOpacity:i,customColors:l,onRemoveCustomColor:u,onToggleCustom:d,onOpacityChange:h,menu:m}=e,[p,v]=(0,o.useState)(!1),f="number"==typeof n?n:1,[E,C]=(0,c.useRowsNavigation)();return(0,o.useLayoutEffect)((()=>{m&&m.update()}),[i,m]),p?o.createElement(G,{color:t,onSelect:b,onAdd:function(t){v(!1),null==d||d(!1);const{onAddColor:n}=e;n&&n(t)}}):o.createElement("div",{className:z.container},o.createElement("div",{ref:E,onKeyDown:C},o.createElement(N,{colors:g.basic,color:t,onSelect:b}),o.createElement(N,{colors:g.extended,color:t,onSelect:b}),o.createElement("div",{className:z.separator}),o.createElement(N,{colors:l,color:t,onSelect:b,onRemoveCustomColor:u},r&&o.createElement(o.Fragment,null,s.PLATFORM_ACCESSIBILITY_ENABLED?(null==l?void 0:l.length)?o.createElement("button",{title:Y,onClick:y,className:a()(z.customButton,z.accessible,"apply-common-tooltip"),tabIndex:-1}):o.createElement("div",{"data-role":"row"},o.createElement("button",{title:Y,onClick:y,className:a()(z.customButton,z.accessible,"apply-common-tooltip"),tabIndex:-1})):o.createElement("div",{className:a()(z.customButton,"apply-common-tooltip"),onClick:y,title:Y,tabIndex:-1})))),i&&o.createElement(o.Fragment,null,o.createElement("div",{className:z.sectionTitle},q),o.createElement(x.Opacity,{color:t,opacity:f,onChange:function(e){h&&h(e)}})));function b(t){const{onColorChange:n}=e;n&&n(t,p)}function y(e){v(!0),null==d||d(!0)}}},939075:(e,t,n)=>{"use strict";n.d(t,{Opacity:()=>u});var o=n(50959),r=n(497754),a=n(650151),i=n(44681),s=n(180185),c=n(892932),l=n(130099);class u extends o.PureComponent{constructor(e){super(e),this._container=null,this._pointer=null,this._raf=null,this._refContainer=e=>{this._container=e},this._refPointer=e=>{this._pointer=e},this._handlePosition=e=>{null===this._raf&&(this._raf=requestAnimationFrame((()=>{const t=(0,a.ensureNotNull)(this._container),n=(0,a.ensureNotNull)(this._pointer),o=t.getBoundingClientRect(),r=n.offsetWidth,s=e.clientX-r/2-o.left,c=(0,i.clamp)(s/(o.width-r),0,1);this.setState({inputOpacity:Math.round(100*c).toString()}),this.props.onChange(c),this._raf=null})))},this._onSliderClick=e=>{this._handlePosition(e.nativeEvent),this._dragSubscribe()},this._mouseUp=e=>{this.setState({isPointerDragged:!1}),this._dragUnsubscribe(),this._handlePosition(e)},this._mouseMove=e=>{this.setState({isPointerDragged:!0}),this._handlePosition(e)},this._onTouchStart=e=>{this._handlePosition(e.nativeEvent.touches[0])},this._handleTouch=e=>{this.setState({isPointerDragged:!0}),this._handlePosition(e.nativeEvent.touches[0])},this._handleTouchEnd=()=>{this.setState({isPointerDragged:!1})},this._handleInput=e=>{const t=e.currentTarget.value,n=Number(t)/100;this.setState({inputOpacity:t}),Number.isNaN(n)||n>1||this.props.onChange(n)},this._handleKeyDown=e=>{const t=(0,s.hashFromEvent)(e);if(37!==t&&39!==t)return;e.preventDefault()
;const n=Number(this.state.inputOpacity);37===t&&0!==n&&this._changeOpacity(n-1),39===t&&100!==n&&this._changeOpacity(n+1)},this.state={inputOpacity:Math.round(100*e.opacity).toString(),isPointerDragged:!1}}componentWillUnmount(){null!==this._raf&&(cancelAnimationFrame(this._raf),this._raf=null),this._dragUnsubscribe()}render(){const{color:e,opacity:t,hideInput:n,disabled:a}=this.props,{inputOpacity:i,isPointerDragged:s}=this.state,u={color:e||void 0};return o.createElement("div",{className:l.opacity},o.createElement("div",{className:r(l.opacitySlider,c.PLATFORM_ACCESSIBILITY_ENABLED&&l.accessible),style:u,tabIndex:c.PLATFORM_ACCESSIBILITY_ENABLED&&!a?0:-1,ref:this._refContainer,onMouseDown:this._onSliderClick,onTouchStart:this._onTouchStart,onTouchMove:this._handleTouch,onTouchEnd:this._handleTouchEnd,onKeyDown:this._handleKeyDown,"aria-disabled":a},o.createElement("div",{className:l.opacitySliderGradient,style:{backgroundImage:`linear-gradient(90deg, transparent, ${e})`}}),o.createElement("div",{className:l.opacityPointerWrap},o.createElement("div",{className:r(l.pointer,s&&l.dragged),style:{left:100*t+"%"},ref:this._refPointer}))),!n&&o.createElement("div",{className:l.opacityInputWrap},o.createElement("input",{type:"text",className:l.opacityInput,value:i,onChange:this._handleInput}),o.createElement("span",{className:l.opacityInputPercent},"%")))}_dragSubscribe(){const e=(0,a.ensureNotNull)(this._container).ownerDocument;e&&(e.addEventListener("mouseup",this._mouseUp),e.addEventListener("mousemove",this._mouseMove))}_dragUnsubscribe(){const e=(0,a.ensureNotNull)(this._container).ownerDocument;e&&(e.removeEventListener("mousemove",this._mouseMove),e.removeEventListener("mouseup",this._mouseUp))}_changeOpacity(e){this.setState({inputOpacity:e.toString()}),this.props.onChange(e/100)}}},860184:(e,t,n)=>{"use strict";n.d(t,{basic:()=>s,extended:()=>l,white:()=>r});var o=n(149962);const r=o.colorsPalette["color-white"],a=["ripe-red","tan-orange","banana-yellow","iguana-green","minty-green","sky-blue","tv-blue","deep-blue","grapes-purple","berry-pink"],i=[200,300,400,500,600,700,800,900].map((e=>`color-cold-gray-${e}`));i.unshift("color-white"),i.push("color-black"),a.forEach((e=>{i.push(`color-${e}-500`)}));const s=i.map((e=>o.colorsPalette[e])),c=[];[100,200,300,400,700,900].forEach((e=>{a.forEach((t=>{c.push(`color-${t}-${e}`)}))}));const l=c.map((e=>o.colorsPalette[e]))},206397:(e,t,n)=>{"use strict";n.d(t,{useCustomColors:()=>c});var o=n(50959),r=n(870122),a=n(559410);function i(e,t){(0,o.useEffect)((()=>(a.subscribe(e,t,null),()=>{a.unsubscribe(e,t,null)})),[e,t])}var s=n(724377);function c(){const[e,t]=(0,o.useState)((0,r.getJSON)("pickerCustomColors",[]));i("add_new_custom_color",(n=>t(l(n,e)))),i("remove_custom_color",(n=>t(u(n,e))));const n=(0,o.useCallback)((t=>{const n=t?(0,s.parseRgb)(t):null;e.some((e=>null!==e&&null!==n&&(0,s.areEqualRgb)((0,s.parseRgb)(e),n)))||(a.emit("add_new_custom_color",t),(0,r.setJSON)("pickerCustomColors",l(t,e)))}),[e]),c=(0,o.useCallback)((t=>{
(t>=0||t<e.length)&&(a.emit("remove_custom_color",t),(0,r.setJSON)("pickerCustomColors",u(t,e)))}),[e]);return[e,n,c]}function l(e,t){const n=t.slice();return n.push(e),n.length>29&&n.shift(),n}function u(e,t){return t.filter(((t,n)=>e!==n))}},874485:(e,t,n)=>{"use strict";n.d(t,{makeOverlapable:()=>a});var o=n(50959),r=n(813113);function a(e){return class extends o.PureComponent{render(){const{isOpened:t,root:n}=this.props;if(!t)return null;const a=o.createElement(e,{...this.props,zIndex:150});return"parent"===n?a:o.createElement(r.Portal,null,a)}}}},27164:(e,t,n)=>{"use strict";function o(e){e.dispatchEvent(new CustomEvent("roving-tabindex:main-element"))}function r(e){e.dispatchEvent(new CustomEvent("roving-tabindex:secondary-element"))}n.d(t,{becomeMainElement:()=>o,becomeSecondaryElement:()=>r})},465890:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11" height="9" fill="none"><path stroke-width="2" d="M0.999878 4L3.99988 7L9.99988 1"/></svg>'}}]);