(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[2306],{66783:e=>{"use strict";var t=Object.prototype.hasOwnProperty;function o(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}e.exports=function(e,i){if(o(e,i))return!0;if("object"!=typeof e||null===e||"object"!=typeof i||null===i)return!1;var n=Object.keys(e),r=Object.keys(i);if(n.length!==r.length)return!1;for(var s=0;s{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"}},70132:e=>{e.exports={}},19619:e=>{e.exports={}},65719:e=>{e.exports={}},88803:e=>{e.exports={"tablet-normal-breakpoint":"screen and (max-width: 768px)","small-height-breakpoint":"screen and (max-height: 360px)","tablet-small-breakpoint":"screen and (max-width: 430px)"}},12005:e=>{e.exports={wrap:"wrap-Nn3SCuEL",icon:"icon-Nn3SCuEL",colorBg:"colorBg-Nn3SCuEL",color:"color-Nn3SCuEL",multicolor:"multicolor-Nn3SCuEL",white:"white-Nn3SCuEL"}},31188:e=>{e.exports={button:"button-BuUjli6L"}},20835:e=>{e.exports={item:"item-KdWj36gM",withIcon:"withIcon-KdWj36gM",icon:"icon-KdWj36gM",labelRow:"labelRow-KdWj36gM",multiWidth:"multiWidth-KdWj36gM",buttonWrap:"buttonWrap-KdWj36gM",buttonLabel:"buttonLabel-KdWj36gM"}},93402:e=>{e.exports={container:"container-mdcOkvbj",sectionTitle:"sectionTitle-mdcOkvbj",separator:"separator-mdcOkvbj",customButton:"customButton-mdcOkvbj",accessible:"accessible-mdcOkvbj"}},80679: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"}},1369:e=>{e.exports={hue:"hue-r4uo5Wn6",pointer:"pointer-r4uo5Wn6",accessible:"accessible-r4uo5Wn6",pointerContainer:"pointerContainer-r4uo5Wn6"}},30099: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"}},35257:e=>{e.exports={saturation:"saturation-NFNfqP2w",pointer:"pointer-NFNfqP2w",accessible:"accessible-NFNfqP2w"}},87466: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"}},94720:(e,t,o)=>{"use strict";o.d(t,{Button:()=>b});var i=o(50959),n=o(97754),r=o(95604),s=o(9745),l=o(1414),a=o.n(l);const c="apply-overflow-tooltip apply-overflow-tooltip--check-children-recursively apply-overflow-tooltip--allow-text";function h(e){const{color:t="brand",size:o="medium",variant:i="primary",stretch:s=!1,icon:l,startIcon:h,endIcon:d,iconOnly:u=!1,className:p,isGrouped:m,cellState:g,disablePositionAdjustment:v=!1,primaryText:_,secondaryText:w,isAnchor:f=!1}=e,y=function(e){let t="";return 0!==e&&(1&e&&(t=n(t,a()["no-corner-top-left"])),2&e&&(t=n(t,a()["no-corner-top-right"])),4&e&&(t=n(t,a()["no-corner-bottom-right"])),8&e&&(t=n(t,a()["no-corner-bottom-left"]))),t}((0,r.getGroupCellRemoveRoundBorders)(g));return n(p,a().button,a()[`size-${o}`],a()[`color-${t}`],a()[`variant-${i}`],s&&a().stretch,(l||h)&&a()["with-start-icon"],d&&a()["with-end-icon"],u&&a()["icon-only"],y,m&&a().grouped,m&&!v&&a()["adjust-position"],m&&g.isTop&&a()["first-row"],m&&g.isLeft&&a()["first-col"],_&&w&&a()["multiline-content"],f&&a().link,c)}function d(e){const{startIcon:t,icon:o,iconOnly:r,children:l,endIcon:h,primaryText:d,secondaryText:u}=e,p=null!=t?t:o,m=!(t||o||h||r)&&!l&&d&&u;return i.createElement(i.Fragment,null,p&&i.createElement(s.Icon,{icon:p,className:a()["start-icon-wrap"]}),l&&i.createElement("span",{className:a().content},l),h&&!r&&i.createElement(s.Icon,{icon:h,className:a()["end-icon-wrap"]}),m&&function(e){return e.primaryText&&e.secondaryText&&i.createElement("div",{className:n(a()["text-wrap"],c)},i.createElement("span",{className:a()["primary-text"]}," ",e.primaryText," "),"string"==typeof e.secondaryText?i.createElement("span",{className:a()["secondary-text"]}," ",e.secondaryText," "):i.createElement("span",{className:a()["secondary-text"]},i.createElement("span",null,e.secondaryText.firstLine),i.createElement("span",null,e.secondaryText.secondLine)))}(e))}var u=o(34094),p=o(86332),m=o(90186);function g(e){ const{className:t,color:o,variant:i,size:n,stretch:r,animated:s,icon:l,iconOnly:a,startIcon:c,endIcon:h,primaryText:d,secondaryText:u,...p}=e;return{...p,...(0,m.filterDataProps)(e),...(0,m.filterAriaProps)(e)}}function v(e){const{reference:t,tooltipText:o,...n}=e,{isGrouped:r,cellState:s,disablePositionAdjustment:l}=(0,i.useContext)(p.ControlGroupContext),a=h({...n,isGrouped:r,cellState:s,disablePositionAdjustment:l});return i.createElement("button",{...g(n),className:a,ref:t,"data-overflow-tooltip-text":null!=o?o:e.primaryText?[e.primaryText,e.secondaryText].join(" "):(0,u.getTextForTooltip)(e.children)},i.createElement(d,{...n}))}function _(e="default"){switch(e){case"default":return"primary";case"stroke":return"secondary"}}function w(e="primary"){switch(e){case"primary":return"brand";case"success":return"green";case"default":return"gray";case"danger":return"red"}}function f(e="m"){switch(e){case"s":return"xsmall";case"m":return"small";case"l":return"large"}}function y(e){const{intent:t,size:o,appearance:i,useFullWidth:n,icon:r,...s}=e;return{...s,color:w(t),size:f(o),variant:_(i),stretch:n,startIcon:r}}function b(e){return i.createElement(v,{...y(e)})}},86332:(e,t,o)=>{"use strict";o.d(t,{ControlGroupContext:()=>i});const i=o(50959).createContext({isGrouped:!1,cellState:{isTop:!0,isRight:!0,isBottom:!0,isLeft:!0}})},95604:(e,t,o)=>{"use strict";function i(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}o.d(t,{getGroupCellRemoveRoundBorders:()=>i})},56073:(e,t,o)=>{"use strict";function i(e,t=!1){const o=getComputedStyle(e),i=[o.height];return"border-box"!==o.boxSizing&&i.push(o.paddingTop,o.paddingBottom,o.borderTopWidth,o.borderBottomWidth),t&&i.push(o.marginTop,o.marginBottom),i.reduce(((e,t)=>e+(parseFloat(t)||0)),0)}function n(e,t=!1){const o=getComputedStyle(e),i=[o.width];return"border-box"!==o.boxSizing&&i.push(o.paddingLeft,o.paddingRight,o.borderLeftWidth,o.borderRightWidth),t&&i.push(o.marginLeft,o.marginRight),i.reduce(((e,t)=>e+(parseFloat(t)||0)),0)}o.d(t,{outerHeight:()=>i,outerWidth:()=>n})},34094:(e,t,o)=>{"use strict";o.d(t,{getTextForTooltip:()=>s});var i=o(50959);const n=e=>(0,i.isValidElement)(e)&&Boolean(e.props.children),r=e=>null==e||"boolean"==typeof e||"{}"===JSON.stringify(e)?"":e.toString()+" ",s=e=>Array.isArray(e)||(0,i.isValidElement)(e)?i.Children.toArray(e).reduce(((e,t)=>{let o="";return o=(0,i.isValidElement)(t)&&n(t)?s(t.props.children):(0,i.isValidElement)(t)&&!n(t)?"":r(t),e.concat(o)}),"").trim():r(e)},52778:(e,t,o)=>{"use strict";o.d(t,{OutsideEvent:()=>n});var i=o(36383);function n(e){const{children:t,...o}=e;return t((0,i.useOutsideEvent)(o))}},24437:(e,t,o)=>{"use strict";o.d(t,{DialogBreakpoints:()=>n});var i=o(88803);const n={SmallHeight:i["small-height-breakpoint"],TabletSmall:i["tablet-small-breakpoint"],TabletNormal:i["tablet-normal-breakpoint"]}},70114:(e,t,o)=>{"use strict";o.d(t,{ColorPickerButton:()=>_}) ;var i=o(50959),n=o(97754),r=o.n(n),s=o(50151),l=o(9745),a=o(24377),c=o(87095),h=o(56512),d=o(35789),u=o(6914),p=o(8087),m=o(43982),g=o(12811),v=o(12005);function _(e){const{property:t,icon:o,propertyApplier:n,title:_,undoText:w,isToolbarFixed:f,className:y}=e,b=(0,m.useProperty)(t),T=(0,i.useRef)(null),C=b?(0,a.parseRgba)(b)[3]:void 0,x=""===b,L=String(A()).toLowerCase()===u.white,[S,P,E]=(0,h.useCustomColors)();return i.createElement(p.ToolWidgetMenu,{className:y,verticalDropDirection:f?g.VerticalDropDirection.FromBottomToTop:void 0,horizontalDropDirection:f?g.HorizontalDropDirection.FromLeftToRight:void 0,horizontalAttachEdge:f?g.HorizontalAttachEdge.Left:void 0,verticalAttachEdge:f?g.VerticalAttachEdge.Top:void 0,content:i.createElement("div",{className:v.wrap},i.createElement(l.Icon,{className:v.icon,icon:o}),i.createElement("div",{className:v.colorBg},i.createElement("div",{className:r()(v.color,x&&v.multicolor,L&&v.white),style:x?void 0:{backgroundColor:b}}))),arrow:!1,title:_,ref:T,"data-name":e["data-name"],menuDataName:`${e["data-name"]}-menu`},i.createElement(d.ColorPicker,{color:A(),opacity:C,onColorChange:function(e,t){const o=b?(0,c.alphaToTransparency)((0,a.parseRgba)(b)[3]):0;B((0,c.generateColor)(String(e),o,true)),t||(0,s.ensureNotNull)(T.current).close()},onOpacityChange:function(e){B((0,c.generateColor)(b,(0,c.alphaToTransparency)(e),!0))},selectOpacity:void 0!==C,selectCustom:!0,customColors:S,onAddColor:function(e){P(e),(0,s.ensureNotNull)(T.current).close()},onRemoveCustomColor:E}));function A(){return b?(0,a.rgbToHexString)((0,a.parseRgb)(b)):null}function B(e){n.setProperty(t,e,w)}}},61259:(e,t,o)=>{"use strict";o.d(t,{LineWidthButton:()=>y});var i=o(50959),n=o(97754),r=o(50151),s=o(9745),l=o(8087),a=o(43982),c=o(16396),h=o(40173),d=o(12811),u=o(22978),p=o(14631),m=o(6096),g=o(6483),v=o(66611),_=o(20835);const w=(0,h.mergeThemes)(c.DEFAULT_POPUP_MENU_ITEM_THEME,_),f=[{value:1,icon:u},{value:2,icon:p},{value:3,icon:m},{value:4,icon:g}];function y(e){const{multipleProperty:t,title:o,undoText:h,propertyApplier:u,isToolbarFixed:p,className:m,isSmallScreen:g}=e,y=(0,a.useProperty)((0,r.ensureDefined)(t)),b="mixed"===y||!y,T=function(e){const t=f.find((t=>t.value===e));if(!t)return v;return t.icon}(y);return i.createElement(l.ToolWidgetMenu,{className:m,arrow:!1,title:o,"data-name":e["data-name"],menuDataName:`${e["data-name"]}-menu`,verticalDropDirection:p?d.VerticalDropDirection.FromBottomToTop:void 0,horizontalDropDirection:p?d.HorizontalDropDirection.FromRightToLeft:void 0,horizontalAttachEdge:p?d.HorizontalAttachEdge.Right:void 0,verticalAttachEdge:p?d.VerticalAttachEdge.Top:void 0,content:i.createElement("div",null,b?i.createElement("div",{className:_.multiWidth},i.createElement(s.Icon,{icon:v})):i.createElement("div",{className:_.buttonWrap},!g&&i.createElement(s.Icon,{icon:T}),i.createElement("div",{className:n(!g&&_.buttonLabel)},`${y}px`)))},f.map((({value:e,icon:t})=>i.createElement(c.PopupMenuItem,{key:e,theme:w,label:`${e}px`,icon:t,isActive:e===y,onClick:C,onClickArg:e})))) ;function C(e){e&&t&&(u.beginUndoMacro(h),t.setValue(e,void 0,{applyValue:(e,t)=>{u.setProperty(e,t,h)}}),u.endUndoMacro())}}},43982:(e,t,o)=>{"use strict";o.d(t,{useProperty:()=>n});var i=o(50959);const n=e=>{const[t,o]=(0,i.useState)(e.value());return(0,i.useEffect)((()=>{const t=e=>{o(e.value())};t(e);const i={};return e.subscribe(i,t),()=>e.unsubscribe(i,t)}),[e]),t}},59369:(e,t,o)=>{"use strict";o.d(t,{useRowsNavigation:()=>c});var i=o(50959),n=o(50151),r=o(16838),s=o(68335),l=o(71468);const a=[37,39,38,40];function c(e){const t=(0,i.useRef)(null);return(0,i.useLayoutEffect)((()=>{if(!r.PLATFORM_ACCESSIBILITY_ENABLED)return;const e=(0,n.ensureNotNull)(t.current),o=()=>{const o=(0,r.queryTabbableElements)(e).sort(r.navigationOrderComparator);if(0===o.length||o[0].parentElement&&!u(o[0].parentElement,(0,n.ensureNotNull)(t.current))){const i=function(e){const o=d(e).sort(r.navigationOrderComparator).find((e=>u(e,(0,n.ensureNotNull)(t.current))));if(!o)return null;const i=Array.from(o.children);if(!i.length)return null;return i[0]}(e);if(null===i)return;if((0,l.becomeMainElement)(i),o.length>0)for(const e of o)(0,l.becomeSecondaryElement)(e)}};return window.addEventListener("keyboard-navigation-activation",o),o(),()=>window.removeEventListener("keyboard-navigation-activation",o)}),[]),[t,function(t){if(!r.PLATFORM_ACCESSIBILITY_ENABLED)return;if(t.defaultPrevented)return;const o=(0,s.hashFromEvent)(t);if(!a.includes(o))return;const i=document.activeElement;if(!(i instanceof HTMLElement))return;const n=t.currentTarget;let l,c;if(e){const e=i.parentElement;l=e?Array.from(e.children):[],c=l.indexOf(i)}else l=(u=n,Array.from(u.querySelectorAll("button:not([disabled]):not([aria-disabled])")).filter((0,r.createScopedVisibleElementFilter)(u))).sort(r.navigationOrderComparator),c=l.indexOf(i);var u;if(0===l.length||-1===c)return;const m=(0,r.mapKeyCodeToDirection)(o);switch(m){case"inlinePrev":if(t.preventDefault(),!e&&0===c)break;p(h(l,c,-1));break;case"inlineNext":if(t.preventDefault(),!e&&c===l.length-1)break;p(h(l,c,1));break;case"blockPrev":case"blockNext":(o=>{if(!document.activeElement)return;const i=d(n),r=document.activeElement.parentElement;if(!r)return;const s=Array.from(r.children).indexOf(document.activeElement);if(-1===s)return;const l=i["blockNext"===o?i.indexOf(r)+1:i.indexOf(r)-1];if(!l)return;t.preventDefault();const a=Array.from(l.children);a.length&&(!e&&s<=a.length-1?p(a[s]):p(a[0]))})(m)}}]}function h(e,t,o){return e[(t+e.length+o)%e.length]}function d(e){return Array.from(e.querySelectorAll('[data-role="row"]')).filter((0,r.createScopedVisibleElementFilter)(e))}function u(e,t){const o=(0,n.ensureNotNull)(e.parentElement).offsetTop,i=o+(0,n.ensureNotNull)(e.parentElement).clientHeight,r=t.scrollTop,s=r+t.clientHeight;return o>=r&&i<=s}function p(e){document.activeElement&&(0,l.becomeSecondaryElement)(document.activeElement),(0,l.becomeMainElement)(e),e.focus()}},35789:(e,t,o)=>{"use strict";o.d(t,{ColorPicker:()=>j}) ;var i=o(50959),n=o(97754),r=o.n(n),s=o(11542),l=o(16838),a=o(59369),c=o(43688),h=o(93532),d=o(45582),u=Math.ceil,p=Math.max;const m=function(e,t,o){t=(o?(0,h.default)(e,t,o):void 0===t)?1:p((0,d.default)(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var n=0,r=0,s=Array(u(i/t));ni.createElement("div",{className:C.row,"data-role":"row",key:t},e.map(((e,o)=>i.createElement(x,{key:String(e)+o,color:e,selected:l&&(0,g.areEqualRgb)(l,(0,g.parseRgb)(String(e))),onSelect:c,onSwatchRemove:s?()=>function(e,t){const o=10*e+t;null==s||s(o)}(t,o):void 0})))))),n);function c(e){r&&r(e)}}var S=o(54368),P=o(94720);function E(e){const t=`Invalid RGB color: ${e}`;if(null===e)throw new Error(t);const o=e.match(/^#?([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i);if(null===o)throw new Error(t);const[,i,n,r]=o;if(!i||!n||!r)throw new Error(t);const s=parseInt(i,16)/255,l=parseInt(n,16)/255,a=parseInt(r,16)/255,c=Math.max(s,l,a),h=Math.min(s,l,a);let d;const u=c,p=c-h,m=0===c?0:p/c;if(c===h)d=0;else{switch(c){case s:d=(l-a)/p+(l{this._container=e},this._handlePosition=e=>{const{hsv:{h:t},onChange:o}=this.props;if(!o)return;const i=(0,v.ensureNotNull)(this._container).getBoundingClientRect(),n=e.clientX-i.left,r=e.clientY-i.top;o({h:t,s:(0,M.clamp)(n/i.width,0,1),v:(0,M.clamp)(1-r/i.height,0,1)})},this._handleKeyDown=e=>{const{hsv:{h:t,s:o,v:i},onChange:n}=this.props,r=(0,B.hashFromEvent)(e);if(!n||!D.includes(r))return;if(37===r||39===r){return void n({h:t,s:(0,M.clamp)(37===r?o-k:o+k,0,1),v:i})}n({h:t,s:o,v:(0, M.clamp)(40===r?i-k:i+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,A.default)(this._handlePosition,100),this._handleTouch=e=>{this._handlePosition(e.nativeEvent.touches[0])}}render(){const{className:e,hsv:{h:t,s:o,v:n}}=this.props,s=`hsl(${360*t}, 100%, 50%)`;return i.createElement("div",{tabIndex:l.PLATFORM_ACCESSIBILITY_ENABLED?0:-1,className:r()(l.PLATFORM_ACCESSIBILITY_ENABLED&&z.accessible,e),onKeyDown:this._handleKeyDown},i.createElement("div",{className:z.saturation,style:{backgroundColor:s},ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},i.createElement("div",{className:z.pointer,style:{left:100*o+"%",top:100*(1-n)+"%"}})))}}var W=o(1369);class I extends i.PureComponent{constructor(){super(...arguments),this._container=null,this._refContainer=e=>{this._container=e},this._handlePosition=e=>{const{hsv:{s:t,v:o},onChange:i}=this.props;if(!i)return;const n=(0,v.ensureNotNull)(this._container).getBoundingClientRect(),r=e.clientY-n.top;i({h:(0,M.clamp)(r/n.height,0,1),s:t,v:o})},this._handleKeyDown=e=>{const{hsv:{h:t,s:o,v:i},onChange:n}=this.props,r=(0,B.hashFromEvent)(e);if(!n||38!==r&&40!==r)return;n({h:(0,M.clamp)(38===r?t-.01:t+.01,0,1),s:o,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,A.default)(this._handlePosition,100),this._handleTouch=e=>{this._handlePosition(e.nativeEvent.touches[0])}}render(){const{className:e,hsv:{h:t}}=this.props;return i.createElement("div",{className:r()(W.hue,l.PLATFORM_ACCESSIBILITY_ENABLED&&W.accessible,e),tabIndex:l.PLATFORM_ACCESSIBILITY_ENABLED?0:-1,onKeyDown:this._handleKeyDown},i.createElement("div",{className:W.pointerContainer,ref:this._refContainer,onMouseDown:this._mouseDown,onTouchStart:this._handleTouch,onTouchMove:this._handleTouch},i.createElement("div",{className:W.pointer,style:{top:100*t+"%"}})))}}var R=o(80679);const F="#000000",V=s.t(null,{context:"Color Picker"},o(40276));class O extends i.PureComponent{constructor(e){super(e),this._inputRef=i.createRef(),this._handleHSV=e=>{const t=function(e){const{h:t,s:o,v:i}=e;let n,r,s;const l=Math.floor(6*t),a=6*t-l,c=i*(1-o),h=i*(1-a*o),d=i*(1-(1-a)*o);switch(l%6){case 0:n=i,r=d,s=c;break;case 1:n=h,r=i,s=c;break;case 2:n=c,r=i,s=d;break;case 3:n=c,r=h,s=i;break;case 4:n=d,r=c,s=i;break;case 5:n=i,r=c,s=h;break;default:n=0,r=0,s=0}return"#"+[255*n,255*r,255*s].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=E(t),o=`#${t}`;this.setState({color:o,inputColor:t,hsv:e}),this.props.onSelect(o)}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:E(t)}}componentDidMount(){var e;l.PLATFORM_ACCESSIBILITY_ENABLED&&!_.CheckMobile.any()&&(null===(e=this._inputRef.current)||void 0===e||e.focus())}render(){const{color:e,hsv:t,inputColor:o}=this.state;return i.createElement("div",{className:R.container},i.createElement("div",{className:R.form},i.createElement("div",{className:R.swatch,style:{backgroundColor:e}}),i.createElement("div",{className:R.inputWrap},i.createElement("span",{className:R.inputHash},"#"),i.createElement("input",{ref:this._inputRef,type:"text",className:R.input,value:o,onChange:this._handleInput})),i.createElement("div",{className:R.buttonWrap},i.createElement(P.Button,{size:"s",onClick:this._handleAddColor},V))),i.createElement("div",{className:R.hueSaturationWrap},i.createElement(N,{className:R.saturation,hsv:t,onChange:this._handleHSV}),i.createElement(I,{className:R.hue,hsv:t,onChange:this._handleHSV})))}}var H=o(93402);const K=s.t(null,{context:"Color Picker"},o(53585)),Z=s.t(null,{context:"Color Picker"},o(81865));function j(e){const{color:t,opacity:o,selectCustom:n,selectOpacity:s,customColors:c,onRemoveCustomColor:h,onToggleCustom:d,onOpacityChange:u,menu:p}=e,[m,g]=(0,i.useState)(!1),v="number"==typeof o?o:1,[_,w]=(0,a.useRowsNavigation)();return(0,i.useLayoutEffect)((()=>{p&&p.update()}),[s,p]),m?i.createElement(O,{color:t,onSelect:f,onAdd:function(t){g(!1),null==d||d(!1);const{onAddColor:o}=e;o&&o(t)}}):i.createElement("div",{className:H.container},i.createElement("div",{ref:_,onKeyDown:w},i.createElement(L,{colors:y.basic,color:t,onSelect:f}),i.createElement(L,{colors:y.extended,color:t,onSelect:f}),i.createElement("div",{className:H.separator}),i.createElement(L,{colors:c,color:t,onSelect:f,onRemoveCustomColor:h},n&&i.createElement(i.Fragment,null,l.PLATFORM_ACCESSIBILITY_ENABLED?(null==c?void 0:c.length)?i.createElement("button",{title:K,onClick:b,className:r()(H.customButton,H.accessible,"apply-common-tooltip"),tabIndex:-1}):i.createElement("div",{"data-role":"row"},i.createElement("button",{title:K,onClick:b,className:r()(H.customButton,H.accessible,"apply-common-tooltip"),tabIndex:-1})):i.createElement("div",{className:r()(H.customButton,"apply-common-tooltip"),onClick:b,title:K,tabIndex:-1})))),s&&i.createElement(i.Fragment,null,i.createElement("div",{className:H.sectionTitle},Z),i.createElement(S.Opacity,{color:t,opacity:v,onChange:function(e){u&&u(e)}})));function f(t){const{onColorChange:o}=e;o&&o(t,m)}function b(e){g(!0),null==d||d(!0)}}},54368:(e,t,o)=>{"use strict";o.d(t,{Opacity:()=>h});var i=o(50959),n=o(97754),r=o(50151),s=o(37160),l=o(68335),a=o(16838),c=o(30099);class h extends i.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),o=(0,r.ensureNotNull)(this._pointer),i=t.getBoundingClientRect(),n=o.offsetWidth,l=e.clientX-n/2-i.left,a=(0,s.clamp)(l/(i.width-n),0,1);this.setState({inputOpacity:Math.round(100*a).toString()}),this.props.onChange(a),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,o=Number(t)/100;this.setState({inputOpacity:t}),Number.isNaN(o)||o>1||this.props.onChange(o)},this._handleKeyDown=e=>{const t=(0,l.hashFromEvent)(e);if(37!==t&&39!==t)return;e.preventDefault();const o=Number(this.state.inputOpacity);37===t&&0!==o&&this._changeOpacity(o-1),39===t&&100!==o&&this._changeOpacity(o+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:o,disabled:r}=this.props,{inputOpacity:s,isPointerDragged:l}=this.state,h={color:e||void 0};return i.createElement("div",{className:c.opacity},i.createElement("div",{className:n(c.opacitySlider,a.PLATFORM_ACCESSIBILITY_ENABLED&&c.accessible),style:h,tabIndex:a.PLATFORM_ACCESSIBILITY_ENABLED&&!r?0:-1,ref:this._refContainer,onMouseDown:this._onSliderClick,onTouchStart:this._onTouchStart,onTouchMove:this._handleTouch,onTouchEnd:this._handleTouchEnd,onKeyDown:this._handleKeyDown,"aria-disabled":r},i.createElement("div",{className:c.opacitySliderGradient,style:{backgroundImage:`linear-gradient(90deg, transparent, ${e})`}}),i.createElement("div",{className:c.opacityPointerWrap},i.createElement("div",{className:n(c.pointer,l&&c.dragged),style:{left:100*t+"%"},ref:this._refPointer}))),!o&&i.createElement("div",{className:c.opacityInputWrap},i.createElement("input",{type:"text",className:c.opacityInput,value:s,onChange:this._handleInput}),i.createElement("span",{className:c.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))}_changeOpacity(e){this.setState({inputOpacity:e.toString()}),this.props.onChange(e/100)}}},6914:(e,t,o)=>{"use strict";o.d(t,{basic:()=>l,extended:()=>c,white:()=>n}) ;var i=o(33013);const n=i.colorsPalette["color-white"],r=["ripe-red","tan-orange","banana-yellow","iguana-green","minty-green","sky-blue","tv-blue","deep-blue","grapes-purple","berry-pink"],s=[200,300,400,500,600,700,800,900].map((e=>`color-cold-gray-${e}`));s.unshift("color-white"),s.push("color-black"),r.forEach((e=>{s.push(`color-${e}-500`)}));const l=s.map((e=>i.colorsPalette[e])),a=[];[100,200,300,400,700,900].forEach((e=>{r.forEach((t=>{a.push(`color-${t}-${e}`)}))}));const c=a.map((e=>i.colorsPalette[e]))},56512:(e,t,o)=>{"use strict";o.d(t,{useCustomColors:()=>a});var i=o(50959),n=o(56840),r=o(76422);function s(e,t){(0,i.useEffect)((()=>(r.subscribe(e,t,null),()=>{r.unsubscribe(e,t,null)})),[e,t])}var l=o(24377);function a(){const[e,t]=(0,i.useState)((0,n.getJSON)("pickerCustomColors",[]));s("add_new_custom_color",(o=>t(c(o,e)))),s("remove_custom_color",(o=>t(h(o,e))));const o=(0,i.useCallback)((t=>{const o=t?(0,l.parseRgb)(t):null;e.some((e=>null!==e&&null!==o&&(0,l.areEqualRgb)((0,l.parseRgb)(e),o)))||(r.emit("add_new_custom_color",t),(0,n.setJSON)("pickerCustomColors",c(t,e)))}),[e]),a=(0,i.useCallback)((t=>{(t>=0||t29&&o.shift(),o}function h(e,t){return t.filter(((t,o)=>e!==o))}},84877:(e,t,o)=>{"use strict";o.d(t,{MatchMediaMap:()=>s});var i=o(50959),n=o(66783),r=o.n(n);class s extends i.Component{constructor(e){super(e),this._handleMediaChange=()=>{const e=a(this.state.queries,((e,t)=>t.matches));let t=!1;for(const o in e)if(e.hasOwnProperty(o)&&this.state.matches[o]!==e[o]){t=!0;break}t&&this.setState({matches:e})};const{rules:t}=this.props;this.state=l(t)}shouldComponentUpdate(e,t){return!r()(e,this.props)||(!r()(t.rules,this.state.rules)||!r()(t.matches,this.state.matches))}componentDidMount(){this._migrate(null,this.state.queries)}componentDidUpdate(e,t){r()(e.rules,this.props.rules)||this._migrate(t.queries,this.state.queries)}componentWillUnmount(){this._migrate(this.state.queries,null)}render(){return this.props.children(this.state.matches)}static getDerivedStateFromProps(e,t){if(r()(e.rules,t.rules))return null;const{rules:o}=e;return l(o)}_migrate(e,t){null!==e&&a(e,((e,t)=>{t.removeListener(this._handleMediaChange)})),null!==t&&a(t,((e,t)=>{t.addListener(this._handleMediaChange)}))}}function l(e){const t=a(e,((e,t)=>window.matchMedia(t)));return{queries:t,matches:a(t,((e,t)=>t.matches)),rules:{...e}}}function a(e,t){const o={};for(const i in e)e.hasOwnProperty(i)&&(o[i]=t(i,e[i]));return o}},86431:(e,t,o)=>{"use strict";o.d(t,{makeOverlapable:()=>r});var i=o(50959),n=o(42842);function r(e){return class extends i.PureComponent{render(){const{isOpened:t,root:o}=this.props;if(!t)return null;const r=i.createElement(e,{...this.props,zIndex:150});return"parent"===o?r:i.createElement(n.Portal,null,r)}}}},40173:(e,t,o)=>{"use strict";function i(e,t,o={}){return Object.assign({},e,function(e,t,o={}){const i=Object.assign({},t) ;for(const n of Object.keys(t)){const r=o[n]||n;r in e&&(i[n]=[e[r],t[n]].join(" "))}return i}(e,t,o))}o.d(t,{mergeThemes:()=>i})},54784:e=>{e.exports={button:"button-KTgbfaP5",hover:"hover-KTgbfaP5",clicked:"clicked-KTgbfaP5",bg:"bg-KTgbfaP5",icon:"icon-KTgbfaP5",isActive:"isActive-KTgbfaP5",isTransparent:"isTransparent-KTgbfaP5",isGrayed:"isGrayed-KTgbfaP5",isHidden:"isHidden-KTgbfaP5",accessible:"accessible-KTgbfaP5"}},66427:(e,t,o)=>{"use strict";o.d(t,{ToolButton:()=>l});var i=o(50959),n=o(97754),r=o(9745),s=o(54784);const l=(0,i.forwardRef)(((e,t)=>{const{id:o,activeClass:l,children:a,className:c,icon:h,isActive:d,isGrayed:u,isHidden:p,isTransparent:m,theme:g=s,onClick:v,onKeyDown:_,buttonHotKey:w,tooltipPosition:f="vertical",tag:y="div",tabIndex:b,tooltip:T,...C}=e,x="button"===e.tag;return i.createElement(y,{"aria-label":x?T:void 0,...C,id:o,type:x?"button":void 0,className:n(g.button,c,d&&l,{"apply-common-tooltip":Boolean(T),"common-tooltip-vertical":Boolean(T)&&"vertical"===f,[g.isActive]:d,[g.isGrayed]:u,[g.isHidden]:p,[g.isTransparent]:m},x&&g.accessible),onClick:v,onKeyDown:_,"data-role":x?void 0:"button",ref:t,tabIndex:b,"data-tooltip-hotkey":w,"aria-pressed":x?d:void 0,"data-tooltip":T},i.createElement("div",{className:g.bg},h&&("string"==typeof h?i.createElement(r.Icon,{className:g.icon,icon:h}):i.createElement("span",{className:g.icon},h)),a))}))},87872:(e,t,o)=>{"use strict";o.d(t,{drawingToolsIcons:()=>i});const i={SyncDrawing:o(99088),arrow:o(63743),cursor:o(18953),dot:o(72196),performance:"",drawginmode:o(53950),drawginmodeActive:o(1532),eraser:o(27999),group:o(19799),hideAllDrawings:o(45820),hideAllDrawingsActive:o(84959),hideAllIndicators:o(42321),hideAllIndicatorsActive:o(75895),hideAllDrawingTools:o(93756),hideAllDrawingToolsActive:o(42650),hideAllPositionsTools:o(57313),hideAllPositionsToolsActive:o(65162),lockAllDrawings:o(91244),lockAllDrawingsActive:o(65186),magnet:o(68385),heart:o(10862),smile:o(7636),sticker:o(62567),strongMagnet:o(46049),measure:o(88518),removeAllDrawingTools:o(35149),showObjectsTree:o(36515),zoom:o(6894),"zoom-out":o(45360)}},9629:(e,t,o)=>{"use strict";o.r(t),o.d(t,{FavoriteDrawingToolbar:()=>g});var i=o(11542),n=o(3809),r=o(71810),s=(o(50151),o(70027)),l=o(39347),a=o(10643),c=o(88348),h=o(78036),d=o(56840),u=o(11417),p=o(97145),m=o(92249);o(70132);class g extends n.FloatingToolbar{constructor(e){super({dragOnlyInsideToolbar:!0,defaultPosition:e,positionSettingsKey:"chart.favoriteDrawingsPosition",positionStorageType:"device"}),this._linetoolsWidgets={},this._canBeShownValue=new p.WatchedValue(!1),this._attachHandlers(),this._loadVisibilityState(),this._hideAction=this._createHideToolbarAction()}show(){this._canBeShownValue.value()&&(this.isVisible()||this._renderAllLinetools(),super.show())}showAndSaveSettingsValue(){this._canBeShownValue.value()&&(u.TVLocalStorage.setItem("ChartFavoriteDrawingToolbarWidget.visible","true"),this.show())}hideAndSaveSettingsValue(){u.TVLocalStorage.setItem("ChartFavoriteDrawingToolbarWidget.visible","false"),this.hide()}canBeShown(){ return this._canBeShownValue.readonly()}_onFavoriteAdded(e){this.addWidget(this._createLinetoolWidget(e)),r.LinetoolsFavoritesStore.favorites().filter(v).length>0&&(this._canBeShownValue.setValue(!0),this.showAndSaveSettingsValue())}_onFavoriteRemoved(e){this.removeWidget(this._linetoolsWidgets[e]),delete this._linetoolsWidgets[e],0===r.LinetoolsFavoritesStore.favorites().filter(v).length&&(this._canBeShownValue.setValue(!1),this.hide())}_onFavoriteMoved(){this._renderAllLinetools()}_onSelectedLinetoolChanged(e){Object.keys(this._linetoolsWidgets).forEach((t=>{this._linetoolsWidgets[t].classList.toggle("i-active",e===t)}))}_createLinetoolWidget(e){const t=`${h.lineToolsInfo[e].icon}`,o=(0,s.parseHtmlElement)(t);return o.addEventListener("click",(async t=>{t.preventDefault(),await(0,m.initLineTool)(e),c.tool.value()!==e&&c.tool.setValue(e)})),this._linetoolsWidgets[e]=o,o}_renderAllLinetools(){this._linetoolsWidgets={},this.removeWidgets(),r.LinetoolsFavoritesStore.favorites().filter((e=>h.lineToolsInfo[e]&&!0)).forEach((e=>{this.addWidget(this._createLinetoolWidget(e))}))}_attachHandlers(){r.LinetoolsFavoritesStore.favoriteAdded.subscribe(this,this._onFavoriteAdded),r.LinetoolsFavoritesStore.favoriteRemoved.subscribe(this,this._onFavoriteRemoved),r.LinetoolsFavoritesStore.favoriteMoved.subscribe(this,this._onFavoriteMoved),r.LinetoolsFavoritesStore.favoritesSynced.subscribe(null,(()=>{this._loadVisibilityState(),this._renderAllLinetools()})),this.onContextMenu((e=>{e.preventDefault(),a.ContextMenuManager.showMenu([this._hideAction],e)})),c.tool.subscribe(this._onSelectedLinetoolChanged.bind(this))}_createHideToolbarAction(){return new l.Action({actionId:"Chart.FavoriteDrawingToolsToolbar.Hide",options:{label:i.t(null,void 0,o(74813)),onExecute:()=>{this.hideAndSaveSettingsValue()}}})}_loadVisibilityState(){const e=r.LinetoolsFavoritesStore.favorites().filter(v).length>0;this._canBeShownValue.setValue(e);const t=r.LinetoolsFavoritesStore.favoritesCount()>0;let o;const i=d.getValue("ChartFavoriteDrawingToolbarWidget.visible");void 0!==i?(d.remove("ChartFavoriteDrawingToolbarWidget.visible",{forceFlush:!0}),o="false"!==i,u.TVLocalStorage.setItem("ChartFavoriteDrawingToolbarWidget.visible",i)):o="false"!==u.TVLocalStorage.getItem("ChartFavoriteDrawingToolbarWidget.visible"),o&&t?this.show():this.hide()}}function v(e){return!0}},3809:(e,t,o)=>{"use strict";o.d(t,{FLOATING_TOOLBAR_REACT_WIDGETS_CLASS:()=>w,FloatingToolbar:()=>y});var i=o(59064),n=o(32563),r=o(61345),s=o(56840),l=o(97145),a=o(38881);class c extends a.ChunkLoader{_startLoading(){return Promise.all([o.e(1553),o.e(2377)]).then(o.bind(o,13367)).then((e=>e.HammerJS))}}var h=o(11417),d=o(50151),u=o(56073);var p=o(49483);o(65719);class m{constructor(e){var t,o;this._helper=null,this._handleDragStart=e=>{var t;if(null!==this._helper)return;const o=this._source ;o.classList.add("ui-draggable-dragging");const[i,n]=[(0,u.outerWidth)(o),(0,u.outerHeight)(o)];this._helper={startTop:parseFloat(o.style.top)||0,startLeft:parseFloat(o.style.left)||0,nextTop:null,nextLeft:null,raf:null,size:[i,n],containment:this._containment instanceof HTMLElement?[parseInt(getComputedStyle(this._containment).borderLeftWidth)+parseInt(getComputedStyle(this._containment).paddingLeft),parseInt(getComputedStyle(this._containment).borderTopWidth)+parseInt(getComputedStyle(this._containment).paddingTop),this._containment.offsetWidth-parseInt(getComputedStyle(this._containment).borderRightWidth)-parseInt(getComputedStyle(this._containment).paddingRight)-parseInt(getComputedStyle(o).marginLeft)-parseInt(getComputedStyle(o).marginRight)-i,this._containment.offsetHeight-parseInt(getComputedStyle(this._containment).borderBottomWidth)-parseInt(getComputedStyle(this._containment).paddingBottom)-parseInt(getComputedStyle(o).marginTop)-parseInt(getComputedStyle(o).marginBottom)-n]:"window"===this._containment?[window.scrollX,window.scrollY,window.scrollX+document.documentElement.offsetWidth-i,window.scrollY+document.documentElement.offsetHeight-n]:null},null===(t=this._start)||void 0===t||t.call(this)},this._handleDragMove=e=>{var t;if(null===this._helper)return;const{current:o,initial:i}=e.detail,n=this._source,r=this._helper.nextTop,s=this._helper.nextLeft,l="y"===this._axis||!1===this._axis||0!==o.movementY;if(l){const e=this._helper.startTop;isFinite(e)&&(this._helper.nextTop=o.clientY-i.clientY+e)}const a="x"===this._axis||!1===this._axis||0!==o.movementY;if(a){const e=this._helper.startLeft;isFinite(e)&&(this._helper.nextLeft=o.clientX-i.clientX+e)}if(null!==this._helper.containment){const[e,t,o,i]=this._helper.containment;l&&this._helper.nextTop&&(this._helper.nextTop=Math.min(this._helper.nextTop,i),this._helper.nextTop=Math.max(this._helper.nextTop,t)),a&&this._helper.nextLeft&&(this._helper.nextLeft=Math.min(this._helper.nextLeft,o),this._helper.nextLeft=Math.max(this._helper.nextLeft,e))}null!==this._helper.raf||r===this._helper.nextTop&&s===this._helper.nextLeft||(this._helper.raf=requestAnimationFrame((()=>{null!==this._helper&&(null!==this._helper.nextTop&&(n.style.top=this._helper.nextTop+"px",this._helper.nextTop=null),null!==this._helper.nextLeft&&(n.style.left=this._helper.nextLeft+"px",this._helper.nextLeft=null),this._helper.raf=null)}))),null===(t=this._drag)||void 0===t||t.call(this)},this._handleDragStop=e=>{var t;if(null===this._helper)return;this._source.classList.remove("ui-draggable-dragging"),this._helper=null,null===(t=this._stop)||void 0===t||t.call(this)};const i=this._source=e.source;i.classList.add("ui-draggable");const n=this._handle=null!==(t=e.handle?i.querySelector(e.handle):null)&&void 0!==t?t:i;n.classList.add("ui-draggable-handle"),this._start=e.start,this._stop=e.stop,this._drag=e.drag,this._backend=new g({handle:n,onDragStart:this._handleDragStart,onDragMove:this._handleDragMove,onDragStop:this._handleDragStop}),this._axis=null!==(o=e.axis)&&void 0!==o&&o, this._containment=e.containment}destroy(){const e=this._source;e.classList.remove("ui-draggable"),e.classList.remove("ui-draggable-dragging");this._handle.classList.remove("ui-draggable-handle"),this._backend.destroy(),null!==this._helper&&(this._helper.raf&&cancelAnimationFrame(this._helper.raf),this._helper=null)}}class g{constructor(e){this._initial=null,this._handlePointerDown=e=>{if(null!==this._initial)return;if(!(e.target instanceof Element&&this._handle.contains(e.target)))return;if(this._initial=e,!this._dispatchEvent(this._createEvent("pointer-drag-start",e)))return void(this._initial=null);e.preventDefault();const t=this._getEventTarget();t.addEventListener("pointermove",this._handlePointerMove),t.addEventListener("pointerup",this._handlePointerUp),t.addEventListener("pointercancel",this._handlePointerUp),t.addEventListener("lostpointercapture",this._handlePointerUp),t.setPointerCapture(e.pointerId)},this._handlePointerMove=e=>{null!==this._initial&&this._initial.pointerId===e.pointerId&&(e.preventDefault(),this._dispatchEvent(this._createEvent("pointer-drag-move",e)))},this._handlePointerUp=e=>{if(null===this._initial||this._initial.pointerId!==e.pointerId)return;e.preventDefault();const t=this._getEventTarget();t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._handlePointerUp),t.removeEventListener("pointercancel",this._handlePointerUp),t.removeEventListener("lostpointercapture",this._handlePointerUp),t.releasePointerCapture(this._initial.pointerId),this._dispatchEvent(this._createEvent("pointer-drag-stop",e)),this._initial=null};const t=this._handle=e.handle;this._onDragStart=e.onDragStart,this._onDragMove=e.onDragMove,this._onDragStop=e.onDragStop,t.style.touchAction="none";this._getEventTarget().addEventListener("pointerdown",this._handlePointerDown)}destroy(){this._handle.style.touchAction="";const e=this._getEventTarget();e.removeEventListener("pointerdown",this._handlePointerDown),e.removeEventListener("pointermove",this._handlePointerMove),e.removeEventListener("pointerup",this._handlePointerUp),e.removeEventListener("pointercancel",this._handlePointerUp),e.removeEventListener("lostpointercapture",this._handlePointerUp),null!==this._initial&&(e.releasePointerCapture(this._initial.pointerId),this._initial=null)}_getEventTarget(){return p.CheckMobile.iOS()||(0,p.isMac)()&&n.touch?window.document.documentElement:this._handle}_dispatchEvent(e){switch(e.type){case"pointer-drag-start":this._onDragStart(e);break;case"pointer-drag-move":this._onDragMove(e);break;case"pointer-drag-stop":this._onDragStop(e)}return!e.defaultPrevented}_createEvent(e,t){return(0,d.assert)(null!==this._initial),new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:{backend:this,initial:this._initial,current:t}})}}var v=o(70027),_=o(25388);o(19619) ;const w="floating-toolbar-react-widgets",f=`
${_}
`;class y{constructor(e){this._widget=document.createElement("div"),this._isVertical=!1,this._hiddingTimeoutId=null,this._visibility=new l.WatchedValue(!1),this._windowResizeListener=this._onWindowResize.bind(this),this._responsiveResizeFunction=null,this._showTimeStamp=null,this._draggable=null,this._preventClickUntilAnimation=e=>{null!==this._showTimeStamp&&performance.now()-this._showTimeStamp{this.isVisible()&&this._widget.classList.remove("i-closed")}))):this._widget.classList.remove("i-closed"),this._onWindowResize())}hide(e=!1){if(!this.isVisible())return;const t=this._widget.classList.contains("i-closed");if(this._widget.classList.add("i-closed"),this._visibility.setValue(!1),e||t)this._setHiddingTimeout(null),this._widget.classList.add("i-hidden");else{const e=setTimeout((()=>{this._setHiddingTimeout(null),this._widget.classList.add("i-hidden")}),this.hideDuration());this._setHiddingTimeout(e)}window.removeEventListener("resize",this._windowResizeListener)}raise(){y._toolbars.length+y._startZIndex!==this._zIndex()&&(y._toolbars.splice(y._toolbars.indexOf(this),1),y._toolbars.push(this),y._updateAllZIndexes())}hideDuration(){ return.75*r.dur}addWidget(e,t={}){const o=this.widgetsCount();if(void 0===t.index&&(t.index=o),t.index<0||t.index>o)throw new Error(`Index must be in [0, ${o}]`);const i=document.createElement("div");i.className="tv-floating-toolbar__widget js-widget",i.appendChild(e);const n=t.index===o?null:this._content.childNodes.item(t.index);this._content.insertBefore(i,n),this._onWindowResize()}getReactWidgetContainer(){return this._reactWidgetsContainer}removeWidget(e){const t=this._findWrapperForWidget(e);t&&(this._content.removeChild(t),this._onWindowResize())}widgetsCount(){return this._content.childNodes.length}showWidget(e){const t=this._findWrapperForWidget(e);t&&t.classList.remove("i-hidden")}hideWidget(e){const t=this._findWrapperForWidget(e);t&&t.classList.add("i-hidden")}removeWidgets(){for(;this._content.firstChild;)this._content.removeChild(this._content.firstChild);this._onWindowResize()}onContextMenu(e){if(n.mobiletouch){(new c).load().then((t=>{const o=new t(this._widget);o.get("press").set({time:500}),o.on("press",(t=>{this._preventWidgetTouchEndEvent(),e(t.srcEvent)}))}))}else this._widget.addEventListener("contextmenu",e)}checkPosition(){const e=this._getCorrectedWidgetRect(),t={left:e.left,top:e.top};this._correctPosition(t),e.left===t.left&&e.top===t.top||(this._widget.style.left=t.left+"px",this._widget.style.top=t.top+"px")}_determineCurrentLayoutVertical(e){const t=this._isVertical?e.height:e.width;return window.innerWidthe.left&&(e.left=Math.min(e.left+i,o.left)),n<0?e.top=Math.max(0,window.innerHeight-t.height):o&&o.top>e.top&&(e.top=Math.min(e.top+n,o.top))}_getCorrectedWidgetRect(){const e=this._widget.getBoundingClientRect();if(this._widget.classList.contains("i-closed")){const t=1/.925-1,o=e.width*t,i=e.height*t;return{bottom:e.bottom+i/2,height:e.height+i,left:e.left-o/2,right:e.right+o/2,top:e.top-i/2,width:e.width+o}}return e}_getSavedPosition(){var e;let t;if("device"===this._options.positionStorageType){const e=h.TVLocalStorage.getItem(this._options.positionSettingsKey);t=null!==e?JSON.parse(e):null}else t=null!==(e=(0,s.getJSON)(this._options.positionSettingsKey))&&void 0!==e?e:null;return null!==t&&"top"in t&&"left"in t?t:null}_setHiddingTimeout(e){null!==this._hiddingTimeoutId&&clearTimeout(this._hiddingTimeoutId),this._hiddingTimeoutId=e}_preventWidgetTouchEndEvent(){const e=t=>{t.preventDefault(),this._widget.removeEventListener("touchend",e)};this._widget.addEventListener("touchend",e)}_updateLayoutType(){this._widget.classList.toggle("i-vertical",this._isVertical)}_onWindowResize(){if("auto"===(this._options.layout||"auto")){ const e=this._isVertical,t=this._getCorrectedWidgetRect();this._isVertical=this._determineCurrentLayoutVertical(t),this._updateLayoutType(),e!==this._isVertical&&this._onVerticalChanged(this._isVertical,e)}this.checkPosition(),this._resizeResponsive()}_resizeResponsive(){if(null===this._responsiveResizeFunction)return;let e=this._options.layout||"auto";"auto"===e&&(e=this._isVertical?"vertical":"horizontal");const t="vertical"===e?this._widget.clientHeight:this._widget.clientWidth,o=("vertical"===e?window.innerHeight:window.innerWidth)-t;this._responsiveResizeFunction(t,o,e)}_setZIndex(e){this._widget.style.zIndex=String(e)}_zIndex(){return Number(this._widget.style.zIndex)}_loadPosition(){var e;const t=null!==(e=this._getSavedPosition())&&void 0!==e?e:this._options.defaultPosition;this._widget.style.left=Math.round(t.left)+"px",this._widget.style.top=Math.round(t.top)+"px",this._onWindowResize()}_savePosition(){const e=this._widget.getBoundingClientRect();if("device"===this._options.positionStorageType)try{h.TVLocalStorage.setItem(this._options.positionSettingsKey,JSON.stringify({left:e.left,top:e.top}))}catch(e){}else(0,s.setJSON)(this._options.positionSettingsKey,{left:e.left,top:e.top})}_init(){this._loadPosition(),this._draggable=new m({source:this._widget,containment:"window",handle:".js-drag",start:i.globalCloseMenu,stop:this._savePosition.bind(this)}),this._widget.addEventListener("pointerdown",this.raise.bind(this))}static _updateAllZIndexes(){y._toolbars.forEach(((e,t)=>{e._setZIndex(y._startZIndex+t)}))}}y._startZIndex=20,y._toolbars=[]},44296:(e,t,o)=>{"use strict";o.d(t,{LineToolPropertiesWidgetBase:()=>ye});var i=o(50959),n=o(962),r=o(11542),s=o(36298),l=o(14483),a=o(97145),c=o(1722),h=o(88348),d=o(62513),u=o(68806),p=o(50151),m=o(88640);class g extends m.default{constructor(e,t,o){super(),this._listenersMappers=[],this._isProcess=!1,this._baseProperty=e,this._propertyApplier=t,this._undoText=o}destroy(){this._baseProperty.destroy(),super.destroy()}value(){return this._baseProperty.value()}setValue(e){this._isProcess=!0,this._baseProperty.setValue(e,void 0,{applyValue:(e,t)=>this._propertyApplier.setProperty(e,t,this._undoText)}),this._isProcess=!1,this._listenersMappers.forEach((e=>{e.method.call(e.obj,this,"")}))}subscribe(e,t){const o=o=>{this._isProcess||t.call(e,this,"")},i={obj:e,method:t,callback:o};this._listenersMappers.push(i),this._baseProperty.subscribe(e,o)}unsubscribe(e,t){var o;const i=(0,p.ensureDefined)(null===(o=this._listenersMappers.find((o=>o.obj===e&&o.method===t)))||void 0===o?void 0:o.callback);this._baseProperty.unsubscribe(e,i)}unsubscribeAll(e){this._baseProperty.unsubscribeAll(e)}}var v=o(69152),_=o(97754),w=o.n(_),f=o(84877),y=o(3809),b=o(24437);const T=y.FLOATING_TOOLBAR_REACT_WIDGETS_CLASS+"__button";function C(e){const{templateButton:t,propertyButtons:o,commonButtons:n,isDrawingFinished:r,isToolbarFixed:s,buttonClassName:l,activeChartWidget:a}=e,c=a.hasModel()&&a.model().selection().dataSources();return c&&c.length?i.createElement(f.MatchMediaMap,{rules:{ isSmallWidth:b.DialogBreakpoints.TabletSmall,isSmallHeight:"screen and (max-height: 430px)"}},(({isSmallWidth:e,isSmallHeight:t})=>i.createElement(i.Fragment,null,h(),r&&i.createElement(i.Fragment,null,Boolean(o.length)&&o.map(((o,n)=>i.createElement(o.component,{...o.props,key:`${o.props.title}_${n}`,className:w()(T,l),isSmallScreen:e||t,isToolbarFixed:s}))),Boolean(n.length)&&n.map(((o,n)=>{const r=e||t;return r?o.showForSmallScreen?i.createElement(o.component,{...o.props,isSmallScreen:r,key:`${o.props.title}_${n}`,className:w()(T,l)}):null:i.createElement(o.component,{...o.props,key:`${o.props.title}_${n}`,className:w()(T,l)})})))))):h();function h(){return null===t?null:i.createElement(t.component,{...t.props,isToolbarFixed:s,isDrawingFinished:r,className:w()(T,l)})}}var x=o(51768),L=o(50813),S=o(61964);function P(e){const{title:t,activeChartWidget:o,className:n}=e;return i.createElement(L.ToolWidgetIconButton,{className:n,icon:S,title:t,onClick:async function(){(0,x.trackEvent)("GUI","Context action on drawings","Settings");const e=o.model().selection().lineDataSources(),t=e.length;1===t?await o.showChartPropertiesForSource(e[0],void 0,{onWidget:o.onWidget()}):t>1&&await o.showChartPropertiesForSources({sources:e})},"data-name":"settings"})}var E=o(43982),A=o(66427),B=o(31188);function M(e){const{className:t,...o}=e;return i.createElement(A.ToolButton,{className:_(t,B.button),tooltipPosition:"horizontal",...o})}var z=o(65186),D=o(91244);function k(e){const{activeChartWidget:t,className:n}=e,s=t.model().selection().lineDataSources();if(0===s.length)return null;const l=s[0].properties().frozen,a=(0,E.useProperty)(l),c=a?{tooltip:r.t(null,void 0,o(15101)),icon:z}:{tooltip:r.t(null,void 0,o(42284)),icon:D};return i.createElement(M,{className:n,isActive:Boolean(a),onClick:function(){(0,x.trackEvent)("GUI","Context action on drawings","Lock"),t.toggleLockSelectedObject()},"data-name":Boolean(a)?"unlock":"lock",...c})}var N=o(35149);function W(e){const{title:t,activeChartWidget:o,className:n}=e;return i.createElement(L.ToolWidgetIconButton,{className:n,icon:N,title:t,"data-name":"remove",onClick:function(){(0,x.trackEvent)("GUI","Context action on drawings","Remove"),o.removeSelectedSources()}})}var I=o(9745),R=o(32563),F=o(8087),V=o(28127),O=o(10643),H=o(24120),K=o(68335),Z=o(4741),j=o(39347),U=o(84959);function $(e,t){const i=[(0,H.createVisualOrderAction)(e,t),(0,H.createChangeIntervalsVisibilitiesAction)(e,t)],n=function(e,t){const i=[],n=K.isMacKeyboard?" +":"",s=t.filter((e=>e.cloneable()));s.length>0&&i.push(new j.Action({actionId:"Chart.LineTool.Clone",options:{name:"clone",icon:o(36296),shortcutHint:K.humanReadableModifiers(Z.Modifiers.Mod)+n+" Drag",label:r.t(null,void 0,o(52977)),onExecute:()=>{e.model().cloneLineTools(s,!1),(0,x.trackEvent)("GUI","Context action on drawings","Clone")}}}));const l=t.filter((e=>e.copiable()));if(l.length>0){const t={name:"copy",label:r.t(null,void 0,o(35216)),shortcutHint:K.humanReadableModifiers(Z.Modifiers.Mod)+n+" C",onExecute:()=>{ e.chartWidgetCollection().clipboard.uiRequestCopy(l)}};i.push(new j.Action({actionId:"Chart.Clipboard.CopyLineTools",options:t,id:"Copy"}))}return function(e,t){return!!(null==e?void 0:e.isMultipleLayout().value())&&t.some((e=>e.isSynchronizable()))}(e,t)?(i.push(...(0,H.createSyncDrawingActions)(e,t)),i):i}(e,t);return n.length&&i.push(new j.Separator,...n),i.push(new j.Separator,function(e){return new j.Action({actionId:"Chart.SelectedObject.Hide",options:{label:r.t(null,void 0,o(31971)),icon:U,onExecute:()=>{e.hideSelectedObject()},name:"hide"}})}(e)),i}var G=o(44996);function q(e){const{title:t,activeChartWidget:o,isSmallScreen:n,className:r}=e,s=o.model().selection().lineDataSources(),[l,a]=(0,i.useState)([]),c=(0,i.useRef)(null),h=(0,i.useMemo)((()=>new H.ActionsProvider(o)),[o]),d=(0,i.useCallback)((()=>h.contextMenuActionsForSources(s)),[h,s]),u=(0,i.useCallback)((()=>{if(n)return;const e=$(o,s);a(Y(e))}),[n,o,s]),p=(0,i.useCallback)((e=>{if(!n){const e=Y($(o,s));return a(e),void O.ContextMenuManager.createMenu(e,{mode:"drawer","data-name":"more-menu"},{menuName:"LineToolFloatingToolbarMoreMenu"})}d().then((t=>{const o=Y(t);window.matchMedia(b.DialogBreakpoints.TabletSmall).matches||a(o),O.ContextMenuManager.showMenu(o,e,{mode:"drawer","data-name":"more-menu"},{menuName:"LineToolFloatingToolbarMoreMenu"})}))}),[n,d]);return(0,i.useEffect)((()=>{var e;l.length&&(null===(e=c.current)||void 0===e||e.update())}),[l]),i.createElement(F.ToolWidgetMenu,{className:r,ref:c,arrow:!1,onOpen:u,onClick:p,title:t,content:i.createElement(I.Icon,{icon:G}),"data-name":"more",menuDataName:"more-menu",closeOnEsc:!0},i.createElement(V.ActionsTable,{parentIsOpened:!0,items:l}))}function Y(e){if(R.touch&&!window.matchMedia("(pointer:fine)").matches){const t=e.filter((e=>"Copy"!==e.id));if(t.length===e.length)return t;const o=[];return t.forEach((e=>{("separator"!==e.type||o.length>0&&"separator"!==o[o.length-1].type)&&o.push(e)})),o}return e}var X=o(95586),J=o(12811),Q=o(501),ee=o(23851),te=o(57740),oe=o(80427);function ie(e){const{property:t,propertyApplier:n,title:s,undoText:l,isToolbarFixed:a,className:c}=e,h=(0,E.useProperty)(t),d=(0,i.useMemo)((()=>[new j.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToSolid",options:{icon:Q,label:r.t(null,void 0,o(1277)),active:X.LineStyle.Solid===h,onExecute:()=>n.setProperty(t,X.LineStyle.Solid,l)}}),new j.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToDashed",options:{icon:ee,label:r.t(null,void 0,o(59317)),active:X.LineStyle.Dashed===h,onExecute:()=>n.setProperty(t,X.LineStyle.Dashed,l)}}),new j.Action({actionId:"Chart.LineTool.Toolbar.ChangeLineStyleToDotted",options:{icon:te,label:r.t(null,void 0,o(42973)),active:X.LineStyle.Dotted===h,onExecute:()=>n.setProperty(t,X.LineStyle.Dotted,l)}})]),[n,t,h]);return i.createElement(F.ToolWidgetMenu,{className:c,arrow:!1,content:i.createElement(I.Icon,{icon:ne(h)}),title:s,"data-name":e["data-name"],menuDataName:`${e["data-name"]}-menu`,verticalDropDirection:a?J.VerticalDropDirection.FromBottomToTop:void 0, horizontalDropDirection:a?J.HorizontalDropDirection.FromRightToLeft:void 0,horizontalAttachEdge:a?J.HorizontalAttachEdge.Right:void 0,verticalAttachEdge:a?J.VerticalAttachEdge.Top:void 0},i.createElement(V.ActionsTable,{items:d}))}function ne(e){switch(e){case X.LineStyle.Solid:return Q;case X.LineStyle.Dashed:return ee;case X.LineStyle.Dotted:return te;case"mixed":return oe;default:return""}}const re=[10,11,12,14,16,20,24,28,32,40];function se(e){const{property:t,propertyApplier:o,title:n,undoText:r,isToolbarFixed:s,className:l}=e,a=(0,E.useProperty)(t),c=re.map((e=>new j.Action({actionId:"Chart.LineTool.Toolbar.ChangeFontSizeProperty",options:{label:e.toString(),onExecute:()=>o.setProperty(t,e,r),active:e===a}})));return i.createElement(F.ToolWidgetMenu,{arrow:!1,content:a,className:l,title:n,verticalDropDirection:s?J.VerticalDropDirection.FromBottomToTop:void 0,horizontalDropDirection:s?J.HorizontalDropDirection.FromRightToLeft:void 0,horizontalAttachEdge:s?J.HorizontalAttachEdge.Right:void 0,verticalAttachEdge:s?J.VerticalAttachEdge.Top:void 0,"data-name":e["data-name"],menuDataName:`${e["data-name"]}-menu`},i.createElement(V.ActionsTable,{items:c}))}var le=o(69774),ae=o(92249),ce=o(15367),he=o(3587),de=o(87919);const ue=new s.TranslatedString("change line tool(s) font size",r.t(null,void 0,o(36819))),pe=new s.TranslatedString("change line tool(s) line style",r.t(null,void 0,o(54769))),me=(new s.TranslatedString("apply drawing template",r.t(null,void 0,o(49037))),new s.TranslatedString("line tool(s) line style",r.t(null,{context:"line tool property name"},o(2443)))),ge=r.t(null,void 0,o(89517)),ve=r.t(null,void 0,o(34596)),_e=r.t(null,void 0,o(41610)),we=r.t(null,void 0,o(32733)),fe=r.t(null,void 0,o(17006));class ye{constructor(e){this._isDrawingFinished=new a.WatchedValue(!0),this._currentTool=null,this._updateVisibilityTimeout=null,this._lineWidthsProperty=null,this._lineColorsProperty=null,this._currentProperties=null,this._floatingContainer=null,this._floatingToolbarRendered=!1,this._toolbarVisible=!1,this._propertiesVisible=!1,this._templatesButton=null,this._propertyButtons=[],this._commonButtons=[],this._handleSourceEdit=e=>{h.isDirectionalMovementActive.value()||(e?this._floatingToolbar.hide(!0):this._floatingToolbarRendered&&this._floatingToolbar.show())},this._chartWidgetCollection=e,this._floatingToolbar=new y.FloatingToolbar({defaultPosition:{top:le.HEADER_TOOLBAR_HEIGHT_EXPANDED+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position",positionStorageType:"device",layout:"horizontal","data-name":"drawing-toolbar"}),this._floatingContainer=this._floatingToolbar.getReactWidgetContainer(),this._isToolMovingNowSpawn=h.isToolMovingNow.spawn(),this._isToolEditingNowSpawn=h.isToolEditingNow.spawn(),this._toolSpawn=h.tool.spawn(),this._iconToolSpawn=h.iconTool.spawn(),this._emojiToolSpawn=h.emojiTool.spawn(),this._selectedSourcesSpawn=this._chartWidgetCollection.selectedSources.spawn(),this._isToolMovingNowSpawn.subscribe(this._handleSourceEdit), this._isToolEditingNowSpawn.subscribe(this._handleSourceEdit),this._toolSpawn.subscribe(this._onToolChanged.bind(this),{callWithLast:!0}),this._iconToolSpawn.subscribe((()=>this._onToolChanged(h.tool.value()))),this._emojiToolSpawn.subscribe((()=>this._onToolChanged(h.tool.value()))),this._selectedSourcesSpawn.subscribe((()=>this.onSourceChanged(this.selectedSources()))),this._chartWidgetCollection.onAboutToBeDestroyed.subscribe(this,this.destroy,!0)}destroy(){this._isToolMovingNowSpawn.destroy(),this._isToolEditingNowSpawn.destroy(),this._toolSpawn.destroy(),this._iconToolSpawn.destroy(),this._emojiToolSpawn.destroy(),this._selectedSourcesSpawn.destroy()}refresh(){this.onSourceChanged(this.selectedSources())}onSourceChanged(e){if(!(null==e?void 0:e.length))return this._propertiesVisible=!1,this._toolbarVisible=!1,void this.hide();if(this._createCommonButtons(),e.every((t=>t.toolname===e[0].toolname))?this._showTemplatesOf({sources:e}):this._templatesButton&&this._clearTemplatesButton(),1===e.length){const t=e[0];t.isAvailableInFloatingWidget()&&this.activeChartWidget().model().model().dataSourceForId(t.id())?(!t.userEditEnabled()||!(0,ce.isLineDrawnWithPressedButton)(t.toolname)&&this.activeChartWidget().model().lineBeingCreated()||this._isDrawingFinished.setValue(!0),this.showPropertiesOf(t.toolname,t.properties(),!0),this._toolbarVisible=!0):this.hide()}else this._clearProperties(),this._createWidthsButton(void 0,!0),this._createLineStyleButton(),this._createColorsButton(void 0,!0),this._createBackgroundsButton(void 0,!0),this._createTextColorsButton(void 0,!0),this._propertiesVisible=!0;this._updateVisibility()}activeChartWidget(){return this._chartWidgetCollection.activeChartWidget.value()}selectedSources(){return this._chartWidgetCollection.selectedSources.value().filter(ae.isLineTool)}hide(){this._updateVisibilityTimeout&&clearTimeout(this._updateVisibilityTimeout),this._updateVisibilityTimeout=setTimeout((()=>{(0,ae.unsetNewToolProperties)(),this._floatingToolbar.hide(!0),this._isToolbarRendered()&&this._unmountFloatingToolbar(),this._clearProperties(),this._clearCommonButtons()}),0),delete this._propertyApplier}templatesList(){return this._templatesList}_onToolChanged(e,t){this._currentTool=e;const o=this.selectedSources();this._isDrawingToolExcludingCustomUrlEventTool(e)?(this._isDrawingFinished.setValue(!1),this._updateVisibility()):o&&o.length?(o.length>1&&this._isDrawingFinished.setValue(!0),this.onSourceChanged(this.selectedSources())):this.hide()}_propertyApplierImpl(){return this._propertyApplier||(this._propertyApplier=new de.PropertyApplierWithoutSavingChart((()=>this.activeChartWidget().model()),new a.WatchedValue(false))),this._propertyApplier}_clearProperties(){this._clearPropertyButtons(),this._lineWidthsProperty&&(this._lineWidthsProperty.destroy(),this._lineWidthsProperty=null),this._lineColorsProperty&&(this._lineColorsProperty.destroy(),this._lineColorsProperty=null),this._currentProperties&&(this._currentProperties=null)}_show(){ this._updateVisibilityTimeout&&clearTimeout(this._updateVisibilityTimeout),this._updateVisibilityTimeout=setTimeout((()=>{this._renderFloatingToolbar(),this._floatingToolbar.show(),this._floatingToolbar.checkPosition()}),0)}_addPropertyButton(e){this._propertyButtons.push(e),this._renderFloatingToolbar()}_addCommonButton(e){this._commonButtons.push(e),this._renderFloatingToolbar()}_addTemplatesButton(e){this._templatesButton=e}_renderFloatingToolbar(){null!==this._floatingContainer&&this.activeChartWidget()&&this.activeChartWidget().hasModel()&&(n.render(i.createElement(C,{templateButton:this._templatesButton,propertyButtons:this._propertyButtons,commonButtons:this._commonButtons,isDrawingFinished:this._isDrawingFinished.value(),activeChartWidget:this.activeChartWidget()}),this._floatingContainer),this._floatingToolbarRendered=!0)}_unmountFloatingToolbar(){null!==this._floatingContainer&&(n.unmountComponentAtNode(this._floatingContainer),this._floatingToolbarRendered=!1)}_clearTemplatesButton(){this._templatesButton=null}_clearPropertyButtons(){this._propertyButtons=[]}_clearCommonButtons(){this._commonButtons=[]}_isToolbarRendered(){return this._floatingToolbarRendered}_createSettingsButton(){const e={component:P,props:{title:ge,activeChartWidget:this.activeChartWidget()}};this._addCommonButton(e)}_createLockButton(){const e={component:k,props:{title:"Lock",activeChartWidget:this.activeChartWidget()}};this._addCommonButton(e)}_createRemoveButton(){const e={component:W,props:{title:ve,activeChartWidget:this.activeChartWidget()},showForSmallScreen:!0};this._addCommonButton(e)}_createDotsButton(){this._addCommonButton({component:q,props:{title:_e,activeChartWidget:this.activeChartWidget()},showForSmallScreen:!0})}_createAlertButton(){}_createSourceActions(){this._createLockButton()}_createLineStyleButton(e){const t=this.selectedSources().filter(ae.isLineTool);if(!t.length)return!1;let o,i=this._propertyApplierImpl();if(1===t.length){if(o=t[0].properties().linestyle||e,!o)return!1}else{const e=t.map((e=>e.properties().linestyle||e.properties().lineStyle)).filter(c.notUndefined);if(!e.length)return!1;o=new d.CollectiblePropertyUndoWrapper(new u.LineToolCollectedProperty(e),me,this._propertyApplierImpl()),i={...i,setProperty:(e,t)=>e.setValue(t)}}return this._addPropertyButton({component:ie,props:{property:o,title:we,propertyApplier:i,"data-name":"style",undoText:pe}}),!0}_createFontSizeButton(e){const t=this.selectedSources();if(0===t.length)return!1;const o=t[0];if(!(0,he.isDataSource)(o))return!1;const i={component:se,props:{property:o.properties().fontsize||e,title:fe,propertyApplier:this._propertyApplierImpl(),"data-name":"font-size",undoText:ue}};return this._addPropertyButton(i),!0}_createCommonButtons(){this._commonButtons.length&&this._clearCommonButtons(),l.enabled("property_pages")&&this._createSettingsButton(),this._createSourceActions(),this._createRemoveButton(),this._createDotsButton()}_prepareProperties(e){const t=this.selectedSources().filter((t=>t.properties()[e])) ;if(!(t.filter((t=>t.properties()[e].visible())).length<1))return t.map((t=>t.properties()[e])).filter(c.notNull)}_createProperty(e,t,o,i){if(t){const e=this._prepareProperties(o);if(!e)return;return this._isWidthProperty(e[0])?new g(new u.MultipleLineWidthsProperty(e),this._propertyApplierImpl(),i):new v.CollectibleColorPropertyUndoWrapper(new u.MultipleLineColorsProperty(e),this._propertyApplierImpl(),i)}if(e&&e.visible())return this._isWidthProperty(e)?new u.MultipleLineWidthsProperty([e]):new v.CollectibleColorPropertyDirectWrapper(new u.MultipleLineColorsProperty([e]))}_shouldShowBackgroundProperty(e,t){return!t||!t.fillBackground||!!t.fillBackground.value()}_isDrawingToolExcludingCustomUrlEventTool(e){return Boolean(null==e?void 0:e.toLowerCase().includes("linetool"))&&"LineToolTweet"!==e&&"LineToolIdea"!==e&&"LineToolImage"!==e}_updateVisibility(){this._isDrawingFinished.value()&&(this._toolbarVisible||this._propertiesVisible)?this._show():this.hide()}_showTemplatesOf(e){}_isWidthProperty(e){return e instanceof u.LineToolWidthsProperty}}},78036:(e,t,o)=>{"use strict";o.d(t,{lineToolsInfo:()=>f});var i=o(50151),n=o(11542),r=o(61814),s=(o(42053),o(57673)),l=o(87872);const a={SyncDrawing:n.t(null,void 0,o(36551)),arrow:n.t(null,void 0,o(96237)),cursor:n.t(null,void 0,o(29908)),dot:n.t(null,void 0,o(60925)),performance:n.t(null,void 0,o(79165)),drawginmode:n.t(null,void 0,o(49421)),eraser:n.t(null,void 0,o(99289)),group:n.t(null,void 0,o(91977)),hideAllDrawings:n.t(null,void 0,o(17517)),lockAllDrawings:n.t(null,void 0,o(37057)),magnet:n.t(null,void 0,o(37140)),measure:n.t(null,void 0,o(59607)),removeAllDrawingTools:n.t(null,void 0,o(76091)),showObjectsTree:n.t(null,void 0,o(51072)),zoom:n.t(null,void 0,o(38925)),"zoom-out":n.t(null,void 0,o(49895))};var c=o(59656),h=o(68335),d=o(86972);const u=(0,h.humanReadableModifiers)(h.Modifiers.Shift,!1),p=(0,h.humanReadableModifiers)(h.Modifiers.Alt,!1),m=(0,h.humanReadableModifiers)(h.Modifiers.Mod,!1),g={keys:[u],text:n.t(null,void 0,o(40234))},v={keys:[u],text:n.t(null,void 0,o(68125))},_={keys:[u],text:n.t(null,void 0,o(81591))},w={LineTool5PointsPattern:{},LineToolABCD:{},LineToolArc:{},LineToolArrow:{},LineToolArrowMarkDown:{},LineToolArrowMarkLeft:{},LineToolArrowMarkRight:{},LineToolArrowMarkUp:{},LineToolBalloon:{},LineToolComment:{},LineToolBarsPattern:{},LineToolBezierCubic:{},LineToolBezierQuadro:{},LineToolBrush:{},LineToolCallout:{},LineToolCircleLines:{},LineToolCypherPattern:{},LineToolDateAndPriceRange:{},LineToolDateRange:{},LineToolDisjointAngle:{hotKey:(0,r.hotKeySerialize)(g)},LineToolElliottCorrection:{},LineToolElliottDoubleCombo:{},LineToolElliottImpulse:{},LineToolElliottTriangle:{},LineToolElliottTripleCombo:{},LineToolEllipse:{hotKey:(0,r.hotKeySerialize)(v)},LineToolExtended:{},LineToolFibChannel:{},LineToolFibCircles:{hotKey:(0,r.hotKeySerialize)(v)},LineToolFibRetracement:{},LineToolFibSpeedResistanceArcs:{},LineToolFibSpeedResistanceFan:{hotKey:(0,r.hotKeySerialize)(_)},LineToolFibSpiral:{},LineToolFibTimeZone:{},LineToolFibWedge:{}, LineToolFlagMark:{},LineToolFlatBottom:{hotKey:(0,r.hotKeySerialize)(g)},LineToolAnchoredVWAP:{},LineToolGannComplex:{},LineToolGannFixed:{},LineToolGannFan:{},LineToolGannSquare:{hotKey:(0,r.hotKeySerialize)({keys:[u],text:n.t(null,void 0,o(10289))})},LineToolHeadAndShoulders:{},LineToolHorzLine:{hotKey:(0,r.hotKeySerialize)({keys:[p,"H"],text:"{0} + {1}"})},LineToolHorzRay:{},LineToolIcon:{},LineToolEmoji:{},LineToolInsidePitchfork:{},LineToolNote:{},LineToolNoteAbsolute:{},LineToolSignpost:{},LineToolParallelChannel:{hotKey:(0,r.hotKeySerialize)(g)},LineToolPitchfan:{},LineToolPitchfork:{},LineToolPolyline:{},LineToolPath:{},LineToolPrediction:{},LineToolPriceLabel:{},LineToolPriceNote:{hotKey:(0,r.hotKeySerialize)(g)},LineToolArrowMarker:{},LineToolPriceRange:{},LineToolProjection:{},LineToolRay:{},LineToolRectangle:{hotKey:(0,r.hotKeySerialize)({keys:[u],text:n.t(null,void 0,o(81591))})},LineToolCircle:{},LineToolRegressionTrend:{},LineToolRiskRewardLong:{},LineToolRiskRewardShort:{},LineToolFixedRangeVolumeProfile:{},LineToolRotatedRectangle:{hotKey:(0,r.hotKeySerialize)(g)},LineToolSchiffPitchfork:{},LineToolSchiffPitchfork2:{},LineToolSineLine:{},LineToolText:{},LineToolTextAbsolute:{},LineToolThreeDrivers:{},LineToolTimeCycles:{},LineToolTrendAngle:{hotKey:(0,r.hotKeySerialize)(g)},LineToolTrendBasedFibExtension:{},LineToolTrendBasedFibTime:{},LineToolTrendLine:{hotKey:(0,r.hotKeySerialize)(g)},LineToolInfoLine:{},LineToolTriangle:{},LineToolTrianglePattern:{},LineToolVertLine:{hotKey:(0,r.hotKeySerialize)({keys:[p,"V"],text:"{0} + {1}"})},LineToolCrossLine:{},LineToolHighlighter:{},LineToolGhostFeed:{},SyncDrawing:{iconActive:l.drawingToolsIcons.SyncDrawingActive},arrow:{},cursor:{},dot:{},drawginmode:{iconActive:l.drawingToolsIcons.drawginmodeActive},eraser:{},group:{},hideAllDrawings:{iconActive:l.drawingToolsIcons.hideAllDrawingsActive,hotKey:(0,r.hotKeySerialize)({keys:[m,p,"H"],text:"{0} + {1} + {2}"})},lockAllDrawings:{iconActive:l.drawingToolsIcons.lockAllDrawingsActive},magnet:{hotKey:(0,r.hotKeySerialize)({keys:[m],text:"{0}"})},measure:{hotKey:(0,r.hotKeySerialize)({keys:[u],text:n.t(null,void 0,o(32868))})},removeAllDrawingTools:{},showObjectsTree:{},zoom:{},"zoom-out":{}};const f={};Object.entries(w).map((([e,t])=>{var o,n;const r=null!==(o=s.lineToolsIcons[e])&&void 0!==o?o:l.drawingToolsIcons[e];(0,i.assert)(!!r,`Icon is not defined for drawing "${e}"`);const h=null!==(n=c.lineToolsLocalizedNames[e])&&void 0!==n?n:a[e];(0,i.assert)(!!h,`Localized name is not defined for drawing "${e}"`);return{...t,name:e,icon:r,localizedName:h,selectHotkey:d.lineToolsSelectHotkeys[e]}})).forEach((e=>{f[e.name]=e}))},26916:(e,t,o)=>{"use strict";var i=o(36298).TranslatedString,n=o(44296).LineToolPropertiesWidgetBase;const r=o(70114).ColorPickerButton,s=o(61259).LineWidthButton ;var l=o(94071),a=o(21065),c=o(89103),h=new i("change line tool(s) color",o.tf(null,void 0,o(68519))),d=new i("change line tool(s) background color",o.tf(null,void 0,o(74350))),u=new i("change line tool(s) text color",o.tf(null,void 0,o(16631))),p=new i("change line tool(s) line width",o.tf(null,void 0,o(41648))),m=o.tf(null,void 0,o(40054)),g=o.tf(null,void 0,o(12928)),v=o.tf(null,void 0,o(19221)),_=o.tf(null,void 0,o(21327)),w=o.tf(null,void 0,o(38455)),f=o.tf(null,void 0,o(71845)),y=o.tf(null,void 0,o(32733)),b=o.tf(null,void 0,o(23886)),T=o.tf(null,void 0,o(86327)),C=o.tf(null,void 0,o(47059)),x=o.tf(null,void 0,o(36785)),L=o.tf(null,void 0,o(49593)),S=o.tf(null,void 0,o(67455)),P=o.tf(null,void 0,o(79964)),E=o.tf(null,void 0,o(45320));class A extends n{constructor(e){super(e),this._templatesButton=null}_createWidthsButton(e,t){if(this._lineWidthsProperty&&(this._lineWidthsProperty.destroy(),this._lineWidthsProperty=null),this._lineWidthsProperty=this._createProperty(e,t,"linesWidths",p),!this._lineWidthsProperty)return!0;var o=T;t&&(1!==this.selectedSources().filter((e=>e.properties().linesWidths)).length&&(o=C));return this._addPropertyButton({component:s,props:{title:o,multipleProperty:this._lineWidthsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"line-tool-width",undoText:p}}),!0}_createColorsButton(e,t){return this._lineColorsProperty&&(this._lineColorsProperty.destroy(),this._lineColorsProperty=null),this._lineColorsProperty=this._createProperty(e,t,"linesColors",h),!this._lineColorsProperty||(this._addPropertyButton({component:r,props:{icon:l,title:g,property:this._lineColorsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"line-tool-color",undoText:h}}),!0)}_createBackgroundsButton(e,t){return this._backgroundsProperty&&(this._backgroundsProperty.destroy(),this._backgroundsProperty=null),this._backgroundsProperty=this._createProperty(e,t,"backgroundsColors",d),!this._backgroundsProperty||(this._addPropertyButton({component:r,props:{icon:a,title:f,property:this._backgroundsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"background-color",undoText:d}}),!0)}_createTextColorsButton(e,t){return this._textColorsProperty&&(this._textColorsProperty.destroy(),this._textColorsProperty=null),this._textColorsProperty=this._createProperty(e,t,"textsColors",u),!this._textColorsProperty||(this._addPropertyButton({component:r,props:{icon:c,title:_,property:this._textColorsProperty,propertyApplier:this._propertyApplierImpl(),"data-name":"text-color",undoText:u}}),!0)}_getPossibleProperty(e){for(var t=[],o=this._defaultToolProperties(),i=0;i{"use strict";o.d(t,{CollectibleColorPropertyDirectWrapper:()=>l,CollectibleColorPropertyUndoWrapper:()=>s});var i=o(50151),n=o(88640);class r extends n.default{constructor(e){super(),this._listenersMappers=[],this._isProcess=!1,this._baseProperty=e}destroy(){this._baseProperty.destroy(),super.destroy()}value(){ const e=this._baseProperty.value();return"mixed"===e?"":e}visible(){return this._baseProperty.visible()}setValue(e){this._isProcess=!0,this._baseProperty.setValue(""===e?"mixed":e,void 0,{applyValue:this._applyValue.bind(this)}),this._isProcess=!1,this._listenersMappers.forEach((e=>{e.method.call(e.obj,this,"")}))}subscribe(e,t){const o=o=>{this._isProcess||t.call(e,this,"")},i={obj:e,method:t,callback:o};this._listenersMappers.push(i),this._baseProperty.subscribe(e,o)}unsubscribe(e,t){var o;const n=(0,i.ensureDefined)(null===(o=this._listenersMappers.find((o=>o.obj===e&&o.method===t)))||void 0===o?void 0:o.callback);this._baseProperty.unsubscribe(e,n)}unsubscribeAll(e){this._baseProperty.unsubscribeAll(e)}}class s extends r{constructor(e,t,o){super(e),this._propertyApplier=t,this._undoText=o}_applyValue(e,t){this._propertyApplier.setProperty(e,t,this._undoText)}}class l extends r{_applyValue(e,t){e.setValue(t)}}},62513:(e,t,o)=>{"use strict";o.d(t,{CollectiblePropertyUndoWrapper:()=>a});var i=o(50151),n=o(11542),r=o(36298),s=o(88640);const l=new r.TranslatedString("change {propertyName} property",n.t(null,void 0,o(18567)));class a extends s.default{constructor(e,t,o){super(),this._isProcess=!1,this._listenersMappers=[],this._valueApplier={applyValue:(e,t)=>{this._propertyApplier.setProperty(e,t,l)}},this._baseProperty=e,this._propertyApplier=o,this._propertyName=t}destroy(){this._baseProperty.destroy(),super.destroy()}value(){return this._baseProperty.value()}setValue(e,t){this._propertyApplier.beginUndoMacro(l.format({propertyName:this._propertyName})),this._isProcess=!0,this._baseProperty.setValue(e,void 0,this._valueApplier),this._isProcess=!1,this._propertyApplier.endUndoMacro(),this._listenersMappers.forEach((e=>{e.method.call(e.obj,this,"")}))}subscribe(e,t){const o=()=>{this._isProcess||t.call(e,this,"")};this._listenersMappers.push({obj:e,method:t,callback:o}),this._baseProperty.subscribe(e,o)}unsubscribe(e,t){var o;const n=(0,i.ensureDefined)(null===(o=this._listenersMappers.find((o=>o.obj===e&&o.method===t)))||void 0===o?void 0:o.callback);this._baseProperty.unsubscribe(e,n)}unsubscribeAll(e){this._baseProperty.unsubscribeAll(e)}}},71810:(e,t,o)=>{"use strict";o.d(t,{LinetoolsFavoritesStore:()=>a});var i=o(57898),n=o(56840);const r=["LineToolBalloon"],s=!1;var l,a;!function(e){function t(){var t,i;e.favorites=[];let a=!1;const c=Boolean(void 0===(0,n.getValue)("chart.favoriteDrawings")),h=(0,n.getJSON)("chart.favoriteDrawings",[]);if(0===h.length&&c&&"undefined"!=typeof window){const e=JSON.parse(null!==(i=null===(t=window.urlParams)||void 0===t?void 0:t.favorites)&&void 0!==i?i:"{}").drawingTools;e&&Array.isArray(e)&&h.push(...e)}h.forEach(((t,i)=>{const n=t.tool||t;o(n)?r.includes(n)?a=!0:e.favorites.push(n):s&&s.includes(n)&&e.hiddenToolsPositions.set(n,i)})),a&&l(),e.favoritesSynced.fire()}function o(e){return"string"==typeof e&&""!==e&&!(s&&s.includes(e))}function l(t){const o=e.favorites.slice();e.hiddenToolsPositions.forEach(((e,t)=>{o.splice(e,0,t)})),(0,n.setJSON)("chart.favoriteDrawings",o,t)} e.favorites=[],e.favoritesSynced=new i.Delegate,e.hiddenToolsPositions=new Map,e.favoriteIndex=function(t){return e.favorites.indexOf(t)},e.isValidLineToolName=o,e.saveFavorites=l,t(),n.onSync.subscribe(null,t)}(l||(l={})),function(e){function t(e){return l.isValidLineToolName(e)}function o(){return l.favorites.length}function n(e){return-1!==l.favoriteIndex(e)}e.favoriteAdded=new i.Delegate,e.favoriteRemoved=new i.Delegate,e.favoriteMoved=new i.Delegate,e.favoritesSynced=l.favoritesSynced,e.favorites=function(){return l.favorites.slice()},e.isValidLineToolName=t,e.favoritesCount=o,e.favorite=function(e){return e<0||e>=o()?"":l.favorites[e]},e.addFavorite=function(o,i){return!(n(o)||!t(o)||"performance"===o)&&(l.favorites.push(o),l.saveFavorites(i),e.favoriteAdded.fire(o),!0)},e.removeFavorite=function(t,o){const i=l.favoriteIndex(t);if(-1===i)return!1;l.favorites.splice(i,1);const n=l.hiddenToolsPositions;return n.forEach(((e,t)=>{e>i&&n.set(t,e-1)})),l.saveFavorites(o),e.favoriteRemoved.fire(t),!0},e.isFavorite=n,e.moveFavorite=function(i,n,r){if(n<0||n>=o()||!t(i))return!1;const s=l.favoriteIndex(i);if(-1===s||n===s)return!1;const a=l.hiddenToolsPositions;return a.forEach(((e,t)=>{se?e--:ne&&e++,a.set(t,e)})),l.favorites.splice(s,1),l.favorites.splice(n,0,i),l.saveFavorites(r),e.favoriteMoved.fire(i,s,n),!0}}(a||(a={}))},87919:(e,t,o)=>{"use strict";o.d(t,{PropertyApplierWithoutSavingChart:()=>i});class i{constructor(e,t){this._undoModelSupplier=e,this._featureToggle=t}setProperty(e,t,o){this._undoModelSupplier().setProperty(e,t,o,this._featureToggle.value())}beginUndoMacro(e){return this._undoModelSupplier().beginUndoMacro(e,this._shouldWeKeepChartValidated())}endUndoMacro(){this._undoModelSupplier().endUndoMacro()}setWatchedValue(e,t,o){this._undoModelSupplier().undoHistory().setWatchedValue(e,t,o,!0)}_shouldWeKeepChartValidated(){const e=this._undoModelSupplier().model().isAutoSaveEnabled().value();return this._featureToggle.value()&&e}}},44996:e=>{e.exports=''},19799:e=>{e.exports=''},63743:e=>{ e.exports=''},18953:e=>{e.exports=''},72196:e=>{e.exports=''},1532:e=>{e.exports=''},53950:e=>{e.exports=''},27999:e=>{e.exports=''}, 10862:e=>{e.exports=''},68385:e=>{e.exports=''},88518:e=>{e.exports=''},36515:e=>{e.exports=''},7636:e=>{e.exports=''},62567:e=>{e.exports=''},46049:e=>{ e.exports=''},99088:e=>{e.exports=''},42650:e=>{e.exports=''},75895:e=>{ e.exports=''},65162:e=>{e.exports=''},65186:e=>{ e.exports=''},91244:e=>{e.exports=''},45820:e=>{e.exports=''},93756:e=>{ e.exports=''},42321:e=>{e.exports=''},57313:e=>{ e.exports=''},6894:e=>{e.exports=''},45360:e=>{e.exports=''},23851:e=>{e.exports=''},57740:e=>{e.exports=''},80427:e=>{e.exports=''},501:e=>{e.exports=''},36296:e=>{ e.exports=''},21065:e=>{e.exports=''},25388:e=>{e.exports=''},22978:e=>{e.exports=''},14631:e=>{e.exports=''},6096:e=>{e.exports=''},6483:e=>{e.exports=''},66611:e=>{e.exports=''},94071:e=>{e.exports=''},89103:e=>{e.exports=''},61964:e=>{ e.exports=''},25931:(e,t,o)=>{"use strict";o.d(t,{nanoid:()=>i});let i=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")}}]);