(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[4891],{37593:e=>{e.exports={wrapper:"wrapper-5Xd5conM",input:"input-5Xd5conM",box:"box-5Xd5conM",icon:"icon-5Xd5conM",noOutline:"noOutline-5Xd5conM","intent-danger":"intent-danger-5Xd5conM",check:"check-5Xd5conM",dot:"dot-5Xd5conM"}},96670:e=>{e.exports={checkbox:"checkbox-GxG6nBa7",reverse:"reverse-GxG6nBa7",label:"label-GxG6nBa7",baseline:"baseline-GxG6nBa7"}},12857:e=>{e.exports={"textarea-container":"textarea-container-I5L4qQPj","change-highlight":"change-highlight-I5L4qQPj",focused:"focused-I5L4qQPj","resize-vertical":"resize-vertical-I5L4qQPj","resize-horizontal":"resize-horizontal-I5L4qQPj","resize-both":"resize-both-I5L4qQPj",textarea:"textarea-I5L4qQPj"}},15994:e=>{e.exports={radio:"radio-vpA3AYsc",input:"input-vpA3AYsc",box:"box-vpA3AYsc",reverse:"reverse-vpA3AYsc",label:"label-vpA3AYsc",wrapper:"wrapper-vpA3AYsc",noOutline:"noOutline-vpA3AYsc"}},74588:e=>{e.exports={wrap:"wrap-sYKPueSl",thicknessItem:"thicknessItem-sYKPueSl",checked:"checked-sYKPueSl",radio:"radio-sYKPueSl",bar:"bar-sYKPueSl"}},9198:e=>{e.exports={innerLabel:"innerLabel-MS9pjVpT"}},44712:e=>{e.exports={controlWrapper:"controlWrapper-y2rn9wiU",hidden:"hidden-y2rn9wiU",control:"control-y2rn9wiU",controlIncrease:"controlIncrease-y2rn9wiU",controlDecrease:"controlDecrease-y2rn9wiU",controlIcon:"controlIcon-y2rn9wiU",title:"title-y2rn9wiU"}},16300:e=>{e.exports={titleWrap:"titleWrap-ZYQL0yaM",groupFooter:"groupFooter-ZYQL0yaM"}},23128:e=>{e.exports={inlineRow:"inlineRow-CqPNtHDN"}},70199:e=>{e.exports={icon:"icon-OTC0ma9h"}},6041:e=>{e.exports={input:"input-pBN3Orju",symbol:"symbol-pBN3Orju",checkbox:"checkbox-pBN3Orju",label:"label-pBN3Orju",dropdownMenu:"dropdownMenu-pBN3Orju",sessionStart:"sessionStart-pBN3Orju",sessionEnd:"sessionEnd-pBN3Orju",sessionInputContainer:"sessionInputContainer-pBN3Orju",sessionDash:"sessionDash-pBN3Orju",inputGroup:"inputGroup-pBN3Orju",textarea:"textarea-pBN3Orju",inlineGroup:"inlineGroup-pBN3Orju",hasTooltip:"hasTooltip-pBN3Orju"}},46828:e=>{e.exports={content:"content-ByXdMGQj",cell:"cell-ByXdMGQj",inner:"inner-ByXdMGQj",first:"first-ByXdMGQj",inlineCell:"inlineCell-ByXdMGQj",fill:"fill-ByXdMGQj",top:"top-ByXdMGQj",topCenter:"topCenter-ByXdMGQj",offset:"offset-ByXdMGQj",inlineRow:"inlineRow-ByXdMGQj",grouped:"grouped-ByXdMGQj",separator:"separator-ByXdMGQj",groupSeparator:"groupSeparator-ByXdMGQj",big:"big-ByXdMGQj",adaptive:"adaptive-ByXdMGQj",checkableTitle:"checkableTitle-ByXdMGQj"}},300:e=>{e.exports={wrap:"wrap-l3G0HrB9",labelWrap:"labelWrap-l3G0HrB9",label:"label-l3G0HrB9",hasTooltip:"hasTooltip-l3G0HrB9"}},55914:e=>{e.exports={wrap:"wrap-GsOqvniR",icon:"icon-GsOqvniR",text:"text-GsOqvniR",disabled:"disabled-GsOqvniR"}},14348:e=>{e.exports={colorPickerWrap:"colorPickerWrap-pz6IRAmC",focused:"focused-pz6IRAmC",readonly:"readonly-pz6IRAmC",disabled:"disabled-pz6IRAmC","size-small":"size-small-pz6IRAmC","size-medium":"size-medium-pz6IRAmC","size-large":"size-large-pz6IRAmC","font-size-small":"font-size-small-pz6IRAmC",
"font-size-medium":"font-size-medium-pz6IRAmC","font-size-large":"font-size-large-pz6IRAmC","border-none":"border-none-pz6IRAmC",shadow:"shadow-pz6IRAmC","border-thin":"border-thin-pz6IRAmC","border-thick":"border-thick-pz6IRAmC","intent-default":"intent-default-pz6IRAmC","intent-success":"intent-success-pz6IRAmC","intent-warning":"intent-warning-pz6IRAmC","intent-danger":"intent-danger-pz6IRAmC","intent-primary":"intent-primary-pz6IRAmC","corner-top-left":"corner-top-left-pz6IRAmC","corner-top-right":"corner-top-right-pz6IRAmC","corner-bottom-right":"corner-bottom-right-pz6IRAmC","corner-bottom-left":"corner-bottom-left-pz6IRAmC",colorPicker:"colorPicker-pz6IRAmC",swatch:"swatch-pz6IRAmC",placeholderContainer:"placeholderContainer-pz6IRAmC",placeholder:"placeholder-pz6IRAmC",mixedColor:"mixedColor-pz6IRAmC",white:"white-pz6IRAmC",opacitySwatch:"opacitySwatch-pz6IRAmC",colorLine:"colorLine-pz6IRAmC",multiWidth:"multiWidth-pz6IRAmC",line:"line-pz6IRAmC",thicknessContainer:"thicknessContainer-pz6IRAmC",thicknessTitle:"thicknessTitle-pz6IRAmC"}},83421:e=>{e.exports={thicknessContainer:"thicknessContainer-ofeynovw",thicknessTitle:"thicknessTitle-ofeynovw"}},83998:e=>{e.exports={hasTooltip:"hasTooltip-0t5K1wco",uppercase:"uppercase-0t5K1wco"}},26527:e=>{e.exports={wrap:"wrap-dHwHcgvB"}},27345:e=>{e.exports={checkbox:"checkbox-24x04noU",title:"title-24x04noU"}},51842:e=>{e.exports={titleWrap:"titleWrap-O5QDBhZc",title:"title-O5QDBhZc"}},10667:e=>{e.exports={container:"container-WiTVOllB",sectionTitle:"sectionTitle-WiTVOllB",separator:"separator-WiTVOllB",customButton:"customButton-WiTVOllB"}},99565:e=>{e.exports={container:"container-UpS01XRM",form:"form-UpS01XRM",swatch:"swatch-UpS01XRM",inputWrap:"inputWrap-UpS01XRM",inputHash:"inputHash-UpS01XRM",input:"input-UpS01XRM",buttonWrap:"buttonWrap-UpS01XRM",hueSaturationWrap:"hueSaturationWrap-UpS01XRM",saturation:"saturation-UpS01XRM",hue:"hue-UpS01XRM"}},24429:e=>{e.exports={hue:"hue-oQv2KoOx",pointer:"pointer-oQv2KoOx",pointerContainer:"pointerContainer-oQv2KoOx"}},15381:e=>{e.exports={opacity:"opacity-YL5Gjk00",opacitySlider:"opacitySlider-YL5Gjk00",opacitySliderGradient:"opacitySliderGradient-YL5Gjk00",pointer:"pointer-YL5Gjk00",dragged:"dragged-YL5Gjk00",opacityPointerWrap:"opacityPointerWrap-YL5Gjk00",opacityInputWrap:"opacityInputWrap-YL5Gjk00",opacityInput:"opacityInput-YL5Gjk00",opacityInputPercent:"opacityInputPercent-YL5Gjk00"}},88440:e=>{e.exports={saturation:"saturation-lJHGRPyu",pointer:"pointer-lJHGRPyu"}},24590:e=>{e.exports={swatches:"swatches-qgksmXjR",swatch:"swatch-qgksmXjR",hover:"hover-qgksmXjR",empty:"empty-qgksmXjR",white:"white-qgksmXjR",selected:"selected-qgksmXjR",contextItem:"contextItem-qgksmXjR"}},66230:e=>{e.exports={button:"button-h8C3IU2n","button-children":"button-children-h8C3IU2n",hiddenArrow:"hiddenArrow-h8C3IU2n",invisibleFocusHandler:"invisibleFocusHandler-h8C3IU2n"}},99171:e=>{e.exports={button:"button-1ARG85Og",disabled:"disabled-1ARG85Og",hidden:"hidden-1ARG85Og",icon:"icon-1ARG85Og",dropped:"dropped-1ARG85Og"}},79756:e=>{e.exports={
placeholder:"placeholder-fKHYe1Lk"}},84413:(e,t,n)=>{"use strict";n.d(t,{CheckboxInput:()=>c});var o=n(59496),s=n(97754),r=n(9745),a=n(49154),i=n(37593),l=n.n(i);function c(e){const t=s(l().box,l()["intent-"+e.intent],{[l().check]:!Boolean(e.indeterminate),[l().dot]:Boolean(e.indeterminate),[l().noOutline]:-1===e.tabIndex}),n=s(l().wrapper,e.className);return o.createElement("span",{className:n,title:e.title},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}),o.createElement("span",{className:t},o.createElement(r.Icon,{icon:a,className:l().icon})))}},15294:(e,t,n)=>{"use strict";n.d(t,{Checkbox:()=>c});var o=n(59496),s=n(97754),r=n(54349),a=n(84413),i=n(96670),l=n.n(i);class c extends o.PureComponent{render(){const{inputClassName:e,labelClassName:t,...n}=this.props,r=s(this.props.className,l().checkbox,{[l().reverse]:Boolean(this.props.labelPositionReverse),[l().baseline]:Boolean(this.props.labelAlignBaseline)}),i=s(l().label,t,{[l().disabled]:this.props.disabled});let c=null;return this.props.label&&(c=o.createElement("span",{className:i,title:this.props.title},this.props.label)),o.createElement("label",{className:r},o.createElement(a.CheckboxInput,{...n,className:e}),c)}}c.defaultProps={value:"on"};(0,r.makeSwitchGroupItem)(c)},2568:(e,t,n)=>{"use strict";n.d(t,{Textarea:()=>f});var o,s=n(59496),r=n(97754),a=n(66092),i=n(29202),l=n(48027),c=n(45812),u=n(47201),p=n(48907),d=n(67029),h=n(78274),m=n(12857),g=n.n(m);!function(e){e.None="none",e.Vertical="vertical",e.Horizontal="horizontal",e.Both="both"}(o||(o={}));const b=s.forwardRef((e,t)=>{const{id:n,title:o,tabIndex:a,containerTabIndex:i,role:l,inputClassName:c,autoComplete:u,autoFocus:p,cols:m,disabled:b,isFocused:v,form:C,maxLength:f,minLength:y,name:E,placeholder:S,readonly:x,required:_,rows:w,value:N,defaultValue:k,wrap:I,containerReference:T,onChange:P,onSelect:R,onFocus:B,onContainerFocus:M,onBlur:O,"aria-describedby":A,...D}=e,z={id:n,title:o,tabIndex:a,role:l,autoComplete:u,autoFocus:p,cols:m,disabled:b,form:C,maxLength:f,minLength:y,name:E,placeholder:S,readOnly:x,required:_,rows:w,value:N,defaultValue:k,wrap:I,onChange:P,onSelect:R,onFocus:B,onBlur:O,"aria-describedby":A};return s.createElement(d.ControlSkeleton,{...D,tabIndex:i,disabled:b,readonly:x,isFocused:v,ref:T,onFocus:M,middleSlot:s.createElement(h.MiddleSlot,null,s.createElement("textarea",{...z,className:r(g().textarea,c),ref:t}))})});b.displayName="TextareaView";const v=(e,t,n)=>t?void 0:e?-1:n,C=(e,t,n)=>t?void 0:e?n:-1,f=s.forwardRef((e,t)=>{e=(0,l.useControl)(e);const{className:n,disabled:d,autoSelectOnFocus:h,tabIndex:m=0,borderStyle:f,highlight:y,resize:E,containerReference:S=null,onFocus:x,onBlur:_,...w}=e,N=(0,s.useRef)(null),k=(0,s.useRef)(null),{isMouseDown:I,handleMouseDown:T,handleMouseUp:P}=(0,c.useIsMouseDown)(),[R,B]=(0,i.useFocus)(),M=(0,
u.createSafeMulticastEventHandler)(B.onFocus,(function(e){h&&!I.current&&(0,p.selectAllContent)(e.currentTarget)}),x),O=(0,u.createSafeMulticastEventHandler)(B.onBlur,_),A=void 0!==E&&E!==o.None,D=null!=f?f:A?y?"thick":"thin":void 0,z=null!=y?y:!A&&void 0;return s.createElement(b,{...w,className:r(g()["textarea-container"],A&&g()["change-highlight"],E&&E!==o.None&&g()["resize-"+E],R&&g().focused,n),disabled:d,isFocused:R,containerTabIndex:v(R,d,m),tabIndex:C(R,d,m),borderStyle:D,highlight:z,onContainerFocus:function(e){k.current===e.target&&null!==N.current&&N.current.focus()},onFocus:M,onBlur:O,onMouseDown:T,onMouseUp:P,ref:function(e){N.current=e,"function"==typeof t?t(e):t&&(t.current=e)},containerReference:(0,a.useMergedRefs)([S,k])})});f.displayName="Textarea"},54349:(e,t,n)=>{"use strict";n.d(t,{SwitchGroup:()=>r,makeSwitchGroupItem:()=>a});var o=n(59496),s=n(19036);class r extends o.PureComponent{constructor(){super(...arguments),this._subscriptions=new Set,this._getName=()=>this.props.name,this._getValues=()=>this.props.values,this._getOnChange=()=>this.props.onChange,this._subscribe=e=>{this._subscriptions.add(e)},this._unsubscribe=e=>{this._subscriptions.delete(e)}}getChildContext(){return{switchGroupContext:{getName:this._getName,getValues:this._getValues,getOnChange:this._getOnChange,subscribe:this._subscribe,unsubscribe:this._unsubscribe}}}render(){return this.props.children}componentDidUpdate(e){this._notify(this._getUpdates(this.props.values,e.values))}_notify(e){this._subscriptions.forEach(t=>t(e))}_getUpdates(e,t){return[...t,...e].filter(n=>t.includes(n)?!e.includes(n):e.includes(n))}}function a(e){var t;return(t=class extends o.PureComponent{constructor(){super(...arguments),this._onChange=e=>{this.context.switchGroupContext.getOnChange()(e)},this._onUpdate=e=>{e.includes(this.props.value)&&this.forceUpdate()}}componentDidMount(){this.context.switchGroupContext.subscribe(this._onUpdate)}render(){return o.createElement(e,{...this.props,name:this._getName(),onChange:this._onChange,checked:this._isChecked()})}componentWillUnmount(){this.context.switchGroupContext.unsubscribe(this._onUpdate)}_getName(){return this.context.switchGroupContext.getName()}_isChecked(){return this.context.switchGroupContext.getValues().includes(this.props.value)}}).contextTypes={switchGroupContext:s.any.isRequired},t}r.childContextTypes={switchGroupContext:s.any.isRequired}},22064:(e,t,n)=>{"use strict";n.d(t,{createDomId:()=>l,joinDomIds:()=>c});const o=/\s/g;function s(e){return"string"==typeof e}function r(e){switch(typeof e){case"string":return e;case"number":case"bigint":return e.toString(10);case"boolean":case"symbol":return e.toString();default:return null}}function a(e){return e.trim().length>0}function i(e){return e.replace(o,"-")}function l(...e){const t=e.map(r).filter(s).filter(a).map(i);return(t.length>0&&t[0].startsWith("id_")?t:["id",...t]).join("_")}function c(...e){return e.map(r).filter(s).filter(a).join(" ")}},92399:(e,t,n)=>{"use strict";n.d(t,{NumberInputView:()=>N})
;var o=n(59496),s=n(32563),r=n(97754),a=n(67029),i=n(78274),l=n(86623),c=n(84275),u=n(1405),p=n(9198);const d={large:a.InputClasses.FontSizeLarge,medium:a.InputClasses.FontSizeMedium},h={attachment:u.anchors.top.attachment,targetAttachment:u.anchors.top.targetAttachment,attachmentOffsetY:-4};function m(e){const{className:t,inputClassName:n,stretch:s=!0,errorMessage:a,fontSizeStyle:u="large",endSlot:m,button:g,error:b,warning:v,innerLabel:C,inputReference:f,children:y,...E}=e,S=b&&void 0!==a?[a]:void 0,x=v&&void 0!==a?[a]:void 0,_=r(p.inputContainer,d[u],t),w=C?o.createElement(i.StartSlot,{className:p.innerLabel,interactive:!1},C):void 0,N=m||g||y?o.createElement(i.EndSlot,null,m,g,y):void 0;return o.createElement(l.FormInput,{...E,className:_,inputClassName:n,errors:S,warnings:x,hasErrors:b,hasWarnings:v,messagesPosition:c.MessagesPosition.Attached,customErrorsAttachment:h,messagesRoot:"document",inheritMessagesWidthFromTarget:!0,disableMessagesRtlStyles:!0,iconHidden:!0,stretch:s,reference:f,startSlot:w,endSlot:N})}var g=n(28353),b=n(9745),v=n(81268),C=n(44712);function f(e){const t=r(C.control,C.controlIncrease),n=r(C.control,C.controlDecrease);return o.createElement(o.Fragment,null,void 0!==e.title&&o.createElement("div",{className:C.title},e.title),o.createElement("div",{className:C.controlWrapper},(e.defaultButtonsVisible||e.title)&&o.createElement(o.Fragment,null,o.createElement("button",{type:"button",tabIndex:-1,"aria-label":(0,g.t)("Increase"),className:t,onClick:e.increaseValue},o.createElement(b.Icon,{icon:v,className:C.controlIcon})),o.createElement("button",{type:"button",tabIndex:-1,"aria-label":(0,g.t)("Decrease"),className:n,onClick:e.decreaseValue},o.createElement(b.Icon,{icon:v,className:C.controlIcon})))))}var y=n(70412),E=n(29202),S=n(47201),x=n(68335);const _=[38],w=[40];function N(e){const[t,n]=(0,y.useHover)(),[r,a]=(0,E.useFocus)(),i=(0,S.createSafeMulticastEventHandler)(a.onFocus,e.onFocus),l=(0,S.createSafeMulticastEventHandler)(a.onBlur,e.onBlur),c=(0,o.useCallback)(t=>{!e.disabled&&r&&(t.preventDefault(),t.deltaY<0?e.onValueByStepChange(1):e.onValueByStepChange(-1))},[r,e.disabled,e.onValueByStepChange]);return o.createElement(m,{...n,id:e.id,name:e.name,pattern:e.pattern,borderStyle:e.borderStyle,fontSizeStyle:e.fontSizeStyle,value:e.value,className:e.className,inputClassName:e.inputClassName,button:function(){const{button:n,forceShowControls:a,disabled:i,title:l}=e,c=!i&&!s.mobiletouch&&(a||r||t);return i?void 0:o.createElement(o.Fragment,null,null!=n?n:o.createElement(f,{increaseValue:u,decreaseValue:p,defaultButtonsVisible:c,title:l}))}(),disabled:e.disabled,placeholder:e.placeholder,innerLabel:e.innerLabel,endSlot:e.endSlot,containerReference:e.containerReference,inputReference:e.inputReference,inputMode:e.inputMode,type:e.type,error:e.error,errorMessage:e.errorMessage,onClick:e.onClick,onFocus:i,onBlur:l,onChange:e.onValueChange,onKeyDown:function(t){if(e.disabled||0!==(0,x.modifiersFromEvent)(t.nativeEvent))return;let n=_,o=w;e.controlDecKeyCodes&&(o=o.concat(e.controlDecKeyCodes))
;e.controlIncKeyCodes&&(n=n.concat(e.controlIncKeyCodes));(o.includes(t.keyCode)||n.includes(t.keyCode))&&(t.preventDefault(),e.onValueByStepChange(o.includes(t.keyCode)?-1:1));e.onKeyDown&&e.onKeyDown(t)},onWheelNoPassive:c,stretch:e.stretch,intent:e.intent,highlight:e.highlight,highlightRemoveRoundBorder:e.highlightRemoveRoundBorder,autoSelectOnFocus:e.autoSelectOnFocus,"data-property-id":e["data-name"]});function u(){e.disabled||e.onValueByStepChange(1)}function p(){e.disabled||e.onValueByStepChange(-1)}}},35726:(e,t,n)=>{"use strict";n.d(t,{splitThousands:()=>s});var o=n(93751);function s(e,t="&nbsp;"){let n=e+"";-1!==n.indexOf("e")&&(n=function(e){return(0,o.fixComputationError)(e).toFixed(10).replace(/\.?0+$/,"")}(Number(e)));const s=n.split(".");return s[0].replace(/\B(?=(\d{3})+(?!\d))/g,t)+(s[1]?"."+s[1]:"")}},46446:(e,t,n)=>{"use strict";n.d(t,{bind:()=>a,setter:()=>i});var o=n(59496),s=n(617),r=n(27365);function a(e){var t;return(t=class extends o.PureComponent{constructor(){super(...arguments),this._onChange=(e,t,n)=>{const{setValue:o}=this.context,{onChange:s}=this.props;i(o,s)(e,t,n)}}render(){const{input:t}=this.props,{values:n,model:s}=this.context;return o.createElement(e,{...this.props,value:n[t.id],tzName:(0,r.getTimezoneName)(s),onChange:this._onChange})}}).contextType=s.PropertyContext,t}function i(e,t){return(n,o,s)=>{e(o,n,s),t&&t(n,o,s)}}},617:(e,t,n)=>{"use strict";n.d(t,{PropertyContext:()=>c,PropertyContainer:()=>u});var o=n(59496),s=n(88537),r=n(28353),a=n(24980);const i=(0,n(98125).getLogger)("Platform.GUI.StudyInputPropertyContainer"),l=new a.TranslatedString("change {propertyName} property",(0,r.t)("change {propertyName} property")),c=o.createContext(null);class u extends o.PureComponent{constructor(e){super(e),this._setValue=(e,t,n)=>{const{property:o,model:c}=this.props,u=(0,s.ensureDefined)(o.child(e));i.logNormal(`Changing property "${e}" value from "${o.value()}" to "${t}"`);const p=new a.TranslatedString(n,function(e){return(0,r.t)(e,{context:"input"})}(n));c.setProperty(u,t,l.format({propertyName:p}))};const{property:t}=e,n={};t.childNames().forEach(e=>{const o=(0,s.ensureDefined)(t.child(e));n.hasOwnProperty(e)||(n[e]=o.value())}),this.state=n}componentDidMount(){const{property:e,onStudyInputChange:t}=this.props;e.childNames().forEach(n=>{(0,s.ensureDefined)(e.child(n)).subscribe(this,e=>{const o=e.value();i.logNormal(`Property "${n}" updated to value "${o}"`),this.setState({[n]:o}),null==t||t(o,n)})})}componentWillUnmount(){const{property:e}=this.props;e.childNames().forEach(t=>{(0,s.ensureDefined)(e.child(t)).unsubscribeAll(this)})}render(){const{study:e,model:t,children:n}=this.props,s={study:e,model:t,values:this.state,setValue:this._setValue};return o.createElement(c.Provider,{value:s},n)}}},44488:(e,t,n)=>{"use strict";n.d(t,{ModelContext:()=>s,bindModel:()=>r});var o=n(59496);const s=o.createContext(null);function r(e,t){return o.createElement(s.Consumer,null,n=>n?o.createElement(e,{...Object.assign({model:n},t)}):null)}},87536:(e,t,n)=>{"use strict";n.d(t,{
StylePropertyContext:()=>r,StylePropertyContainer:()=>a,bindPropertyContext:()=>i});var o=n(59496),s=n(44488);const r=o.createContext(null);class a extends o.PureComponent{constructor(){super(...arguments),this._setValue=(e,t,n)=>{const{model:o}=this.props;o.setProperty(e,t,n)}}componentDidMount(){const{property:e}=this.props;e.subscribe(this,()=>this.forceUpdate())}componentWillUnmount(){const{property:e}=this.props;e.unsubscribeAll(this)}render(){const e={setValue:this._setValue};return o.createElement(r.Provider,{value:e},this.props.children)}}function i(e,t){return(0,s.bindModel)(({model:n})=>o.createElement(a,{model:n,property:t.property},o.createElement(e,{...t})),t)}},65376:(e,t,n)=>{"use strict";n.d(t,{InputTooltip:()=>h});var o=n(59496),s=n(97754),r=n.n(s),a=n(9745),i=n(38780),l=n(32563),c=n(70199),u=n(60495);function p(){document.removeEventListener("scroll",p),document.removeEventListener("touchstart",p),(0,i.hide)()}function d(e){l.mobiletouch&&((0,i.showOnElement)(e.currentTarget,{tooltipDelay:0}),document.addEventListener("scroll",p),document.addEventListener("touchstart",p))}function h(e){const{className:t,title:n}=e;return o.createElement(a.Icon,{icon:u,className:r()(t,"apply-common-tooltip",c.icon),title:n,onClick:d})}},95087:(e,t,n)=>{"use strict";n.d(t,{isGroup:()=>s,isInputInlines:()=>r,getInputGroups:()=>a});var o=n(88537);function s(e){return e.hasOwnProperty("groupType")}function r(e){return s(e)&&"inline"===e.groupType}function a(e){const t=[],n=new Map,s=new Map;return s.set(void 0,new Map),e.forEach(e=>{const{group:r,inline:a}=e;if(void 0!==r||void 0!==a)if(void 0!==r)if(void 0!==a)if(n.has(r)){const t=(0,o.ensureDefined)(n.get(r));let l;s.has(t)?l=(0,o.ensureDefined)(s.get(t)):(l=new Map,s.set(t,l)),i(e,"inline",a,l,t.children)}else{const o={id:a,groupType:"inline",children:[e]},i={id:r,groupType:"group",children:[o]},l=new Map;l.set(a,o),s.set(i,l),n.set(r,i),t.push(i)}else i(e,"group",r,n,t);else{const n=(0,o.ensureDefined)(s.get(void 0));i(e,"inline",(0,o.ensureDefined)(a),n,t)}else t.push(e)}),t}function i(e,t,n,s,r){if(s.has(n))(0,o.ensureDefined)(s.get(n)).children.push(e);else{const o={id:n,groupType:t,children:[e]};s.set(n,o),r.push(o)}}},27547:(e,t,n)=>{"use strict";n.d(t,{InputRow:()=>X});var o=n(28353),s=n(59496),r=n(88537),a=n(33266),i=n(26007),l=n(48948),c=n(48100),u=n(97754),p=n.n(u),d=n(31261),h=n(46446),m=n(93379),g=n(6041);class b extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e.currentTarget.value,t,n)}}render(){const{input:{defval:e},value:t,disabled:n,onBlur:o,onKeyDown:r,hasTooltip:a}=this.props;return s.createElement(d.InputControl,{className:p()(g.input,a&&g.hasTooltip),value:void 0===t?e:t,onChange:this._onChange,onBlur:o,onKeyDown:r,disabled:n})}}const v=(0,m.debounced)(b),C=(0,h.bind)(v);var f=n(76110),y=n(35868);function E(e){const{className:t}=e,n=(0,s.useContext)(y.PropertyTable.InlineRowContext);return s.createElement("div",{className:u(g.inputGroup,n&&g.inlineGroup,t)},e.children)
}var S=n(36565);function x(e=""){const[,t="",n="",o="",s=""]=Array.from(e.match(/^(\d\d)(\d\d)-(\d\d)(\d\d)/)||[]);return[`${t}:${n}`,`${o}:${s}`]}class _ extends s.PureComponent{constructor(e){super(e),this._onStartPick=e=>{this.setState({startTime:e},this._onChange)},this._onEndPick=e=>{this.setState({endTime:e},this._onChange)},this._onChange=()=>{const{input:{id:e,name:t},onChange:n}=this.props,{startTime:o,endTime:s}=this.state;n(o.replace(":","")+"-"+s.replace(":",""),e,t)};const t=e.value||e.input.defval,[n,o]=x(t);this.state={prevValue:t,startTime:n,endTime:o}}render(){const{startTime:e,endTime:t}=this.state,{hasTooltip:n,disabled:o}=this.props;return s.createElement(E,{className:p()(n&&g.hasTooltip)},s.createElement("div",{className:g.sessionStart},s.createElement(S.TimeInput,{className:p()(g.input,g.sessionInputContainer),name:"start",value:(0,r.ensureDefined)(e),onChange:this._onStartPick,disabled:o}),s.createElement("span",{className:g.sessionDash}," — ")),s.createElement("div",{className:g.sessionEnd},s.createElement(S.TimeInput,{className:p()(g.input,g.sessionInputContainer),name:"end",value:(0,r.ensureDefined)(t),onChange:this._onEndPick,disabled:o})))}static getDerivedStateFromProps(e,t){if(e.value===t.prevValue)return t;const[n,o]=x(e.value);return{prevValue:e.value,startTime:n,endTime:o}}}const w=(0,h.bind)(_);var N=n(67337),k=n(67072),I=n.n(k),T=n(617),P=n(45685);class R extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e,t,n)}}render(){const{input:{id:e,defval:t,options:n,optionsTitles:r},value:a,disabled:i,hasTooltip:l}=this.props,c=n.map(e=>{const t=r&&r[e]?r[e]:e;return{value:e,content:(0,o.t)(t,{context:"input"})}}),u=void 0!==a&&n.includes(a)?a:t;return s.createElement(P.Select,{id:e,className:p()(g.input,l&&g.hasTooltip),menuClassName:g.dropdownMenu,value:u,items:c,onChange:this._onChange,disabled:i})}}const B=(0,h.bind)(R);var M=n(72280);const O={open:(0,o.t)("open"),high:(0,o.t)("high"),low:(0,o.t)("low"),close:(0,o.t)("close"),hl2:(0,o.t)("hl2"),hlc3:(0,o.t)("hlc3"),ohlc4:(0,o.t)("ohlc4"),hlcc4:(0,o.t)("hlcc4")};class A extends s.PureComponent{render(){const{input:e}=this.props,{study:t,model:n}=this.context;let o={...O};delete o.hlcc4;const a=(0,M.createAdapter)(t);if(t&&this._isStudy(t)&&t.isChildStudy()){const t=a.parentSource(),n=t.title(),s=I().getChildSourceInputTitles(e,t.metaInfo(),n);o={...o,...s}}if(N.enabled("study_on_study")&&t&&this._isStudy(t)&&(t.isChildStudy()||I().canBeChild(t.metaInfo()))){const e=[t,...a.getAllChildren()];n.model().allStudies().filter(t=>t.canHaveChildren()&&!e.includes(t)).forEach(e=>{const t=e.title(!0,void 0,!0),n=e.sourceId()||"#"+e.id(),s=e.metaInfo(),a=s.styles,i=s.plots||[];if(1===i.length)o[n+"$0"]=t;else if(i.length>1){const e=i.reduce((e,o,s)=>{if(!I().canPlotBeSourceOfChildStudy(o.type))return e;let i;try{i=(0,r.ensureDefined)((0,r.ensureDefined)(a)[o.id]).title}catch(e){i=o.id}return{...e,[`${n}$${s}`]:`${t}: ${i}`}},{});o={...o,...e}}})}const i={...e,type:"text",
options:Object.keys(o),optionsTitles:o};return s.createElement(B,{...this.props,input:i})}_isStudy(e){return!e.hasOwnProperty("isInputsStudy")}}A.contextType=T.PropertyContext;var D=n(29823),z=n(9315);const V=void 0,F=["1","3","5","15","30","45","60","120","180","240","1D","1W","1M"];class L extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e,t,n)}}render(){const{input:e,value:t,disabled:n,hasTooltip:r}=this.props,a=D.Interval.parse(void 0===t?e.defval:t),i=a.isValid()?a.value():t,l=V?V.get().filter(e=>!D.Interval.parse(e).isRange()):[],c=(0,z.mergeResolutions)(F,l);return c.unshift(""),s.createElement(P.Select,{id:e.id,className:p()(g.input,g.resolution,r&&g.hasTooltip),menuClassName:p()(g.dropdownMenu,g.resolution),items:(u=c,u.map(e=>({value:e,content:""===e?(0,o.t)("Chart"):(0,z.getTranslatedResolutionModel)(e).hint}))),value:i,onChange:this._onChange,disabled:n});var u}}const G=(0,h.bind)(L);var W=n(79946),j=n(87536);class H extends s.PureComponent{render(){return s.createElement(T.PropertyContext.Consumer,null,e=>e?this._getColorInputWithContext(e):null)}_getColorInputWithContext(e){var t;const{input:{id:n},disabled:o,hasTooltip:r}=this.props,{model:a,study:i}=e;if("properties"in i||"tempProperties"in i){const e="properties"in i?i.properties().inputs[n]:null===(t=i.tempProperties)||void 0===t?void 0:t.inputs.child(n);return s.createElement(j.StylePropertyContainer,{model:a,property:e},s.createElement(W.ColorWithThicknessSelect,{className:p()(r&&g.hasTooltip),color:e,disabled:o}))}return null}}class K extends s.PureComponent{render(){const{input:e,disabled:t,onChange:n,tzName:o,hasTooltip:r}=this.props;if((0,a.isStudyInputOptionsInfo)(e))return s.createElement(B,{input:e,disabled:t,onChange:n,hasTooltip:r});switch(e.type){case"integer":return s.createElement(i.IntegerInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"float":case"price":return s.createElement(l.FloatInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"bool":return s.createElement(c.BoolInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"text":return s.createElement(C,{input:e,disabled:t,onChange:n,hasTooltip:r});case"symbol":return s.createElement(f.SymbolInput,{input:e,disabled:t,onChange:n,hasTooltip:r});case"session":return s.createElement(w,{input:e,disabled:t,onChange:n,hasTooltip:r});case"source":return s.createElement(A,{input:e,disabled:t,onChange:n,hasTooltip:r});case"resolution":return s.createElement(G,{input:e,disabled:t,onChange:n,hasTooltip:r});case"time":return null;case"color":return s.createElement(H,{input:e,disabled:t,onChange:n,hasTooltip:r});default:return null}}}var U=n(65376);class X extends s.PureComponent{render(){const{label:e,children:t,input:n,disabled:a,onChange:i,labelAlign:l,grouped:c,tooltip:u,offset:p}=this.props;return s.createElement(y.PropertyTable.Row,null,s.createElement(y.PropertyTable.Cell,{placement:"first",verticalAlign:l,grouped:c,offset:p},void 0!==e?e:(0,o.t)((0,r.ensureDefined)(n).name,{context:"input"
})),s.createElement(y.PropertyTable.Cell,{placement:"last",grouped:c},t||s.createElement(K,{input:(0,r.ensureDefined)(n),onChange:i,disabled:a,hasTooltip:Boolean(u)}),u&&s.createElement(U.InputTooltip,{title:u})))}}},27423:(e,t,n)=>{"use strict";n.d(t,{InputsTabContent:()=>F});var o,s=n(59496),r=n(28353),a=n(617),i=n(35868),l=n(54349),c=n(97754),u=n.n(c),p=n(15994),d=n.n(p);const h=(0,l.makeSwitchGroupItem)(((o=class extends s.PureComponent{constructor(){super(...arguments),this._onChange=()=>{this.props.onChange&&this.props.onChange(this.props.value)}}render(){const e=c(this.props.className,d().radio,{[d().reverse]:Boolean(this.props.labelPositionReverse)}),t=c(d().label,{[d().disabled]:this.props.disabled}),n=c(d().box,{[d().noOutline]:-1===this.props.tabIndex});let o=null;return this.props.label&&(o=s.createElement("span",{className:t},this.props.label)),s.createElement("label",{className:e},s.createElement("span",{className:d().wrapper,title:this.props.title},s.createElement("input",{id:this.props.id,tabIndex:this.props.tabIndex,autoFocus:this.props.autoFocus,role:this.props.role,className:d().input,type:"radio",name:this.props.name,checked:this.props.checked,disabled:this.props.disabled,value:this.props.value,onChange:this._onChange,ref:this.props.reference}),s.createElement("span",{className:n})),o)}}).defaultProps={value:"on"},o));var m=n(88537),g=n(76110),b=n(46446),v=n(65376),C=n(6041);function f(e){const{children:t,input:n,disabled:o,onChange:c,grouped:u,tooltip:p}=e,d=(0,s.useContext)(a.PropertyContext),{values:f,setValue:y}=(0,m.ensureNotNull)(d),E=f[n.id],[S,x]=(0,s.useState)(E?"another-symbol":"main-symbol"),[_,w]=(0,s.useState)(E);return(0,s.useEffect)(()=>{E&&w(E)},[E]),s.createElement(l.SwitchGroup,{name:"symbol-source-"+n.id,values:[S],onChange:function(e){x(e),"main-symbol"===e?(0,b.setter)(y)("",n.id,n.name):"another-symbol"===e&&_&&(0,b.setter)(y,c)(_,n.id,n.name)}},s.createElement(i.PropertyTable.Row,null,s.createElement(i.PropertyTable.Cell,{colSpan:2,placement:"first",grouped:u},s.createElement(h,{value:"main-symbol",className:C.checkbox,disabled:o,label:s.createElement("span",{className:C.label},(0,r.t)("Main chart symbol",{context:"input"}))}))),s.createElement(i.PropertyTable.Row,null,s.createElement(i.PropertyTable.Cell,{placement:"first",grouped:u},s.createElement(h,{value:"another-symbol",className:C.checkbox,disabled:o,label:s.createElement("span",{className:C.label},(0,r.t)("Another symbol",{context:"input"}))})),s.createElement(i.PropertyTable.Cell,{placement:"last",grouped:u},t||s.createElement(g.SymbolInput,{input:(0,m.ensureDefined)(n),onChange:c,disabled:o||"main-symbol"===S,hasTooltip:Boolean(p)}),p&&s.createElement(v.InputTooltip,{title:p}))))}var y=n(48100);class E extends s.PureComponent{render(){const{label:e,input:t,tooltip:n}=this.props;return s.createElement(i.PropertyTable.Row,null,s.createElement(i.PropertyTable.Cell,{placement:"first",colSpan:2},s.createElement(y.BoolInput,{label:e,input:t,hasTooltip:Boolean(n)}),n&&s.createElement(v.InputTooltip,{title:n})))}}
var S=n(27547),x=n(2568),_=n(67029),w=n(93379);class N extends s.PureComponent{constructor(){super(...arguments),this._onChange=e=>{const{input:{id:t,name:n},onChange:o}=this.props;o(e.currentTarget.value,t,n)}}render(){const{input:{defval:e},value:t,disabled:n,onBlur:o,onKeyDown:r}=this.props;return s.createElement(x.Textarea,{className:u()(C.input,C.textarea,_.InputClasses.FontSizeMedium),value:void 0===t?e:t,onChange:this._onChange,onBlur:o,onKeyDown:r,disabled:n})}}const k=(0,w.debounced)(N),I=(0,b.bind)(k);var T=n(300);function P(e){const{input:t,label:n,tooltip:o}=e;return s.createElement(i.PropertyTable.Row,null,s.createElement(i.PropertyTable.Cell,{placement:"first",colSpan:2,className:T.wrap},s.createElement("div",{className:T.labelWrap},s.createElement("span",{className:u()(T.label,o&&T.hasTooltip)},n),o&&s.createElement(v.InputTooltip,{title:o})),s.createElement(I,{input:t})))}function R(e){const{input:t,tooltip:n}=e;return"symbol"===t.type&&t.optional?s.createElement(f,{input:t,tooltip:n}):"bool"===t.type?s.createElement(E,{label:(0,r.t)(t.name,{context:"input"}),input:t,tooltip:n}):"text_area"===t.type?s.createElement(P,{label:(0,r.t)(t.name,{context:"input"}),input:t,tooltip:n}):s.createElement(S.InputRow,{labelAlign:function(e){switch(e){case"session":return"adaptive";case"time":return"topCenter";default:return}}(t.type),input:t,tooltip:n})}var B=n(86067),M=n(23128);function O(e){const{content:t}=e;let n;return s.createElement(i.PropertyTable.InlineRowContext.Provider,{value:!0},s.createElement("div",{className:M.inlineRow},t.children.map((e,o)=>(void 0!==e.tooltip&&(n=e.tooltip),s.createElement(R,{key:e.id,input:e,tooltip:o===t.children.length-1?n:void 0})))))}var A=n(95087),D=n(16300);function z(e){const{content:t}=e;return(0,A.isGroup)(t)?(0,A.isInputInlines)(t)?s.createElement(O,{content:t}):s.createElement(s.Fragment,null,s.createElement("div",{className:D.titleWrap},s.createElement(B.GroupTitleSection,{title:(0,r.t)(t.id,{context:"input"}),name:t.id})),t.children.map(e=>(0,A.isGroup)(e)?s.createElement(O,{key:e.id,content:e}):s.createElement(R,{key:e.id,input:e,tooltip:e.tooltip})),s.createElement("div",{className:D.groupFooter})):s.createElement(R,{input:t,tooltip:t.tooltip})}const V={offset:(0,r.t)("Offset")};class F extends s.PureComponent{render(){const{reference:e,inputs:t,property:n,study:o,model:r,onStudyInputChange:a,className:l}=this.props,{offset:c,offsets:u}=n;return s.createElement(i.PropertyTable,{reference:e,className:l},s.createElement(L,{study:o,model:r,property:n.inputs,inputs:t,onStudyInputChange:a}),c&&this._createOffsetSection(c),u&&u.childNames().map(e=>{const t=u.childs()[e];return this._createOffsetSection(t)}))}_createOffsetSection(e){const t=e.childs();return s.createElement(L,{key:"offset_"+t.title.value(),study:this.props.study,model:this.props.model,inputs:[G(t)],property:e})}}function L(e){const{study:t,model:n,inputs:o,property:r,onStudyInputChange:i}=e,l=o,c=(0,s.useMemo)(()=>(0,A.getInputGroups)(l),[l]);return s.createElement(a.PropertyContainer,{property:r,
study:t,model:n,onStudyInputChange:i},!1,c.map(e=>s.createElement(z,{key:e.id,content:e})))}function G(e){return{id:"val",name:e.title.value()||V.offset,defval:e.val.value(),type:"integer",min:e.min.value(),max:e.max.value()}}},48100:(e,t,n)=>{"use strict";n.d(t,{BoolInputComponent:()=>c,BoolInput:()=>u});var o=n(59496),s=n(15294),r=n(97754),a=n.n(r),i=n(46446),l=n(6041);class c extends o.PureComponent{constructor(){super(...arguments),this._onChange=()=>{const{input:{id:e,name:t},value:n,onChange:o}=this.props;o(!n,e,t)}}render(){const{input:{defval:e},value:t,disabled:n,label:r,hasTooltip:i}=this.props,c=void 0===t?e:t;return o.createElement(s.Checkbox,{className:a()(l.checkbox,i&&l.hasTooltip),disabled:n,checked:c,onChange:this._onChange,label:o.createElement("span",{className:l.label},r),labelAlignBaseline:!0})}}const u=(0,i.bind)(c)},93379:(e,t,n)=>{"use strict";n.d(t,{debounced:()=>r});var o=n(59496);const s={blur:0,commit:0,change:1/0};function r(e,t=s){return class extends o.PureComponent{constructor(e){super(e),this._onChange=(e,n,o)=>{const s=t.change;s?(clearTimeout(this._timeout),this.setState({value:e},()=>{s!==1/0&&(this._timeout=setTimeout(()=>this._flush(),s))})):this._flush(e)},this._onBlur=()=>{this._debounce(t.blur);const{onBlur:e}=this.props;e&&e()},this._onKeyDown=e=>{13===e.keyCode&&this._debounce(t.commit)},this.state={prevValue:e.value,value:e.value}}componentWillUnmount(){this._flush()}render(){const{value:t}=this.state;return o.createElement(e,{...this.props,value:t,onChange:this._onChange,onBlur:this._onBlur,onKeyDown:this._onKeyDown})}static getDerivedStateFromProps(e,t){return e.value===t.prevValue?t:{prevValue:e.value,value:e.value}}_debounce(e){e?(clearTimeout(this._timeout),e!==1/0&&(this._timeout=setTimeout(()=>this._flush(),e))):this.setState(e=>{this._flush(e.value)})}_flush(e){const{input:{id:t,name:n},onChange:o}=this.props,{prevValue:s,value:r}=this.state;clearTimeout(this._timeout);const a=void 0!==e?e:r;void 0!==a&&a!==s&&o(a,t,n)}}}},48948:(e,t,n)=>{"use strict";n.d(t,{FloatInputComponent:()=>p,FloatInput:()=>d});var o=n(59496),s=n(97754),r=n.n(s),a=n(17571),i=n(46446),l=n(93379),c=n(6041);class u extends o.PureComponent{render(){const{hasTooltip:e}=this.props;return o.createElement(a.NumericInput,{...this.props,className:r()(c.input,e&&c.hasTooltip),stretch:!1})}}const p=(0,l.debounced)(u,{change:1/0,commit:0,blur:0}),d=(0,i.bind)(p)},26007:(e,t,n)=>{"use strict";n.d(t,{IntegerInputComponent:()=>p,IntegerInput:()=>d});var o=n(59496),s=n(97754),r=n.n(s),a=n(46446),i=n(93379),l=n(17571),c=n(6041);class u extends o.PureComponent{render(){const{hasTooltip:e}=this.props;return o.createElement(l.NumericInput,{...this.props,mode:"integer",className:r()(c.input,e&&c.hasTooltip),stretch:!1})}}const p=(0,i.debounced)(u,{change:1/0,commit:0,blur:0}),d=(0,a.bind)(p)},17571:(e,t,n)=>{"use strict";n.d(t,{NumericInput:()=>y});var o=n(59496),s=n(88537),r=n(28353),a=n(60521),i=n(49483),l=n(92399),c=n(35726),u=n(62820);var p=n(95505),d=n(64514);const h=(0,
r.t)("Number format is invalid."),m=new class{constructor(e=" "){this._divider=e}format(e){const t=(0,c.splitThousands)(e,this._divider);return(0,u.isRtl)()?(0,u.startWithLTR)(t):t}parse(e){const t=(0,u.stripLTRMarks)(e).split(this._divider).join(""),n=Number(t);return isNaN(n)||/e/i.test(t)?{res:!1}:{res:!0,value:n,suggest:this.format(n)}}},g=/^-?[0-9]*$/,b=9e15;class v extends o.PureComponent{constructor(e){super(e),this._onFocus=e=>{this.setState({focused:!0}),this.props.onFocus&&this.props.onFocus(e)},this._onBlur=e=>{this.setState({displayValue:C(this.props,this.props.value),focused:!1}),this.props.errorHandler&&this.props.errorHandler(!1),this.props.onBlur&&this.props.onBlur(e)},this._onValueChange=e=>{const t=e.target.value;if(void 0!==this.props.onEmptyString&&""===t&&this.props.onEmptyString(),"integer"===this.props.mode&&!g.test(t))return;const n=f(t,this.props.formatter),o=n.res?this._checkValueBoundaries(n.value):{isPassed:!1,msg:void 0},s=n.res&&!o.isPassed,r=n.res&&n.suggest&&!this.state.focused?n.suggest:t,a=s&&o.msg?o.msg:h;this.setState({displayValue:r,errorMsg:a}),n.res&&o.isPassed&&this.props.onValueChange(n.value,"input"),this.props.errorHandler&&this.props.errorHandler(!n.res||s)},this._onValueByStepChange=e=>{const{roundByStep:t=!0,step:n=1,uiStep:o,min:s=n,formatter:r}=this.props,i=f(this.state.displayValue,r),l=null!=o?o:n;let c=n;if(i.res){const o=new a.Big(i.value),r=o.minus(s).mod(n);let u=o.plus(e*l);!r.eq(0)&&t&&(u=u.plus((e>0?0:1)*l).minus(r)),c=u.toNumber()}const{isPassed:u,clampedValue:p}=this._checkValueBoundaries(c);c=u?c:p,this.setState({displayValue:C(this.props,c)}),this.props.onValueChange(c,"step"),this.props.errorHandler&&this.props.errorHandler(!1)};const{value:t}=e;this.state={value:t,displayValue:C(e,t),focused:!1,errorMsg:h}}render(){var e;return o.createElement(l.NumberInputView,{id:this.props.id,inputMode:null!==(e=this.props.inputMode)&&void 0!==e?e:i.CheckMobile.iOS()?void 0:"numeric",borderStyle:this.props.borderStyle,fontSizeStyle:this.props.fontSizeStyle,value:this.state.displayValue,forceShowControls:this.props.forceShowControls,className:this.props.className,inputClassName:this.props.inputClassName,button:this.props.button,placeholder:this.props.placeholder,innerLabel:this.props.innerLabel,endSlot:this.props.endSlot,disabled:this.props.disabled,error:this.props.error,errorMessage:this.props.errorMessage||this.state.errorMsg,onValueChange:this._onValueChange,onValueByStepChange:this._onValueByStepChange,containerReference:this.props.containerReference,inputReference:this.props.inputReference,onClick:this.props.onClick,onFocus:this._onFocus,onBlur:this._onBlur,onKeyDown:this.props.onKeyDown,controlDecKeyCodes:this.props.controlDecKeyCodes,controlIncKeyCodes:this.props.controlIncKeyCodes,title:this.props.title,intent:this.props.intent,highlight:this.props.highlight,highlightRemoveRoundBorder:this.props.highlightRemoveRoundBorder,stretch:this.props.stretch,autoSelectOnFocus:!i.CheckMobile.any()})}getClampedValue(){
const{min:e=-1/0,max:t=b}=this.props,n=f(this.state.displayValue,this.props.formatter);return n.res?(0,d.clamp)(n.value,e,t):null}static getDerivedStateFromProps(e,t){const{alwaysUpdateValueFromProps:n,value:o}=e;return t.focused&&!n||t.value===o?null:{value:o,displayValue:C(e,o)}}_checkValueBoundaries(e){var t,n,o,s;const{min:a=-1/0,max:i=b}=this.props,l=function(e,t,n){const o=e>=t,s=e<=n;return{passMin:o,passMax:s,pass:o&&s,clamped:(0,d.clamp)(e,t,n)}}(e,a,i);let c;return l.passMax||(c=null!==(n=null===(t=this.props.boundariesErrorMessages)||void 0===t?void 0:t.greaterThanMax)&&void 0!==n?n:(0,r.t)("Specified value is more than the instrument maximum of {max}.",{replace:{max:String(i)}})),l.passMin||(c=null!==(s=null===(o=this.props.boundariesErrorMessages)||void 0===o?void 0:o.lessThanMin)&&void 0!==s?s:(0,r.t)("Specified value is less than the instrument minimum of {min}.",{replace:{min:String(a)}})),{isPassed:l.pass,msg:c,clampedValue:l.clamped}}}function C(e,t){const{useFormatter:n=!0,formatter:o,mode:s}=e;return n&&"integer"!==s?function(e,t=m){return null!==e?t.format(e):""}(t,o):function(e){if(null===e)return"";return p.NumericFormatter.formatNoE(e)}(t)}function f(e,t=m){return t.parse?t.parse(e):{res:!1,error:"Formatter does not support parse"}}class y extends o.PureComponent{constructor(){super(...arguments),this._container=null,this._handleContainerRef=e=>this._container=e,this._onChange=(e,t)=>{const{input:{id:n,name:o},onChange:s,onBlur:r}=this.props;s(e,n,o),"step"===t&&r&&r()},this._onBlur=e=>{const{onBlur:t}=this.props;if(t){const n=(0,s.ensureNotNull)(this._container);n.contains(document.activeElement)||n.contains(e.relatedTarget)||t()}}}render(){const{input:{defval:e,min:t,max:n,step:s},value:r,disabled:a,onKeyDown:i,className:l,mode:c,stretch:u}=this.props;return o.createElement(v,{className:l,value:Number(void 0===r?e:r),min:t,max:n,step:s,mode:c,onBlur:this._onBlur,onValueChange:this._onChange,onKeyDown:i,disabled:a,containerReference:this._handleContainerRef,fontSizeStyle:"medium",roundByStep:!1,stretch:u})}}},76110:(e,t,n)=>{"use strict";n.d(t,{getSymbolName:()=>c,SymbolInput:()=>u});var o=n(59496),s=n(88537),r=n(617),a=n(46446),i=n(72280),l=n(48897);function c(e,t){const n=(0,i.createAdapter)(t).resolvedSymbolInfoBySymbol(e);return n&&(n.ticker||n.full_name)?n.ticker||n.full_name:e}const u=(0,a.bind)((function(e){const t=(0,o.useContext)(r.PropertyContext),{study:n}=(0,s.ensureNotNull)(t),{input:{defval:a},value:i}=e;return o.createElement(l.SymbolInputsButton,{...e,value:c(i||a||"",n),study:n})}))},79946:(e,t,n)=>{"use strict";n.d(t,{ColorWithThicknessSelect:()=>b});var o=n(59496),s=n(24377),r=n(28353),a=n(24980),i=n(68906),l=n(87536),c=n(58593),u=n(463),p=n(51768);const d=new a.TranslatedString("change thickness",(0,r.t)("change thickness")),h=new a.TranslatedString("change color",(0,r.t)("change color")),m=new a.TranslatedString("change opacity",(0,r.t)("change opacity")),g=[1,2,3,4];class b extends o.PureComponent{constructor(){super(...arguments),this._trackEventLabel=null,
this._getTransparencyValue=()=>{const{transparency:e}=this.props;return e?e.value():0},this._getOpacityValue=()=>{const{color:e}=this.props,t=(0,u.getPropertyValue)(e);if(t)return(0,i.isHexColor)(t)?(0,i.transparencyToAlpha)(this._getTransparencyValue()):(0,s.parseRgba)(t)[3]},this._getColorValueInHex=()=>{const{color:e}=this.props,t=(0,u.getPropertyValue)(e);return t?(0,i.isHexColor)(t)?t:(0,s.rgbToHexString)((0,s.parseRgb)(t)):null},this._onThicknessChange=e=>{const{thickness:t}=this.props;void 0!==t&&this._setProperty(t,e,d)},this._onColorChange=e=>{const{color:t,isPaletteColor:n}=this.props,o=(0,u.getPropertyValue)(t);let r=0;o&&(r=(0,i.isHexColor)(o)?this._getTransparencyValue():(0,i.alphaToTransparency)((0,s.parseRgba)(o)[3])),this._setProperty(t,(0,i.generateColor)(String(e),r,!0),h),this._trackEventLabel="Plot color > "+(n?"Palette":"Single")},this._onOpacityChange=e=>{const{color:t}=this.props,n=(0,u.getPropertyValue)(t);this._setProperty(t,(0,i.generateColor)(n,(0,i.alphaToTransparency)(e),!0),m)},this._onPopupClose=()=>{this._trackEventLabel&&((0,p.trackEvent)("GUI","Study settings",this._trackEventLabel),this._trackEventLabel=null)}}componentWillUnmount(){this._onPopupClose()}render(){const{selectOpacity:e=!0,disabled:t,className:n}=this.props;return o.createElement(c.ColorSelect,{className:n,disabled:t,color:this._getColorValueInHex(),selectOpacity:e,opacity:this._getOpacityValue(),thickness:this._getThicknessValue(),thicknessItems:g,onColorChange:this._onColorChange,onOpacityChange:this._onOpacityChange,onThicknessChange:this._onThicknessChange,onPopupClose:this._onPopupClose})}_getThicknessValue(){const{thickness:e}=this.props;return e?(0,u.getPropertyValue)(e):void 0}_setProperty(e,t,n){const{setValue:o}=this.context;(0,u.setPropertyValue)(e,e=>o(e,t,n))}}b.contextType=l.StylePropertyContext},35868:(e,t,n)=>{"use strict";n.d(t,{PropertyTable:()=>l});var o=n(59496),s=n(97754),r=n(90186),a=n(46828);const i=o.createContext(!1);class l extends o.PureComponent{render(){return o.createElement("div",{ref:this.props.reference,className:s(a.content,this.props.className)},this.props.children)}}l.InlineRowContext=i,l.Row=function(e){const{children:t}=e;return(0,o.useContext)(i)?o.createElement("span",{className:a.inlineRow},t):o.createElement(o.Fragment,null,t)},l.Cell=function(e){const t=(0,o.useContext)(i),n=s(a.cell,e.offset&&a.offset,e.grouped&&a.grouped,t&&a.inlineCell,"top"===e.verticalAlign&&a.top,"topCenter"===e.verticalAlign&&a.topCenter,"adaptive"===e.verticalAlign&&a.adaptive,e.checkableTitle&&a.checkableTitle,2===e.colSpan&&a.fill,"first"===e.placement&&2!==e.colSpan&&a.first,"last"===e.placement&&2!==e.colSpan&&a.last),l=(0,r.filterDataProps)(e);return o.createElement("div",{...l,className:n},o.createElement("div",{className:s(a.inner,e.className)},e.children))},l.Separator=function(e){return o.createElement(l.Row,null,o.createElement("div",{className:s(a.cell,a.separator,a.fill)}))},l.GroupSeparator=function(e){const t=e.size||0;return o.createElement(l.Row,null,o.createElement("div",{
className:s(a.cell,a.groupSeparator,a.fill,1===t&&a.big)}))}},463:(e,t,n)=>{"use strict";function o(e){return Array.isArray(e)?e[0].value():e.value()}function s(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)}n.d(t,{getPropertyValue:()=>o,setPropertyValue:()=>s})},58593:(e,t,n)=>{"use strict";n.d(t,{ColorSelect:()=>w});var o=n(59496),s=n(97754),r=n.n(s),a=n(88537),i=n(68335),l=n(50628),c=n(29202),u=n(27797),p=n(64706);function d(e){const{button:t,children:n,className:s,onPopupClose:r,...d}=e,[h,m]=(0,o.useState)(!1),[g,b]=(0,o.useState)(!1),[v,C]=(0,c.useFocus)(),f=(0,o.useRef)(null);return o.createElement("div",{className:s},o.createElement("div",{tabIndex:e.disabled?void 0:-1,ref:f,onClick:y,onFocus:C.onFocus,onBlur:C.onBlur,onKeyDown:E},"function"==typeof t?t(g,v):t),o.createElement(l.PopupMenu,{isOpened:g,onClose:S,position:function(){const e=(0,a.ensureNotNull)(f.current).getBoundingClientRect();return{x:e.left,y:e.top+e.height}},doNotCloseOn:f.current,onKeyDown:E},o.createElement(p.MenuContext.Consumer,null,e=>o.createElement(u.ColorPicker,{...d,onToggleCustom:m,menu:e})),!h&&n));function y(){e.disabled||(b(e=>!e),m(!1))}function E(e){switch((0,i.hashFromEvent)(e)){case 27:g&&(e.preventDefault(),S())}}function S(){y(),(0,a.ensureNotNull)(f.current).focus(),r&&r()}}var h=n(56512),m=n(68906),g=n(6914),b=n(28353),v=n(54349),C=n(74588);const f=(0,v.makeSwitchGroupItem)(class extends o.PureComponent{constructor(){super(...arguments),this._onChange=()=>{this.props.onChange&&this.props.onChange(this.props.value)}}render(){const{name:e,checked:t,value:n}=this.props,r=s(C.thicknessItem,{[C.checked]:t}),a=s(C.bar,{[C.checked]:t}),i={borderTopWidth:parseInt(n)};return o.createElement("div",{className:r},o.createElement("input",{type:"radio",className:C.radio,name:e,value:n,onChange:this._onChange,checked:t}),o.createElement("div",{className:a,style:i}," "))}});function y(e){const{name:t,values:n,selectedValues:s,onChange:r}=e,a=n.map((e,t)=>o.createElement(f,{key:t,value:e.toString()})),i=s.map(e=>e.toString());return o.createElement("div",{className:C.wrap},o.createElement(v.SwitchGroup,{name:t,onChange:e=>{r(parseInt(e))},values:i},a))}var E=n(83421);const S=(0,b.t)("Thickness");function x(e){const{value:t,items:n,onChange:s}=e;return o.createElement("div",{className:E.thicknessContainer},o.createElement("div",{className:E.thicknessTitle},S),o.createElement(y,{name:"color_picker_thickness_select",onChange:s,values:n,selectedValues:"mixed"===t?[]:[t]}))}var _=n(14348);function w(e){const{className:t,selectOpacity:n=void 0!==e.opacity,thickness:s,color:a,disabled:i,opacity:l=1,onColorChange:c,onOpacityChange:u,onThicknessChange:p,thicknessItems:m,onPopupClose:g}=e,[b,v,C]=(0,h.useCustomColors)();return o.createElement(d,{className:t,disabled:i,color:"mixed"!==a?a:null,selectOpacity:n,opacity:l,selectCustom:!0,customColors:b,onColorChange:c,onOpacityChange:a?u:void 0,onAddColor:v,onRemoveCustomColor:C,button:function(e,t){const n=e||t,c=n?"primary":"default";return o.createElement("div",{
className:r()(_.colorPickerWrap,_["intent-"+c],_["border-thin"],_["size-medium"],n&&_.highlight,n&&_.focused,i&&_.disabled),"data-role":"button","data-name":s?"color-with-thickness-select":"color-select"},o.createElement("div",{className:r()(_.colorPicker,i&&_.disabled)},a&&"mixed"!==a?function(){const e=N(a,l),t=l>=.95&&k(a);return o.createElement("div",{className:_.opacitySwatch},o.createElement("div",{style:{backgroundColor:e},className:r()(_.swatch,t&&_.white)}))}():o.createElement("div",{className:_.placeholderContainer},o.createElement("div",{className:"mixed"===a?_.mixedColor:_.placeholder})),s&&function(){const e=a&&"mixed"!==a?N(a,l):void 0;if("mixed"===s)return o.createElement("div",{className:_.multiWidth},o.createElement("div",{style:{backgroundColor:e},className:_.line}),o.createElement("div",{style:{backgroundColor:e},className:_.line}),o.createElement("div",{style:{backgroundColor:e},className:_.line}));return o.createElement("span",{className:r()(_.colorLine,k(a)&&_.white),style:{height:s,backgroundColor:e}})}()),n&&o.createElement("span",{className:_.shadow}))},onPopupClose:g},s&&m&&o.createElement(x,{value:s,items:m,onChange:function(e){p&&p(e)}}))}function N(e,t){return e?(0,m.generateColor)(e,(0,m.alphaToTransparency)(t)):"#000000"}function k(e){return!!e&&e.toLowerCase()===g.white}},48897:(e,t,n)=>{"use strict";n.d(t,{SymbolInputsButton:()=>w});var o=n(59496),s=n(97754),r=n.n(s),a=n(28353),i=n(88537),l=n(50655),c=n(95711),u=n(67337),p=n(76110),d=n(89453),h=n(1861),m=n(9745),g=n(36826),b=n(55914);function v(e){const{value:t,onClick:n,className:r,startSlot:a,disabled:i=!1}=e;return o.createElement("div",{className:s(b.wrap,i&&b.disabled,r),onClick:n,"data-name":"edit-button"},o.createElement("div",{className:s(b.text,"apply-overflow-tooltip")},void 0!==a&&a,o.createElement("span",null,t)),o.createElement(m.Icon,{icon:g,className:b.icon}))}var C=n(31356),f=n(78260),y=n(7785),E=n(15983),S=n(82708),x=n(83998);function _(e){const{symbol:t,onSymbolChanged:n,disabled:s,className:i}=e,[p,m]=(0,o.useState)(t),g=(0,o.useContext)(l.SlotContext),b=(0,o.useContext)(c.PopupContext);return o.createElement(v,{value:p,onClick:function(){const e=function(e){const t=(0,y.tokenize)(e);return(0,E.isSpread)(t)}(p)?p:(0,S.safeShortName)(p),t=(0,d.getSymbolSearchCompleteOverrideFunction)();(0,h.showSymbolSearchItemsDialog)({onSearchComplete:e=>{t(e[0].symbol).then(e=>{n(e),m(e)})},dialogTitle:(0,a.t)("Change symbol"),defaultValue:e,manager:g,onClose:()=>{b&&b.focus()},showSpreadActions:u.enabled("show_spread_operators")&&u.enabled("studies_symbol_search_spread_operators")})},disabled:s,className:r()(i,u.enabled("uppercase_instrument_names")&&x.uppercase)})}function w(e){if("definition"in e){const{propType:t,properties:n,id:s,title:r=""}=e.definition,a=n[t],l=a.value()||"",c=e=>{a.setValue(e)};return o.createElement(C.CommonSection,{id:s,title:r},o.createElement(f.CellWrap,null,o.createElement(_,{symbol:(0,i.ensureDefined)(l),onSymbolChanged:c})))}{
const{study:t,value:n,input:{id:s,name:a},onChange:l,disabled:c,hasTooltip:u}=e,d=e=>{const n=(0,p.getSymbolName)(e,t);l(n,s,a)};return o.createElement(_,{symbol:(0,i.ensureDefined)(n),onSymbolChanged:d,disabled:c,className:r()(u&&x.hasTooltip)})}}},72280:(e,t,n)=>{"use strict";n.d(t,{createAdapter:()=>r});var o=n(14291),s=n(81851);function r(e){if((0,o.isLineTool)(e))return{isPine:()=>!1,isStandardPine:()=>!1,canOverrideMinTick:()=>!1,resolvedSymbolInfoBySymbol:()=>{throw new TypeError("Only study is supported.")},symbolsResolved:()=>{throw new TypeError("Only study is supported.")},parentSource:()=>{throw new TypeError("Only study is supported.")},getAllChildren:()=>[],sourceId:()=>{throw new TypeError("Only study is supported.")}};if((0,s.isStudy)(e))return e;if("isInputsStudy"in e)return e;throw new TypeError("Unsupported source type.")}},45560:(e,t,n)=>{"use strict";n.d(t,{useDefinitionProperty:()=>r});var o=n(59496),s=n(71953);const r=e=>{const t="property"in e?e.property:void 0,n="defaultValue"in e?e.defaultValue:e.property.value(),[r,a]=(0,o.useState)(t?t.value():n);(0,o.useEffect)(()=>{if(t){const n={};return a(t.value()),t.subscribe(n,t=>{const n=t.value();e.handler&&e.handler(n),a(n)}),()=>t.unsubscribeAll(n)}return()=>{}},[t]);return[r,e=>{if(void 0!==t){const n=t.value();s.logger.logNormal(`Changing property value from "${n}" to "${e}"`),t.setValue(e)}}]}},78260:(e,t,n)=>{"use strict";n.d(t,{CellWrap:()=>i});var o=n(59496),s=n(97754),r=n.n(s),a=n(26527);function i(e){return o.createElement("div",{className:r()(a.wrap,e.className)},e.children)}},53424:(e,t,n)=>{"use strict";n.d(t,{CheckableTitle:()=>c});var o=n(59496),s=n(15294),r=n(45560);function a(e){const{property:t,...n}=e,[a,i]=(0,r.useDefinitionProperty)({property:t}),l="mixed"===a;return o.createElement(s.Checkbox,{...n,name:"toggle-enabled",checked:l||a,indeterminate:l,onChange:function(){i("mixed"===a||!a)}})}var i=n(78260),l=n(27345);function c(e){const{property:t,disabled:n,title:s,className:r,name:c}=e,u=o.createElement("span",{className:l.title},s);return o.createElement(i.CellWrap,{className:r},t?o.createElement(a,{name:c,className:l.checkbox,property:t,disabled:n,label:u,labelAlignBaseline:!0}):u)}},31356:(e,t,n)=>{"use strict";n.d(t,{CommonSection:()=>a});var o=n(59496),s=n(35868),r=n(53424);function a(e){const{id:t,offset:n,disabled:a,checked:i,title:l,children:c}=e;return o.createElement(s.PropertyTable.Row,null,o.createElement(s.PropertyTable.Cell,{placement:"first",verticalAlign:"adaptive",offset:n,"data-section-name":t,colSpan:Boolean(c)?void 0:2,checkableTitle:!0},o.createElement(r.CheckableTitle,{name:"is-enabled-"+t,title:l,disabled:a,property:i})),Boolean(c)&&o.createElement(s.PropertyTable.Cell,{placement:"last","data-section-name":t},c))}},86067:(e,t,n)=>{"use strict";n.d(t,{GroupTitleSection:()=>i});var o=n(59496),s=n(35868),r=n(53424),a=n(51842);function i(e){return o.createElement(s.PropertyTable.Row,null,o.createElement(s.PropertyTable.Cell,{className:a.titleWrap,placement:"first",verticalAlign:"adaptive",colSpan:2,
"data-section-name":e.name,checkableTitle:!0},o.createElement(r.CheckableTitle,{title:e.title,name:"is-enabled-"+e.name,className:a.title})))}},71953:(e,t,n)=>{"use strict";n.d(t,{logger:()=>o});const o=(0,n(98125).getLogger)("Platform.GUI.PropertyDefinitionTrace")},27797:(e,t,n)=>{"use strict";n.d(t,{ColorPicker:()=>B});var o=n(59496),s=n(97754),r=n.n(s),a=n(28353),i=n(24377),l=n(88537),c=n(49483),u=n(50628),p=n(16396);const d=o.createContext(void 0);var h=n(6914),m=n(78679),g=n(24590);function b(e){const{index:t,color:n,selected:r,onSelect:i}=e,[b,v]=(0,o.useState)(!1),C=(0,o.useContext)(d),f=(0,o.useRef)(null),y=Boolean(C)&&!c.CheckMobile.any();return o.createElement(o.Fragment,null,o.createElement("div",{ref:f,style:n?{color:n}:void 0,className:s(g.swatch,b&&g.hover,r&&g.selected,!n&&g.empty,String(n).toLowerCase()===h.white&&g.white),onClick:function(){i(n)},onContextMenu:y?E:void 0}),y&&o.createElement(u.PopupMenu,{isOpened:b,onClose:E,position:function(){const e=(0,l.ensureNotNull)(f.current).getBoundingClientRect();return{x:e.left,y:e.top+e.height+4}},onClickOutside:E},o.createElement(p.PopupMenuItem,{className:g.contextItem,label:(0,a.t)("Remove color"),icon:m,onClick:function(){E(),(0,l.ensureDefined)(C)(t)},dontClosePopup:!0})));function E(){v(!b)}}class v extends o.PureComponent{constructor(){super(...arguments),this._onSelect=e=>{const{onSelect:t}=this.props;t&&t(e)}}render(){const{colors:e,color:t,children:n}=this.props;if(!e)return null;const s=t?(0,i.parseRgb)(String(t)):void 0;return o.createElement("div",{className:g.swatches},e.map((e,t)=>o.createElement(b,{key:String(e)+t,index:t,color:e,selected:s&&(0,i.areEqualRgb)(s,(0,i.parseRgb)(String(e))),onSelect:this._onSelect})),n)}}var C=n(54368),f=n(94720);function y(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,s,r]=n;if(!o||!s||!r)throw new Error(t);const a=parseInt(o,16)/255,i=parseInt(s,16)/255,l=parseInt(r,16)/255,c=Math.max(a,i,l),u=Math.min(a,i,l);let p;const d=c,h=c-u,m=0===c?0:h/c;if(c===u)p=0;else{switch(c){case a:p=(i-l)/h+(i<l?6:0);break;case i:p=(l-a)/h+2;break;case l:p=(a-i)/h+4;break;default:p=0}p/=6}return{h:p,s:m,v:d}}var E=n(43370),S=n(88440);class x 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,l.ensureNotNull)(this._container).getBoundingClientRect(),s=e.clientX-o.left,r=e.clientY-o.top;let a=s/o.width;a<0?a=0:a>1&&(a=1);let i=1-r/o.height;i<0?i=0:i>1&&(i=1),n({h:t,s:a,v:i})},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,E.default)(this._handlePosition,100),this._handleTouch=e=>{
this._handlePosition(e.nativeEvent.touches[0])}}render(){const{className:e,hsv:{h:t,s:n,v:s}}=this.props,a=`hsl(${360*t}, 100%, 50%)`;return o.createElement("div",{className:r()(S.saturation,e),style:{backgroundColor:a},ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},o.createElement("div",{className:S.pointer,style:{left:100*n+"%",top:100*(1-s)+"%"}}))}}var _=n(24429);class w 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 s=(0,l.ensureNotNull)(this._container).getBoundingClientRect();let r=(e.clientY-s.top)/s.height;r<0?r=0:r>1&&(r=1),o({h:r,s:t,v:n})},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,E.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:r()(_.hue,e)},o.createElement("div",{className:_.pointerContainer,ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},o.createElement("div",{className:_.pointer,style:{top:100*t+"%"}})))}}var N=n(99565);const k=(0,a.t)("Add",{context:"Color Picker"});class I extends o.PureComponent{constructor(e){super(e),this._handleHSV=e=>{const t=function(e){const{h:t,s:n,v:o}=e;let s,r,a;const i=Math.floor(6*t),l=6*t-i,c=o*(1-n),u=o*(1-l*n),p=o*(1-(1-l)*n);switch(i%6){case 0:s=o,r=p,a=c;break;case 1:s=u,r=o,a=c;break;case 2:s=c,r=o,a=p;break;case 3:s=c,r=u,a=o;break;case 4:s=p,r=c,a=o;break;case 5:s=o,r=c,a=u;break;default:s=0,r=0,a=0}return"#"+[255*s,255*r,255*a].map(e=>("0"+Math.round(e).toString(16)).replace(/.+?([a-f0-9]{2})$/i,"$1")).join("")}(e)||"#000000";this.setState({color:t,inputColor:t.replace(/^#/,""),hsv:e}),this.props.onSelect(t)},this._handleInput=e=>{const t=e.currentTarget.value;try{const e=y(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||"#000000";this.state={color:t,inputColor:t.replace(/^#/,""),hsv:y(t)}}render(){const{color:e,hsv:t,inputColor:n}=this.state;return o.createElement("div",{className:N.container},o.createElement("div",{className:N.form},o.createElement("div",{className:N.swatch,style:{backgroundColor:e}}),o.createElement("div",{className:N.inputWrap},o.createElement("span",{className:N.inputHash},"#"),o.createElement("input",{type:"text",className:N.input,value:n,onChange:this._handleInput})),o.createElement("div",{className:N.buttonWrap},o.createElement(f.Button,{size:"s",onClick:this._handleAddColor},k))),o.createElement("div",{
className:N.hueSaturationWrap},o.createElement(x,{className:N.saturation,hsv:t,onChange:this._handleHSV}),o.createElement(w,{className:N.hue,hsv:t,onChange:this._handleHSV})))}}var T=n(10667);const P=(0,a.t)("Add custom color",{context:"Color Picker"}),R=(0,a.t)("Opacity",{context:"Color Picker"});class B extends o.PureComponent{constructor(e){super(e),this._handleAddColor=e=>{this.setState({isCustom:!1}),this._onToggleCustom(!1);const{onAddColor:t}=this.props;t&&t(e)},this._handleSelectColor=e=>{const{onColorChange:t}=this.props,{isCustom:n}=this.state;t&&t(e,n)},this._handleCustomClick=()=>{this.setState({isCustom:!0}),this._onToggleCustom(!0)},this._handleOpacity=e=>{const{onOpacityChange:t}=this.props;t&&t(e)},this.state={isCustom:!1}}componentDidUpdate(e,t){e.selectOpacity!==this.props.selectOpacity&&this.props.menu&&this.props.menu.update()}render(){const{color:e,opacity:t,selectCustom:n,selectOpacity:s,customColors:a,onRemoveCustomColor:i}=this.props,{isCustom:l}=this.state,c="number"==typeof t?t:1;return l?o.createElement(I,{color:e,onSelect:this._handleSelectColor,onAdd:this._handleAddColor}):o.createElement("div",{className:T.container},o.createElement(v,{colors:h.basic,color:e,onSelect:this._handleSelectColor}),o.createElement(v,{colors:h.extended,color:e,onSelect:this._handleSelectColor}),o.createElement("div",{className:T.separator}),o.createElement(d.Provider,{value:i},o.createElement(v,{colors:a,color:e,onSelect:this._handleSelectColor},n&&o.createElement("div",{className:r()(T.customButton,"apply-common-tooltip"),onClick:this._handleCustomClick,title:P}))),s&&o.createElement(o.Fragment,null,o.createElement("div",{className:T.sectionTitle},R),o.createElement(C.Opacity,{color:e,opacity:c,onChange:this._handleOpacity})))}_onToggleCustom(e){const{onToggleCustom:t}=this.props;t&&t(e)}}},54368:(e,t,n)=>{"use strict";n.d(t,{Opacity:()=>l});var o=n(59496),s=n(97754),r=n(88537),a=n(64514),i=n(15381);class l 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,r.ensureNotNull)(this._container),n=(0,r.ensureNotNull)(this._pointer),o=t.getBoundingClientRect(),s=n.offsetWidth,i=e.clientX-s/2-o.left,l=(0,a.clamp)(i/(o.width-s),0,1);this.setState({inputOpacity:Math.round(100*l).toString()}),this.props.onChange(l),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.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}=this.props,{inputOpacity:r,isPointerDragged:a}=this.state,l={color:e||void 0};return o.createElement("div",{className:i.opacity},o.createElement("div",{className:i.opacitySlider,style:l,ref:this._refContainer,onMouseDown:this._onSliderClick,onTouchStart:this._onTouchStart,onTouchMove:this._handleTouch,onTouchEnd:this._handleTouchEnd},o.createElement("div",{className:i.opacitySliderGradient,style:{backgroundImage:`linear-gradient(90deg, transparent, ${e})`}}),o.createElement("div",{className:i.opacityPointerWrap},o.createElement("div",{className:s(i.pointer,a&&i.dragged),style:{left:100*t+"%"},ref:this._refPointer}))),!n&&o.createElement("div",{className:i.opacityInputWrap},o.createElement("input",{type:"text",className:i.opacityInput,value:r,onChange:this._handleInput}),o.createElement("span",{className:i.opacityInputPercent},"%")))}_dragSubscribe(){const e=(0,r.ensureNotNull)(this._container).ownerDocument;e&&(e.addEventListener("mouseup",this._mouseUp),e.addEventListener("mousemove",this._mouseMove))}_dragUnsubscribe(){const e=(0,r.ensureNotNull)(this._container).ownerDocument;e&&(e.removeEventListener("mousemove",this._mouseMove),e.removeEventListener("mouseup",this._mouseUp))}}},6914:(e,t,n)=>{"use strict";n.d(t,{white:()=>s,basic:()=>i,extended:()=>c});var o=n(45112);const s=o.colorsPalette["color-white"],r=["ripe-red","tan-orange","banana-yellow","iguana-green","minty-green","sky-blue","tv-blue","deep-blue","grapes-purple","berry-pink"],a=[200,300,400,500,600,700,800,900].map(e=>"color-cold-gray-"+e);a.unshift("color-white"),a.push("color-black"),r.forEach(e=>{a.push(`color-${e}-500`)});const i=a.map(e=>o.colorsPalette[e]),l=[];[100,200,300,400,700,900].forEach(e=>{r.forEach(t=>{l.push(`color-${t}-${e}`)})});const c=l.map(e=>o.colorsPalette[e])},46059:(e,t,n)=>{"use strict";n.d(t,{ControlDisclosureView:()=>E});var o=n(59496),s=n(97754),r=n.n(s),a=n(66092),i=n(67029),l=n(78274),c=n(50628),u=n(88537);function p(e,t){return(0,o.useCallback)(()=>function(e,t){const n=(0,u.ensureNotNull)(e).getBoundingClientRect(),o={x:n.left,y:n.top+n.height};return t&&(o.overrideWidth=n.width),o}(e.current,t),[e,t])}const d=JSON.parse('{"size-header-height":"64px"}'),h=parseInt(d["size-header-height"]);function m(e){const{button:t,popupChildren:n,buttonRef:s,listboxId:r,listboxClassName:a,listboxTabIndex:i,matchButtonAndListboxWidths:l,isOpened:u,scrollWrapReference:d,listboxReference:m,onClose:g,onOpen:b,onListboxFocus:v,onListboxBlur:C,onListboxKeyDown:f,listboxAria:y,repositionOnScroll:E=!0,closeOnHeaderOverlap:S=!1}=e,x=p(s,l),_=S?h:0;return o.createElement(o.Fragment,null,t,o.createElement(c.PopupMenu,{...y,id:r,className:a,tabIndex:i,isOpened:u,position:x,
repositionOnScroll:E,onClose:g,onOpen:b,doNotCloseOn:s.current,reference:m,scrollWrapReference:d,onFocus:v,onBlur:C,onKeyDown:f,closeOnScrollOutsideOffset:_},n))}var g=n(9745),b=n(89974),v=n(99171);function C(e){const{isDropped:t}=e;return o.createElement(g.Icon,{className:r()(v.icon,t&&v.dropped),icon:b})}function f(e){const{className:t,disabled:n,isDropped:s}=e;return o.createElement("span",{className:r()(v.button,n&&v.disabled,t)},o.createElement(C,{isDropped:s}))}var y=n(66230);const E=o.forwardRef((e,t)=>{const{listboxId:n,className:s,listboxClassName:c,listboxTabIndex:u,hideArrowButton:p,matchButtonAndListboxWidths:d,disabled:h,isOpened:g,scrollWrapReference:b,repositionOnScroll:v,closeOnHeaderOverlap:C,listboxReference:E,size:S="medium",onClose:x,onOpen:_,onListboxFocus:w,onListboxBlur:N,onListboxKeyDown:k,buttonChildren:I,children:T,caretClassName:P,listboxAria:R,...B}=e,M=(0,o.useRef)(null),O=!p&&o.createElement(l.EndSlot,null,o.createElement(f,{isDropped:g,disabled:h,className:P}));return o.createElement(m,{buttonRef:M,listboxId:n,listboxClassName:c,listboxTabIndex:u,isOpened:g,onClose:x,onOpen:_,listboxReference:E,scrollWrapReference:b,onListboxFocus:w,onListboxBlur:N,onListboxKeyDown:k,listboxAria:R,matchButtonAndListboxWidths:d,button:o.createElement(i.ControlSkeleton,{...B,"data-role":"listbox",disabled:h,className:r()(y.button,s),size:S,ref:(0,a.useMergedRefs)([M,t]),middleSlot:o.createElement(l.MiddleSlot,null,o.createElement("span",{className:r()(y["button-children"],p&&y.hiddenArrow)},I)),endSlot:O}),popupChildren:T,repositionOnScroll:v,closeOnHeaderOverlap:C})});E.displayName="ControlDisclosureView"},68721:(e,t,n)=>{"use strict";n.d(t,{useControlDisclosure:()=>c});var o=n(59496),s=n(88537),r=n(29202),a=n(47201),i=n(22064),l=n(35749);function c(e){const{intent:t,highlight:n,...c}=e,{isFocused:u,...p}=function(e){const{id:t,disabled:n,buttonTabIndex:c=0,onFocus:u,onBlur:p,onClick:d}=e,[h,m]=(0,o.useState)(!1),[g,b]=(0,r.useFocus)(),v=g||h,C=void 0!==t?(0,i.createDomId)(t,"listbox"):void 0,f=(0,o.useRef)(null),y=(0,o.useCallback)(e=>(0,s.ensureNotNull)(f.current).focus(e),[f]),E=(0,o.useRef)(null),S=(0,o.useCallback)(()=>(0,s.ensureNotNull)(E.current).focus(),[E]),x=(0,o.useCallback)(()=>m(!0),[m]),_=(0,o.useCallback)((e=!1)=>{m(!1);const{activeElement:t}=document;t&&(0,l.isTextEditingField)(t)||y({preventScroll:e})},[m,y]),w=(0,o.useCallback)(()=>{h?_():x()},[h,_,x]),N=n?[]:[u,b.onFocus],k=n?[]:[p,b.onBlur],I=n?[]:[d,w],T=(0,a.createSafeMulticastEventHandler)(...N),P=(0,a.createSafeMulticastEventHandler)(...k),R=(0,a.createSafeMulticastEventHandler)(...I);return{listboxId:C,isOpened:h,isFocused:v,buttonTabIndex:n?-1:c,listboxTabIndex:-1,open:x,close:_,toggle:w,onOpen:S,buttonFocusBindings:{onFocus:T,onBlur:P},onButtonClick:R,buttonRef:f,listboxRef:E,buttonAria:{"aria-controls":h?C:void 0,"aria-expanded":h,"aria-disabled":n}}}(c);return{...p,isFocused:u,highlight:null!=n?n:u,intent:null!=t?t:u?"primary":"default"}}},26597:(e,t,n)=>{"use strict";n.d(t,{useKeyboardActionHandler:()=>a,
useComposedKeyboardActionHandlers:()=>i,useKeyboardEventHandler:()=>l,useKeyboardToggle:()=>c,useKeyboardClose:()=>u,useKeyboardOpen:()=>p});var o=n(59496),s=n(68335);const r=()=>!0;function a(e,t,n=r){return(0,o.useCallback)(o=>{const s=e.map(e=>"function"==typeof e?e():e);return!(!n()||!s.includes(o))&&(t(),!0)},[...e,t,n])}function i(...e){return(0,o.useCallback)(t=>{for(const n of e)if(n(t))return!0;return!1},[...e])}function l(...e){const t=i(...e);return(0,o.useCallback)(e=>{t((0,s.hashFromEvent)(e))&&e.preventDefault()},[t])}function c(e){return a([13,32],e)}function u(e,t){return a([9,(0,o.useCallback)(()=>s.Modifiers.Shift+9,[]),27],t,(0,o.useCallback)(()=>e,[e]))}function p(e,t){return a([40,38],t,(0,o.useCallback)(()=>!e,[e]))}},56512:(e,t,n)=>{"use strict";n.d(t,{useCustomColors:()=>l});var o=n(59496),s=n(56840),r=n(76422);function a(e,t){(0,o.useEffect)(()=>(r.subscribe(e,t,null),()=>{r.unsubscribe(e,t,null)}),[e,t])}var i=n(24377);function l(){const[e,t]=(0,o.useState)((0,s.getJSON)("pickerCustomColors",[]));a("add_new_custom_color",n=>t(c(n,e))),a("remove_custom_color",n=>t(u(n,e)));const n=(0,o.useCallback)(t=>{const n=t?(0,i.parseRgb)(t):null;e.some(e=>null!==e&&null!==n&&(0,i.areEqualRgb)((0,i.parseRgb)(e),n))||(r.emit("add_new_custom_color",t),(0,s.setJSON)("pickerCustomColors",c(t,e)))},[e]),l=(0,o.useCallback)(t=>{(t>=0||t<e.length)&&(r.emit("remove_custom_color",t),(0,s.setJSON)("pickerCustomColors",u(t,e)))},[e]);return[e,n,l]}function c(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)}},45685:(e,t,n)=>{"use strict";n.d(t,{Select:()=>k});var o=n(59496),s=n(22064),r=n(66092),a=n(88537),i=n(74991);const l={duration:200,additionalScroll:0},c={vertical:{scrollSize:"scrollHeight",clientSize:"clientHeight",start:"top",end:"bottom",size:"height"},horizontal:{scrollSize:"scrollWidth",clientSize:"clientWidth",start:"left",end:"right",size:"width"}};function u(e,t){const n=c[e];return t[n.scrollSize]>t[n.clientSize]}function p(e,t,n,o,s,r){const a=function(e,t,n,o=0){const s=c[e];return{start:-1*o,middle:-1*(Math.floor(n[s.size]/2)-Math.floor(t[s.size]/2)),end:-1*(n[s.size]-t[s.size])+o}}(e,o,s,r.additionalScroll);let l=0;if(function(e,t,n){const o=c[e];return t[o.start]<n[o.start]-n[o.size]/2||t[o.end]>n[o.end]+n[o.size]/2}(e,o,s))l=a.middle;else{const t=function(e){const{start:t,middle:n,end:o}=e,s=new Map([[Math.abs(t),{key:"start",value:Math.sign(t)}],[Math.abs(n),{key:"middle",value:Math.sign(n)}],[Math.abs(o),{key:"end",value:Math.sign(o)}]]),r=Math.min(...s.keys());return s.get(r)}(function(e,t,n,o=0){const s=c[e],r=t[s.start]+Math.floor(t[s.size]/2),a=n[s.start]+Math.floor(n[s.size]/2);return{start:t[s.start]-n[s.start]-o,middle:r-a,end:t[s.end]-n[s.end]+o}}(e,o,s,r.additionalScroll));l=void 0!==t?a[t.key]:0}return function(e){const{additionalScroll:t=0,duration:n=i.dur,func:o=i.easingFunc.easeInOutCubic,onScrollEnd:s,target:r,wrap:a,direction:l="vertical"}=e;let{targetRect:c,wrapRect:u}=e;c=null!=c?c:r.getBoundingClientRect(),
u=null!=u?u:a.getBoundingClientRect();const p=("vertical"===l?c.top-u.top:c.left-u.left)+t,d="vertical"===l?"scrollTop":"scrollLeft",h=a?a[d]:0;let m,g=0;return g=window.requestAnimationFrame((function e(t){let r;if(m?r=t-m:(r=0,m=t),r>=n)return a[d]=h+p,void(s&&s());const i=h+p*o(r/n);a[d]=Math.floor(i),g=window.requestAnimationFrame(e)})),function(){window.cancelAnimationFrame(g),s&&s()}}({...r,target:t,targetRect:o,wrap:n,wrapRect:s,additionalScroll:l,direction:e})}class d{constructor(e=null){this._container=null,this._lastScrolledElement=null,this._stopVerticalScroll=null,this._stopHorizontalScroll=null,this._container=e}scrollTo(e,t=l){if(null!==this._container&&null!==e&&!function(e,t){const n=e.getBoundingClientRect(),o=t.getBoundingClientRect();return n.top>=o.top&&n.bottom<=o.bottom&&n.left>=o.left&&n.right<=o.right}(e,this._container)){const n=e.getBoundingClientRect(),o=this._container.getBoundingClientRect();this.stopScroll(),u("vertical",this._container)&&(this._stopVerticalScroll=p("vertical",e,this._container,n,o,this._modifyOptions("vertical",t))),u("horizontal",this._container)&&(this._stopHorizontalScroll=p("horizontal",e,this._container,n,o,this._modifyOptions("horizontal",t)))}this._lastScrolledElement=e}scrollToLastElement(e){this.scrollTo(this._lastScrolledElement,e)}stopScroll(){null!==this._stopVerticalScroll&&this._stopVerticalScroll(),null!==this._stopHorizontalScroll&&this._stopHorizontalScroll()}getContainer(){return this._container}setContainer(e){var t;this._container=e,(null===(t=this._container)||void 0===t?void 0:t.contains(this._lastScrolledElement))||(this._lastScrolledElement=null)}destroy(){this.stopScroll(),this._container=null,this._lastScrolledElement=null}_handleScrollEnd(e){"vertical"===e?this._stopVerticalScroll=null:this._stopHorizontalScroll=null}_modifyOptions(e,t){return Object.assign({},t,{onScrollEnd:()=>{this._handleScrollEnd(e),void 0!==t.onScrollEnd&&t.onScrollEnd()}})}}function h(e,t){const n=(0,o.useRef)(null),s=(0,o.useRef)(new WeakMap),r=function(e){const t=(0,o.useRef)(null);return(0,o.useEffect)(()=>(t.current=new d(e),()=>(0,a.ensureNotNull)(t.current).destroy()),[]),t}(n.current),i=(0,o.useCallback)(()=>{null!==r.current&&null!==n.current&&r.current.getContainer()!==n.current&&r.current.setContainer(n.current)},[r,n]),l=(0,o.useCallback)(e=>{n.current=e},[n]),c=(0,o.useCallback)((e,t)=>{s.current.set(e,t)},[s]),u=(0,o.useCallback)((e,t)=>{if(!e)return;const n=s.current.get(e);n&&(i(),(0,a.ensureNotNull)(r.current).scrollTo(n,t))},[s,r]);return(0,o.useEffect)(()=>u(e,t),[u,e]),[l,c,u]}var m=n(16396),g=n(4889),b=n(43370);var v=n(62820),C=n(26597);function f(e,t){return e>=0?e%t:(t-Math.abs(e)%t)%t}const y={next:[40,()=>(0,v.isRtl)()?37:39],previous:[38,()=>(0,v.isRtl)()?39:37],first:[33,36],last:[34,35]};var E=n(46059),S=n(68721),x=n(79756);function _(e){return!e.readonly}function w(e,t){var n;return null!==(n=null==t?void 0:t.id)&&void 0!==n?n:(0,s.createDomId)(e,"item",null==t?void 0:t.value)}function N(e){var t,n;const{selectedItem:s,placeholder:r}=e
;if(!s)return o.createElement("span",{className:x.placeholder},r);const a=null!==(n=null!==(t=s.selectedContent)&&void 0!==t?t:s.content)&&void 0!==n?n:s.value;return o.createElement("span",null,a)}const k=o.forwardRef((e,t)=>{const{id:n,menuClassName:a,menuItemClassName:i,tabIndex:l,disabled:c,highlight:u,intent:p,hideArrowButton:d,placeholder:v,addPlaceholderToItems:x=!0,value:k,"aria-labelledby":I,onFocus:T,onBlur:P,onClick:R,onChange:B,repositionOnScroll:M=!0,...O}=e;let{items:A}=e;if(v&&x){A=[{value:void 0,content:v,id:(0,s.createDomId)(n,"placeholder")},...A]}const{listboxId:D,isOpened:z,isFocused:V,buttonTabIndex:F,listboxTabIndex:L,highlight:G,intent:W,open:j,onOpen:H,close:K,toggle:U,buttonFocusBindings:X,onButtonClick:Q,buttonRef:q,listboxRef:Y,buttonAria:$}=(0,S.useControlDisclosure)({id:n,disabled:c,buttonTabIndex:l,intent:p,highlight:u,onFocus:T,onBlur:P,onClick:R}),J=A.filter(_),Z=J.find(e=>e.value===k),[ee,te,ne]=h(Z),oe=(0,s.joinDomIds)(I,n),se=oe.length>0?oe:void 0,re=(0,o.useMemo)(()=>({role:"listbox","aria-labelledby":I,"aria-activedescendant":w(n,Z)}),[I,Z]),ae=(0,o.useCallback)(e=>e.value===k,[k]),ie=(0,o.useCallback)(e=>B&&B(e.value),[B]),le=function(e,t,n,s=!0,r={}){const a=(0,o.useCallback)(()=>{const o=e.findIndex(t);if(o===e.length-1&&!s)return;const r=f(o+1,e.length);n&&n(e[r])},[e,t,n,s]),i=(0,o.useCallback)(()=>{const o=e.findIndex(t);if(0===o&&!s)return;const r=f(o-1,e.length);n&&n(e[r])},[e,t,n,s]),l=(0,o.useCallback)(()=>{n&&n(e[0])},[n,e]),c=(0,o.useCallback)(()=>{n&&n(e[e.length-1])},[n,e]),{next:u=y.next,previous:p=y.previous,first:d=y.first,last:h=y.last}=r;return(0,C.useComposedKeyboardActionHandlers)((0,C.useKeyboardActionHandler)(u,a),(0,C.useKeyboardActionHandler)(p,i),(0,C.useKeyboardActionHandler)(d,l),(0,C.useKeyboardActionHandler)(h,c))}(J,ae,ie,!1,{next:[40],previous:[38]}),ce=(0,C.useKeyboardToggle)(U),ue=(0,C.useKeyboardClose)(z,K),pe=(0,C.useKeyboardOpen)(z,j),de=(0,C.useKeyboardEventHandler)(ce,ue,pe),he=(0,C.useKeyboardEventHandler)(le,ce,ue),me=function(e){const t=(0,o.useRef)(""),n=(0,o.useMemo)(()=>(0,g.default)(()=>{t.current=""},500),[]),s=(0,o.useMemo)(()=>(0,b.default)(e,200),[e]);return(0,o.useCallback)(e=>{e.key.length>0&&e.key.length<3&&(t.current+=e.key,s(t.current,e),n())},[n,s])}((e,t)=>{const n=function(e,t){return e.find(e=>{var n;const o=t.toLowerCase();return!e.readonly&&(!e.readonly&&("string"==typeof e.content&&e.content.toLowerCase().startsWith(o)||String(null!==(n=e.value)&&void 0!==n?n:"").toLowerCase().startsWith(o)))})}(J,e);void 0!==n&&B&&(t.stopPropagation(),z||j(),B(n.value))});return o.createElement(E.ControlDisclosureView,{...O,...$,...X,id:n,role:"button",tabIndex:F,"aria-owns":$["aria-controls"],"aria-haspopup":"listbox","aria-labelledby":se,disabled:c,hideArrowButton:d,isFocused:V,isOpened:z,highlight:G,intent:W,ref:(0,r.useMergedRefs)([q,t]),onClick:Q,onOpen:function(){ne(Z,{duration:0}),H()},onClose:K,onKeyDown:function(e){de(e),e.defaultPrevented||me(e)},listboxId:D,listboxTabIndex:L,listboxClassName:a,listboxAria:re,
listboxReference:Y,scrollWrapReference:ee,onListboxKeyDown:function(e){he(e),e.defaultPrevented||me(e)},buttonChildren:o.createElement(N,{selectedItem:Z,placeholder:v}),repositionOnScroll:M},A.map((e,t)=>{var s;if(e.readonly)return o.createElement(o.Fragment,{key:"readonly_item_"+t},e.content);const r=w(n,e);return o.createElement(m.PopupMenuItem,{key:r,id:r,className:i,role:"option","aria-selected":k===e.value,isActive:k===e.value,label:null!==(s=e.content)&&void 0!==s?s:e.value,onClick:ge,onClickArg:e.value,isDisabled:e.disabled,reference:t=>te(e,t)})}));function ge(e){B&&B(e)}});k.displayName="Select"},86656:(e,t,n)=>{"use strict";n.d(t,{TouchScrollContainer:()=>i});var o=n(59496),s=n(59142),r=n(88537),a=n(49483);function i(e){const{reference:t,children:n,...r}=e,i=(0,o.useRef)(null),c=(0,o.useCallback)(e=>{t&&(t.current=e),a.CheckMobile.iOS()&&(null!==i.current&&(0,s.enableBodyScroll)(i.current),i.current=e,null!==i.current&&(0,s.disableBodyScroll)(i.current,{allowTouchMove:l(i)}))},[t]);return o.createElement("div",{ref:c,...r},n)}function l(e){return t=>{const n=(0,r.ensureNotNull)(e.current),o=document.activeElement;return!n.contains(t)||null!==o&&n.contains(o)&&o.contains(t)}}},49154: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>'},89974:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 7" width="11" height="7" fill="none"><path stroke="currentColor" stroke-width="1.3" d="M.5 1.5l5 4 5-4"/></svg>'},36826:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M13.5 7l1.65-1.65a.5.5 0 0 0 0-.7l-1.8-1.8a.5.5 0 0 0-.7 0L11 4.5M13.5 7L11 4.5M13.5 7l-8.35 8.35a.5.5 0 0 1-.36.15H2.5v-2.3a.5.5 0 0 1 .15-.35L11 4.5"/></svg>'},60495:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18" height="18" fill="none"><path stroke="currentColor" d="M8 8.5h1.5V14"/><circle fill="currentColor" cx="9" cy="5" r="1"/><path stroke="currentColor" d="M16.5 9a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0z"/></svg>'}}]);