(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[1297],{20041:e=>{e.exports={}},17192:e=>{e.exports={}},69681:e=>{e.exports={}},73052:e=>{e.exports={}},15216:e=>{e.exports={"tv-spinner__container-rotate":"tv-spinner__container-rotate-aLqboHuu"}},10048:e=>{e.exports={container:"container-B8mkOfAH",inner:"inner-B8mkOfAH","border-left":"border-left-B8mkOfAH","border-right":"border-right-B8mkOfAH","border-top":"border-top-B8mkOfAH","border-bottom":"border-bottom-B8mkOfAH","top-right-radius":"top-right-radius-B8mkOfAH","top-left-radius":"top-left-radius-B8mkOfAH","bottom-right-radius":"bottom-right-radius-B8mkOfAH","bottom-left-radius":"bottom-left-radius-B8mkOfAH"}},20350:e=>{e.exports={screen:"screen-otjoFNF2",fade:"fade-otjoFNF2",screenfade:"screenfade-otjoFNF2"}},26572:e=>{e.exports={}},98714:e=>{e.exports={css_value_currency_label_radius:"4",css_wrapper_margin:"4",css_row_left_right_padding:"3",css_fade_height:"10","price-axis-currency-label-wrapper":"price-axis-currency-label-wrapper-y5H41VPj",hidden:"hidden-y5H41VPj","price-axis-currency-label":"price-axis-currency-label-y5H41VPj",row:"row-y5H41VPj",expanded:"expanded-y5H41VPj","price-axis-currency-label-arrow-down":"price-axis-currency-label-arrow-down-y5H41VPj","price-axis-currency-label-text":"price-axis-currency-label-text-y5H41VPj"}},82815:e=>{e.exports={}},60070:e=>{e.exports={}},99647:e=>{e.exports={"css-value-chart-controls-bar-height-with-border":"39px","css-value-chart-controls-bar-border":"1px"}},43882:e=>{e.exports={}},95047:e=>{e.exports={}},25043:e=>{e.exports={}},91751:e=>{e.exports={"common-tooltip":"common-tooltip-EJBD96zX","common-tooltip--hidden":"common-tooltip--hidden-EJBD96zX","common-tooltip--horizontal":"common-tooltip--horizontal-EJBD96zX","common-tooltip--farther":"common-tooltip--farther-EJBD96zX","common-tooltip--vertical":"common-tooltip--vertical-EJBD96zX","common-tooltip-farther":"common-tooltip-farther-EJBD96zX","common-tooltip--direction_normal":"common-tooltip--direction_normal-EJBD96zX","common-tooltip__body":"common-tooltip__body-EJBD96zX","common-tooltip__button-container":"common-tooltip__button-container-EJBD96zX","common-tooltip__body--no-buttons":"common-tooltip__body--no-buttons-EJBD96zX","common-tooltip__button":"common-tooltip__button-EJBD96zX","common-tooltip--direction_reversed":"common-tooltip--direction_reversed-EJBD96zX","common-tooltip__ear-holder":"common-tooltip__ear-holder-EJBD96zX","common-tooltip__ear-holder--below":"common-tooltip__ear-holder--below-EJBD96zX","common-tooltip__ear-holder--above":"common-tooltip__ear-holder--above-EJBD96zX","common-tooltip__ear-holder--before":"common-tooltip__ear-holder--before-EJBD96zX","common-tooltip__ear-holder--after":"common-tooltip__ear-holder--after-EJBD96zX","common-tooltip__body--with-hotkey":"common-tooltip__body--with-hotkey-EJBD96zX","common-tooltip__body--width_wide":"common-tooltip__body--width_wide-EJBD96zX","common-tooltip__body--width_narrow":"common-tooltip__body--width_narrow-EJBD96zX",
"common-tooltip__body--no-padding":"common-tooltip__body--no-padding-EJBD96zX","common-tooltip__hotkey-block":"common-tooltip__hotkey-block-EJBD96zX","common-tooltip__hotkey-block--divider":"common-tooltip__hotkey-block--divider-EJBD96zX","common-tooltip__hotkey-text":"common-tooltip__hotkey-text-EJBD96zX","common-tooltip__hotkey-button":"common-tooltip__hotkey-button-EJBD96zX","common-tooltip__plus-sign":"common-tooltip__plus-sign-EJBD96zX"}},56616:(e,t,i)=>{"use strict";function s(){return navigator.clipboard}function n(e){return o(e,null)}function o(e,t){const i=e.files&&e.files.length>0;if(!i&&t&&t.eventPhase>0)return r(t,e),Promise.resolve();if(!i){let t=!1;const i=i=>{i.stopImmediatePropagation(),r(i,e),t=!0};try{document.addEventListener("copy",i,!0),document.execCommand("copy")}finally{document.removeEventListener("copy",i,!0)}if(t)return Promise.resolve()}return async function(e){const t=s();if(!t||!t.write||!window.ClipboardItem)throw new DOMException("ClipboardApi is not supported","NotSupportedError");const i={};for(const t of e.files||[])i[t.type]=t;e.text&&(i["text/plain"]=e.text);e.html&&(i["text/html"]=e.html);return t.write([new window.ClipboardItem(i)])}(e)}function r(e,t){e.preventDefault();const i=e.clipboardData;t.text&&i.setData("text/plain",t.text),t.html&&i.setData("text/html",t.html)}async function a(e,t){const i=s();if("text/plain"===t&&!i.write){const t=await e;return i.writeText(await t.text())}if(!i||!i.write||!window.ClipboardItem)throw new DOMException("ClipboardApi is not supported","NotSupportedError");let n=null;try{n=new window.ClipboardItem({[t]:e})}catch(i){n=new window.ClipboardItem({[t]:await e})}if(n)return i.write([n]);throw new Error("ClipboardApi is not supported")}i.d(t,{copyToClipboard:()=>n,getClipboard:()=>s,writeImpl:()=>o,writePromiseUsingApi:()=>a})},3343:(e,t,i)=>{"use strict";i.d(t,{Modifiers:()=>r,hashFromEvent:()=>l,humanReadableHash:()=>u,humanReadableModifiers:()=>c,isMacKeyboard:()=>o,modifiersFromEvent:()=>a});var s,n=i(75774);!function(e){e[e.KeyCode=255]="KeyCode",e[e.Control=256]="Control",e[e.Alt=512]="Alt",e[e.Shift=1024]="Shift",e[e.Meta=2048]="Meta"}(s||(s={}));const o=n.isMac||n.isIOS;var r;function a(e){let t=0;return e.shiftKey&&(t+=1024),e.altKey&&(t+=512),e.ctrlKey&&(t+=256),e.metaKey&&(t+=2048),t}function l(e){return a(e)|e.keyCode}!function(e){e[e.None=0]="None",e[e.Alt=512]="Alt",e[e.Shift=1024]="Shift",e[e.Mod=o?2048:256]="Mod",e[e.Control=256]="Control",e[e.Meta=2048]="Meta"}(r||(r={}));function c(e,t=!o){let i="";return 256&e&&(i+=_(o?"^":"Ctrl",t)),512&e&&(i+=_(o?"⌥":"Alt",t)),1024&e&&(i+=_(o?"⇧":"Shift",t)),2048&e&&(i+=_(o?"⌘":"Win",t)),i}const h={9:"⇥",13:"↵",27:"Esc",8:o?"⌫":"Backspace",32:"Space",35:"End",36:"Home",37:"←",38:"↑",39:"→",40:"↓",45:"Ins",46:"Del",188:",",191:"/"},d={9:"Tab",13:"Enter",27:"Esc",8:"Backspace",32:"Space",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Ins",46:"Del",188:",",191:"/"};for(let e=1;e<=16;e++)h[e+111]=`F${e}`,d[e+111]=`F${e}`;function u(e){let t=c(e);const i=255&e
;return t+=i in h?h[i]:String.fromCharCode(i),t}function _(e,t){return`${e}${t?" + ":o?" ":""}`}},54717:(e,t,i)=>{"use strict";i.d(t,{isNativeUIInteraction:()=>o,isTextEditingField:()=>n});var s=i(3343);function n(e){if("INPUT"===e.tagName){const t=e.type;return"text"===t||"email"===t||"number"===t||"password"===t||"search"===t||"tel"===t||"url"===t}return"TEXTAREA"===e.tagName||e.isContentEditable}function o(e,t){if(!t)return!1;const i=255&e;if(27===i||i>>>4==7)return!1;switch(e^i){case s.Modifiers.Alt:return(38===i||40===i)&&"SELECT"===t.tagName||n(t);case s.Modifiers.Alt+s.Modifiers.Shift:return n(t);case s.Modifiers.Mod:if(67===i||!s.isMacKeyboard&&45===i){const e=t.ownerDocument&&t.ownerDocument.getSelection();if(e&&!e.isCollapsed)return!0}return n(t);case s.Modifiers.Mod+s.Modifiers.Shift:return i>=33&&i<=40&&n(t);case s.Modifiers.Shift:case 0:return 9===i?!(!t.ownerDocument||t===t.ownerDocument.body||t===t.ownerDocument.documentElement):(!function(e){if("BUTTON"===e.tagName)return!0;if("INPUT"===e.tagName){const t=e.type;if("submit"===t||"button"===t||"reset"===t||"checkbox"===t||"radio"===t)return!0}return!1}(t)||13===i||32===i||9===i)&&("form"in t||t.isContentEditable)}return!1}},7029:(e,t,i)=>{"use strict";i.d(t,{t:()=>s});const s=i.i18next},19625:(e,t,i)=>{"use strict";i.d(t,{colorsPalette:()=>d,getHexColorByName:()=>u});var s=i(23420),n=i(579),o=i(50151);const r={...s,...n},a={},l=Object.keys(r).length,c=/^#(([a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i;function h(e,t=[],i=r){const s=i[e];if(!s)return null;if(c.test(s))return s;const n=s;return t.push(e),-1!==t.indexOf(n)?(console.warn("Colors definitions cycled"),s):t.length>l?(console.warn("Too many variables-link in HEX-color search: "+t[0]),null):h(n,t,i)}Object.keys(r).forEach((e=>{const t=h(e);a[e]=(0,o.ensureNotNull)(t)}));const d=a;function u(e,t=d){const i=t[e];if(!i){if(c.test(e))return e;throw new Error("No such color "+e)}return i}},74991:(e,t,i)=>{"use strict";i.d(t,{CubicBezier:()=>o,dur:()=>s,easingFunc:()=>n});const s=350,n={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:(4-2*e)*e-1,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e};class o{constructor(e,t,i,s){this._mX1=e,this._mY1=t,this._mX2=i,this._mY2=s}easingFunc(e){return this._mX1===this._mY1&&this._mX2===this._mY2?e:this._calcBezier(this._getTForX(e))}_a(e,t){return 1-3*t+3*e}_b(e,t){return 3*t-6*e}_c(e){return 3*e}_calcBezier(e){return((this._a(this._mY1,this._mY2)*e+this._b(this._mY1,this._mY2))*e+this._c(this._mY1))*e}_getSlope(e){return 3*this._a(this._mX1,this._mX2)*e*e+2*this._b(this._mX1,this._mX2)*e+this._c(this._mX1)}_getTForX(e){let t=e;for(let i=0;i<4;++i){const i=this._getSlope(t);if(0===i)return t;t-=(this._calcBezier(t)-e)/i}return t}}},58096:(e,t,i)=>{"use strict";i.d(t,{
DEFAULT_SIZE:()=>s,spinnerSizeMap:()=>n});const s="large",n={mini:"xsmall",xxsmall:"xxsmall",xsmall:"xsmall",small:"small",medium:"medium",large:"large"}},34811:(e,t,i)=>{"use strict";i.d(t,{FOCUS_TRAP_DATA_ATTRIBUTE:()=>s});const s="data-focus-trap"},15754:(e,t,i)=>{"use strict";i.d(t,{FOCUSABLE_SELECTOR:()=>n,createScopedVisibleElementFilter:()=>h,getActiveElementSelectors:()=>c,isInertRoot:()=>a,isVisibilityVisible:()=>o});const s=["button","fieldset","optgroup","option","select","textarea","input"],n=["button","input","select","textarea","a[href]","audio[controls]","video[controls]",'[tabindex="0"]','[contenteditable="true"]'].map((e=>s.includes(e)?`${e}:not(:disabled)`:e)).map((e=>`${e}:not([tabindex="-1"])`)).join(",");function o(e){return"visible"===getComputedStyle(e).visibility}function r(e,t){if(e.matches("[inert],[inert] *"))return!0;let i=e;for(;i!==t&&null!==i;){if(l(i))return!0;i=i.parentElement}return!1}function a(e){return e.matches("[inert]")||l(e)}function l(e){return"none"===getComputedStyle(e).display}function c(){return n}function h(e){return t=>o(t)&&!r(t,e)}},76460:(e,t,i)=>{"use strict";function s(e){return 0===e.detail}i.d(t,{isKeyboardClick:()=>s})},91682:(e,t,i)=>{"use strict";i.d(t,{capitalizeFirstLetterInWord:()=>u,decodeHTMLEntities:()=>l,getFirstSegmentOrCodePointString:()=>_,htmlEscape:()=>c,removeSpaces:()=>d,removeTags:()=>h});const s=/[<"'&>]/g,n=e=>`${e.charCodeAt(0)};`,o={"<":"<",">":">",""":'"',"'":"'","&":"&","<":"<",">":">",""":'"',"'":"'","'":"'","&":"&"},r=Object.assign({},...Object.entries(o).map((([e,t])=>({[t]:e})))),a=new RegExp(Object.keys(o).join("|"),"g");new RegExp(Object.keys(r).join("|"),"g");function l(e){return e.replace(a,(e=>o[e]||e))}function c(e){return e.replace(s,n)}function h(e=""){return e.replace(/(<([^>]+)>)/gi,"")}function d(e=""){return e.replace(/\s+/g,"")}function u(e=""){return e.replace(/\b\w/g,(e=>e.toUpperCase()))}function _(e){const t=Intl.Segmenter;if(t){const i=new t(void 0,{granularity:"grapheme"}),[{segment:s}={segment:null}]=i.segment(e);return s?.toUpperCase()??null}{const t=e.codePointAt(0);return t?String.fromCodePoint(t).toUpperCase():null}}},94194:(e,t,i)=>{"use strict";i.d(t,{getTooltipData:()=>n,setTooltipData:()=>o});const s=new WeakMap;function n(e,t){const i=s.get(e);return i instanceof Function?i(t):i&&i[t]}function o(e,t,i){if(i instanceof Function)return void s.set(e,i);const n=s.get(e),o=void 0===n||n instanceof Function?{}:n;o[t]=i,s.set(e,o)}},61814:(e,t,i)=>{"use strict";i.d(t,{hotKeyDeserialize:()=>o,hotKeySerialize:()=>n});var s=i(91682);function n(e){return(0,s.htmlEscape)(JSON.stringify(e))}function o(e){return JSON.parse((0,s.decodeHTMLEntities)(e))}},38780:(e,t,i)=>{"use strict";i.d(t,{hide:()=>$,show:()=>j,showOnElement:()=>U});var s=i(32563),n=i(50151),o=i(4741);let r=0,a=0,l=0;function c(){clearTimeout(r),clearTimeout(a),clearTimeout(l)}function h(e,t){r=setTimeout(e,t)}const d="tooltip-root-element";let u;function _(){const e=document.getElementById(d)
;e?u=e:(u=document.createElement("div"),u.id=d,document.body.appendChild(u))}function p(){u&&(u.innerHTML="")}"interactive"===document.readyState?_():document.addEventListener("DOMContentLoaded",_);var m=i(49481),g=i(63273),f=(i(21251),i(14729)),y=i(9859),v=i(49483);const S={default:"",white:"theme-white",chart:"theme-chart","round-shadow":"theme-round-shadow"},b=Object.keys(S);var w,C=i(94194),P=i(61814),T=i(91751);function x(e){const t=function(e){const t=e.hasAttribute("data-tooltip")?e.getAttribute("data-tooltip"):e.getAttribute("title");return t&&((0,C.setTooltipData)(e,"text",t),e.removeAttribute("title")),(0,C.getTooltipData)(e,"text")||""}(e),i=e.getBoundingClientRect(),s={h:i.height,w:i.width,x:i.left,y:i.top},n=e.getAttribute("data-color-theme")||"",o=e.classList.contains("common-tooltip-html"),r=parseInt(e.getAttribute("data-tooltip-delay")||""),a=parseInt(e.getAttribute("data-tooltip-debounce")||"");let l={type:"none"};return t&&(l={type:o?"html":"text",data:t}),{above:e.classList.contains("common-tooltip-above"),below:e.classList.contains("common-tooltip-below"),otl:e.classList.contains("common-tooltip-otl"),otr:e.classList.contains("common-tooltip-otr"),vertical:e.classList.contains("common-tooltip-vertical"),hotkey:e.getAttribute("data-tooltip-hotkey"),narrow:e.classList.contains("common-tooltip-narrow"),wide:e.classList.contains("common-tooltip-wide"),colorTheme:n,tooltipDelay:r,tooltipDebounce:a,rect:s,content:l,target:e}}function I(e){const t=(0,n.ensureNotNull)(B).cloneNode(!0),i=N(t),{content:s}=e;switch(s.type){case"element":i.innerHTML="",i.appendChild(s.data);break;case"html":i.innerHTML=s.data;break;case"text":if(e.hotkey){const e=(0,n.ensureNotNull)(R).cloneNode(!0);e.innerText=s.data,i.appendChild(e)}else i.innerText=s.data}if(e.hotkey){const t="none"!==s.type,o=(0,n.ensureNotNull)(V).cloneNode(!0),r=(0,P.hotKeyDeserialize)(e.hotkey),a=r.keys.map((e=>`${e}`));o.innerHTML=function(e,t){const i=/{\d}|{hotkey_\d}/gi;return e.replace(i,(e=>{const i=Number(e.match(/\d/));return t[i]}))}(r.text,a).replace(/\s\+\s/g,`+`),i.classList.add(T["common-tooltip__body--with-hotkey"]),t&&o.classList.add(T["common-tooltip__hotkey-block--divider"]),i.appendChild(o)}return t.addEventListener("contextmenu",f.preventDefault),t}function M(e,t){const i=t.rect;if(!i)return;!function(e,t){const i=b.includes(t)?S[t]:"";e.classList.remove(...b.map((e=>S[e])).filter((e=>!!e))),i&&!e.classList.contains(i)&&e.classList.add(i)}(e,t.colorTheme||"default"),t.addClass&&e.classList.add(t.addClass);const s=N(e),n=e.querySelector(`.${T["common-tooltip__button-container"]}`);s.classList.toggle(T["common-tooltip__body--width_wide"],Boolean(t.wide)),s.classList.toggle(T["common-tooltip__body--no-padding"],Boolean(t.noPadding)),s.classList.toggle(T["common-tooltip__body--width_narrow"],Boolean(t.narrow)),s.classList.toggle(T["common-tooltip__body--no-buttons"],!0),s.style.left=L(0),
s.style.width=L(s.clientWidth+(Boolean(t.noPadding)?0:2));const o=document.body.clientWidth,r=v.CheckMobile.iOS()||v.CheckMobile.Android()||(0,v.supportTouch)()&&(0,v.isMac)()?window.innerHeight:document.body.clientHeight,a=t.vertical,l=t.extendMargin||a&&i.w<20||!a&&i.h<20;e.classList.toggle(T["common-tooltip--farther"],l),e.classList.toggle(T["common-tooltip--vertical"],a),e.classList.toggle(T["common-tooltip--horizontal"],!a);const c=function(e){return e.querySelector(`.${T["common-tooltip__ear-holder"]}`)}(e),h=e.offsetHeight;if(a){const a=10,l=r-10,d=12,u=a+d,_=l-d,p=(0,y.clamp)(i.y+i.h/2,u,_)-h/2,m=p+h;e.style.left=L(i.x+i.w),e.style.top=L(p),pl&&(s.style.top=n.style.top=L(l-m));const{right:f}=(e.querySelector(":last-child")||s).getBoundingClientRect(),v=f+10>o;e.classList.toggle(T["common-tooltip--direction_reversed"],v),e.classList.toggle(T["common-tooltip--direction_normal"],!v);let S=v?"after":"before";(0,g.isRtl)()?(S=t.otr?"after":S,S=t.otl?"before":S):(S=t.otr?"before":S,S=t.otl?"after":S),c.classList.toggle(T["common-tooltip__ear-holder--before"],"before"===S),c.classList.toggle(T["common-tooltip__ear-holder--after"],"after"===S),"after"===S&&(e.style.left="auto",e.style.right=L(o-i.x))}else{const a=i.x-(s.offsetWidth-i.w)/2,l=o-e.offsetWidth-20<=0?(o-e.offsetWidth)/2:10,d=o-l-e.offsetWidth,u=Math.max(l,Math.min(a,d));e.style.left=L(u);const _=d\n\t\t\n\t\t\n\t\n`,D=`\n\t\n`,E=`\n\t\n`,B=(0,m.parseHtmlElement)(k),V=(0,m.parseHtmlElement)(D),R=(0,m.parseHtmlElement)(E);function N(e){return e.querySelector(`.${T["common-tooltip__body"]}`)}function O(e,t){return 10+e{if(W&&W.options.target){let e;e="isConnected"in W.options.target?W.options.target.isConnected:document.body.contains(W.options.target),e||$()}})),U=(e,t={})=>{const{content:i,...s}=Z(t),n=x(e),o=Object.assign(n,s);return"none"!==i.type&&(o.content=i),!("none"===o.content.type&&!o.hotkey)&&(o.target=e,j(o),!0)},j=e=>{const t=Z(e),i=I(t);var s;if(W={options:t,element:i},s=i,p(),u&&u.appendChild(s),c(),!F)return A(i),void h((()=>K(i)),function(e){return"number"!=typeof e.tooltipDelay||isNaN(e.tooltipDelay)?500:e.tooltipDelay}(t));const{tooltipDebounce:n}=e;"number"!=typeof n||isNaN(n)?K(i):h((()=>K(i)),n)};function G(e,t){if("sourceCapabilities"in e&&e.sourceCapabilities?.firesTouchEvents)return;const i=function(e,t,i){const s=[];for(;e&&e!==t;)e.classList&&e.classList.contains(i)&&s.push(e),e=e.parentElement||Y(e.parentNode);return s}(e.target,e.currentTarget,"apply-common-tooltip");for(const s of i){if(e instanceof MouseEvent)if("buttons"in e){if(1&e.buttons)continue}else if(1===e.which)continue;const i=()=>U(s);if(i()){const e=e=>n(null,!0),n=(o,r=!1)=>{s.removeEventListener("common-tooltip-update",i),s.removeEventListener("mouseleave",n),s.removeEventListener("mousedown",n),document.removeEventListener("scroll",e,{capture:!0}),t&&(s.removeEventListener("blur",n),s.removeEventListener("active-descendant-blur",n)),H&&(H.destroy(),H=null),$(r)};s.addEventListener("common-tooltip-update",i),s.addEventListener("mouseleave",n),s.addEventListener("mousedown",n),document.addEventListener("scroll",e,{capture:!0}),t&&(s.addEventListener("blur",n),s.addEventListener("active-descendant-blur",n)),null===H&&(H=(0,o.createGroup)({desc:"Tooltip"}),H.add({desc:"Hide",hotkey:27,handler:n}));break}}}function q(){p(),F=!1,W=null}const $=(e,t)=>{if(c(),(0,n.ensureNotNull)(z).disconnect(),!W)return;if(!e&&!F)return;const{element:i,options:s}=W,o=()=>{i.removeEventListener("mouseleave",o),A(i),e?q():l=setTimeout((()=>{q()}),250),t?.()};var r,h;s.tooltipHideDelay?(r=()=>{i.querySelector(":hover")?i.addEventListener("mouseleave",o):o()},h=s.tooltipHideDelay,a=setTimeout(r,h)):o()};function K(e){const{options:t}=(0,n.ensureNotNull)(W);if(M(e,t),function(e){e.classList.toggle(T["common-tooltip--hidden"],!1)}(e),(0,n.ensureNotNull)(z).observe(document,{childList:!0,subtree:!0}),F=!0,t.forceHideOnMove){const e=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("touchmove",e),$()};document.addEventListener("mousemove",e),document.addEventListener("touchmove",e)}}function Y(e){return e&&(e.nodeType===Node.ELEMENT_NODE?e:null)}function Z(e){if(function(e){return"content"in e}(e))return e;const{inner:t,html:i,text:s,...n}=e;let o={type:"none"};return t&&(o={type:"element",data:t}),s&&(o={type:i?"html":"text",data:s}),{
content:o,...n}}},32112:(e,t,i)=>{"use strict";function s(e,t){const i=e.dataSourceForId(t);if(null===i)throw new Error(`Chart has no study or shape with id "${t}"`);return i}i.d(t,{SelectionApi:()=>n});class n{constructor(e){this._model=e}add(e){Array.isArray(e)?this._model.selectionMacro((t=>{e.map(s.bind(null,this._model)).forEach((e=>t.addSourceToSelection(e)))})):this.add([e])}canBeAddedToSelection(e){const t=s(this._model,e);return this._model.selection().canBeAddedToSelection(t)}set(e){Array.isArray(e)?this._model.selectionMacro((t=>{t.clearSelection(),e.map(s.bind(null,this._model)).forEach((e=>t.addSourceToSelection(e)))})):this.set([e])}remove(e){Array.isArray(e)?this._model.selectionMacro((t=>{e.map(s.bind(null,this._model)).forEach((e=>t.removeSourceFromSelection(e)))})):this.remove([e])}contains(e){const t=s(this._model,e);return this._model.selection().isSelected(t)}allSources(){return this._model.selection().dataSources().map((e=>e.id()))}isEmpty(){return this._model.selection().isEmpty()}clear(){this._model.selectionMacro((e=>{e.clearSelection()}))}onChanged(){return this._model.onSelectedSourceChanged()}}},23024:(e,t,i)=>{"use strict";i.d(t,{getChartStorage:()=>o});var s=i(64289);let n=null;async function o(){const e=(0,s.getCustomAdapter)();if(null===n)if(null!==e){const{ChartStorageExternalAdapter:t}=await i.e(8313).then(i.bind(i,33047));n=new t(e)}else{const{ChartStorageHttpLibrary:e}=await i.e(6124).then(i.bind(i,11777));n=new e}return null===n&&(n=new ChartStorageHttp),n}},38881:(e,t,i)=>{"use strict";i.d(t,{ChunkLoader:()=>n});var s=i(14051);class n{constructor(){this._retries=5,this._cache=null,this._tryLoad=(e,t)=>{this._retries=this._retries-1;this._startLoading(e).then(t,0!==this._retries?i=>{(0,s.isAbortError)(i)||setTimeout((()=>this._tryLoad(e,t)),3e3)}:void 0)}}load(e){return this._cache||(this._cache=new Promise(this._tryLoad.bind(this,e??null))),this._cache}}},80007:(e,t,i)=>{"use strict";i.d(t,{preventDefault:()=>n,preventScrollByWheelClick:()=>r,wrapHandlerWithPreventEvent:()=>o});var s=i(49483);function n(e){e.cancelable&&e.preventDefault()}function o(e){return t=>{n(t),e(t)}}function r(e){s.isChrome&&e.addEventListener("mousedown",(e=>{if(1===e.button)return e.preventDefault(),!1}))}},56186:(e,t,i)=>{"use strict";function s(e){if(e instanceof Error)return e.stack||e.message;try{return e.outerHTML.slice(0,1024)}catch{}try{if(void 0!==e)return JSON.stringify(e).slice(0,1024)}catch{}return String(e)}function n(){window.__tv_js_errors||(window.__tv_js_errors=[]),window.addEventListener("error",(e=>{const t=(new Date).toISOString();window.__tv_js_errors.push(`${t} ${e.message||"JS error"}. ${e.filename||""}, line ${e.lineno}, col ${e.colno}.\nError: ${s(e.error)}`)}),!1),window.addEventListener("unhandledrejection",(e=>{const t=(new Date).toISOString();window.__tv_js_errors.push(`${t} Unhandled rejection.\nReason: ${s(e.reason)}`)}),!1),document.addEventListener("securitypolicyviolation",(e=>{
if(String(e.sourceFile).startsWith("https://securepubads.g.doubleclick.net")&&String(e.blockedURI).startsWith("https://adservice.google."))return;const t=(new Date).toISOString(),i="report"===e.disposition?"CSP report-only":"CSP violation";window.__tv_js_errors.push(`${t} ${i}: ${e.violatedDirective||e.effectiveDirective}. ${e.sourceFile||""}, line ${e.lineNumber}, col ${e.columnNumber}.\nBlocked URI: ${e.blockedURI}\nSample: ${e.sample}\nTarget: ${s(e.target)}`)}),!1)}i.d(t,{install:()=>n})},76422:(e,t,i)=>{"use strict";i.r(t),i.d(t,{emit:()=>u,emitOnce:()=>_,on:()=>c,subscribe:()=>h,subscribeToAll:()=>d,unsubscribe:()=>a,unsubscribeAll:()=>l});var s=i(52033);const n={},o=[],r={};function a(e,t,i){n[e].unsubscribe(i,t)}function l(e,t){n[e].unsubscribeAll(t)}function c(e,t,i){h(e,t,i)}function h(e,t,i,o){n.hasOwnProperty(e)||(n[e]=new s.Delegate),r[e]?t.call(i):n[e].subscribe(i,t,o)}function d(e){o.push(e)}function u(e,...t){const i=[e].concat(t);o.forEach((e=>{e.apply(null,i)})),n.hasOwnProperty(e)&&n[e].fire.apply(n[e],t)}function _(e){r[e]&&console.warn(`Something went wrong: emitOnce called multiple times with same event (${e})`),r[e]=!0,u.apply(null,arguments)}},4741:(e,t,i)=>{"use strict";i.d(t,{Modifiers:()=>n.Modifiers,createGroup:()=>_,keyboardPressedKeysState:()=>u,pressedKeys:()=>d});var s=i(91679),n=i(3343),o=i(54717);class r{constructor(e,t){this.modifiers=e,this.code=t}altOrOptionCode(){return"AltLeft"===this.code||"AltRight"===this.code}controlOrMetaCode(){return n.isMacKeyboard?"MetaLeft"===this.code||"MetaRight"===this.code||"OSLeft"===this.code||"OSRight"===this.code:"ControlLeft"===this.code||"ControlRight"===this.code}}class a extends s.WatchedValue{setValue(e,t){const i=this.value();(t||void 0===i||i.code!==e.code||i.modifiers!==e.modifiers)&&super.setValue(e)}}class l{constructor(e,t){this._group=e;const{hotkey:i,handler:s,desc:n,isDisabled:o,element:r=null,isRepeatAccepted:a=!1}=t;this.hotkey=i,this.handler=s,this.desc=n,this.element=r,this.isRepeatAccepted=a,this.isDisabled=o?"function"==typeof o?o:()=>!0:()=>!1}destroy(){this._group&&(this._group.remove(this),this._group=null)}}class c{constructor(e,t){this._actions=new Map,this._manager=e,this.modal=!(!t||!t.modal),t&&(this.desc=t.desc),t&&t.isDisabled?"function"==typeof t.isDisabled?this.isDisabled=t.isDisabled:this.isDisabled=()=>!0:this.isDisabled=()=>!1,this._manager.registerGroup(this)}add(e){let t=this._actions.get(e.hotkey);t||(t=[],this._actions.set(e.hotkey,t));const i=new l(this,e);return t.push(i),i}remove(e){const t=this._actions.get(e.hotkey);if(!t)return;const i=t.findIndex((t=>t===e));i>=0&&(1===t.length?this._actions.delete(e.hotkey):t.splice(i,1))}handleHotkey(e,t){const i=this._actions.get(e);if(!i)return!1;for(const s of i)if((!s.element||t.target&&s.element.contains(t.target))&&!s.isDisabled(t))return t.repeat&&!s.isRepeatAccepted||(s.handler(t),this._callMatchedHotkeyHandler(e)),t.preventDefault(),!0;return!1}promote(){this._manager.promoteGroup(this)}destroy(){
for(const[,e]of this._actions)for(const t of e)t.destroy();this._actions.clear(),this._manager.unregisterGroup(this)}static setMatchedHotkeyHandler(e){c._matchedHotkeyHandler=e}_callMatchedHotkeyHandler(e){c._matchedHotkeyHandler&&c._matchedHotkeyHandler(e)}}const h=new class{constructor(){this._groups=[],this._pressedKeys=new s.WatchedValue(0),this._keyboardPressedKeysState=new a(new r(0)),this._keyDownListener=e=>{if(e.defaultPrevented)return;const t=(0,n.hashFromEvent)(e);if(this._pressedKeys.setValue(t),this._keyboardPressedKeysState.setValue(new r((0,n.modifiersFromEvent)(e),e.code)),!(0,o.isNativeUIInteraction)(t,e.target))for(let i=this._groups.length;i-- >0;){const s=this._groups[i];if(!s.isDisabled()){if(s.handleHotkey(t,e))return;if(s.modal)return}}},this._keyUpListener=e=>{const t=(0,n.hashFromEvent)(e);this._pressedKeys.setValue(t),this._keyboardPressedKeysState.setValue(new r((0,n.modifiersFromEvent)(e),""))},this._blurEvent=()=>{this._pressedKeys.setValue(0),this._keyboardPressedKeysState.setValue(new r(0,""))},this._mouseEvent=e=>{const t=(0,n.modifiersFromEvent)(e),i=255&(this._pressedKeys.value()??0);this._pressedKeys.setValue(t|i)}}listen(e){e.addEventListener("keydown",this._keyDownListener),e.addEventListener("keyup",this._keyUpListener),e.addEventListener("blur",this._blurEvent),e.addEventListener("mousemove",this._mouseEvent)}unlisten(e){e.removeEventListener("keydown",this._keyDownListener),e.removeEventListener("keyup",this._keyUpListener),e.removeEventListener("blur",this._blurEvent),e.removeEventListener("mousemove",this._mouseEvent)}registerGroup(e){this._groups.push(e)}unregisterGroup(e){for(let t=this._groups.length;t--;)this._groups[t]===e&&this._groups.splice(t,1)}promoteGroup(e){let t=this._groups.length-1;for(let i=this._groups.length;i--;){if(this._groups[i]===e)return void(i!==t&&(this._groups.splice(i,1),this._groups.splice(t,0,e)));this._groups[i].modal&&(t=i-1)}}pressedKeys(){return this._pressedKeys.readonly()}keyboardPressedKeysState(){return this._keyboardPressedKeysState.readonly()}},d=h.pressedKeys(),u=h.keyboardPressedKeysState();function _(e){return new c(h,e)}var p,m=i(51768);p=window,h.listen(p),c.setMatchedHotkeyHandler((e=>{(0,m.trackEvent)("Keyboard Shortcuts",(0,n.humanReadableHash)(e))}))},68335:(e,t,i)=>{"use strict";i.d(t,{Modifiers:()=>s.Modifiers,hashFromEvent:()=>s.hashFromEvent,humanReadableHash:()=>s.humanReadableHash,humanReadableModifiers:()=>s.humanReadableModifiers,isMacKeyboard:()=>s.isMacKeyboard,modifiersFromEvent:()=>s.modifiersFromEvent});var s=i(3343)},35749:(e,t,i)=>{"use strict";i.d(t,{isNativeUIInteraction:()=>s.isNativeUIInteraction,isTextEditingField:()=>s.isTextEditingField});var s=i(54717)},71382:(e,t,i)=>{"use strict";i.d(t,{isTouchEvent:()=>n});var s=i(32563);function n(e){const t=e.sourceCapabilities;let i=t&&t.firesTouchEvents;return void 0===i&&(i=s.touch),i}},82992:(e,t,i)=>{"use strict";i.d(t,{linking:()=>m});var s=i(90484),n=i(50151),o=i(64147),r=(i(56570),i(85049)),a=i(68805),l=i(9343),c=i(42989),h=i(69109);const d=(0,
l.getLogger)("Linking");var u,_;!function(e){e[e.NotBound=0]="NotBound",e[e.BoundToWidget=1]="BoundToWidget",e[e.BoundToModel=2]="BoundToModel"}(u||(u={})),function(e){e[e.Symbol=0]="Symbol",e[e.Resolution=1]="Resolution"}(_||(_={}));class p{constructor(e,t,i){this.watchedSymbol=new o.WatchedValue,this.seriesShortSymbol=new o.WatchedValue,this.proSymbol=new o.WatchedValue,this.ensuredProSymbol=new o.WatchedValue,this.watchedInterval=new o.WatchedValue,this.watchedIntraday=new o.WatchedValue,this.watchedSeconds=new o.WatchedValue,this.watchedTicks=new o.WatchedValue,this.watchedDataFrequencyResolution=new o.WatchedValue,this.watchedRange=new o.WatchedValue,this.watchedSupportedResolutions=new o.WatchedValue,this.watchedSupportedChartStyles=new o.WatchedValue,this.symbolNamesList=new o.WatchedValue,this._chartWidgetCollection=null,this._chartWidgetBindingState=0,this._activeChartWidget=null,this._linkingGroupCharts=null,this._boundChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._setGroupSymbolCancellationToken={cancelled:!1},this._muted=!1,this.updateBoundChartWidget=()=>{const e=this._chartToBind();e!==this._boundChartWidget&&(null===e?this.unbindFromChartWidget():this.bindToChartWidget(e))},this._updateAllGroupChartWidgets=()=>{this._destroySymbolIntervalPropertySubscriptions?.();const e=(0,n.ensureNotNull)(this._linkingGroupCharts).value(),t=[],i=[];for(const s of e){const e=s.symbolWV().spawn(),n=s.resolutionWV().spawn();e.subscribe(this._updateSymbolByProperty.bind(this,s)),n.subscribe(this._updateIntervalByProperty.bind(this,s)),t.push(e),i.push(n)}this._destroySymbolIntervalPropertySubscriptions=()=>{t.forEach((e=>e.destroy())),i.forEach((e=>e.destroy())),this._destroySymbolIntervalPropertySubscriptions=void 0};const s=this.watchedSymbol.value();e.length>1&&this._needApplySymbol(s)&&!this._muted&&this._setGroupSymbol(s);const o=this.watchedInterval.value();e.length>1&&this._needApplyInterval(o)&&!this._muted&&this._setGroupInterval(o),this.updateBoundChartWidget()},this._groupIndex=e;const s=(e,t)=>{e.subscribe((e=>{i()===this&&t.setValue(e)}),{callWithLast:!0})};s(this.watchedSymbol,t.watchedSymbol),s(this.seriesShortSymbol,t.seriesShortSymbol),s(this.proSymbol,t.proSymbol),s(this.ensuredProSymbol,t.ensuredProSymbol),s(this.watchedInterval,t.watchedInterval),s(this.watchedIntraday,t.watchedIntraday),s(this.watchedSeconds,t.watchedSeconds),s(this.watchedTicks,t.watchedTicks),s(this.watchedDataFrequencyResolution,t.watchedDataFrequencyResolution),s(this.watchedRange,t.watchedRange),s(this.watchedSupportedResolutions,t.watchedSupportedResolutions),s(this.watchedSupportedChartStyles,t.watchedSupportedChartStyles),s(this.symbolNamesList,t.symbolNamesList),this.watchedSymbol.subscribe((e=>{this._boundChartWidget&&this._boundChartWidget.hasModel()&&this._mainSeries().symbolSameAsCurrent(e)||this.proSymbol.setValue(e)}),{callWithLast:!0})}mute(e){this._muted=e}bindToChartWidgetCollection(e){
this.unbindFromChartWidgetCollection(),this._chartWidgetCollection=e,this._activeChartWidget=e.activeChartWidget.spawn(),this._activeChartWidget.subscribe(this.updateBoundChartWidget),this._linkingGroupCharts=e.linkingGroupsCharts(this._groupIndex).spawn(),this._linkingGroupCharts.subscribe(this._updateAllGroupChartWidgets),this.updateBoundChartWidget(),this._updateAllGroupChartWidgets()}unbindFromChartWidgetCollection(){this.unbindFromChartWidget(),this._chartWidgetCollection=null,this._activeChartWidget?.destroy(),this._activeChartWidget=null,this._linkingGroupCharts?.destroy(),this._linkingGroupCharts=null,this._destroySymbolIntervalPropertySubscriptions?.()}bindToChartWidget(e){if(this.unbindFromChartWidget(),this._boundChartWidget=e,e.hasModel())return void this._onChartModelCreated(e.model());e.modelCreated().subscribe(this,this._onChartModelCreated,!0),this._chartWidgetBindingState=1;const t=e.mainSeriesProperties().childs();this.watchedSymbol.setValue(t.symbol.value()),this.watchedInterval.setValue(t.interval.value()),this._boundChartWidget.linkingGroupIndex().subscribe(this.updateBoundChartWidget)}unbindFromChartWidget(){const e=this._boundChartWidget;if(null!==e){switch(this._chartWidgetBindingState){case 1:e.modelCreated().unsubscribeAll(this);break;case 2:this.watchedSymbol.unsubscribe(this._watchedSymbolListenerBound);const t=this._mainSeries().dataEvents();t.symbolResolved().unsubscribeAll(this),t.symbolError().unsubscribeAll(this),this._mainSeries().onIntervalChanged().unsubscribeAll(this),this.watchedInterval.unsubscribe(this._watchedIntervalListenerBound),delete this.watchedSymbol.writeLock}e.linkingGroupIndex().unsubscribe(this.updateBoundChartWidget),this._boundChartWidget=null,this._chartWidgetBindingState=0}}boundChartWidget(){return this._boundChartWidget}_mainSeries(){if(!this._boundChartWidget)throw new Error("ChartWidget is undefined");return this._boundChartWidget.model().mainSeries()}_watchedSymbolListener(e){this._needApplySymbol(e)&&!this._muted&&this._setGroupSymbol(e)}_updateSymbolByProperty(e,t){const i=this._symbolLock();i&&this._needApplySymbol(t)&&!this._muted&&this._setGroupSymbol(t),(i||e===this._boundChartWidget)&&this.watchedSymbol.setValue(t)}_watchedIntervalListener(e){const t=r.Interval.normalize(e);t&&this._needApplyInterval(t)&&!this._muted&&this._setGroupInterval(t)}_updateIntervalByProperty(e,t){const i=this._intervalLock(),s=r.Interval.normalize(t);i&&s&&this._needApplyInterval(s)&&!this._muted&&this._setGroupInterval(s),(i||e===this._boundChartWidget)&&this.watchedInterval.setValue(s??t)}_sendSnowplowAnalytics(){if(!window.user.do_not_track)throw new Error("unsupported")}_updateSeriesSymbolInfo(){this.seriesShortSymbol.setValue((0,n.ensureNotNull)(this._boundChartWidget).getSymbol(!0));const e=this._mainSeries().symbolInfo();if(e){const t=e.pro_name||!1;this.proSymbol.setValue(t||this.watchedSymbol.value()),this.ensuredProSymbol.setValue(this.proSymbol.value()),e.aliases&&this.symbolNamesList.setValue(e.aliases);{const t=e.supported_resolutions
;t?this.watchedSupportedResolutions.setValue(t):this.watchedSupportedResolutions.setValue(void 0)}let i=(0,c.allChartStyles)();((0,a.isCloseBasedSymbol)(e)||this._mainSeries().intervalObj().is1Tick())&&(i=i.filter((e=>(0,a.isSingleValueBasedStyle)(e)))),this.watchedSupportedChartStyles.setValue(i),this.watchedIntraday.setValue(!!e.has_intraday),this.watchedSeconds.setValue(!!e.has_seconds),this.watchedTicks.setValue(!(0,a.isCloseBasedSymbol)(e)&&!!e["is-tickbars-available"]),this.watchedRange.setValue(!(0,a.isCloseBasedSymbol)(e));const s=e.data_frequency?e.data_frequency:void 0;this.watchedDataFrequencyResolution.setValue(s)}else this.watchedIntraday.setValue(!1),this.watchedSeconds.setValue(!1),this.watchedTicks.setValue(!1),this.watchedRange.setValue(!1),this._mainSeries().isFailed()&&this.ensuredProSymbol.setValue(this.proSymbol.value())}_onChartModelCreated(e){if(!this._boundChartWidget)throw new Error("ChartWidget is undefined");this._chartWidgetBindingState=2,this.watchedSymbol.setValue(this._boundChartWidget.symbolWV().value()),this.watchedSymbol.subscribe(this._watchedSymbolListenerBound);const t=e.mainSeries().dataEvents();t.symbolResolved().subscribe(this,this._updateSeriesSymbolInfo),t.symbolError().subscribe(this,this._updateSeriesSymbolInfo),e.mainSeries().onIntervalChanged().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo(),this.watchedInterval.setValue(this._boundChartWidget.resolutionWV().value()),this.watchedInterval.subscribe(this._watchedIntervalListenerBound),this._boundChartWidget.readOnly()&&(this.watchedSymbol.writeLock=!0)}_chartToBind(){const e=this._chartWidgetCollection;return null===e?null:e.activeChartWidget.value()}_symbolLock(){return!!this._chartWidgetCollection?.lock.symbol.value()}_intervalLock(){return!!this._chartWidgetCollection?.lock.interval.value()}_chartsForLock(e){return(0===e?this._symbolLock():this._intervalLock())?(0,n.ensureNotNull)(this._linkingGroupCharts).value():this._boundChartWidget?[this._boundChartWidget]:[]}_setGroupSymbol(e){this.mute(!0),this._setGroupSymbolCancellationToken.cancelled=!0;const t=this._setGroupSymbolCancellationToken={cancelled:!1};(0,n.ensureNotNull)(this._chartWidgetCollection).setSymbol(e,this._groupIndex,(0,n.ensureNotNull)(this._boundChartWidget)).finally((()=>{if(this._boundChartWidget&&!t.cancelled){const t=this._boundChartWidget.model().mainSeries();t.symbolSameAsCurrent(e)||(this.watchedSymbol.setValue(t.symbol()),this.proSymbol.setValue(t.proSymbol()))}})),this.mute(!1)}_needApplySymbol(e){const t=this._chartsForLock(0),i=t.find((t=>t.hasModel()&&t.model().mainSeries().symbolInfo()&&t.model().mainSeries().symbolSameAsResolved(e)));if(i){const e=i.model().mainSeries();if(t.every((t=>e.symbolSameAsResolved(t.symbolWV().value()))))return!1}return t.some((t=>t.symbolWV().value()!==e))}_setGroupInterval(e){this.mute(!0),(0,n.ensureNotNull)(this._chartWidgetCollection).setResolution(e,this._groupIndex).finally((()=>{if(this._boundChartWidget){const t=this._boundChartWidget.resolutionWV().value()
;r.Interval.isEqual(t,e)||this.watchedInterval.setValue(t)}})),this.mute(!1)}_needApplyInterval(e){return this._chartsForLock(1).some((t=>!r.Interval.isEqual(t.resolutionWV().value(),e)))}}const m=new class{constructor(){this._watchedSymbol=new o.WatchedValue,this._seriesShortSymbol=new o.WatchedValue,this._proSymbol=new o.WatchedValue,this._ensuredProSymbol=new o.WatchedValue,this._watchedInterval=new o.WatchedValue,this._watchedIntraday=new o.WatchedValue,this._watchedSeconds=new o.WatchedValue,this._watchedTicks=new o.WatchedValue,this._watchedDataFrequencyResolution=new o.WatchedValue,this._watchedRange=new o.WatchedValue,this._watchedSupportedResolutions=new o.WatchedValue,this._watchedSupportedChartStyles=new o.WatchedValue([]),this._symbolNamesList=new o.WatchedValue,this._chartWidgetCollection=null,this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._searchChartsLoadDebounced=null,this._selfEmit=!1,this._preventFeedBySymbol=!1,this._feedBySymbolDebounceCounter=0,this._linkingGroups=new Map,this._activeLinkingGroup=new o.WatchedValue,this._activeLinkingGroupIndex=null,this._updateLinkingGroups=()=>{(0,n.ensureNotNull)(this._chartWidgetCollection).allLinkingGroups().value().forEach((e=>this._linkingGroup(e))),this._linkingGroups.forEach((e=>e.updateBoundChartWidget()))},this._activeLinkingGroup.setValue(this._linkingGroup(null));const e=(e,t)=>{e.subscribe((e=>t().setValue(e)),{callWithLast:!0})};e(this._watchedSymbol,(()=>this._activeLinkingGroup.value().watchedSymbol)),e(this._seriesShortSymbol,(()=>this._activeLinkingGroup.value().seriesShortSymbol)),e(this._proSymbol,(()=>this._activeLinkingGroup.value().proSymbol)),e(this._ensuredProSymbol,(()=>this._activeLinkingGroup.value().ensuredProSymbol)),e(this._watchedInterval,(()=>this._activeLinkingGroup.value().watchedInterval)),e(this._watchedIntraday,(()=>this._activeLinkingGroup.value().watchedIntraday)),e(this._watchedSeconds,(()=>this._activeLinkingGroup.value().watchedSeconds)),e(this._watchedTicks,(()=>this._activeLinkingGroup.value().watchedTicks)),e(this._watchedDataFrequencyResolution,(()=>this._activeLinkingGroup.value().watchedDataFrequencyResolution)),e(this._watchedRange,(()=>this._activeLinkingGroup.value().watchedRange)),e(this._watchedSupportedResolutions,(()=>this._activeLinkingGroup.value().watchedSupportedResolutions)),e(this._watchedSupportedChartStyles,(()=>this._activeLinkingGroup.value().watchedSupportedChartStyles)),e(this._symbolNamesList,(()=>this._activeLinkingGroup.value().symbolNamesList));const t=e=>{this._watchedSymbol.setValue(e.watchedSymbol.value()),this._seriesShortSymbol.setValue(e.seriesShortSymbol.value()),this._proSymbol.setValue(e.proSymbol.value()),this._ensuredProSymbol.setValue(e.ensuredProSymbol.value()),this._watchedInterval.setValue(e.watchedInterval.value()),this._watchedIntraday.setValue(e.watchedIntraday.value()),this._watchedSeconds.setValue(e.watchedSeconds.value()),this._watchedTicks.setValue(e.watchedTicks.value()),
this._watchedDataFrequencyResolution.setValue(e.watchedDataFrequencyResolution.value()),this._watchedRange.setValue(e.watchedRange.value()),this._watchedSupportedResolutions.setValue(e.watchedSupportedResolutions.value()),this._watchedSupportedChartStyles.setValue(e.watchedSupportedChartStyles.value()),this._symbolNamesList.setValue(e.symbolNamesList.value())};this._activeLinkingGroup.subscribe(t),t(this._activeLinkingGroup.value()),(0,h.setMuteLinkingGroup)(((e,t)=>{this._linkingGroup(e).mute(t)}))}get symbol(){return this._watchedSymbol}get proSymbol(){return this._proSymbol.readonly()}get ensuredProSymbol(){return this._ensuredProSymbol.readonly()}get symbolNamesList(){return this._symbolNamesList.readonly()}get seriesShortSymbol(){return this._seriesShortSymbol.readonly()}get interval(){return this._watchedInterval}get intraday(){return this._watchedIntraday.readonly()}get seconds(){return this._watchedSeconds.readonly()}get ticks(){return this._watchedTicks.readonly()}get range(){return this._watchedRange.readonly()}get supportedResolutions(){return this._watchedSupportedResolutions.readonly()}get supportedChartStyles(){return this._watchedSupportedChartStyles.readonly()}get preventFeedBySymbol(){return this._preventFeedBySymbol}get dataFrequencyResolution(){return this._watchedDataFrequencyResolution.readonly()}activeLinkingGroup(){return this._activeLinkingGroup.readonly()}getChartWidget(){return this.activeLinkingGroup().value().boundChartWidget()}bindToChartWidgetCollection(e){this._chartWidgetCollection?.onAboutToBeDestroyed.unsubscribeAll(this),this._unbindFromChartWidgetCollection(),this._chartWidgetCollection=e,this._chartWidgetCollection.onAboutToBeDestroyed.subscribe(this,this._unbindFromChartWidgetCollection),this._chartWidgetCollection.allLinkingGroups().subscribe(this._updateLinkingGroups),this._updateLinkingGroups(),this._activeLinkingGroupIndex=e.activeLinkingGroup().spawn(),this._activeLinkingGroupIndex.subscribe((e=>{this._activeLinkingGroup.setValue(this._linkingGroup(e))}),{callWithLast:!0}),this._linkingGroups.forEach((t=>t.bindToChartWidgetCollection(e)))}bindToSearchCharts(e){this.unbindFromSearchCharts(),this._searchCharts=e,e.onSearchBySymbol.subscribe(this,this._onSearchBySymbol),e.loadingSymbol.subscribe((e=>{!1===e&&(this._feedBySymbolDebounceCounter=0)})),this._watchedSymbol.subscribe(this._onSymbolLinkBound)}unbindFromSearchCharts(){this._searchCharts&&(this._searchCharts.onSearchBySymbol.unsubscribe(this,this._onSearchBySymbol),this._watchedSymbol.unsubscribe(this._onSymbolLinkBound),this._searchCharts=null)}setPreventFeedBySymbol(e){this._preventFeedBySymbol=e}setSymbolAndLogInitiator(e,t,i){(this.symbol.value()!==e||i)&&(d.logInfo(`Change linking symbol to ${e}, initiator: ${t}`),this.symbol.setValue(e,i))}_onSearchBySymbol(e){if(!e.resolved_symbol)throw new Error("no resolved_symbol");this._selfEmit=!0,this._watchedSymbol.setValue(e.resolved_symbol),this._selfEmit=!1}_onSymbolLink(e){if(!this._selfEmit){if(!this._searchCharts){const e="No search charts defined"
;throw d.logError(e),new Error(e)}this._preventFeedBySymbol||this._loadSearchCharts(e)}}_loadSearchCharts(e){if(!this._searchCharts){const e="No search charts defined";throw d.logError(e),new Error(e)}if(this._searchChartsLoadDebounced)return void(this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced(e)));const t=e=>this._searchCharts?(!0===this._searchCharts.loadingSymbol.value()?this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced=(0,s.default)(t,2e3),this._searchChartsLoadDebounced(e)):this._searchChartsLoadDebounced=null,this._searchCharts.feedBySymbol.call(this._searchCharts,e)):()=>{};!0===this._searchCharts.loadingSymbol.value()?this._feedBySymbolDebounceCounter<100&&(this._feedBySymbolDebounceCounter++,this._searchChartsLoadDebounced=(0,s.default)(t,2e3),this._searchChartsLoadDebounced(e)):this._searchCharts.feedBySymbol(e)}_linkingGroup(e){e=null;let t=this._linkingGroups.get(e);if(void 0===t){const i={watchedSymbol:this._watchedSymbol,seriesShortSymbol:this._seriesShortSymbol,proSymbol:this._proSymbol,ensuredProSymbol:this._ensuredProSymbol,watchedInterval:this._watchedInterval,watchedIntraday:this._watchedIntraday,watchedSeconds:this._watchedSeconds,watchedTicks:this._watchedTicks,watchedDataFrequencyResolution:this._watchedDataFrequencyResolution,watchedRange:this._watchedRange,watchedSupportedResolutions:this._watchedSupportedResolutions,watchedSupportedChartStyles:this._watchedSupportedChartStyles,symbolNamesList:this._symbolNamesList};t=new p(e,i,(()=>this._activeLinkingGroup.value())),this._linkingGroups.set(e,t),this._chartWidgetCollection&&t.bindToChartWidgetCollection(this._chartWidgetCollection)}return t}_unbindFromChartWidgetCollection(){null!==this._chartWidgetCollection&&(this._activeLinkingGroupIndex?.destroy(),this._activeLinkingGroupIndex=null,this._linkingGroups.forEach((e=>e.unbindFromChartWidgetCollection())),this._chartWidgetCollection.allLinkingGroups().unsubscribe(this._updateLinkingGroups),this._chartWidgetCollection=null)}};window.TradingViewApi||(window.TradingViewApi={linking:m})},11417:(e,t,i)=>{"use strict";const{getLogger:s}=i(9343),n=s("TVLocalStorage");var o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(e){delete this.isAvailable,delete this.localStorage}this._updateLength();try{this._report()}catch(e){}};o.prototype._report=function(){if(this.isAvailable){const e=10,t=[];for(let e=0;et.length-e.length));const i=t.slice(0,e);t.sort(((e,t)=>t.key.length-e.key.length));const s=t.slice(0,e);n.logNormal(`Total amount of keys in Local Storage: ${this.length}`),n.logNormal(`Top ${e} keys with longest values: ${JSON.stringify(i)}`),n.logNormal(`Top ${e} longest key names: ${JSON.stringify(s)}`);try{navigator.storage.estimate().then((e=>{
n.logNormal(`Storage estimate: ${JSON.stringify(e)}`)}))}catch(e){}}},o.prototype.length=0,o.prototype.isAvailable=!1,o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){if(this.isAvailable)this.length=this.localStorage.length;else{var e,t=0;for(e in this.localStorage)this.localStorage.hasOwnProperty(e)&&t++;this.length=t}},o.prototype.key=function(e){return this.isAvailable?this.localStorage.key(e):Object.keys(this.localStorage)[e]},o.prototype.getItem=function(e){return this.isAvailable?this.localStorage.getItem(e):void 0===this.localStorage[e]?null:this.localStorage[e]},o.prototype.setItem=function(e,t){this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},o.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},window.TVLocalStorage=new o,e.exports.TVLocalStorage=window.TVLocalStorage},84015:(e,t,i)=>{"use strict";function s(e,t=!1){return!1}function n(e,t=!1){return e}i.d(t,{isOnMobileAppPage:()=>s,urlWithMobileAppParams:()=>n})},69109:(e,t,i)=>{"use strict";let s;function n(e,t){s?.(e,t)}function o(e){s=e}i.d(t,{muteLinkingGroup:()=>n,setMuteLinkingGroup:()=>o})},19334:(e,t,i)=>{"use strict";i.d(t,{addPerfMark:()=>c,perfMeasureOperation:()=>h});var s=i(92184);function n(){}const o=console.timeStamp?console.timeStamp.bind(console):n,r=window.performance&&performance.mark?performance.mark.bind(performance):n,a=window.performance&&performance.measure?performance.measure.bind(performance):n,l=window.performance&&performance.clearMarks?performance.clearMarks.bind(performance):n;function c(e){o(e),r(e)}async function h(e,t){const i=`measure-${e}-${(0,s.randomHash)()}`;r(i);try{return await t()}finally{a(e,i),l(i)}}},16216:(e,t,i)=>{"use strict";i.d(t,{hasService:()=>r,registerService:()=>o,service:()=>a});const s={},n=new Map;function o(e,t){if(r(e))throw new Error("Service already registered");s[e.id]=t;const i=n.get(e.id);void 0!==i&&(n.delete(e.id),i.resolve(t))}function r(e){return void 0!==s[e.id]}function a(e){const t=s[e.id];if(void 0===t)throw new Error("ServiceLocator: Service "+e.id+" not found");return t}},56840:(e,t,i)=>{"use strict";e=i.nmd(e),i(49483);i(84906).fetch;var s=i(66800).regExpEscape,n=i(21097).TVXWindowEvents,o=i(11417).TVLocalStorage,r=i(52033).Delegate,a=i(56570),l=["s.tradingview.com","betacdn.tradingview.com"],c=a.enabled("use_localstorage_for_settings"),h=window.TVSettings=function(){var e=!1,t=null;function i(){return!t&&c}try{e=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(e){}if(e){var d={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},u=function(e,t,i){var s=d[e];return s??t},_=function(){};return{loaded:!1,loadedModel:!1,getValue:u,getJSON:u,getBool:u,getFloat:u,getInt:u,setValue:_,setJSON:_,remove:_,keys:function(){return Object.keys(d)},
keysMask:function(){return[]},sync:_,onSync:{subscribe:function(){}}}}window.environment;var p,m=TradingView.onWidget()?"tradingview-widget":"tradingview",g=m+".",f={},y=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^chart\.favoriteLibraryIndicators$/,/^loadChartDialog.favorites$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/,/^trading\.orderWidgetMode\./,/^symbolWatermark$/,/^pinereference\.size$/,/^pinereference\.position$/,/^hint\.+/,/^ChartDrawingToolbarWidget\.visible/];function v(e){return g+e}function S(e){return e.substring(g.length)}function b(e,t){var i=f[e];return i??t}function w(e,t,i){i=i||{};var s=""+t;return f[e]!==s&&(f[e]=s,P(e)),i.forceFlush&&!p&&(p=setTimeout((function(){p=void 0,T()}),10)),h}function C(e,t){return t=t||{},null!=f[e]&&(delete f[e],P(e)),t.forceFlush&&T(),h}function P(e){if(t)null==f[e]?t.removeValue(e):t.setValue(e,f[e]);else if(i())try{null==f[e]?o.removeItem(v(e)):o.setItem(v(e),f[e])}catch(e){}else 0;n.emit("settings",JSON.stringify({key:e,value:f[e]}))}function T(e){}function x(){return Object.keys(f)}function I(e){for(var t=0;t=0;o--)e.test(i[o])&&n.push(i[o]),e.lastIndex=0;return n},sync:function(e){null!==e?(t?A(t.initialSettings||{}):i()?(function(){if(TradingView.onWidget()&&l.includes(window.location.host))for(var e="tradingview.",t=o.length;t--;){var i=o.key(t);if(0===i.indexOf(e)){var s=i.replace(e,m+".");o.setItem(s,o.getItem(i)),o.removeItem(i)}}}(),function(){f={};for(var e=!a.enabled("save_chart_properties_to_local_storage"),t=o.length;t--;){var i=o.key(t);if(i&&M(i)){var s=i.substring(g.length);e&&!I(s)||(f[s]=o.getItem(i))}}
}()):A(e||{}),L.fire()):!0},onSync:L,setSettingsAdapter:function(e){t=e}}}();e&&e.exports&&(e.exports=h)},88145:(e,t,i)=>{"use strict";function s(e){return void 0!==e&&e.includes("crypto")}function n(e){return"bond"===e}function o(e){return Boolean(e.typespecs?.includes("yield"))}function r(e){return e?.includes("discontinued")??!1}i.d(t,{hasCryptoTypespec:()=>s,isBond:()=>n,isSymbolDelisted:()=>r,isYield:()=>o})},49156:(e,t,i)=>{"use strict";i.d(t,{colors:()=>a});var s=i(19625),n=i(19063);const o={colorBlack:(0,s.getHexColorByName)("color-black"),colorWhite:(0,s.getHexColorByName)("color-white"),colorTvBlue50:(0,s.getHexColorByName)("color-tv-blue-50"),colorTvBlue200:(0,s.getHexColorByName)("color-tv-blue-200"),colorTvBlue400:(0,s.getHexColorByName)("color-tv-blue-400"),colorTvBlue500:(0,s.getHexColorByName)("color-tv-blue-500"),colorTvBlue600:(0,s.getHexColorByName)("color-tv-blue-600"),colorTvBlue800:(0,s.getHexColorByName)("color-tv-blue-800"),colorTvBlueA800:(0,s.getHexColorByName)("color-tv-blue-a800"),colorDeepBlue200:(0,s.getHexColorByName)("color-deep-blue-200"),colorDeepBlue300:(0,s.getHexColorByName)("color-deep-blue-300"),colorDeepBlue500:(0,s.getHexColorByName)("color-deep-blue-500"),colorDeepBlueA200:(0,s.getHexColorByName)("color-deep-blue-a200"),colorDeepBlueA400:(0,s.getHexColorByName)("color-deep-blue-a400"),colorDeepBlueA700:(0,s.getHexColorByName)("color-deep-blue-a700"),colorSkyBlue400:(0,s.getHexColorByName)("color-sky-blue-400"),colorSkyBlue500:(0,s.getHexColorByName)("color-sky-blue-500"),colorSkyBlue700:(0,s.getHexColorByName)("color-sky-blue-700"),colorDefaultRed:(0,s.getHexColorByName)("color-youtube"),colorRipeRed200:(0,s.getHexColorByName)("color-ripe-red-200"),colorRipeRed300:(0,s.getHexColorByName)("color-ripe-red-300"),colorRipeRed400:(0,s.getHexColorByName)("color-ripe-red-400"),colorRipeRed500:(0,s.getHexColorByName)("color-ripe-red-500"),colorRipeRed600:(0,s.getHexColorByName)("color-ripe-red-600"),colorRipeRed800:(0,s.getHexColorByName)("color-ripe-red-800"),colorRipeRedA900:(0,s.getHexColorByName)("color-ripe-red-a900"),colorRipeRedA700:(0,s.getHexColorByName)("color-ripe-red-a700"),colorGrapesPurpleA200:(0,s.getHexColorByName)("color-grapes-purple-a200"),colorGrapesPurpleA400:(0,s.getHexColorByName)("color-grapes-purple-a400"),colorGrapesPurple500:(0,s.getHexColorByName)("color-grapes-purple-500"),colorBerryPink400:(0,s.getHexColorByName)("color-berry-pink-400"),colorBerryPink500:(0,s.getHexColorByName)("color-berry-pink-500"),colorMintyGreen100:(0,s.getHexColorByName)("color-minty-green-100"),colorMintyGreen200:(0,s.getHexColorByName)("color-minty-green-200"),colorMintyGreen400:(0,s.getHexColorByName)("color-minty-green-400"),colorMintyGreen500:(0,s.getHexColorByName)("color-minty-green-500"),colorMintyGreen600:(0,s.getHexColorByName)("color-minty-green-600"),colorMintyGreen800:(0,s.getHexColorByName)("color-minty-green-800"),colorMintyGreenA900:(0,s.getHexColorByName)("color-minty-green-a900"),colorIguanaGreen300:(0,s.getHexColorByName)("color-iguana-green-300"),
colorIguanaGreen500:(0,s.getHexColorByName)("color-iguana-green-500"),colorIguanaGreenA700:(0,s.getHexColorByName)("color-iguana-green-a700"),colorTanOrange300:(0,s.getHexColorByName)("color-tan-orange-300"),colorTanOrange500:(0,s.getHexColorByName)("color-tan-orange-500"),colorTanOrange600:(0,s.getHexColorByName)("color-tan-orange-600"),colorTanOrange700:(0,s.getHexColorByName)("color-tan-orange-700"),colorColdGray100:(0,s.getHexColorByName)("color-cold-gray-100"),colorColdGray150:(0,s.getHexColorByName)("color-cold-gray-150"),colorColdGray200:(0,s.getHexColorByName)("color-cold-gray-200"),colorColdGray300:(0,s.getHexColorByName)("color-cold-gray-300"),colorColdGray400:(0,s.getHexColorByName)("color-cold-gray-400"),colorColdGray450:(0,s.getHexColorByName)("color-cold-gray-450"),colorColdGray500:(0,s.getHexColorByName)("color-cold-gray-500"),colorColdGray600:(0,s.getHexColorByName)("color-cold-gray-600"),colorColdGray650:(0,s.getHexColorByName)("color-cold-gray-650"),colorColdGray700:(0,s.getHexColorByName)("color-cold-gray-700"),colorColdGray750:(0,s.getHexColorByName)("color-cold-gray-750"),colorColdGray800:(0,s.getHexColorByName)("color-cold-gray-800"),colorColdGray850:(0,s.getHexColorByName)("color-cold-gray-850"),colorColdGray900:(0,s.getHexColorByName)("color-cold-gray-900"),colorForestGreen300:(0,s.getHexColorByName)("color-forest-green-300")},r={colorWhiteAlpha25:(0,n.generateColor)(o.colorWhite,75),colorTvBlue500Alpha30:(0,n.generateColor)(o.colorTvBlue500,70),colorTvBlue500Alpha28:(0,n.generateColor)(o.colorTvBlue500,72),colorTvBlue500Alpha25:(0,n.generateColor)(o.colorTvBlue500,75),colorTvBlue500Alpha20:(0,n.generateColor)(o.colorTvBlue500,80),colorDeepBlue500Alpha20:(0,n.generateColor)(o.colorDeepBlue500,80),colorSkyBlue400Alpha5:(0,n.generateColor)(o.colorSkyBlue400,95),colorSkyBlue400Alpha50:(0,n.generateColor)(o.colorSkyBlue400,50),colorSkyBlue400Alpha75:(0,n.generateColor)(o.colorSkyBlue400,25),colorSkyBlue500Alpha20:(0,n.generateColor)(o.colorSkyBlue500,80),colorSkyBlue700Alpha70:(0,n.generateColor)(o.colorSkyBlue700,30),colorRipeRed400Alpha5:(0,n.generateColor)(o.colorRipeRed400,95),colorRipeRed500Alpha5:(0,n.generateColor)(o.colorRipeRed500,95),colorRipeRed500Alpha20:(0,n.generateColor)(o.colorRipeRed500,80),colorRipeRed500Alpha28:(0,n.generateColor)(o.colorRipeRed500,72),colorRipeRed500Alpha30:(0,n.generateColor)(o.colorRipeRed500,70),colorRipeRed500Alpha50:(0,n.generateColor)(o.colorRipeRed500,50),colorGrapesPurpleA200Alpha15:(0,n.generateColor)(o.colorGrapesPurpleA200,85),colorGrapesPurple500Alpha0:(0,n.generateColor)(o.colorGrapesPurple500,100),colorGrapesPurple500Alpha20:(0,n.generateColor)(o.colorGrapesPurple500,80),colorGrapesPurple500Alpha70:(0,n.generateColor)(o.colorGrapesPurple500,30),colorBerryPink400Alpha50:(0,n.generateColor)(o.colorBerryPink400,50),colorBerryPink400Alpha75:(0,n.generateColor)(o.colorBerryPink400,25),colorBerryPink500Alpha20:(0,n.generateColor)(o.colorBerryPink500,80),colorMintyGreen500Alpha20:(0,n.generateColor)(o.colorMintyGreen500,80),colorMintyGreen500Alpha28:(0,
n.generateColor)(o.colorMintyGreen500,72),colorMintyGreen500Alpha50:(0,n.generateColor)(o.colorMintyGreen500,50),colorMintyGreen500Alpha5:(0,n.generateColor)(o.colorMintyGreen500,95),colorIguanaGreen500Alpha20:(0,n.generateColor)(o.colorIguanaGreen500,80),colorTanOrange500Alpha20:(0,n.generateColor)(o.colorTanOrange500,80),colorForestGreen300Alpha5:(0,n.generateColor)(o.colorForestGreen300,95),colorColdGray100Alpha0:(0,n.generateColor)(o.colorColdGray100,100),colorColdGray100Alpha6:(0,n.generateColor)(o.colorColdGray100,94),colorColdGray800Alpha0:(0,n.generateColor)(o.colorColdGray800,100),colorColdGray800Alpha6:(0,n.generateColor)(o.colorColdGray800,94)},a={...o,...r}},2433:(e,t,i)=>{"use strict";i.d(t,{light:()=>te});var s=i(49156),n=i(46088);const{colorWhite:o,colorBlack:r,colorColdGray150:a,colorColdGray300:l,colorColdGray400:c,colorColdGray450:h,colorColdGray800Alpha0:d,colorColdGray800Alpha6:u,colorColdGray900:_,colorGrapesPurpleA400:p,colorGrapesPurpleA200Alpha15:m,colorMintyGreen200:g,colorMintyGreen400:f,colorMintyGreen500:y,colorMintyGreen600:v,colorMintyGreen800:S,colorMintyGreen500Alpha5:b,colorMintyGreen500Alpha20:w,colorMintyGreen500Alpha28:C,colorMintyGreen500Alpha50:P,colorRipeRed200:T,colorRipeRed400:x,colorRipeRed500:I,colorRipeRed600:M,colorRipeRedA700:A,colorRipeRed500Alpha5:L,colorRipeRed500Alpha28:k,colorRipeRed500Alpha50:D,colorRipeRed500Alpha20:E,colorDeepBlueA700:B,colorBerryPink500:V,colorBerryPink400Alpha50:R,colorBerryPink400Alpha75:N,colorIguanaGreenA700:O,colorSkyBlue400Alpha5:F,colorSkyBlue400Alpha50:W,colorSkyBlue400Alpha75:H,colorSkyBlue500:z,colorDeepBlueA400:U,colorTvBlue200:j,colorTvBlue400:G,colorTvBlue500:q,colorTvBlue500Alpha28:$,colorTvBlue600:K,colorTvBlue800:Y,colorTanOrange500:Z,colorTanOrange600:X}=s.colors,J={},Q={},ee={},te={content:{chartProperties:{scalesProperties:{textColor:_,lineColor:d,backgroundColor:o},paneProperties:{vertGridProperties:{color:u},horzGridProperties:{color:u},crossHairProperties:{color:c},backgroundType:n.ColorType.Solid,background:o,backgroundGradientStartColor:o,backgroundGradientEndColor:o,separatorColor:a}},sessions:{sessionHighlight:{backgrounds:{outOfSession:{color:q,transparency:92},preMarket:{color:Z,transparency:92},postMarket:{color:q,transparency:92},electronic:{color:q,transparency:92}},vertlines:{sessBreaks:{color:"#4985e7"}}}},mainSourceProperties:{baseLineColor:l,prevClosePriceLineColor:"#555555",priceLineColor:"",highLowAvgPrice:{highLowPriceLinesColor:"",averagePriceLineColor:""},bidAsk:{bidLineColor:q,askLineColor:x},prePostMarket:{preMarketColor:X,postMarketColor:q},candleStyle:{borderColor:"#378658",upColor:y,wickColor:"#737375",wickUpColor:y,wickDownColor:I,downColor:I,borderUpColor:y,borderDownColor:I},volCandlesStyle:{borderColor:"#378658",upColor:y,wickColor:"#737375",wickUpColor:y,wickDownColor:I,downColor:I,borderUpColor:y,borderDownColor:I},haStyle:{borderColor:"#378658",upColor:y,wickColor:"#737375",wickUpColor:y,wickDownColor:I,downColor:I,borderUpColor:y,borderDownColor:I},hlcAreaStyle:{highLineColor:y,lowLineColor:I,
closeLineColor:h,highCloseFillColor:w,closeLowFillColor:E},hollowCandleStyle:{upColor:y,downColor:I,borderColor:"#378658",borderUpColor:y,borderDownColor:I,wickColor:"#737375",wickUpColor:y,wickDownColor:I},barStyle:{downColor:I,upColor:y},pnfStyle:{downColor:I,upColor:y,upColorProjection:"#a9dcc3",downColorProjection:"#f5a6ae"},baselineStyle:{baselineColor:h,topFillColor1:C,topFillColor2:b,bottomFillColor1:L,bottomFillColor2:k,topLineColor:y,bottomLineColor:I},areaStyle:{transparency:100,color1:$,color2:q,linecolor:q},hiloStyle:{color:q,borderColor:q,labelColor:q},columnStyle:{upColor:P,downColor:D},renkoStyle:{upColor:y,downColor:I,borderUpColor:y,borderDownColor:I,upColorProjection:"#a9dcc3",downColorProjection:"#f5a6ae",borderUpColorProjection:"#a9dcc3",borderDownColorProjection:"#f5a6ae",wickUpColor:y,wickDownColor:I},lineStyle:{colorType:n.ColorType.Gradient,color:q,gradientStartColor:p,gradientEndColor:"#00BCE5"},lineWithMarkersStyle:{colorType:n.ColorType.Gradient,color:q,gradientStartColor:p,gradientEndColor:"#00BCE5"},steplineStyle:{colorType:n.ColorType.Gradient,color:q,gradientStartColor:p,gradientEndColor:"#00BCE5"},kagiStyle:{downColor:I,upColor:y,upColorProjection:"#a9dcc3",downColorProjection:"#f5a6ae"},pbStyle:{upColor:y,downColor:I,borderUpColor:y,borderDownColor:I,upColorProjection:"#a9dcc3",downColorProjection:"#f5a6ae",borderUpColorProjection:"#a9dcc3",borderDownColorProjection:"#f5a6ae"},rangeStyle:{upColor:y,downColor:I,upColorProjection:"#a9dcc3",downColorProjection:"#f5a6ae",candlesUpColor:y,candlesDownColor:I,candlesBorderUpColor:y,candlesBorderDownColor:I,candlesWickUpColor:y,candlesWickDownColor:I},tpoStyle:J,volFootprintStyle:Q,svpStyle:ee}}}},24317:(e,t,i)=>{"use strict";i.d(t,{darkTheme:()=>le,getStdChartTheme:()=>ue,getStdThemeNames:()=>de,lightTheme:()=>ae,overrideStdTheme:()=>ce,restoreStdThemes:()=>he,translateThemeName:()=>_e});var s=i(11542),n=i(37265),o=i(2433),r=i(46088),a=i(49156);const{colorWhite:l,colorColdGray100Alpha0:c,colorColdGray100Alpha6:h,colorColdGray200:d,colorColdGray300:u,colorColdGray400:_,colorColdGray450:p,colorColdGray600:m,colorColdGray800:g,colorColdGray900:f,colorDeepBlueA200:y,colorGrapesPurpleA400:v,colorGrapesPurpleA200Alpha15:S,colorMintyGreen400:b,colorMintyGreen500:w,colorMintyGreen600:C,colorMintyGreen800:P,colorMintyGreen500Alpha5:T,colorMintyGreen500Alpha20:x,colorMintyGreen500Alpha28:I,colorMintyGreen500Alpha50:M,colorMintyGreenA900:A,colorRipeRed400:L,colorRipeRed500:k,colorRipeRed600:D,colorRipeRed800:E,colorRipeRed500Alpha5:B,colorRipeRed500Alpha20:V,colorRipeRed500Alpha28:R,colorRipeRed500Alpha50:N,colorRipeRedA900:O,colorBerryPink400Alpha50:F,colorBerryPink400Alpha75:W,colorBerryPink500:H,colorIguanaGreenA700:z,colorSkyBlue400Alpha5:U,colorSkyBlue400Alpha50:j,colorSkyBlue400Alpha75:G,colorSkyBlue500:q,colorDeepBlueA400:$,colorTvBlue400:K,colorTvBlue500:Y,colorTvBlue500Alpha28:Z,colorTvBlue600:X,colorTvBlue800:J,colorTvBlueA800:Q,colorTanOrange500:ee,colorTanOrange600:te}=a.colors,ie={},se={},ne={},oe={content:{chartProperties:{
scalesProperties:{textColor:u,lineColor:c,backgroundColor:l},paneProperties:{vertGridProperties:{color:h},horzGridProperties:{color:h},crossHairProperties:{color:_},background:f,backgroundGradientStartColor:"#1C1C1C",backgroundGradientEndColor:f,backgroundType:"gradient",separatorColor:g}},sessions:{sessionHighlight:{backgrounds:{outOfSession:{color:Y,transparency:92},preMarket:{color:ee,transparency:92},postMarket:{color:Y,transparency:92},electronic:{color:Y,transparency:92}},vertlines:{sessBreaks:{color:"#4985e7"}}}},mainSourceProperties:{baseLineColor:m,prevClosePriceLineColor:"#555555",priceLineColor:"",highLowAvgPrice:{highLowPriceLinesColor:"",averagePriceLineColor:""},bidAsk:{bidLineColor:Y,askLineColor:L},prePostMarket:{preMarketColor:te,postMarketColor:Y},candleStyle:{borderColor:"#378658",upColor:w,wickColor:"#737375",wickUpColor:w,wickDownColor:k,downColor:k,borderUpColor:w,borderDownColor:k},volCandlesStyle:{borderColor:"#378658",upColor:w,wickColor:"#737375",wickUpColor:w,wickDownColor:k,downColor:k,borderUpColor:w,borderDownColor:k},haStyle:{borderColor:"#378658",upColor:w,wickColor:"#737375",wickUpColor:w,wickDownColor:k,downColor:k,borderUpColor:w,borderDownColor:k},hlcAreaStyle:{highLineColor:w,lowLineColor:k,closeLineColor:p,highCloseFillColor:x,closeLowFillColor:V},hollowCandleStyle:{upColor:w,downColor:k,borderColor:"#378658",borderUpColor:w,borderDownColor:k,wickColor:"#737375",wickUpColor:w,wickDownColor:k},barStyle:{downColor:k,upColor:w},pnfStyle:{downColor:k,upColor:w,upColorProjection:"#336854",downColorProjection:"#7f323f"},baselineStyle:{baselineColor:p,topFillColor1:I,topFillColor2:T,bottomFillColor1:B,bottomFillColor2:R,topLineColor:w,bottomLineColor:k},areaStyle:{transparency:100,color1:Z,color2:Y,linecolor:Y},hiloStyle:{color:Y,borderColor:Y,labelColor:Y},columnStyle:{upColor:M,downColor:N},renkoStyle:{upColor:w,downColor:k,borderUpColor:w,borderDownColor:k,upColorProjection:"#336854",downColorProjection:"#7f323f",borderUpColorProjection:"#336854",borderDownColorProjection:"#7f323f",wickUpColor:w,wickDownColor:k},lineStyle:{colorType:r.ColorType.Gradient,color:Y,gradientStartColor:v,gradientEndColor:"#00BCE5"},lineWithMarkersStyle:{colorType:r.ColorType.Gradient,color:Y,gradientStartColor:v,gradientEndColor:"#00BCE5"},steplineStyle:{colorType:r.ColorType.Gradient,color:Y,gradientStartColor:v,gradientEndColor:"#00BCE5"},kagiStyle:{downColor:k,upColor:w,upColorProjection:"#336854",downColorProjection:"#7f323f"},pbStyle:{upColor:w,downColor:k,borderUpColor:w,borderDownColor:k,upColorProjection:"#336854",downColorProjection:"#7f323f",borderUpColorProjection:"#336854",borderDownColorProjection:"#7f323f"},rangeStyle:{upColor:w,downColor:k,upColorProjection:"#336854",downColorProjection:"#7f323f",candlesUpColor:w,candlesDownColor:k,candlesBorderUpColor:w,candlesBorderDownColor:k,candlesWickUpColor:w,candlesWickDownColor:k},tpoStyle:ie,volFootprintStyle:se,svpStyle:ne}}};var re=i(24633);let ae=(0,n.clone)(o.light),le=(0,n.clone)(oe);function ce(e,t){switch(e){case re.StdTheme.Light:ae=(0,
n.merge)((0,n.clone)(ae),t);break;case re.StdTheme.Dark:le=(0,n.merge)((0,n.clone)(le),t)}}function he(){ae=(0,n.clone)(o.light),le=(0,n.clone)(oe)}function de(){return[re.StdTheme.Light,re.StdTheme.Dark]}function ue(e){return{[re.StdTheme.Light]:(0,n.clone)(ae),[re.StdTheme.Dark]:(0,n.clone)(le)}[e]}function _e(e){return{[re.StdTheme.Light]:s.t(null,{context:"colorThemeName"},i(96870)),[re.StdTheme.Dark]:s.t(null,{context:"colorThemeName"},i(85119))}[e]||e}},24633:(e,t,i)=>{"use strict";var s;i.d(t,{StdTheme:()=>s}),function(e){e.Light="light",e.Dark="dark"}(s||(s={}))},85662:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DEFAULT_THEME:()=>c,getCurrentTheme:()=>g,getStdTheme:()=>T,getStdThemeNames:()=>C,getStdThemedValue:()=>x,getTheme:()=>b,getThemeNames:()=>w,getThemedColor:()=>f,isPublicTheme:()=>m,isStdThemeName:()=>P,isStdThemedDefaultValue:()=>I,isThemeExist:()=>L,removeTheme:()=>A,restoreTheme:()=>y,saveTheme:()=>M,savedThemeName:()=>v,syncTheme:()=>S,themes:()=>p,translateStdThemeName:()=>k});var s=i(24377),n=i(56840);function o(){return(0,n.getValue)("current_theme.name")||null}const r=i(64289);var a=i(24317),l=i(45345);const c="light";var h=i(24633),d=i(11542),u=i(20913),_=i(19625);const p={[h.StdTheme.Light]:{name:h.StdTheme.Light,label:()=>d.t(null,{context:"colorThemeName"},i(96870)),order:2,getThemedColor:e=>(0,_.getHexColorByName)(e)},[h.StdTheme.Dark]:{name:h.StdTheme.Dark,label:()=>d.t(null,{context:"colorThemeName"},i(85119)),order:1,getThemedColor:e=>{const t=u[e]||e;return(0,_.getHexColorByName)(t)}}};function m(e){return!e.isPrivate}function g(){return p[l.watchedTheme.value()]||p[c]}function f(e){return g().getThemedColor(e)}function y(){(0,l.setTheme)(o()||c)}function v(){return o()}function S(){var e;e=g().name,(0,n.setValue)("current_theme.name",e,{forceFlush:!0})}function b(e){return r.loadTheme(e)}function w(){return r.loadThemes()}function C(){return a.getStdThemeNames()}function P(e){return C().includes(e)}function T(e){return a.getStdChartTheme(e)||{content:void 0}}function x(e,t){const i=t||g().name,s=a.getStdChartTheme(i),n=0!==e.length&&e.split(".");return s&&s.content&&n?n.reduce(((e,t)=>e[t]),s.content):null}function I(e,t,i){const n=x(e,i);return null!==n&&(0,s.areEqualRgba)((0,s.parseRgba)(n),(0,s.parseRgba)(String(t)))}function M(e,t){return r.saveTheme(e,t)}function A(e){return r.removeTheme(e)}function L(e){return r.isThemeExist(e)}function k(e){return a.translateThemeName(e)}},45345:(e,t,i)=>{"use strict";i.d(t,{setTheme:()=>r,watchedTheme:()=>o});var s,n=i(64147);!function(e){e.ThemeClassPrefix="theme-"}(s||(s={}));const o=new n.WatchedValue;function r(e){o.setValue(e)}o.subscribe((e=>{!function(e,t=window){const i="theme-"+e,s=t.document.documentElement.classList;for(const e of Array.from(s))e.startsWith("theme-")&&e!==i&&s.remove(e);s.add(i)}(e,window)}))},51768:(e,t,i)=>{"use strict";i.d(t,{disableTrackingEvents:()=>a,trackEvent:()=>r});var s=i(76422);i(56570);(0,i(9343).getLogger)("Common.TrackEvent")
;const n=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/];let o=!1;const r=(e,t,i)=>{o||((e,t,i)=>{t=t||e||i||"";let o="";for(let e=0;e{"use strict";i.d(t,{TVXWindowEvents:()=>r});i(21251);var s=i(9343),n=i(11417);const o=(0,s.getLogger)("XWindowEvents");var r;!function(e){const t="tvxwevents.",i={};let s;window.BroadcastChannel?(s=new BroadcastChannel("tvxwevents"),s.addEventListener("message",(function(e){const{data:{event:t,value:s}}=e;i[t]&&i[t].forEach((e=>{e(s)}))})),function(){const e=[],i=performance.now();for(let i=0;i{t(e.newValue)}));n.TVLocalStorage.removeItem(o)})),e.on=function(e,t){i[e]||(i[e]=[]),i[e].push(t)},e.off=function(e,t){if(!i[e])return;const s=i[e].indexOf(t);-1!==s&&(1===i[e].length?delete i[e]:i[e].splice(s,1))},e.emit=function(e,i=Date.now()){try{s?s.postMessage({event:e,value:i}):n.TVLocalStorage.setItem(t+e,i.toString())}catch(e){o.logError(e.message)}}}(r||(r={}))},58473:(e,t,i)=>{"use strict";i.d(t,{activateKeyPressHandler:()=>m,showDialog:()=>g});const s=[];let n=null;function o(e){for(let t=0;t=0&&!0!==s[t].func(e);t--);}window.addEventListener("keypress",r,!1);var a=i(79652),l=i(56570),c=i(86235),h=i(86001),d=i(50340),u=i(51768);let _=null;function p(e){if(!(0,a.globalKeypressMatches)(e))return!1;e.preventDefault();const t=String.fromCharCode(e.charCode);return l.enabled("show_interval_dialog_on_key_press")&&function(e){return/[1-9]/.test(e)}(t)?(0,c.showChangeIntervalDialogAsync)({initVal:t}):l.enabled("symbol_search_hot_key")&&(g({defaultValue:t,selectSearchOnInit:!1,source:"keyboard",trackResultsOptions:{trackResults:!1,emptySearchType:"empty_result__supercharts"},enableOptionsChain:l.enabled("symbol_search_option_chain_selector")}),(0,u.trackEvent)("GUI","SS","hotkey")),!0}function m(){(0,h.loadChangeIntervalDialog)(),function(e,t){const i={name:e,func:t},n=o(i.name);n>-1&&s.splice(n,1),s.unshift(i)}("symbolEdit",p)}function g(e){const t=_=(0,d.loadNewSymbolSearch)().then((i=>{t===_&&i.showDefaultSearchDialog(e)}));return t}},78136:(e,t,i)=>{"use strict";let s;function n(){return s}function o(e){s=e}i.d(t,{getSearchRequestDelay:()=>n,setSearchRequestDelay:()=>o})},52092:(e,t,i)=>{"use strict";i.d(t,{CLOSE_POPUPS_AND_DIALOGS_COMMAND:()=>s});const s="CLOSE_POPUPS_AND_DIALOGS_COMMAND";var n;!function(e){e[e.Mobile=0]="Mobile",e[e.TabletSmall=480]="TabletSmall",e[e.Tablet=768]="Tablet",e[e.TabletLarge=1024]="TabletLarge",e[e.DesktopSmall=1280]="DesktopSmall",e[e.Desktop=1440]="Desktop",e[e.DesktopLarge=1920]="DesktopLarge"}(n||(n={}))},3615:(e,t,i)=>{"use strict";async function s(e,t){const s=await Promise.all([i.e(1303),i.e(3703),i.e(3953),i.e(4524),i.e(7939),i.e(5826),i.e(4600),i.e(2564),i.e(6445),i.e(3799),i.e(5480),i.e(6489),i.e(9766),i.e(5375),i.e(601),i.e(4876),i.e(4137),i.e(2371),i.e(2227),i.e(4931),i.e(2544),i.e(769),i.e(4411),i.e(8890)]).then(i.bind(i,70493));return s.showSimpleDialog(e,s.renameModule,t)}async function n(e,t){const s=await Promise.all([i.e(1303),i.e(3703),i.e(3953),i.e(4524),i.e(7939),i.e(5826),i.e(4600),i.e(2564),i.e(6445),i.e(3799),i.e(5480),i.e(6489),i.e(9766),i.e(5375),i.e(601),i.e(4876),i.e(4137),i.e(2371),i.e(2227),i.e(4931),i.e(2544),i.e(769),i.e(4411),i.e(8890)]).then(i.bind(i,70493));return s.showSimpleDialog(e,s.confirmModule,t)}async function o(e,t){const s=await Promise.all([i.e(1303),i.e(3703),i.e(3953),i.e(4524),i.e(7939),i.e(5826),i.e(4600),i.e(2564),i.e(6445),i.e(3799),i.e(5480),i.e(6489),i.e(9766),i.e(5375),i.e(601),i.e(4876),i.e(4137),i.e(2371),i.e(2227),i.e(4931),i.e(2544),i.e(769),i.e(4411),i.e(8890)]).then(i.bind(i,70493));return s.showSimpleDialog(e,s.warningModule,t)}i.d(t,{showConfirm:()=>n,showRename:()=>s,showWarning:()=>o})},14881:(e,t,i)=>{"use strict";i.d(t,{hideStateChange:()=>o});var s,n=i(52033);!function(e){e.Drawings="drawings",e.Indicators="indicators",e.Positions="positions",e.All="all"}(s||(s={}));const o=new n.Delegate},90995:(e,t,i)=>{"use strict";i.d(t,{getHideModeStateValue:()=>u,getHideOptions:()=>h,getSavedHideMode:()=>_,toggleHideMode:()=>d})
;var s=i(50151),n=i(11542),o=i(56840),r=i(79320),a=i(928),l=i(14881);let c=null;function h(){if(null!==c)return c;const e=(0,r.tradingService)();return c=new Map([["drawings",{label:n.t(null,void 0,i(3217)),dataName:"hide-drawing-tools",tooltip:{active:n.t(null,void 0,i(85891)),inactive:n.t(null,void 0,i(52563))},getBoxedValue:()=>(0,a.hideAllDrawings)(),trackLabel:"hide drawings"}],["indicators",{label:n.t(null,void 0,i(72351)),dataName:"hide-indicators",tooltip:{active:n.t(null,void 0,i(98753)),inactive:n.t(null,void 0,i(78525))},getBoxedValue:()=>(0,a.hideAllIndicators)(),trackLabel:"hide indicators"}],["positions",{label:n.t(null,void 0,i(92226)),dataName:"hide-positions-and-orders",tooltip:{active:n.t(null,void 0,i(20506)),inactive:n.t(null,void 0,i(42164))},getBoxedValue:()=>(0,s.ensureNotNull)(e).showTradedSources,inverted:!0,trackLabel:"hide positions"}],["all",{label:n.t(null,void 0,i(47074)),dataName:"hide-all",tooltip:{active:e?n.t(null,void 0,i(86738)):n.t(null,void 0,i(25881)),inactive:e?n.t(null,void 0,i(18216)):n.t(null,void 0,i(90763))},trackLabel:"hide all"}]]),e||c.delete("positions"),c}function d(e){e?o.setValue("ChartToolsHideMode",e):e=_();const t=p();let i=!t;return"all"===e?(m(((e,t,s)=>{e.setValue(s?!i:i)})),l.hideStateChange.fire({hideMode:e,isActive:i}),i):(m(((s,n,o)=>{if(n===e){const e=t?!o:!s.value();s.setValue(e),i=o?!e:e}else s.setValue(Boolean(o))})),l.hideStateChange.fire({hideMode:e,isActive:i}),i)}function u(e){if("all"===e)return p();const t=(0,s.ensureDefined)(h().get(e)),i=(0,s.ensureDefined)(t.getBoxedValue)().value();return t.inverted?!i:i}function _(){const e=o.getValue("ChartToolsHideMode","drawings");return h().has(e)?e:"drawings"}function p(){let e=!0;return m(((t,i,s)=>{const n=t.value();e=e&&(s?!n:n)})),e}function m(e){h().forEach(((t,i)=>{const s=t.getBoxedValue?.();s&&e(s,i,t.inverted)}))}},25812:(e,t,i)=>{"use strict";var s;i.d(t,{ToolboxType:()=>s}),function(e){e[e.Delete=0]="Delete"}(s||(s={}))},59064:(e,t,i)=>{"use strict";i.d(t,{globalCloseDelegate:()=>s,globalCloseMenu:()=>n});const s=new(i(52033).Delegate);function n(){s.fire()}},61223:e=>{e.exports={"css-value-header-toolbar-height":"38px"}},63844:e=>{e.exports={chartsSplitter:"chartsSplitter-L0xapso5",hovered:"hovered-L0xapso5"}},45982:e=>{e.exports={"css-value-pane-controls-padding-left":"1px","css-value-pane-controls-padding-right":"4px"}},56479:e=>{e.exports={paneSeparator:"paneSeparator-uqBaC1Ki",handle:"handle-uqBaC1Ki",mobile:"mobile-uqBaC1Ki",hovered:"hovered-uqBaC1Ki",selected:"selected-uqBaC1Ki",active:"active-uqBaC1Ki"}},79437:(e,t,i)=>{"use strict";var s=i(37265).declareClassAsPureInterface;function n(){}TradingView.WEB_SOCKET_WAS_CONNECTED=!1,n.prototype.defaultResolutions=function(){},n.prototype.availableCurrencies=function(){},n.prototype.availableUnits=function(){},n.prototype.supportedSymbolsTypes=function(){},n.prototype.symbolsGrouping=function(){},n.prototype.quoteCreateSession=function(e){},n.prototype.quoteDeleteSession=function(e){},n.prototype.quoteSetFields=function(e,t){},
n.prototype.quoteAddSymbols=function(e,t){},n.prototype.quoteRemoveSymbols=function(e,t){},n.prototype.quoteFastSymbols=function(e,t){},n.prototype.depthCreateSession=function(e,t,i){},n.prototype.depthDeleteSession=function(e){},n.prototype.depthSetSymbol=function(e,t){},n.prototype.depthClearSymbol=function(e){},n.prototype.depthSetScale=function(e,t){},n.prototype.chartCreateSession=function(e,t){},n.prototype.chartDeleteSession=function(e){},n.prototype.createSession=function(e,t){},n.prototype.removeSession=function(e){},n.prototype.connected=function(){},n.prototype.connect=function(){},n.prototype.disconnect=function(){},n.prototype.switchTimezone=function(e,t){},n.prototype.resolveSymbol=function(e,t,i,s){},n.prototype.createSeries=function(e,t,i,s,n,o,r,a){},n.prototype.removeSeries=function(e,t,i){},n.prototype.modifySeries=function(e,t,i,s,n,o,r){},n.prototype.requestMoreData=function(e,t,i,s){},n.prototype.requestMetadata=function(e){},n.prototype.canCreateStudy=function(e,t,i){},n.prototype.createStudy=function(e,t,i,s,n,o,r,a){},n.prototype.getStudyCounter=function(e){},n.prototype.getFundamentalCounter=function(e){},n.prototype.removeStudy=function(e,t){},n.prototype.modifyStudy=function(e,t,i,s,n){},n.prototype.createPointset=function(e,t,i,s,n,o,r){},n.prototype.modifyPointset=function(e,t,i,s,n){},n.prototype.removePointset=function(e,t,i){},n.prototype.requestMoreTickmarks=function(e,t,i,s){},n.prototype.requestFirstBarTime=function(e,t,i,s){},n.prototype._sendRequest=function(e,t){},n.prototype._onMessage=function(e){},n.prototype._dispatchNotification=function(e){},n.prototype._invokeNotificationHandler=function(e,t,i){},n.prototype._notifySessions=function(e){},n.prototype.unpack=function(e){},n.prototype.searchSymbols=function(e,t,i,s,n,o,r,a,l,c){},n.prototype.getMarks=function(e,t,i,s,n){},n.prototype.getTimescaleMarks=function(e,t,i,s,n){},s(n,"ChartApiInterface"),e.exports.ChartApiInterface=n},64289:(e,t,i)=>{"use strict";i.r(t),i.d(t,{favorStandardStudyTemplate:()=>D,favorStudyTemplate:()=>k,getChartContent:()=>C,getCharts:()=>S,getChartsCount:()=>v,getCustomAdapter:()=>g,getDrawingTemplates:()=>R,getStandardStudyTemplateById:()=>E,getStorageURL:()=>p,getStudyTemplateById:()=>I,getStudyTemplatesList:()=>A,initialize:()=>f,invalidateStudyTemplatesList:()=>L,isThemeExist:()=>j,loadDrawingTemplate:()=>N,loadLayout:()=>P,loadTheme:()=>W,loadThemes:()=>H,openLayoutLink:()=>T,removeChart:()=>b,removeDrawingTemplate:()=>O,removeStudyTemplate:()=>x,removeTheme:()=>U,renameStudyTemplate:()=>B,replaceStudyTemplate:()=>V,saveChart:()=>w,saveDrawingTemplate:()=>F,saveStudyTemplate:()=>M,saveTheme:()=>z,setCustomAdapter:()=>m,updateUser:()=>y});var s=i(9343),n=i(14712),o=i(56840);const r=(0,s.getLogger)("Chart.SaveloadAdapter.Library"),a={error:""};let l,c,h,d,u=null,_=null;function p(e){return`${h}/${encodeURIComponent(d)}/${e}?client=${encodeURIComponent(l)}&user=${encodeURIComponent(c)}`}function m(e){u=e}function g(){return u}function f(e,t,i,s){l=e,c=t,h=i,d=s}function y(e){c=e}function v(e,t){
throw new Error("Not implemented")}async function S(){const e=e=>e.map((e=>({id:e.id,name:e.name,image_url:String(e.id),modified_iso:e.timestamp,short_symbol:e.symbol,interval:e.resolution})));if(u)return u.getAllCharts().then(e);try{const t=await fetch(`${p("charts")}`,{credentials:"same-origin"});if(!t.ok)throw new Error(`Getting chart content response was not OK. Status: ${t.status}.`);const i=await t.json();if("ok"!==i.status)throw new Error("Get chart content request failed: "+i.message);return e(i.data)}catch(e){throw r.logWarn((0,n.errorToString)(e)),e}}async function b(e){if(u)return u.removeChart(e);try{const t=await fetch(`${p("charts")}&chart=${encodeURIComponent(e)}`,{method:"DELETE",credentials:"same-origin"});if(!t.ok)throw new Error(`Remove chart response was not OK. Status: ${t.status}.`);const i=await t.json();if("ok"!==i.status)throw new Error("Remove drawing template request failed: "+i.message)}catch(e){throw r.logWarn((0,n.errorToString)(e)),e}}async function w(e,t,i,s,o){const a=o.id,l={name:e,content:JSON.stringify(s),symbol:t,resolution:i};try{if(u){return{result:await u.saveChart({...l,id:a,timestamp:Math.round(Date.now()/1e3)})}}const e=new FormData;for(const t in l)e.append(t,l[t]);let t=p("charts");null!=a&&(t+=`&chart=${encodeURIComponent(a)}`);const i=await fetch(t,{credentials:"same-origin",method:"POST",body:e});if(!i.ok)throw new Error(`Saving chart content response was not OK. Status: ${i.status}.`);const s=await i.json();if("ok"!==s.status)throw new Error("Saving chart content request failed: "+s.message);return{result:(s.id??a).toString(),response:i}}catch(e){throw r.logWarn((0,n.errorToString)(e)),e}}async function C(e){const t=t=>{const i=JSON.parse(t);return i.uid=e.id,i};if(u)return u.getChartContent(e.id).then((e=>t(e)));try{const i=await fetch(`${p("charts")}&chart=${encodeURIComponent(e.id)}`,{credentials:"same-origin"});if(!i.ok)throw new Error(`Getting chart content response was not OK. Status: ${i.status}.`);const s=await i.json();if("ok"!==s.status)throw new Error("Get chart content request failed: "+s.message);return t(s.data.content)}catch(e){throw r.logWarn((0,n.errorToString)(e)),e}}async function P(e){try{return{chartWidgetCollectionState:await C(e),description:e.name,id:e.id,lastModified:e.modified_iso,name:e.name,uid:e.url,username:""}}catch(e){throw r.logWarn("Error loading chart"),e}}function T(e,t){throw new Error("Opening layout link is not supported")}async function x(e){try{const t=G().filter((t=>t!==e));if(u)return q(t),u.removeStudyTemplate({name:e});const i=await fetch(`${p("study_templates")}&template=${encodeURIComponent(e)}`,{method:"DELETE",credentials:"same-origin"});if(!i.ok)throw new Error(`Remove study template response was not OK. Status: ${i.status}.`);const s=await i.json();if("ok"!==s.status)throw new Error("Remove study template request failed: "+s.message);q(t)}catch(e){throw r.logWarn((0,n.errorToString)(e)),e}}async function I(e){try{if(u){return{content:await u.getStudyTemplateContent({name:e})}}
const t=await fetch(`${p("study_templates")}&template=${encodeURIComponent(e)}`,{credentials:"same-origin"});if(!t.ok)throw new Error(`Get study template response was not OK. Status: ${t.status}.`);const i=await t.json();if("ok"!==i.status)throw new Error("Get study template request failed: "+i.message);return i.data}catch(e){throw r.logWarn((0,n.errorToString)(e)),e}}async function M(e){try{if(u)return u.saveStudyTemplate(e).then((()=>({error:""}))).catch((e=>({error:null!=e?(0,n.errorToString)(e):"error"})));const t=new FormData;t.append("name",e.name),t.append("content",e.content);const i=await fetch(p("study_templates"),{method:"POST",body:t,credentials:"same-origin"});if(!i.ok)throw new Error(`Save study template response was not OK. Status: ${i.status}.`);const s=await i.json();return{error:"ok"===s.status?"":s.status}}catch(e){throw r.logWarn((0,n.errorToString)(e)),e}}async function A(){try{if(_)return _;_=[];const e=e=>(_=e.map((e=>{const t=G().indexOf(e.name);return{id:e.name,is_default:!1,name:e.name,favorite_date:-1!==t?t:null}})),_);if(u)return u.getAllStudyTemplates().then(e);const t=await fetch(p("study_templates"),{method:"GET",credentials:"same-origin"});if(!t.ok)throw new Error(`Study templates list response was not OK. Status: ${t.status}.`);const i=await t.json();if("ok"!==i.status)throw new Error("Study templates list request failed: "+i.message);return e(i.data)}catch(e){throw r.logWarn((0,n.errorToString)(e)),e}}function L(){_=null}function k(e,t,i){const s=G();q(t?[...s,e]:s.filter((t=>t!==e))),i?.(null)}function D(e,t,i){k(e,t,i)}function E(e,t){throw new Error("Not implemented")}function B(e,t,i){throw new Error("Not implemented")}function V(e,t,i){throw new Error("Not implemented")}async function R(e){throw new Error("Not implemented")}async function N(e,t){throw new Error("Not implemented")}async function O(e,t){throw new Error("Not implemented")}async function F(e,t,i){throw new Error("Not implemented")}function W(e){if(null!==u)return u.getChartTemplateContent(e);throw new Error("Not implemented")}function H(){return null!==u?u.getAllChartTemplates():Promise.resolve([])}async function z(e,t){if(null!==u)try{return await u.saveChartTemplate(e,t),a}catch(e){return console.error(e),{error:e instanceof Error?e.message:e.toString()}}throw new Error("Not implemented")}async function U(e){if(null!==u)try{return await u.removeChartTemplate(e),a}catch(e){return console.error(e),{error:e instanceof Error?e.message:e.toString()}}throw new Error("Not implemented")}function j(e){return W(e).then((e=>Boolean(e.content)))}function G(){return o.getJSON("StudyTemplates.quicks",[])}function q(e){o.setJSON("StudyTemplates.quicks",e)}},51243:(e,t,i)=>{"use strict";var s=i(50151).ensureNotNull,n=i(50151).ensureDefined,o=i(9343).getLogger("Chart.ChartApiLocal"),r=i(14381),a=i(85049).Interval,l=i(40344).JSStudyEngineTypescript,c=i(6058),h=i(79437).ChartApiInterface,d=i(18278).HandlerInfo,u=i(37265).requireFullInterfaceImplementation,_=i(82783).TIMEFRAMETYPE,p=i(53388).createDwmAligner
;TradingView.STUDY_COUNT_LIMIT=210;function m(e,t){return`${e}__${t}`}JSServer.ChartApi=function(e){this._notificationHandlers={},this._sessions={},this.studyCounter=0,this._metadataRequestNextNumber=1,this._connected=!1,this._enabled=!1,this._studyEngine=new l(e),this._callbacks={},this._serverTimeOffset=0;var t=this;this._studyEngine.on("configuration_received",(function(){t._fireEvent("configuration_received")})),this._studyEngine.on("realtime_tick",(function(e){var i={time:e.value[0]/1e3,open:e.value[1],high:e.value[2],low:e.value[3],close:e.value[4],volume:e.value[5]};t._fireEvent("realtime_tick",i,!0)})),this._setVisibleRangeTimeout={},this._studySpecs=new Map,this._isNonCountedStudy=()=>!0},JSServer.ChartApi.prototype.destroy=function(){this._studyEngine.destroy(),this._studyEngine=null},JSServer.ChartApi.prototype.purgeCache=function(e){this._studyEngine.purgeCache(),this._studyEngine.purgeDataCache()},JSServer.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||["1","3","5","15","30","45","60","120","180","240","1D","1W","1M"]},JSServer.ChartApi.prototype.availableCurrencies=function(){var e=this._studyEngine.supportedCurrencies().map((function(e){return"string"==typeof e?{id:e,code:e}:e}));return Promise.resolve(e)},JSServer.ChartApi.prototype.availableUnits=function(){return Promise.resolve(this._studyEngine.supportedUnits())},JSServer.ChartApi.prototype.availablePriceSources=function(e){return this._studyEngine.supportedPriceSources(e)},JSServer.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()},JSServer.ChartApi.prototype.symbolsGrouping=function(){return this._studyEngine.symbolsGrouping()},JSServer.ChartApi.prototype.start=function(){this._enabled=!0,this._fireEvent("start_enabled")},JSServer.ChartApi.prototype.unsubscribe=function(e,t){var i=this._callbacks[e];i&&i.splice(i.indexOf(t),1)},JSServer.ChartApi.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},JSServer.ChartApi.prototype._fireEvent=function(e,t,i){if(this._callbacks.hasOwnProperty(e)){var s=this._callbacks[e].slice(0);i||(this._callbacks[e]=[]);for(var n=0;no||(TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(t,i,m,o,a,c),l&&setTimeout(l,0))}}}if(this._studyEngine.isTimeScaleExtendedTo(e,1e3*n))m();else{var g=TradingView.ChartapiMessagerInstances[e].beforeSeriesCompleted,f=TradingView.ChartapiMessagerInstances[e].seriesError;void 0!==this._setVisibleRangeTimeout[e]&&clearTimeout(this._setVisibleRangeTimeout[e]),this._setVisibleRangeTimeout[e]=setTimeout(function(){delete this._setVisibleRangeTimeout[e],g.subscribe(null,y,!0),f.subscribe(null,v,!0),this._studyEngine.ensureExtendedTo(t,e,1e3*n)}.bind(this),0)}function y(e,s){e===t&&s===i&&(g.unsubscribe(null,y),f.unsubscribe(null,v),m())}function v(e,s){e===t&&s===i&&g.unsubscribe(null,y)}},JSServer.ChartApi.prototype._applyTimeFrame=function(e,t,i,s,n){var o,l,c={},h=!0;if(n.type===_.PeriodBack){var d=this._studyEngine.getSeriesLastBarTime(e,i);if(null===d)return;l=d/1e3;var u=a.parse(n.value),m=this._studyEngine.getSeriesSymbolInfo(e,i)
;o=r.alignPeriodsBackForVisibleRange(m.session,m.session_holidays,m.corrections,u.letter(),u.multiplier(),1,d)/1e3;var g=p(this._studyEngine.getSeriesInterval(e,i),m);null!==g&&(l=g.timeToExchangeTradingDay(1e3*l)/1e3,o=g.timeToExchangeTradingDay(1e3*o)/1e3),c={applyDefaultRightMargin:!0},h=!1}else o=n.from,l=n.to;this.setVisibleTimeRange(e,i,s,o,l,h,c,void 0,n)},JSServer.ChartApi.prototype.modifySeries=function(e,t,i,s,n,o,r,a){var l=this;this._notificationHandlers[e][t]=new d((function(n){"series_completed"===n.method&&null!==r&&(l._applyTimeFrame(e,s,t,i,r),r=null),a(n)}),t),this._studyEngine.modifySeries(e,t,s,n,i,o)},JSServer.ChartApi.prototype.requestMoreData=function(e,t){this._studyEngine.extendSeriesRange(e,t)},JSServer.ChartApi.prototype.setStudiesAccessController=function(e){this.studiesAccessController=e},JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(){return new Promise(((e,t)=>{const i=this.studiesAccessController.getEnabledTools();e({method:"studies_metadata",params:[this._makeNextRequestId(),{errors:[],hash:"",metainfo:i,migrations:[]}]})}))},JSServer.ChartApi.prototype._makeNextRequestId=function(){return"metadata_"+this._metadataRequestNextNumber++},JSServer.ChartApi.prototype.setIsNonCountedStudyFn=function(e){this._isNonCountedStudy=e},JSServer.ChartApi.prototype.canCreateStudy=function(e,t,i){return this._isNonCountedStudy(t.id)||this.studyCounter{"use strict";var s=i(52033).Delegate,n=function(e,t){this._server=e,this._session=t,this.beforeSeriesCompleted=new s,this.seriesError=new s};n.prototype.onSymbolResolved=function(e,t){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,e,t]})},n.prototype.onSymbolError=function(e,t){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,e,t]})},n.prototype.onStudyError=function(e,t,i){this._server.receiveLocalResponse({method:"study_error",params:[this._session,e,t,i]})},n.prototype.onSeriesLoading=function(e,t){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,e,t]})},n.prototype.onSeriesCompleted=function(e,t,i){this.beforeSeriesCompleted.fire(e,t),
this._server.receiveLocalResponse({method:"series_completed",params:[this._session,e,i,t]})},n.prototype.onSeriesError=function(e,t,i){this._server.receiveLocalResponse({method:"series_error",params:[this._session,e,t,i]}),this.seriesError.fire(e,t)},n.prototype.onStudyCompleted=function(e,t){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,e,t]})},n.prototype.onStudyLoading=function(e,t){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,e,t]})},n.prototype.onTickmarksUpdated=function(e,t){var i={method:"tickmark_update",params:[this._session,{index:e,zoffset:0,changes:[],marks:t,index_diff:[]}]};this._server.receiveLocalResponse(i)},n.prototype.onTimescaleUpdate=function(e,t){var i={method:"timescale_update",params:[this._session,this._prepareDataUpdateObjects(t),{index:e.pointsIndex,zoffset:0,changes:e.points,marks:e.marks,index_diff:e.indexChange,baseIndex:e.baseIndex}]};this._server.receiveLocalResponse(i)},n.prototype.onTimescaleCompleted=function(e){this._server.receiveLocalResponse({method:"timescale_completed",params:[this._session,e]})},n.prototype.onSeriesTimeframeUpdate=function(e,t,i,s,n,o){var r={method:"series_timeframe",params:[this._session,e,t,i,s,o||null,!0,n]};this._server.receiveLocalResponse(r)},n.prototype.onPointsetDataUpdate=function(e,t,i){this.onDataUpdate(e,t,i,null)},n.prototype._prepareDataUpdateObjects=function(e){var t={};return e.forEach((function(e){t[e.objId]={series:e.data,turnaround:e.turnaround},e.nonSeriesData&&(e.nonSeriesData.data?t[e.objId].nonseries={d:JSON.stringify(e.nonSeriesData.data),indexes:e.nonSeriesData.indexes}:t[e.objId].nonseries={d:"",indexes:[]})})),t},n.prototype.onDataUpdate=function(e,t,i,s){var n={method:"data_update",params:[this._session,this._prepareDataUpdateObjects([{objId:e,turnaround:t,data:i,nonSeriesData:s}])]};this._server.receiveLocalResponse(n)},n.prototype.onQuotesData=function(e){this._server.receiveLocalResponse({method:"quote_symbol_data",params:e})},n.prototype.onDepthData=function(e){this._server.receiveLocalResponse({method:"dd",params:e})},n.prototype.onDepthUpdate=function(e){this._server.receiveLocalResponse({method:"dpu",params:e})},n.prototype.onClearData=function(e){this._server.receiveLocalResponse({method:"clear_data",params:[this._session,e]})},TradingView.ChartapiMessagerInstances=[],e.exports=n},47282:(e,t,i)=>{"use strict";i.d(t,{DatafeedRequestsCachedProcessor:()=>m});var s,n=i(50151),o=i(85049),r=i(29981),a=i(56570),l=i(14381),c=i(53388),h=i(17326),d=(i(21251),i(85541));function u(e,t){return e.ticker+(e.currency_code?"_#_"+e.currency_code:"")+(e.unit_id?"_#_"+e.unit_id:"")+(e.subsession_id?"_#_"+e.subsession_id:"")+"_#_"+t}function _(e){return new Date(e).toISOString()}!function(e){e.ThreadKeySeparator="_#_"}(s||(s={})),function(e){e[e.MaxEmptyResponsesInARow=50]="MaxEmptyResponsesInARow",e[e.ResetCacheTimePeriod=1e4]="ResetCacheTimePeriod"}(s||(s={}));class p{constructor(e,t,i,s,n,r){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],
this._subscribers=[],this._requesting=!1,this._leftDate=null,this._nextTime=null,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._destroyed=!1,this._emptyResponsesCount=0,this._firstDataRequest=!0,this._datafeed=e,this._symbolInfo=t,this._interval=o.Interval.parse(i),this._resolution=this._interval.value(),this._dwmAligner=n,this._serverTimeOffsetGetter=s,this._resetCacheTimePeriod=void 0===r?1e4:r,this._sessionSpec=new h.SessionsSpec(t.timezone,t.session,t.session_holidays,t.corrections),this._updateDatesFromExpirationDate()}destroy(){0!==this._subscribers.length&&this._logWarning("Destroying with not-empty state"),this._clearResetCacheTimeout(),this._unsubscribeRealtime(),this._purgeCache(),delete this._datafeed,this._destroyed=!0}addSubscription(e,t,i){const s=this._getNextSubscriptionId();this._pendingSubscribers.push({key:s,range:e,onHistoryCallback:t,onErrorCallback:i}),o.Interval.isDWM(this._resolution)&&void 0!==e.to&&null!==this._dwmAligner&&e.to%864e5&&this._logWarning(`Internal error: invalid date for DWM resolution ${_(e.to)}, expected time without a time part`),this._clearResetCacheTimeout();return setTimeout((()=>{this._destroyed||this._processPendingSubscribers()}),0),s}removeSubscription(e){const t=this._pendingSubscribers.find((t=>t.key===e));if(t)return void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(t),1);const i=this._subscribers.find((t=>t.key===e));if(i)return this._subscribers.splice(this._subscribers.indexOf(i),1),void(this._subscribers.length||(this._resetCacheTimeout=setTimeout((()=>{this._resetCacheTimeout=null,this._purgeCache(),this._unsubscribeRealtime()}),this._resetCacheTimePeriod)));this._logWarning("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,e))}_logMessage(e,t){(a.enabled("charting_library_debug_mode")||t)&&console.log(`${this._logMessagePrefix()}${e}`)}_logWarning(e){console.warn(`${this._logMessagePrefix()}${e}`)}_logError(e){console.error(`${this._logMessagePrefix()}${e}`)}_logMessagePrefix(){const e=this._symbolInfo.currency_code,t=this._symbolInfo.unit_id;return`${(new Date).toISOString()} FEED [${this._symbolInfo.name}|${this._resolution}${e?"|"+e:""}${t?"|"+t:""}]: `}_clearResetCacheTimeout(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)}_purgeCache(){this._logMessage("Reset cache"),this._cache={bars:[]},this._errorMessage=null,this._leftDate=null,this._endOfData=!1,this._firstDataRequest=!0,this._updateDatesFromExpirationDate()}_updateDatesFromExpirationDate(){void 0!==this._symbolInfo.expiration_date&&(this._nextTime=1e3*this._symbolInfo.expiration_date,this._leftDate=1e3*(this._symbolInfo.expiration_date+1))}_dealignTime(e){return null===this._dwmAligner?e:this._dwmAligner.timeToExchangeTradingDay(e)}_normalizeRange(e){const t=void 0!==e.to?e.to:this._dealignTime(this._now());if(0===this._cache.bars.length||void 0!==e.to&&t<=(0,n.ensureNotNull)(this._leftDate))return{countBack:e.countBack,
to:t};const i=null!==this._dwmAligner?this._dwmAligner.timeToSessionStart(t):t,s=(0,r.lowerbound)(this._cache.bars,i,((e,t)=>e.time{e.onErrorCallback(t)}))}let t=this._normalizeRange(e[0].range);for(const i of e.map((e=>this._normalizeRange(e.range))))(i.tot.countBack)&&(t=i);this._logMessage(`Leftmost subscriber requires ${t.countBack} bars prior ${_(t.to)}`);!(null===this._leftDate||t.to{const t=this._moveSubscriberToRealtime(e);this._returnHistoryDataToSubscriber(e,t)})),this._subscribeRealtimeIfNeeded()):this._ensureRequestedTo(t)}_moveSubscriberToRealtime(e){const t={key:e.key,onHistoryCallback:e.onHistoryCallback,barset:null};return this._subscribers.push(t),t}_isSymbolExpired(){return this._symbolInfo.expired||void 0!==this._symbolInfo.expiration_date}_subscribeRealtimeIfNeeded(){!this._subscribers.length||this._realtimeOn||this._isSymbolExpired()||this._subscribeRealtime()}_subscribeRealtime(){if(this._symbolInfo.expired||this._realtimeOn)return;this._realtimeOn=!0,this._datafeed.subscribeBars(this._symbolInfo,this._resolution,(e=>{null!==this._dwmAligner&&(e.time=this._dwmAligner.timeToSessionStart(e.time)),this._putToCacheNewBar(e),this._subscribers.forEach((t=>{const i=t.barset;if(null===i)throw new Error("subscriber.barset is null");i.add(e),t.onHistoryCallback(i)}))}),u(this._symbolInfo,this._resolution),(()=>{this._unsubscribeRealtime();const e=this._leftDate;this._purgeCache(),null===e||a.enabled("request_only_visible_range_on_reset")||this._ensureRequestedTo({to:e,countBack:0})})),this._logMessage("Subscribed to realtime")}_unsubscribeRealtime(){!this._isSymbolExpired()&&this._realtimeOn&&(this._datafeed.unsubscribeBars(u(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)}_returnHistoryDataToSubscriber(e,t){const i=this._normalizeRange(e.range),s=this._createBarsetForRange(i);s.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(e.key,s.count(),_(s.bars[0].time),_(s.bars[s.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(e.key)),t.barset=s,this._endOfData&&null!==this._leftDate&&i.to<=this._leftDate&&(s.endOfData=!0),e.onHistoryCallback(s)}_createBarsetForRange(e){
const t=null!==this._dwmAligner?this._dwmAligner.timeToSessionStart(e.to):e.to,i=(0,r.lowerbound)(this._cache.bars,t,((e,t)=>e.time{if(!this._destroyed)if(r)this._logMessage("getBars callback is already called before",!0);else{if(r=!0,e.length>0){const t=` [${_(e[0].time)} ... ${_(e[e.length-1].time)}]`;this._logMessage(`Receiving bars: total ${e.length} bars in ${t}, requested range: ${o}`)}else this._logMessage(`Receiving bars: barset is empty, requested range: ${o}`);this._requesting=!1,this._processBars(e,t)}}),(e=>{this._destroyed||(r?this._logMessage("getBars callback is already called before",!0):(r=!0,this._requesting=!1,this._errorMessage=e||null,this._processPendingSubscribers()))}))}_processBars(e,t){this._checkBars(e),this._alignBarsTime(e),e.length>0?(this._emptyResponsesCount=0,this._processFullBarset(e,t)):(this._emptyResponsesCount+=1,this._processEmptyBarset(t)),this._processPendingSubscribers()}_processEmptyBarset(e){e&&e.nextTime?(this._logMessage("Next time received: `{0}`".format(_(1e3*e.nextTime))),this._nextTime=1e3*e.nextTime):e&&e.noData?(this._logMessage("EOD received"),
this._setEndOfData()):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned"),50===this._emptyResponsesCount&&(this._logMessage("EOD detected due 50 empty responses in a row"),this._setEndOfData())}_setEndOfData(){this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._dealignTime(this._cache.bars[0].time))}_processFullBarset(e,t){this._putToCache(e)?null!==this._leftDate&&0!==this._cache.bars.length&&(this._interval.isTicks()?this._leftDate=this._dealignTime(this._cache.bars[0].time):this._leftDate=Math.min(this._leftDate,this._dealignTime(this._cache.bars[0].time))):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),t&&t.nextTime?this._logWarning("nextTime should be set when there is no data in the requested period only"):t&&t.noData&&this._logWarning("noData should be set when there is no data in the requested period and earlier only")}_getNextSubscriptionId(){return this._nextSubscriptionId++}_checkBars(e,t=!1){if(a.enabled("charting_library_debug_mode"))for(let i=1;i"number"!=typeof e[i][t]||!isFinite(e[i][t])))&&this._logError("Wrong bars values: all OHLC values should be numbers")}}_putToCache(e){if(0===e.length)return!0;if(this._cache.bars.length===e.length&&this._cache.bars[0].time===e[0].time&&this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&e[e.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&e[e.length-1].time>=this._cache.bars[0].time){const t=this._cache.bars[this._cache.bars.length-1].time===e[e.length-1].time;if(this._cache.bars=[],!t)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return this._cache.bars=[...e,...this._cache.bars],this._checkBars(this._cache.bars,!0),!0}_putToCacheNewBar(e){const t=this._cache.bars.length,i=e.time,s=0===t?NaN:this._cache.bars[t-1].time;0===t||st.destroy())),this._threads={},delete this._datafeed}purgeCache(){this._forEachThread(((e,t)=>t.destroy())),this._threads={}}subscribe(e,t,i,s,n){const o=u(e,t);this._threads[o]||(this._threads[o]=this._createThread(e,t));return o+'"'+this._threads[o].addSubscription(i,s,n)}unsubscribe(e){const t=e.split('"');if(2!==t.length)return void this._logWarning("Wrong guid format");const i=t[0],s=parseInt(t[1]);this._threads.hasOwnProperty(i)?this._threads[i].removeSubscription(s):this._logWarning("Data thread doesnt exist: "+e)}_createThread(e,t){return new p(this._datafeed,e,t,this._serverTimeOffsetGetter,(0,c.createDwmAligner)(t,e),this._resetCacheTimePeriod)}_forEachThread(e){Object.keys(this._threads).forEach((t=>e(t,this._threads[t])))}_logWarning(e){console.warn(`${(new Date).toISOString()} FEED: ${e}`)}}},9447:(e,t,i)=>{"use strict";i.d(t,{barTimeToEndOfPeriod:()=>n,endOfPeriodToBarTime:()=>o});var s=i(83910);function n(e,t,i){if(i.isDays())return t;if(e.moveTo(1e3*t),i.isIntraday()){const i=e.indexOfBar(1e3*t);if(i<0)throw new Error(`${t} is out of the instrument session `);return e.endOfBar(i)/1e3}return e.startOfBar(s.SessionStage.LASTBAR_SESSION)/1e3}function o(e,t,i){if(i.isDays())return t;const s=1e3*t-1;if(e.moveTo(s),i.isIntraday()){const i=e.indexOfBar(s);if(i<0)throw new Error(`${t} is out of the instrument session `);return e.startOfBar(i)/1e3}return t=e.startOfBar(0)/1e3}},30328:(e,t,i)=>{"use strict";i.d(t,{replaceGraphicsTimesWithTimePointIndexIndex:()=>o});const s=new Map([["horizlines",e=>[e.startIndex,e.endIndex]],["hhists",e=>[e.firstBarTime,e.firstBarTime]],["vertlines",e=>[e.index]],["polygons",e=>e.points.map((e=>e.index))],["horizlines",e=>[e.startIndex,e.endIndex]],["hhists",e=>[e.firstBarTime,e.firstBarTime]],["vertlines",e=>[e.index]],["polygons",e=>e.points.map((e=>e.index))],["backgrounds",e=>[e.start,e.stop]]]),n=new Map([["horizlines",(e,t)=>{const i=e;i.startIndex=t.get(i.startIndex),i.endIndex=t.get(i.endIndex)}],["hhists",(e,t)=>{const i=e;i.firstBarTime=t.get(i.firstBarTime),i.lastBarTime=t.get(i.lastBarTime)}],["vertlines",(e,t)=>{const i=e;i.index=t.get(i.index)}],["polygons",(e,t)=>{const i=e;for(const e of i.points)e.index=t.get(e.index)}],["backgrounds",(e,t)=>{const i=e;i.start=t.get(i.start),i.stop=t.get(i.stop)}]]);function o(e){const t=e.data&&e.data.graphicsCmds&&e.data.graphicsCmds.create;if(!t)return[];const i=new Map,o=new Set;s.forEach(((e,s)=>{const n=t[s];if(n)for(const t of n)for(const s of t.data){const t=e(s);for(const e of t)i.set(e,-1),o.add(e)}}));const r=Array.from(o).sort(((e,t)=>e-t));return r.forEach(((e,t)=>i.set(e,t))),n.forEach(((e,s)=>{const n=t[s];if(n)for(const t of n)for(const s of t.data)e(s,i)})),r}},9001:(e,t,i)=>{"use strict";var s=i(56570);window.onload=function(){location.hostname.indexOf(".")>=0&&!function(){try{return/^(192|172|10)\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]/.test(location.hostname)||/^.*((?:\.local)|localhost)$/.test(location.hostname)}catch(e){return!1}}()&&setTimeout((function(){try{
var e=function(){var e=0;return JSON.parse(urlParams.logo).image&&(e="C",s.enabled("link_to_tradingview")||(e="D")),e}();window.ga&&(0!==e&&window.ga("send","event","s",e),urlParams.utm||window.ga("send","event","l"))}catch(e){}}),3e4)}},2060:(e,t,i)=>{"use strict";var s,n=i(14381),o={};e.exports=function(e,t,i){var r,a,l,c,h={},d=o[i]||"out_of_session",u=!1,_=i,p=t,m=null,g=null;function f(){var e={};e.symbolname=_,e.status="ok",e.values={},e.values.current_session=d,o[_]=d,TradingView.ChartapiMessagerInstances[p].onQuotesData([p].concat([e]))}function y(){if(r)if(c)d="out_of_session";else{var e=(new Date).getTime(),t=n.isTradingNow(e,r)?"market":"out_of_session";a&&n.isTradingNow(e,a)?t="pre_market":l&&n.isTradingNow(e,l)&&(t="post_market"),t!==d&&(d=t)}}return e(i,null,(function(e){u||function(e){r=new n.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections),c=e.expired,e.subsession_id&&e.subsessions?e.subsessions.forEach((t=>{switch(t.id){case"regular":r=new n.SessionInfo(e.timezone,e.session,e.session_holidays,t["session-correction"]||e["session-correction"]||e.corrections);break;case"premarket":a=new n.SessionInfo(e.timezone,t.session,e.session_holidays,t["session-correction"]||e["session-premarket-correction"]||e.corrections);break;case"postmarket":l=new n.SessionInfo(e.timezone,t.session,e.session_holidays,t["session-correction"]||e["session-postmarket-correction"]||e.corrections)}})):(a=void 0,l=void 0);const t=60-new Date(Date.now()).getSeconds();s&&s?.ticker===e.ticker||(s={ticker:e.ticker,timer:t},clearTimeout(s.timeout)),g=setTimeout((()=>{m=setInterval((()=>{y(),f()}),6e4),y(),f()}),1e3*s.timer),s&&void 0!==s?.timeout||(s.timeout=g),y(),f()}(e)}),(function(){})),h.stop=function(){u=!0,m&&clearInterval(m),g&&clearInterval(g)},h.marketStatus=function(){return d},h}},85541:(e,t,i)=>{"use strict";i.d(t,{BarSet:()=>s});class s{constructor(e,t){this.info=e,this.bars=t||[],this.isBarClosed=!0,this.firstLoadedTimeMs=0!==this.bars.length?this.bars[0].time:1/0,this._emptyBarCount=0,this._lastBarIsEmpty=!1}symbolinfo(){return this.info}isLastBarClosed(){return this.isBarClosed}setLastBarClosed(e){this.isBarClosed=e}bar(e){const t=this.bars[e];if(void 0===t)throw new Error(`BarSet has no value at index ${e}`);return t}count(){return this.bars.length}emptyBarCount(){return this._emptyBarCount}add(e,t,i){void 0===i&&(i=!1);const s=e,n=this.bars,o=n.length,r=s.time,a=0===o?NaN:n[o-1].time;0===o||a{"use strict";i.r(t),i.d(t,{DataFeed:()=>P,setupFeed:()=>S,unsubscribeUnused:()=>b});var s=i(50151),n=i(85049);class o{constructor(){this._listeners=[]}listenersCount(){return this._listeners.reduce(((e,t)=>e+(t?1:0)),0)}addListener(e,t){this._listeners.push({dataListener:e,onErrorCallback:t}),
this._barset&&e(this._barset),this._errorMsg&&t(this._errorMsg)}removeListener(e){const t=this._listeners.filter((t=>t&&t.dataListener===e));if(0===t.length)return;const i=this._listeners.indexOf(t[0]);delete this._listeners[i]}onError(e){this._errorMsg=e||"unspecified error";const t=this._listeners,i=t.length;for(let s=0;s{throw new Error("BarBuildItem scripts should not need to access any input values")},recalc:(e,t)=>{this._recalc(t)},out:(e,t)=>{this._out(e,t)},nonseriesOut:(e,t)=>{this._nonseriesOut(e,t)},setNoMoreData:()=>{this._barset&&(this._barset.endOfData=!0)},onErrorCallback:e=>{this.listeners.onError(e)}})}stop(){this.engine?this.engine.stop():console.error("Internal library error 0x1")}_recalc(e){this._isRecalculated&&console.error("recalc called twice!"),this._barset||(this._barset=new l.BarSet(this._symbolInfo)),e&&(this._barset.firstLoadedTimeMs=e.firstLoadedTimeMs,this._barset.endOfData=e.endOfData),this.listeners.fire(this._barset),this._isRecalculated=!0}_nonseriesOut(e,t){const i=Object.assign({},t);i.nonseries=!0,i.data=t.bars,delete i.bars,i.barsetSize=this._barset?this._barset.count():0,i.lastBar=this._barset&&this._barset.count()>0?this._barset.bar(this._barset.count()-1):null,this.listeners.fire(i,!0)}_out(e,t){const i=t[0];if(isNaN(i))return;const n={time:i,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],updatetime:t[6]},o=t[7];this._barset||(this._barset=new l.BarSet((0,s.ensureDefined)(e.info,"bar builder item output symbol info")));const r=t[8],a=t[9];if(r instanceof Array&&a)for(let e=0;e{n&&e.regular_session&&(e.session=e.regular_session),this._subs=this._host.subscribe(e,s,a,(e=>{this.listeners.fire(e)}),(e=>{this.listeners.onError(e)}))}),(e=>{this.listeners.onError(e)}))}stop(){
this._subs&&this._host.unsubscribe(this._subs)}}var g=i(60656),f=i(14381),y=i(40644);class v{constructor(e,t){this._period=e,this._generateEmptyBars=!!t}init(e){this._bb=(0,f.newBarBuilder)(this._period,e.symbol.session,null),this._bbEmptyBars=this._generateEmptyBars?(0,f.newBarBuilder)(this._period,e.symbol.session,null):void 0,e.setMinimumAdditionalDepth(0)}main(e){const t=(0,s.ensureDefined)(this._bb,"bar builder study bar builder"),i=e.symbol.time,n=t.alignTime(i),o=e.new_var(n),r=h.Std.na(n),a=o.get(1),l=h.Std.na(a)?1:h.Std.neq(n,a),c=e.new_var(),d=e.new_var(),u=e.new_var(),_=e.new_var(),p=c.get(1),m=d.get(1),g=u.get(1),f=_.get(1),y=r?NaN:l?h.Std.open(e):p,v=r?NaN:l?h.Std.high(e):h.Std.max(h.Std.high(e),m),S=r?NaN:l?h.Std.low(e):h.Std.min(h.Std.low(e),g),b=r?NaN:h.Std.close(e),w=r?NaN:l?h.Std.volume(e):h.Std.volume(e)+f,C=r?NaN:i,P=e.symbol.isBarClosed&&t.isLastBar(0,i),T=this._generateEmptyBars&&l?this._extrapolate(a,n):void 0,x=e.new_var(h.Std.close(e)).get(1),I=T instanceof Array?x:NaN;return c.set(y),d.set(v),u.set(S),_.set(w),[n,y,v,S,b,w,C,P,T,I]}_extrapolate(e,t){return isNaN(e)||isNaN(t)?void 0:(0,y.extrapolateBarsFrontToTime)((0,s.ensureDefined)(this._bbEmptyBars,"bar builder study empty bar builder"),e,t,Number.MAX_SAFE_INTEGER,!0).times}}const S=e=>{P.instance=new P(e),(0,g.setupFeed)(P.instance)},b=()=>{P.instance.removeUnused()},w=e=>{console.error(e),h.Std.error(e)},C=n.Interval.parse("1M").inMilliseconds(0);class P{constructor(e){this._host=e,this._cache={}}subscribe(e,t,i,s,n,o,r,a,l,c,h){const d=l(r),u=((e,t,i,s,n,o,r,a,l)=>o+e+s+(t||"")+(i||"")+(l||"")+(n.has_empty_bars?"_":"")+"_"+r.countBack+"_"+r.to+"_"+Boolean(a))(e,t,i,s,r,a,d,c,h);let _=this._getCache(u);return _||(_=this._createItem(e,t,i,s,r,d,a,c,h),this._putCache(u,_)),_.listeners.addListener(n,o),{key:u,listener:n}}unsubscribe(e){const t=this._getCache(e.key);t&&t.listeners.removeListener(e.listener)}removeUnused(){const e=[],t=e=>!!this._cache[e];for(const i in this._cache)if(t(i)){0===(0,s.ensureNotNull)(this._cache[i],`datafeed cache item ${i}`).listeners.listenersCount()&&e.push(i)}if(0!==e.length){for(let t=0;t{"use strict";let s;function n(e,t,i,n){return s?.(e,t,i,n)??e}function o(e){s=e}i.d(t,{getVolumeProfileResolutionForPeriod:()=>n,overwriteVolumeProfileResolutionForPeriodGetter:()=>o})},67153:(e,t,i)=>{"use strict";i.r(t),i.d(t,{findSuitableResolutionToBuildFrom:()=>r});var s=i(85049);function n(e,t){const i=t.multiplier();for(let s=e.length-1;s>=0;s--){const n=Number(e[s]);if(i%n==0)return{error:!1,resolution:`${n}${t.letter()}`}}return{error:!0,errorMessage:o(t.value())}}function o(e){return`Misconfiguration error: it is trying to request ${e} but we cannot build it from lower resolution`}function r(e,t){const i=s.Interval.parse(e);if((i.isWeeks()||i.isMonths())&&t.has_weekly_and_monthly){let e=["1"];i.isWeeks()&&void 0!==t.weekly_multipliers&&(e=t.weekly_multipliers),i.isMonths()&&void 0!==t.monthly_multipliers&&(e=t.monthly_multipliers);const s=n(e,i);if(!s.error)return s}if(i.isDWM()&&(void 0===t.has_daily||t.has_daily))return i.isDays()&&void 0!==t.daily_multipliers?n(t.daily_multipliers,i):void 0===t.daily_multipliers||t.daily_multipliers.includes("1")?{error:!1,resolution:"1D"}:{error:!0,errorMessage:"Misconfiguration error: it is trying to request a resolution but symbol does not support it"};if(i.isDWM())return{error:!0,errorMessage:o(i.value())};if(i.isMinutes()&&!t.has_intraday)return{error:!0,errorMessage:"Misconfiguration error: it is trying to request intraday resolution but symbol does not support it"};if(i.isSeconds()&&!t.has_seconds)return{error:!0,errorMessage:"Misconfiguration error: it is trying to request seconds resolution but symbol does not support it"};const r=t.seconds_multipliers??["1"],a=0===r.length,l=a||r.every((e=>parseInt(e,10)>i.multiplier())),c=t.build_seconds_from_ticks&&(a||l)&&t["is-tickbars-available"];if(i.isSeconds()&&c)return{error:!1,resolution:"1T"};if(i.isTicks())return!t["is-tickbars-available"]||i.multiplier()>1?{error:!0,errorMessage:`Misconfiguration error: it is trying to request ${i.multiplier()} ticks resolution but symbol does not support it`}:{error:!1,resolution:"1T"}
;const h=i.isSeconds()?t.seconds_multipliers:t.intraday_multipliers;return void 0===h?{error:!1,resolution:i.value()}:n(h,i)}},60656:(e,t,i)=>{"use strict";i.d(t,{ScriptRunner:()=>C,setupFeed:()=>w});var s=i(50151),n=i(85049),o=i(73698),r=i(2740),a=i(42217),l=i(17326),c=i(14381),h=i(91007),d=i(50335);class u{constructor(e,t,i,s,r,l,c){this.periodBase="";const h=(0,o.decodeExtendedSymbol)(e),d="string"==typeof h.symbol?h:h.symbol;if((0,o.isStudySymbol)(d))throw new Error(`Unexpected nested study symbol: ${e}`);const u="string"==typeof h.symbol?h.symbol:h.symbol.symbol;this.ticker=u,this.currencyCode=i||d["currency-id"],this.unitId=s||d["unit-id"],this.subsessionId=c||d.session;const _=d["currency-id"]!==this.currencyCode||d["unit-id"]!==this.unitId;d["currency-id"]=this.currencyCode,d["unit-id"]=this.unitId,_&&(e=(0,o.encodeExtendedSymbolOrGetSimpleSymbolString)(h)),this.tickerid=e;const p=n.Interval.parse(t);this.resolution=p.letter(),this.interval=p.multiplier(),this.period=p.value(),this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.minTick=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.isFirstBar=!1,this.isLastBar=!1,this.session=new a.SessionInfo("Etc/UTC","24x7"),this.regularSubsession=null,this.preMarketSubsession=null,this.postMarketSubsession=null,this.script=r,this.projectionTime=NaN,this.isAdditionalDepthAllowed=!(0,o.isStudySymbol)(h)||h.type.includes("BarSetHeikenAshi"),l&&this.set_symbolinfo(l)}set_symbolinfo(e){if(e||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=e,this.minTick=e.minmov/e.pricescale,this.currencyCode=e.currency_code,this.unitId=e.unit_id,this.subsessionId=e.subsession_id,this.timezone=(0,r.get_timezone)(e.timezone),this.session.init(e.timezone,e.session,e.session_holidays,e.corrections),void 0!==e.subsessions){const t=e.subsessions.find((e=>e.id===h.SubsessionId.Regular)),i=e.subsessions.find((e=>e.id===h.SubsessionId.PreMarket)),s=e.subsessions.find((e=>e.id===h.SubsessionId.PostMarket));void 0!==t&&(this.regularSubsession=new l.SessionsSpec(e.timezone,t.session,e.session_holidays,t["session-correction"])),void 0!==i&&(this.preMarketSubsession=new l.SessionsSpec(e.timezone,i.session,e.session_holidays,i["session-correction"])),void 0!==s&&(this.postMarketSubsession=new l.SessionsSpec(e.timezone,s.session,e.session_holidays,s["session-correction"]))}}isdwm(){return""!==this.resolution&&"S"!==this.resolution&&"T"!==this.resolution}enable_dwm_aligning(e,t){this.dwm_aligner=(0,c.newBarBuilder)(this.period,e,t)}bartime(){const e=this.time;if(!this.isdwm()||isNaN(e))return e;const t=(0,s.ensureDefined)(this.timezone,"symbol instrument timezone");let i=(0,r.utc_to_cal)(t,e);return i=this.session.spec.correctTradingDay(i),(0,r.cal_to_utc)(t,i)}lastbar(e){if(isNaN(e.time))return;let t=e.time;this.dwm_aligner&&(this.dwm_aligner.moveTo(t),t=this.dwm_aligner.startOfBar(0));const i=this.time!==t;i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),
this.time=t,this.open=e.open,this.high=e.high,this.low=e.low,this.close=e.close,this.volume=(0,d.isNumber)(e.volume)&&e.volume>=0?e.volume:NaN,this.updatetime=e.updatetime||NaN,this.isNewBar=i,this.isBarClosed=!!e.isBarClosed,this.isLastBar=!!e.isLastBar,this.projectionTime=e.projectionTime||NaN,this.isNewBar&&(this.index++,this.isFirstBar=0===this.index),this.script.calc(this)}}var _=i(29981),p=i(73772);class m{constructor(e){this.mindepth=0,this.original=NaN,this.modified=!1,this._hist=null,this._histPos=0,this.symbol=e}valueOf(){return this.get(0)}get(e=0){return isNaN(e)&&(e=0),e=e||0,this._hist?e>=this._hist.length?(console.error("not enough depth: "+this),NaN):this._get(e):(this.mindepth=p.Std.max(this.mindepth,e),NaN)}set(e){this._hist&&(this._hist[this._histPos]=e,this.modified=!0)}prepare(e){e===this.symbol&&(e.isNewBar?(this.original=this.get(0),!this.modified&&this._hist||this.add_hist()):this.set(this.original),this.modified=!1)}add_hist(){if(!this._hist){let e=p.Std.na(this.mindepth)?p.Std.max_series_default_size:p.Std.max(this.mindepth+1,1);e=Math.round(e);const t=new Array(e);for(let i=0;i0&&void 0!==e&&i.set(e),i}new_unlimited_var(e){const t=this._vars;t.length<=this._varsIndex&&t.push(new g(this.symbol));const i=t[this._varsIndex++];return arguments.length>0&&i.set(e),i}new_ctx(){return this._ctx.length<=this._ctxIndex&&this._ctx.push(new f(this.symbol)),this._ctx[this._ctxIndex++]}prepare(e){
this._ctxIndex=0,this._varsIndex=0;for(let t=0;te&&(e=i)}return e}stop(){this.symbol=null,this._vars=null}setMinimumAdditionalDepth(e){this.minimumAdditionalDepth=e}}function y(e){return!Array.isArray(e)&&"composite"!==e.type&&"non_series_bars"!==e.type&&!!e.nonseries}class v{constructor(e,t,i,s,n,o,r,a,l,c,h){this._body=o,this._symbols=[],this._runner=n,this._inputCallback=a,this._out=r,this._nonseriesOut=l,this._ctx=new f(this.add_sym(e,t,i,s,c,h)),this.init()}calc(e){const t=this._ctx,i=this._body;t.prepare(e);const s=i.main(t,this._inputCallback,e);var n;if(null!=s)if(null===(n=s)||Array.isArray(n)||"composite"!==n.type)this._processResult(s);else for(let e=0;e1&&this._runner.host.enableDwmAligning&&r.enable_dwm_aligning(this._symbols[0].session,r.session),r}maxAdditionalDepth(){return this._symbols[0].isAdditionalDepthAllowed?this._ctx.maxAdditionalDepth():0}stop(){this._symbols=null,this._ctx?.stop(),this._ctx=null}get_sym(e){return this._symbols[e]}_processResult(e){const t=this._ctx;var i;this._out&&e&&(!isNaN(t.symbol.time)||y(e))&&(y(e)?(i=e,Array.isArray(i)||"projection"!==i.type||(e.projectionTime=t.symbol.time),this._nonseriesOut(t.symbol,e)):!function(e){return!Array.isArray(e)&&("non_series_bars"===e.type||"projection"===e.type)}(e)?this._out(t.symbol,e):e.bars.forEach((e=>{this._out(t.symbol,e)})))}}var S=i(53388),b=i(1452);function w(e){C.feed=e}class C{constructor(e){this._nonseriesUpdate=null,this._script=null,this._symbols=[],this._barsets=[],this._subscription=[],this.host=e,this._isRecalculated=!1,this.isStarted=!1,this.start()}add_sym(e,t,i,s,n,o,r){const a=new u(e,t,i,s,n,o,r);return this._symbols.push(a),a}get_sym(e){return this._symbols[e]}out(e,t){if(this._nonseriesUpdate){const i=Object.assign({},this._nonseriesUpdate);t.splice(0,0,e.time),i.lastBar=t,this.host.nonseriesOut(e,i)}else this.host.out(e,t)}start(){this.isStarted=!0;const e=this.host,t=new v(e.tickerid,e.period,e.currencyCode,e.unitId,this,e.body,this.out.bind(this),e.input,e.nonseriesOut,e.symbolInfo,e.subsessionId);this._script=t;const i=[],o=this._symbols,r=Object.assign({},e.dataRange,{countBack:e.dataRange.countBack+this._script.maxAdditionalDepth()}),a=o[0],l=(t,s,n)=>{i.push(C.feed.subscribe(t.tickerid,t.currencyCode,t.unitId,t.period,n,e.onErrorCallback,e.symbolInfo,e.sessionId,s,e.forceAlignBars,t.subsessionId))},c=(t,i)=>{"series"===(i.nonseries?"nonseries":"series")?this.update(t,i):i.lastBar?(this._nonseriesUpdate=i,i.lastBar.isLastBar=!0,
this._symbols[0].lastbar(i.lastBar),this._nonseriesUpdate=null):e.nonseriesOut(o[0],i)},h=()=>r;l(a,h,(e=>{!e.nonseries&&Number.isFinite(e.firstLoadedTimeMs)&&(e=>{function i(i,n){let o=(0,S.createTimeToBarTimeAligner)(i,n)(e);const r=(0,S.createDwmAligner)(i,n);return null!==r&&(o=r.timeToExchangeTradingDay(o)),{to:o,countBack:(0,s.ensureNotNull)(t,"script runner script").maxAdditionalDepth()}}for(let e=1;e=0;t--){const i=e[t],s=this._barsets[t],n=s.count();for(let e=0;ee.endOfData));t&&this.host.setNoMoreData(),this.host.recalc(this,{endOfData:t,firstLoadedTimeMs:this._barsets[0].firstLoadedTimeMs,emptyBarCount:this._barsets[0].emptyBarCount()})}catch(e){if(!(e instanceof b.StudyError))throw e;this.host.onErrorCallback(e.message)}}}C.feed={subscribe(){throw console.error("must be initialized with setupFeed"),new Error("must be initialized with setupFeed")},unsubscribe(){throw console.error("must be initialized with setupFeed"),new Error("must be initialized with setupFeed")}}},23863:(e,t,i)=>{"use strict";const s=i(56570),n=i(19625).getHexColorByName;var o=i(73772).Std;i(42924);var r=i(69146).pivotPointsStandardStudyItem,a=i(24018).volumeProfileVisibleRangeStudyItem,l=i(92245).volumeProfileFixedRangeVbPStudyItem,c=i(92245).volumeProfileFixedRangeBSStudyItem,h=i(68563).spreadStudyItem,d=i(15497).ratioStudyItem,u=i(65498).regressionTrendStudyItem,_=i(46367).anchoredVWAPStudyItem;const p=n("color-ripe-red-400"),m=n("color-minty-green-400"),g=s.enabled("secondary_series_extend_time_scale");JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#9C27B0"}},inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",
is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol",isHidden:!0}],id:"Compare@tv-basicstudies-1",format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(1),o.period(this._context))},this.main=function(e,t){this._context=e;var i=this._context.new_unlimited_var(this._context.symbol.time);this._context.select_sym(1);var s=this._context.new_unlimited_var(this._context.symbol.time),n=o[t(0)](this._context),r=this._context.new_unlimited_var(n);return this._context.select_sym(0),[r.adopt(s,i,0)]}}},{name:"Overlay",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},inputs:{symbol:"",extendTimeScale:!1}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{title:"Open"},high:{title:"High"},low:{title:"Low"},close:{title:"Close"}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0},{id:"extendTimeScale",name:"extendTimeScale",defval:!1,type:"boolean",isHidden:!0}],id:"Overlay@tv-basicstudies-1",format:{type:"price",precision:4},canExtendTimeScale:!0},constructor:function(){this.init=function(e,t){this._context=e,this._context.new_sym(t(0),o.period(this._context))},this.main=function(e,t){this._context=e;var i=!g||!0!==t(1),s=this._context.new_unlimited_var(this._context.symbol.time);this._context.select_sym(1);var n=this._context.new_unlimited_var(this._context.symbol.time),r=this._context.new_unlimited_var(o.open(this._context)),a=this._context.new_unlimited_var(o.high(this._context)),l=this._context.new_unlimited_var(o.low(this._context)),c=this._context.new_unlimited_var(o.close(this._context));return i?(this._context.select_sym(0),[r.adopt(n,s,1),a.adopt(n,s,1),l.adopt(n,s,1),c.adopt(n,s,1)]):[r.get(0),a.get(0),l.get(0),c.get(0)]}}},{name:"Volume",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:50,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!1,color:"#2196F3"},smoothedMA:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!1,color:"#2196F3"}},palettes:{volumePalette:{colors:{0:{color:p,width:1,style:0},1:{color:m,width:1,style:0}}}},inputs:{showMA:!1,volumeMA:"SMA",length:20,col_prev_close:!1,symbol:"",smoothingLine:"SMA",smoothingLength:9}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"},{id:"smoothedMA",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0},smoothedMA:{title:"Smoothed MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{
name:"Falling"},1:{name:"Growing"}}}},inputs:[{id:"symbol",name:"Other Symbol",defval:"",type:"symbol",optional:!0,isHidden:!1},{id:"showMA",name:"show MA",defval:!1,type:"bool",isHidden:!0},{id:"length",name:"MA Length",defval:20,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["vol_ma"]},{id:"volumeMA",name:"Volume MA",defval:"SMA",type:"text",options:["SMA","EMA","WMA"],hideWhenPlotsHidden:["vol_ma"]},{defval:!1,id:"col_prev_close",name:"Color based on previous close",type:"bool"},{id:"smoothingLine",name:"Smoothing Line",defval:"SMA",type:"text",options:["SMA","EMA","WMA"],hideWhenPlotsHidden:["smoothedMA"]},{id:"smoothingLength",name:"Smoothing Length",defval:9,type:"integer",min:1,max:1e4,hideWhenPlotsHidden:["smoothedMA"]}],id:"Volume@tv-basicstudies-1",format:{type:"volume"}},constructor:function(){this.init=function(e,t){this._context=e,""!==t(0)&&this._context.new_sym(t(0),o.period(this._context))},this.f_0=function(e,t){return o.gt(e,t)?0:1},this.main=function(e,t){this._context=e,this._input=t;var i=o.volume(this._context),s=o.open(this._context),n=o.close(this._context),r=this._context.new_var(this._context.symbol.time),a=this._input(5),l=this._input(6),c=this._input(2),h=this._input(3);if(this._context.setMinimumAdditionalDepth(c+l),""!==this._input(0)){this._context.select_sym(1);var d=this._context.new_var(this._context.symbol.time),u=this._context.new_var(o.volume(this._context)),_=this._context.new_var(o.open(this._context)),p=this._context.new_var(o.close(this._context));i=u.adopt(d,r,1),s=_.adopt(d,r,1),n=p.adopt(d,r,1),this._context.select_sym(0)}var m=this._context.new_var(i),g=o[h.toLowerCase()](m,c,this._context),f=this._context.new_var(g),y=this._context.new_var(n);return[i,y.get(1)&&this._input(4)?this.f_0(y.get(1),n):this.f_0(s,n),g,o[a.toLowerCase()](f,l,this._context)]}}},{name:"ZigZag",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"float",min:.001,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),n=i/100,r=Math.ceil(s/2);return[o.zigzag(n,r,this._context),o.zigzagbars(n,r,this._context)]}}},{name:"Sessions",metainfo:{_metainfoVersion:52,defaults:{graphics:{vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}},backgrounds:{preMarket:{color:"#FF9800",transparency:92,visible:!0},postMarket:{color:"#2196F3",transparency:92,visible:!0}}},linkedToSeries:!0},description:"Sessions",graphics:{vertlines:{sessBreaks:{
name:"Session Break",halign:"left"}},backgrounds:{preMarket:{name:"Pre market"},postMarket:{name:"Post market"}}},id:"Sessions@tv-basicstudies-1",inputs:[],is_hidden_study:!0,is_price_study:!0,name:"Sessions@tv-basicstudies",palettes:{},plots:[],shortDescription:"Sessions",format:{type:"inherit"}},constructor:function(){function e(e,t){return{id:e,index:e,extendBottom:!0,extendTop:!0}}function t(e){return{id:e.start,start:e.start,stop:e.stop}}this.init=function(){this._times=[]},this._getVerticalLineData=function(t){return o.selectSessionBreaks(t,this._times).map(e)},this._getPreAndPostMarketBackgroundsData=function(e){const i=o.selectPreAndPostMarketTimes(e,this._times);return{preMarket:i.preMarket.map(t),postMarket:i.postMarket.map(t)}},this.main=function(e,t){if(o.isdwm(e))return null;var i=o.time(e);if(isNaN(i))return null;var s=this._times.length;if(0!==s&&this._times[s-1]===i||this._times.push(i),!e.symbol.isLastBar||!e.symbol.isNewBar)return null;var n=this._getVerticalLineData(e),r=this._getPreAndPostMarketBackgroundsData(e);return 0===n.length&&0===r.preMarket.length&&0===r.postMarket?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:n}],backgrounds:[{styleId:"preMarket",data:r.preMarket},{styleId:"postMarket",data:r.postMarket}]},erase:[{action:"all"}]}}}}}},{name:"SuperTrend",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:3,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_2:{linestyle:0,linewidth:3,plottype:"shape_arrow_up",trackPrice:!1,location:"BelowBar",transparency:35,visible:!0,color:"#00FF00"},plot_3:{linestyle:0,linewidth:3,plottype:"shape_arrow_down",trackPrice:!1,location:"AboveBar",transparency:35,visible:!0,color:"#FF0000"}},palettes:{palette_0:{colors:{0:{color:"#008000",width:3,style:0},1:{color:"#800000",width:3,style:0}}}},inputs:{in_0:10,in_1:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"},{id:"plot_2",type:"shapes"},{id:"plot_3",type:"shapes"}],styles:{plot_0:{title:"SuperTrend",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Up Arrow",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Down Arrow",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"SuperTrend",shortDescription:"SuperTrend",is_price_study:!0,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:100},{id:"in_1",name:"Factor",defval:3,type:"float",min:1,max:100}],id:"SuperTrend@tv-basicstudies-1",scriptIdPart:"",name:"SuperTrend",isCustomIndicator:!0,format:{type:"inherit"}},constructor:function(){this.main=function(e,t){var i=t(0),s=t(1),[n,r]=o.supertrend(s,i,e),a=e.new_var(r).get(1);return[n,-1===r?0:1,-1===r&&a!==r?1:NaN,1===r&&a!==r?1:NaN]}}},r,a,l,c,h,d,u,_])},73772:(e,t,i)=>{"use strict";i.d(t,{Std:()=>h});var s=i(14381),n=i(2740);class o{constructor(e,t,i){this._timezone=e,
this._preMarketSessionSpec=t,this._postMarketSessionSpec=i}getPreAndPostMarketTimes(e){if(0===e.length)return{preMarket:[],postMarket:[]};const t=[],i=[];let s=null,o=null,r=e[0],a=(0,n.utc_to_cal)(this._timezone,r);this._isInPreMarketSession(a)&&(o=r),this._isInPostMarketSession(a)&&(s=r);for(let l=1;le?1:0,h={};function d(e,t,i,s,n){let o=n,r=0;if(isNaN(e.get(t-1)))return{index:NaN,value:NaN};for(let i=0;ie.symbol.index+1,h.nz=(e,t=0)=>isFinite(e)?e:t,h.na=function(e){return 0===arguments.length?NaN:isNaN(e)?1:0},h.isZero=e=>Math.abs(e)<=1e-10?1:0,h.toBool=e=>isFinite(e)&&!h.isZero(e),h.eq=(e,t)=>h.isZero(e-t),h.neq=(e,t)=>c(!h.eq(e,t)),h.ge=(e,t)=>c(h.isZero(e-t)||e>t),h.gt=(e,t)=>c(!h.isZero(e-t)&&e>t),h.lt=(e,t)=>c(!h.isZero(e-t)&&ec(h.isZero(e-t)||eisNaN(e)||isNaN(t)?NaN:h.isZero(e)||h.isZero(t)?0:1,h.or=(e,t)=>isNaN(e)||isNaN(t)?NaN:h.isZero(e)&&h.isZero(t)?0:1,h.not=e=>isNaN(e)?NaN:h.isZero(e)?1:0,h.eps=()=>l,h.greaterOrEqual=(e,t,i)=>t-e<(i||l),h.lessOrEqual=(e,t,i)=>e-t<(i||l),h.equal=(e,t,i)=>Math.abs(e-t)<(i||l),h.greater=(e,t,i)=>e-t>(i||l),h.less=(e,t,i)=>t-e>(i||l),h.compare=(e,t,i)=>h.equal(e,t,i)?0:h.greater(e,t,i)?1:-1,h.max=Math.max,h.min=Math.min,h.pow=Math.pow,h.abs=Math.abs,h.log=Math.log,h.log10=e=>Math.log(e)/Math.LN10,h.sqrt=Math.sqrt,h.sign=e=>isNaN(e)?NaN:h.isZero(e)?0:e>0?1:-1,h.exp=Math.exp,h.sin=Math.sin,h.cos=Math.cos,h.tan=Math.tan,h.asin=Math.asin,h.acos=Math.acos,h.atan=Math.atan,h.floor=Math.floor,h.ceil=Math.ceil,h.round=Math.round,h.avg=(...e)=>{if(2===e.length)return(e[0]+e[1])/2;let t=0;for(let i=0;ie.symbol.open,h.high=e=>e.symbol.high,h.low=e=>e.symbol.low,h.close=e=>e.symbol.close,h.hl2=e=>(e.symbol.high+e.symbol.low)/2,h.hlc3=e=>(e.symbol.high+e.symbol.low+e.symbol.close)/3,
h.ohlc4=e=>(e.symbol.open+e.symbol.high+e.symbol.low+e.symbol.close)/4,h.volume=e=>e.symbol.volume,h.updatetime=e=>e.symbol.updatetime,h.time=e=>e.symbol.bartime(),h.period=e=>e.symbol.period,h.tickerid=e=>e.symbol.tickerid,h.currencyCode=e=>e.symbol.currencyCode,h.unitId=e=>e.symbol.unitId,h.ticker=e=>e.symbol.ticker,h.interval=e=>e.symbol.interval,h.isdwm=e=>e.symbol.isdwm(),h.isintraday=e=>!e.symbol.isdwm(),h.isdaily=e=>"D"===e.symbol.resolution,h.isweekly=e=>"W"===e.symbol.resolution,h.ismonthly=e=>"M"===e.symbol.resolution,h.year=(e,t)=>h.timepart(e.symbol,n.YEAR,t),h.month=(e,t)=>h.timepart(e.symbol,n.MONTH,t),h.weekofyear=(e,t)=>h.timepart(e.symbol,n.WEEK_OF_YEAR,t),h.dayofmonth=(e,t)=>h.timepart(e.symbol,n.DAY_OF_MONTH,t),h.dayofweek=(e,t)=>h.timepart(e.symbol,n.DAY_OF_WEEK,t),h.hour=(e,t)=>h.timepart(e.symbol,n.HOUR_OF_DAY,t),h.minute=(e,t)=>h.timepart(e.symbol,n.MINUTE,t),h.second=(e,t)=>h.timepart(e.symbol,n.SECOND,t),h.add_days_considering_dst=(e,t,i)=>(0,n.add_days_considering_dst)((0,n.get_timezone)(e),t,i),h.add_years_considering_dst=(e,t,i)=>(0,n.add_years_considering_dst)((0,n.get_timezone)(e),t,i),h.selectSessionBreaks=(e,t)=>{if(h.isdwm(e)||void 0===e.symbol.session.timezone)return[];const i=(0,s.newBarBuilder)(e.symbol.period,e.symbol.session,null),n=[],o=t.length;if(i.moveTo(t[o-1]),1===o&&i.startOfBar(0)===t[0])n.push(t[0]);else{for(let e=o-2;e>=0;--e){const s=t[e];if(s>=i.startOfBar(0))continue;i.moveTo(s);const o=t[e+1];n.push(o)}n.reverse()}return n},h.selectPreAndPostMarketTimes=(e,t)=>{if(h.isdwm(e)||void 0===e.symbol.session.timezone)return{preMarket:[],postMarket:[]};return new o(e.symbol.session.timezone,e.symbol.preMarketSubsession??null,e.symbol.postMarketSubsession??null).getPreAndPostMarketTimes(t)},h.iff=(e,t,i)=>h.not(e)?i:t,h.rising=(e,t)=>{for(let i=1;ie.get(0))return 0;return 1},h.falling=(e,t)=>{for(let i=1;i{const s=(0,n.utc_to_cal)(e.session.timezone,i||e.bartime());return(0,n.get_part)(s,t)},h.rsi=(e,t)=>h.isZero(t)?100:h.isZero(e)?0:100-100/(1+e/t),h.sum=(e,t,i)=>{const s=i.new_var(),n=h.nz(e.get())+h.nz(s.get(1))-h.nz(e.get(t));return s.set(n),n},h.sma=(e,t,i)=>{const s=h.sum(e,t,i);return h.na(e.get(t-1))?NaN:s/t},h.smma=(e,t,i)=>{const s=i.new_var(e),n=h.sma(s,t,i),o=i.new_var(),r=(o.get(1)*(t-1)+e)/t;return o.set(h.na(o.get(1))?n:r),o.get(0)},h.rma=(e,t,i)=>{const s=h.sum(e,t,i),n=t-1,o=e.get(n),r=i.new_var(),a=r.get(1),l=e.get(),c=h.na(o)?NaN:h.na(a)?s/t:(l+a*n)/t;return r.set(c),c},h.fixnan=(e,t)=>{const i=t.new_var();return isNaN(e)?i.get(1):(i.set(e),e)},h.tr=(e,t)=>{let i=t.new_var(h.close(t)).get(1);return e&&isNaN(i)&&(i=h.close(t)),h.max(h.max(h.high(t)-h.low(t),h.abs(h.high(t)-i)),h.abs(h.low(t)-i))},h.atr=(e,t)=>{const i=t.new_var(h.tr(void 0,t));return h.rma(i,e,t)},h.ema=(e,t,i)=>{const s=h.sum(e,t,i),n=i.new_var(),o=e.get(0),r=e.get(t-1),a=n.get(1),l=h.na(r)?NaN:h.na(a)?s/t:2*(o-a)/(t+1)+a;return n.set(l),l},h.wma=(e,t,i)=>{let s=0;for(let i=t=Math.round(t);i>=0;i--){
s+=(t-i)*e.get(i)}return 2*s/(t*(t+1))},h.vwma=(e,t,i)=>{const s=i.new_var(h.volume(i)),n=i.new_var(e.get(0)*h.volume(i));return h.sma(n,t,i)/h.sma(s,t,i)},h.swma=(e,t)=>(e.get(0)+2*e.get(1)+2*e.get(2)+e.get(3))/6,h.supertrend=(e,t,i)=>{const s=h.atr(t,i),n=i.new_var(s).get(1),o=h.hl2(i);let r=o+s*e,a=o-s*e;const l=h.close(i),c=i.new_var(l).get(1),d=i.new_var(),u=h.nz(d.get(1)),_=i.new_var(),p=h.nz(_.get(1));a=h.gt(a,u)||h.lt(c,u)?a:u,d.set(a),r=h.lt(r,p)||h.gt(c,p)?r:p,_.set(r);let m=h.na();const g=i.new_var(),f=g.get(1);m=h.na(n)?1:f===p?l>r?-1:1:l-d(e,t,0,((e,t)=>h.lt(e,t)),Number.MAX_VALUE).index,h.lowest=(e,t,i)=>d(e,t,0,((e,t)=>h.lt(e,t)),Number.MAX_VALUE).value,h.highestbars=(e,t,i)=>-d(e,t,0,((e,t)=>h.gt(e,t)),Number.MIN_VALUE).index,h.highest=(e,t,i)=>d(e,t,0,((e,t)=>h.gt(e,t)),Number.MIN_VALUE).value,h.cum=(e,t)=>{const i=t.new_var(),s=h.nz(i.get(1))+e;return i.set(s),s},h.accdist=e=>{const t=h.high(e),i=h.low(e),s=h.close(e),n=h.volume(e);return h.cum(s===t&&s===i||t===i?0:n*(2*s-i-t)/(t-i),e)},h.correlation=(e,t,i,s)=>{const n=h.sma(e,i,s),o=h.sma(t,i,s),r=s.new_var(e.get()*t.get());return(h.sma(r,i,s)-n*o)/Math.sqrt(h.variance2(e,n,i)*h.variance2(t,o,i))},h.stoch=(e,t,i,s,n)=>{const o=h.highest(t,s,n),r=h.lowest(i,s,n);return h.fixnan(100*(e.get()-r)/(o-r),n)},h.tsi=(e,t,i,s)=>{const n=s.new_var(h.change(e)),o=s.new_var(h.abs(h.change(e))),r=s.new_var(h.ema(n,i,s)),a=s.new_var(h.ema(o,i,s));return h.ema(r,t,s)/h.ema(a,t,s)},h.cross=(e,t,i)=>{if(isNaN(e)||isNaN(t))return!1;const s=i.new_var((n=e-t)<0?-1:0===n?0:1);var n;return!isNaN(s.get(1))&&s.get(1)!==s.get()},h.linreg=(e,t,i)=>{let s=0,n=0,o=0,r=0;for(let i=0;i{const n=s.new_var(),o=s.new_var(),r=s.new_var(),a=h.high(s),l=h.low(s),c=h.close(s),d=s.new_var(a),u=s.new_var(l),_=s.new_var(c),p=s.new_var();let m=p.get(1),g=o.get(1),f=r.get(1);o.set(g),r.set(f);let y=!1;const v=u.get(1),S=u.get(2),b=d.get(1),w=d.get(2),C=_.get(),P=_.get(1);2===h.n(s)&&(h.greater(C,P)?(n.set(1),r.set(d.get()),m=v,f=d.get()):(n.set(-1),r.set(u.get()),m=b,f=u.get()),y=!0,o.set(e),g=e);let T=m+g*(f-m);return 1===n.get()?h.greater(T,u.get())&&(y=!0,n.set(-1),T=Math.max(d.get(),r.get()),r.set(u.get()),o.set(e)):h.less(T,d.get())&&(y=!0,n.set(1),T=Math.min(u.get(),r.get()),r.set(d.get()),o.set(e)),y||(1===n.get()?h.greater(d.get(),r.get())&&(r.set(d.get()),o.set(Math.min(o.get()+t,i))):h.less(u.get(),r.get())&&(r.set(u.get()),o.set(Math.min(o.get()+t,i)))),1===n.get()?(T=Math.min(T,v),h.n(s)>2&&(T=Math.min(T,S))):(T=Math.max(T,b),h.n(s)>2&&(T=Math.max(T,w))),p.set(T),T},h.alma=(e,t,i,s)=>{const n=Math.floor(i*(t-1)),o=t/s*(t/s),r=[];let a=0;for(let e=0;ee.get()-e.get(1),h.roc=(e,t)=>{
const i=e.get(t);return 100*(e.get()-i)/i},h.dev=(e,t,i)=>{const s=h.sma(e,t,i);return h.dev2(e,t,s)},h.dev2=(e,t,i)=>{let s=0;for(let n=0;n{const s=h.variance(e,t,i);return h.sqrt(s)},h.variance=(e,t,i)=>{const s=h.sma(e,t,i);return h.variance2(e,s,t)},h.variance2=(e,t,i)=>{let s=0;for(let n=0;n{if(h.na(e.get(t-1)))return NaN;let i=0;const s=e.get();for(let n=1;n{if(void 0===e.symbol.session.timezone)return()=>!1;const t=(0,s.newBarBuilder)(e.symbol.period,e.symbol.session,null);return e=>t.indexOfBar(e)===r.SessionStage.POST_SESSION&&(t.moveTo(e),!0)},h.createNthBarInSessionCheck=e=>{if(void 0===e.symbol.session.timezone)return()=>!1;const t=(0,s.newBarBuilder)(e.symbol.period,e.symbol.session,null);return(e,i)=>(t.indexOfBar(e)===r.SessionStage.POST_SESSION&&t.moveTo(e),t.indexOfBar(e)===i)},h.error=e=>{throw new a.StudyError(e)},h.dmi=(e,t,i)=>{const s=i.new_var(h.high(i)),n=i.new_var(h.low(i)),o=h.change(s),r=-h.change(n),a=i.new_var(h.na(o)||h.na(r)?h.na():h.and(h.gt(o,r),h.gt(o,0))?o:0),l=i.new_var(h.na(r)?h.na():h.and(h.gt(r,o),h.gt(r,0))?r:0),c=h.atr(e,i),d=h.fixnan(100*h.rma(a,e,i)/c,i),u=h.fixnan(100*h.rma(l,e,i)/c,i);let _=d+u;h.isZero(_)&&(_+=1);const p=Math.abs(d-u)/_*100,m=i.new_var(p),g=h.rma(m,t,i),f=i.new_var(g);return[d,u,p,g,(f.get(0)+f.get(e-1))/2]},h.zigzag=(e,t,i)=>new m(e,t,i).lastPrice(),h.zigzagbars=(e,t,i)=>{const s=new m(e,t,i);return-1===s.lastIndex()?NaN:s.lastIndex()-h.n(i)};const u=0,_=1;class p{constructor(e,t,i,s,n){this._areaRight=e,this._areaLeft=t,this._pivotType=i,this._series=s,this._currentIndex=n.new_var(0),this._currentValue=n.new_var(NaN),this._pivotIndex=n.new_var(-1),this._index=h.n(n),this._isNewBar=n.symbol.isNewBar;const o=this._currentIndex.get(1),r=this._currentValue.get(1),a=this._pivotIndex.get(1);this._index>1&&(this._currentIndex.set(o),this._currentValue.set(r),this._pivotIndex.set(a))}isPivotFound(){return-1!==this._pivotIndex.get()}pivotIndex(){return this._pivotIndex.get()}currentValue(){return this._currentValue.get()}pivotType(){return this._pivotType}reset(){this._currentValue.set(NaN),this._currentIndex.set(0),this._pivotIndex.set(-1)}isRightSideOk(e){return e-this._currentIndex.get()===this._areaRight}isViolate(e,t){if(e<1||isNaN(this._currentValue.get()))return!0;const i=this._series.get(this._index-e);return!!isNaN(i)||(i===this._currentValue.get()?t:this._pivotType===_?i>this._currentValue.get():ithis._areaRight}update(){if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){let e=!0
;for(let t=0;t1&&this.addPivot(o,r,a),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}addPivot(e,t,i){this._lastIndex.set(e),this._lastVal.set(t),this._lastType.set(i)}updatePivot(e,t){this._lastIndex.set(e),this._lastVal.set(t)}lastPrice(){return this._lastVal.get()}lastIndex(){return this._lastIndex.get()}addPoint(e,t,i){if(isNaN(this._lastVal.get()))return void this.addPivot(e,t,i);const s=this._lastVal.get();if(this._lastType.get()===i){return void((i===_?t>s:tthis._deviation&&this.addPivot(e,t,i)}processPivot(e){e.update(),this._isBarClosed&&e.isPivotFound()&&this.addPoint(e.pivotIndex(),e.currentValue(),e.pivotType())}}},46367:(e,t,i)=>{"use strict";i.d(t,{anchoredVWAPStudyItem:()=>r});const s={_metainfoVersion:51,description:"Anchored VWAP",shortDescription:"Anchored VWAP",format:{type:"inherit"},id:"AnchoredVWAP@tv-basicstudies-1",is_hidden_study:!0,is_price_study:!0,defaults:{areaBackground:{backgroundColor:"#4caf50",fillBackground:!0,transparency:95},filledAreasStyle:{Background_1:{fillType:void 0,color:"#4caf50",transparency:95,visible:!0}},inputs:{start_time:0,"Bands Calculation Mode":"Standard Deviation",bands_multiplier:1,bands_multiplier_2:2,bands_multiplier_3:3,calculate_stDev:!0,calculate_stDev_2:!1,calculate_stDev_3:!1,source:"hlc3"},styles:{VWAP:{color:"#1e88e5",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,display:15},LowerBand:{display:15,color:"#4caf50",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},LowerBand_2:{display:15,color:"#808000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},LowerBand_3:{display:15,color:"#00897b",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},UpperBand:{display:15,color:"#4caf50",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},UpperBand_2:{display:15,color:"#808000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0},UpperBand_3:{display:15,color:"#00897b",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0}}},inputs:[{defval:0,id:"start_time",isHidden:!0,max:Number.MAX_SAFE_INTEGER,min:-Number.MAX_SAFE_INTEGER,name:"Start time",type:"time"},{defval:"Standard Deviation",group:"Bands Settings",id:"Bands Calculation Mode",
name:"Bands Calculation Mode",options:["Standard Deviation","Percentage"],tooltip:"Determines the units used to calculate the distance of the bands. When 'Percentage' is selected, a multiplier of 1 means 1%.",type:"text",display:15},{defval:!0,group:"Bands Settings",id:"calculate_stDev",inline:"band_1",name:" ",type:"bool",display:0},{defval:1,group:"Bands Settings",id:"bands_multiplier",inline:"band_1",max:Number.MAX_VALUE,min:0,name:"Bands Multiplier #1",step:.5,type:"float",display:15},{defval:!1,group:"Bands Settings",id:"calculate_stDev_2",inline:"band_2",name:" ",type:"bool",display:0},{defval:2,group:"Bands Settings",id:"bands_multiplier_2",inline:"band_2",max:Number.MAX_VALUE,min:0,name:"Bands Multiplier #2",step:.5,type:"float",display:15},{defval:!1,group:"Bands Settings",id:"calculate_stDev_3",inline:"band_3",name:" ",type:"bool",display:0},{defval:3,group:"Bands Settings",id:"bands_multiplier_3",inline:"band_3",max:Number.MAX_VALUE,min:0,name:"Bands Multiplier #3",step:.5,type:"float",display:15},{defval:"hlc3",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"source"}],plots:[{id:"VWAP",type:"line"},{id:"UpperBand",type:"line"},{id:"LowerBand",type:"line"},{id:"UpperBand_2",type:"line"},{id:"LowerBand_2",type:"line"},{id:"UpperBand_3",type:"line"},{id:"LowerBand_3",type:"line"}],styles:{VWAP:{histogramBase:0,title:"VWAP"},LowerBand:{histogramBase:0,title:"Lower Band #1"},LowerBand_2:{histogramBase:0,title:"Lower Band #2"},LowerBand_3:{histogramBase:0,title:"Lower Band #3"},UpperBand:{histogramBase:0,title:"Upper Band #1"},UpperBand_2:{histogramBase:0,title:"Upper Band #2"},UpperBand_3:{histogramBase:0,title:"Upper Band #3"}},filledAreas:[{title:"Background #1",id:"Background_1",objAId:"UpperBand",objBId:"LowerBand",type:"plot_plot"}],area:[{name:"UpperBand",visible:!0},{name:"LowerBand",visible:!0}]};var n=i(50151),o=i(73772);const r={name:"Anchored VWAP",metainfo:s,constructor:class{constructor(){this._isNewSession=null,this._firstBarTime=0}init(e,t){this._firstBarTime=t(0),this._isNewSession=null}main(e,t,i){if(void 0===i)return[NaN];(0,n.assert)(e.symbol.time===i.time);const s=i.time;if(s&&s{"use strict";i.d(t,{OHLCV:()=>n});var s=i(73772);class n{main(e){
return[s.Std.open(e),s.Std.high(e),s.Std.low(e),s.Std.close(e),s.Std.volume(e),s.Std.updatetime(e),void 0,void 0,void 0,void 0]}}},69146:(e,t,i)=>{"use strict";i.d(t,{pivotPointsStandardStudyItem:()=>_});var s,n,o=i(85049),r=i(67153),a=i(73772);!function(e){e[e.TRADITIONAL=0]="TRADITIONAL",e[e.FIBONACCI=1]="FIBONACCI",e[e.WOODIE=2]="WOODIE",e[e.CLASSIC=3]="CLASSIC",e[e.DEMARK=4]="DEMARK",e[e.CAMARILLA=5]="CAMARILLA",e[e.FLOOR=6]="FLOOR"}(s||(s={})),function(e){e.AUTO="Auto",e.DAILY="Daily",e.WEEKLY="Weekly",e.MONTHLY="Monthly",e.YEARLY="Yearly"}(n||(n={}));class l{constructor(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}}class c{constructor(){this.pivots=[]}}function h(e,t){e.setUTCMonth(e.getUTCMonth()+t)}function d(e,t){if(a.Std.ismonthly(e)){let i=new Date(t);return i.getUTCDay()=1&&t.multiplier()<=15?"1D":"1W";case o.ResolutionKind.Seconds:case o.ResolutionKind.Ticks:return"1D"}throw new Error("Unexpected resolution type: "+e.symbol.resolution)}(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw new Error("No such pivTimeFrame: "+t)}}const _={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla","Floor"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:1,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots",format:{type:"price",precision:4}},constructor:class{constructor(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}init(e,t){const i=t(0),s=t(1),n=t(2),o=t(3);this._data=new c,this._firstMainSeriesBarTime=NaN,this._kindPP=function(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;case"Floor":return 6;default:
throw new Error("Unknown kind "+e)}}(i),this._showHistoricalPivots=s,this._historicalPivotsToKeep=o,this._pivTimeFrame=n,this._isValidResolution=function(e,t){return!(a.Std.isdaily(e)&&"Daily"===t||a.Std.isweekly(e)&&("Daily"===t||"Weekly"===t)||a.Std.ismonthly(e)&&("Daily"===t||"Weekly"===t||"Monthly"===t))}(e,this._pivTimeFrame),this._isValidResolution||a.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=u(e,this._pivTimeFrame),void 0!==e.symbol.info&&(0,r.findSuitableResolutionToBuildFrom)(this._secondaryRes,e.symbol.info).error&&(this._isValidResolution=!1,a.Std.error(`Resolution ${this._secondaryRes} is not supported for this symbol`))),e.new_sym(e.symbol.tickerid,this._secondaryRes)}main(e,t,i){if(!this._isValidResolution)return null;if(e.is_main_symbol(i))return isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null;e.select_sym(1);const s=e.new_var(a.Std.open(e)),n=e.new_var(a.Std.high(e)),o=e.new_var(a.Std.low(e)),r=e.new_var(a.Std.close(e)),c=e.new_var(a.Std.time(e)),h=this._data,u=s.get(0),_=c.get(0),p=s.get(1),m=n.get(1),g=o.get(1),f=r.get(1),y=e.symbol.isLastBar;if(0!==h.pivots.length&&e.symbol.isNewBar){const e=h.pivots[h.pivots.length-1];e.endIndex__t!==_&&(e.endIndex__t=_)}if(0===e.symbol.index||!e.symbol.isNewBar)return e.select_sym(0),null;const v=function(e,t,i,s,n,o,r,c){const h=new l;let d=NaN;const u=i-s;switch(c){case 0:d=(i+s+n)/3,h.p=d,h.r1=2*d-s,h.s1=2*d-i,h.r2=d+(i-s),h.s2=d-(i-s),h.r3=2*d+(i-2*s),h.s3=2*d-(2*i-s),h.r4=3*d+(i-3*s),h.s4=3*d-(3*i-s),h.r5=4*d+(i-4*s),h.s5=4*d-(4*i-s);break;case 1:d=(i+s+n)/3,h.p=d,h.r1=d+.382*u,h.s1=d-.382*u,h.r2=d+.618*u,h.s2=d-.618*u,h.r3=d+u,h.s3=d-u;break;case 2:d=(i+s+2*e)/4,h.p=d,h.r1=2*d-s,h.s1=2*d-i,h.r2=d+u,h.s2=d-u,h.r3=i+2*(d-s),h.s3=s-2*(i-d),h.r4=h.r3+u,h.s4=h.s3-u;break;case 3:d=(i+s+n)/3,h.p=d,h.r1=2*d-s,h.s1=2*d-i,h.r2=d+u,h.s2=d-u,h.r3=d+2*u,h.s3=d-2*u,h.r4=d+3*u,h.s4=d-3*u;break;case 4:let o=NaN;o=a.Std.equal(t,n)?i+s+2*n:a.Std.greater(n,t)?2*i+s+n:2*s+i+n,d=o/4,h.p=d,h.r1=o/2-s,h.s1=o/2-i;break;case 5:d=(i+s+n)/3,h.p=d,h.r1=n+1.1*u/12,h.s1=n-1.1*u/12,h.r2=n+1.1*u/6,h.s2=n-1.1*u/6,h.r3=n+1.1*u/4,h.s3=n-1.1*u/4,h.r4=n+1.1*u/2,h.s4=n-1.1*u/2;break;case 6:d=(i+s+n)/3,h.p=d,h.r1=2*d-s,h.s1=2*d-i,h.r2=d+(i-s),h.s2=d-(i-s),h.r3=d-h.s1+h.r2,h.s3=2*d-(2*i-s);break;default:throw new Error("Unknown kind")}return h.startIndex__t=o,h.endIndex__t=r,h}(u,p,m,g,f,_,d(e,_),this._kindPP);return e.select_sym(0),this._showHistoricalPivots||(h.pivots=[]),h.pivots.push(v),h.pivots.length>this._historicalPivotsToKeep&&h.pivots.shift(),y?this._createResponse():null}_createResponse(){return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}}_removeUnusedPivots(){const e=Math.max(this._data.pivots.findIndex((e=>e.startIndex__t>this._firstMainSeriesBarTime))-1,0);e>0&&this._data.pivots.splice(0,e)}}}},15497:(e,t,i)=>{"use strict";i.d(t,{
ratioStudyItem:()=>o});var s=i(62473);class n extends s.SpreadRatioBase{_doCalculation(e,t,i,s){return e*t/(i*s)}}const o={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:s.spreadRatioDefaults,plots:s.spreadRatioPlots,styles:s.spreadRatioStyles,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:s.spreadRatioInputs,id:"Ratio@tv-basicstudies-1",format:{type:"price",precision:2}},constructor:n}},65498:(e,t,i)=>{"use strict";i.d(t,{regressionTrendStudyItem:()=>o});var s=i(73772);function n(e,t,i){const n={slope:NaN,average:NaN,intercept:NaN,stdDev:NaN,upDev:NaN,downDev:NaN,pearsons:NaN};return 0===e.length||(function(e,t){let i=0,s=0,n=0,o=0;for(let t=0;to&&(o=u),u=d-i[s],u>r&&(r=u),u=e[s];const p=u-n.average,m=d-_;u-=d,a+=u*u,l+=p*p,c+=m*m,h+=p*m,d+=n.slope}n.stdDev=Math.sqrt(a/(0===u?1:u)),n.pearsons=s.Std.isZero(l)||s.Std.isZero(c)?0:h/Math.sqrt(l*c),n.upDev=o,n.downDev=r}(e,t,i,n)),n}const o={name:"Regression Trend",metainfo:{_metainfoVersion:51,description:"Regression Trend",format:{type:"inherit"},id:"RegressionTrend@tv-basicstudies-144",is_hidden_study:!0,is_price_study:!0,shortDescription:"Reg Trend",defaults:{inputs:{"first bar time":0,"last bar time":0,"lower diviation":-2,source:"close","upper diviation":2,"use lower diviation":!0,"use upper diviation":!0},styles:{}},inputs:[{defval:2,id:"upper diviation",max:500,min:-500,name:"Upper Deviation",type:"float"},{defval:-2,id:"lower diviation",max:500,min:-500,name:"Lower Deviation",type:"float"},{defval:!0,id:"use upper diviation",name:"Use Upper Deviation",type:"bool"},{defval:!0,id:"use lower diviation",name:"Use Lower Deviation",type:"bool"},{defval:0,id:"first bar time",isHidden:!0,max:253370764800,min:-253370764800,name:"First bar time",type:"time"},{defval:0,id:"last bar time",isHidden:!0,max:253370764800,min:-253370764800,name:"Last bar time",type:"time"},{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"source"}],plots:[]},constructor:class{constructor(){this._resultSent=!1}init(e,t){this._resultSent=!1,this._data={baseLine:{startPrice:NaN,endPrice:NaN},upLine:{startPrice:NaN,endPrice:NaN},downLine:{startPrice:NaN,endPrice:NaN},pearsons:NaN,startIndex__t:NaN,endIndex__t:NaN}}main(e,t){const i=t(6),o=e.new_unlimited_var(s.Std.time(e)),r=e.new_unlimited_var(s.Std.high(e)),a=e.new_unlimited_var(s.Std.low(e)),l=e.new_unlimited_var(s.Std[i](e));if(!e.symbol.isLastBar)return null;if(this._resultSent)return null;const c=t(0),h=t(1),d=t(2),u=t(3),_=t(4),p=t(5),m=o.indexOf(_),g=o.indexOf(p),f=[],y=[],v=[],S=[];for(let e=m;e>=g;--e)f.push(o.get(e)),y.push(r.get(e)),v.push(a.get(e)),S.push(l.get(e));return this._updateData(f,d,c,u,h,_,p,n(S,y,v)),this._resultSent=!0,{
type:"non_series_data",nonseries:!0,data:{data:this._data}}}_updateData(e,t,i,s,n,o,r,a){const l=e.length-1;this._data.baseLine.startPrice=a.intercept,this._data.baseLine.endPrice=a.intercept+a.slope*l;const c=a.intercept+(t?a.stdDev*i:a.upDev);this._data.upLine.startPrice=c,this._data.upLine.endPrice=c+a.slope*l;const h=a.intercept+(s?a.stdDev*n:-a.downDev);this._data.downLine.startPrice=h,this._data.downLine.endPrice=h+a.slope*l,this._data.pearsons=a.pearsons,this._data.startIndex__t=o,this._data.endIndex__t=r}}}},62473:(e,t,i)=>{"use strict";i.d(t,{SpreadRatioBase:()=>l,spreadRatioDefaults:()=>c,spreadRatioFilledAreas:()=>p,spreadRatioInputs:()=>h,spreadRatioPalettes:()=>_,spreadRatioPlots:()=>d,spreadRatioStyles:()=>u});var s=i(19625),n=i(94113),o=i(73772),r=i(19063);const a="rgba(0, 0, 0, 0)";class l{init(e,t){e.new_sym(t(1),o.Std.period(e)),this._source=t(0),this._scaleFactor1=1,this._scaleFactor2=1}main(e,t){const i=e.symbol.time,s=o.Std[this._source](e);e.select_sym(1);const n=o.Std[this._source](e),r=e.new_unlimited_var(n),a=e.new_unlimited_var(e.symbol.time);if(e.select_sym(0),isNaN(i))return null;let l=a.indexOf(i);-1!==l&&a.get(l)!==i&&(l=-1);const c=l<0?NaN:r.get(l),h=this._doCalculation(this._scaleFactor1,s,this._scaleFactor2,c);return[h,0,o.Std.ge(h,0),o.Std.lt(h,0)]}}const c={styles:{plot1:{linestyle:0,linewidth:2,plottype:n.LineStudyPlotStyle.Line,trackPrice:!1,transparency:35,color:"#800080",display:15},plotBaseline:{linestyle:0,linewidth:2,plottype:n.LineStudyPlotStyle.Line,trackPrice:!1,transparency:0,color:a,display:0}},palettes:{negativePalette:{colors:[{color:(0,r.applyAlpha)((0,s.getHexColorByName)("color-ripe-red-500"),.5),style:0,width:0},{color:a,style:0,width:0}]},positivePalette:{colors:[{color:(0,r.applyAlpha)((0,s.getHexColorByName)("color-minty-green-500"),.5),style:0,width:0},{color:a,style:0,width:0}]}},filledAreasStyle:{negativeFill:{color:"",transparency:0,visible:!0,fillType:void 0},positiveFill:{color:"",transparency:0,visible:!0,fillType:void 0}},precision:2,inputs:{source:"close",symbol2:""}},h=[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol2",name:"Symbol",type:"symbol",confirm:!0}],d=[{id:"plot1",type:"line"},{id:"plotBaseline",type:"line"},{id:"plotNegativeFill",type:"colorer",target:"negativeFill",palette:"negativePalette"},{id:"plotPositiveFill",type:"colorer",target:"positiveFill",palette:"positivePalette"}],u={plot1:{title:"Plot",histogramBase:0},plotBaseline:{title:"Baseline",isHidden:!0}},_={negativePalette:{valToIndex:{0:0,1:1},colors:[{name:"Color"}]},positivePalette:{valToIndex:{0:0,1:1},colors:[{name:"Color"}]}},p=[{id:"negativeFill",objAId:"plot1",objBId:"plotBaseline",type:"plot_plot",title:"Negative fill",palette:"negativePalette",fillToIntersection:!0},{id:"positiveFill",objAId:"plot1",objBId:"plotBaseline",type:"plot_plot",title:"Positive fill",palette:"positivePalette",fillToIntersection:!0}]},68563:(e,t,i)=>{"use strict";i.d(t,{spreadStudyItem:()=>o});var s=i(62473)
;class n extends s.SpreadRatioBase{_doCalculation(e,t,i,s){return e*t-i*s}}const o={name:"Spread",metainfo:{_metainfoVersion:15,defaults:s.spreadRatioDefaults,plots:s.spreadRatioPlots,styles:s.spreadRatioStyles,palettes:s.spreadRatioPalettes,filledAreas:s.spreadRatioFilledAreas,description:"Spread",shortDescription:"Spread",is_price_study:!1,inputs:s.spreadRatioInputs,id:"Spread@tv-basicstudies-1",format:{type:"price",precision:2}},constructor:n}},56209:(e,t,i)=>{"use strict";i.d(t,{VbPCheckHaveVolumeExpr:()=>n});var s=i(73772);class n{constructor(e){this._haveAnyVolume=!1,this._isDisabled=!1,this._seriesGetter=e}update(e,t){if(this._haveAnyVolume||this._isDisabled)return;const i=this._seriesGetter.volume().get(e);0!==i&&Number.isFinite(i)&&(this._haveAnyVolume=!0),t&&(this._haveAnyVolume||s.Std.error("The data vendor doesn't provide volume data for this symbol."),this._isDisabled=!0)}}},43789:(e,t,i)=>{"use strict";i.d(t,{VolumeByPriceExpr:()=>g});var s=i(50151),n=i(9859),o=i(85049),r=i(41978);class a extends r.GraphicsObj{constructor(e,t,i,n,o,r){super(e),(0,s.assert)(t({index:e.index,offset:e.offset,level:e.level})))}}}class p extends r.GraphicsObj{constructor(e,t,i,s,n=!1,o=!1){super(e),this._endIndex=this._mixinJSONObject.createTimeField(i,"endIndex"),this._extendLeft=this._mixinJSONObject.createField(n,"extendLeft"),this._extendRight=this._mixinJSONObject.createField(o,"extendRight"),this._level=this._mixinJSONObject.createDoubleField(s,"level"),this._startIndex=this._mixinJSONObject.createTimeField(t,"startIndex")}isNaN(){return super.isNaN()||Number.isNaN(this._level.get())||this._startIndex.get()<0||this._endIndex.get()<0||this._startIndex.get()===this._endIndex.get()&&!this._extendLeft.get()&&!this._extendRight.get()}jsonName(){return"horizlines"}primitiveData(){return{id:this.id(),startIndex:this._startIndex.get(),endIndex:this._endIndex.get(),extendLeft:this._extendLeft.get(),extendRight:this._extendRight.get(),level:this._level.get()}}startIndex(){return this._startIndex.get()}setStartIndex(e){this._startIndex.set(e)&&this._processObjUpdate()}endIndex(){return this._endIndex.get()}setEndIndex(e){this._endIndex.set(e)&&this._processObjUpdate()}level(){return this._level.get()}setLevel(e){this._level.set(e)&&this._processObjUpdate()}isExtendLeft(){return this._extendLeft.get()}setExtendLeft(e){this._extendLeft.set(e)&&this._processObjUpdate()}extendLeft(){return this.isExtendLeft()}isExtendRight(){return this._extendRight.get()}setExtendRight(e){this._extendRight.set(e)&&this._processObjUpdate()}extendRight(){return this.isExtendRight()}}!function(e){e[e.AssertAccuracy=.05]="AssertAccuracy"}(l||(l={})),function(e){e[e.START=0]="START",e[e.END=1]="END"}(c||(c={}));class m{constructor(){this._map=new Map}get(e){const t=this._innerMap(e.start);return t&&t.get(e.end)}set(e,t){this._innerMap(e.start,!0).set(e.end,t)}clear(){this._map.clear()}size(){let e=0;return this._map.forEach((t=>e+=t.size)),e}_innerMap(e,t){let i=this._map.get(e);return void 0===i&&t&&(i=new Map,this._map.set(e,i)),i}}class g{constructor(e,t,i,n,o,r,a,l,c,d,u,_,p,g,f){this._freezedBoxes=new h.GraphicsList,this._freezedHists=new h.GraphicsList,this._freezedPocs=new h.GraphicsList,this._freezedVAHists=new h.GraphicsList,this._currentHistsGr=new h.GraphicsList,this._currentVAHistsGr=new h.GraphicsList,this._currentHists=[],this._currentHistsMap=new m,this._currentBox=null,this._currentPoc=null,this._historyBarSet=[],this._prevRtBar=null,this._minPrice=Number.POSITIVE_INFINITY,
this._maxPrice=Number.NEGATIVE_INFINITY,this._leftBoxTime=null,this._rightBoxTime=null,this._actualRightBoxTime=null,this._needRecalc=!1,this._largestHistItem=null,this._rowsLayout=null,this._currentVAStart=0,this._currentVAEnd=0,this._previousVAStart=0,this._previousVAEnd=0,this._idsGenerator=null,(0,s.assert)(1===e||2===e),this._numOfSubHists=e,this._outHists=n,this._outBoxLines=o,this._outPocLines=r,this._extendPocLeftRight=a,this._outVAHists=l,this._vaVolumePercent=c,this._rowsLayoutSupplier=d,this._outHists.addStable(this._freezedHists),this._outVAHists.addStable(this._freezedVAHists),this._maxHHistItems=u,this._layoutIsAutoselected=g,this._leftBoxTimeMutable=_,this._rightBoxTimeMutable=p,this._actualRightBoxTime=f??p,this._ctx=t,this._seriesGetter=i}update(e){this._supplyRowsLayout(this._ctx),null===this._currentBox&&this._initCurrentBox(),null===this._currentPoc&&this._initCurrentPoc();const t=this._timeScale().get(e);this._leftBoxTime=this._leftBoxTimeMutable,this._rightBoxTime=this._rightBoxTimeMutable,this._ctx.symbol.isLastBar&&!Number.isNaN(this._rightBoxTime)&&(this._rightBoxTime=Math.min(t+o.Interval.parse(this._ctx.symbol.interval+this._ctx.symbol.resolution).inMilliseconds(t)-1,this._rightBoxTime));const i=d.Std.greaterOrEqual(this._seriesClose().get(e),this._seriesOpen().get(e)),s={high:this._seriesHigh().get(e),low:this._seriesLow().get(e),volume:this._seriesVol().get(e),isUp:i,time:t};this._updateCurrentHistogram(s),this._currentHists.length>0&&(this._largestHistItem=this._getLargestHistItem(),this._updateCurrentPoc(),this._seriesGetter.developingPoc().set(this._currentPoc.level()),this._updateValueArea(),this._vaVolumePercent>0&&(this._seriesGetter.developingVAHigh().set(this._currentHists[this._currentVAEnd].priceHigh()),this._seriesGetter.developingVALow().set(this._currentHists[this._currentVAStart].priceLow()))),this._updateCurrentBox(),this._rebuildOutData()}setIdsGeneratorProxy(e){this._idsGenerator=e}nextGraphicsObjId(){return(0,s.ensureNotNull)(this._idsGenerator).nextGraphicsObjId()}pushEraseObjCmd(e,t){(0,s.ensureNotNull)(this._idsGenerator).pushEraseObjCmd(e,t)}popEraseCmds(){return(0,s.ensureNotNull)(this._idsGenerator).popEraseCmds()}_timeScale(){return this._seriesGetter.time()}_seriesLow(){return this._seriesGetter.low()}_seriesHigh(){return this._seriesGetter.high()}_seriesVol(){return this._seriesGetter.volume()}_seriesOpen(){return this._seriesGetter.open()}_seriesClose(){return this._seriesGetter.close()}_freezeCurrentHistogramAndCleanup(){null!==this._currentBox&&this._freezedBoxes.add(this._currentBox),d.Std.greater(this._getVolume(this._currentHists),0)&&(this._freezedHists.addAll(this._currentHistsGr),this._freezedVAHists.addAll(this._currentVAHistsGr),null!==this._currentPoc&&this._freezedPocs.add(this._currentPoc)),this._currentHists=[],this._currentHistsGr.clear(),this._currentHistsMap.clear(),this._initCurrentBox(),this._initCurrentPoc(),this._currentVAHistsGr.clear(),this._historyBarSet=[],this._minPrice=Number.POSITIVE_INFINITY,this._maxPrice=Number.NEGATIVE_INFINITY,
this._prevRtBar=null,this._leftBoxTime=null,this._rightBoxTime=null}_supplyRowsLayout(e){null===this._rowsLayout&&e.symbol.isFirstBar&&e.symbol.isNewBar&&(this._rowsLayout=this._rowsLayoutSupplier())}_updateCurrentHistogram(e){if(this._needRecalc=!1,d.Std.greater(this._minPrice,e.low)&&(this._minPrice=e.low,this._needRecalc=!0),d.Std.less(this._maxPrice,e.high)&&(this._maxPrice=e.high,this._needRecalc=!0),this._ctx.symbol.isBarClosed&&this._historyBarSet.length>0){const t=this._historyBarSet[this._historyBarSet.length-1];t.time===e.time&&(this._prevRtBar=t,this._historyBarSet.pop())}this._needRecalc&&0===(0,s.ensureNotNull)(this._rowsLayout).type()?(this._recalculateCurrentResultsOnHistoryBarSet(),this._applyUpdateToCurrentResults(e,!1)):this._applyUpdateToCurrentResults(e,!0),this._ctx.symbol.isBarClosed?((0,s.assert)(null===this._prevRtBar||e.time===this._prevRtBar.time),this._historyBarSet.push(e),this._prevRtBar=null):this._prevRtBar=e}_getMidLevel(e){return(e.priceHigh()+e.priceLow())/2}_getMidLevelFromList(e){return e.length%2==0?e[e.length/2].priceLow():this._getMidLevel(e[Math.floor(e.length/2)])}_getLargestHistItem(){let e=[],t=this._currentHists[0];for(const i of this._currentHists)d.Std.greater(i.ratesSum(),t.ratesSum())?(t=i,e=[t]):d.Std.equal(i.ratesSum(),t.ratesSum())&&e.push(i);if(e.length>1){const i=this._getMidLevelFromList(this._currentHists);t=e[e.length-1];for(let s=e.length-2;s>=0;s--){const n=e[s];d.Std.lessOrEqual(Math.abs(this._getMidLevel(n)-i),Math.abs(this._getMidLevel(t)-i))&&(t=n)}}return t}_initCurrentPoc(){this._currentPoc=new p(this,0,0,0)}_updateCurrentPoc(){const e=(0,s.ensureNotNull)(this._currentPoc);e.setStartIndex((0,s.ensureNotNull)(this._leftBoxTime)),e.setEndIndex((0,s.ensureNotNull)(this._actualRightBoxTime)),e.setExtendLeft(this._extendPocLeftRight),e.setExtendRight(this._extendPocLeftRight);const t=this._getMidLevel((0,s.ensureNotNull)(this._largestHistItem));e.setLevel(t)}_getVolume(e){let t=0;for(const i of e)t+=i.ratesSum();return t}_getPocHistItemIndex(){for(let e=0;e=0,`ERROR - PocHistItemIndex == ${e}`),this._currentVAStart=e-1,this._currentVAEnd=e+1;const t=this._getVolume(this._currentHists)*this._vaVolumePercent*.01;let i=this._currentHists[e].ratesSum(),n=0,o=null;for(;d.Std.lessOrEqual(i+n,t)&&(i+=n,0===o?--this._currentVAStart:1===o&&++this._currentVAEnd,-1!==this._currentVAStart||this._currentVAEnd!==this._currentHists.length);){let t,i;if(this._currentVAStart>-1)if(t=this._currentHists[this._currentVAStart].ratesSum(),this._currentVAEndthis._getMidLevel(this._currentHists[this._currentVAStart])&&e.priceLow()0&&(e=this._currentHists[0].priceLow(),t=this._currentHists[this._currentHists.length-1].priceHigh());const i=[],n=(0,s.ensureNotNull)(this._leftBoxTime),o=(0,s.ensureNotNull)(this._actualRightBoxTime);i.push(new u(n,e)),i.push(new u(n,t)),i.push(new u(o,t)),i.push(new u(o,e)),(0,s.ensureNotNull)(this._currentBox).setPoints(i)}_recalculateCurrentResultsOnHistoryBarSet(){for(let e=0;e0&&(this._largestHistItem=this._getLargestHistItem(),this._updateCurrentPoc()),this._updateCurrentBox()}_applyUpdateToCurrentResults(e,t){t&&null!==this._prevRtBar&&this._addHistoryBarToHistogram(this._prevRtBar,this._historyBarSet.length-1,this._currentHists,this._currentHistsMap,-1),this._addHistoryBarToHistogram(e,this._historyBarSet.length-1,this._currentHists,this._currentHistsMap,1),this._updateLastBarTimeInHistogram(this._currentHists)}_addHistoryBarToHistogram(e,t,i,n,o){(0,s.assert)(-1===o||1===o,"Please set sign argument either +1 or -1");const r=e.low,a=e.high,l=isNaN(e.volume)?0:e.volume,c=e.isUp,h=(0,s.ensureNotNull)(this._rowsLayout);h.init(this._ctx.symbol.minTick,this._minPrice,this._maxPrice,r,a);const u=h.rowWidth();if(!d.Std.greater(u,0))return;h.calculate();const _=h.getIndexLowVbP(),p=h.getIndexHighVbP(),m=h.getStartPrice();if(_===p){const e=_*u+m,t=(_+1)*u+m;this._updateResult({start:e,end:t},o*l,c,i,n)}else{let e=0;for(let t=_;t<=p;t++){
const s=t*u+m,h=(t+1)*u+m,d=this._rowCoeff(s,h,r,a),_=d*l;e+=d,this._updateResult({start:s,end:h},o*_,c,i,n)}(0,s.assert)(d.Std.equal(e,1,.05),`totalCoeff not equal 1! totalConf = ${e}`)}}_updateResult(e,t,i,n,o){const r=this._createRates(i,t);(0,s.assert)(null!==this._leftBoxTime,"leftBoxTime is not set (equals null)"),(0,s.assert)(null!==this._rightBoxTime,"rightBoxTime is not set (equals null)");const l=(0,s.ensureNotNull)(this._leftBoxTime),c=(0,s.ensureNotNull)(this._actualRightBoxTime);let h=o.get(e);if(void 0===h)h=new a(this,e.start,e.end,r,l,c),o.set(e,h),this._verifyHistogramSizeIsNotTooLarge(o.size()),this._currentHistsGr.add(h),g._addInOrder(h,n,0,n.length,((e,t)=>{let i=d.Std.compare(e.firstBarTime(),t.firstBarTime());return 0!==i?i:(i=d.Std.compare(e.priceLow(),t.priceLow()),0!==i?i:d.Std.compare(e.priceHigh(),t.priceHigh()))}));else{const e=[];for(let t=0;t0?g._addInOrder(e,t,r+1,s,o):t.splice(r,0,e)}}},7370:(e,t,i)=>{"use strict";i.d(t,{VolumeProfileBase:()=>p,maxHHistItems:()=>u,numOfSubHists:()=>_});var s,n=i(56570),o=i(85049);!function(e){e[e.NumberOfRows=0]="NumberOfRows",e[e.TicksPerRow=1]="TicksPerRow"}(s||(s={}));class r{constructor(e,t){this._minTick=NaN,this._minPrice=NaN,this._maxPrice=NaN,this._low=NaN,this._high=NaN,this._startPrice=NaN,this._indexLowVbP=NaN,this._indexHighVbP=NaN,this._rowSize=e,this._type=t}
init(e,t,i,s,n){this._minTick=e,this._minPrice=t,this._maxPrice=i,this._low=s,this._high=n}getStartPrice(){return this._startPrice}setStartPrice(e){this._startPrice=e}getIndexLowVbP(){return this._indexLowVbP}setIndexLowVbP(e){this._indexLowVbP=e}getIndexHighVbP(){return this._indexHighVbP}setIndexHighVbP(e){this._indexHighVbP=e}type(){return this._type}}class a extends r{constructor(e){super(e,0)}calculate(){this.setStartPrice(this._minPrice);const e=this.rowWidth();let t=Math.floor((this._low-this._minPrice)/e),i=Math.ceil((this._high-this._minPrice)/e)-1;t=Math.max(t,0),i=Math.max(i,0),i=Math.min(i,this._rowSize-1),t=Math.min(t,i),this.setIndexLowVbP(t),this.setIndexHighVbP(i)}rowWidth(){return Math.max((this._maxPrice-this._minPrice)/this._rowSize,this._minTick)}}class l extends r{constructor(e){super(e,1)}calculate(){this.setStartPrice(0);const e=this.rowWidth();let t=Math.floor(this._low/e);const i=Math.ceil(this._high/e)-1;t=Math.min(t,i),this.setIndexLowVbP(t),this.setIndexHighVbP(i)}rowWidth(){return this._minTick*this._rowSize}}var c,h=i(73772),d=i(39692);function u(){return 6e3}function _(e){switch(e){case"Delta":case"Up/Down":return 2;case"Total":return 1;default:h.Std.error(`Invalid study argument value: ${e}`)}}!function(e){e.VolumeUpDown="Up/Down",e.VolumeTotal="Total",e.VolumeDelta="Delta",e.NumberOfRows="Number Of Rows",e.TicksPerRow="Ticks Per Row"}(c||(c={}));class p{findBasicResolutionForFromTo(e,t,i,s){const r=(0,d.getVolumeProfileResolutionForPeriod)(e.value(),t,i,s),a=o.Interval.parse(r);return n.enabled("charting_library_debug_mode")&&console.log(`${(new Date).toISOString()} Selected resolution ${a.value()} for (${e.value()}, ${t}, ${i})`),a}verifyRowSizeInput(e,t){"Number Of Rows"===t&&e>6e3&&h.Std.error('Histogram is too large, please reduce "Row Size" input.')}_getRowsLayout(e,t){return"Number Of Rows"===e?new a(t):new l(t)}}},92245:(e,t,i)=>{"use strict";i.d(t,{volumeProfileFixedRangeBSStudyItem:()=>w,volumeProfileFixedRangeVbPStudyItem:()=>b});var s=i(50151),n=i(7370),o=i(94113),r=i(9233),a=i(85049),l=i(40878),c=i(45382),h=i(32569),d=i(61923),u=i(62628),_=i(56209),p=i(85904),m=i(43789);class g extends m.VolumeByPriceExpr{constructor(e,t,i,s,n,o,r,a,l,c,h,d,u){super(e,t,i,o,r,a,!1,l,c,(()=>h),d,s,n,!1,u),this._firstBarTime=s,this._lastBarTime=n}update(e){this._supplyRowsLayout(this._ctx),this.timeInRequestedRange(e)&&super.update(e)}timeInRequestedRange(e){const t=this._timeScale().get(e);return this._firstBarTime<=t&&t=this._firstBarTime){const e=this._developingPocSeries.getLeftOrEqual(o),t=this._developingVAHighSeries.getLeftOrEqual(o),i=this._developingVALowSeries.getLeftOrEqual(o);n.data.push([e,t,i])}else n.data.push([NaN,NaN,NaN])}return n}time(){return this._timeSeries}open(){return this._openSeries}high(){return this._highSeries}low(){return this._lowSeries}close(){return this._closeSeries}volume(){return this._volumeSeries}developingPoc(){return this._developingPocSeries}developingVAHigh(){return this._developingVAHighSeries}developingVALow(){return this._developingVALowSeries}}function S(e){return{constructor:v,name:e.description,metainfo:{_metainfoVersion:51,shortDescription:"VPFR",format:{type:"volume"},is_price_study:!0,defaults:{graphics:{hhists:{histBars2:{colors:["",""],direction:r.HHistDirection.LeftToRight,percentWidth:30,showValues:!1,transparencies:[76,76],valuesColor:"#424242",visible:!0},histBarsVA:{colors:["#1592e6","#fbc123"],direction:r.HHistDirection.LeftToRight,percentWidth:30,showValues:!1,transparencies:[30,30],valuesColor:"",visible:!0}},horizlines:{pocLines:{color:"",style:p.LineStyle.Solid,visible:!0,width:2}},polygons:{histBoxBg:{color:"",transparency:94}}},inputs:{first_bar_time:0,last_bar_time:0,rows:24,rowsLayout:"Number Of Rows",subscribeRealtime:!0,vaVolume:70,volume:"Up/Down"},styles:{developingPoc:{color:"",linestyle:p.LineStyle.Solid,linewidth:1,plottype:o.LineStudyPlotStyle.StepLine,trackPrice:!1,transparency:0,display:0},developingVAHigh:{color:"",linestyle:p.LineStyle.Solid,linewidth:1,plottype:o.LineStudyPlotStyle.StepLine,trackPrice:!1,transparency:0,display:0},developingVALow:{color:"",linestyle:p.LineStyle.Solid,linewidth:1,plottype:o.LineStudyPlotStyle.StepLine,trackPrice:!1,transparency:0,display:0}}},graphics:{hhists:{histBars2:{location:r.HHistLocation.Absolute,title:"Volume Profile",titles:["Up Volume","Down Volume"]},histBarsVA:{location:r.HHistLocation.Absolute,title:"Value Area",titles:["Value Area Up","Value Area Down"]}},horizlines:{pocLines:{name:"POC",showPrice:!0}},polygons:{histBoxBg:{mouseTouchable:!1,name:"Histogram Box",showBorder:!1}}},inputs:[{defval:"Number Of Rows",id:"rowsLayout",name:"Rows Layout",options:["Number Of Rows","Ticks Per Row"],type:"text"},{defval:24,id:"rows",max:1e6,min:1,name:"Row Size",type:"integer"},{defval:"Up/Down",id:"volume",name:"Volume",options:["Up/Down","Total","Delta"],type:"text"},{defval:0,id:"first_bar_time",isHidden:!0,max:253370764800,min:-253370764800,name:"First Bar Time",type:"time"},{defval:0,id:"last_bar_time",isHidden:!0,max:253370764800,min:-253370764800,name:"Last Bar Time",type:"time"},{defval:70,id:"vaVolume",max:100,min:0,name:"Value Area Volume",type:"integer"},{defval:!0,id:"subscribeRealtime",isHidden:!0,name:"SubscribeRealtime",type:"bool"}],plots:[{id:"developingPoc",
type:"line"},{id:"developingVAHigh",type:"line"},{id:"developingVALow",type:"line"}],styles:{developingPoc:{histogramBase:0,title:"Developing Poc"},developingVAHigh:{histogramBase:0,title:"Developing VA High"},developingVALow:{histogramBase:0,title:"Developing VA Low"}},...e}}}const b=S({id:"VbPFixed@tv-volumebyprice-57",description:"Volume Profile Fixed Range"}),w=S({id:"VbPFixed@tv-basicstudies-152",description:"Fixed Range",is_hidden_study:!0})},11694:(e,t,i)=>{"use strict";i.d(t,{VolumeProfileOutputSeries:()=>o});var s=i(50151),n=i(29981);class o{constructor(){this._histPos=-1,this._hist=new Float64Array(2e3),this._times=new Float64Array(2e3)}addHist(e){if(this._histPos>=0){const t=this._times[this._histPos];(0,s.assert)(t<=e,"History order violation"),this._histPos+=t===e?0:1}else this._histPos+=1;if(this._histPos===this._hist.length){const e=new Float64Array(2*this._hist.length);e.set(this._hist),this._hist=e;const t=new Float64Array(this._hist.length);t.set(this._times),this._times=t}this._hist[this._histPos]=NaN,this._times[this._histPos]=e}removeLastIfNaN(){Number.isNaN(this.get(0))&&(this._histPos-=1)}get(e){(0,s.assert)(0===e);const t=this._histPos-e;return this._hist[t]}getLeftOrEqual(e){const t=(0,n.upperbound)(this._times,e,((e,t)=>e{"use strict";i.d(t,{volumeProfileVisibleRangeStudyItem:()=>y});var s=i(50151),n=i(7370),o=i(9233),r=i(85049),a=i(40878),l=i(43789),c=i(61923);class h extends l.VolumeByPriceExpr{constructor(e,t,i,s,n,o,r,a,l,h,d){super(e,t,i,o,new c.GraphicsList,r,!0,a,l,(()=>h),d,s,n,!1),this._firstBarTime=s,this._lastBarTime=n}update(e){this._supplyRowsLayout(this._ctx),this.timeInRequestedRange(e)&&super.update(e)}timeInRequestedRange(e){const t=this._timeScale().get(e);return this._firstBarTime<=t&&t=this._firstBarTime){const e=this._developingPocSeries.getLeftOrEqual(o),t=this._developingVAHighSeries.getLeftOrEqual(o),i=this._developingVALowSeries.getLeftOrEqual(o);n.data.push([e,t,i])}else n.data.push([NaN,NaN,NaN])}return n}time(){return this._timeSeries}open(){return this._openSeries}high(){return this._highSeries}low(){return this._lowSeries}
close(){return this._closeSeries}volume(){return this._volumeSeries}developingPoc(){return this._developingPocSeries}developingVAHigh(){return this._developingVAHighSeries}developingVALow(){return this._developingVALowSeries}}const y={constructor:f,name:"Volume Profile Visible Range",metainfo:{_metainfoVersion:51,id:"VbPVisible@tv-basicstudies-49",description:"Volume Profile Visible Range",shortDescription:"VPVR",format:{type:"volume"},is_price_study:!0,linkedToSeries:!0,palettes:{},inputs:[{id:"rowsLayout",name:"Rows Layout",defval:"Number Of Rows",options:["Number Of Rows","Ticks Per Row"],type:"text"},{id:"rows",name:"Row Size",defval:24,max:1e6,min:1,type:"integer"},{id:"volume",name:"Volume",defval:"Up/Down",options:["Up/Down","Total","Delta"],type:"text"},{id:"first_visible_bar_time",name:"First Visible Bar Time",defval:0,isHidden:!0,max:253370764800,min:-253370764800,type:"time"},{id:"last_visible_bar_time",name:"Last Visible Bar Time",defval:0,isHidden:!0,max:253370764800,min:-253370764800,type:"time"},{id:"vaVolume",name:"Value Area Volume",defval:70,max:100,min:0,type:"integer"}],plots:[{id:"developingPoc",type:"line"},{id:"developingVAHigh",type:"line"},{id:"developingVALow",type:"line"}],graphics:{hhists:{histBars2:{location:o.HHistLocation.Relative,title:"Volume Profile",titles:["Up Volume","Down Volume"]},histBarsVA:{location:o.HHistLocation.Relative,title:"Value Area",titles:["Value Area Up","Value Area Down"]}},horizlines:{pocLines:{name:"POC",showPrice:!0}}},defaults:{graphics:{hhists:{histBars2:{colors:["",""],direction:o.HHistDirection.RightToLeft,percentWidth:30,showValues:!1,transparencies:[76,76],valuesColor:"",visible:!0},histBarsVA:{colors:["",""],direction:o.HHistDirection.RightToLeft,percentWidth:30,showValues:!1,transparencies:[30,30],valuesColor:"",visible:!0}},horizlines:{pocLines:{color:"",style:0,visible:!0,width:2},vahLines:{color:"",style:0,visible:!1,width:2},valLines:{color:"",style:0,visible:!1,width:2}}},inputs:{first_visible_bar_time:0,last_visible_bar_time:0,rows:24,rowsLayout:"Number Of Rows",vaVolume:70,volume:"Up/Down"},styles:{developingPoc:{color:"",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,display:0},developingVAHigh:{color:"",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,display:0},developingVALow:{color:"",linestyle:0,linewidth:1,plottype:9,trackPrice:!1,transparency:0,display:0}}},styles:{developingPoc:{histogramBase:0,title:"Developing Poc"},developingVAHigh:{histogramBase:0,title:"Developing VA High"},developingVALow:{histogramBase:0,title:"Developing VA Low"}}}}},20629:(e,t,i)=>{"use strict";i.d(t,{StudyEngine:()=>n});var s=i(60656);class n{constructor(e){this.runner=new s.ScriptRunner(e)}stop(){this.runner.stop()}isStarted(){return this.runner.isStarted}}},1452:(e,t,i)=>{"use strict";i.d(t,{StudyError:()=>s});class s extends Error{constructor(e){super(e),this.studyError=!0}}},32569:(e,t,i)=>{"use strict";var s;i.d(t,{EraseAll:()=>o,EraseObj:()=>n,GraphicsCmds:()=>r}),function(e){e.One="one",e.All="all"}(s||(s={}));class n{
constructor(e,t){this.id=e,this.type=t}primitiveData(){return{action:"one",id:this.id,type:this.type}}}class o{primitiveData(){return{action:"all"}}}class r{constructor(){this.erase=[],this.create=null,this._modified=!1}primitiveData(e){if(this.isNaN())return null;const t={},i=this.create&&this.create.primitiveData(e);return null!==i&&(t.create=i),null!==this.erase&&this.erase.length>0&&(t.erase=this.erase.map((e=>e.primitiveData()))),void 0===t.create&&void 0===t.erase?null:t}setCreate(e){this.create=e,this.create.forEachList((e=>e.setOwner(this)))}isNaN(){return(null===this.erase||0===this.erase.length)&&null===this.create}isModified(){return this._modified}setModified(e){this._modified=e}dirty(){this._modified=!0}setOwner(e){throw new Error("Unsupported")}}},40878:(e,t,i)=>{"use strict";i.d(t,{GraphicsListColl:()=>s});class s{constructor(){this._stable=[],this._variable=null,this._owner=null}addStable(e){e.setOwner(this),this._stable.push(e)}setVariable(e){this._variable=e,null!==this._variable&&this._variable.setOwner(this)}primitivesData(e){const t=[];return this._forEach((i=>t.push(...i.primitivesData(e)))),t}deleteErasedItems(){this._forEach((e=>e.deleteErasedItems()))}markPostedItems(){this._forEach((e=>e.markPostedItems()))}isNaN(){return this._all((e=>e.isNaN()))}dirty(){null!==this._owner&&this._owner.dirty()}setOwner(e){this._owner=e}_forEach(e){for(const t of this._stable)e(t);null!==this._variable&&e(this._variable)}_all(e){for(const t of this._stable)if(!e(t))return!1;return null===this._variable||e(this._variable)}}},61923:(e,t,i)=>{"use strict";i.d(t,{GraphicsList:()=>o});var s=i(41978),n=i(67908);class o{constructor(){this._items=[],this._owner=null}primitivesData(e){const t=[];for(const i of this._items)e.isIgnoredObj(i)||t.push(i.primitiveData());return t}get(e){return this._items[e]}set(e,t){return this.dirty(),t.setOwner(this),this._items[e]=t,t}addAtIndex(e,t){this.dirty(),t.setOwner(this),this._items[e]=t}clear(){this._unsetOwner(this._items),this._items=[],this.dirty()}addAllFromNumber(e,t){this.setOwner(t),this._items.splice(e,0,...t._items);const i=!0;return this._setCachedDataValid(!1),i}addAll(e){this.setOwner(e),this._items.push(...e._items);const t=!0;return this._setCachedDataValid(!1),t}remove(e){const t=this._items[e];return this._items.splice(e,1),t.unsetOwner(this),this.dirty(),t}getItems(){return this._items}size(){return this._items.length}add(e){e.setOwner(this),this._items.push(e);const t=!0;return this._setCachedDataValid(!1),t}deleteErasedItems(){this._items=this._items.filter((e=>!e.isErased()))}markPostedItems(){for(const e of this._items)e.markAsPosted()}isNaN(){if(0===this._items.length)return!0;for(const e of this._items){if(!(0,n.isNaNable)(e))return!1;if(!e.isNaN())return!1}return!0}setOwner(e){this._owner=e}dirty(){null!==this._owner&&this._owner.dirty()}_unsetOwner(e){for(const t of e)t instanceof s.GraphicsObj&&t.unsetOwner(this)}_setCachedDataValid(e){e||this.dirty()}}},41978:(e,t,i)=>{"use strict";i.d(t,{GraphicsObj:()=>l});var s=i(73772);class n{
constructor(e,t,i,s){this._value=e,this._name=t,this._owner=i,this._comparer=void 0!==s?s:(e,t)=>null==e?null!=t:e===t}getName(){return this._name}set(e){const t=this._comparer(this._value,e);return t&&this._owner.dirty(),this._value=e,t}get(){return this._value}}class o{constructor(e,t,i){this._owner=null,this._value=e,this._name=t,this._owner=i}getName(){return this._name}set(e){return this._value!==e&&(this._value=e,null!==this._owner&&this._owner.dirty(),!0)}get(){return this._value}}class r extends n{constructor(e,t,i,s){super(e,t,i,s)}}class a{constructor(e){this._owner=e}createField(e,t){return new n(e,t,this)}createDoubleField(e,t){return new n(e,t,this,((e,t)=>!s.Std.equal(e,t)))}createDoubleArrayField(e,t){return new r(e,t,this,((e,t)=>{if(e===t)return!1;const i=e.length;if(t.length!==i)return!0;for(let n=0;n{"use strict";function s(e){return Boolean(e.isNaN)}i.d(t,{isNaNable:()=>s})},62628:(e,t,i)=>{"use strict";i.d(t,{JStudyDataUpdate:()=>p});var s=i(32569);class n{constructor(){this.isUpdate=!1,this.graphicsCmds=new s.GraphicsCmds,this._offsetsChanged=!1,this._disableGraphicsAndData=!1}isNaN(){return this.graphicsCmds.isNaN()}primitiveData(e){const t={};if(!this._disableGraphicsAndData){const i=this.graphicsCmds.primitiveData(e);null!==i&&(t.graphicsCmds=i)}return this.isUpdate&&(t.isUpdate=!0),void 0===t.graphicsCmds?void 0:t}disable(){this._disableGraphicsAndData=!0}checkForChangeAndResetChangedState(e){const t=this._offsetsChanged,i=this.graphicsCmds.isModified();this.graphicsCmds.setModified(!1),this._offsetsChanged=!1;return i||t||0!==e.length}}class o{constructor(e){this._dataObj=new n,this._isDirty=!1,this._eraseCmds=[],this._enableCmdDataStudy=e}init(e){this._dataObj.graphicsCmds.setCreate(e),this.update(!0)}dataObj(){return this._dataObj}setEraseCmds(e){this._eraseCmds=e}resetDirtyState(){this._isDirty=!1}disable(){this._dataObj.disable()}}var r,a=i(37265),l=i(67908);function c(e){return Boolean(e.isPosted)}!function(e){e[e.New=0]="New",e[e.Posted=1]="Posted",e[e.Erased=2]="Erased"}(r||(r={}));class h{
isIgnoredObj(e,t){return h.isIgnoredObjDefault(e,t)}static isIgnoredObjDefault(e,t){if(void 0===t)return h.isIgnoredObjNaNable(e);const i=e[t];return h.isIgnoredByGeneralRules(e,t)||h.isIgnoredObjNaNable(i)||h.isIgnoredObjListOfNaNables(i)}static isIgnoredObjNaNable(e){return(0,l.isNaNable)(e)&&e.isNaN()}static isIgnoredObjListOfNaNables(e){if(!(0,a.isArray)(e))return!1;let t=!0;for(const i of e)if(!(0,l.isNaNable)(i)||!i.isNaN()){t=!1;break}return t}static isIgnoredObjPosted(e){return c(e)&&e.isPosted()}static isIgnoredObjErased(e){return c(e)&&e.isErased()}static isIgnoredByGeneralRules(e,t){const i=e[t];return(0,a.isArray)(i)&&0===i.length}}class d{isIgnoredObj(e,t){if(void 0===t)return h.isIgnoredObjDefault(e)||h.isIgnoredObjErased(e);const i=e[t];return h.isIgnoredObjDefault(e,t)||h.isIgnoredObjErased(i)}}class u extends o{constructor(e){super(e),this._snapshotPredicate=new d,this._dataSnapShot={}}getData(){return this._dataSnapShot}getUpdate(){return this._isDirty?this._dataSnapShot:{}}update(e){(this._dataObj.checkForChangeAndResetChangedState(this._eraseCmds)||e)&&(null!==this._dataObj.graphicsCmds.create&&(this._dataObj.graphicsCmds.create.deleteErasedObjs(),this._dataObj.graphicsCmds.erase=[new s.EraseAll]),this._makeSnapshot(),this._isDirty=!0)}_makeSnapshot(){this._json=this._dataObj.primitiveData(this._snapshotPredicate),this._dataSnapShot={json:this._json}}}class _{isIgnoredObj(e,t){if(void 0===t)return h.isIgnoredObjDefault(e)||h.isIgnoredObjErased(e)||h.isIgnoredObjPosted(e);const i=e[t];return h.isIgnoredObjDefault(e,t)||h.isIgnoredObjErased(i)||h.isIgnoredObjPosted(i)}}class p extends u{constructor(e){super(e),this._updatePredicate=new _,this._sendShapshotOnly=!0,this._isFirstNotForcedUpdate=!0}update(e){(this._dataObj.checkForChangeAndResetChangedState(this._eraseCmds)||e)&&(null!==this._dataObj.graphicsCmds.create&&(this._dataObj.graphicsCmds.erase=[new s.EraseAll]),this._dataObj.isUpdate=!0,this._makeSnapshot(),null!==this._dataObj.graphicsCmds.create&&(this._dataObj.graphicsCmds.erase=this._eraseCmds),this._dataObj.isUpdate=!0,this._jsonUpdate=this._dataObj.primitiveData(this._updatePredicate),null!==this._dataObj.graphicsCmds.create&&this._dataObj.graphicsCmds.create.deleteErasedAndMarkPostedObjs(),this._sendShapshotOnly=e||this._isFirstNotForcedUpdate,this._isFirstNotForcedUpdate=Boolean(e),this._isDirty=!0)}getUpdate(){return this._isDirty?this._enableCmdDataStudy?{json:this._sendShapshotOnly?this._json:void 0,jsonUpdate:this._sendShapshotOnly?void 0:this._jsonUpdate}:{json:this._json,jsonUpdate:this._sendShapshotOnly?void 0:this._jsonUpdate}:{}}}},45382:(e,t,i)=>{"use strict";i.d(t,{Container:()=>o,StudyGraphicsData:()=>n});var s=i(50151);class n{constructor(){this._horizlines=[],this._hhists=[],this._polygons=[],this._vertlines=[],this._containersCache=[],this._containerNamesCache=[],this._containersMapCache=new Map,this._addToCache("horizlines",this._horizlines),this._addToCache("hhists",this._hhists),this._addToCache("polygons",this._polygons),this._addToCache("vertlines",this._vertlines)
}primitiveData(e){const t={};let i=!1;for(const s of this._containerNamesCache){const n=[],o=this.getObjsContainer(s);for(const t of o){if(t.isNaN())continue;const i=t.primitiveData(e);i.data.length>0&&n.push(i)}n.length>0&&(t[s]=n,i=!0)}return i?t:null}deleteErasedAndMarkPostedObjs(){this.forEachList((e=>{e.deleteErasedItems(),e.markPostedItems()}))}deleteErasedObjs(){this.forEachList((e=>e.deleteErasedItems()))}getObjsContainer(e){return(0,s.ensureDefined)(this._containersMapCache.get(e))}forEachList(e){for(const t of this._containersCache)for(const i of t)e(i.data)}_addToCache(e,t){this._containersCache.push(t),this._containerNamesCache.push(e),this._containersMapCache.set(e,t)}}class o{constructor(e,t){this.styleId=e,this.data=t}isNaN(){return this.data.isNaN()}primitiveData(e){return{styleId:this.styleId,data:this.data.primitivesData(e)}}}},42924:(e,t,i)=>{"use strict";const s=i(19625).getHexColorByName,n=i(73772).Std,o=s("color-ripe-red-100"),r=s("color-ripe-red-200"),a=s("color-ripe-red-500"),l=s("color-ripe-red-900"),c=s("color-ripe-red-a200"),h=s("color-minty-green-100"),d=s("color-minty-green-400"),u=s("color-minty-green-500");JSServer.studyLibrary=[{name:"Accumulation/Distribution",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accumulation/Distribution",shortDescription:"Accum/Dist",is_price_study:!1,inputs:[],id:"Accumulation/Distribution@tv-basicstudies-1",scriptIdPart:"",name:"Accumulation/Distribution",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t,i,s){return n.or(n.and(n.eq(e,t),n.eq(e,i)),n.eq(t,i))?0:(2*e-i-t)/(t-i)*s},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0(n.close(this._context),n.high(this._context),n.low(this._context),n.volume(this._context));return[n.cum(i,this._context)]}}},{name:"Accumulative Swing Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ASI",histogramBase:0,joinPoints:!1}},description:"Accumulative Swing Index",shortDescription:"ASI",is_price_study:!1,inputs:[{id:"in_0",name:"Limit Move Value",defval:10,type:"float",min:.1,max:1e5}],id:"Accumulative Swing Index@tv-basicstudies-1",scriptIdPart:"",name:"Accumulative Swing Index",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t){var i=t.new_var(n.open(t)),s=t.new_var(n.high(t)),o=t.new_var(n.low(t)),r=t.new_var(n.close(t)),a=n.abs(s-r.get(1)),l=n.abs(o-r.get(1)),c=n.abs(s-o),h=n.abs(r.get(1)-i.get(1)),d=n.max(a,l),u=n.iff(a>=n.max(l,c),a-.5*l+.25*h,n.iff(l>=n.max(a,c),l-.5*a+.25*h,c+.25*h));return n.iff(0===u,0,(r-r.get(1)+.5*(r-i)+.25*(r.get(1)-i.get(1)))/u*d/e*50)},
this.f_1=function(e,t){var i=this.f_0(e,t);return n.cum(i,t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0);return[this.f_1(i,this._context)]}}},{name:"Advance/Decline",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Advance/Decline",shortDescription:"AD",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t){return n.gt(e,t)},this.f_1=function(e,t){return n.lt(e,t)},this.f_2=function(e,t){return 0===t?e:e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this.f_0(n.close(this._context),n.open(this._context)),o=this._context.new_var(s),r=n.sum(o,i,this._context),a=this.f_1(n.close(this._context),n.open(this._context)),l=this._context.new_var(a),c=n.sum(l,i,this._context);return[this.f_2(r,c)]}}},{name:"Arnaud Legoux Moving Average",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:.85,in_2:6}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Arnaud Legoux Moving Average",shortDescription:"ALMA",is_price_study:!0,inputs:[{id:"in_0",name:"Window Size",defval:9,type:"integer",min:0,max:5e3},{id:"in_1",name:"Offset",defval:.85,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"Sigma",defval:6,type:"float",min:-1e12,max:1e12}],id:"Arnaud Legoux Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Arnaud Legoux Moving Average",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=n.close(this._context),s=this._input(0),o=this._input(1),r=this._input(2),a=this._context.new_var(i);return[n.alma(a,s,o,r)]}}},{name:"Aroon",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FB8C00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Aroon",shortDescription:"Aroon",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon",format:{precision:2,type:"percent"}},constructor:function(){this.f_0=function(e,t){return 100*(e+t)/t},this.main=function(e,t){
this._context=e,this._input=t;var i=this._input(0),s=n.high(this._context),o=i+1,r=this._context.new_var(s),a=n.highestbars(r,o,this._context),l=this.f_0(a,i),c=n.low(this._context),h=this._context.new_var(c),d=n.lowestbars(h,o,this._context);return[l,this.f_0(d,i)]}}},{name:"Average Price",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"AveragePrice@tv-basicstudies-1",scriptIdPart:"",name:"Average Price",description:"Average Price",shortDescription:"Average Price",is_price_study:!0,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{symbol:""}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"symbol",name:"Other Symbol",defval:"",type:"symbol",optional:!0,isHidden:!1}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,""!==t(0)&&this._context.new_sym(t(0),n.period(this._context))},this.main=function(e,t){if(this._context=e,this._input=t,""===this._input(0))return[n.ohlc4(this._context)];this._context.select_sym(0);const i=this._context.new_var(this._context.symbol.time);this._context.select_sym(1);const s=this._context.new_var(n.ohlc4(this._context)).adopt(this._context.new_var(this._context.symbol.time),i,1);return this._context.select_sym(0),[s]}}},{name:"Average Directional Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:c}},inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ADX",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Average Directional Index",shortDescription:"ADX",is_price_study:!1,inputs:[{id:"in_0",name:"ADX Smoothing",defval:14,type:"integer",min:-1e12,max:1e12},{id:"in_1",name:"DI Length",defval:14,type:"integer",min:-1e12,max:1e12}],id:"average_directional_Index@tv-basicstudies-1",scriptIdPart:"",name:"Average Directional Index",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e){var t=this._context.new_var(n.high(this._context)),i=n.change(t),s=this._context.new_var(n.low(this._context)),o=-n.change(s),r=this._context.new_var(n.tr(void 0,this._context)),a=n.rma(r,e,this._context),l=this._context.new_var(n.and(n.gt(i,o),n.gt(i,0))?i:0),c=n.fixnan(100*n.rma(l,e,this._context)/a,this._context),h=this._context.new_var(n.and(n.gt(o,i),n.gt(o,0))?o:0);return[c,n.fixnan(100*n.rma(h,e,this._context)/a,this._context)]},this.f_1=function(e,t){var i=this.f_0(e),s=i[0],o=i[1],r=s+o,a=this._context.new_var(n.abs(s-o)/(n.eq(r,0)?1:r));return[100*n.rma(a,t,this._context)]},this.main=function(e,t){return this._context=e,this._input=t,this._context.setMinimumAdditionalDepth(this._input(0)+this._input(1)),this.f_1(this._input(1),this._input(0))}}},{name:"Average True Range",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,
trackPrice:!1,transparency:0,visible:!0,color:l}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Average True Range",shortDescription:"ATR",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){var i=t(0);return[n.atr(i,e)]}}},{name:"Awesome Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:0,visible:!0,color:"#000080"}},palettes:{palette_0:{colors:{0:{color:a,width:1,style:0},1:{color:u,width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Awesome Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[],id:"Awesome Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Awesome Oscillator",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e){return n.le(e,0)?0:1},this.main=function(e,t){this._context=e,this._input=t;var i=n.hl2(this._context),s=this._context.new_var(i),o=n.sma(s,5,this._context),r=this._context.new_var(i),a=n.sma(r,34,this._context),l=this.f_0(o,a),c=l,h=this._context.new_var(l),d=n.change(h);return[c,this.f_1(d)]}}},{name:"Accelerator Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:0,visible:!0,color:"#000080"}},palettes:{palette_0:{colors:{0:{color:a,width:1,style:0},1:{color:u,width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accelerator Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[],id:"Accelerator Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Accelerator Oscillator",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e-t},this.f_1=function(e){return n.le(e,0)?0:1},this.main=function(e,t){this._context=e,this._input=t;var i=n.hl2(this._context),s=this._context.new_var(i),o=n.sma(s,5,this._context),r=this._context.new_var(i),a=n.sma(r,34,this._context),l=this.f_0(o,a),c=this._context.new_var(l),h=n.sma(c,5,this._context),d=this.f_0(l,h),u=this._context.new_var(d),_=n.change(u);return[d,this.f_1(_)]}}},{name:"Balance of Power",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:c}},inputs:{}},plots:[{
id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Balance of Power",shortDescription:"Balance of Power",is_price_study:!1,inputs:[],id:"Balance of Power@tv-basicstudies-1",scriptIdPart:"",name:"Balance of Power",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t,i,s){return(e-t)/(i-s)},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0(n.close(this._context),n.open(this._context),n.high(this._context),n.low(this._context))]}}},{name:"BB",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e12},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"BB@tv-basicstudies-1"},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=n.close(this._context),s=this._input(0),o=this._input(1),r=this._context.new_var(i),a=n.sma(r,s,this._context),l=this._context.new_var(i),c=n.stdev(l,s,this._context),h=this.f_0(o,c);return[a,this.f_1(a,h),this.f_2(a,h)]}}},{name:"Bollinger Bands",metainfo:{_metainfoVersion:53,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{in_0:20,in_1:2,symbol:""}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"symbol",name:"Other Symbol",defval:"",
type:"symbol",optional:!0,isHidden:!1},{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.init=function(e,t){this._context=e,""!==t(0)&&this._context.new_sym(t(0),n.period(this._context))},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.time(this._context)),s=n.close(this._context),o=this._input(0),r=this._input(1),a=this._input(2);if(""!==o){this._context.select_sym(1);var l=this._context.new_var(n.time(this._context));s=this._context.new_var(n.close(this._context)).adopt(l,i,1),this._context.select_sym(0)}var c=this._context.new_var(s),h=n.sma(c,r,this._context),d=this._context.new_var(s),u=n.stdev(d,r,this._context),_=this.f_0(a,u);return[h,this.f_1(h,_),this.f_2(h,_)]}}},{name:"Bollinger Bands %B",metainfo:{_metainfoVersion:53,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:d}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#26A69A",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,zorder:1}},description:"Bollinger Bands %B",shortDescription:"BB %B",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit",zorder:-1.1},{id:"hline_1",name:"LowerLimit",zorder:-1.11}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background",zorder:-2}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands %B@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands %B",format:{precision:2,type:"price"},usePlotsZOrder:!0},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/(i-t)},this.main=function(e,t){this._context=e,this._input=t;var i=n.close(this._context),s=this._input(0),o=this._input(1),r=this._context.new_var(i),a=n.sma(r,s,this._context),l=this._context.new_var(i),c=n.stdev(l,s,this._context),h=this.f_0(o,c),d=this.f_1(a,h),u=this.f_2(a,h);return[this.f_3(i,u,d)]}}},{name:"Bollinger Bands Width",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands Width",shortDescription:"BBW",is_price_study:!1,inputs:[{id:"in_0",
name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands Width@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands Width",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t){return e*t},this.f_1=function(e,t){return e+t},this.f_2=function(e,t){return e-t},this.f_3=function(e,t,i){return(e-t)/i},this.main=function(e,t){this._context=e,this._input=t;var i=n.close(this._context),s=this._input(0),o=this._input(1),r=this._context.new_var(i),a=n.sma(r,s,this._context),l=this._context.new_var(i),c=n.stdev(l,s,this._context),h=this.f_0(o,c),d=this.f_1(a,h),u=this.f_2(a,h);return[this.f_3(d,u,a)]}}},{name:"Chaikin Money Flow",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,zorder:1}},description:"Chaikin Money Flow",shortDescription:"CMF",is_price_study:!1,bands:[{id:"hline_0",name:"Zero",zorder:-1}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow",format:{precision:2,type:"price"},usePlotsZOrder:!0},constructor:function(){this.f_0=function(e,t,i,s){return n.or(n.and(n.eq(e,t),n.eq(e,i)),n.eq(t,i))?0:(2*e-i-t)/(t-i)*s},this.f_1=function(e,t){return e/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this.f_0(n.close(this._context),n.high(this._context),n.low(this._context),n.volume(this._context)),o=this._context.new_var(s),r=n.sum(o,i,this._context),a=n.volume(this._context),l=this._context.new_var(a),c=n.sum(l,i,this._context);return[this.f_1(r,c)]}}},{name:"Chaikin Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#EC407A"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:3,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,zorder:1}},description:"Chaikin Oscillator",shortDescription:"Chaikin Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero",zorder:-1}],inputs:[{id:"in_0",name:"short",defval:3,type:"integer",min:1,max:2e3},{id:"in_1",name:"long",defval:10,type:"integer",min:1,max:2e3}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator",format:{type:"volume"},usePlotsZOrder:!0},constructor:function(){this.f_0=function(e,t){return e-t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=n.accdist(this._context),r=this._context.new_var(o),a=n.ema(r,i,this._context),l=this._context.new_var(o),c=n.ema(l,s,this._context);return[this.f_0(a,c)]}
}},{name:"Chaikin Volatility",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Chaikin Volatility@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Volatility",description:"Chaikin Volatility",shortDescription:"Chaikin Volatility",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#AB47BC"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{periods:10,rocLookback:10}},styles:{plot_0:{title:"Plot",zorder:1}},bands:[{id:"hline_0",name:"Zero",zorder:-1}],inputs:[{id:"periods",type:"integer",name:"Periods"},{id:"rocLookback",type:"integer",name:"Rate of Change Lookback"}],format:{type:"volume"},usePlotsZOrder:!0},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.rocLookback=this._input(1)},this.main=function(e,t){this._context=e,this._input=t,this._context.setMinimumAdditionalDepth(this.period+this.rocLookback);var i=this._context.new_var(n.high(this._context)-n.low(this._context)),s=this._context.new_var(n.ema(i,this.period,this._context));return[n.roc(s,this.rocLookback)]}}},{name:"Chande Kroll Stop",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},inputs:{in_0:10,in_1:1,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Long",histogramBase:0,joinPoints:!1},plot_1:{title:"Short",histogramBase:0,joinPoints:!1}},description:"Chande Kroll Stop",shortDescription:"Chande Kroll Stop",is_price_study:!0,inputs:[{id:"in_0",name:"p",defval:10,type:"integer",min:1,max:4999},{id:"in_1",name:"x",defval:1,type:"integer",min:1,max:1e12},{id:"in_2",name:"q",defval:9,type:"integer",min:1,max:1e12}],id:"Chande Kroll Stop@tv-basicstudies-1",scriptIdPart:"",name:"Chande Kroll Stop",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t,i){return e-t*i},this.f_1=function(e,t,i){return e+t*i},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=this._input(2),r=n.high(this._context),a=this._context.new_var(r),l=n.highest(a,i,this._context),c=n.atr(i,this._context),h=this.f_0(l,s,c),d=this._context.new_var(r),u=n.lowest(d,i,this._context),_=this.f_1(u,s,c),p=this._context.new_var(h),m=n.highest(p,o,this._context),g=this._context.new_var(_);return[n.lowest(g,o,this._context),m]}}},{name:"Chande Momentum Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chande Momentum Oscillator",
shortDescription:"ChandeMO",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:2e3}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator",format:{type:"price",precision:2}},constructor:function(){this.f_0=function(e){return n.ge(e,0)?e:0},this.f_1=function(e){return n.ge(e,0)?0:-e},this.f_2=function(e,t){return 100*e/t},this.f_3=function(e,t){return this.f_2(e-t,e+t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=n.close(this._context),o=this._context.new_var(s),r=n.change(o),a=this.f_0(r),l=this.f_1(r),c=this._context.new_var(a),h=n.sum(c,i,this._context),d=this._context.new_var(l),u=n.sum(d,i,this._context);return[this.f_3(h,u)]}}},{name:"Chop Zone",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:0,visible:!0,color:"#000080"}},palettes:{palette_0:{colors:{0:{color:"#26C6DA",width:1,style:0},1:{color:"#43A047",width:1,style:0},2:{color:"#A5D6A7",width:1,style:0},3:{color:u,width:1,style:0},4:{color:"#D50000",width:1,style:0},5:{color:"#E91E63",width:1,style:0},6:{color:"#FF6D00",width:1,style:0},7:{color:"#FFB74D",width:1,style:0},8:{color:"#FDD835",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Chop Zone",shortDescription:"Chop Zone",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"},4:{name:"Color 4"},5:{name:"Color 5"},6:{name:"Color 6"},7:{name:"Color 7"},8:{name:"Color 8"}},valToIndex:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8}}},inputs:[],id:"chop_zone@tv-basicstudies-1",scriptIdPart:"",name:"Chop Zone",format:{precision:0,type:"price"}},constructor:function(){this.f_0=function(){var e=n.close(this._context),t=n.hlc3(this._context),i=this._context.new_var(n.high(this._context)),s=n.highest(i,30,this._context),o=n.lowest(i,30,this._context),r=25/(s-o)*o,a=this._context.new_var(e),l=this._context.new_var(n.ema(a,34,this._context)),c=(l.get(1)-l.get(0))/t*r,h=n.sqrt(1+c*c),d=n.round(180*n.acos(1/h)/3.141592653589793),u=n.iff(n.gt(c,0),-d,d),_=n.and(n.gt(u,-2.14),n.le(u,-.71))?7:8,p=n.and(n.gt(u,-3.57),n.le(u,-2.14))?6:_,m=n.and(n.gt(u,-5),n.le(u,-3.57))?5:p,g=n.le(u,-5)?4:m,f=n.and(n.lt(u,2.14),n.ge(u,.71))?3:g,y=n.and(n.lt(u,3.57),n.ge(u,2.14))?2:f,v=n.and(n.lt(u,5),n.ge(u,3.57))?1:y;return[1,n.ge(u,5)?0:v]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Choppiness Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:38.2}],
filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,zorder:1}},description:"Choppiness Index",shortDescription:"CHOP",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit",zorder:-1.1},{id:"hline_1",name:"LowerLimit",zorder:-1.11}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background",zorder:-2}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index",format:{type:"price",precision:2},usePlotsZOrder:!0},constructor:function(){this.f_0=function(e,t,i,s){return 100*n.log10(e/(t-i))/s},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=n.atr(1,this._context),o=this._context.new_var(s),r=n.sum(o,i,this._context),a=n.high(this._context),l=this._context.new_var(a),c=n.highest(l,i,this._context),h=n.low(this._context),d=this._context.new_var(h),u=n.lowest(d,i,this._context),_=n.log10(i);return[this.f_0(r,c,u,_)]}}},{name:"Commodity Channel Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},smoothedMA:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!1}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-100}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:20,smoothingLine:"SMA",smoothingLength:20}},plots:[{id:"plot_0",type:"line"},{id:"smoothedMA",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,zorder:2},smoothedMA:{title:"Smoothed MA",histogramBase:0,joinPoints:!1,zorder:1}},description:"Commodity Channel Index",shortDescription:"CCI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit",zorder:-1.1},{id:"hline_1",name:"LowerLimit",zorder:-1.11}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background",zorder:-2}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3},{id:"smoothingLine",name:"Smoothing Line",defval:"SMA",type:"text",options:["SMA","EMA","WMA"],hideWhenPlotsHidden:["smoothedMA"]},{id:"smoothingLength",name:"Smoothing Length",defval:20,type:"integer",min:1,max:1e4,hideWhenPlotsHidden:["smoothedMA"]}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index",format:{precision:2,type:"price"},usePlotsZOrder:!0},constructor:function(){this.f_0=function(e,t,i){return(e-t)/(.015*i)},this.main=function(e,t){this._context=e,this._input=t;var i=n.hlc3(this._context),s=this._input(0),o=this._input(1),r=this._input(2);this._context.setMinimumAdditionalDepth(s+r)
;var a,l=this._context.new_var(i),c=n.sma(l,s,this._context),h=this._context.new_var(i),d=n.dev(h,s,this._context),u=this.f_0(i,c,d),_=this._context.new_var(u);return"EMA"===o?a=n.ema(_,r,this._context):"WMA"===o?a=n.wma(_,r,this._context):"SMA"===o&&(a=n.sma(_,r,this._context)),[u,a]}}},{name:"Connors RSI",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#2196F3",transparency:90,visible:!0}},inputs:{in_0:3,in_1:2,in_2:100}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"CRSI",histogramBase:0,joinPoints:!1,zorder:1}},description:"Connors RSI",shortDescription:"CRSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit",zorder:-1.1},{id:"hline_1",name:"LowerLimit",zorder:-1.11}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background",zorder:-2}],inputs:[{id:"in_0",name:"RSI Length",defval:3,type:"integer",min:1},{id:"in_1",name:"UpDown Length",defval:2,type:"integer",min:1},{id:"in_2",name:"ROC Length",defval:100,type:"integer",min:1}],id:"Connors RSI@tv-basicstudies-1",scriptIdPart:"",name:"Connors RSI",format:{precision:2,type:"price"},usePlotsZOrder:!0},constructor:function(){var e;this.f_1=function(e,t,i){var s=i.new_var(n.max(n.change(e),0));return n.rma(s,t,i)},this.f_2=function(e,t,i){var s=i.new_var(-n.min(n.change(e),0));return n.rma(s,t,i)},this.f_3=(e=0,function(t){var i=t.get(0),s=t.get(1);return e=i===s?0:i>s?n.nz(e)<=0?1:n.nz(e)+1:n.nz(e)>=0?-1:n.nz(e)-1,this._context.new_var(e)}),this.main=function(e,t){this._context=e,this._input=t;var i=n.close(this._context),s=this._context.new_var(i),o=this._input(0),r=this._input(1),a=this._input(2);this._context.setMinimumAdditionalDepth(a);var l=n.rsi(this.f_1(s,o,this._context),this.f_2(s,o,this._context)),c=this.f_3(s),h=n.rsi(this.f_1(c,r,this._context),this.f_2(c,r,this._context)),d=this._context.new_var(n.roc(s,1)),u=n.percentrank(d,a);return[n.avg(l,h,u)]}}},{name:"Coppock Curve",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",min:-1e12,max:5e3},{id:"in_1",name:"Long RoC Length",defval:14,type:"integer",min:1,max:4999},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:1,max:4999}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e+t},this.main=function(e,t){
this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=this._input(2);this._context.setMinimumAdditionalDepth(i+Math.max(s,o));var r=n.close(this._context),a=this._context.new_var(r),l=n.roc(a,s),c=this._context.new_var(r),h=n.roc(c,o),d=this.f_0(l,h),u=this._context.new_var(d);return[n.wma(u,i,this._context)]}}},{name:"Correlation Coeff",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:"",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation Coefficient",shortDescription:"CC",is_price_study:!1,inputs:[{id:"in_0",name:"sym",defval:"",type:"symbol"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",name:"Correlation Coeff",format:{precision:2,type:"price"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this._context.new_sym(this._input(0),n.period(this._context))},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_unlimited_var(this._context.symbol.time),s=(this._input(0),n.period(this._context),n.close(this._context)),o=this._input(1);this._context.select_sym(1);var r=this._context.new_unlimited_var(this._context.symbol.time),a=n.close(this._context),l=this._context.new_unlimited_var(a);this._context.select_sym(0);var c=l.adopt(r,i,0),h=this._context.new_var(s),d=this._context.new_var(c);return[n.correlation(h,d,o,this._context)]}}},{name:"Correlation - Log",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Correlation - Log@tv-basicstudies-1",scriptIdPart:"",name:"Correlation - Log",description:"Correlation - Log",shortDescription:"Correlation - Log",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{instrument:"",instrument2:"",periods:25}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"instrument",name:"Instrument 1",type:"symbol",defval:"",confirm:!0},{id:"instrument2",name:"Instrument 2",type:"symbol",defval:"",confirm:!0},{id:"periods",name:"Periods",type:"integer",defval:25}],format:{precision:2,type:"price"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this._context.new_sym(this._input(0),n.period(this._context)),this._context.new_sym(this._input(1),n.period(this._context)),this.period=this._input(2)},this.correlationLog=function(e,t,i,s){var o=n.sma(e,i,s),r=n.sma(t,i,s),a=s.new_var(e.get()*t.get());return(n.sma(a,i,s)-o*r)/Math.sqrt(n.variance2(e,o,i)*n.variance2(t,r,i))},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(this._context.symbol.time);this._context.select_sym(2)
;var s=this._context.new_var(n.close(this._context)),o=this._context.new_var(n.log(s.get()/s.get(1))),r=this._context.new_var(this._context.symbol.time);this._context.select_sym(1);var a=this._context.new_var(this._context.symbol.time),l=this._context.new_var(n.close(this._context)),c=this._context.new_var(n.log(l.get()/l.get(1))),h=this._context.new_var(o.adopt(r,a,0)),d=this._context.new_var(this.correlationLog(c,h,this.period,this._context)),u=this._context.new_var(d.adopt(a,i,0)).get(),_=n.round(1e3*u)/1e3;return this._context.select_sym(0),[_]}}},{name:"Detrended Price Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:21,in_1:!1}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"DPO",histogramBase:0,joinPoints:!1,isHidden:!1,zorder:1}},description:"Detrended Price Oscillator",shortDescription:"DPO",is_price_study:!1,is_hidden_study:!1,id:"detrended_price_oscillator@tv-basicstudies-1",bands:[{id:"hline_0",name:"Zero",isHidden:!1,zorder:-1}],inputs:[{id:"in_0",name:"Period",defval:21,type:"integer",min:1,max:1e12},{id:"in_1",name:"isCentered",defval:!1,type:"bool"}],scriptIdPart:"",name:"Detrended Price Oscillator",format:{type:"price",precision:2},usePlotsZOrder:!0},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._input(1),i=Math.floor(e/2+1);this._context.setMinimumAdditionalDepth(e+i);var s=this._context.new_var(n.close(this._context)),o=this._context.new_var(n.sma(s,e,this._context)),r=this._context.new_var(n.close(this._context)).get(i)-o,a=n.close(this._context)-o.get(i);return[t?r:a,t?-i:0]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[{value:i[0],offset:i[1]}]}}},{name:"Directional Movement Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_3:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FFA726"},plot_4:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#ab47bc"}},inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"DX",histogramBase:0,joinPoints:!1},plot_3:{title:"ADX",histogramBase:0,joinPoints:!1},plot_4:{title:"ADXR",histogramBase:0,joinPoints:!1}},description:"Directional Movement",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",
defval:14,type:"integer",min:1,max:2e3},{id:"in_1",name:"ADX Smoothing",defval:14,type:"integer",min:1,max:50}],id:"Directional Movement Index@tv-basicstudies-1",scriptIdPart:"",name:"Directional Movement Index",format:{precision:4,type:"price"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1);return this._context.setMinimumAdditionalDepth(2*i+s),n.dmi(i,s,this._context)}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{in_0:20,offset:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Lower",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Basis",histogramBase:0,joinPoints:!1}},description:"Donchian Channels",shortDescription:"DC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_0",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3},{id:"offset",name:"Offset",defval:0,type:"integer",min:-1e3,max:1e3}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=n.low(this._context),r=this._context.new_var(o);this._context.setMinimumAdditionalDepth(i+Math.max(s,0));var a=n.lowest(r,i,this._context),l=n.high(this._context),c=this._context.new_var(l),h=n.highest(c,i,this._context);return[{value:a,offset:s},{value:h,offset:s},{value:n.avg(h,a),offset:s}]}}},{name:"Double Exponential Moving Average",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double EMA",shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return 2*e-t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0);this._context.setMinimumAdditionalDepth(2*i);var s=n.close(this._context),o=this._context.new_var(s),r=n.ema(o,i,this._context),a=this._context.new_var(r),l=n.ema(a,i,this._context);return[this.f_0(r,l)]}}},{name:"Ease of Movement",metainfo:{
_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"}},inputs:{in_0:1e4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease Of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",defval:1e4,type:"integer",min:1,max:1e9},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t,i,s,n){return e*t*(i-s)/n},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=n.hl2(this._context),r=this._context.new_var(o),a=n.change(r),l=this.f_0(i,a,n.high(this._context),n.low(this._context),n.volume(this._context)),c=this._context.new_var(l);return[n.sma(c,s,this._context)]}}},{name:"Elders Force Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:a}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,zorder:1}},description:"Elder's Force Index",shortDescription:"EFI",is_price_study:!1,bands:[{id:"hline_0",name:"Zero",zorder:-1}],inputs:[{id:"in_0",name:"length",defval:13,type:"integer",min:1,max:2e3}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index",format:{type:"volume"},usePlotsZOrder:!0},constructor:function(){this.f_0=function(e,t){return e*t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=n.close(this._context),o=this._context.new_var(s),r=n.change(o),a=this.f_0(r,n.volume(this._context)),l=this._context.new_var(a);return[n.ema(l,i,this._context)]}}},{name:"EMA Cross",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#43A047"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"EMA Cross",shortDescription:"EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["plot_0","plot_2"]},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["plot_1","plot_2"]}],id:"EMA Cross@tv-basicstudies-1",scriptIdPart:"",
name:"EMA Cross",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e?t:n.na()},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=n.close(this._context),r=this._context.new_var(o),a=n.ema(r,i,this._context),l=this._context.new_var(o),c=n.ema(l,s,this._context),h=a,d=c,u=n.cross(a,c,this._context);return[h,d,this.f_0(u,a)]}}},{name:"Envelopes",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#FF6D00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},filledAreasStyle:{fill_0:{color:"#2196F3",transparency:95,visible:!0}},inputs:{in_0:20,in_1:10,in_2:10,in_3:"Simple",in_4:"close"}},plots:[{id:"plot_1",type:"line"},{id:"plot_0",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Average",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelopes",shortDescription:"Envelopes",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Upper Percentage",defval:2,type:"float",min:0},{id:"in_2",name:"Lower Percentage",defval:2,type:"float",min:0},{id:"in_3",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]},{id:"in_4",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelopes",format:{type:"inherit"}},constructor:function(){this.f_0=function(e,t){return e*(1+t)},this.f_1=function(e,t){return e*(1-t)},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n[this._input(4)](this._context)),s=n.sma(i,this._input(0),this._context);return"Exponential"===this._input(3)?s=n.ema(i,this._input(0),this._context):"Weighted"===this._input(3)&&(s=n.wma(i,this._input(0),this._context)),[this.f_0(s,this._input(1)/100),s,this.f_1(s,this._input(2)/100)]}}},{name:"Standard Error",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Standard Error@tv-basicstudies-1",scriptIdPart:"",name:"Standard Error",description:"Standard Error",shortDescription:"Standard Error",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"}},inputs:{length:14}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"length",type:"integer",name:"Length",min:3}],format:{precision:2,type:"price"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0)},this.main=function(e,t){this._context=e,this._input=t
;for(var i,s,o=this._context.new_var(n.close(this._context)),r=0,a=0,l=0;l0?1:3,i=n.change(this._context.new_var(e));return t-(n.le(i,0)?0:1)},this.init=function(e,t){this._context=e,""!==t(0)&&this._context.new_sym(t(0),n.period(this._context))},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(this._context.symbol.time),s=n[this._input(3)](this._context),o=this._input(1),r=this._input(2),a=this._input(4),l=this._input(5),c=this._input(6);if(this._context.setMinimumAdditionalDepth(Math.max(o,r)+a),""!==this._input(0)){this._context.select_sym(1);var h=this._context.new_var(this._context.symbol.time),d=n[this._input(3)](this._context);s=this._context.new_var(d).adopt(h,i,0),this._context.select_sym(0)}var u,_,p=this._context.new_var(s);"EMA"===l?u=n.ema(p,o,this._context):"WMA"===l?u=n.wma(p,o,this._context):"SMA"===l&&(u=n.sma(p,o,this._context)),"EMA"===l?_=n.ema(p,r,this._context):"WMA"===l?_=n.wma(p,r,this._context):"SMA"===l&&(_=n.sma(p,r,this._context));var m,g=this.f_0(u,_),f=this._context.new_var(g);"EMA"===c?m=n.ema(f,a,this._context):"WMA"===c?m=n.wma(f,a,this._context):"SMA"===c&&(m=n.sma(f,a,this._context));var y=this.f_0(g,m);return[y,g,m,this.f_1(y)]}}},{name:"Moving Average Exponential",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{
linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},smoothedMA:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!1}},inputs:{length:9,source:"close",offset:0,smoothingLine:"SMA",smoothingLength:9}},plots:[{id:"plot_0",type:"line"},{id:"smoothedMA",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},smoothedMA:{title:"Smoothed MA",histogramBase:0,joinPoints:!1}},description:"Moving Average Exponential",shortDescription:"EMA",is_price_study:!0,inputs:[{id:"length",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"source",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"offset",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4},{id:"smoothingLine",name:"Smoothing Line",defval:"SMA",type:"text",options:["SMA","EMA","WMA"],hideWhenPlotsHidden:["smoothedMA"]},{id:"smoothingLength",name:"Smoothing Length",defval:9,type:"integer",min:1,max:1e4,hideWhenPlotsHidden:["smoothedMA"]}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=n[this._input(1)](this._context),s=this._input(0),o=this._input(2),r=this._input(3),a=this._input(4);this._context.setMinimumAdditionalDepth(s+a);var l,c=this._context.new_var(i),h=n.ema(c,s,this._context),d=this._context.new_var(h);return"EMA"===r?l=n.ema(d,a,this._context):"WMA"===r?l=n.wma(d,a,this._context):"SMA"===r&&(l=n.sma(d,a,this._context)),[{value:h,offset:o},{value:l,offset:o}]}}},{name:"Moving Average Weighted",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Weighted",shortDescription:"WMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Weighted",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=n[this._input(1)](this._context),s=this._input(0),o=this._input(2),r=this._context.new_var(i);return[{value:n.wma(r,s,this._context),offset:o}]}}},{name:"Moving Average Double",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"Moving Average Double@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Double",description:"Moving Average Double",shortDescription:"Moving Average Double",is_price_study:!0,plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],defaults:{styles:{
plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"},plot_1:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{symbol:"",firstPeriods:14,secondPeriods:21,method:"Simple"}},styles:{plot_0:{title:"Plot 1"},plot_1:{title:"Plot 2"}},inputs:[{id:"symbol",name:"Another symbol",defval:"",type:"symbol",optional:!0,isHidden:!1},{id:"firstPeriods",name:"1st Period",type:"integer",defval:14,min:1,max:1e4},{id:"secondPeriods",name:"2nd Period",type:"integer",defval:21,min:1,max:1e4},{id:"method",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,""!==t(0)&&this._context.new_sym(t(0),n.period(this._context))},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.time(this._context)),s=n.close(this._context);if(""!==this._input(0)){this._context.select_sym(1);var o=this._context.new_var(n.time(this._context)),r=n.close(this._context);s=this._context.new_var(r).adopt(o,i,1),this._context.select_sym(0)}var a,l,c=this._context.new_var(s);return"Exponential"===this._input(2)?(a=n.ema(c,this._input(1),this._context),l=n.ema(c,this._input(2),this._context)):"Weighted"===this._input(2)?(a=n.wma(c,this._input(1),this._context),l=n.wma(c,this._input(2),this._context)):(a=n.sma(c,this._input(1),this._context),l=n.sma(c,this._input(2),this._context)),[a,l]}}},{name:"Moving Average Triple",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Triple@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Triple",description:"Moving Average Triple",shortDescription:"Moving Average Triple",plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#FF6D00"},plot_1:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#2196F3"},plot_2:{linestyle:0,visible:!0,linewidth:1,transparency:0,plottype:0,trackPrice:!1,color:"#26C6DA"}},inputs:{firstPeriods:14,secondPeriods:21,thirdPeriods:35,method:"Simple"}},styles:{plot_0:{title:"Plot 1"},plot_1:{title:"Plot 2"},plot_2:{title:"Plot 3"}},inputs:[{id:"firstPeriods",name:"1st Period",type:"integer",defval:14,min:1,max:1e4,hideWhenPlotsHidden:["plot_0"]},{id:"secondPeriods",name:"2nd Period",type:"integer",defval:21,min:1,max:1e4,hideWhenPlotsHidden:["plot_1"]},{id:"thirdPeriods",name:"3rd Period",type:"integer",defval:35,min:1,max:1e4,hideWhenPlotsHidden:["plot_2"]},{id:"method",name:"Method",type:"text",defval:"Simple",options:["Simple","Exponential","Weighted"]}],format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i,s,o,r=this._context.new_var(n.close(this._context));return"Exponential"===this._input(3)?(i=n.ema(r,this._input(0),this._context),
s=n.ema(r,this._input(1),this._context),o=n.ema(r,this._input(2),this._context)):"Weighted"===this._input(3)?(i=n.wma(r,this._input(0),this._context),s=n.wma(r,this._input(1),this._context),o=n.wma(r,this._input(2),this._context)):(i=n.sma(r,this._input(0),this._context),s=n.sma(r,this._input(1),this._context),o=n.sma(r,this._input(2),this._context)),[i,s,o]}}},{name:"Moving Average Adaptive",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Adaptive@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Adaptive",description:"Moving Average Adaptive",shortDescription:"Moving Average Adaptive",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#AB47BC"}},inputs:{periods:10}},styles:{plot_0:{title:"Plot 1"}},inputs:[{id:"periods",name:"Period",type:"integer",defval:10,min:2,max:1e4}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.periods=this._input(0)},this.ama=function(e,t){var i=this.periods,s=this._context.new_var(),o=e.get(),r=n.stdev(t,i,this._context),a=n.log(o/e.get(i))/(r*Math.sqrt(i)),l=.1*Math.abs(a),c=(o-s.get(1))*l+s.get(1);return s.set(isNaN(c)?o:c),c},this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.close(this._context)),s=this._context.new_var(n.log(i.get()/i.get(1)));return[this.ama(i,s)]}}},{name:"Moving Average Hamming",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Moving Average Hamming@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Hamming",description:"Moving Average Hamming",shortDescription:"Moving Average Hamming",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,transparency:0,trackPrice:!1,color:"#4CAF50"}},inputs:{periods:10}},styles:{plot_0:{title:"Plot 1"}},inputs:[{id:"periods",name:"Period",type:"integer",defval:10,min:1,max:1e4}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.periods=this._input(0);for(var i=[],s=0,n=1;n<=this.periods;++n){var o=Math.sin((1+n)/this.periods*Math.PI/2);i.unshift(o),s+=o}this.hmaFactors=i,this.hmaFactorsSum=s},this.hma=function(e){for(var t=this.periods,i=0,s=0;sthis._context.new_var(s).get(1)?1:0,[100*n.sma(this._context.new_var(i),this.rollingPeriod,this._context)]}}},{name:"Net Volume",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Net Volume",shortDescription:"Net Volume",is_price_study:!1,inputs:[],id:"Net Volume@tv-basicstudies-1",scriptIdPart:"",name:"Net Volume",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t,i){return n.gt(e,0)?t:n.lt(i,0)?-t:0*t},this.main=function(e,t){this._context=e,this._input=t;var i=n.close(this._context),s=this._context.new_var(i),o=n.change(s);return[this.f_0(o,n.volume(this._context),o)]}}},{name:"On Balance Volume",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},smoothedMA:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!1}},inputs:{smoothingLine:"SMA",smoothingLength:9}},plots:[{id:"plot_0",type:"line"},{id:"smoothedMA",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},smoothedMA:{title:"Smoothed MA",histogramBase:0,joinPoints:!1}},description:"On Balance Volume",shortDescription:"OBV",is_price_study:!1,inputs:[{id:"smoothingLine",name:"Smoothing Line",defval:"SMA",type:"text",options:["SMA","EMA","WMA"],hideWhenPlotsHidden:["smoothedMA"]},{id:"smoothingLength",name:"Smoothing Length",defval:9,type:"integer",min:1,max:1e4,hideWhenPlotsHidden:["smoothedMA"]}],id:"On Balance Volume@tv-basicstudies-1",scriptIdPart:"",name:"On Balance Volume",format:{type:"volume"}},constructor:function(){this.f_0=function(e,t,i){return n.gt(e,0)?t:n.lt(i,0)?-t:0*t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=n.close(this._context),r=this._context.new_var(o),a=n.change(r),l=this.f_0(a,n.volume(this._context),a),c=n.cum(l,this._context);this._context.setMinimumAdditionalDepth(s);var h,d=this._context.new_var(c);return"EMA"===i?h=n.ema(d,s,this._context):"WMA"===i?h=n.wma(d,s,this._context):"SMA"===i&&(h=n.sma(d,s,this._context)),[c,h]}}},{name:"Parabolic SAR",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:3,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:.02,in_1:.02,in_2:.2,symbol:""}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,
joinPoints:!1}},description:"Parabolic SAR",shortDescription:"SAR",is_price_study:!0,inputs:[{id:"in_0",name:"start",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_1",name:"increment",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"maximum",defval:.2,type:"float",min:-1e12,max:1e12},{id:"symbol",name:"Other Symbol",defval:"",type:"symbol",optional:!0,isHidden:!1}],id:"Parabolic SAR@tv-basicstudies-1",scriptIdPart:"",name:"Parabolic SAR",format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,""!==t(3)&&this._context.new_sym(t(3),n.period(this._context))},this.main=function(e,t){this._context=e,this._input=t;const i=()=>n.sar(this._input(0),this._input(1),this._input(2),this._context);if(""===this._input(3))return[i()];this._context.select_sym(0);const s=this._context.new_var(this._context.symbol.time);this._context.select_sym(1);const o=this._context.new_var(i()).adopt(this._context.new_var(this._context.symbol.time),s,1);return this._context.select_sym(0),[o]}}},{name:"Price Channel",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#F50057"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:20,in_1:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Highprice Line",histogramBase:0,joinPoints:!1},plot_1:{title:"Lowprice Line",histogramBase:0,joinPoints:!1},plot_2:{title:"Centerprice Line",histogramBase:0,joinPoints:!1}},description:"Price Channel",shortDescription:"PC",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Offset Length",defval:0,type:"integer",min:1,max:2e3}],id:"Price Channel@tv-basicstudies-1",scriptIdPart:"",name:"Price Channel",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=n.high(this._context),s=this._context.new_var(i),o=n.low(this._context),r=this._context.new_var(o),a=this._input(0),l=this._input(1),c=n.highest(s,a,this._context),h=n.lowest(r,a,this._context);return[{value:c,offset:l},{value:h,offset:l},{value:n.avg(c,h),offset:l}]}}},{name:"Price Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:u}},inputs:{in_0:10,in_1:21}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Price Oscillator",shortDescription:"PPO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:21,type:"integer",min:1,max:2e3}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator",format:{
type:"price",precision:2}},constructor:function(){this.f_0=function(e,t){return(e-t)/t*100},this.main=function(e,t){this._context=e,this._input=t;var i=n.close(this._context),s=this._input(0),o=this._input(1),r=this._context.new_var(i),a=n.sma(r,s,this._context),l=this._context.new_var(i),c=n.sma(l,o,this._context);return[this.f_0(a,c)]}}},{name:"Price Volume Trend",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"PVT",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Price Volume Trend",shortDescription:"PVT",is_price_study:!1,is_hidden_study:!1,id:"price_volume_trend@tv-basicstudies-1",inputs:[],scriptIdPart:"",name:"Price Volume Trend",format:{type:"volume"}},constructor:function(){this.f_0=function(){var e=this._context.new_var(n.close(this._context));return[n.cum(n.change(e)/e.get(1)*n.volume(this._context),this._context)]},this.main=function(e,t){return this._context=e,this._input=t,[this.f_0()[0]]}}},{name:"Rank Correlation Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:12}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"RCI",histogramBase:0,joinPoints:!1,isHidden:!1,zorder:1}},description:"Rank Correlation Index",shortDescription:"RCI",is_price_study:!1,bands:[{id:"hline_0",name:"Zero Line",isHidden:!1,zorder:-1}],inputs:[{id:"in_0",name:"length",defval:12,type:"integer",min:1,max:1e12}],id:"rank_correlation_index@tv-basicstudies-1",scriptIdPart:"",name:"Rank Correlation Index",format:{precision:2,type:"price"},usePlotsZOrder:!0},constructor:function(){this.orderRank=function(e,t,i){let s=e.get(t),o=1,r=0;for(let t=0;t0?1:-1:a/(l=Math.sqrt(l))},this.main=function(e,t){return this._context=e,this._input=t,[this.trendStrengthIndex()]}}},{name:"Typical Price",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,id:"TypicalPrice@tv-basicstudies-1",scriptIdPart:"",name:"Typical Price",description:"Typical Price",shortDescription:"Typical Price",is_price_study:!0,plots:[{id:"plot_0",type:"line"}],defaults:{styles:{
plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#FF6D00"}},inputs:{}},styles:{plot_0:{title:"Plot"}},inputs:[],format:{type:"inherit"}},constructor:function(){this.main=function(e,t){return this._context=e,this._input=t,[n.hlc3(this._context)]}}},{name:"Ultimate Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:a}},inputs:{in_0:7,in_1:14,in_2:28}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"UO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ultimate Oscillator",shortDescription:"UO",is_price_study:!1,inputs:[{id:"in_0",name:"length7",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"length14",defval:14,type:"integer",min:1,max:1e12},{id:"in_2",name:"length28",defval:28,type:"integer",min:1,max:1e12}],id:"ultimate_oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Ultimate Oscillator",format:{precision:2,type:"price"}},constructor:function(){this.f_0=function(e,t,i){var s=this._context.new_var(e),o=this._context.new_var(t);return[n.sum(s,i,this._context)/n.sum(o,i,this._context)]},this.f_1=function(){var e=this._input(0),t=this._input(1),i=this._input(2),s=this._context.new_var(n.close(this._context)),o=n.max(n.high(this._context),s.get(1)),r=this._context.new_var(n.close(this._context)),a=n.min(n.low(this._context),r.get(1)),l=n.close(this._context)-a,c=o-a,h=this.f_0(l,c,e),d=this.f_0(l,c,t),u=this.f_0(l,c,i);return[100*(4*h[0]+2*d[0]+u[0])/7]},this.main=function(e,t){return this._context=e,this._input=t,this.f_1()}}},{name:"Volatility Close-to-Close",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!1,id:"Volatility Close-to-Close@tv-basicstudies-1",scriptIdPart:"",name:"Volatility Close-to-Close",description:"Volatility Close-to-Close",shortDescription:"Volatility Close-to-Close",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#2196F3"}},inputs:{periods:10,daysPerYear:252}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer",defval:10,min:2},{id:"daysPerYear",name:"Days Per Year",type:"integer",defval:252,min:1,max:366}],format:{precision:2,type:"percent"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.daysPerYear=this._input(1)},this.stdev=function(e,t,i){var s=this.variance(e,t,i);return n.sqrt(s)},this.variance=function(e,t,i){var s=n.sma(e,t,i);return this.variance2(e,s,t)},this.variance2=function(e,t,i){var s,n,o=0;for(s=0;s0&&(l=.12*this.square(e.get()-s.get(1))/this.marketClosedPercentage+.88*l/(1-this.marketClosedPercentage)),l/=a,l*=this.secondsPerYear
;var c=this._context.new_var(l);return 100*Math.sqrt(n.sum(c,this.period,this._context)/this.period)},this.main=function(e,t){return this._context=e,this._input=t,[this.volatilityOHLC()]}}},{name:"Volatility Index",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,is_price_study:!0,id:"Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Volatility Index",description:"Volatility Index",shortDescription:"Volatility Index",plots:[{id:"plot_0",type:"line"}],defaults:{styles:{plot_0:{linestyle:0,visible:!0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:c}},inputs:{periods:10,atrMult:3,method:"Wilder Smoothing"}},styles:{plot_0:{title:"Plot"}},inputs:[{id:"periods",name:"Periods",type:"integer"},{id:"atrMult",name:"ATR Mult",type:"float"},{id:"method",name:"Method",type:"text",defval:"Exponential",options:["Exponential","Wilder Smoothing"]}],format:{type:"inherit"}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this.period=this._input(0),this.atrMult=this._input(1),this.maMethod=this._input(2),this.nextsar=null,this.position=null,this.sic=null,this.bars=[],this.count=0,this.lastSar=null,this._context.setMinimumAdditionalDepth("Exponential"===this.maMethod?2*this.period+2:this.period)},this.computeATR=function(){var e=n.high(this._context)-n.low(this._context),t=n.high(this._context)-this.bars[this.bars.length-2],i=this.bars[this.bars.length-2]-n.low(this._context);return this.tr=Math.max(e,t,i),"Exponential"===this.maMethod?this.atr=n.ema(this._context.new_var(this.tr),this.period,this._context):this.atr=this.tr/this.period+(1-1/this.period)*this.atr,this.atr*this.atrMult},this.calculateVolatility=function(){if(n.close(this._context)===this.bars[this.bars.length-1])return this.lastSar;if(this.bars.push(n.close(this._context)),1===this.count)this.atr=n.high(this._context)-n.low(this._context),this.sic=n.close(this._context);else if(this.countthis.sic&&(this.sic=n.close(this._context))}else if(this.count===this.period){e=n.high(this._context)-n.low(this._context),t=n.high(this._context)-this.bars[this.bars.length-2],i=this.bars[this.bars.length-2]-n.low(this._context);this.atr+=Math.max(e,t,i),this.atr*=1/this.period,n.close(this._context)>this.sic&&(this.sic=n.close(this._context)),this.position="LONG",this.nextsar=this.sic-this.atr*this.atrMult}else{var s=this.nextsar;"LONG"===this.position?n.close(this._context)s?(this.position="LONG",this.sic=n.close(this._context),this.nextsar=this.sic-this.computeATR()):(this.position="SHORT",
this.sic=Math.min(n.close(this._context),this.sic),this.nextsar=this.sic+this.computeATR())),this.lastSar=s}return this.count++,s},this.main=function(e,t){return this._context=e,this._input=t,this._context.select_sym(0),[this.calculateVolatility()]}}},{name:"VWAP",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{inputs:{in_0:"hlc3",in_anchor:"Session"},styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:0,transparency:0,visible:!0,color:"#2196F3"}}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"VWAP",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"VWAP",shortDescription:"VWAP",is_price_study:!0,inputs:[{id:"in_0",name:"Source",defval:"hlc3",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_anchor",name:"Anchor Period",defval:"Session",type:"text",options:["Session","Week","Month","Quarter","Year","Decade","Century"]}],id:"VWAP@tv-basicstudies-1",scriptIdPart:"",name:"VWAP",format:{type:"inherit"}},constructor:function(){this.f_1=function(e){e.reset_hist()},this.createAnchorChecker=function(e,t){switch(t){case"Week":return function(t,i){return n.weekofyear(e,t)!==n.weekofyear(e,i)||n.year(e,t)!==n.year(e,i)};case"Month":return function(t,i){return n.month(e,t)!==n.month(e,i)||n.year(e,t)!==n.year(e,i)};case"Quarter":return function(t,i){return Math.floor(n.month(e,t)/3)!==Math.floor(n.month(e,i)/3)||n.year(e,t)!==n.year(e,i)};case"Year":return function(t,i){return n.year(e,t)!==n.year(e,i)};case"Decade":return function(t,i){return Math.floor(n.year(e,t)/10)!==Math.floor(n.year(e,i)/10)};case"Century":return function(t,i){return Math.floor(n.year(e,t)/100)!==Math.floor(n.year(e,i)/100)};default:return e=>this._isFirstBarInSession(e)}},this.init=function(e,t){this._input=t,this._isFirstBarInSession=null;const i=this._input(1)||"Session";this._anchorChecker=this.createAnchorChecker(e,i)},this.main=function(e,t){this._context=e,this._input=t;const i=this._input(0);var s=e.new_var(),o=e.new_var(),r=e.new_var();const a=n.time(this._context),l=this._context.new_unlimited_var(a).get(1);if(a){if(null===this._isFirstBarInSession){const t=n.createNthBarInSessionCheck(e);this._isFirstBarInSession=e=>t(e,0)}this._anchorChecker(a,l)&&(this.f_1(s),this.f_1(o),r.set(a))}return s.set(n.nz(s.get(1))+n[i](this._context)*n.volume(this._context)),o.set(n.nz(o.get(1))+n.volume(this._context)),n.na(r.get(0))?[NaN]:[s.get(0)/o.get(0)]}}},{name:"VWMA",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"VWMA",shortDescription:"VWMA",is_price_study:!0,inputs:[{id:"in_0",name:"len",defval:20,type:"integer",min:1,max:1e4}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,
this._input=t;var i=n.close(this._context),s=this._input(0),o=this._context.new_var(i);return[n.vwma(o,s,this._context)]}}},{name:"Volume Oscillator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,zorder:1}},description:"Volume Oscillator",shortDescription:"Volume Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero",zorder:-1}],inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:4999},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:4999}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator",format:{precision:2,type:"percent"},usePlotsZOrder:!0},constructor:function(){this.f_0=function(e,t){return 100*(e-t)/t},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=n.volume(this._context),r=this._context.new_var(o),a=n.ema(r,i,this._context),l=this._context.new_var(o),c=n.ema(l,s,this._context);return[this.f_0(a,c)]}}},{name:"Vortex Indicator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#E91E63"}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"VI +",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"VI -",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Vortex Indicator",shortDescription:"VI",is_price_study:!1,is_hidden_study:!1,id:"vortex_indicator@tv-basicstudies-1",inputs:[{id:"in_0",name:"Period",defval:14,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Vortex Indicator",format:{precision:4,type:"price"}},constructor:function(){this.f_0=function(){var e=this._input(0),t=this._context.new_var(n.low(this._context)),i=this._context.new_var(n.abs(n.high(this._context)-t.get(1))),s=n.sum(i,e,this._context),o=this._context.new_var(n.high(this._context)),r=this._context.new_var(n.abs(n.low(this._context)-o.get(1))),a=n.sum(r,e,this._context),l=this._context.new_var(n.atr(1,this._context)),c=n.sum(l,e,this._context);return[s/c,a/c]},this.main=function(e,t){return this._context=e,this._input=t,this.f_0()}}},{name:"Willams %R",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#7E57C2"}},bands:[{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-20},{color:"#787B86",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#7E57C2",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{
title:"Plot",histogramBase:0,joinPoints:!1,zorder:1}},description:"Williams %R",shortDescription:"%R",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit",zorder:-1.1},{id:"hline_1",name:"LowerLimit",zorder:-1.11}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background",zorder:-2}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R",format:{precision:2,type:"price"},usePlotsZOrder:!0},constructor:function(){this.f_0=function(e,t,i){return 100*(e-t)/(t-i)},this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=n.high(this._context),o=this._context.new_var(s),r=n.highest(o,i,this._context),a=n.low(this._context),l=this._context.new_var(a),c=n.lowest(l,i,this._context);return[this.f_0(n.close(this._context),r,c)]}}},{name:"Williams Alligator",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#2196F3"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#E91E63"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0,color:"#66BB6A"}},inputs:{in_0:21,in_1:13,in_2:8,in_3:8,in_4:5,in_5:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Jaw",histogramBase:0,joinPoints:!1},plot_1:{title:"Teeth",histogramBase:0,joinPoints:!1},plot_2:{title:"Lips",histogramBase:0,joinPoints:!1}},description:"Williams Alligator",shortDescription:"Alligator",is_price_study:!0,inputs:[{id:"in_0",name:"Jaw Length",defval:21,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["plot_0"]},{id:"in_1",name:"Teeth Length",defval:13,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["plot_1"]},{id:"in_2",name:"Lips Length",defval:8,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["plot_2"]},{id:"in_3",name:"Jaw Offset",defval:8,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["plot_0"]},{id:"in_4",name:"Teeth Offset",defval:5,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["plot_1"]},{id:"in_5",name:"Lips Offset",defval:3,type:"integer",min:1,max:2e3,hideWhenPlotsHidden:["plot_2"]}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator",format:{type:"inherit"}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._input(0),s=this._input(1),o=this._input(2),r=this._input(3),a=this._input(4),l=this._input(5),c=n.hl2(this._context);return[{value:n.smma(c,i,this._context),offset:r},{value:n.smma(c,s,this._context),offset:a},{value:n.smma(c,o,this._context),offset:l}]}}},{name:"Williams Fractals",metainfo:{_metainfoVersion:52,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{plottype:"shape_triangle_down",visible:!0,location:"BelowBar",transparency:0,color:a},plot_1:{plottype:"shape_triangle_up",visible:!0,location:"AboveBar",transparency:0,color:u}},inputs:{
in_0:2}},plots:[{id:"plot_0",type:"shapes"},{id:"plot_1",type:"shapes"}],styles:{plot_0:{title:"Down fractals",isHidden:!1},plot_1:{title:"Up fractals",isHidden:!1}},description:"Williams Fractal",shortDescription:"Fractals",is_price_study:!0,is_hidden_study:!1,id:"Williams Fractals@tv-basicstudies-1",inputs:[{id:"in_0",name:"Periods",defval:2,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Williams Fractals",isCustomIndicator:!0,format:{type:"inherit"}},constructor:function(){this.f_0=function(){for(var e=this._input(0),t=this._context.new_var(n.high(this._context)),i=!0,s=!0,o=!0,r=!0,a=!0,l=!0,c=1;c<=e;c++)i=n.and(i,n.lt(t.get(e-c),t.get(e))),s=n.and(s,n.lt(t.get(e+c),t.get(e))),o=n.and(o,n.and(n.le(t.get(e+1),t.get(e)),n.lt(t.get(e+c+1),t.get(e)))),r=n.and(r,n.and(n.le(t.get(e+1),t.get(e)),n.and(n.le(t.get(e+2),t.get(e)),n.lt(t.get(e+c+2),t.get(e))))),a=n.and(a,n.and(n.le(t.get(e+1),t.get(e)),n.and(n.le(t.get(e+2),t.get(e)),n.and(n.le(t.get(e+3),t.get(e)),n.lt(t.get(e+c+3),t.get(e)))))),l=n.and(l,n.and(n.le(t.get(e+1),t.get(e)),n.and(n.le(t.get(e+2),t.get(e)),n.and(n.le(t.get(e+3),t.get(e)),n.and(n.le(t.get(e+4),t.get(e)),n.lt(t.get(e+c+4),t.get(e)))))));var h=n.or(s,n.or(o,n.or(r,n.or(a,l)))),d=n.and(i,h),u=this._context.new_var(n.low(this._context)),_=1,p=1,m=1,g=1,f=1,y=1;for(c=1;c<=e;c++)_=n.and(_,n.gt(u.get(e-c),u.get(e))),p=n.and(p,n.gt(u.get(e+c),u.get(e))),m=n.and(m,n.and(n.ge(u.get(e+1),u.get(e)),n.gt(u.get(e+c+1),u.get(e)))),g=n.and(g,n.and(n.ge(u.get(e+1),u.get(e)),n.and(n.ge(u.get(e+2),u.get(e)),n.gt(u.get(e+c+2),u.get(e))))),f=n.and(f,n.and(n.ge(u.get(e+1),u.get(e)),n.and(n.ge(u.get(e+2),u.get(e)),n.and(n.ge(u.get(e+3),u.get(e)),n.gt(u.get(e+c+3),u.get(e)))))),y=n.and(y,n.and(n.ge(u.get(e+1),u.get(e)),n.and(n.ge(u.get(e+2),u.get(e)),n.and(n.ge(u.get(e+3),u.get(e)),n.and(n.ge(u.get(e+4),u.get(e)),n.gt(u.get(e+c+4),u.get(e)))))));var v=n.or(p,n.or(m,n.or(g,n.or(f,y))));return[n.and(_,v),d]},this.main=function(e,t){this._context=e,this._input=t;var i=this.f_0();return[{value:i[0],offset:-this._input(0)},{value:i[1],offset:-this._input(0)}]}}},{name:"Guppy Multiple Moving Average",metainfo:{isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,description:"Guppy Multiple Moving Average",shortDescription:"GMMA",is_price_study:!0,id:"Guppy Multiple Moving Average@tv-basicstudies-1",_metainfoVersion:52,format:{type:"inherit"},defaults:{inputs:{traderEMA1Length:3,traderEMA2Length:5,traderEMA3Length:8,traderEMA4Length:10,traderEMA5Length:12,traderEMA6Length:15,investorEMA1Length:30,investorEMA2Length:35,investorEMA3Length:40,investorEMA4Length:45,investorEMA5Length:50,investorEMA6Length:60},styles:{traderEMA1:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:15,visible:!0},traderEMA2:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:12,visible:!0},traderEMA3:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:9,visible:!0},traderEMA4:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:6,
visible:!0},traderEMA5:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:3,visible:!0},traderEMA6:{color:"#00FFFF",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0},investorEMA1:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:15,visible:!0},investorEMA2:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:12,visible:!0},investorEMA3:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:9,visible:!0},investorEMA4:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:6,visible:!0},investorEMA5:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:3,visible:!0},investorEMA6:{color:"#FF0000",linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,visible:!0}}},inputs:[{defval:3,id:"traderEMA1Length",max:1e3,min:1,name:"Trader EMA 1 length",type:"integer",hideWhenPlotsHidden:["traderEMA1"]},{defval:5,id:"traderEMA2Length",max:1e3,min:1,name:"Trader EMA 2 length",type:"integer",hideWhenPlotsHidden:["traderEMA2"]},{defval:8,id:"traderEMA3Length",max:1e3,min:1,name:"Trader EMA 3 length",type:"integer",hideWhenPlotsHidden:["traderEMA3"]},{defval:10,id:"traderEMA4Length",max:1e3,min:1,name:"Trader EMA 4 length",type:"integer",hideWhenPlotsHidden:["traderEMA4"]},{defval:12,id:"traderEMA5Length",max:1e3,min:1,name:"Trader EMA 5 length",type:"integer",hideWhenPlotsHidden:["traderEMA5"]},{defval:15,id:"traderEMA6Length",max:1e3,min:1,name:"Trader EMA 6 length",type:"integer",hideWhenPlotsHidden:["traderEMA6"]},{defval:30,id:"investorEMA1Length",max:1e3,min:1,name:"Investor EMA 1 length",type:"integer",hideWhenPlotsHidden:["investorEMA1"]},{defval:35,id:"investorEMA2Length",max:1e3,min:1,name:"Investor EMA 2 length",type:"integer",hideWhenPlotsHidden:["investorEMA2"]},{defval:40,id:"investorEMA3Length",max:1e3,min:1,name:"Investor EMA 3 length",type:"integer",hideWhenPlotsHidden:["investorEMA3"]},{defval:45,id:"investorEMA4Length",max:1e3,min:1,name:"Investor EMA 4 length",type:"integer",hideWhenPlotsHidden:["investorEMA4"]},{defval:50,id:"investorEMA5Length",max:1e3,min:1,name:"Investor EMA 5 length",type:"integer",hideWhenPlotsHidden:["investorEMA5"]},{defval:60,id:"investorEMA6Length",max:1e3,min:1,name:"Investor EMA 6 length",type:"integer",hideWhenPlotsHidden:["investorEMA6"]}],plots:[{id:"traderEMA1",type:"line"},{id:"traderEMA2",type:"line"},{id:"traderEMA3",type:"line"},{id:"traderEMA4",type:"line"},{id:"traderEMA5",type:"line"},{id:"traderEMA6",type:"line"},{id:"investorEMA1",type:"line"},{id:"investorEMA2",type:"line"},{id:"investorEMA3",type:"line"},{id:"investorEMA4",type:"line"},{id:"investorEMA5",type:"line"},{id:"investorEMA6",type:"line"}],styles:{traderEMA1:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 1"},traderEMA2:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 2"},traderEMA3:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 3"},traderEMA4:{histogramBase:0,isHidden:!1,joinPoints:!1,
title:"Trader EMA 4"},traderEMA5:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 5"},traderEMA6:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Trader EMA 6"},investorEMA1:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 1"},investorEMA2:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 2"},investorEMA3:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 3"},investorEMA4:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 4"},investorEMA5:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 5"},investorEMA6:{histogramBase:0,isHidden:!1,joinPoints:!1,title:"Investor EMA 6"}}},constructor:function(){this.main=function(e,t){this._context=e,this._input=t;var i=this._context.new_var(n.close(this._context)),s=this._input(0),o=this._input(1),r=this._input(2),a=this._input(3),l=this._input(4),c=this._input(5),h=n.ema(i,s,this._context),d=n.ema(i,o,this._context),u=n.ema(i,r,this._context),_=n.ema(i,a,this._context),p=n.ema(i,l,this._context),m=n.ema(i,c,this._context),g=this._input(6),f=this._input(7),y=this._input(8),v=this._input(9),S=this._input(10),b=this._input(11);return[h,d,u,_,p,m,n.ema(i,g,this._context),n.ema(i,f,this._context),n.ema(i,y,this._context),n.ema(i,v,this._context),n.ema(i,S,this._context),n.ema(i,b,this._context)]}}},{name:"52 Week High/Low",metainfo:{_metainfoVersion:52,id:"52 Week High/Low@tv-basicstudies-1",description:"52 Week High/Low",shortDescription:"52W H/L",is_price_study:!0,format:{type:"inherit"},plots:[],graphics:{horizlines:{highest:{name:"Highest"},lowest:{name:"Lowest"}}},inputs:[{defval:"close",id:"highestSource",name:"High source",options:["close","high"],type:"text"},{defval:"close",id:"lowestSource",name:"Low source",options:["close","low"],type:"text"}],defaults:{graphics:{horizlines:{highest:{color:"rgb(93, 96, 107)",showPrice:!0,style:1,visible:!0,width:2},lowest:{color:"rgb(93, 96, 107)",showPrice:!0,style:1,visible:!0,width:2}}},inputs:{highestSource:"close",lowestSource:"close"}}},constructor:function(){this.init=function(e,t){this._context=e,this._input=t,this._symbolSupports1DResolution=!this._context.symbol.info.supported_resolutions||-1!==this._context.symbol.info.supported_resolutions.indexOf("1D"),this._symbolSupports1DResolution&&"1D"!==n.period(this._context)&&this._context.new_sym(this._context.symbol.ticker,"1D")},this.main=function(e,t){this._symbolSupports1DResolution||n.error(`Daily bars are not available for ${this._context.symbol.info.name}`),this._context=e,this._input=t,"1D"!==n.period(this._context)&&this._context.select_sym(1);const i=this._input(0),s=this._input(1),o=n.time(this._context),r=this._context.new_unlimited_var(o),a=this._context.new_unlimited_var(n[i](this._context)),l=this._context.new_unlimited_var(n[s](this._context));if(r.get(365),!this._context.symbol.isLastBar||!this._context.symbol.isNewBar)return null
;const c=n.add_years_considering_dst(this._context.symbol.info.timezone,new Date(o),-1),h=r.indexOf(c.getTime()),d=-1===h?NaN:n.highest(a,h,this._context),u=-1===h?NaN:n.lowest(l,h,this._context);if(isNaN(d)||isNaN(u))return{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{erase:[{action:"all"}]}}};return{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{horizlines:[{styleId:"highest",data:[{startIndex:o,endIndex:o,level:d,extendLeft:!0,extendRight:!0}]},{styleId:"lowest",data:[{startIndex:o,endIndex:o,level:u,extendLeft:!0,extendRight:!0}]}]},erase:[{action:"all"}]}}}}}}]},91007:(e,t,i)=>{"use strict";var s;i.d(t,{SubsessionId:()=>s}),function(e){e.Regular="regular",e.Extended="extended",e.PreMarket="premarket",e.PostMarket="postmarket"}(s||(s={}))},16426:(e,t,i)=>{"use strict";i.d(t,{PointsetsManager:()=>r});var s=i(9343),n=i(85049);const o=(0,s.getLogger)("ChartApi.PointsetsManager");class r{constructor(){this._pointsetsDataBySymbol=new Map}destroy(){this._pointsetsDataBySymbol.clear()}createPointset(e,t,i,s,n){let r=this._pointsetsDataBySymbol.get(t);void 0===r&&(r=new Map,this._pointsetsDataBySymbol.set(t,r));const a=[];for(const t of s){const[s,r,l]=t;if("number"!=typeof s||Number.isNaN(s)){o.logWarn(`Pointset time is invalid: id=${e}, ${s} of type ${typeof s}`);continue}const c=n(l||i);a.push({point:t,extrapolation:c.extrapolateTimeWithOffsetToTime(1e3*s,r)})}s.length===a.length&&r.set(e,{resolution:i,points:a})}removePointset(e){const t=[];this._pointsetsDataBySymbol.forEach(((i,s)=>{i.delete(e),0===i.size&&t.push(s)}));for(const e of t)this._pointsetsDataBySymbol.delete(e)}invalidatePointsetsForSymbol(e,t){const i=this._pointsetsDataBySymbol.get(e);void 0!==i&&i.forEach(((e,i)=>{if(n.Interval.isEqual(e.resolution,t))for(const t of e.points)null!==t.extrapolation&&t.extrapolation.exact&&(t.extrapolation.exact=!1)}))}getUpdatesForSymbol(e,t,i,s){const n=new Map,o=this._pointsetsDataBySymbol.get(e);return void 0!==o&&o.forEach(((e,o)=>{const r=this._refreshPointsetData(e,t,i,s);null!==r&&n.set(o,r)})),n}_refreshPointsetData(e,t,i,s){if(n.Interval.isEqual(e.resolution,t))for(let s=0;s ${t}`),null;r.push({index:i,value:[a.index,a.timeMs/1e3]})}return r}}},73461:(e,t,i)=>{"use strict";i.d(t,{postProcessSymbolInfo:()=>o});var s=i(85049),n=i(91007);function o(e,t){if(e.ticker||(e.ticker=e.symbol||e.name),e.full_name=t.shouldUseTickerNotSymbol?e.ticker:`${e.exchange}:${e.name}`,e.pro_name=e.full_name,e.base_name||(e.base_name=[e.name]),e.legs||(e.legs=[e.name]),e.exchange||(e.exchange=e["exchange-listed"]),e.data_status||(e.data_status="streaming"),
!e.session&&e["session-regular"]&&(e.session=e["session-regular"]),!e.minmov&&e.minmovement&&(e.minmov=e.minmovement),e.currency_code&&(e.currency_id=e.currency_code),e.original_currency_code&&(e.original_currency_id=e.original_currency_code),e.holidays&&(e.session_holidays=e.holidays),void 0!==e.has_no_volume&&(e.visible_plots_set=e.has_no_volume?"ohlc":"ohlcv"),void 0===e.visible_plots_set&&(e.visible_plots_set="ohlcv"),e.supported_resolutions)for(let t=0;t{"use strict";i.d(t,{SessionTimeScale:()=>v});var s=i(50151),n=i(56570),o=i(2740),r=i(29981),a=i(53388),l=i(50503),c=i(9447);function h(e){return 60*e*60*1e3}function d(e){return 60*e*1e3}const u=[{divisor:1,weight:18},{divisor:(_=1,1e3*_),weight:19},{divisor:d(1),weight:20},{divisor:d(5),weight:21},{divisor:d(30),weight:22},{divisor:h(1),weight:30},{divisor:h(3),weight:31},{divisor:h(6),weight:32},{divisor:h(12),weight:33}];var _,p;function m(e,t){if(null!==t){if(e.getUTCFullYear()!==t.getUTCFullYear())return 70;if(e.getUTCMonth()!==t.getUTCMonth())return 60;if(e.getUTCDate()!==t.getUTCDate())return 50;const i=t.getTime(),s=e.getTime();for(let e=u.length-1;e>=0;--e)if(Math.floor(i/u[e].divisor)!==Math.floor(s/u[e].divisor))return u[e].weight}return 18}function g(e,t,i=0){if(0===e.length)return[];let s=i,n=i;const o=[];for(;s=t.length?(o.push({old:s,new:l.INVALID_TIME_POINT_INDEX}),s++):e[s].timeMs===t[n].timeMs?(s!==n&&o.push({old:s,new:n}),s++,n++):e[s].timeMs{if(e.new===t.new&&e.new===l.INVALID_TIME_POINT_INDEX)return e.old-t.old;if(e.new===l.INVALID_TIME_POINT_INDEX)return-1;if(t.new===l.INVALID_TIME_POINT_INDEX)return 1;const i=e.old-e.new,s=t.old-t.new;return i>0?s>0?e.old-t.old:-1:s<0?t.new-e.new:1}))}function f(e,t){return{span:e.markWeight,time:e.displayTime,index:t}}!function(e){e[e.FutureTickMarksLimit=1e3]="FutureTickMarksLimit"}(p||(p={}));const y=n.enabled("end_of_period_timescale_marks");class v{constructor(){this._completed=!0,this._mainSymbolExtrapolator=null,this._pointDataByTimePoint=new Map,this._instanceIds=new Set,this._displayTimezone=null,this._minFutureBarsCount=0,this._sortedTimePoints=[]}destroy(){this.clearTimeScale()}setCompleted(e){this._completed=e}isCompleted(){return this._completed}clearTimeScale(){return this._pointDataByTimePoint.clear(),this._instanceIds.clear(),this._sortedTimePoints=[],{baseIndex:null,pointsIndex:0,indexChange:[],marks:[],
points:[]}}indexOfTime(e){if(0===this._sortedTimePoints.length)return null===this._mainSymbolExtrapolator?null:this._mainSymbolExtrapolator.indexOfTime(e);if(ethis._sortedTimePoints[this._sortedTimePoints.length-1].timeMs){if(null===this._mainSymbolExtrapolator)return null;const t=this._mainSymbolExtrapolator.indexOfTime(e),i=this._mainSymbolExtrapolator.indexOfTime(this._sortedTimePoints[this._sortedTimePoints.length-1].timeMs);if(null===t||null===i)return null;const s=t.index-i.index-1;return{index:this._sortedTimePoints.length+s,timeMs:t.timeMs}}let t=(0,r.lowerbound)(this._sortedTimePoints,e,((e,t)=>e.timeMs({timeMs:e,markWeight:0,displayTime:NaN})));this._fillPointsData(i,0,0!==this._sortedTimePoints.length?this._sortedTimePoints[this._sortedTimePoints.length-1].displayTime:null);const n=[];for(let t=e;tf(e,i+t)));return n.concat(o)}setTimezone(e){this._displayTimezone="exchange"===e?null:(0,o.get_timezone)(e),this._fillPointsData(this._sortedTimePoints,0)}fillIndexesInRows(e){if(0===e.length)return;let t=-1,i=(0,r.lowerbound)(this._sortedTimePoints,Math.round(1e3*e[0].value[0]),((e,t)=>e.timeMse.timeMs{for(;n=this._sortedTimePoints.length){const t=this.indexOfTime(e)
;if(null===t)return l.INVALID_TIME_POINT_INDEX;n=t.timeMs!==e?t.index+1:t.index}return(!t||o>0&&e<=r[o-1])&&(0,s.assert)(n>i,"data must have unique sorted times"),i=n,n}))}firstSeriesBarTime(){return 0===this._sortedTimePoints.length?null:this._sortedTimePoints[0].timeMs}replaceBarsTimesTail(e,t){if(0===t.length)return null;if(!this._instanceIds.has(e))return this.setSeriesBarsTimes(e,t);const i=[],s=(0,r.lowerbound)(this._sortedTimePoints,t[0],((e,t)=>e.timeMs({timeMs:e.timeMs,pointData:e.pointData,markWeight:0,displayTime:NaN})));for(let e=s;ee.timeMs-t.timeMs));const a=this._updateTimeScalePointsTail(o);return this._applyTimeScaleChanges(a,!1)}setSeriesBarsTimes(e,t){return this._setBarsTimes(e,t)}setStudyBarsTimes(e,t){return this._setBarsTimes(e,t)}_setBarsTimes(e,t){const i=0!==this._pointDataByTimePoint.size;if(this._instanceIds.has(e))for(const t of this._sortedTimePoints)t.pointData.instances.delete(e);0===t.length?this._instanceIds.delete(e):this._instanceIds.add(e),this._addBarsTimesToInstance(e,t,!1),i&&this._cleanupPointsData(this._sortedTimePoints);const s=[];this._pointDataByTimePoint.forEach(((e,t)=>{s.push({markWeight:0,timeMs:t,displayTime:NaN,pointData:e})})),s.sort(((e,t)=>e.timeMs-t.timeMs));const n=this._updateTimeScalePoints(s);return this._applyTimeScaleChanges(n,!1)}_updateFutureBars(){if(0===this._minFutureBarsCount||null===this._mainSymbolExtrapolator)return;if(0!==this._sortedTimePoints.length){const e=this._sortedTimePoints[this._sortedTimePoints.length-1].timeMs;this._mainSymbolExtrapolator.ensureExtrapolatedToFutureTime(e)}const e=this._futureBarsFirstPointIndex();this._mainSymbolExtrapolator.setMinFutureBarsCount(e+this._minFutureBarsCount)}_addBarsTimesToInstance(e,t,i){const s=i?[]:null;for(const i of t){const t=this._pointDataByTimePoint.get(i);if(void 0===t){const t=new Set;t.add(e);const n={index:0,instances:t};this._pointDataByTimePoint.set(i,n),null!==s&&s.push({timeMs:i,pointData:n})}else t.instances.add(e)}return s}_futureBarsFirstPointIndex(){if(null===this._mainSymbolExtrapolator||0===this._sortedTimePoints.length)return 0;const e=this._mainSymbolExtrapolator.futureBars();return(0,r.upperbound_int)(e,this._sortedTimePoints[this._sortedTimePoints.length-1].timeMs)}_futureBars(){return null===this._mainSymbolExtrapolator?[]:this._mainSymbolExtrapolator.futureBars().slice(this._futureBarsFirstPointIndex(),this._futureBarsFirstPointIndex()+1e3)}_cleanupPointsData(e){for(const t of e)0===t.pointData.instances.size&&this._pointDataByTimePoint.delete(t.timeMs)}_updateTimeScalePoints(e){let t=-1;for(let i=0;ie.timeMs=this._sortedTimePoints.length)continue;this._sortedTimePoints[o].timeMs!==n.timeMs&&-1===i&&(i=o)}const s=t+e.length;if(i=S(i,this._sortedTimePoints.length,s),-1===i)return null;this._fillPointsData(e,0,0===t||0===this._sortedTimePoints.length?null:this._sortedTimePoints[t-1].displayTime);const n=g(this._sortedTimePoints.slice(t),e).map((e=>({old:e.old+t,new:e.new===l.INVALID_TIME_POINT_INDEX?e.new:e.new+t})));{const i=this._sortedTimePoints;let n=0;for(;t+n1&&null===i){const t=Math.ceil(o/(e.length-1)),i=new Date(1e3*(e[0].displayTime-t));e[0].markWeight=m(new Date(1e3*e[0].displayTime),i)}}(e,t,i)}_applyTimeScaleChanges(e,t){if(null===e)return t?(this._fillPointsData(this._sortedTimePoints,0),{points:[],pointsIndex:0,baseIndex:this._getBaseIndex(),indexChange:[],marks:this.tickMarks(0)}):null;let i=e.pointsIndex;if(0!==i&&t&&(this._fillPointsData(this._sortedTimePoints,0),i=0),0===this._sortedTimePoints.length)return{baseIndex:null,pointsIndex:0,indexChange:[],marks:[],points:[]};const s=[];for(let t=e.pointsIndex;t{"use strict";i.d(t,{JSStudyEngineTypescript:()=>r});var s=i(56570),n=i(80359),o=i.n(n);class r extends(o()){_studyCanExtendTimeScale(e,t){const i=this._studiesCache[e][t]?.metainfo;return void 0!==i&&(s.enabled("studies_extend_time_scale")&&i.canExtendTimeScale||s.enabled("secondary_series_extend_time_scale")&&"Overlay@tv-basicstudies-1"===i.id)}}},80359:(e,t,i)=>{"use strict";var s=i(2060),n=i(20629).StudyEngine,o=i(3075).OHLCV,r=i(36802),a=i(1430).SymbolExtrapolator,l=i(75683).SessionTimeScale,c=i(16426).PointsetsManager,h=i(14381),d=i(53388).createDwmAligner,u=i(85049).Interval,_=i(76422),p=i(44843).visitObject,m=i(37265).isObject;i(42924),i(6058);var g=i(47282).DatafeedRequestsCachedProcessor,f=i(63950).timezoneIsAvailable,y=i(53388).isAlignmentEnabled,v=i(73698),S=v.isEncodedExtendedSymbol,b=v.decodeExtendedSymbol,w=i(68805).extractSymbolNameFromSymbolInfo,C=i(30328).replaceGraphicsTimesWithTimePointIndexIndex,P=i(56570);const{findSuitableResolutionToBuildFrom:T}=i(67153);var x=i(91007).SubsessionId,I=i(14381).getPeriodsBetweenDates,M=i(39692).overwriteVolumeProfileResolutionForPeriodGetter,{INVALID_TIME_POINT_INDEX:A}=i(50503),L=i(73461).postProcessSymbolInfo,k=i(33030).CLOSE_PLOT;const D="pre_post_market_sessions",E=P.enabled(D),B=P.enabled("pay_attention_to_ticker_not_symbol");function V(e,t,i,s){return[e,t,i,s].filter((e=>!!e)).join("|")}var R=-5e6;function N(e){var t=e.findIndex((function(e){return e.index!==R}));return-1===t?[]:0===t?e:e.slice(t)}function O(e,t,i){if(i.logoid=void 0,i["base-currency-logoid"]=void 0,i["currency-logoid"]=void 0,e){if("string"==typeof e)return void U("`logo_urls` should be an array of urls, not a string.");const[t,s]=e;s?(i["base-currency-logoid"]=t,i["currency-logoid"]=s):i.logoid=e}t&&(i.provider_id=t,i.country=void 0)}function F(e,t){return e+"_"+t}function W(e){if(null===e||"number"==typeof e)return e;if("object"==typeof e&&Array.isArray(e)){switch(e[0]){case"bar_count":return e[2];case"from_to":return e.length>=3?e[2]:null}}return null}function H(e){const t=b(e),i="string"==typeof t.symbol?t:t.symbol;return[i.symbol,{currency:i["currency-id"],unit:i["unit-id"],session:i.session===x.Regular?void 0:i.session}]}var z=function(e){var t=this;this._studiesCache={},this._objectsDataCache={},this._studiesNonSeriesTimes={},this._metainfoCache=[],this._barsCoefficientsCache={},this._externalDatafeed=e,e.getVolumeProfileResolutionForPeriod&&M((function(t,i,s,n){return e.getVolumeProfileResolutionForPeriod(t,i,s,n)})),this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._resolvePromisesBySymbolId=new Map,this._symbolIdToSymbolRequestString=new Map,this._callbacks={},this._serverTimeOffset=0,t._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),t._datafeedConfiguration=t._adoptConfigurationData(window.configurationData),t._fireEvent("configuration_received"),
t._externalDatafeed.getServerTime&&t._externalDatafeed.getServerTime((function(e){t._serverTimeOffset=e-(new Date).valueOf()/1e3})),this._invalidatedPointsetSessions=new Set,this._refreshPointsetsTimerId=null,this._pointsetsManagers={},this._quotesInfo=[],this._depthInfo=[],this._endOfData={},this._computeStudyCounter=0,this._symbolExtrapolators={},this._timeScales={},this._cachedDatafeed=new g(e,this.serverTimeOffset.bind(this),this._datafeedConfiguration.reset_cache_timeout),r.setupFeed({resolve:function(e,i,s,n){t._resolveSymbolByName(e,i,s,n)},subscribe:function(e,i,s,n,o){return t._cachedDatafeed.subscribe(e,i,s,function(e,i,s){var n=new h.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections),o=h.newBarBuilder(i,n,n);return function(e){if(e&&e.count()){var i=1e3*t.getCurrentUTCTime();o.moveTo(i),o.indexOfBar(i)>=0&&e.setLastBarClosed(!1)}s(e)}}(e,i,n),o)},unsubscribe:function(e){return t._cachedDatafeed.unsubscribe(e)}})};function U(e){console.warn(`${(new Date).toISOString()} ${e}`)}function j(e,t){return e+"_"+t}function G(e,t,i,s){return e+(t?"_#_"+t:"")+(i?"_#_"+i:"")+(s?"_#_"+s:"")}z.prototype._getSymbolExtrapolator=function(e,t,i){var s=u.normalize(i),n=function(e,t,i){const s=void 0!==t.subsession_id?","+t.subsession_id:"";return e+","+t.full_name+","+i+s}(e,t,s),o=this._symbolExtrapolators[n];return void 0===o&&(o=new a(t,s),this._symbolExtrapolators[n]=o),o},z.prototype._barsCoefficients=function(e,t){if(void 0===b(e).type)return{};var i=e+t;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},z.prototype.destroy=function(){for(const e of Object.keys(this._quotesInfo))this._stopQuotesSubscription(e);this._cachedDatafeed.destroy(),this._externalDatafeed=null;for(const e of Object.keys(this._pointsetsManagers))this._pointsetsManagers[e].destroy();this._quotesInfo={},this._pointsetsManagers={}},z.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={},this._objectsDataCache={},this._studiesNonSeriesTimes={},this._studiesCache={},this._resolvePromisesBySymbolId.clear(),this._symbolIdToSymbolRequestString.clear(),Object.keys(this._pointsetsManagers).forEach((function(e){this._pointsetsManagers[e].destroy()}),this),this._pointsetsManagers={},Object.keys(this._timeScales).forEach((function(e){this._timeScales[e].destroy()}),this),this._timeScales={},Object.keys(this._symbolExtrapolators).forEach((function(e){this._symbolExtrapolators[e].destroy()}),this),this._symbolExtrapolators={}},z.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},z.prototype._logMessage=function(e){P.enabled("charting_library_debug_mode")&&console.log(`${(new Date).toISOString()} ${e}`)},z.prototype.on=function(e,t){return this._callbacks.hasOwnProperty(e)||(this._callbacks[e]=[]),this._callbacks[e].push(t),this},z.prototype._fireEvent=function(e,t,i){if(this._callbacks.hasOwnProperty(e)){for(var s=this._callbacks[e],n=0;n{this._resolveSymbolImpl(e,(e=>{t(e.price_sources)}),(e=>{i(e)}))}))},z.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},z.prototype.symbolsGrouping=function(){return this._datafeedConfiguration.symbols_grouping||{futures:/$a/}},z.prototype._findStudyObject=function(e){e.endsWith("!")&&(e=e.slice(0,-1));var t=e.split("@")[0],i=JSServer.studyLibrary.filter((function(i){return i.metainfo.id===e||i.metainfo.shortDescription===t}));return 0===i.length?null:i[0]},z.prototype.getMarks=function(e,t,i,s,n){var o={red:6,green:5,blue:4,yellow:3};if(this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks){this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,n,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString()));var r=this;this._externalDatafeed.getMarks(e,t,i,(function(t){var i=t.map((function(e){return e.time=parseInt(e.time),e}));r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,n,JSON.stringify(i)));var a=d(n,e),l=P.enabled("two_character_bar_marks_labels"),c=i.map((function(e){return e.tickmark=null!==a?a.timeToSessionStart(1e3*e.time)/1e3:e.time,e.direction=o[e.color],e.onClicked=function(){_.emit("onMarkClick",e.id)},e.label=!!e.label&&(l?e.label.slice(0,2):e.label[0]),e}));s(c)}),n)}},z.prototype.getTimescaleMarks=function(e,t,i,s,n){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(e.full_name,n,new Date(1e3*t).toUTCString(),new Date(1e3*i).toUTCString()));var o=this;this._externalDatafeed.getTimescaleMarks(e,t,i,(function(t){o._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(e.full_name,n,JSON.stringify(t)));var i=d(n,e),r=t.map((function(e){return e.tickmark=null!==i?i.timeToSessionStart(1e3*e.time)/1e3:e.time,e}));s(r)}),n)}},z.prototype.getSeriesLastBarTime=function(e,t){var i=this._getSeriesData(e,t);return null===i||0===i.length?null:i[i.length-1].timeMs},z.prototype.getSeriesInterval=function(e,t){var i=this._studiesCache[e][t];return i?i.resolution:null},z.prototype.getSeriesSymbolInfo=function(e,t){var i=this._studiesCache[e][t];return i?i.symbolInfo:null},z.prototype._getSeriesData=function(e,t){
return this._objectsDataCache[j(e,t)]||null},z.prototype._computeStudy=async function(e,t,i,s,o,r,a,l,c,h){var _=!0,p=[];null!==l&&(this._objectsDataCache[l]=null),this._timeScales[e].setCompleted(!1);var m=this._computeStudyCounter++;function g(e,t){if(e0&&T(s,i).error)h.onSymbolErrorCallback(`unsupported resolution: ${i.ticker}, ${s}`);else{if(u.isDWM(s)&&void 0!==a.to){var b=d(s,i);null!==b&&(a.to=b.timeToExchangeTradingDay(a.to))}if(a.from&&a.to){const e=I(i.session,i.session_holidays,i.corrections,m.letter(),m.multiplier(),a.from,a.to);a.countBack=Math.max(e,a.countBack)}try{var w=new n({tickerid:c,symbolInfo:i,period:s,body:t,sessionId:e,onErrorCallback:h.onErrorCallback,dataRange:a,subsessionId:i.subsession_id,forceAlignBars:!P.enabled("disable_sameinterval_aligning")&&y(),enableDwmAligning:!S._studyCanExtendTimeScale(e,o),input:function(e){return r[e]},out:function(e,t){!function(e,t,i){for(var s=e.time,n="number"==typeof t?[t]:t,o=0;op[a].timeMs;l?p.push({index:g(s,p.length),value:[s/1e3].concat(n),timeMs:s}):(p[a].index=g(s,a),p[a].value=[s/1e3].concat(n),p[a].timeMs=s),_||h.onRealtimeCallback([p[p.length-1]],l,p.length,f,i)}(e,t,i)},nonseriesOut:function(e,t){h.onNonSeriesDataUpdate(t,i)},setNoMoreData:function(){v=!0},recalc:function(e,s){_=!1,p.endOfData=v,p.emptyBarCount=s.emptyBarCount,t.error&&null!==t.error()||(null!==l&&(S._objectsDataCache[l]=p),h.onDataReadyCallback(p,f,i,s))}});if(!S._studiesCache[e]||!S._studiesCache[e][o])throw Error("This should never happen");S._studiesCache[e][o].engine=w}catch(e){if(!e.studyError)throw e;h.onErrorCallback(e.message)}}}(w,C)},z.prototype._getDataRangeForStudy=function(e,t){var i=this._studiesCache[e][t],s={...this._seriesDataRange(e,i.parentId)};return this._studyCanExtendTimeScale(e,t)?void 0!==i.dataRange?i.dataRange:(i.firstLoadedTimeMs&&(s.to=i.firstLoadedTimeMs),s):s},z.prototype._createStudy=function(e,t,i,s,n,o,r,a){var l=this;function c(e,t,i){const r=l._studiesCache[s][n];if(r.completed=!0,e.length>0&&(r.firstLoadedTimeMs=e[0].timeMs),e=N(e),l._setEndOfData(s,n,o,!l._studyCanExtendTimeScale(s,n)||e.endOfData),l._studyCanExtendTimeScale(s,n)){const t=e.map((function(e){return e.timeMs})),i=l._timeScales[s].setStudyBarsTimes(n,t);l._applyTimeScaleUpdate(s,i)}l._timeScales[s].fillIndexesInRows(e),TradingView.ChartapiMessagerInstances[s].onDataUpdate(n,o,e,t),
TradingView.ChartapiMessagerInstances[s].onStudyCompleted(n,o),l._updateTimeScaleState(s)}function h(e){var t={};if(0!==e.size){var i={},o=l._studiesCache[s][n].metainfo;e.forEach((function(e,t){i[o.plots[t].id]=e})),t.data={offsets:i}}return t}this._studiesCache[s][n].completed=!1,a=function(e){if(Array.isArray(e))return e;for(var t=[],i=l._studiesCache[s][n].metainfo.inputs,o=0;o=0;r--){const l=a[r];e.has(l)||l===A?(i.data.data.pivots.splice(r,1),n++):(t.unshift(o[r]),s.unshift(l),e.add(l))}n>0&&i.data.data.pivots.forEach(((e,t)=>{e.startIndex=t,e.endIndex=t+1})),o=t,a=s}l._studiesNonSeriesTimes[s][n]=o,i.indexes=a,c([],i);break;default:U("unsupported non-series data type for study "+e.type)}}})},z.prototype.onSessionSeriesError=function(e){this.stopSources(e);var t=this._mainSeriesRecord(e);null!==t&&(t.error=!0),this._applyTimeScaleUpdate(e,this._timeScales[e].clearTimeScale())},z.prototype.modifySeries=function(e,t,i,s,n,o){var r=this._mainSeriesRecord(e);if(null===r||r.guid!==t){if(null!==r&&r.error)return this._studiesCache[e][t].symbolId=i,this._studiesCache[e][t].resolution=s,void(this._studiesCache[e][t].turnaround=n);for(var a in this._stopSourcesTree(e,t),this.createSeries(e,t,n,i,s,{
countBack:0},!0),this._studiesCache[e]){var l=this._studiesCache[e][a];if(l&&"study"===l.type&&l.parentId===t){this._studiesNonSeriesTimes[e][a]=null;var c=this._studiesCache[e][l.parentId];this._createStudy(c.symbolId,c.resolution,l.studyObject,e,a,l.turnaround,l.parentId,l.inputs)}}}else this._modifyMainSeries(e,i,s,n,o)},z.prototype._modifyMainSeries=function(e,t,i,s,n){this.stopSources(e);var o=this._mainSeriesRecord(e);let r=!1;for(var a in this._studiesCache[e]){if((l=this._studiesCache[e][a])&&"series"===l.type)if(l.guid===o.guid){r=o.symbolId!==t||o.resolution!==i;const a=W(n),l={countBack:a||0};P.enabled("request_only_visible_range_on_reset")&&a&&(delete this._objectsDataCache[j(e,o.guid)],delete this._studiesCache[e][o.guid]),this.createSeries(e,o.guid,s,t,i,l,!0)}else this.createSeries(e,l.guid,l.turnaround,l.symbolId,i,{countBack:0},!0)}for(var a in this._studiesCache[e]){var l;if((l=this._studiesCache[e][a])&&"study"===l.type){this._studiesNonSeriesTimes[e][a]=null;var c=this._studiesCache[e][l.parentId];this._createStudy(c.symbolId,c.resolution,l.studyObject,e,a,l.turnaround,l.parentId,l.inputs)}}r&&this._applyTimeScaleUpdate(e,this._timeScales[e].clearTimeScale())},z.prototype.stopSources=function(e){for(var t in this._studiesCache[e]){var i=this._studiesCache[e][t];i&&"series"===i.type&&this._stopSourcesTree(e,t)}},z.prototype._stopSourcesTree=function(e,t){for(var i in this._studiesCache[e]){var s=this._studiesCache[e][i];s&&(("series"===s.type&&i===t||"study"===s.type&&s.parentId===t)&&(s.engine&&s.engine.isStarted()&&s.engine.stop(),s.activeResolve=-1))}r.unsubscribeUnused()},z.prototype._recreateSourcesForDataRange=function(e,t){var i=[];for(var s in this._studiesCache[e]){if((o=this._studiesCache[e][s])&&"series"===o.type&&!this._isEndOfData(e,s,o.turnaround)&&(this._stopSourcesTree(e,s),i.push(s)),o&&"study"===o.type&&this._studyCanExtendTimeScale(e,s)&&!this._isEndOfData(e,s,o.turnaround)){var n=this._studiesCache[e][o.parentId];o.dataRange=t,this._createStudy(n.symbolId,n.resolution,o.studyObject,e,s,o.turnaround,o.parentId,o.inputs)}}for(var s in i.forEach((function(i){this._startSourcesTree(e,i,Object.assign({},t))}),this),this._studiesCache[e]){var o;"series"===(o=this._studiesCache[e][s]).type&&this._isEndOfData(e,s,o.turnaround)&&TradingView.ChartapiMessagerInstances[e].onSeriesCompleted(s,o.turnaround,o.engine.runner.host.symbolInfo.data_status)}this._updateTimeScaleState(e)},z.prototype._startSourcesTree=function(e,t,i){var s=this._studiesCache[e][t];for(var n in this.createSeries(e,t,s.turnaround,s.symbolId,s.resolution,i,!0),this._studiesCache[e]){var o=this._studiesCache[e][n];o&&"study"===o.type&&o.parentId===t&&this._createStudy(s.symbolId,s.resolution,o.studyObject,e,n,o.turnaround,o.parentId,o.inputs)}},z.prototype.removeStudy=function(e,t){if(this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].engine&&(this._studiesCache[e][t].engine.stop(),r.unsubscribeUnused()),this._studyCanExtendTimeScale(e,t)){this._timeScales[e].setCompleted(!1)
;const i=this._timeScales[e].setStudyBarsTimes(t,[]);this._applyTimeScaleUpdate(e,i),this._updateTimeScaleState(e)}delete this._studiesCache[e][t],delete this._studiesNonSeriesTimes[e][t]},z.prototype.removeSeries=function(e,t){this._stopSourcesTree(e,t),delete this._studiesCache[e][t],this._updateMainTsBuilder(e),this._timeScales[e].isCompleted()&&this._timeScales[e].setCompleted(!1);var i=this._timeScales[e].setSeriesBarsTimes(t,[]);this._applyTimeScaleUpdate(e,i),this._updateTimeScaleState(e)},z.prototype.modifyStudy=function(e,t,i,s){var n=this._studiesCache[e][t];if(!n)throw Error("This should never happen");var o=this._studiesCache[e][n.parentId];n.inputs=s,n.turnaround=i,n.engine&&(n.engine.stop(),r.unsubscribeUnused()),this._studiesNonSeriesTimes[e][t]=null,this._createStudy(o.symbolId,o.resolution,n.studyObject,e,t,i,n.parentId,s)},z.prototype.createStudy=function(e,t,i,s,n,o){var r=this._studiesCache[e][i],a=this._findStudyObject(n);if(null===a)return U("Study does not exist: "+n),void TradingView.ChartapiMessagerInstances[e].onStudyError(t,s,"unknown study name");var l=new a.constructor;this._studiesCache[e]=this._studiesCache[e]||{},this._studiesCache[e][t]={studyObject:l,guid:t,type:"study",inputs:o,metainfo:a.metainfo,turnaround:s,parentId:i},this._studiesNonSeriesTimes[e][t]=null,this._createStudy(r.symbolId,r.resolution,l,e,t,s,i,o)},z.prototype.sessionTimeScale=function(e){return this._timeScales[e]||null},z.prototype.isTimeScaleExtendedTo=function(e,t){var i=this._mainSeriesRecord(e);if(u.isDWM(i.resolution)&&null!=i.symbolInfo){var s=d(i.resolution,i.symbolInfo);null!==s&&(t=s.timeToSessionStart(t))}var n=this._timeScales[e].indexOfTime(t);return null!==n&&n.index>=0},z.prototype.ensureExtendedTo=function(e,t,i){if(!this._studiesCache[t][e])throw Error("This should never happen");var s=this;setTimeout((function(){s._recreateSourcesForDataRange(t,{to:i})}),0)},z.prototype.extendSeriesRange=function(e,t){var i=this._timeScales[e].firstSeriesBarTime();if(null!==i){var s=this._mainSeriesRecord(e);if(u.isDWM(s.resolution)&&null!=s.symbolInfo){var n=d(s.resolution,s.symbolInfo);null!==n&&(i=n.timeToExchangeTradingDay(i))}var o=this._symbolIdToSymbolRequestString.get(F(e,s.symbolId)),r=this._barsCoefficients(o,s.resolution),a=r.barsCoefficient||1;if(!r.barsCoefficient){var l=this._getSeriesData(e,s.guid);null!==l&&(r.expectedBarsCount=l.length+t)}var c=this;setTimeout((function(){c._recreateSourcesForDataRange(e,{to:i,countBack:(t+2)*a})}),0)}else this._logMessage("Nothing to extend - there is no points on time scale")},z.prototype.seriesTurnaround=function(e,t){return this._studiesCache[e]&&this._studiesCache[e][t]&&this._studiesCache[e][t].turnaround},z.prototype._seriesDataRange=function(e,t){var i=this._studiesCache[e][t];return null!==i.firstLoadedTimeMs?{to:i.firstLoadedTimeMs,countBack:0}:i.dataRange},z.prototype._applyTimeScaleUpdate=function(e,t){if(null!==t){var i=[];for(var s in this._studiesCache[e]){var n=this._studiesCache[e][s];if(n&&"study"===n.type){var o=this._studiesNonSeriesTimes[e][s]
;if(o){var r={indexes:this._timeScales[e].convertTimesToIndexes(o),data:{indexes_replace:!0}};i.push({objId:s,turnaround:n.turnaround,data:[],nonSeriesData:r})}}}TradingView.ChartapiMessagerInstances[e].onTimescaleUpdate(t,i),Promise.resolve().then(function(){var t=this._mainSeriesRecord(e);if(null!==t&&null!=t.symbolInfo){this._pointsetsManagers[e].getUpdatesForSymbol(t.symbolInfo.full_name,t.resolution,((i=t.resolution)=>this._getSymbolExtrapolator(e,t.symbolInfo,i)),this._timeScales[e]).forEach((function(t,i){TradingView.ChartapiMessagerInstances[e].onPointsetDataUpdate(i,null,t)}))}}.bind(this))}},z.prototype._updateMainTsBuilder=function(e){var t=this._mainSeriesRecord(e);if(null!==t&&null!=t.symbolInfo){var i=this._getSymbolExtrapolator(e,t.symbolInfo,t.resolution);this._timeScales[e].setMainSymbolExtrapolator(i)}},z.prototype._updateTimeScaleState=function(e){var t=!0,i=!0;for(var s in this._studiesCache[e]){var n=this._studiesCache[e][s];i=i&&this._isEndOfData(e,s,n.turnaround),t=t&&n.completed}this._timeScales[e].isCompleted()!==t&&(this._timeScales[e].setCompleted(t),t&&TradingView.ChartapiMessagerInstances[e].onTimescaleCompleted(i))},z.prototype._mainSeriesRecord=function(e){var t=null,i=null;for(var s in this._studiesCache[e]){var n=this._studiesCache[e][s];if("series"===n.type&&(null===t&&(t=n),n.isMain)){i=n;break}}return null===i&&(i=t),null!==i&&(i.isMain=!0),i},z.prototype._seriesCount=function(e){var t=0;for(var i in this._studiesCache[e]){"series"===this._studiesCache[e][i].type&&(t+=1)}return t},z.prototype._prepareSeriesNonSeriesData=function(e,t,i){var s=i.data[i.data.length-1],n=this._getSeriesData(e,t),o=null===n?[]:i.data;return{data:{data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:s?s[k]:i.price,bars:o.map((function(e,t){return{time:t,open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5],factor:e[6],additionalPrice:e[6]}}))}},indexes:this._timeScales[e].convertTimesToIndexes(o.map((function(e){var t=e[0]||0;return t<0?n[n.length+t].timeMs:i.projectionTime+t})))}},z.prototype.createSeries=function(e,t,i,s,n,r,a){this._setEndOfData(e,t,i,!1);var l=new o;this._studiesCache[e]=this._studiesCache[e]||{};var c=this._getSeriesData(e,t),h=this._studiesCache[e][t],d=this._seriesCount(e),_=this._mainSeriesRecord(e);if(!h||u.isEqual(h.resolution,n)&&h.symbolId===s)void 0!==r.countBack&&null!==c&&0!==c.length&&(r.to=c[0].timeMs),h&&null!=h.firstLoadedTimeMs?r.to=void 0!==r.to?Math.min(h.firstLoadedTimeMs,r.to):h.firstLoadedTimeMs:h||0===d||null!==_&&(null!=_.firstLoadedTimeMs?(r.to=_.firstLoadedTimeMs,r.countBack=0):r=Object.assign({},_.dataRange));else if(1===d)r=Object.assign({},h.initialDatarange);else{var p=this._timeScales[e].firstSeriesBarTime();(void 0===r.to||null!==p&&pthis._getSymbolExtrapolator(e,o,t))),null===this._refreshPointsetsTimerId){var a=this;this._refreshPointsetsTimerId=setTimeout((function(){a._refreshPointsetsTimerId=null,a._refreshPointsets(a._invalidatedPointsetSessions),a._invalidatedPointsetSessions.clear()}),0)}this._invalidatedPointsetSessions.add(e)},z.prototype._refreshPointsets=function(e){var t=this;e.forEach((function(e){var i=t._studiesCache[e];if(null!=i){var s=null;for(var n in i){var o=i[n];if("series"===o.type){s=o;break}}if(null!==s&&null!=s.symbolInfo){t._pointsetsManagers[e].getUpdatesForSymbol(s.symbolInfo.full_name,s.resolution,((i=s.resolution)=>t._getSymbolExtrapolator(e,s.symbolInfo,i)),t._timeScales[e]).forEach((function(t,i){TradingView.ChartapiMessagerInstances[e].onPointsetDataUpdate(i,null,t)}))}}}))},z.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map((function(e){return e.metainfo})),this._metainfoCache.push({palettes:{},inputs:[],plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"},{id:"volume",type:"line"}],graphics:{},_metainfoVersion:48,description:"Unnamed Study",format:{type:"inherit"},is_hidden_study:!0,is_price_study:!1,shortDescription:"Unnamed Study",description_localized:"Unnamed Study",id:"BarSetHeikenAshi@tv-prostudies",shortId:"BarSetHeikenAshi",packageId:"tv-basicstudies",version:"13",fullId:"BarSetHeikenAshi@tv-basicstudies-13",productId:"tv-basicstudies",name:"BarSetHeikenAshi@tv-basicstudies"})),this._metainfoCache},
z.prototype.searchSymbols=function(e,t,i,s){this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var n=this;this._externalDatafeed.searchSymbols(e,t,i,(function(e){n._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),e.forEach((e=>{O(e.logo_urls,e.exchange_logo,e)})),s(e)}))},z.prototype.resolveSymbol=function(e,t,i){var s=this;this._symbolIdToSymbolRequestString.set(F(e,t),i),this._resolvePromisesBySymbolId.set(F(e,t),new Promise((function(n,o){s._resolveSymbolImpl(i,(function(s){TradingView.ChartapiMessagerInstances[e].onSymbolResolved(t,s),n({symbolInfo:s,requestedSymbol:i})}),(function(i){TradingView.ChartapiMessagerInstances[e].onSymbolError(t,i),o(i)}))})))},z.prototype._resolveSymbolImpl=function(e,t,i){var s;S(e)||(s="Expect to get symbol encoded string, but got the following instead: "+e,console.error(`${(new Date).toISOString()} ${s}`));const[n,o]=H(e);this._resolveSymbolByName(n,o,t,i)},z.prototype._resolveSymbolByName=function(e,t,i,s){var n,o=t&&t.currency,r=t&&t.unit,a=t&&t.session,l=G(e,o,r,a);if(this._resolveRequests[l])n=this._resolveRequests[l];else{n=this._resolveSymbolInternal(e,o||void 0,r||void 0,a||void 0),this._resolveRequests[l]=n;var c=this;n.then((function(t){c._resolveRequests[G(e,t.currency_id,t.unit_id,t.subsession_id)]=n,c._resolveRequests[G(w(t,null),t.currency_id,t.unit_id,t.subsession_id)]=n,c._resolveRequests[G(w(t,null),o,r,a)]=n})).catch((function(){}))}n.then(i).catch(s)},z.prototype._resolveSymbolInternal=function(e,t,i,s){var n=this;return new Promise(function(o,r){const a=V(e,t,i,s);this._logMessage("Symbol resolve requested: `{0}` ".format(a));var l=!0;this._externalDatafeed.resolveSymbol(e,(function(e){l&&U("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),n._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(a,JSON.stringify(e))),function(e){const t=e.ticker??e.name??e.symbol??"unknown symbol";function i(e){U(`SymbolInfo validation for ${t}: `+e)}if("string"==typeof e.ticker&&0!==e.ticker.length||!B||i('ticker must be a non-empty string when the "pay_attention_to_ticker_not_symbol" featureset is enabled'),void 0!==e.exchange&&0!==e.exchange.length||i("exchange must be provided to the symbol information"),e.has_empty_bars&&!y()&&i('both has_empty_bars field and featureset "disable_resolution_rebuild" are enabled and may cause data issues (see #3329)'),(void 0===e.minmov||e.minmov<=0)&&i("minmov must be positive"),(void 0===e.pricescale||e.pricescale<=0)&&i("pricescale must be positive"),void 0!==e.name&&0!==e.name.length||i("name must be non-empty string"),void 0!==e.session&&0!==e.session.length||i("session must be non-empty string"),void 0!==e.holidays&&i("field holidays is deprecated, use session_holidays instead"),void 0!==e.has_no_volume&&i("field has_no_volume is deprecated, use visible_plots_set instead"),
void 0===e.timezone||0===e.timezone.length?i("timezone must be non-empty string"):"exchange"!==e.timezone&&f(e.timezone)||"UTC"!==e.timezone&&i('unsupported timezone "{0}"'.format(e.timezone)),void 0!==e.intraday_multipliers){var s=e.intraday_multipliers;if(Array.isArray(s))for(var n=0;nthis._resolveSymbolByName(t,i,r,(s=>{U(`Error resolving for market status watcher ${V(t,i.currency,i.unit,i.session)}:\n${s}`),this.quoteRemoveSymbols(e,[n]),a(s)}))),e,n)}}},z.prototype._removeMarketStatusWatchers=function(e){var t=this;Object.keys(this._marketStatusWatchers[e]||{}).forEach((function(i){t._marketStatusWatchers[e][i].stop()})),this._marketStatusWatchers[e]={}},z.prototype._stopQuotesSubscription=function(e){this._quotesInfo[e].listenerGUID&&(P.enabled("charting_library_debug_mode")&&this._logMessage(`QUOTES Unsubscribe listenerGUID=${this._quotesInfo[e].listenerGUID}`),this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[e].listenerGUID),this._quotesInfo[e].listenerGUID=void 0),this._removeMarketStatusWatchers(e)};let q=1;z.prototype._startQuotesSubscription=async function(e){var t={},i={},s=this;function n(o){o.forEach((function(r){const a=r.n;if(i[a]?.size>0){const t=[...i[a]].map((e=>({...r,n:e})));if(P.enabled("charting_library_debug_mode")){const t=void 0!==s._quotesInfo[e].listenerGUID?`with listenerGUID ${s._quotesInfo[e].listenerGUID}`:"";s._logMessage(`QUOTES Data for symbol ${a} ${t}: ${JSON.stringify(o)}`)}setTimeout((()=>n(t)),0)}if(void 0!==t[r.n]&&null!==t[r.n])!function(t,i){var n=s._marketStatusWatchers[e][t.n];t.symbolname=t.n,t.status=t.s,t.values=t.v,t.values.change=t.v.ch,t.values.last_price=t.v.lp,t.values.change_percent=t.v.chp,
t.values.current_session=t.v.cs||n&&n.marketStatus(),t.values.pricescale=i.pricescale,t.values.minmov=i.minmov,t.values.minmove2=i.minmove2||0,t.values.fractional=i.fractional||!1,O(i.logo_urls,i.exchange_logo,t.values),n&&t.v.cs&&n.stop(),TradingView.ChartapiMessagerInstances[e].onQuotesData([e].concat([t]))}(r,t[r.n]);else if(P.enabled("charting_library_debug_mode")){const t=void 0!==s._quotesInfo[e].listenerGUID?`with listenerGUID ${s._quotesInfo[e].listenerGUID}`:"";s._logMessage(`QUOTES Data for unexpected symbol ${a} ${t}: ${JSON.stringify(o)}`)}}))}async function o(e){const[n,o]=H(e),r=await new Promise(((e,t)=>{s._resolveSymbolByName(n,o,e,t)})),a=r.ticker;return t[e]=r,t[a]=r,a===e||(void 0===i[a]&&(i[a]=new Set),a!==e&&i[a].add(e)),a}async function r(e){return[...new Set(await Promise.all([...new Set(e)].map(o)))]}if(this._externalDatafeed.getQuotes&&!P.enabled("charting_library")){const[t,i]=await Promise.all([r(this._quotesInfo[e].symbols),r(this._quotesInfo[e].fastSymbols)]),o={};if(P.enabled("charting_library_debug_mode")){const e=q++;s._logMessage(`QUOTES Requesting data for symbols ${JSON.stringify(t)} with request ID ${e}`);for(const i of t){const t=1e4;o[i]=setTimeout((()=>{s._logMessage(`QUOTES Timeout after waiting ${t/1e3} seconds for data symbol ${i} with request ID ${e}`)}),t)}}this._externalDatafeed.getQuotes(t,(function(r){if(P.enabled("charting_library_debug_mode"))for(const e of r)void 0!==o[e.n]&&clearTimeout(o[e.n]),delete o[e.n];s._quotesInfo[e]&&0!==s._quotesInfo[e].symbols.length&&(n(r),s._quotesInfo[e].listenerGUID=e,P.enabled("charting_library_debug_mode")&&s._logMessage(`QUOTES Subscribing listenerGUID ${s._quotesInfo[e].listenerGUID} to data for symbols ${JSON.stringify(t)} and fast symbols ${JSON.stringify(i)}`),s._externalDatafeed.subscribeQuotes(t,i,n,s._quotesInfo[e].listenerGUID))}),(function(e){s._logMessage(`QUOTES Error getting data for symbols ${JSON.stringify(t)}: ${e}`)}))}else!this._externalDatafeed.getQuotes&&P.enabled("trading_terminal")&&setTimeout((()=>{n(this._quotesInfo[e].symbols.map((function(e){return{n:e,s:"ok",v:{}}})))}));this._createMarketStatusWatchers(e,this._quotesInfo[e].symbols)},z.prototype._restartQuotesSubscription=function(e){this._stopQuotesSubscription(e),this._startQuotesSubscription(e)},z.prototype.quoteCreateSession=function(e){this._quotesInfo[e]={symbols:[],fastSymbols:[],listenerGUID:void 0}},z.prototype.quoteDeleteSession=function(e){this._stopQuotesSubscription(e),this._quotesInfo[e]=null},z.prototype.quoteSetFields=function(e,t){},z.prototype.quoteAddSymbols=function(e,t){this._quotesInfo[e].symbols=this._filteredSymbols(this._quotesInfo[e].symbols.concat(t)),this._restartQuotesSubscription(e)},z.prototype.quoteRemoveSymbols=function(e,t){this._quotesInfo[e].symbols=this._quotesInfo[e].symbols.filter((function(e){return t.indexOf(e)<0})),this._restartQuotesSubscription(e)},z.prototype.quoteFastSymbols=function(e,t){this._quotesInfo[e].fastSymbols=this._filteredSymbols(t),this._restartQuotesSubscription(e)},
z.prototype.quoteHibernateAll=function(e){},z.prototype._stopDepthSubscription=function(e){this._depthInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[e].listenerGUID),this._depthInfo[e].listenerGUID=void 0)},z.prototype._startDepthSubscription=function(e){var t=this,i=this._depthInfo[e].symbol;function s(e){return e.map((function(e){return{p:e.price,v:e.volume}}))}function n(e){var t={};return t.s=i,t.bids=s(e.bids),t.asks=s(e.asks),t}i&&this._externalDatafeed.subscribeDepth&&(t._depthInfo[e].listenerGUID=this._externalDatafeed.subscribeDepth(i,(function(i){var s;t._depthInfo[e]&&((s=i).snapshot?TradingView.ChartapiMessagerInstances[e].onDepthData([e].concat([n(s)])):TradingView.ChartapiMessagerInstances[e].onDepthUpdate([e].concat([n(s)])))})))},z.prototype._restartDepthSubscription=function(e){this._stopDepthSubscription(e),this._startDepthSubscription(e)},z.prototype.depthCreateSession=function(e){this._depthInfo[e]={symbol:null,listenerGUID:void 0}},z.prototype.depthDeleteSession=function(e){this._depthInfo[e].symbol=null,this._stopDepthSubscription(e),delete this._depthInfo[e]},z.prototype.depthSetSymbol=function(e,t){this._depthInfo[e].symbol=t,this._restartDepthSubscription(e)},z.prototype._filteredSymbols=function(e){var t=[];return e.forEach((function(e){e instanceof Object||t.indexOf(e)<0&&t.push(e)})),t},z.prototype._isEndOfData=function(e,t,i){var s=e+"!"+t+"@"+i;return!!this._endOfData[s]},z.prototype._setEndOfData=function(e,t,i,s){var n=e+"!"+t+"@"+i;this._endOfData[n]=!1!==s},z.prototype.serverTimeOffset=function(){return this._serverTimeOffset},z.prototype.serverTime=function(){return 1e3*this.getCurrentUTCTime()},z.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},z.prototype.switchTimezone=function(e,t){this._timeScales[e].setTimezone(t);var i=this._timeScales[e].tickMarks();null!==i&&TradingView.ChartapiMessagerInstances[e].onTickmarksUpdated(0,i)},e.exports=z},1430:(e,t,i)=>{"use strict";i.d(t,{SymbolExtrapolator:()=>h});var s,n=i(50151),o=i(29981),r=i(14381),a=i(40644),l=i(85049);function c(e,t){return e.length>t}!function(e){e[e.DefaultExtrapolateLimit=2e5]="DefaultExtrapolateLimit"}(s||(s={}));class h{constructor(e,t,i=2e5){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._projectionFirstIndex=1/0,this._barsTimes=[],this._minFutureBarsCount=0,this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._symbolInfo=e,this._interval=l.Interval.parse(t),this._extrapolateLimit=i,this._barBuilder=(0,r.newBarBuilder)(t,new r.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections),null)}destroy(){this.clear()}interval(){return this._interval}barBuilder(){return this._barBuilder}symbolInfo(){return this._symbolInfo}clear(){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._barsTimes=[],this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._minFutureBarsCount=0,this._projectionFirstIndex=1/0}firstFutureBarIndex(){return this._barsTimes.length}futureBars(){return this._futureBarsCache}
replaceBarsTimesTail(e,t=e.length){if(0===e.length)return;if(0===this._barsTimes.length)return void this.setBarsTimes(e,t);const i=e[0],s=this._barsTimes[this._barsTimes.length-1],r=i>s?this._barsTimes.length:(0,o.lowerbound_int)(this._barsTimes,i);0!==r?(this._barsTimes.splice(r,this._barsTimes.length,...e),this._projectionFirstIndex=t===e.length?this._barsTimes.length:this._barsTimes.indexOf(e[t]),(0,n.assert)(-1!==this._projectionFirstIndex,"something went wrong"),s!==e[e.length-1]&&this._setLastRealBarTime(e[e.length-1])):this.setBarsTimes(e,t)}setBarsTimes(e,t=e.length){const i=this._barsTimes;if(this._barsTimes=e.slice(),this._projectionFirstIndex=0===this._barsTimes.length?1/0:t,0===e.length)return this._historyBarsCache=[],this._futureBarsCache=[],this._firstRealBarTimeMs=null,void(this._lastRealBarTimeMs=null);0!==i.length&&i[i.length-1]===e[e.length-1]||this._setLastRealBarTime(e[e.length-1]),0!==i.length&&i[0]===e[0]||(this._historyBarsCache=[],this._firstRealBarTimeMs=e[0])}extrapolateTimeWithOffsetToTime(e,t){if(0===t)return{timeMs:e,exact:!0};0===this._barsTimes.length&&(t<0?null===this._firstRealBarTimeMs?this._firstRealBarTimeMs=e:(this._extendHistoryCacheToTimeFromRight(Math.min(e,null!==this._lastRealBarTimeMs?this._lastRealBarTimeMs:1/0)),this._ensureExtrapolatedToHistoryTime(e)):null===this._lastRealBarTimeMs?this._lastRealBarTimeMs=e:(this._extendFutureCacheToTimeFromLeft(Math.max(e,null!==this._firstRealBarTimeMs?this._firstRealBarTimeMs:1/0)),this._ensureExtrapolatedToFutureTime(e)));const i=this.indexOfTime(e);if(null===i)return null;const s=this._timeOfBarIndex(i.index+t);return null===s?null:((i.index<0||this._projectionFirstIndex<=i.index)&&(s.exact=!1),s)}indexOfTime(e){if(null!==this._firstRealBarTimeMs&ðis._lastRealBarTimeMs){this._ensureExtrapolatedToFutureTime(e);let t=(0,o.lowerbound_int)(this._futureBarsCache,e);if(0!==this._futureBarsCache.length&&t===this._futureBarsCache.length&&e>this._futureBarsCache[this._futureBarsCache.length-1])return null;this._futureBarsCache[t]!==e&&(t-=1);const i=Math.max(1,this._barsTimes.length)+t;return{index:i,timeMs:i===this._barsTimes.length-1?(0,n.ensureNotNull)(this._lastRealBarTimeMs):this._futureBarsCache[t]}}if(0===this._barsTimes.length)return null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||null!==this._lastRealBarTimeMs&&e<=this._lastRealBarTimeMs?{index:0,timeMs:(0,n.ensureNotNull)(this._timeOfBarIndex(0)).timeMs}:null;let t=(0,o.lowerbound_int)(this._barsTimes,e);return this._barsTimes[t]!==e&&(t-=1),{index:t,timeMs:this._barsTimes[t]}}setMinFutureBarsCount(e){this._minFutureBarsCount=e,
0!==this._barsTimes.length&&this._ensureExtrapolatedToFutureBar(e)}ensureExtrapolatedToFutureTime(e){this._ensureExtrapolatedToFutureTime(e)}_setLastRealBarTime(e){const t=this._futureBarsCache.length,i=(0,o.upperbound_int)(this._futureBarsCache,e);0===i?this._extendFutureCacheToTimeFromLeft(e):(this._lastRealBarTimeMs=e,this._futureBarsCache=this._futureBarsCache.slice(i)),this._ensureExtrapolatedToFutureBar(Math.max(t,this._minFutureBarsCount))}_timeOfBarIndex(e){if(e<0){const t=Math.abs(e);this._ensureExtrapolatedToHistoryBar(t);const i=this._historyBarsCache.length-t;return i<0?null:{timeMs:this._historyBarsCache[i],exact:!1}}if(0===e&&0===this._barsTimes.length)return{timeMs:(0,n.ensureNotNull)(this._firstRealBarTimeMs??this._lastRealBarTimeMs),exact:!1};if(e>=this._barsTimes.length){const t=e-Math.max(1,this._barsTimes.length);return this._ensureExtrapolatedToFutureBar(t+1),t>=this._futureBarsCache.length?null:{timeMs:this._futureBarsCache[t],exact:!1}}return{timeMs:this._barsTimes[e],exact:e=e)return;if((0,n.assert)(0===this._barsTimes.length,"bars should be empty"),this._firstRealBarTimeMs=e,0===this._historyBarsCache.length)return;const t=(0,a.extrapolateBarsFrontToTime)(this._barBuilder,this._historyBarsCache[this._historyBarsCache.length-1],e-1,this._extrapolateLimit,!0).times;this._historyBarsCache=this._historyBarsCache.concat(t)}_ensureExtrapolatedToFutureBar(e){return!(this._futureBarsCache.length>=e||c(this._futureBarsCache,this._extrapolateLimit))&&this._extendFutureCacheFromRight(((t,i)=>(0,a.extrapolateBarsFrontByCount)(this._barBuilder,t,e-i,!0).times))}_ensureExtrapolatedToFutureTime(e){null!==this._lastRealBarTimeMs&&this._lastRealBarTimeMs>=e||c(this._futureBarsCache,this._extrapolateLimit)||0!==this._futureBarsCache.length&&this._futureBarsCache[this._futureBarsCache.length-1]>=e||(this._extendFutureCacheFromRight(((t,i)=>(0,
a.extrapolateBarsFrontToTime)(this._barBuilder,t,e,this._extrapolateLimit,!0).times)),this._futureBarsCache[this._futureBarsCache.length-1]=e||c(this._historyBarsCache,this._extrapolateLimit)||this._extendHistoryCacheFromLeft(((t,i)=>(0,a.extrapolateBarsFrontByCount)(this._barBuilder,t,-(e-i),!0).times.reverse()))}_ensureExtrapolatedToHistoryTime(e){null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||c(this._historyBarsCache,this._extrapolateLimit)||0!==this._historyBarsCache.length&&this._historyBarsCache[0]<=e||(this._extendHistoryCacheFromLeft(((t,i)=>{const s=(0,a.extrapolateBarsFrontToTime)(this._barBuilder,t-1,e-1,this._extrapolateLimit,!0).times;return s[s.length-1]===t?s.slice(0,-1):s})),(0===this._historyBarsCache.length||this._historyBarsCache[0]>e)&&this._ensureExtrapolatedToHistoryBar(this._historyBarsCache.length+1))}}},39076:(e,t,i)=>{"use strict";i.d(t,{backend:()=>s});const s=i(64289)},18278:(e,t,i)=>{"use strict";i.d(t,{HandlerInfo:()=>s});class s{constructor(e,t,i){this.handler=e,this.customId=t,this.singleShot=i}}},82783:(e,t,i)=>{"use strict";var s,n,o,r;function a(e,t){return"period-back"===e.type&&"period-back"===t.type?e.value===t.value:"time-range"===e.type&&"time-range"===t.type&&(e.from===t.from&&e.to===t.to)}i.d(t,{TIMEFRAMETYPE:()=>r,areEqualTimeFrames:()=>a}),function(e){e.extractErrorReason=function(e){return e.params[1]}}(s||(s={})),function(e){e.Default="default",e.FullSingleSession="full_single_session"}(n||(n={})),function(e){e.PeriodBack="period-back",e.TimeRange="time-range"}(o||(o={})),function(e){e.PeriodBack="period-back",e.TimeRange="time-range"}(r||(r={}))},80437:()=>{"use strict";TradingView.Pro=function(){this.hasPackage=function(){return!1}},window.user={is_pro:!1,settings:{}},TradingView.Pro.prototype.isPaidPro=function(){return!1},TradingView.Pro.prototype.isSupportAvailable=function(){return!1},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]}},92883:(e,t,i)=>{"use strict";i.d(t,{getNewPeveCloseMode:()=>n});let s=!1;function n(){return s}},97126:(e,t,i)=>{"use strict";i.r(t),i.d(t,{QUOTE_FIELDS:()=>o,QUOTE_FIELDS_CACHE:()=>r,QuoteCache:()=>n});var s=i(50151);class n{constructor(e){this._cache=new Map,this._fields=[...e.fields]}update(e,t,i){const n=(0,s.ensureDefined)(e.symbolname);if(this._cache.has(n)||this._cache.set(n,{symbolname:n,status:e.status,values:{}}),"error"===e.status)return;const o=(0,s.ensureDefined)(this._cache.get(n));o.status=e.status;for(const s of this._fields)t.has(s)&&(i||void 0!==e.values[s])&&(o.values[s]=e.values[s])}get(e){return this._cache.get(e)??null}fields(){return this._fields}}
const o=new Set(["pro_name","base_name","logoid","currency-logoid","base-currency-logoid","source-logoid","short_name","web_site_url","pro_perm","timezone","current_session","last_price","lp_time","prev_close_price","open_price","high_price","low_price","price_52_week_high","price_52_week_low","ask","ask_size","bid","bid_size","rch","rchp","rtc","rtc_time","data_frequency","reference-last-period-start","business_description","web_site_url","figi","number_of_employees","float_shares_outstanding","earnings_release_next_calendar_date","root","description","exchange","listed_exchange","type","country_code","provider_id","sector","typespecs","visible-plots-set","industry","currency_id","last_price","fractional","minmov","minmove2","pricescale","variable_tick_size","change","change_percent","volume","average_volume","market_cap_basic","market_cap_calc","total_revenue","earnings_per_share_basic_ttm","price_earnings_ttm","beta_1_year","dps_common_stock_prim_issue_fy","dividends_yield","earnings_release_next_date","earnings_per_share_forecast_next_fq","earnings_publication_type_next_fq","earnings_release_date","earnings_per_share_fq","earnings_per_share_forecast_fq","forecast_raw","last_release_date","next_release_date","reference_last_period","fundamental_currency_code","number_of_employees","web_site_url","business_description","founded","ceo","float_shares_outstanding","total_shares_outstanding","dividend_payout_ratio_ttm","dividends_yield_current","dividend_ex_date_upcoming","dividend_amount_upcoming","dividend_amount_recent","dividend_ex_date_recent","total_revenue_fq_h","total_revenue_fy_h","net_income_fy_h","net_income_fq_h","total_assets_fy_h","total_assets_fq_h","total_liabilities_fy_h","total_liabilities_fq_h","cash_f_operating_activities_fy_h","cash_f_operating_activities_fq_h","cash_f_investing_activities_fy_h","cash_f_investing_activities_fq_h","cash_f_financing_activities_fy_h","cash_f_financing_activities_fq_h","fiscal_period_fy_h","fiscal_period_fq_h","fiscal_period_fh_h","earnings_release_date_fq_h","earnings_release_next_date_fq","earnings_per_share_forecast_next_fq","earnings_per_share_forecast_fq_h","earnings_per_share_fq_h","earnings_fiscal_period_fq_h","next_earnings_fiscal_period_fq","is_next_earnings_release_date_estimated","symbol-primaryname","currency_code","rates_mc","rates_fy","rates_ttm","measure","value_unit_id","value-unit-id","update_mode","language","local_description","short_description","source","source2","format","recommendation_mark","last_report_frequency","price_target_estimates_num","price_target_average","update_mode_seconds","recommendation_total","recommendation_buy","recommendation_over","recommendation_hold","recommendation_under","recommendation_sell","recommendation_total","price_target_high","price_target_low","rates_pt","rates_pt","total_revenue_fy_h","total_revenue_fq_h","total_revenue_fh_h","net_income_fy_h","net_income_fq_h","net_income_fh_h","total_assets_fy_h","total_assets_fq_h","total_assets_fh_h","total_liabilities_fy_h","total_liabilities_fq_h","total_liabilities_fh_h","cash_f_operating_activities_fy_h","cash_f_operating_activities_fq_h","cash_f_operating_activities_fh_h","cash_f_investing_activities_fy_h","cash_f_investing_activities_fq_h","cash_f_investing_activities_fh_h","cash_f_financing_activities_fy_h","cash_f_financing_activities_fq_h","cash_f_financing_activities_fh_h","fiscal_period_fy","fiscal_period_fq","fiscal_period_fh","earnings_release_date_fq_h","earnings_release_date_fy_h","earnings_release_date_fh_h","earnings_release_next_date_fq","earnings_release_next_date_fy","earnings_release_next_date_fh","earnings_release_next_time","earnings_release_time","is_next_earnings_release_date_estimated","earnings_per_share_forecast_next_fq","earnings_per_share_forecast_next_fy","earnings_per_share_forecast_next_fh","earnings_per_share_forecast_fq_h","earnings_per_share_forecast_fy_h","earnings_per_share_forecast_fh_h","earnings_per_share_fq_h","earnings_per_share_fy_h","earnings_per_share_fh_h","earnings_fiscal_period_fq_h","earnings_fiscal_period_fy_h","earnings_fiscal_period_fh_h","next_earnings_fiscal_period_fq","next_earnings_fiscal_period_fy","next_earnings_fiscal_period_fh","revenue_fq_h","revenue_fy_h","revenue_fh_h","revenue_forecast_fq_h","revenue_forecast_fy_h","revenue_forecast_fh_h","revenue_forecast_next_fq","revenue_forecast_next_fy","revenue_forecast_next_fh","revenue_seg_by_business_h","revenue_seg_by_region_h","dividend_payout_ratio_ttm","dividends_yield_current","dividend_ex_date_upcoming","dividend_amount_upcoming","dividend_amount_recent","dividend_ex_date_recent","dividend_amount_h","total_revenue_fy","total_revenue_fq","total_revenue_fh","gross_profit_fy","gross_profit_fq","gross_profit_fh","ebitda_fy","ebit_fy","net_income_fy","net_income_fq","net_income_fh","total_debt_fy_h","total_debt_fq_h","total_debt_fh_h","free_cash_flow_fy_h","free_cash_flow_fq_h","free_cash_flow_fh_h","cash_n_equivalents_fy_h","cash_n_equivalents_fq_h","cash_n_equivalents_fh_h","total_current_assets_fy","total_current_assets_fq","total_current_assets_fh","total_current_liabilities_fy","total_current_liabilities_fq","total_current_liabilities_fh","total_non_current_assets_fy","total_non_current_assets_fq","total_non_current_assets_fh","total_non_current_liabilities_fy","total_non_current_liabilities_fq","total_non_current_liabilities_fh","loans_net_fy","loans_net_fy_h","loans_net_fq_h","loans_net_fh_h","total_deposits_fy","total_deposits_fy_h","total_deposits_fq_h","total_deposits_fh_h","loan_loss_allowances_fy","loan_loss_allowances_fy_h","loan_loss_allowances_fq_h","loan_loss_allowances_fh_h","reserve_to_total_capital_fy_h","reserve_to_total_capital_fq_h","reserve_to_total_capital_fh_h","unearned_premium_to_total_capital_fy_h","unearned_premium_to_total_capital_fq_h","unearned_premium_to_total_capital_fh_h","insurance_reserves_fy_h","insurance_reserves_fq_h","insurance_reserves_fh_h","policy_claims_fy_h","policy_claims_fq_h","policy_claims_fh_h","premiums_earned_fy_h","premiums_earned_fq_h","premiums_earned_fh_h","price_earnings_fq_h","price_earnings_fy_h","price_earnings_fh_h","price_sales_fq_h","price_sales_fy_h","price_sales_fh_h","diluted_net_income_ttm","total_revenue_ttm","price_earnings_current","price_sales_current","isin-displayed","interest_income_fy_h","interest_income_fq_h","interest_income_fh_h","non_interest_income_fy_h","non_interest_income_fq_h","non_interest_income_fh_h","website","doc","explorer","sources","contracts","crypto_common_categories","crypto_asset","community","dividends_availability","earnings_availability","financials_availability","etf_asset_type_exposure","etf_region_exposure","top_holdings","unit-id","options-info","interest_income_fy","interest_income_fq","interest_income_fh","non_interest_income_fy","non_interest_income_fq","non_interest_income_fh","interest_expense_fy","interest_expense_fq","interest_expense_fh","loan_loss_provision_fy","loan_loss_provision_fq","loan_loss_provision_fh","non_interest_expense_fy","non_interest_expense_fq","non_interest_expense_fh","non_oper_income_fy","non_oper_income_fq","non_oper_income_fh","unusual_expense_inc_fy","unusual_expense_inc_fq","unusual_expense_inc_fh","pretax_income_fy","pretax_income_fq","pretax_income_fh","income_tax_fy","income_tax_fq","income_tax_fh","after_tax_other_income_fy","after_tax_other_income_fq","after_tax_other_income_fh","total_non_oper_income_fy","total_non_oper_income_fq","total_non_oper_income_fh","oper_income_fy","oper_income_fq","oper_income_fh","operating_expenses_fy","operating_expenses_fq","operating_expenses_fh","cost_of_goods_fy","cost_of_goods_fq","cost_of_goods_fh","equity_in_earnings_fy","equity_in_earnings_fq","equity_in_earnings_fh","minority_interest_exp_fy","minority_interest_exp_fq","minority_interest_exp_fh","discontinued_operations_fy","discontinued_operations_fq","discontinued_operations_fh","front_contract","pointvalue","unit_id","expiration","aum","asset_class","focus","expense_ratio","launch_date","issuer","brand","homepage","index_tracked","actively_managed","fund_view_mode","common_equity_tier1_ratio_fy_h","common_equity_tier1_ratio_fq_h","common_equity_tier1_ratio_fh_h","tier1_capital_ratio_fy_h","tier1_capital_ratio_fq_h","tier1_capital_ratio_fh_h","total_capital_ratio_fy_h","total_capital_ratio_fq_h","total_capital_ratio_fh_h","preferred_stock_carrying_value_fh","preferred_stock_carrying_value_fq","total_debt_fq","minority_interest_fh","minority_interest_fq","cash_n_short_term_invest_fq","cash_n_due_f_banks_fh","cash_n_due_f_banks_fq","enterprise_value_current","etf_holdings_count","contract-description","reference-last-period","all_time_high","all_time_high_day","all_time_low","all_time_low_day","outstanding_amount","nominal_value","denom_min","current_coupon","coupon_type_general","coupon_frequency","yield_to_maturity","maturity-date","days_to_maturity","bond_issuer","issue_date","bond_issuer_stock_symbol","total_issued_amount","paid_amount","bond_snp_rating_lt_h","placement_type","duration_type","maturity_type","offer_type","redemption_type","conversion_option","sinking_fund","ownership_form","daily-summary-ast","issue_status","coupon_h","sinking_fund_next_date","sinking_fund_min_amount_next","call_next_date","redemptions_h","call_notice_days","put_next_date","put_notice_days_min","seniority_level","inflation_protection","pledge_status","bond_issuer_country_of_risk","bond_issuer_cr_parent","credit_enhancement_type","credit_enhancement_status","use_of_proceeds","bond_issuer_snp_rating_lt_h","bond_issuer_snp_rating_st_h","bond_agents_tr","first_bar_time_1d","financial-indicator-id","exchange-info","underlying-symbol","strike","lotsize","option-style"]),r=new n({
fields:o})},42003:(e,t,i)=>{"use strict";i.d(t,{destroyQuoteSessions:()=>r,getQuoteSessionInstance:()=>o});var s=i(32783);const n={};function o(e="full"){return n[e]||function(e="full",t){n[e]=t}(e,new s(e)),n[e]}function r(){for(const e in n)if(n.hasOwnProperty(e)){const t=n[e];void 0!==t&&t.destroy(),delete n[e]}}},64364:(e,t,i)=>{"use strict";i.d(t,{QuoteSession:()=>n});var s=i(92184);class n{constructor(e,t=(0,s.randomHash)()){this._sessionstarted=!1,this._globalHandler=null,this._chartApi=e,this._sessionid="qs_"+t}destroy(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionstarted=!1)}connected(){return this._chartApi.connected()}connect(e){this._globalHandler=e,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()}disconnect(){this._chartApi.disconnect()}quoteAddSymbols(e){this._chartApi.quoteAddSymbols(this._sessionid,e)}quoteRemoveSymbols(e){this._chartApi.quoteRemoveSymbols(this._sessionid,e)}quoteFastSymbols(e){this._chartApi.quoteFastSymbols(this._sessionid,e)}quoteSetFields(e){this._chartApi.quoteSetFields(this._sessionid,e)}onMessage(e){switch(e.method){case"connected":this._sessionstarted||(this._chartApi.quoteCreateSession(this._sessionid),this._sessionstarted=!0);break;case"disconnected":this._sessionstarted=!1}this._globalHandler?.(e)}quoteHibernateAll(){this._chartApi.quoteHibernateAll(this._sessionid)}}window.TradingView.QuoteSession=n},32783:(e,t,i)=>{"use strict";e=i.nmd(e);var s=i(20057).default,n=i(90484).default,o=i(725).PriceFormatter;const{uniq:r}=i(97144);var a=i(92184);const{normalizeUpdateMode:l}=i(89512);var c=i(31054).deepExtend;const{QUOTE_FIELDS_CACHE:h,QUOTE_FIELDS:d}=i(97126);var u,_=i(52033).Delegate,p=i(92883).getNewPeveCloseMode;function m(e,t){this.options=Object.assign({throttleTimeout:125},t),this._connected=!1,this._symbol_data={},this._subscriptions={},this.onConnect=new _,this.onDisconnect=new _,this._quoteApi=new u(window.ChartApiInstance),this._type=e||"full",this._delayUpdateFastSymbols=n(this._updateFastSymbols,250),this._throttledSymbolData={},this._formatterValuesCache={},this._waitingForFormatters={},this._snapshotValuesCache={},this._waitingForSnapshot={},this.connect()}u=i(64364).QuoteSession,m.prototype.destroy=function(){this._quoteApi.destroy(),this._quoteApi=null,this._connected=!1,this.onDisconnect.fire()},m.prototype.typeFields={},m.prototype.typeFields.simple=["base-currency-logoid","ch","chp","currency-logoid","currency_code","currency_id","base_currency_id","current_session","description","exchange","format","fractional","is_tradable","language","local_description","listed_exchange","logoid","lp","lp_time","minmov","minmove2","original_name","pricescale","pro_name","short_name","type","typespecs","update_mode","volume","variable_tick_size","value_unit_id","unit_id","measure"],
m.prototype.typeFields.simpleDetailed=[].concat(m.prototype.typeFields.simple,["ask","bid","fundamentals","high_price","is_tradable","low_price","open_price","prev_close_price","rch","rchp","rtc","rtc_time","status","basic_eps_net_income","beta_1_year","earnings_per_share_basic_ttm","industry","market_cap_basic","price_earnings_ttm","sector","volume","dividends_yield","timezone"]),m.prototype.typeFields.full=[],m.prototype.typeFields.watchlist=[].concat(m.prototype.typeFields.simple,["rchp","rtc","country_code","provider_id"]),m.prototype.typeFields.portfolio=["pro_name","short_name","exchange","listed_exchange","description","local_description","language","sector","type","typespecs","industry","currency_code","currency_id","ch","chp","logoid","currency-logoid","base-currency-logoid","earnings_per_share_forecast_next_fq","earnings_release_next_date","earnings_release_date","earnings_per_share_fq","lp","fractional","minmov","minmove2","pricescale","volume","average_volume","market_cap_calc","market_cap_basic","total_revenue","earnings_per_share_basic_ttm","price_earnings_ttm","beta_1_year","dps_common_stock_prim_issue_fy","dividends_yield","fundamental_currency_code","rates_mc","rates_fy","rates_ttm","format","value_unit_id","unit_id","measure"],m.prototype.typeFields.notes=["short_name","pro_name","logoid","currency-logoid","base-currency-logoid","symbol-primaryname","type","typespecs"],m.prototype.typeFields.estimates=["fundamental_data","type","typespecs","earnings_per_share_forecast_next_symbol_currency_fq","earnings_release_next_aligned_date","earnings_release_next_calendar_date","earnings_release_next_date"],m.prototype.typeFields.economic=["reference-last-period","lp","currency_code","value_unit_id","unit_id","measure"],m.prototype.connect=function(e){this._quoteApi.connect(this.quoteHandler.bind(this))},m.prototype.quoteHandler=function(e){var t=e.method,i=e.params;switch(t){case"connected":this._connected||(this._connected=!0,this.onConnected());break;case"quote_list_fields":break;case"quote_symbol_data":this._connected&&this.onSymbolData(i[0]);break;case"quote_completed":this._connected&&this.onSymbolData({symbolname:i[0],complete:performance.now(),values:{}});break;case"disconnected":this._connected&&(this._connected=!1,this.onDisconnect.fire())}},m.prototype.onConnected=function(){this.setFields();var e=Object.keys(this._symbol_data);e.length&&(this._quoteApi.quoteAddSymbols(e),this._delayUpdateFastSymbols()),this.onConnect.fire()},m.prototype.setFields=function(){var e=m.prototype.typeFields[this._type];e&&e.length&&this._quoteApi.quoteSetFields(e)},m.prototype.onSymbolData=function(e){try{e.status&&h.update(e,d,!1)}catch(e){}var t=e.symbolname,i=this._throttledSymbolData[t];p()&&(delete e.values.prev_close_price,void 0!==e.values.regular_close&&(e.values.prev_close_price=e.values.regular_close)),i||(i=this._throttledSymbolData[t]={fnDispatch:s(this.dipatchSymbolData.bind(this),this.options.throttleTimeout)}),i.cache?c(i.cache,e):i.cache=e,i.fnDispatch(t)},m.prototype._parseUpdateMode=function(e){l(e)},
m.prototype.dipatchSymbolData=function(e){var t=this._symbol_data[e],i=this._throttledSymbolData[e].cache;if(delete this._throttledSymbolData[e].cache,this._symbol_data[e])for(var s in c(t,i),t.values&&this._parseUpdateMode(t.values),this._subscriptions){var n=this._subscriptions[s];n.has(e)&&[...n.get(e)].forEach((function(e){e(t,i)}))}},m.prototype.subscribe=function(e,t,i){this._subscriptions[e]=this._subscriptions[e]||new Map;var s=this._subscriptions[e];t=[].concat(t);var n=[];t.forEach((function(e){this._symbol_data[e]?s&&s.has(e)||this._symbol_data[e].subscribers_count++:(this._symbol_data[e]={subscribers_count:1},n.push(e)),s.has(e)||s.set(e,[]),s.get(e).push(i),s.get(e).fast=!0,this._symbol_data[e]&&this._symbol_data[e].values&&i(this._symbol_data[e],this._symbol_data[e])}),this),n.length&&this._connected&&(this._quoteApi.quoteAddSymbols(n),this._delayUpdateFastSymbols())},m.prototype.unsubscribe=function(e,t,i){t=[].concat(t);for(var s=this._subscriptions[e],n=[],o=0;o{"use strict";i.d(t,{getServerInterval:()=>n});var s=i(85049);function n(e){return s.Interval.isRange(e)?"1":e}},89512:(e,t,i)=>{"use strict";function s(e){if(void 0===e)return null;const t=e.match(/(delayed_streaming)_(\d+)/);return null===t?null:{mode:t[1],interval:parseInt(t[2])}}function n(e){const t=s(e.update_mode);return null===t||(e.update_mode=t.mode,e.update_mode_seconds=t.interval),e}i.r(t),i.d(t,{normalizeUpdateMode:()=>n,parseUpdateMode:()=>s})},63812:(e,t,i)=>{"use strict";function s(e,t,i){const s=e.get(t);return void 0!==s?s:(e.set(t,i),i)}function n(e,t,i){const s=e.get(t);if(void 0!==s)return s;const n=i();return e.set(t,n),n}function o(e,t,i,o){return n(s(e,t,new Map),i,o)}function r(e,t,i,n,o){const r=s(e,t,new Map),a=s(r,i,new Map);return s(a,n,o)}i.d(t,{AbstractMapContainer:()=>a,getDefault2Lazy:()=>o,getDefault3:()=>r});class a{constructor(){this._map=new Map,this._size=0}size(){return this._size}clear(){this._map.clear(),this._size=0}}},29981:(e,t,i)=>{"use strict";i.d(t,{compareTwoCollectionsByIds:()=>y,indexOf:()=>f,intersect:()=>p,join:()=>m,lowerbound:()=>r,lowerboundExt:()=>o,lowerbound_int:()=>a,mapEntriesGenerator:()=>S,moveAfter:()=>u,moveBefore:()=>_,moveToHead:()=>d,nestedMapGenerator:()=>b,removeItemFromArray:()=>g,subtract:()=>h,sum:()=>v,upperbound:()=>l,upperbound_int:()=>c});var s=i(50151);function n(e,t){return e>1,r=s+n;i(e(r),t)?(s=r+1,o-=n+1):o=n}return s}function r(e,t,i,s=0,n=e.length){return o((t=>e[t]),t,i,s,n)}function a(e,t,i=0,s=e.length){return r(e,t,n,i,s)}function l(e,t,i,s=0,n=e.length){let o=n-s;for(;0>1,r=s+n;i(t,e[r])?o=n:(s=r+1,o-=n+1)}return s}function c(e,t,i=0,s=e.length){return l(e,t,n,i,s)}function h(e,t){return e.filter((e=>!t.includes(e)))}function d(e,t){const i=e.indexOf(t);return i<0?e.slice():[t].concat(e.slice(0,i)).concat(e.slice(i+1))}function u(e,t,i){const s=new Set(t),n=[],o=[],r=[];return e.forEach(((e,t)=>{s.has(e)?o.push(e):(n.push(e),r.push(t))})),i=i{s.has(e)?o.push(e):(n.push(e),r.push(t))})),i=i<=e.length-1?a(r,i):n.length,n.splice(i,0,...o),{newItems:n,movedItemsStartIndex:i}}function p(e,t){const i=new Set;return e.forEach((e=>{t.has(e)&&i.add(e)})),i}function m(e,t){const i=new Set(e);return t.forEach((e=>i.add(e))),i}function g(e,t){const i=e.indexOf(t);(0,s.assert)(-1!==i,"Item is not found"),e.splice(i,1)}function f(e,t){for(let i=0;ie+t),0)}function*S(e){for(const[t,i]of e)yield[t,i]}function*b(e,t){for(const[i,s]of e)if(void 0===t)for(const[,e]of s)yield[i,e];else{const e=s.get(t);void 0!==e&&(yield[i,e])}}},2740:(e,t,i)=>{"use strict";i.d(t,{DAY_OF_MONTH:()=>S,DAY_OF_WEEK:()=>w,DECEMBER:()=>g,FIRST_DAY_OF_WEEK:()=>_,FRIDAY:()=>d,HOUR_OF_DAY:()=>C,JANUARY:()=>m,LAST_DAY_OF_WEEK:()=>p,MINUTE:()=>P,MONDAY:()=>a,MONTH:()=>y,SATURDAY:()=>u,SECOND:()=>T,SUNDAY:()=>r,THURSDAY:()=>h,TUESDAY:()=>l,WEDNESDAY:()=>c,WEEK_OF_YEAR:()=>v,YEAR:()=>f,add_date:()=>H,add_days_considering_dst:()=>F,add_minutes:()=>z,add_years_considering_dst:()=>W,cal_to_utc:()=>ie,clone:()=>j,days_per_year:()=>q,get_cal:()=>Q,get_cal_from_unix_timestamp_ms:()=>ee,get_cal_utc:()=>te,get_day_of_month:()=>E,get_day_of_week:()=>B,get_day_of_year:()=>V,get_minutes_from_midnight:()=>R,get_minutes_with_hours:()=>N,get_month:()=>L,get_part:()=>K,get_timezone:()=>se,get_year:()=>A,is_leap_year:()=>$,minutesPerDay:()=>x,minutesPerWeek:()=>I,setCustomTimezones:()=>oe,set_hms:()=>O,set_seconds:()=>U,time_seconds:()=>Y,time_seconds_diff:()=>Z,utc_to_cal:()=>X,utc_to_cal_ts:()=>J});var s=i(23998);const n={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334};class o{constructor(e){this._invalid=!1,this._name=e;let t=s.tzData[e];!t&&ne&&(t=ne.instance().getTimezoneData(e)),t||(t={time:[],offset:[]},this._invalid=!0),t.time.length!==t.offset.length&&(t={time:[],offset:[]},this._invalid=!0);const i=t;if(!i.time_utc){const e=t.time,s=t.offset,n=e.length,o=new Array(n);for(let t=0;t0){if(e-t[s-1]<=n)return n}return 0}static offset(e,t,i){const s=re(e,i);return-1===s?0:t[s]}}const r=1,a=2,l=3,c=4,h=5,d=6,u=7,_=r,p=u,m=0,g=11,f=1,y=2,v=3,S=5,b=6,w=7,C=11,P=12,T=13,x=1440,I=10080,M=864e5;function A(e){return e.getUTCFullYear()}function L(e){return e.getUTCMonth()}function k(e){return e.getUTCHours()}function D(e){return e.getUTCMinutes()}function E(e){return e.getUTCDate()}function B(e){return e.getUTCDay()+1}function V(e){const t=e.getUTCMonth();let i=n[t];return t>m+1&&$(e.getUTCFullYear())&&(i+=1),i+e.getUTCDate()}function R(e){return 60*k(e)+D(e)}function N(e){return R(e)}function O(e,t,i,s,n,o){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(s),e.setUTCMilliseconds(n),void 0!==o&&function(e,t){const i=e.getTime(),s=t.correction_loc(i);e.setTime(i+s)}(e,o)}function F(e,t,i){const s=e.offset_utc(t.getTime()),n=j(t);H(n,i);const o=e.offset_utc(n.getTime());return n.setTime(n.getTime()+s-o),n}function W(e,t,i){let s=t;for(let t=Math.abs(i);t>0;t--)s=F(e,s,G(s)*Math.sign(i));return s}function H(e,t){e.setTime(e.getTime()+t*M)
}function z(e,t){e.setTime(e.getTime()+60*t*1e3)}function U(e,t){const i=86400,s=t%i<0?-1:0,n=Math.trunc(t/i)+s,o=t-n*i,r=Math.trunc(o/3600),a=Math.trunc(o%3600/60);O(e,r,a,o-3600*r-60*a,0),H(e,n)}function j(e){return new Date(e.getTime())}function G(e){return q(e.getUTCFullYear())}function q(e){return $(e)?366:365}function $(e){return e%4==0&&(e%100!=0||e%400==0)}function K(e,t){switch(t){case f:return A(e);case y:return L(e);case S:return E(e);case v:return function(e){const t=new Date(Date.UTC(e.getUTCFullYear(),0,1)).getUTCDay(),i=0===t?1:8-t,s=V(e)-i;return Math.ceil(s/7)+1}(e);case w:return B(e);case C:return k(e);case P:return D(e);case b:return V(e);case T:return function(e){return e.getUTCSeconds()}(e);default:return e.getTime()}}function Y(e){return 1e3*e}function Z(e,t){return le(e)-le(t)}function X(e,t){return new Date(J(e,t))}function J(e,t){return t+e.offset_utc(t)}function Q(e,t,i,s,n,o,r){const a=new Date(Date.UTC(t,i,s,n||0,o||0,r||0)),l=e.offset_utc(+a);return new Date(a.valueOf()-l)}function ee(e,t){return new Date(t+e.offset_utc(t))}function te(e,t,i,s=0,n=0,o=0){return new Date(Date.UTC(e,t,i,s,n,o))}function ie(e,t,i){let s=t.getTime();i&&(s+=e.correction_loc(s));return s-e.offset_loc(s)}function se(e){return new o(e)}let ne;function oe(e){ne=e}function re(e,t){const i=e.length;if(0===i)return-1;if(isNaN(t))throw Error("Key is NaN");let s=0,n=i-1,o=ae((s+n)/2);for(;;){if(e[o]>t){if(n=o-1,n{"use strict";i.r(t),i.d(t,{LINESTYLE_DASHED:()=>o,LINESTYLE_DOTTED:()=>n,LINESTYLE_LARGE_DASHED:()=>r,LINESTYLE_SMALL_DASHED:()=>l,LINESTYLE_SOLID:()=>s,LINESTYLE_SPARSE_DOTTED:()=>a});const s=0,n=1,o=2,r=3,a=4,l=5},5201:(e,t,i)=>{"use strict";i.d(t,{CircularCacheBuffer:()=>r});var s,n=i(50151);function o(e){const{prevItem:t,nextItem:i}=e;null!==t&&(t.nextItem=i),null!==i&&(i.prevItem=t)}!function(e){e[e.CapacityFactor=1.3]="CapacityFactor"}(s||(s={}));class r{constructor(e=0,t=1.3){this._cache=new Map,this._lastItem=null,this._firstItem=null,this._size=e,this._sizeLimited=e>0,this._capacityFactor=t}set(e,t){const i={key:e,value:t,prevItem:this._lastItem,nextItem:null};null!==this._lastItem&&(this._lastItem.nextItem=i);const s=this._cache.get(e);return void 0!==s&&(o(s),s===this._firstItem&&(this._firstItem=s.nextItem)),this._cache.set(e,i),this._lastItem=i,null===this._firstItem&&(this._firstItem=i),this._sizeLimited&&this._cache.size>this._size*this._capacityFactor&&this._removeExtraItems(),this}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);if(void 0===t)return t;if(t===this._firstItem&&(this._firstItem=t.nextItem??t),t!==this._lastItem){o(t);const e=(0,n.ensureNotNull)(this._lastItem);e.nextItem=t,t.prevItem=e,t.nextItem=null,this._lastItem=t}return t.value}clear(){this._cache.clear(),this._firstItem=null,this._lastItem=null}delete(e){const t=this._cache.get(e);return void 0!==t&&(o(t),
t===this._lastItem&&(this._lastItem=t.prevItem),t===this._firstItem&&(this._firstItem=t.nextItem)),this._cache.delete(e)}*entries(){if(null!==this._firstItem)for(let e=this._firstItem;null!==e;e=e.nextItem)yield[e.key,e.value]}state(){const e=[];for(const[t,i]of this.entries())e.push([t,i]);return e}restoreState(e){for(const t of e)this.set(t[0],t[1])}_removeExtraItems(){const e=this._cache.size-this._size;let t=(0,n.ensureNotNull)(this._firstItem);for(let i=0;i{"use strict";i.d(t,{accumulate:()=>a,combine:()=>r,combineWithFilteredUpdate:()=>o});var s=i(64147);function n(e,t,...i){let n=null;const o=(...t)=>e(...t.map((e=>e.value())),n?.value()),r=n=new s.WatchedValue(o(...i)),a=()=>{t(...i.map((e=>e.value())))&&r.setValue(o(...i))},l=i.map((e=>e.spawn()));for(const e of l)e.subscribe(a);return r.readonly().spawn((()=>{l.forEach((e=>e.destroy())),i.forEach((e=>e.release()))}))}function o(e,t,...i){return n(e,t,...i)}function r(e,...t){return n(e,(()=>!0),...t)}function a(e,t,i){const n=(t,i)=>{const s=t.map((e=>e.value()));return e(s,i)},o=new s.WatchedValue(n(t.value(),i?.value())),r=t.spawn();let a=[];const l=i?.spawn()??new s.WatchedValue(void 0),c=()=>{o.setValue(n(a,l.value()))},h=e=>{a.forEach((e=>e.destroy())),a=e.map((e=>e.spawn())),a.forEach((e=>{e.subscribe(c)})),c()};h(r.value()),r.subscribe(h),l.subscribe(c);return o.readonly().spawn((()=>{a.forEach((e=>e.destroy())),r.destroy(),l.destroy(),t.release()}))}},63950:(e,t,i)=>{"use strict";i.d(t,{availableTimezones:()=>l,timezoneIsAvailable:()=>u,timezoneIsSupported:()=>_,timezoneTitle:()=>p,updateAvailableTimezones:()=>d});var s=i(82112),n=i(11542);const o=[{id:"Etc/UTC",get title(){return n.t(null,void 0,i(1833))}},{id:"exchange",get title(){return n.t(null,void 0,i(86905))}}],r=[{id:"Africa/Cairo",get title(){return n.t(null,void 0,i(65736))},offset:0},{id:"Africa/Casablanca",get title(){return n.t(null,void 0,i(70409))},offset:0},{id:"Africa/Johannesburg",get title(){return n.t(null,void 0,i(39585))},offset:0},{id:"Africa/Lagos",get title(){return n.t(null,void 0,i(19931))},offset:0},{id:"Africa/Nairobi",get title(){return n.t(null,void 0,i(40977))},offset:0},{id:"Africa/Tunis",get title(){return n.t(null,void 0,i(21007))},offset:0},{id:"America/Anchorage",get title(){return n.t(null,void 0,i(42630))},offset:0},{id:"America/Argentina/Buenos_Aires",get title(){return n.t(null,void 0,i(25282))},offset:0},{id:"America/Bogota",get title(){return n.t(null,void 0,i(73905))},offset:0},{id:"America/Caracas",get title(){return n.t(null,void 0,i(30948))},offset:0},{id:"America/Chicago",get title(){return n.t(null,void 0,i(72452))},offset:0},{id:"America/El_Salvador",get title(){return n.t(null,void 0,i(55502))},offset:0},{id:"America/Juneau",get title(){return n.t(null,void 0,i(67560))},offset:0},{id:"America/Lima",get title(){return n.t(null,void 0,i(59444))},offset:0},{id:"America/Los_Angeles",get title(){return n.t(null,void 0,i(28733))},
offset:0},{id:"America/Mexico_City",get title(){return n.t(null,void 0,i(73332))},offset:0},{id:"America/New_York",get title(){return n.t(null,void 0,i(40544))},offset:0},{id:"America/Phoenix",get title(){return n.t(null,void 0,i(14055))},offset:0},{id:"America/Santiago",get title(){return n.t(null,void 0,i(30231))},offset:0},{id:"America/Sao_Paulo",get title(){return n.t(null,void 0,i(91912))},offset:0},{id:"America/Toronto",get title(){return n.t(null,void 0,i(10095))},offset:0},{id:"America/Vancouver",get title(){return n.t(null,void 0,i(32838))},offset:0},{id:"US/Mountain",get title(){return n.t(null,void 0,i(27358))},offset:0},{id:"Asia/Almaty",get title(){return n.t(null,void 0,i(98128))},offset:0},{id:"Asia/Ashkhabad",get title(){return n.t(null,void 0,i(63627))},offset:0},{id:"Asia/Bahrain",get title(){return n.t(null,void 0,i(90594))},offset:0},{id:"Asia/Bangkok",get title(){return n.t(null,void 0,i(47045))},offset:0},{id:"Asia/Chongqing",get title(){return n.t(null,void 0,i(50349))},offset:0},{id:"Asia/Colombo",get title(){return n.t(null,void 0,i(10871))},offset:0},{id:"Asia/Dhaka",get title(){return n.t(null,void 0,i(24959))},offset:0},{id:"Asia/Dubai",get title(){return n.t(null,void 0,i(23650))},offset:0},{id:"Asia/Ho_Chi_Minh",get title(){return n.t(null,void 0,i(34491))},offset:0},{id:"Asia/Hong_Kong",get title(){return n.t(null,void 0,i(48861))},offset:0},{id:"Asia/Jakarta",get title(){return n.t(null,void 0,i(14995))},offset:0},{id:"Asia/Jerusalem",get title(){return n.t(null,void 0,i(36057))},offset:0},{id:"Asia/Karachi",get title(){return n.t(null,void 0,i(70913))},offset:0},{id:"Asia/Kathmandu",get title(){return n.t(null,void 0,i(54533))},offset:0},{id:"Asia/Kolkata",get title(){return n.t(null,void 0,i(31561))},offset:0},{id:"Asia/Kuala_Lumpur",get title(){return n.t(null,void 0,i(38561))},offset:0},{id:"Asia/Kuwait",get title(){return n.t(null,void 0,i(76614))},offset:0},{id:"Asia/Manila",get title(){return n.t(null,void 0,i(48991))},offset:0},{id:"Asia/Muscat",get title(){return n.t(null,void 0,i(9865))},offset:0},{id:"Asia/Nicosia",get title(){return n.t(null,void 0,i(94600))},offset:0},{id:"Asia/Qatar",get title(){return n.t(null,void 0,i(28756))},offset:0},{id:"Asia/Riyadh",get title(){return n.t(null,void 0,i(37974))},offset:0},{id:"Asia/Seoul",get title(){return n.t(null,void 0,i(26820))},offset:0},{id:"Asia/Shanghai",get title(){return n.t(null,void 0,i(1852))},offset:0},{id:"Asia/Singapore",get title(){return n.t(null,void 0,i(77377))},offset:0},{id:"Asia/Taipei",get title(){return n.t(null,void 0,i(11034))},offset:0},{id:"Asia/Tehran",get title(){return n.t(null,void 0,i(6686))},offset:0},{id:"Asia/Tokyo",get title(){return n.t(null,void 0,i(69122))},offset:0},{id:"Asia/Yangon",get title(){return n.t(null,void 0,i(53168))},offset:0},{id:"Atlantic/Azores",get title(){return n.t(null,void 0,i(87580))},offset:0},{id:"Atlantic/Reykjavik",get title(){return n.t(null,void 0,i(13386))},offset:0},{id:"Australia/Adelaide",get title(){return n.t(null,void 0,i(426))},offset:0},{
id:"Australia/Brisbane",get title(){return n.t(null,void 0,i(79336))},offset:0},{id:"Australia/Perth",get title(){return n.t(null,void 0,i(24436))},offset:0},{id:"Australia/Sydney",get title(){return n.t(null,void 0,i(31622))},offset:0},{id:"Europe/Amsterdam",get title(){return n.t(null,void 0,i(36485))},offset:0},{id:"Europe/Athens",get title(){return n.t(null,void 0,i(73702))},offset:0},{id:"Europe/Belgrade",get title(){return n.t(null,void 0,i(71797))},offset:0},{id:"Europe/Berlin",get title(){return n.t(null,void 0,i(64313))},offset:0},{id:"Europe/Bratislava",get title(){return n.t(null,void 0,i(70876))},offset:0},{id:"Europe/Brussels",get title(){return n.t(null,void 0,i(91499))},offset:0},{id:"Europe/Bucharest",get title(){return n.t(null,void 0,i(33672))},offset:0},{id:"Europe/Budapest",get title(){return n.t(null,void 0,i(20313))},offset:0},{id:"Europe/Copenhagen",get title(){return n.t(null,void 0,i(38917))},offset:0},{id:"Europe/Dublin",get title(){return n.t(null,void 0,i(79716))},offset:0},{id:"Europe/Helsinki",get title(){return n.t(null,void 0,i(48203))},offset:0},{id:"Europe/Istanbul",get title(){return n.t(null,void 0,i(78326))},offset:0},{id:"Europe/Lisbon",get title(){return n.t(null,void 0,i(53375))},offset:0},{id:"Europe/London",get title(){return n.t(null,void 0,i(19439))},offset:0},{id:"Europe/Luxembourg",get title(){return n.t(null,void 0,i(81038))},offset:0},{id:"Europe/Madrid",get title(){return n.t(null,void 0,i(52066))},offset:0},{id:"Europe/Malta",get title(){return n.t(null,void 0,i(38365))},offset:0},{id:"Europe/Moscow",get title(){return n.t(null,void 0,i(64039))},offset:0},{id:"Europe/Oslo",get title(){return n.t(null,void 0,i(75722))},offset:0},{id:"Europe/Paris",get title(){return n.t(null,void 0,i(61879))},offset:0},{id:"Europe/Prague",get title(){return n.t(null,void 0,i(81248))},offset:0},{id:"Europe/Riga",get title(){return n.t(null,void 0,i(94022))},offset:0},{id:"Europe/Rome",get title(){return n.t(null,void 0,i(52961))},offset:0},{id:"Europe/Stockholm",get title(){return n.t(null,void 0,i(86716))},offset:0},{id:"Europe/Tallinn",get title(){return n.t(null,void 0,i(79995))},offset:0},{id:"Europe/Vienna",get title(){return n.t(null,void 0,i(23160))},offset:0},{id:"Europe/Vilnius",get title(){return n.t(null,void 0,i(60534))},offset:0},{id:"Europe/Warsaw",get title(){return n.t(null,void 0,i(5959))},offset:0},{id:"Europe/Zurich",get title(){return n.t(null,void 0,i(62859))},offset:0},{id:"Pacific/Auckland",get title(){return n.t(null,void 0,i(66103))},offset:0},{id:"Pacific/Chatham",get title(){return n.t(null,void 0,i(36549))},offset:0},{id:"Pacific/Fakaofo",get title(){return n.t(null,void 0,i(98549))},offset:0},{id:"Pacific/Honolulu",get title(){return n.t(null,void 0,i(79668))},offset:0},{id:"Pacific/Norfolk",get title(){return n.t(null,void 0,i(67891))},offset:0}];function a(e,t,i){const n=function(e){return e.map((e=>{const{id:t}=e,{string:i,offset:n}=(0,s.parseTzOffset)(t);return{id:t,offset:n,get title(){return`(${i}) ${e.title}`}}}))
}(e),o=i.filter((({alias:e})=>Boolean(e))).map((e=>{const{alias:t,id:i}=e,{string:n,offset:o}=(0,s.parseTzOffset)(t);return{id:i,offset:o,get title(){return`(${n}) ${e.title}`},alias:t}})),r=function(e){return e.sort(((e,t)=>{const i=e.offset-t.offset;return 0!==i?i:e.title.localeCompare(t.title)}))}(n.concat(o));return t.concat(r)}const l=a(r,o,[]),c=new Map;l.forEach((e=>{c.set(e.id,!0)}));const h=new Map;o.concat(r).forEach((e=>{h.set(e.id,!0)}));const d=e=>{l.splice(0,l.length,...a(r,o,e)),l.forEach((e=>{c.set(e.id,!0)}))};function u(e){return c.has(e)}function _(e){return h.get(e)||!1}function p(e){for(const{id:t,title:i}of r)if(t===e){return`${i} (${(0,s.parseTzOffset)(e).string})`}for(const{id:t,title:i}of l)if(t===e)return`${i}`;return e}},52033:(e,t,i)=>{"use strict";i.d(t,{Delegate:()=>o});const s=(0,i(9343).getLogger)("Common.Delegate");function n(e){return!e.singleShot}class o{constructor(){this.fire=this._fireImpl.bind(this),this._listeners=[]}subscribe(e,t,i){this._listeners.push({object:e,member:t,singleShot:!!i,skip:!1})}unsubscribe(e,t){for(let i=0;i=0;--t){const i=this._listeners[t];i.object===e&&(i.skip=!0,this._listeners.splice(t,1))}}destroy(){this._listeners=[]}_fireImpl(...e){const t=this._listeners;this._listeners=this._listeners.filter(n);const i=t.length;for(let n=0;n{"use strict";var s,n;i.d(t,{HorizontalAlign:()=>s,VerticalAlign:()=>n}),function(e){e.Left="left",e.Right="right",e.Center="center"}(s||(s={})),function(e){e.Top="top",e.Bottom="bottom",e.Middle="middle"}(n||(n={}))},82236:(e,t,i)=>{"use strict";i.d(t,{formatStudyError:()=>o,triesTranslateError:()=>n});var s=i(11542);function n(e){return r.get(e)||e}function o(e){return e.format({boldHighlightStart:"",boldHighlightEnd:""})}
const r=new Map([["You cannot see this pivot timeframe on this resolution",s.t(null,void 0,i(25059))],["The data vendor doesn't provide volume data for this symbol.",s.t(null,void 0,i(81657))],['Histogram is too large, please increase "Row Size" input.',s.t(null,void 0,i(72819))],["Histogram is too large, please reduce 'Row Size' input.",s.t(null,void 0,i(66751))],['Histogram is too large, please increase "Ticks Per Row" input.',s.t(null,void 0,i(94966))],["This script is invite-only. To request access, please contact its author.",s.t(null,void 0,i(76989))],["Volume Profile indicator available only on our upgraded plans.",s.t(null,void 0,i(39903))],["VOLUME_BIST_MIXED",s.t(null,void 0,i(69156))],["Runtime error",s.t(null,void 0,i(60630))],["Access error",s.t(null,void 0,i(77401))],["User-defined error",s.t(null,void 0,i(8580))],["Compilation error",s.t(null,void 0,i(12086))],["There's no data for your selected period and chart timeframe.",s.t(null,void 0,i(43716))],["The request took too long to process. Ensure you have a stable internet connection. If the issue persists, try decreasing the length of the requested time interval.",s.t(null,void 0,i(99274))],["Unexpected error in Deep Backtesting mode. Contact support for more information.",s.t(null,void 0,i(56815))],["check study unexpected error",s.t(null,void 0,i(83524))]])},19938:(e,t,i)=>{"use strict";i.d(t,{getImage:()=>o});const s=new Map;function n(e){e.crossOrigin="anonymous"}function o(e,t,i=n){let o=s.get(e);return void 0===o&&(o=new Promise(((e,s)=>{const n=new Image;n.onload=()=>{e(n),n.onload=null,n.onerror=null},n.onerror=()=>{s(),n.onload=null,n.onerror=null},i(n),n.src=t})),s.set(e,o)),o}},34776:(e,t,i)=>{"use strict";function s(e){const t=Object.create(e);return t.release=()=>{},t.ownership=()=>t,t}function n(e){const t=e;return t.release=()=>t.destroy(),t.ownership=()=>t,t}i.d(t,{ownership:()=>n,weakReference:()=>s})},9859:(e,t,i)=>{"use strict";function s(e,t,i){return Math.min(Math.max(e,t),i)}function n(e){return e<0?-1:e>0?1:0}function o(e){if(e<0)return!1;if(e>1e18)return!0;for(let t=e;t>1;t/=10)if(t%10!=0)return!1;return!0}function r(e,t,i){return t-e<=i}function a(e,t,i){return Math.abs(e-t)t?1:0}function h(e,t=c){if(e.length<1)throw Error("array is empty");let i=e[0];for(let s=0;s0&&(i=e[s]);return i}function d(e){const t=Math.ceil(e);return t%2!=0?t-1:t}function u(e){return e>0?Math.floor(e):Math.ceil(e)}i.d(t,{ceiledEven:()=>d,clamp:()=>s,equal:()=>a,greaterOrEqual:()=>r,isBaseDecimal:()=>o,log10:()=>l,max:()=>h,sign:()=>n,toInt:()=>u})},82112:(e,t,i)=>{"use strict";i.d(t,{parseTzOffset:()=>n});var s=i(2740);function n(e,t=Date.now()){const i=(0,s.get_timezone)(e).offset_utc(t);let n="";const o=i/1e3/60/60;o%1&&(n=":"+Math.round(Math.abs(o%1*60)).toString().padStart(2,"0"));let r="";return r=o>0?"+"+(o-o%1)+n:0===o?"":String(o-o%1+n),{offset:i,string:"UTC"+r}}},97085:(e,t,i)=>{"use strict";function s(e){
return"number"==typeof e&&isFinite(e)}function n(e){if(!e||"object"!=typeof e)return e;let t;t=Array.isArray(e)?[]:{};for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];t[i]=s&&"object"==typeof s?n(s):s}return t}function o(e,t){for(const i in t)null!==t[i]&&"object"==typeof t[i]&&e.hasOwnProperty(i)?o(e[i],t[i]):e[i]=t[i];return e}function r(e){return"object"==typeof e&&null!==e}function a(e){return null!=e&&(e.constructor===Function||"[object Function]"===Object.prototype.toString.call(e))}function l(e,t,i=""){if(e===t)return[!0,i];if(a(e)&&(e=void 0),a(t)&&(t=void 0),null==e||null==t)return[e===t,i];if("object"!=typeof e&&"object"!=typeof t)return[e===t,i];if(Array.isArray(e)&&Array.isArray(t)){const s=e.length;if(s!==t.length)return[!1,i];for(let n=0;nn,deepEquals:()=>l,isFunction:()=>a,isNumber:()=>s,isObject:()=>r,merge:()=>o})},13665:e=>{"use strict";var t=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}],i=function(){var e=[{pattern:"(",ctor:o},{pattern:")",ctor:r},{pattern:"+",ctor:l},{pattern:"-",ctor:c},{pattern:"*",ctor:h},{pattern:"/",ctor:d},{pattern:"^",ctor:u},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:.&]))|\.\d+/,ctor:g},{pattern:/\./,ctor:v},{pattern:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:.&]*|'.+?'/,ctor:m},{pattern:/'[^']*/,ctor:y},{pattern:/[\0-\x20\s]+/,ctor:n}];function i(e,t){var i=function(){};return i.prototype=t.prototype,e.prototype=new i,e}function s(){}function n(e){this.value=e}function o(){}function r(){}function a(){}function l(){}function c(){}function h(){}function d(){}function u(){}s.prototype.toString=function(){return this.value},i(n,s),i(o,s),o.prototype.value="(",i(r,s),r.prototype.value=")",i(a,s),i(l,a),l.prototype.value="+",l.prototype.precedence=0,l.prototype.commutative=!0,i(c,a),c.prototype.value="-",c.prototype.precedence=0,c.prototype.commutative=!1,i(h,a),h.prototype.value="*",h.prototype.precedence=1,h.prototype.commutative=!0,i(d,a),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,i(u,a),u.prototype.value="^",u.prototype.precedence=2,u.prototype.commutative=!1;var _=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,p=/[+\-/*]/;function m(e){this.value=e}function g(e){this.value=e}function f(e){this.value=e}function y(){m.apply(this,arguments)}function v(){g.apply(this,arguments)}i(m,s),m.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var e=p.test(this._ticker)?"'":""
;return e+(this._exchange?this._exchange+":":"")+this._ticker+e}return this.value},m.prototype.parse=function(){var e=_.exec(this.value);e[1]&&(this._exchange=e[1]),this._ticker=e[2]},m.prototype.parseAsFutures=function(){this.hasOwnProperty("_ticker")||this.parse();for(var e=function(e){return t.some((function(t){return t.t===e}))},i=2;i>=1;--i){var s=this._ticker.slice(0,i);if(e(s)){this._root=s,this._contract=this._ticker.slice(i);break}}},m.prototype.exchange=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null==e?delete this._exchange:this._exchange=e+""},m.prototype.ticker=function(e){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null==e?delete this._ticker:this._ticker=e+"",delete this._root,delete this._contract},m.prototype.root=function(e){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null==e?delete this._root:(this._root=e+"",this._root&&(this._ticker=this._root+(this._contract||"")))},m.prototype.contract=function(e){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null==e?delete this._contract:(this._contract=e+"",this._root&&(this._ticker=this._root+this._contract))},i(g,s),g.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},g.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},f.prototype.toString=function(){return this.value},i(y,m),y.prototype.isIncomplete=!0,y.prototype.incompleteSuggest=function(){if("'"!==this.value)return String("'")},i(v,g),v.prototype.isIncomplete=!0;var S=new RegExp(e.map((function(e){return"("+("string"==typeof e.pattern?e.pattern.replace(/[\^$()[\]{}*+?|\\]/g,"\\$&"):e.pattern.source)+")"})).concat(".").join("|"),"g");function b(t,i){var s,o=[];e:for(;s=S.exec(t);){for(var r=e.length;r--;)if(s[r+1]){if(e[r].ctor){var a=new e[r].ctor(s[r+1]);a._offset=s.index,o.push(a)}continue e}var l=new f(s[0]);l._offset=s.index,o.push(l)}if(i&&i.recover){var c;for(r=o.length;r--;){var h=o[r];if(h instanceof g||h instanceof m){if(void 0!==c){var d=new m(""),u=o.splice(r,c-r+1,d);d.value=u.map((function(e){return e.value})).join("")}c=r}else h instanceof n||(c=void 0)}}return o}function w(e){for(var t=[],i=0;il.precedence&&(s[s.length-1].minPrecedence=l.precedence);else if(l instanceof o)s.push(t={minPrecedence:1/0,openBraceIndex:n});else if(l instanceof r){var c=e[(t=s.pop()).openBraceIndex-1],h=e[n+1];h instanceof a&&!(h.precedence<=t.minPrecedence)||!(!(c instanceof a)||c.precedencet.minPrecedence&&(s[s.length-1].minPrecedence=t.minPrecedence))}}for(n=i.length;n--;)e.splice(i[n],1);return e}function P(e){if("string"!=typeof e)throw new TypeError("expression must be a string");return(e=b(e)).filter((function(e){return e instanceof m})).map((function(e){return e.exchange()})).filter((function(e){return e}))}function T(e){return 1!==(e=P(e)).length?null:e[0]}function x(e,t){return(e=P(e)).some((function(e){return t.includes((e||"").toUpperCase())}))}function I(e){return e.join("")}return{tokenize:b,validate:function(e){return{currentState:"var"}},factorOutBraces:C,normalizeTokens:function(e){for(var t=0;t{"use strict";i.d(t,{TranslatedString:()=>s});class s{constructor(e,t){this._originalText=e,this._translatedText=t}originalText(){return this._originalText}translatedText(){return this._translatedText}format(e){const t={},i={};for(const n of Object.keys(e)){const o=e[n];o instanceof s?(t[n]=o.originalText(),i[n]=o.translatedText()):(t[n]=o.toString(),i[n]=o.toString())}const n=this._originalText.format(t),o=this._translatedText.format(i);return new s(n,o)}}},23998:e=>{e.exports.tzData={"America/New_York":{
time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-76941e4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-17762,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Los_Angeles":{
time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-769420800,-765410400,-687995940,-662680800,-620866800,-608162400,-589417200,-576108e3,-557967600,-544658400,-526518e3,-513208800,-495068400,-481759200,-463618800,-450309600,-431564400,-418255200,-400114800,-386805600,-368665200,-355356e3,-337215600,-323906400,-305766e3,-292456800,-273711600,-261007200,-242262e3,-226533600,-210812400,-195084e3,-179362800,-163634400,-147913200,-13158e4,-116463600,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{
time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1551650400,-1538949600,-1520200800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1067810400,-1045432800,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-769413600,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-21036,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"America/Phoenix":{time:[-2717670498,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-820540740,-812678340,-796867140,-84405600,-68680800,1924966800],offset:[-26898,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"America/Toronto":{
time:[-2366755200,-1632088800,-1615154400,-1601771400,-1583712e3,-1567375200,-1554681600,-1534716e3,-1524088800,-1503266400,-149238e4,-1471816800,-1460930400,-1440972e3,-1428876e3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,-76941e4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-634168800,-620863200,-602719200,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-19052,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Vancouver":{
time:[-2713910400,-1632088800,-1615154400,-880236e3,-769420800,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112e3,-1567468800,-1233446400,-1222992e3,-1205971200,-1194048e3,-117288e4,-1162512e3,-1141344e3,-1130976e3,-1109808e3,-109944e4,-1078272e3,-1067817600,-1046649600,-1036281600,-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352e3,-83376e4,-82728e4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832e3,-71107200,-54777600,-39052800,-23328e3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408e3,719366400,731462400,938908800,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/El_Salvador":{time:[-1546300800,546998400,559699200,578448e3,591148800,1924970400],offset:[-21408,-21600,-18e3,-21600,-18e3,-21600]},"America/Sao_Paulo":{
time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184e4,-570758400,-560217600,-539136e3,-53136e4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816e3,761702400,782265600,793152e3,813715200,823996800,84456e4,856051200,876096e3,888710400,908064e3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904e3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232e4,1203206400,1224374400,1234656e3,1255824e3,1266710400,1287273600,129816e4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576e3,1487462400,1508025600,1518912e3,1541289600,1550361600,1924981200],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,729043200,1924974e3],offset:[-17776,-17776,-18e3,-14400,-18e3]},"America/Caracas":{time:[-2524521600,-1826755200,-157766400,1197169200,1462069800,1924977600],offset:[-16064,-16060,-16200,-14400,-16200,-14400]},"America/Anchorage":{
time:[-3225173303,-2188987200,-880236e3,-769428e3,-765410400,-86918400,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,438998400,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[50424,-35976,-36e3,-32400,-32400,-36e3,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-36e3,-32400,-32400,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400]},"Europe/Moscow":{
time:[-2840140800,-1688256e3,-165681e4,-1641340800,-1627956e3,-1618700400,-1596416400,-1593804521,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1414288800,1925002800],offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18e3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725e4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036e3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Belgrade":{time:[-2713910400,-905821200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-777938400,-766616400,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4920,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Berlin":{
time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-776556e3,-765925200,-761173200,-748476e3,-733266e3,-717627600,-714603600,-71037e4,-701902800,-684972e3,-670453200,-654127200,-639003600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Bratislava":{
time:[-3786825600,-2469398400,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-765320400,-746575200,-733352400,-728514e3,-72126e4,-716421600,-701902800,-684972e3,-670453200,-654213600,-639003600,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3464,3464,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Bucharest":{
time:[-2469398400,-1213142400,-1187049600,-1175468400,-1159747200,-1144018800,-1127692800,-1111964400,-1096243200,-1080514800,-1064793600,-1049065200,-1033344e3,-1017615600,-1001894400,-986166e3,-970444800,-954716400,296611200,307497600,323823600,338950800,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670377600,686106e3,701827200,717555600,733276800,749005200,764726400,780451200,796176e3,811900800,828230400,846374400,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[6264,6264,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Budapest":{
time:[-2498256e3,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1600466400,-1587243600,-1569708e3,-1555189200,-906771600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-778467600,-762649200,-749685600,-733269600,-717631200,-701902800,-686181600,-670453200,-654127200,-639003600,-492652800,-481161600,-461196e3,-449701200,-428536800,-418251600,-397087200,-386802e3,323827200,338950800,354672e3,370400400,386121600,40185e4,417571200,433299600,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4580,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{
time:[-3852662400,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-904514400,-896043600,-875484e3,-864594e3,-844034400,-832539600,-812584800,-798066e3,-781048800,-772059600,-764802e3,-748476e3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,-37238400,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],
offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Luxembourg":{time:[-2069712e3,-1692493200,-1680476400,-1662339600,-165015e4,-1632002400,-1618693200,-1612656e3,-1604278800,-1585515600,-1574038800,-1552255200,-1539997200,-1520546400,-1507510800,-1490569200,-1473642e3,-1459116e3,-1444006800,-142767e4,-1411866e3,-1396220400,-1379293200,-1364770800,-1348448400,-1333321200,-1316394e3,-1301266800,-1284339600,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-1191189600,-1175461200,-1160344800,-1143406800,-1127685600,-1111957200,-1096840800,-1080507600,-1063576800,-1049058e3,-1033336800,-1017608400,-1002492e3,-986158800,-969228e3,-950475600,-942012e3,-935182800,-85725e4,-844552800,-828219600,-812498400,-797979600,-781048800,-766616400,-745452e3,-733266e3,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[1476,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Madrid":{time:[-2177453684,-1631926800,-1616886e3,-1601168400,-158535e4,-1442451600,-142767e4,-1379293200,-1364770800,-1348448400,-1333321200,-1316390400,-1301266800,-1284339600,-1269817200,-1026954e3,-1017615600,-1001898e3,-999478800,-986083200,-954111600,-940208400,-873075600,-862614e3,-842835600,-828313200,-811386e3,-796863600,-779936400,-765414e3,-748486800,-733964400,-652323600,-639010800,135126e3,150253200,166575600,181702800,196815600,212547600,22887e4,243997200,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Paris":{time:[-2486592e3,-1855958400,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544e4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472e3,-1160355600,-1143417600,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012e3,-932432400,-85725e4,-844552800,-828219600,-812498400,-800064e3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Prague":{time:[-3786825600,-2469398400,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-765320400,-746575200,-733352400,-728514e3,-72126e4,-716421600,-701902800,-684972e3,-670453200,-654213600,-639003600,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3464,3464,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Rome":{
time:[-3252096e3,-2403562204,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,107913600,118198800,138758400,149648400,170812800,181098e3,202262400,212547600,233107200,243997200,265161600,276051600,296611200,307501200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2996,2996,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Vienna":{
time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1569708e3,-1555794e3,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-780181200,-748476e3,-733266e3,-717631200,-701902800,-684972e3,-670453200,323827200,338947200,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3921,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{
time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725e4,-844552800,-828219600,-812498400,-796600800,-778723200,-762652800,-748483200,-733266e3,-715212e3,-701902800,-684972e3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,-355356e3,-334191600,-323301600,-307580400,-291852e3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404e3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Istanbul":{
time:[-2840140800,-1869868800,-1693699200,-168048e4,-1570406400,-1552176e3,-1538352e3,-1522540800,-1507507200,-1490572800,-1440201600,-1428019200,-1409702400,-1396483200,-931046400,-922665600,-917827200,-892425600,-875836800,-764726400,-744336e3,-733795200,-716428800,-701913600,-684979200,-670464e3,-654134400,-639014400,-62208e4,-60696e4,-590025600,-575510400,-235612800,-194832e3,-177724800,-165715200,107917200,121226400,133927200,152676e3,164685600,184125600,196221600,215575200,228880800,245815200,260330400,267926400,428464800,433908e3,468122400,482806800,496720800,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733280400,749008800,764125200,780458400,796179600,811908e3,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301281200,1319947200,1332644400,1351396800,1364698800,1382846400,1396234800,1414296e3,1427598e3,1446955200,1459047600,1473206400,1925002800],offset:[6952,7016,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800]},"Europe/Zurich":{time:[-3675196800,-2385244800,-904431600,-891122400,-872982e3,-859672800,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[2048,1786,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672524e3,-1665349200,-883605600,-876085200,-860364e3,-844635600,-828309600,-813186e3,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Australia/Brisbane":{time:[-2366755200,-1672524e3,-1665349200,-883605600,-876085200,-860364e3,-844635600,-828309600,-813186e3,57722400,68007600,625629600,636519600,657079200,667969200,688528800,699418800,1925028e3],offset:[36728,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3]},"Australia/Adelaide":{
time:[-2364076800,-2230156800,-1672524e3,-1665349200,-883605600,-876085200,-860364e3,-844635600,-828309600,-813186e3,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,637729200,657079200,667969200,688528800,701233200,719978400,731473200,752032800,764132400,783482400,796186800,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,972784800,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[33260,32400,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800]},"Australia/ACT":{
time:[-2364076800,-1672524e3,-1665349200,-883605600,-876085200,-860364e3,-844635600,-828309600,-813186e3,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Asia/Almaty":{time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1709251200,192501e4],offset:[18468,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,21600,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,18e3]},"Asia/Ashkhabad":{
time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,192501e4],offset:[14012,14400,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,18e3,14400,18e3]},"Asia/Colombo":{time:[-2840140800,-2019686400,-883267200,-862617600,-764028e3,832982400,846289800,1145061e3,1925011800],offset:[19164,19172,19800,21600,23400,19800,23400,21600,19800]},"Asia/Dhaka":{time:[-2524521600,-891561600,-872035200,-862617600,-576115200,1245452400,1262303999,1925013600],offset:[21700,21200,23400,19800,23400,21600,25200,21600]},"Asia/Tokyo":{time:[-2587678861,-683769600,-672274800,-654739200,-640825200,-620265600,-609375600,-588816e3,-577926e3,1925024400],offset:[33539,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400]},"Asia/Taipei":{time:[-2335219200,-1017792e3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-639100800,-620784e3,-607564800,-589248e3,-576028800,-562896e3,-541728e3,-528681600,-510192e3,-497145600,-478656e3,-465609600,-449798400,-433987200,-418176e3,-402451200,-38664e4,-370915200,-355104e3,-339379200,-323568e3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584e3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176e3,-1167609600,-1073001600,-894153600,-879638400,-766972800,378689400,1925020800],offset:[24925,24925,25200,26400,26400,27e3,32400,27e3,28800]},"Asia/Karachi":{time:[-1988150400,-862617600,-764121600,-576115200,38793600,1018137600,1033862400,1212278400,1225497600,1239753600,1257033600,192501e4],offset:[16092,19800,23400,19800,18e3,18e3,21600,18e3,21600,18e3,21600,18e3]},"Asia/Manila":{time:[-3944678400,-2229292800,-1046649600,-1038700800,-873244800,-794188800,-496195200,-489283200,259372800,275184e3,1925020800],offset:[-57360,29040,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Shanghai":{time:[-2177452800,-1600646400,-1585872e3,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{
time:[-1948752e3,-1830384e3,-767318400,-681177600,-672192e3,-654739200,-640828800,-623376e3,-609379200,-588816e3,-577929600,-498096e3,-462672e3,-451699200,-429753600,-418262400,-399513600,-387417600,-368064e3,-355968e3,-336614400,-324518400,-305164800,-293068800,-264902400,547610400,560919600,57906e4,592369200,1925024400],offset:[30472,30600,32400,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,32400,36e3,32400,36e3,32400]},"Asia/Tehran":{time:[-1704153600,-1090454400,227833200,24624e4,259632e3,271126800,283996800,296611200,306547200,322444800,338515200,673228800,685497600,701222400,71712e4,732758400,748656e3,764294400,780192e3,795830400,811728e3,827366400,843264e3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768e4,1253577600,1269216e3,1285113600,1300752e3,1316649600,1332288e3,1348185600,1363910400,1379808e3,1395446400,1411344e3,1426982400,144288e4,1458518400,1474416e3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1925004600],offset:[12344,12344,12600,16200,14400,18e3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-3645216e3,-3155673600,-2019686400,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,19270,19800,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056663398,-900882e3,-891547200,-884217600,-761176800,-747878400,-728508600,-717021e3,-697059e3,-683757e3,-668028600,-654726600,-636579e3,-623277e3,-605129400,-591827400,-573679800,-559773e3,-541625400,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877e3,-308781e3,-288822600,-277331400,-257373e3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509e3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381e3,9343800,25068600,40793400,56518200,72243e3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371e3,295414200,309324600,1925020800],
offset:[27402,28800,32400,30600,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],offset:[24124,24124,25200]},"Asia/Chongqing":{time:[-2177452800,-1600646400,-1585872e3,-933638400,-922060800,-908841600,-888796800,-881020800,-767836800,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-649987200,515556e3,527047200,545191200,558496800,577245600,589946400,608695200,622000800,640144800,653450400,671594400,6849e5,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Jerusalem":{time:[-2840140800,-1640995200,-933631200,-923086800,-919029600,-857336400,-844293600,-825800400,-812671200,-794178e3,-779839200,-762642e3,-748303200,-731106e3,-681948e3,-673214400,-667947600,-652312800,-636411600,-622072800,-608936400,-591832800,-572475600,-558568800,-542840400,-527724e3,-514414800,-490831200,-482965200,-459381600,-451515600,-428536800,-418251600,-400111200,-387406800,142387200,150854400,167184e3,178675200,334108800,337741200,452649600,46233e4,482284800,494380800,516758400,526435200,545443200,558489600,576633600,589334400,609897600,620784e3,638323200,651628800,669772800,683683200,701827200,715737600,733708800,747187200,765158400,778032e3,796608e3,810086400,826848e3,842832e3,858902400,874195200,890352e3,90504e4,923018400,936324e3,955677600,970794e3,986778e3,1001293200,1017363600,1033952400,1048813200,1065142800,1081299600,1095814800,1112320800,1128823200,1143770400,1159668e3,117522e4,1189908e3,1206669600,1223172e3,1238119200,1254016800,1269568800,1284256800,1301623200,1317520800,1333072800,1348365600,1364522400,1382839200,1395972e3,1414288800,1427421600,1445738400,1458871200,1477792800,1490320800,1509242400,1521770400,1540692e3,1553824800,1572141600,1585274400,1603591200,1616724e3,1635645600,1648173600,1667095200,1679623200,1698544800,1711677600,1729994400,1743127200,1761444e3,1774576800,1792893600,1806026400,1824948e3,1837476e3,1856397600,1868925600,1887847200,190098e4,1919296800,1932429600],
offset:[8454,8440,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Asia/Kuala_Lumpur":{time:[-2177452800,-2038176e3,-1167609600,-1073001600,-894153600,-879638400,-766972800,378689400,1925020800],offset:[24406,24925,25200,26400,26400,27e3,32400,27e3,28800]},"Asia/Kuwait":{time:[-631152e3,1925002800],offset:[11516,10800]},"Asia/Muscat":{time:[-1577923200,1925006400],offset:[14064,14400]},"Asia/Nicosia":{time:[-1518912e3,166579200,182304e3,200966400,21384e4,228873600,243993600,260323200,276134400,291772800,307497600,323827200,338947200,354672e3,370396800,386121600,401846400,417571200,433296e3,449020800,465350400,481075200,4968e5,512524800,528249600,543974400,559699200,575424e3,591148800,606873600,622598400,638323200,654652800,670377600,686102400,701827200,717552e3,733276800,749001600,764726400,780451200,796176e3,811900800,828230400,843955200,85968e4,875404800,891129600,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[8008,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Asia/Qatar":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Riyadh":{time:[-719625600,1925002800],offset:[11212,10800]},"Asia/Yangon":{
time:[-2840140800,-1577923200,-873244800,-778377600,1925015400],offset:[23087,23087,23400,32400,23400]},"Pacific/Auckland":{time:[-3192393600,-1330293600,-1320012e3,-1300658400,-1287352800,-1269208800,-1255903200,-1237759200,-1224453600,-1206309600,-1192399200,-117486e4,-1160949600,-1143410400,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-757382400,152676e3,162356400,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,510116400,530676e3,541566e3,562125600,573620400,59418e4,60507e4,623815200,637729200,655264800,669178800,686714400,700628400,718164e3,732682800,749613600,764132400,781063200,795582e3,812512800,827031600,844567200,858481200,876016800,889930800,907466400,921985200,938916e3,953434800,970365600,984884400,100242e4,1016334e3,1033869600,1047783600,1065319200,1079838e3,1096768800,1111287600,1128218400,1142737200,1159668e3,1174186800,1191117600,1207450800,1222567200,1238900400,1254016800,127035e4,1285466400,1301799600,1316916e3,1333249200,1348970400,1365303600,138042e4,1396753200,1411869600,1428202800,1443319200,1459652400,1474768800,1491102e3,1506218400,1522551600,1538272800,1554606e3,1569722400,1586055600,1601172e3,1617505200,1632621600,1648954800,1664071200,1680404400,1695520800,1712458800,1727575200,1743908400,1759024800,1775358e3,1790474400,1806807600,1821924e3,1838257200,1853373600,1869706800,1885428e3,1901761200,1916877600,1933210800],offset:[41944,41400,45e3,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800]},"Pacific/Chatham":{
time:[-3192393600,-757382400,152678700,162359100,183523500,195018300,215577900,226467900,247027500,257917500,278477100,289367100,309926700,320816700,341376300,352266300,372825900,384320700,404880300,415770300,436329900,447219900,467779500,478669500,499229100,510119100,530678700,541568700,562128300,573623100,594182700,605072700,623817900,637731900,655267500,669181500,686717100,700631100,718166700,732685500,749616300,764135100,781065900,795584700,812515500,827034300,844569900,858483900,876019500,889933500,907469100,921987900,938918700,953437500,970368300,984887100,1002422700,1016336700,1033872300,1047786300,1065321900,1079840700,1096771500,1111290300,1128221100,1142739900,1159670700,1174189500,1191120300,1207453500,1222569900,1238903100,1254019500,1270352700,1285469100,1301802300,1316918700,1333251900,1348973100,1365306300,1380422700,1396755900,1411872300,1428205500,1443321900,1459655100,1474771500,1491104700,1506221100,1522554300,1538275500,1554608700,1569725100,1586058300,1601174700,1617507900,1632624300,1648957500,1664073900,1680407100,1695523500,1712461500,1727577900,1743911100,1759027500,1775360700,1790477100,1806810300,1821926700,1838259900,1853376300,1869709500,1885430700,1901763900,1916880300,1933213500],offset:[44028,44100,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500]},"Pacific/Fakaofo":{time:[-2177452800,1325203200,1925038800],offset:[-41096,-39600,46800]},"Pacific/Honolulu":{time:[-2334139200,-1157320800,-1155470400,-880236e3,-769429800,-765410400,-712188e3,1924956e3],offset:[-37886,-37800,-34200,-37800,-34200,-34200,-37800,-36e3]},"America/Mexico_City":{time:[-1514763396,-1343091600,-1234828800,-1220317200,-1207180800,-1191369600,-975283200,-963187200,-917136e3,-907372800,-821923200,-810086400,-627523200,-613008e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,989114400,1001815200,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1175392800,1193536800,1207447200,1224986400,1238896800,1256436e3,1270346400,1288490400,1301796e3,131994e4,1333245600,1351389600,13653e5,1382839200,1396749600,1414288800,1428199200,1445738400,1459648800,1477792800,1491098400,1509242400,1522548e3,1540692e3,1554602400,1572141600,1586052e3,1603591200,1617501600,1635645600,1648951200,1667095200,1924970400],
offset:[-23796,-25200,-21600,-25200,-21600,-25200,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"Africa/Cairo":{time:[-2185401600,-929836800,-923097600,-906163200,-892857600,-875836800,-857779200,-844300800,-825811200,-812678400,-794188800,-779846400,-762652800,-399081600,-38664e4,-368323200,-355104e3,-336783600,-323643600,-305161200,-292021200,-273625200,-260485200,-242089200,-228949200,-210553200,-197413200,-178930800,-165790800,-147394800,-134254800,-115858800,-102632400,-84322800,-71096400,-52700400,-39474e3,-21164400,-7938e3,10371600,23598e3,41907600,55134e3,7353e4,86756400,105066e3,118292400,136602e3,149828400,168138e3,181364400,199760400,212986800,231296400,244522800,262832400,276058800,294368400,307594800,325990800,339217200,357526800,370753200,396406800,402289200,426819600,433825200,452221200,465447600,483757200,496983600,515293200,528519600,546829200,560055600,578451600,591678e3,610419600,623214e3,641523600,65475e4,673059600,686286e3,704682e3,717908400,736218e3,749444400,767754e3,780980400,799027200,812332800,830476800,843782400,861926400,875232e3,893376e3,906681600,925430400,938736e3,95688e4,970185600,988329600,1001635200,1019779200,1033084800,1051228800,1064534400,1083283200,1096588800,1114732800,1128038400,1146182400,1158883200,1177632e3,1189123200,1209081600,1219968e3,1240531200,1250812800,1272585600,1281484800,1284076800,1285891200,1400198400,1403827200,1406851200,1411689600,168264e4,1698364800,1714089600,1730419200,1745539200,1761868800,1776988800,1793318400,1809043200,1824768e3,1840492800,1856217600,1871942400,1887667200,1903392e3,1919721600,1934841600],offset:[7509,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Africa/Casablanca":{
time:[-1773014400,-956361600,-950486400,-942019200,-761184e3,-617241600,-605145600,-81432e3,-71107200,141264e3,147225600,199756800,207705600,231292800,244252800,265507200,271036800,448243200,504921600,1212278400,1220227200,1243814400,1250812800,1272758400,1281225600,1301788800,1312070400,1335664800,1342753200,1345428e3,1348974e3,1367114400,1373166e3,13761e5,1382842800,1396144800,1403924400,1406944800,1414292400,1427594400,1434250800,1437271200,1445742e3,1459044e3,1465095600,1468116e3,1477796400,1490493600,1495335600,1498960800,1509246e3,1521943200,1526180400,1529200800,1540695600,1557025200,1560045600,1587265200,1590890400,161811e4,1621130400,164835e4,1651975200,1679194800,1682215200,1710039600,171306e4,1740279600,1743904800,1771124400,1774144800,1801969200,1804989600,1832209200,1835834400,1863054e3,1866074400,1893294e3,1896919200,1924138800,1927159200],offset:[-1820,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Africa/Johannesburg":{time:[-2458166400,-2109283200,-860968800,-845244e3,-829519200,-813794400,1924999200],offset:[6720,5400,7200,10800,7200,10800,7200]},"Africa/Nairobi":{time:[-194616e4,-1309737600,-1261958400,-1041379200,-865296e3,1925002800],offset:[8836,9e3,10800,9e3,9900,10800]},"Africa/Tunis":{time:[-27972e5,-1855958400,-969238800,-950486400,-941936400,-891129600,-877824e3,-85725e4,-844552800,-842911200,-84222e4,-828223200,-812498400,-796262400,-781048800,-766627200,231206400,243910800,262828800,276051600,581126400,591152400,606873600,622602e3,64152e4,654656400,1114905600,1128045600,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1924995600],offset:[2444,561,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Asia/Kathmandu":{time:[-1577923200,504921600,1925012700],offset:[20476,19800,20700]},"US/Mountain":{
time:[-2717668796,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1538949600,-1534111200,-880236e3,-769417200,-765410400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-25196,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"Europe/Helsinki":{
time:[-2890252800,-1535932800,-875664e3,-859762800,354679200,370407600,386128800,401857200,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5989,5989,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Stockholm":{time:[-2871676800,-2208988800,-1692493200,-1680476400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[4332,3614,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Copenhagen":{time:[-2524521600,-2398291200,-1692493200,-1680483600,-935107200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-769381200,-747007200,-736376400,-715212e3,-706741200,-683157600,-675291600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3020,3020,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Atlantic/Reykjavik":{
time:[-1956614400,-1668214800,-1647212400,-1636678800,-161343e4,-1605142800,-1581894e3,-1539565200,-153135e4,-968029200,-952293600,-942012e3,-920239200,-909961200,-888789600,-877906800,-857944800,-846457200,-826495200,-815007600,-795045600,-783558e3,-762991200,-752108400,-731541600,-717634800,-700092e3,-686185200,-668642400,-654735600,-636588e3,-623286e3,-605743200,-591836400,-573688800,-559782e3,-542239200,-528332400,-510789600,-496882800,-47934e4,-465433200,-447890400,-433983600,-415836e3,-401929200,-384386400,-370479600,-352936800,-33903e4,-321487200,-307580400,-290037600,-276130800,-258588e3,-244681200,-226533600,-212626800,-195084e3,-181177200,-163634400,-149727600,-132184800,-118278e3,-100735200,-86828400,-68680800,-54774e3,1924992e3],offset:[-5280,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0]},"Europe/Tallinn":{time:[-2840140800,-1638316800,-1632002400,-1618693200,-1593820800,-1535932800,-927936e3,-892944e3,-85725e4,-844552800,-828219600,-812498400,-797644800,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909288e3,92259e4,941342400,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5940,5940,3600,7200,3600,5940,7200,10800,7200,3600,7200,3600,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Riga":{
time:[-2840140800,-1632002400,-1618693200,-1601676e3,-1597266e3,-1377302400,-928022400,-899510400,-85725e4,-844552800,-828219600,-812498400,-79677e4,-795830400,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,843966e3,859690800,877838400,891140400,909288e3,92259e4,941342400,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],offset:[5794,5794,9394,5794,9394,5794,7200,10800,7200,3600,7200,3600,7200,3600,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Vilnius":{time:[-2840140800,-1672531200,-1585094400,-1561248e3,-1553558400,-928195200,-900115200,-85725e4,-844552800,-828219600,-812498400,-802137600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891140400,909284400,922586400,941338800,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
offset:[6076,5040,5736,3600,7200,3600,10800,7200,3600,7200,3600,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,7200,3600,7200,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"America/Lima":{time:[-2524521600,-1938556800,-1009843200,-1002067200,-986774400,-971049600,-955324800,-9396e5,504921600,512697600,536457600,544233600,631152e3,638928e3,757382400,765158400,1924974e3],offset:[-18492,-18516,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Santiago":{time:[-2524521600,-1892678400,-1688428800,-1619222400,-1593820800,-1336003200,-13176e5,-1304380800,-1286064e3,-1272844800,-1254528e3,-1241308800,-1222992e3,-1209772800,-1191369600,-1178150400,-870566400,-865296e3,-740534400,-736646400,-718070400,-713667600,-36633600,-23932800,-3369600,7516800,24451200,37756800,55900800,69206400,87955200,100656e3,118195200,132105600,150854400,163555200,182304e3,195609600,213753600,227059200,245203200,258508800,277257600,289958400,308707200,321408e3,340156800,353462400,371606400,384912e3,403056e3,416361600,434505600,447811200,46656e4,479260800,498009600,510710400,529459200,545184e3,560908800,574214400,592358400,605664e3,624412800,637113600,653443200,668563200,687312e3,700617600,718761600,732067200,750211200,763516800,781660800,794966400,813715200,826416e3,845164800,85968e4,876614400,88992e4,906854400,923184e3,939513600,952819200,971568e3,984268800,1003017600,1015718400,1034467200,1047168e3,1065916800,1079222400,1097366400,1110672e3,1128816e3,1142121600,1160870400,1173571200,119232e4,1206835200,1223769600,1237075200,1255219200,1270339200,1286668800,1304812800,1313884800,1335657600,1346544e3,1367107200,1378598400,1398556800,1410048e3,1463270400,1471132800,149472e4,1502582400,1526169600,1534032e3,1554595200,1567900800,1586044800,1599350400,1617494400,16308e5,1648944e3,1662854400,1680393600,1693699200,1712448e3,1725753600,1743897600,1757203200,1775347200,1788652800,1806796800,1820102400,1838246400,1851552e3,1870300800,1883001600,1901750400,1915056e3,19332e5],
offset:[-16965,-16965,-18e3,-16965,-14400,-16965,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-10800,-14400,-18e3,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800]},"Asia/Bahrain":{time:[-897868800,-820540800,76204800,1925002800],offset:[12140,12600,14400,10800]},"Asia/Jakarta":{time:[-3231273600,-1451693568,-117288e4,-876614400,-766022400,-683856e3,-620784e3,-189388800,1925017200],offset:[25632,25632,26400,27e3,32400,27e3,28800,27e3,25200]},"Africa/Lagos":{time:[-2035584e3,-1940889600,-1767225600,-1588464e3,1924995600],offset:[815,0,815,1800,3600]},"Pacific/Norfolk":{time:[-2177452800,-599616e3,152071200,162961200,1443924e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[40312,40320,41400,45e3,41400,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200,39600,43200]},"America/Juneau":{
time:[-3225169588,-2188987200,-880236e3,-769420800,-765410400,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,438998400,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[54139,-32261,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-28800,-28800,-25200,-28800,-25200,-28800,-25200,-32400,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400,-28800,-32400]},"Asia/Ho_Chi_Minh":{time:[-2004048e3,-1851552e3,-852080400,-782614800,-767836800,-718070400,-457743600,-315622800,171849600,1925017200],offset:[25590,25590,25200,28800,32400,25200,28800,25200,28800,25200]},"Australia/Perth":{time:[-2337897600,-1672524e3,-1665349200,-883605600,-876085200,-860364e3,-844635600,152071200,162961200,436327200,447217200,690343200,699418800,1165111200,1174791600,1193536800,1206846e3,1224986400,1238295600,1925020800],offset:[27804,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Europe/Malta":{
time:[-2403475200,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812584800,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,102384e3,118112400,135734400,148525200,167191200,180496800,198640800,211946400,230090400,243396e3,26154e4,274845600,292989600,306295200,323316e3,338349600,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3484,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Amsterdam":{
time:[-4260211200,-1693699200,-168048e4,-1663452e3,-1650142800,-1633212e3,-1617483600,-1601157600,-1586034e3,-1569708e3,-1554584400,-1538258400,-1523134800,-15075e5,-1490562e3,-1470175200,-1459112400,-1443996e3,-1427662800,-1406671200,-1396213200,-1376949600,-1364763600,-1345413600,-1333314e3,-1313791200,-1301259600,-1282255200,-126981e4,-1250719200,-1238360400,-1219183200,-1206910800,-1186956e3,-1175461200,-1156024800,-1143406800,-1124488800,-1111957200,-1092952800,-1080507600,-1061330400,-1049058e3,-1029189600,-1025740800,-1017608400,-998258400,-986158800,-966722400,-954104400,-935020800,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-766616400,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[1172,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,1172,4772,4800,1200,4800,1200,4800,1200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Brussels":{
time:[-2840140800,-2450994150,-1740355200,-1693699200,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1613822400,-1604278800,-1585526400,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1473642e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-1191189600,-1175461200,-1160344800,-1143406800,-1127685600,-1111957200,-1096840800,-1080507600,-1063576800,-1049058e3,-1033336800,-1017608400,-1002492e3,-986158800,-969228e3,-950475600,-942012e3,-934664400,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-766616400,-745452e3,-733266e3,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[1050,1050,0,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Lisbon":{
time:[-1830386205,-1689555600,-1677798e3,-1667437200,-1647734400,-1635814800,-1616198400,-1604365200,-1584662400,-1572742800,-155304e4,-1541206800,-1521504e3,-1442451600,-1426809600,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1221440400,-1206921600,-1191200400,-1175472e3,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942022800,-922665600,-906944400,-891129600,-877309200,-873680400,-864e6,-857952e3,-845859600,-842835600,-831340800,-825897600,-81441e4,-810781200,-799891200,-794448e3,-782960400,-779331600,-768441600,-762998400,-749091600,-733363200,-717631200,-701902800,-686181600,-670453200,-654732e3,-639003600,-623282400,-607554e3,-591832800,-575499600,-559778400,-54405e4,-528328800,-512600400,-496879200,-481150800,-465429600,-449701200,-43398e4,-417646800,-401925600,-386197200,-370476e3,-354747600,-339026400,-323298e3,-307576800,-291848400,-276127200,-260398800,-244677600,-228344400,-212623200,-196894800,-181173600,-165445200,-149724e3,-133995600,-118274400,212547600,228268800,243997200,260323200,276051600,291772800,307504800,323222400,338954400,354675600,370404e3,386125200,401853600,417578400,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],offset:[-2205,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,0,3600,7200,3600,0,3600,7200,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,7200,3600,7200,3600,7200,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Dublin":{
time:[-2821651200,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-733352400,-719445600,-699483600,-684972e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],offset:[-1521,-1521,2079,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Oslo":{
time:[-2366755200,-1691881200,-1680566400,-927507600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-765320400,-340840800,-324507600,-308786400,-293058e3,-277336800,-261608400,-245887200,-230158800,-214437600,-198709200,-182988e3,-166654800,-147909600,-135205200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2580,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Atlantic/Azores":{
time:[-2713910400,-1830383672,-1689555600,-1677798e3,-1667437200,-1647734400,-1635814800,-1616198400,-1604365200,-1584662400,-1572742800,-155304e4,-1541206800,-1521504e3,-1442451600,-1426809600,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1221440400,-1206921600,-1191200400,-1175472e3,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942022800,-922665600,-906944400,-891129600,-877309200,-873680400,-864e6,-857952e3,-845859600,-842835600,-831340800,-825897600,-81441e4,-810781200,-799891200,-794448e3,-782960400,-779331600,-768441600,-762998400,-749091600,-733363200,-717631200,-701902800,-686181600,-670453200,-654732e3,-639003600,-623282400,-607554e3,-591832800,-575499600,-559778400,-54405e4,-528328800,-512600400,-496879200,-481150800,-465429600,-449701200,-43398e4,-417646800,-401925600,-386197200,-370476e3,-354747600,-339026400,-323298e3,-307576800,-291848400,-276127200,-260398800,-244677600,-228344400,-212623200,-196894800,-181173600,-165445200,-149724e3,-133995600,-118274400,228268800,243997200,260323200,276051600,291772800,307504800,323222400,338954400,354675600,370404e3,386125200,401853600,417578400,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733280400,749005200,764726400,780454800,796176e3,811904400,828230400,846378e3,85968e4,877827600,891129600,909277200,922579200,941331600,954028800,972781200,985478400,1004230800,1017532800,1035680400,1048982400,106713e4,1080432e3,1099184400,1111881600,1130634e3,1143331200,1162083600,1174780800,1193533200,1206835200,1224982800,1238284800,1256432400,1269734400,1288486800,1301184e3,1319936400,1332633600,1351386e3,1364688e3,1382835600,1396137600,1414285200,1427587200,1445734800,1459036800,1477789200,1490486400,1509238800,1521936e3,1540688400,1553990400,1572138e3,158544e4,1603587600,1616889600,1635642e3,1648339200,1667091600,1679788800,1698541200,1711843200,1729990800,1743292800,1761440400,1774742400,179289e4,1806192e3,1824944400,1837641600,1856394e3,1869091200,1887843600,1901145600,1919293200,1932595200],
offset:[-6160,-6872,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,0,-3600,-7200,-3600,0,-3600,-7200,-3600,0,-3600,-7200,-3600,0,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,-7200,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,0,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600,0,-3600]}}},1640:(e,t,i)=>{"use strict";i.d(t,{Version:()=>n});var s=i(50151);class n{constructor(e,t){this._major=e,this._minor=t}major(){return this._major}minor(){return this._minor}isZero(){return 0===this._major&&0===this._minor}toString(){return this._major+"."+this._minor}compareTo(e){return this._majore._major?1:this._minore._minor?1:0}isLess(e){return this.compareTo(e)<0}isLessOrEqual(e){return this.compareTo(e)<=0}isEqual(e){return 0===this.compareTo(e)}isGreater(e){return this.compareTo(e)>0}isGreaterOrEqual(e){return this.compareTo(e)>=0}static parse(e){if(e instanceof n)return new n(e.major(),e.minor());if("number"==typeof e)return(0,s.assert)(Math.floor(e)===e,"Version should not be a float number"),new n(e,0);if("string"==typeof e){const t=e.split(".");if(1===t.length){const i=parseInt(t[0],10);return(0,s.assert)(!isNaN(i),"Bad version string: "+e),new n(i,0)}if(2===t.length){const i=parseInt(t[0],10);(0,s.assert)(!isNaN(i),"Bad version string: "+e);const o=parseInt(t[1],10);return(0,s.assert)(!isNaN(o),"Bad version string: "+e),new n(i,o)}throw new Error("Bad version string (one dot expected): "+e)}throw new Error("Bad version: "+e)}}n.ZERO=new n(0,0)},64147:(e,t,i)=>{"use strict";i.d(t,{WatchedValue:()=>o});const s=(0,i(9343).getLogger)("Common.WatchedValue");function n(e){s.logError(`${e&&(e.stack||e.message)}`)}class o{constructor(...e){this._listeners=[],e.length>0&&(this._value=e[0])}destroy(){this.unsubscribe()}value(){return this._owner?this._owner._value:this._value}setValue(e,t){const i=this._owner?this._owner:this;if(i.writeLock)return;const s=i._value===e||Number.isNaN(i._value)&&Number.isNaN(e);if(!t&&s&&i.hasOwnProperty("_value"))return;i._value=e;const o=i._listeners.slice();let r=0;for(let t=0;tthis.spawn(e).readonly(),destroy:this.destroy.bind(this)};return this._readonlyInstance=e,e}spawn(e){return this._spawn(e)}when(e){!function(e,t,i){if(t(e.value()))return void i();const s=n=>{t(n)&&(e.unsubscribe(s),i())};e.subscribe(s,{callWithLast:!0})}(this,(e=>Boolean(e)),(()=>{try{e(this.value())}catch(e){n(e)}}))}assertNoSubscriptions(){0}ownership(){return this}release(){this.destroy()}spawnOwnership(){return this._spawn()}weakReference(){return this._spawn(void 0,!0)}_spawn(e,t){return new r(this._owner||this,e,t)}}class r extends o{constructor(e,t,i){super(),delete this._listeners,this._owner=e,this._onDestroy=t,this._weakReference=!!i}destroy(){try{this._onDestroy?.()}catch(e){n(e)}super.destroy()}readonly(){return super.readonly()}release(){this._weakReference||super.release()}}},91676:(e,t,i)=>{"use strict";i.d(t,{WatchedObject:()=>r});var s=i(64147),n=i(37265);function o(e,t){return(0,n.deepEquals)(e,t)[0]}class r extends s.WatchedValue{constructor(e,t=o){super(e),this._comparator=t}setValue(e,t){(t||!1===this._comparator(this.value(),e))&&super.setValue(e,t)}}},7047:(e,t,i)=>{"use strict";i.d(t,{MouseClickAutoBlurHandler:()=>r,initMouseClickAutoBlurHandler:()=>a});var s=i(81251),n=i(76460);const o="data-mouse-click-auto-blur";class r{constructor(){this._handler=e=>{document.activeElement instanceof HTMLElement&&((0,n.isKeyboardClick)(e)||e.target instanceof Element&&"INPUT"!==document.activeElement.tagName&&null!==document.activeElement.closest(`[${o}]`)&&document.activeElement.blur())},window.addEventListener("click",this._handler,!0)}static attributes(e=!0){return e?{[o]:!0}:{}}}const a=(0,s.default)((()=>new r))},19291:(e,t,i)=>{"use strict";i.d(t,{mapKeyCodeToDirection:()=>h,navigationOrderComparator:()=>r,queryFocusableElements:()=>l,queryTabbableElements:()=>a,updateTabIndexes:()=>c});var s,n=i(63273),o=i(15754);function r(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function a(e){return Array.from(e.querySelectorAll('button:not([disabled]):not([aria-disabled]):not([tabindex="-1"]), [tabindex]:not([disabled]):not([aria-disabled]):not([tabindex="-1"])')).filter((0,o.createScopedVisibleElementFilter)(e))}function l(e){
return Array.from(e.querySelectorAll('button:not([disabled]):not([aria-disabled="true"]):not([aria-disabled=""]), [tabindex]:not([disabled]):not([aria-disabled="true"]):not([aria-disabled=""])')).filter((0,o.createScopedVisibleElementFilter)(e))}function c(){window.dispatchEvent(new CustomEvent("keyboard-navigation-activation",{bubbles:!0}))}function h(e){const t=(0,n.isRtl)();switch(e){case 38:return"blockPrev";case 40:return"blockNext";case 37:return t?"inlineNext":"inlinePrev";case 39:return t?"inlinePrev":"inlineNext";default:return null}}!function(e){e.BlockPrev="blockPrev",e.BlockNext="blockNext",e.InlinePrev="inlinePrev",e.InlineNext="inlineNext"}(s||(s={}))},27235:(e,t,i)=>{"use strict";i.d(t,{TOOLBAR_WIDTH_COLLAPSED:()=>n,TOOLBAR_WIDTH_EXPANDED:()=>s});const s=52,n=5},6307:(e,t,i)=>{"use strict";i.d(t,{isDrawingToolbarVisible:()=>l});var s=i(56840),n=i(56570),o=i(64147);const r=!n.enabled("hide_left_toolbar_by_default"),a=s.getBool("ChartDrawingToolbarWidget.visible",r),l=new o.WatchedValue(a)},72894:(e,t,i)=>{"use strict";i.d(t,{HEADER_TOOLBAR_HEIGHT_COLLAPSED:()=>o,HEADER_TOOLBAR_HEIGHT_EXPANDED:()=>n});var s=i(61223);const n=parseInt(s["css-value-header-toolbar-height"]),o=3},27514:(e,t,i)=>{"use strict";i.d(t,{shouldShowQuickSearchOnLib:()=>r});var s=i(49483),n=i(84015),o=i(56570);function r(){return!s.CheckMobile.any()&&!(0,n.isOnMobileAppPage)("any")&&!o.enabled("widget")&&o.enabled("header_quick_search")}},81199:(e,t,i)=>{"use strict";i.d(t,{ActionWithStandardIcon:()=>o});var s=i(29023),n=i(67375);class o extends s.Action{constructor(e){const{options:t,customActionOptions:i}=e;t.iconId&&(t.icon=t.icon??n.icons.get(t.iconId)),i&&i.iconId&&(i.icon=i.icon??n.icons.get(i.iconId)),super(e)}}},29023:(e,t,i)=>{"use strict";i.d(t,{Action:()=>c,Separator:()=>h});var s,n=i(50151),o=i(68335),r=i(92184),a=i(52033);class l extends a.Delegate{constructor(e){super(),this._onStartListening=null,this._onStopListening=null,this._onStartListening=e||null}subscribe(e,t,i){const s=0===this._listeners.length;super.subscribe(e,t,i),s&&this._listeners.length>0&&this._onStartListening&&(this._onStopListening=this._onStartListening())}unsubscribe(e,t){const i=0===this._listeners.length;super.unsubscribe(e,t),!i&&0===this._listeners.length&&this._onStopListening&&(this._onStopListening(),this._onStopListening=null)}unsubscribeAll(e){const t=0===this._listeners.length;super.unsubscribeAll(e),!t&&0===this._listeners.length&&this._onStopListening&&(this._onStopListening(),this._onStopListening=null)}destroy(){this._onStopListening&&(this._onStopListening(),this._onStopListening=null),super.destroy()}}!function(e){e.Normal="normal",e.Big="big"}(s||(s={}));class c{constructor(e){this.type="action",this._destroyed=!1,this._loadOptionsPromise=null,this._customAction=null;const{actionId:t,options:i,optionsLoader:s,customActionOptions:o,customActionOptionsLoader:a,id:h=r.guid(),onStartListening:d}=e;(0,n.assert)(void 0!==t,"actionId must be defined"),this.id=h,this._onUpdate=new l(d),this._options={actionId:t,...i},this.update(i),
this._loadOptionsGetter=s??null,this._loadOptionsGetter&&(this._options.loading=!0),o&&(this._customAction=new c({actionId:t,options:o,optionsLoader:a,id:h}))}custom(){return this._customAction}execute(){this._options.checkable&&this.update({checked:!this._options.checked}),this._options.onExecute&&this._options.onExecute(this)}getLabel(){return this._options.label||""}getSubItems(){return this._options.subItems||[]}isDisabled(){return!0===this._options.disabled}isActive(){return!0===this._options.active}isCheckable(){return!0===this._options.checkable}isChecked(){return!0===this._options.checked}isLoading(){return!0===this._options.loading}loadOptions(){return this._loadOptionsPromise?this._loadOptionsPromise:this._loadOptionsGetter?(this._loadOptionsPromise=this._loadOptionsGetter().then((e=>this.update({...e,loading:!1}))),this._loadOptionsPromise):null}getSize(){return this._options.size??"normal"}getPayload(){return this._options.payload}update(e){this._destroyed||(this._unbindShortcut(),e.hotkeyHash&&(this._options.shortcutHint=(0,o.humanReadableHash)(e.hotkeyHash)),this._options=Object.assign(this._options,e),this._bindShortcut(),this._onUpdate.fire(this))}onUpdate(){return this._onUpdate}getState(){return this.loadOptions(),{actionId:this._options.actionId,label:this.getLabel(),styledLabel:this._options.styledLabel,disabled:this.isDisabled(),active:this.isActive(),subItems:this.getSubItems(),checkable:this.isCheckable(),checked:this.isChecked(),loading:this.isLoading(),size:this.getSize(),doNotCloseOnClick:this._options.doNotCloseOnClick||!1,shortcutHint:this._options.shortcutHint,hint:this._options.hint,icon:this._options.icon,iconId:this._options.iconId,iconChecked:this._options.iconChecked,toolbox:this._options.toolbox,showToolboxOnHover:this._options.showToolboxOnHover||!1,statName:this._options.statName,name:this._options.name,invisibleHotkey:this._options.invisibleHotkey,noInteractive:this._options.noInteractive,jsxLabel:"jsxLabel"in this._options?this._options.jsxLabel:void 0,isRepeatAccepted:this._options.isRepeatAccepted}}destroy(){this._destroyed=!0,this._onUpdate.destroy(),this._unbindShortcut(),this._options.onDestroy?.(),this._customAction?.destroy()}options(){return this._options}_bindShortcut(){if(!this._options.hotkeyGroup||!this._options.hotkeyHash)return;const e="string"==typeof this._options.label?this._options.label:this._options.name;this._hotkeyAction=this._options.hotkeyGroup.add({hotkey:this._options.hotkeyHash,isRepeatAccepted:this._options.isRepeatAccepted,desc:e,handler:()=>this.execute(),isDisabled:()=>this.isDisabled()})}_unbindShortcut(){this._hotkeyAction&&(this._hotkeyAction.destroy(),delete this._hotkeyAction)}}class h{constructor(e){this.type="separator",this.id=r.guid(),this._hint=e}getHint(){return this._hint}}},67375:(e,t,i)=>{"use strict";i.d(t,{icons:()=>w});var s,n=i(53573),o=i(34369),r=i(39267),a=i(93544),l=i(84959),c=i(37924),h=i(77067),d=i(16911),u=i(25191),_=i(54190),p=i(6862),m=i(97874),g=i(2872),f=i(29453),y=i(94839),v=i(5845),S=i(1457),b=i(93379);!function(e){
e.ChartShowDataWindow="Chart.ShowDataWindow",e.ChartReset="Chart.Reset",e.ChartRemoveSelectedObject="Chart.RemoveSelectedObject",e.Settings="Settings",e.ChartHide="Chart.Hide",e.ChartSymbolInfo="Chart.SymbolInfo",e.ChartFinancials="Chart.Financials",e.ChartTechnicals="Chart.Technicals",e.ChartDetailsMetrics="Chart.DetailsMetrics",e.AlertAdd="Alert.Add",e.AlertEdit="Alert.Edit",e.AlertRestart="Alert.Restart",e.AlertStop="Alert.Stop",e.AlertEventsExport="Alert.EventsExport",e.ClearAll="Alert.Clear",e.ChartVisualOrder="Chart.VisualOrder",e.ChartShowObject="Chart.ShowObject",e.ChartPriceScale="Chart.PriceScale",e.ChartMove="Chart.Move",e.ChartApplyIndicator="Chart.ApplyIndicator",e.ChartUnlockObject="Chart.UnlockObject",e.ChartLockObject="Chart.LockObject",e.ChartAnchorLineTool="Chart.AnchorLineTool",e.ChartInsertRowTable="Chart.InsertRowTable",e.ChartInsertColumnTable="Chart.InsertColumnTable",e.ChartRemoveRowTable="Chart.RemoveRowTable",e.ChartRemoveColumnTable="Chart.RemoveColumnTable",e.ChartClone="Chart.Clone",e.ChartAddHorzLine="Chart.AddHorzLine",e.WatchlistAddSymbol="Watchlist.AddSymbol",e.WatchlistCreateNew="Watchlist.CreateNew",e.TextNoteAdd="TextNote.Add",e.TradingSell="Trading.Sell",e.TradingBuy="Trading.Buy",e.ObjectsTreeCreateGroup="ObjectsTree.CreateGroup",e.ObjectsTreeRenameItem="ObjectsTree.RenameItem",e.IndicatorAddToFavorites="Indicator.AddToFavorites"}(s||(s={}));const w=new Map([["Chart.Reset",r],["Chart.RemoveSelectedObject",a],["Settings",o],["Chart.Hide",l],["Chart.SymbolInfo",c],["Chart.VisualOrder",h],["Chart.ShowObject",d],["Chart.PriceScale",u],["Chart.Move",_],["Chart.ApplyIndicator",p],["Chart.UnlockObject",m],["Chart.LockObject",g],["Chart.AnchorLineTool",f],["Chart.InsertRowTable",y],["Chart.InsertColumnTable",v],["Chart.RemoveRowTable",a],["Chart.RemoveColumnTable",a],["Chart.Clone",S],["Chart.AddHorzLine",b],["Indicator.AddToFavorites",n]])},56657:(e,t,i)=>{"use strict";i.d(t,{ActionsProvider:()=>st,createActionCopyPrice:()=>Je,createActionToggleVisibilityDataSources:()=>tt,createChangeIntervalsVisibilitiesAction:()=>Xe,createLinesAction:()=>Qe,createPasteAction:()=>Ye,createSyncDrawingActions:()=>et,createVisualOrderAction:()=>Ze,defaultContextMenuOptions:()=>Ke});var s=i(50151),n=i(9343),o=(i(60521),i(37265)),r=i(11542),a=i(56570),l=i(29023),c=i(96152),h=i(19466),d=i(79036),u=(i(26023),i(25149)),_=i(28388),p=i(68335),m=(i(25812),i(85604)),g=i(80387),f=i(86920),y=i(32755),v=i(60074),S=i(34585),b=i(45126),w=(i(928),i(85049)),C=i(85719),P=i(10892),T=i(56616),x=i(65383),I=i(12988),M=i(300),A=i(81199);(0,n.getLogger)("Chart.ActionsProvider");const L=new b.TranslatedString("change visibility",r.t(null,void 0,i(1924))),k=new b.TranslatedString("pin to scale {label}",r.t(null,void 0,i(81566))),D=new b.TranslatedString("pin to right scale",r.t(null,void 0,i(7495))),E=new b.TranslatedString("pin to left scale",r.t(null,void 0,i(78690))),B=(new b.TranslatedString("change earnings visibility",r.t(null,void 0,i(6819))),new b.TranslatedString("change dividends visibility",r.t(null,void 0,i(53929))),
new b.TranslatedString("change splits visibility",r.t(null,void 0,i(47474))),new b.TranslatedString("change continuous contract switch visibility",r.t(null,void 0,i(18867))),new b.TranslatedString("change futures contract expiration visibility",r.t(null,void 0,i(85532))),new b.TranslatedString("change latest news and Minds visibility",r.t(null,void 0,i(50243))),new b.TranslatedString("show all ideas",r.t(null,void 0,i(13336)))),V=new b.TranslatedString("show ideas of followed users",r.t(null,void 0,i(91395))),R=new b.TranslatedString("show my ideas only",r.t(null,void 0,i(57460))),N=(new b.TranslatedString("change events visibility on chart",r.t(null,void 0,i(6119))),new b.TranslatedString("add this symbol to entire layout",r.t(null,void 0,i(79290)))),O=new b.TranslatedString("add this indicator to entire layout",r.t(null,void 0,i(96677))),F=(new b.TranslatedString("add this strategy to entire layout",r.t(null,void 0,i(58156))),new b.TranslatedString("add this financial metric to entire layout",r.t(null,void 0,i(67608))),new b.TranslatedString("apply drawing template",r.t(null,void 0,i(89720))),new b.TranslatedString("lock objects",r.t(null,void 0,i(18942)))),W=new b.TranslatedString("unlock objects",r.t(null,void 0,i(23230))),H=new b.TranslatedString("anchor objects",r.t(null,void 0,i(63869))),z=new b.TranslatedString("unanchor objects",r.t(null,void 0,i(99234))),U=new b.TranslatedString("change visibility at current interval and above",r.t(null,void 0,i(45800))),j=new b.TranslatedString("change visibility at current interval and below",r.t(null,void 0,i(75645))),G=new b.TranslatedString("change visibility at current interval",r.t(null,void 0,i(84331))),q=new b.TranslatedString("change visibility at all intervals",r.t(null,void 0,i(57916))),$=(r.t(null,void 0,i(66823)),(0,S.appendEllipsis)(r.t(null,void 0,i(264))),r.t(null,void 0,i(98334))),K=r.t(null,void 0,i(27298)),Y=r.t(null,void 0,i(3564)),Z=r.t(null,void 0,i(94559)),X=r.t(null,void 0,i(2165)),J=r.t(null,void 0,i(16986)),Q=r.t(null,void 0,i(12645)),ee=r.t(null,void 0,i(44579)),te=r.t(null,void 0,i(29436)),ie=r.t(null,void 0,i(81054)),se=r.t(null,void 0,i(32538)),ne=r.t(null,void 0,i(72046)),oe=r.t(null,void 0,i(90095)),re=r.t(null,void 0,i(14115)),ae=r.t(null,void 0,i(33110)),le=r.t(null,void 0,i(28280)),ce=r.t(null,void 0,i(76150)),he=r.t(null,void 0,i(94210)),de=r.t(null,void 0,i(60035)),ue=r.t(null,void 0,i(10761)),_e=r.t(null,void 0,i(11254)),pe=r.t(null,void 0,i(35049)),me=r.t(null,void 0,i(19271)),ge=r.t(null,void 0,i(15512)),fe=r.t(null,void 0,i(46545)),ye=r.t(null,void 0,i(52160)),ve=r.t(null,void 0,i(17293)),Se=r.t(null,void 0,i(21973)),be=r.t(null,void 0,i(55481)),we=r.t(null,void 0,i(71179)),Ce=r.t(null,void 0,i(4077)),Pe=r.t(null,void 0,i(54853)),Te=r.t(null,void 0,i(20177)),xe=r.t(null,void 0,i(494)),Ie=r.t(null,void 0,i(60668)),Me=r.t(null,void 0,i(58026)),Ae=r.t(null,void 0,i(56982)),Le=((0,S.appendEllipsis)(r.t(null,void 0,i(35088))),(0,S.appendEllipsis)(r.t(null,void 0,i(2439))),(0,
S.appendEllipsis)(r.t(null,void 0,i(32514)))),ke=(r.t(null,void 0,i(78358)),(0,S.appendEllipsis)(r.t(null,void 0,i(76266))),r.t(null,void 0,i(49680))),De=r.t(null,void 0,i(12537)),Ee=(r.t(null,void 0,i(93553)),r.t(null,void 0,i(74975))),Be=r.t(null,void 0,i(99894)),Ve=r.t(null,void 0,i(51077)),Re=r.t(null,void 0,i(24185)),Ne=(r.t(null,void 0,i(37113)),r.t(null,void 0,i(29449)),r.t(null,void 0,i(50849)),r.t(null,void 0,i(33158)),r.t(null,void 0,i(81465)),r.t(null,void 0,i(62986)),r.t(null,void 0,i(55418))),Oe=r.t(null,void 0,i(10261)),Fe=r.t(null,void 0,i(44020)),We=((0,S.appendEllipsis)(r.t(null,void 0,i(32514))),r.t(null,void 0,i(97878)),r.t(null,void 0,i(39010))),He=r.t(null,void 0,i(26090)),ze=(r.t(null,void 0,i(95754)),r.t(null,void 0,i(35679)),r.t(null,void 0,i(9140)),r.t(null,void 0,i(46607)),r.t(null,void 0,i(39079)),(0,S.appendEllipsis)(r.t(null,void 0,i(75594)))),Ue=(0,S.appendEllipsis)(r.t(null,void 0,i(88853))),je=r.t(null,void 0,i(35140)),Ge=r.t(null,void 0,i(63553)),qe=r.t(null,void 0,i(92957)),$e=r.t(null,void 0,i(58764)),Ke=(r.t(null,void 0,i(10996)),r.t(null,void 0,i(3061)),{general:!0,mainSeries:!0,mainSeriesTrade:!1,esdStudies:!0,studies:!0,fundamentals:!0,lineTools:!0,publishedCharts:!0,ordersAndPositions:!0,alerts:!0,chartEvents:!0,objectTree:!0,gotoLineTool:!1});function Ye(e,t){return!t.isEmpty()&&a.enabled("datasource_copypaste")?new A.ActionWithStandardIcon({actionId:"Chart.Clipboard.PasteSource",options:{label:je.trim(),shortcutHint:(0,p.humanReadableHash)(p.Modifiers.Mod+86),statName:"Paste",onExecute:()=>e.chartWidgetCollection().clipboard.uiRequestPaste(t)}}):null}function Ze(e,t){const i=e.model(),s=i.availableZOrderOperations(t),n=[new A.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.BringToFront",options:{label:ve,statName:"BringToFront",disabled:!s.bringToFrontEnabled,onExecute:()=>i.bringToFront(t)}}),new A.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.SendToBack",options:{label:Se,statName:"SendToBack",disabled:!s.sendToBackEnabled,onExecute:()=>i.sendToBack(t)}}),new A.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.BringForward",options:{label:be,statName:"BringForward",disabled:!s.bringForwardEnabled,onExecute:()=>i.bringForward(t)}}),new A.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.SendBackward",options:{label:we,statName:"SendBackward",disabled:!s.sendBackwardEnabled,onExecute:()=>i.sendBackward(t)}})];return new A.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder",options:{label:Ce,iconId:"Chart.VisualOrder",statName:"VisualOrder",subItems:n}})}function Xe(e,t){const i=e.model(),s=(e,s)=>{const n=w.Interval.parse(i.mainSeries().interval()),o=(0,P.getIntervalsVisibilitiesForMode)(n,e),r=[],a=[];t.forEach((e=>{const t=e.properties().intervalsVisibilities.childs();r.push(t.ticks),a.push(o.ticks),r.push(t.seconds),a.push(o.seconds),r.push(t.secondsFrom),a.push(o.secondsFrom),r.push(t.secondsTo),a.push(o.secondsTo),r.push(t.minutes),a.push(o.minutes),r.push(t.minutesFrom),a.push(o.minutesFrom),r.push(t.minutesTo),
a.push(o.minutesTo),r.push(t.hours),a.push(o.hours),r.push(t.hoursFrom),a.push(o.hoursFrom),r.push(t.hoursTo),a.push(o.hoursTo),r.push(t.days),a.push(o.days),r.push(t.daysFrom),a.push(o.daysFrom),r.push(t.daysTo),a.push(o.daysTo),r.push(t.weeks),a.push(o.weeks),r.push(t.weeksFrom),a.push(o.weeksFrom),r.push(t.weeksTo),a.push(o.weeksTo),r.push(t.months),a.push(o.months),r.push(t.monthsFrom),a.push(o.monthsFrom),r.push(t.monthsTo),a.push(o.monthsTo),r.push(t.ranges),a.push(o.ranges)})),i.setProperties(r,a,s,(0,M.sourcesAffectState)(t))},n=[new A.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.CurrentAndAbove",options:{label:Te,statName:"currentAndAboveIntervals",onExecute:()=>s(3,U)}}),new A.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.CurrentAndBelow",options:{label:xe,statName:"currentAndBelowIntervals",onExecute:()=>s(2,j)}}),new A.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.Current",options:{label:Ie,statName:"currentInterval",onExecute:()=>s(1,G)}}),new A.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.All",options:{label:Me,statName:"allIntervals",onExecute:()=>s(0,q)}})];return new A.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility",options:{label:Pe,statName:"IntervalsVisibility",subItems:n}})}function Je(e,t){const i=e.defaultPriceScale(),s=void 0!==t?i.coordinateToPrice(t,e.mainDataSource()?.firstValue()??0):e.model().mainSeries().lastValueData(4,!0,!0).price,n=e.mainDataSource()?.formatter();if(void 0===s||!n)return null;const o=n.format(s),r=n.format(s,{ignoreLocaleNumberFormat:!0});return new A.ActionWithStandardIcon({actionId:"Chart.Clipboard.CopyPrice",options:{label:`${Ge} ${o}`,statName:"CopyPrice",onExecute:()=>(0,T.getClipboard)().writeText(r)}})}function Qe(e){const t=e.actions(),i=[t.showPriceLine];return i.push(t.showHighLowPriceLines),a.enabled("show_average_close_price_line_and_label")&&i.push(t.showAverageClosePriceLine),new A.ActionWithStandardIcon({actionId:"Chart.Lines",options:{label:Ae,statName:"Lines",subItems:i}})}function et(e,t){return[]}function tt(e,t){const i=t[0].properties().visible.value(),s=i?K:$,n=i?"Chart.Hide":"Chart.ShowObject",o=i?"Chart.SelectedObject.Hide":"Chart.SelectedObject.Show";return new A.ActionWithStandardIcon({actionId:o,options:{checkable:!0,statName:"ToggleVisibilitySelectedObject",label:s,iconId:n,onExecute:()=>{const s=e.model();s.withMacro(L,(()=>{t.forEach((e=>{s.setProperty(e.properties().visible,!i,L,C.lineToolsDoNotAffectChartInvalidation&&(0,y.isLineTool)(e))}))}))}}})}var it;!function(e){e.Copy="Copy"}(it||(it={}));class st{constructor(e,t){this._chartWidget=e,this._options=(0,o.merge)((0,o.clone)(Ke),t||{})}async contextMenuActionsForSources(e,t,i,n,o){const r=e[0],a=this._options,c=[];if(r===this._chartWidget.model().mainSeries()&&a.mainSeries)c.push(...await this._contextMenuActionsForSeries(r,i));else if((0,d.isStudy)(r)&&a.studies)c.push(...await this._contextMenuActionsForStudy(r,(0,s.ensureDefined)(t),i));else if((0,
y.isLineTool)(r)&&a.lineTools){const t=e.filter(y.isLineTool);c.push(...await this._contextMenuActionsForLineTool(t))}else 0;return c.length&&o?.length&&c.push(new l.Separator),c.push(...o??[]),c}async actionForLineTools(e,t){switch(t){case"Chart.SelectedObject.ToggleAnchored":return this._createActionToggleAnchorLineTools(e);case"Chart.SelectedObject.InsertRowTable":{if(1!==e.length)return null;const t=e[0];return((await(t.additionalActions?.(this._chartWidget.model())))?.actions??[]).filter((e=>"action"===e.type&&"Chart.SelectedObject.InsertRowTable"===e.getState().actionId))[0]??null}case"Chart.SelectedObject.InsertColumnTable":{if(1!==e.length)return null;const t=e[0];return((await(t.additionalActions?.(this._chartWidget.model())))?.actions??[]).filter((e=>"action"===e.type&&"Chart.SelectedObject.InsertColumnTable"===e.getState().actionId))[0]??null}}throw new Error(`Unsupported actionId: ${t}`)}_isReadOnly(){return this._chartWidget.readOnly()}_createActionScale(e){const t=(0,s.ensureNotNull)(e.priceScale()),i=this._chartWidget.model().model(),n=(0,s.ensureNotNull)(i.paneForSource(e)),o=n.priceScalePosition(t),r=("left"===o?n.leftPriceScales():n.rightPriceScales()).indexOf(t),a=i.priceScaleSlotsCount().totallySlots<2?"dontneedname":"needname",l="overlay"===o?"":(0,c.getPriceAxisNameInfo)(o,r).label,h=ce.format({label:l}),d={"left-needname":h,"left-dontneedname":de,"right-needname":h,"right-dontneedname":ue,"overlay-needname":he,"overlay-dontneedname":he}[o+"-"+a];return new A.ActionWithStandardIcon({actionId:"Chart.Source.ChangePriceScale",options:{label:d,iconId:"Chart.PriceScale",subItems:this._createActionScaleItems(e)}})}_createActionResetInputPoints(e){const t=e.metaInfo(),s=t.inputs.filter(x.isTimeOrPriceNotHiddenInput);return 0===s.length?null:new A.ActionWithStandardIcon({actionId:"Chart.Source.ResetInputPoints",options:{label:Ue,onExecute:async()=>{let n;try{const o=e.properties().childs().inputs.state();for(const e of Object.keys(o))s.find((t=>t.id===e))||delete o[e];const r=new I.Property({inputs:o}),a=await Promise.all([i.e(9003),i.e(3703),i.e(3953),i.e(4524),i.e(7939),i.e(9258),i.e(5387),i.e(4178),i.e(9481),i.e(4600),i.e(2564),i.e(6445),i.e(7384),i.e(3799),i.e(2197),i.e(5480),i.e(5323),i.e(1072),i.e(9325),i.e(116),i.e(8985),i.e(8222),i.e(4106),i.e(7444),i.e(2440),i.e(9296),i.e(625),i.e(5083),i.e(9255),i.e(7935),i.e(422),i.e(1531),i.e(6316),i.e(2227),i.e(4931),i.e(9418),i.e(3202),i.e(2751),i.e(9928),i.e(7223),i.e(9443),i.e(3030)]).then(i.bind(i,73339));n=(await a.selectInputValuesOnChart(this._chartWidget,s,r,t.shortDescription,t.inputs)).customSourceId,e.properties().mergeAndFire(r.state())}finally{void 0!==n&&this._chartWidget.model().model().removeCustomSource(n)}}}})}_createActionLayoutChartsSync(){return new LayoutChartsSyncContextMenuAction(this._chartWidget.linkingGroupIndex().readonly(),(e=>this._chartWidget.model().setLinkingGroupIndex(e)))}_createActionScaleDetach(e,t,i,n){const o=this._chartWidget.model().model(),r=(0,s.ensureNotNull)(o.paneForSource(e))
;if(!r.canCreateNewPriceScale())return null;const a=(0,s.ensureNotNull)(e.priceScale()),l=a.canDetachSource(e),h=r.priceScalePosition(a),d=l||h!==t;if(!d)return null;const u=o.priceScaleSlotsCount(),_={left:{labelled:te,sided:ae},right:{labelled:te,sided:le}},p="left"===t?r.leftPriceScales().length:r.rightPriceScales().length,m=u[t]>p?"labelled":"sided",g=(0,c.getPriceAxisNameInfo)(t,p).label,f=_[t][m].format({label:g});return new A.ActionWithStandardIcon({actionId:"Chart.Source.ChangePriceScale",options:{checkable:!1,disabled:!d,label:f,statName:n,payload:e,onExecute:i}})}_onDetachLeft(e){const t=e.getPayload(),i=this._chartWidget.model().model(),n=(0,s.ensureNotNull)(i.paneForSource(t));this._chartWidget.model().detachToLeft(t,n)}_onDetachRight(e){const t=e.getPayload(),i=this._chartWidget.model().model(),n=(0,s.ensureNotNull)(i.paneForSource(t));this._chartWidget.model().detachToRight(t,n)}_createActionScaleDetachLeft(e){return this._createActionScaleDetach(e,"left",this._onDetachLeft.bind(this),"ToggleScaleLeft")}_createActionScaleDetachRight(e){return this._createActionScaleDetach(e,"right",this._onDetachRight.bind(this),"ToggleScaleRight")}_onMoveToScale(e){const t=e.getPayload();if(t.datasource.priceScale()===t.priceScale)return;const i=this._chartWidget.model().model(),n=(0,s.ensureNotNull)(i.paneForSource(t.datasource));this._chartWidget.model().moveToScale(t.datasource,n,t.priceScale,t.undoText)}_createMoveToScaleAction(e,t,i,s){const n=e.priceScale()===t;return new A.ActionWithStandardIcon({actionId:"Chart.Source.MoveToOtherScale",options:{checkable:!0,checked:n,label:i,statName:"ToggleScale",payload:{datasource:e,priceScale:t,undoText:s},onExecute:this._onMoveToScale.bind(this)}})}_onNoScale(e){const t=e.getPayload().datasource,i=this._chartWidget.model().model(),n=(0,s.ensureNotNull)(i.paneForSource(t));n.isOverlay(t)||this._chartWidget.model().detachNoScale(t,n)}_createActionNoScale(e){const t=this._chartWidget.model().model(),i=(0,s.ensureNotNull)(t.paneForSource(e)),n=i.actionNoScaleIsEnabled(e);return new A.ActionWithStandardIcon({actionId:"Chart.Source.MoveToNoScale",options:{checkable:!0,checked:i.isOverlay(e),label:_e,disabled:!n,statName:"ToggleNoScale",payload:{datasource:e},onExecute:this._onNoScale.bind(this)}})}_createActionScaleItems(e){const t=[],i=this._chartWidget.model().model(),n=(0,s.ensureNotNull)(i.paneForSource(e)),o=i.priceScaleSlotsCount().totallySlots>1,r=n.rightPriceScales(),a=n.leftPriceScales(),h=this._createActionScaleDetachRight(e),d=this._createActionScaleDetachLeft(e),u=r.length+a.length+(null===h?0:1)+(null===d?0:1)>2,_={right:{hidden:{checked:{labelled:Y,sided:Z},unchecked:{labelled:X,sided:J}},visible:{checked:{labelled:Q,sided:ee},unchecked:{labelled:te,sided:ie}}},left:{hidden:{checked:{labelled:Y,sided:se},unchecked:{labelled:X,sided:ne}},visible:{checked:{labelled:Q,sided:oe},unchecked:{labelled:te,sided:re}}}},p={right:D,left:E},m={left:n.visibleLeftPriceScales(),right:n.visibleRightPriceScales()},g=(t,i)=>{
const s=("right"===i?r:a)[t],n=m[i].includes(s)?"visible":"hidden",l=e.priceScale()===s?"checked":"unchecked",h=o?"labelled":"sided",d=_[i],u=(0,c.getPriceAxisNameInfo)(i,t).label;return{actionText:d[n][l][h].format({label:u}),undoText:o?k.format({label:u}):p[i]}};t.push(...r.map(((t,i)=>{const s=g(i,"right");return this._createMoveToScaleAction(e,t,s.actionText,s.undoText)}))),null!==h&&t.push(h);u&&(r.length>0||null!==h)&&t.push(new l.Separator);t.push(...a.map(((t,i)=>{const s=g(i,"left");return this._createMoveToScaleAction(e,t,s.actionText,s.undoText)}))),null!==d&&t.push(d);u&&(a.length>0||null!==d)&&t.push(new l.Separator);return t.push(this._createActionNoScale(e)),t}_createActionMergeUp(e){const t=this._chartWidget.model();return t.model().isMergeUpAvailableForSource(e)?new A.ActionWithStandardIcon({actionId:"Chart.Source.MergeUp",options:{label:me,statName:"MergeUp",onExecute:()=>t.mergeSourceUp(e)}}):null}_createActionUnmergeUp(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new A.ActionWithStandardIcon({actionId:"Chart.Source.UnmergeUp",options:{label:ge,statName:"UnmergeUp",onExecute:()=>t.unmergeSourceUp(e)}}):null}_createActionMergeDown(e){const t=this._chartWidget.model();return t.model().isMergeDownAvailableForSource(e)?new A.ActionWithStandardIcon({actionId:"Chart.Source.MergeDown",options:{label:fe,statName:"MergeDown",onExecute:()=>t.mergeSourceDown(e)}}):null}_createActionUnmergeDown(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new A.ActionWithStandardIcon({actionId:"Chart.Source.UnmergeDown",options:{label:ye,statName:"UnmergeDown",onExecute:()=>t.unmergeSourceDown(e)}}):null}_mergeContentMenuItems(e){return[this._createActionMergeUp(e),this._createActionUnmergeUp(e),this._createActionMergeDown(e),this._createActionUnmergeDown(e)].filter(o.notNull)}_createActionMove(e){const t=this._mergeContentMenuItems(e);return t.length>0?new A.ActionWithStandardIcon({actionId:"Chart.Source.MoveToPane",options:{label:pe,iconId:"Chart.Move",subItems:t}}):null}async _createDetailsMetricsAction(e){return null}async _contextMenuActionsForSeries(e,t){const i=[],n=this._chartWidget.model().model(),o=(0,s.ensureNotNull)(n.paneForSource(e)),r=this._chartWidget.actions(),c=t&&"localY"in t?t.localY:void 0;if(this._isReadOnly())i.push(tt(this._chartWidget,[e])),i.push(new l.Separator),i.push(this._createActionScale(e));else{0,i.length>0&&!(i[i.length-1]instanceof l.Separator)&&i.push(new l.Separator),a.enabled("symbol_info")&&i.push(r.showSymbolInfoDialog);const t=await this._createDetailsMetricsAction(e);if(t&&i.push(t),i.length>0&&!(i[i.length-1]instanceof l.Separator)&&i.push(new l.Separator),!o.isEmpty()&&a.enabled("datasource_copypaste")){const e=Je(o,c),t=Ye(this._chartWidget,o);(e||t)&&(e&&i.push(e),t&&i.push(t),i.push(new l.Separator))}i.push(Ze(this._chartWidget,[e]));const s=this._createActionMove(e);null!==s&&i.push(s),i.push(this._createActionScale(e)),i.push(tt(this._chartWidget,[e])),i.push(new l.Separator)
;Boolean(window.widgetbar?.widget("watchlist"))&&r.addToWatchlist&&(r.addToWatchlist.request(),i.push(r.addToWatchlist)),a.enabled("text_notes")&&i.push(r.addToTextNotes),i[i.length-1]instanceof l.Separator||i.push(new l.Separator),a.enabled("show_chart_property_page")&&!this._chartWidget.onWidget()&&i.push(r.mainSeriesPropertiesAction),i[i.length-1]instanceof l.Separator&&i.pop()}return i}_createActionAddChildStudy(e){throw new Error("unsupported")}_createActionAddFundamentals(e){return null}_createActionShowSymbolInfoDialog(e,t){const i=this._chartWidget.model().model();return new A.ActionWithStandardIcon({actionId:"Chart.Dialogs.ShowSymbolInfo",options:{label:ze,iconId:"Chart.SymbolInfo",checkable:!1,statName:"SymbolInfo",onExecute:()=>{const s={symbolInfo:e.symbolInfo(),unitDescription:e=>e?t.description(e):"",dateFormatter:i.dateFormatter()};(0,g.showSymbolInfoDialog)(s)}}})}_createActionShowProperties(e){return new A.ActionWithStandardIcon({actionId:"Chart.Indicator.ShowSettingsDialog",options:{label:Le,iconId:"Settings",statName:"EditSelectedObject",onExecute:()=>this._chartWidget.showSourceProperties(e)}})}async _contextMenuActionsForStudy(e,t,i){const s=t!==this._chartWidget.model().paneForSource(e),n=this._chartWidget.actions(),o=(i&&"localY"in i&&i.localY,[]);if(!e.userEditEnabled())return o;if(this._chartWidget.readOnly())o.push(tt(this._chartWidget,[e])),o.push(new l.Separator),(0,u.isNonSeriesStudy)(e)||o.push(this._createActionScale(e));else{0,a.enabled("study_on_study")&&e.canHaveChildren()&&o.push(this._createActionAddChildStudy(e));const t=this._createApplyToEntireLayoutCommand(e);null!==t&&o.push(t);const i=this._createAddIndicatorToFavoritesCommand(e);if(i&&o.push(i),o.length>0&&!(o[o.length-1]instanceof l.Separator)&&o.push(new l.Separator),a.enabled("symbol_info")&&(0,d.isCompareOrOverlayStudy)(e)&&null!==e.symbolInfo()&&(o.push(this._createActionShowSymbolInfoDialog(e,this._chartWidget.model().model().availableUnits())),o.push(new l.Separator)),s||o.push(Ze(this._chartWidget,[e])),o.push(Xe(this._chartWidget,[e])),!(0,u.isNonSeriesStudy)(e)&&!s){const t=this._createActionMove(e);null!==t&&o.push(t),o.push(this._createActionScale(e))}o.push(new l.Separator);const r=e.metaInfo();if(e.copiable()){const t=new A.ActionWithStandardIcon({actionId:"Chart.Clipboard.CopySource",options:{label:ke,shortcutHint:(0,p.humanReadableHash)(p.Modifiers.Mod+67),statName:"Copy",onExecute:()=>{this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy([e])}}});o.push(t)}o.push(tt(this._chartWidget,[e])),o.push(n.studyRemove);const c=this._options.objectTree&&n.paneObjectTree,h=!1;(c||h)&&(o.push(new l.Separator),c&&o.push(n.paneObjectTree),h&&o.push(this._chartWidget.actions().showDataWindow)),o.push(new l.Separator),a.enabled("property_pages")&&new _.MetaInfoHelper(r).hasUserEditableOptions()&&o.push(this._createActionShowProperties(e)),o[o.length-1]instanceof l.Separator&&o.pop()}return o}_createLineToolTemplateAction(e){return null}_createActionToggleLockLineTools(e){
const t=e[0].properties().frozen.value(),i=t?Be:Ve;return new A.ActionWithStandardIcon({actionId:"Chart.SelectedObject.ToggleLocked",options:{label:i,statName:"ToggleLockSelectedObject",checkable:!0,iconId:t?"Chart.UnlockObject":"Chart.LockObject",onExecute:()=>{if(1===e.length)this._chartWidget.toggleLockSelectedObject();else{const i=t?W:F,s=this._chartWidget.model();s.withMacro(i,(()=>{e.forEach((e=>{s.setProperty(e.properties().frozen,!t,i,C.lineToolsDoNotAffectChartInvalidation)}))}))}}}})}_createActionToggleAnchorLineTools(e){const t=e.filter((e=>e.anchorable()));if(0===t.length)return null;const i=t[0].properties().anchored.value();return new A.ActionWithStandardIcon({actionId:"Chart.SelectedObject.ToggleAnchored",options:{label:Re,statName:"ToggleAnchoredSelectedObject",checkable:!0,checked:i,onExecute:()=>{const e=i?z:H,s=this._chartWidget.model();s.withMacro(e,(()=>{t.forEach((t=>{s.setProperty(t.properties().childs().anchored,!i,e,C.lineToolsDoNotAffectChartInvalidation)}))}))}}})}async _contextMenuActionsForLineTool(e){const t=[],i=this._chartWidget.actions(),s=(this._chartWidget.model().model(),()=>{t.push(Ze(this._chartWidget,e))}),n=()=>{t.push(Xe(this._chartWidget,e))},o=()=>{const i=e.filter((e=>e.cloneable()));if(i.length>0){const e=new A.ActionWithStandardIcon({actionId:"Chart.LineTool.Clone",options:{label:De,iconId:"Chart.Clone",shortcutHint:(0,p.humanReadableModifiers)(p.Modifiers.Mod)+"Drag",statName:"Clone",onExecute:()=>this._chartWidget.model().cloneLineTools(i,!1)},id:"Clone"});t.push(e)}return!!i.length},r=()=>{const i=e.filter((e=>e.copiable()));if(i.length>0){const e=new l.Action({actionId:"Chart.Clipboard.CopyLineTools",options:{label:ke,shortcutHint:(0,p.humanReadableHash)(p.Modifiers.Mod+67),statName:"Copy",onExecute:()=>this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy(i)},id:"Copy"});t.push(e)}return!!i.length},c=()=>{const e=(this._chartWidget,[]);return t.push(...e),e.length>0},d=e=>{const i=new A.ActionWithStandardIcon({actionId:"Chart.ScrollToLineTool",options:{label:Ee.format({lineToolName:e.title(h.TitleDisplayTarget.StatusLine)}),statName:"GoToLineTool",checkable:!1,onExecute:async()=>this._chartWidget.model().scrollToLineTool(e)}});t.push(i)},u=e=>{const t=this._chartWidget.model().model().lineToolsGroupModel(),i=e.map((e=>t.groupForLineTool(e)));return new Set(i).size<=1};if(1===e.length){const h=e[0];let u={actions:[],placement:"CustomAction"};if(h.additionalActions&&(u=await h.additionalActions(this._chartWidget.model())),u.actions.length>0&&"BeforeAll"===u.placement&&(t.push(...u.actions),t.push(new l.Separator)),this._chartWidget.readOnly())t.push(tt(this._chartWidget,[h]));else if(h.userEditEnabled()){0,s(),n(),this._options.objectTree&&i.paneObjectTree&&t.push(i.paneObjectTree),t.push(new l.Separator);let e=o();e=r()||e,e&&t.push(new l.Separator),e=c(),e&&t.push(new l.Separator),u.actions.length>0&&"CustomAction"===u.placement&&(t.push(...u.actions),t.push(new l.Separator));const _=this._createActionToggleAnchorLineTools([h]);_&&(t.push(_),
t.push(new l.Separator)),t.push(this._createActionToggleLockLineTools([h])),t.push(tt(this._chartWidget,[h])),t.push(i.lineRemove),h.points().length>0&&this._options.gotoLineTool&&(t.push(new l.Separator),d(h));const p=await this._chartWidget.propertiesDefinitionsForSource(h);a.enabled("property_pages")&&null!==p&&(t.push(new l.Separator),t.push(i.format))}}else{this._options.objectTree&&i.paneObjectTree&&t.push(i.paneObjectTree),u(e)&&s(),n(),t.length>0&&t.push(new l.Separator);let h=o();h=r()||h,h&&t.push(new l.Separator),h=c(),h&&t.push(new l.Separator),t.push(this._createActionToggleLockLineTools(e)),t.push(tt(this._chartWidget,e)),t.push(i.lineRemove),a.enabled("property_pages")&&(t.push(new l.Separator),t.push(i.format))}return t}_createEarningsShow(){return null}_createDividendsShow(){return null}_createSplitsShow(){return null}_contextMenuActionsForESD(){return[]}_contextMenuActionsForRollDates(){return[]}_contextMenuActionsForFuturesContractExpiration(){return[]}_contextMenuActionsForisLatestUpdates(){return[]}_contextMenuActionsForPublishedTimeline(e){const t=this._chartWidget.actions(),i=[];if(i.push(t.lineHide),window.is_authenticated){const t=e.properties().childs().filter,s=new l.Action({actionId:"Chart.ShowAllIdeas",options:{checked:t.value()===PublishedChartsFilter.None,checkable:!0,label:Ne,name:"ToggleAllIdeas",statName:"ToggleAllIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.None,B)}}),n=new l.Action({actionId:"Chart.ShowIdeasOfFollowedUsers",options:{checked:t.value()===PublishedChartsFilter.Following,checkable:!0,label:Oe,name:"ToggleIdeasOfPeopleAndUser",statName:"ToggleIdeasOfPeopleAndUser",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.Following,V)}}),o=new l.Action({actionId:"Chart.ShowMyIdeasOnly",options:{checked:t.value()===PublishedChartsFilter.Private,checkable:!0,label:Fe,name:"ToggleUserIdeas",statName:"ToggleUserIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.Private,R)}});i.push(new l.Separator,s,n,o)}return i}_contextMenuActionsForTradingDrawings(e){return e.contextMenuItems()}async _contextMenuActionsForAlertLabel(e,t){return[]}_contextMenuActionsForChartEvents(e){return[]}_createApplyToEntireLayoutCommand(e){if(!this._chartWidget.chartWidgetCollection().applyIndicatorsToAllChartsAvailable())return null;const t=this._chartWidget.model().model();if(e.parentSources().length>0)return null;const i=(0,s.ensureNotNull)(t.paneForSource(e)),n=t.paneForSource(t.mainSeries())===i,o=e instanceof m.StudyCompare&&e.priceScale()===t.mainSeries().priceScale()&&(0,s.ensureNotNull)(e.priceScale()).isPercentage(),r=n?void 0:t.panes().indexOf(i);let a=He,c=O,h="AddStudyToEntireLayout";return(0,v.isActingAsSymbolSource)(e)&&(a=We,c=N,h="AddSymbolToEntireLayout"),new l.Action({actionId:"Chart.AddIndicatorToAllCharts",options:{label:a,statName:h,onExecute:()=>{const i=(0,s.ensureNotNull)((0,f.clipboardDataForSources)(t.id(),[e])),a=this._chartWidget.chartWidgetCollection(),l={isOnMainPane:n,asCompare:o,
paneIndex:r};a.applyIndicatorToAllCharts(this._chartWidget,i,l,c)}},id:"applyStudyToEntireLayout"})}_createAddIndicatorToFavoritesCommand(e){const t=e.metaInfo();let s;if(!a.enabled("items_favoriting"))return null;{const{description_localized:e,description:n}=t,o=e||r.t(n,{context:"study"},i(83477));s=()=>i.e(9790).then(i.bind(i,23390)).then((({isFavorite:e,toggleFavorite:t})=>({label:e(o)?$e:qe,onExecute:()=>t(o)})))}return new A.ActionWithStandardIcon({actionId:"Chart.Indicator.AddFavorites",id:"addIndicatorToFavorites",optionsLoader:s,options:{statName:"AddIndicatorToFavorites",iconId:"Indicator.AddToFavorites"}})}}},86920:(e,t,i)=>{"use strict";i.d(t,{clipboardDataForSources:()=>l,isLineToolClipboardData:()=>a});var s=i(50151),n=i(19466),o=i(79036),r=i(32755);function a(e){return"drawing"===e.type}function l(e,t){if(1===t.length&&(0,o.isStudy)(t[0])){const e=t[0];return{title:e.title(n.TitleDisplayTarget.StatusLine),sources:[{source:(0,s.ensureNotNull)(e.state()),type:"study"}]}}const i={sources:[],title:""};return i.sources=t.filter((e=>e.copiable()&&(0,r.isLineTool)(e))).map((t=>{const i={type:"drawing",geometry:t.geometry(),source:{...t.state(!1),points:t.normalizedPoints()},modelId:e};return delete i.source.alertId,i})),i.sources.length>0?(1===i.sources.length?i.title=t[0].title(n.TitleDisplayTarget.StatusLine):i.title="Drawings",i):null}},7114:(e,t,i)=>{"use strict";i.d(t,{addExclusionArea:()=>P,addExclusionAreaByScope:()=>C,calcTextHorizontalShift:()=>b,clearRect:()=>p,createBoundCanvas:()=>v,createDisconnectedCanvas:()=>g,createDisconnectedCanvasByRenderingInfo:()=>f,disableSelection:()=>w,drawScaled:()=>m,drawWithExclusionAreaByScope:()=>T,fillRect:()=>_,getBindingRenderingInfo:()=>h,getContext2D:()=>d,getPrescaledContext2D:()=>u,measureText:()=>I,tryApplySuggestedCanvasBitmapSize:()=>S});var s=i(27714),n=i(50151),o=i(776),r=i(2844),a=i(63273),l=i(49483);function c(e){return{horizontalPixelRatio:Math.max(1,e.bitmapSize.width/e.canvasElementClientSize.width),verticalPixelRatio:Math.max(1,e.bitmapSize.height/e.canvasElementClientSize.height)}}function h(e){return{...c(e),bitmapSize:e.bitmapSize,mediaSize:e.canvasElementClientSize}}function d(e){const t=(0,n.ensureNotNull)(e.getContext("2d"));return t.setTransform(1,0,0,1,0,0),t}function u(e){const t=(0,n.ensureNotNull)(e.getContext("2d")),i=(0,o.getCanvasDevicePixelRatio)(e);return t.setTransform(i,0,0,i,0,0),t}function _(e,t,i,s,n,o){e.save(),e.fillStyle=o,e.fillRect(t,i,s,n),e.restore()}function p(e,t,i,s,n,o){e.save(),e.globalCompositeOperation="copy",e.fillStyle=o,e.fillRect(t,i,s,n),e.restore()}function m(e,t,i,s){e.save(),e.scale(t,i),s(),e.restore()}function g(e,t,i){const s=y(e);return void 0===i&&(i=(0,o.getCanvasDevicePixelRatio)(s)),s.width=t.width*i,s.height=t.height*i,s}function f(e,t){const{bitmapSize:i,mediaSize:s}=t,n=y(e);return n.style.width=`${s.width}px`,n.style.height=`${s.height}px`,n.width=i.width,n.height=i.height,n}function y(e){const t=e.createElement("canvas");return w(t),t}function v(e,t){const i=y((0,
n.ensureNotNull)(e.ownerDocument));e.appendChild(i);const o=(0,s.bindCanvasElementBitmapSizeTo)(i,{type:"device-pixel-content-box",transform:(e,t)=>0===e.width||0===e.height?e:{width:Math.max(e.width,t.width),height:Math.max(e.height,t.height)}});return o.resizeCanvasElement(t),o}function S(e){const t=e.suggestedBitmapSize;return null!==t&&t.width>0&&t.height>0&&(e.applySuggestedBitmapSize(),!0)}function b(e,t){return"center"===e.textAlign?0:(0,a.isRtl)()?"start"===e.textAlign||"right"===e.textAlign?t:0:"start"===e.textAlign||"left"===e.textAlign?0:t}function w(e){e.style.userSelect="none",e.style.webkitUserSelect="none",e.style.msUserSelect="none",e.style.MozUserSelect="none",e.style.webkitTapHighlightColor="transparent"}function C(e,t){const{context:i,horizontalPixelRatio:s,verticalPixelRatio:n,bitmapSize:o}=e;i.beginPath(),i.rect(0,0,o.width,o.height);for(let e=0;e{"use strict";i.d(t,{ChartChangesWatcher:()=>a,changedAll:()=>r});var s,n=i(84425),o=i(52033);!function(e){e[e.NothingChanged=0]="NothingChanged",e[e.ContentChanged=1]="ContentChanged",e[e.LineToolsChanged=2]="LineToolsChanged"}(s||(s={}));const r=3;class a{constructor(e,t,i){this._undoHistoryHasChanges=!1,this._changesMask=0,this._recursiveLoopingGuard=!1,this._handleMetainfoChanged=()=>{this._changesMask=1|this._changesMask},this._recalculateHaveChanges=(e,t)=>{if(!this._recursiveLoopingGuard)try{this._recursiveLoopingGuard=!0;const e=this._undoHistoryHasChanges?1:0;let i=this._lineToolsHaveChanges.value()?2:0;const s=this._changesMask;this._changesMask=e|i,s!==this._changesMask&&(this._changesMask&&(this._chartWidgetCollection.getAll().forEach((e=>{e.lineToolsSynchronizer()?.markAsValidatedBecauseOfSavingToContent(!!t)})),i=this._lineToolsHaveChanges.value()?2:0,this._changesMask=e|i),this._onValueChanged.fire(0!==this._changesMask))}finally{this._recursiveLoopingGuard=!1}},this._chartWidgetCollection=e,this._undoHistory=e.undoHistory,this._lineToolsHaveChanges=e.lineToolsSynchronizerHasChanges,this._chartSaver=t,this._globalEvents=i,this._onValueChanged=new o.Delegate,this._hasChangesWV=(0,n.createWVFromGetterAndSubscription)((()=>this.hasChanges()),this.getOnChange()),this._subscribe()}destroy(){this._unsubscribe(),this._onValueChanged.destroy(),this._hasChangesWV.destroy()}changes(){return this._changesMask}hasChanges(){return this._changesMask>0}hasChangesWV(){return this._hasChangesWV}getOnChange(){return this._onValueChanged}_subscribe(){
this._globalEvents.subscribe("chart_loaded",this._handleChartLoaded,this),this._globalEvents.subscribe("layout_loaded",this._handleLayoutLoaded,this),this._globalEvents.subscribe("chart_migrated",this._handleChartMigrated,this),this._undoHistory.undoStack().onChange().subscribe(this,this._handleUndoHistoryChange),this._chartSaver?.chartSaved().subscribe(this,this._handleChartSaved),this._lineToolsHaveChanges.subscribe(this._recalculateHaveChanges);this._chartWidgetCollection.metaInfo.name.subscribe(this._handleMetainfoChanged)}_unsubscribe(){this._globalEvents.unsubscribe("chart_loaded",this._handleChartLoaded,this),this._globalEvents.unsubscribe("layout_loaded",this._handleLayoutLoaded,this),this._globalEvents.unsubscribe("chart_migrated",this._handleChartMigrated,this),this._undoHistory.undoStack().onChange().unsubscribe(this,this._handleUndoHistoryChange),this._chartSaver?.chartSaved().unsubscribe(this,this._handleChartSaved),this._lineToolsHaveChanges.unsubscribe(this._recalculateHaveChanges);this._chartWidgetCollection.metaInfo.name.unsubscribe(this._handleMetainfoChanged)}_setUndoHistoryHasChanges(e,t){this._undoHistoryHasChanges=e,this._recalculateHaveChanges(e,t)}_handleChartLoaded(){this._setUndoHistoryHasChanges(!1)}_handleLayoutLoaded(){this._setUndoHistoryHasChanges(!1,!0)}_handleUndoHistoryChange(e){e?.affectsState()&&this._setUndoHistoryHasChanges(!0)}_handleChartMigrated(){this._setUndoHistoryHasChanges(!0)}_handleChartSaved(e){e&&this._setUndoHistoryHasChanges(!1,!0)}}},43550:(e,t,i)=>{"use strict";i.d(t,{ChartHotkeysListener:()=>g,globalEnvironmentState:()=>m,modifierPressed:()=>p,shiftPressed:()=>_});var s=i(4741),n=i(68335),o=i(35749),r=i(32755);var a=i(64147),l=i(28331);const c=new a.WatchedValue(Boolean((s.pressedKeys.value()??0)&n.Modifiers.Shift)),h=new a.WatchedValue(Boolean((s.pressedKeys.value()??0)&n.Modifiers.Mod)),d=new a.WatchedValue(Boolean((s.pressedKeys.value()??0)&n.Modifiers.Alt)),u=[n.Modifiers.None,n.Modifiers.Alt,n.Modifiers.Mod,n.Modifiers.Alt+n.Modifiers.Shift];function _(){return c}function p(){return h}function m(){return new l.EnvironmentState({altKey:d.value(),ctrlKey:p().value(),metaKey:p().value(),shiftKey:_().value()})}s.pressedKeys.subscribe(((e=0)=>{c.setValue(Boolean(e&n.Modifiers.Shift)),h.setValue(Boolean(e&n.Modifiers.Mod)),d.setValue(Boolean(e&n.Modifiers.Alt))}));class g{constructor(e,t){this._pressedKeyCode=null,this._boundKeydownHandler=null,this._boundKeyupHandler=null,this._chartWidget=e,this._parent=t,this._boundKeydownHandler=this._keydownHandler.bind(this),this._boundKeyupHandler=this._keyupHandler.bind(this),this._parent.ownerDocument.addEventListener("keydown",this._boundKeydownHandler),this._parent.ownerDocument.addEventListener("keyup",this._boundKeyupHandler)}destroy(){null!==this._boundKeydownHandler&&(this._parent.ownerDocument.removeEventListener("keydown",this._boundKeydownHandler),this._boundKeydownHandler=null),null!==this._boundKeyupHandler&&(this._parent.ownerDocument.removeEventListener("keyup",this._boundKeyupHandler),
this._boundKeyupHandler=null)}_keydownHandler(e){this._chartWidget.hasModel()&&this._chartWidget.isActive().value()&&(e.defaultPrevented||("text-editor"===window.document.activeElement?.getAttribute("data-name")&&this._handleTabKeyDown(e)||window.document.activeElement===window.document.body&&(this._handleMoveDrawingsKeyDown(e)||this._handleScrollKeyDown(e)||this._handleZoomKeyDown(e)))&&e.preventDefault())}_keyupHandler(e){this._chartWidget.hasModel()&&this._handleScrollKeyUp(e)}_handleTabKeyDown(e){const t=255&(0,n.hashFromEvent)(e),i=this._chartWidget.model();if(9===t){const t=i.selection().dataSources()[0];if(void 0!==t&&(s=t,(0,r.isLineTool)(s)&&"LineToolTable"===s.state().type)){const i=(0,n.modifiersFromEvent)(e);return t.switchActiveCell(i===n.Modifiers.Shift)}return!1}var s;return!1}_handleMoveDrawingsKeyDown(e){const t=255&(0,n.hashFromEvent)(e),i=this._chartWidget.model();switch(t){case 37:return i.moveSelectedToolsLeft();case 39:return i.moveSelectedToolsRight();case 38:return i.moveSelectedToolsUp();case 40:return i.moveSelectedToolsDown()}return!1}_handleScrollKeyDown(e){if(null!==this._pressedKeyCode)return!1;const t=(0,n.hashFromEvent)(e),i=255&t,s=(0,n.modifiersFromEvent)(e);let r;if(37===i)r=1;else{if(39!==i)return!1;r=-1}return!(n.isMacKeyboard&&s===n.Modifiers.Mod||!u.includes(s))&&(!(0,o.isNativeUIInteraction)(t,e.target)&&(this._pressedKeyCode=i,s===n.Modifiers.None?this._chartWidget.scrollHelper().moveByBar(r):s===n.Modifiers.Alt||s===n.Modifiers.Mod?this._chartWidget.scrollHelper().move(r):-1===r?this._chartWidget.model().timeScale().scrollToRealtime(!0):this._chartWidget.model().timeScale().scrollToFirstBar(),!0))}_handleScrollKeyUp(e){if(null===this._pressedKeyCode)return!1;const t=(0,n.hashFromEvent)(e);if((0,o.isNativeUIInteraction)(t,e.target))return!1;return(255&t)===this._pressedKeyCode&&(this._pressedKeyCode=null,this._chartWidget.scrollHelper().stopMove(),!0)}_handleZoomKeyDown(e){const t=(0,n.hashFromEvent)(e),i=255&t;if((0,n.modifiersFromEvent)(e)!==n.Modifiers.Mod||(0,o.isNativeUIInteraction)(t,e.target))return!1;const s=this._chartWidget.model();if(38===i)s.zoomIn();else{if(40!==i)return!1;s.zoomOut()}return!0}}},17730:(e,t,i)=>{"use strict";i.d(t,{getChartWidgetApiTimeConverter:()=>r});var s=i(50151),n=i(53388);const o=i(56570).enabled("end_of_period_timescale_marks");function r(e,t,i){return new l(function(e,t){const i=function(e,t){return e+t.session+t.timezone+(t.corrections||"")+(t.session_holidays||"")}(e,t);let s=a.get(i);void 0===s&&(s=(0,n.createDwmAligner)(e,t),a.set(i,s));return s}(e,t),i)}const a=new Map;class l{constructor(e,t){this._dwmAligner=e,this._chartModel=t}convertPublicTimeToInternalTime(e){return null!==this._dwmAligner?this._dwmAligner.timeToSessionStart(1e3*e)/1e3:e}convertInternalTimeToPublicTime(e){return null!==this._dwmAligner?this._dwmAligner.timeToExchangeTradingDay(1e3*e)/1e3:e}convertTimePointIndexToPublicTime(e){const t=this._chartModel.timeScale();if(t.isEmpty())return null;let i=o?function(e,t){const i=e.indexToUserTime(t)
;if(null===i)return null;return i.getTime()/1e3}(t,e):this.convertTimePointIndexToInternalTime(e);return null!==i&&(i=this.convertInternalTimeToPublicTime(i)),i}convertTimePointIndexToInternalTime(e){const t=this._chartModel.timeScale();if(t.isEmpty())return null;const i=t.points(),{firstIndex:n,lastIndex:o}=(0,s.ensureNotNull)(i.range().value());let r=null;if(n<=e&&e<=o)r=i.valueAt(e);else if(e>o){const i=this._chartModel.mainSeries().syncModel();if(null!==i){const n=(0,s.ensureNotNull)(t.indexToTimePoint(o));r=i.projectTime(n,e-o)}}return r}}},15938:(e,t,i)=>{"use strict";i.d(t,{CHART_FONT_FAMILY:()=>o,setChartFontFamily:()=>n});const s="'Trebuchet MS', Roboto, Ubuntu, sans-serif";function n(e){o=e}let o=`-apple-system, BlinkMacSystemFont, ${s}`},40443:(e,t,i)=>{"use strict";i.d(t,{ContextMenuManager:()=>s});var s,n=i(29981),o=i(29023),r=i(59064);!function(e){let t=null,s=null;const a=[],l={createAction:e=>new o.Action({actionId:"Chart.CustomActionId",options:e}),createAsyncAction:e=>new o.Action({actionId:"Chart.CustomActionId",options:{},optionsLoader:e}),createSeparator:()=>new o.Separator};async function c(e,o={},r={menuName:""},c){null!==t&&(e=await t(e,l,r));let d=null;const u=()=>{const e=(0,n.indexOf)(a,(e=>e.renderer===d));-1!==e&&a.splice(e,1),void 0!==c&&c()};let _=!1;if(null!==s&&(d=await s(e,r,u)),d)_=!0,h();else{const t=await Promise.all([i.e(4109),i.e(3953),i.e(5826),i.e(5323),i.e(2736),i.e(4066),i.e(6489),i.e(7001),i.e(6262),i.e(2227),i.e(2544),i.e(2157),i.e(1584)]).then(i.bind(i,11785));d=new t.ContextMenuRenderer(e,o,u,h)}return a.push({renderer:d,isExternal:_}),d}function h(){(0,r.globalCloseMenu)(),a.forEach((e=>{e.isExternal&&e.renderer.isShown()&&e.renderer.hide()}))}e.createMenu=c,e.showMenu=function(e,t,i={},s,n){return c(e,i,s,n).then((e=>e.show(t)))},e.setCustomRendererFactory=function(e){s=e},e.setCustomItemsProcessor=function(e){t=e},e.hideAll=h,e.getShown=function(){for(let e=0;e{"use strict";i.d(t,{doNotShowDeleteLockedLineConfirmProperty:()=>a,doNotShowDeleteLockedLineKey:()=>o});var s=i(56840),n=i(17625);const o="do_not_show_delete_locked_line_confirm";function r(){return s.getBool(o,!1)}const a=(0,n.createPrimitiveProperty)(r());a.subscribe(null,(()=>s.setValue(o,a.value()))),s.onSync.subscribe(null,(()=>a.setValue(r())))},29280:(e,t,i)=>{"use strict";i.d(t,{DialogRenderer:()=>n});var s=i(64147);class n{constructor(){this._container=document.createElement("div"),this._visibility=new s.WatchedValue(!1),this._rootInstance=null}visible(){return this._visibility.readonly()}_setVisibility(e){this._visibility.setValue(e)}}},26023:(e,t,i)=>{"use strict";var s;i.d(t,{TabNames:()=>s}),function(e){e.background="Background",e.coordinates="Coordinates",e.drawings="Drawings",e.events="Events",e.alerts="Alerts",e.inputs="Inputs",e.properties="Properties",e.scales="Scales",e.legend="Legend",e.sourceCode="Source Code",e.style="Style",e.symbol="Symbol",e.timezoneSessions="Timezone/Sessions",
e.trading="Trading",e.visibility="Visibility",e.text="Text"}(s||(s={}))},9726:(e,t,i)=>{"use strict";i.d(t,{createFavoriteDrawingToolbar:()=>a,getFavoriteDrawingToolbarPromise:()=>r});var s=i(72894);let n=null,o=null;function r(){return o}function a(){null===o&&(o=Promise.all([i.e(7827),i.e(3703),i.e(3953),i.e(4178),i.e(5826),i.e(9481),i.e(4600),i.e(6445),i.e(7384),i.e(5323),i.e(2736),i.e(4066),i.e(6489),i.e(4353),i.e(2440),i.e(9255),i.e(7001),i.e(3745),i.e(6262),i.e(6842),i.e(5099),i.e(2227),i.e(2544),i.e(1890),i.e(2157),i.e(7843),i.e(2306)]).then(i.bind(i,17815)).then((({FavoriteDrawingToolbar:e})=>(n=null!==n?n:new e({left:window.innerWidth/2,top:s.HEADER_TOOLBAR_HEIGHT_EXPANDED+61}),n))))}},776:(e,t,i)=>{"use strict";function s(e){return Math.max(1,e.ownerDocument?.defaultView?.devicePixelRatio||1)}i.d(t,{getCanvasDevicePixelRatio:()=>s})},96152:(e,t,i)=>{"use strict";i.d(t,{getPriceAxisNameInfo:()=>r});const s=["Z","Y","X","W","V","U","T","S"],n=["A","B","C","D","E","F","G","H"];class o{constructor(e){this.label=e}equals(e){return null!==e&&this.label===e.label}}function r(e,t){const i="left"===e?s:n,r=t{"use strict";i.d(t,{getTranslatedInputTitle:()=>o});var s=i(11542);const n={PercentageLTP:"Percentage LTP"};function o(e){return s.t(n[e]??e,{context:"input"},i(32856))}},77788:(e,t,i)=>{"use strict";i.d(t,{CHART_WIDGET_COLLECTION_SERVICE:()=>n,chartWidgetCollectionService:()=>o});var s=i(16216);const n={id:"ChartWidgetCollectionService"};function o(){return(0,s.hasService)(n)?(0,s.service)(n):null}var r;!function(e){e.Multichart="multichart",e.ForceFullscreen="force-fullscreen"}(r||(r={}))},62288:(e,t,i)=>{"use strict";i.d(t,{InvalidationLevel:()=>s,InvalidationMask:()=>l,defaultInvalidationLevel:()=>r});var s,n=i(50151);class o{constructor(e=r){this._paneInvalidationLevel=r,this._leftPriceScalesInvalidationMap=new Map,this._rightPriceScalesInvalidationMap=new Map,this._legendWidgetInvalidated=!1,this._priceScalesPriceRangeAnimationsInvalidationMap=new Map,this._invalidationLevel=e}fullInvalidation(){return this._invalidationLevel}invalidateAll(e){this._invalidationLevel=Math.max(this._invalidationLevel,e)}invalidatePane(e){this._paneInvalidationLevel=Math.max(this._invalidationLevel,e)}invalidateLegendWidgetLayout(){this._legendWidgetInvalidated=!0}invalidatePriceScale(e,t,i){const s="left"===e?this._leftPriceScalesInvalidationMap:this._rightPriceScalesInvalidationMap,n=s.get(t)||r;s.set(t,Math.max(n,i))}setPriceScaleRangeAnimation(e,t){this._priceScalesPriceRangeAnimationsInvalidationMap.set(e,t)}priceScaleRangeAnimations(){return this._priceScalesPriceRangeAnimationsInvalidationMap}invalidationLevelForPane(){return Math.max(this._paneInvalidationLevel,this._invalidationLevel)}legendWidgetLayoutInvalidated(){return this._legendWidgetInvalidated||this._invalidationLevel===s.Full}getterForPriceScaleInvalidationLevelBySide(e){const t="left"===e?this._leftPriceScalesInvalidationMap:this._rightPriceScalesInvalidationMap
;return e=>Math.max(t.get(e)||r,this._invalidationLevel)}priceScaleSideMaxLevel(e){const t="left"===e?this._leftPriceScalesInvalidationMap:this._rightPriceScalesInvalidationMap;let i=this._invalidationLevel;return t.size>0&&t.forEach((e=>{e>i&&(i=e)})),i}merge(e){this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel),this._paneInvalidationLevel=Math.max(this._paneInvalidationLevel,e._paneInvalidationLevel),e._leftPriceScalesInvalidationMap.forEach(((e,t)=>{const i=this._leftPriceScalesInvalidationMap.get(t)||r;this._leftPriceScalesInvalidationMap.set(t,Math.max(i,e))})),e._rightPriceScalesInvalidationMap.forEach(((e,t)=>{const i=this._rightPriceScalesInvalidationMap.get(t)||r;this._rightPriceScalesInvalidationMap.set(t,Math.max(i,e))})),this._legendWidgetInvalidated=this._legendWidgetInvalidated||e._legendWidgetInvalidated,e._priceScalesPriceRangeAnimationsInvalidationMap.forEach(((e,t)=>{this._priceScalesPriceRangeAnimationsInvalidationMap.set(t,e)}))}}!function(e){e[e.None=0]="None",e[e.Cursor=1]="Cursor",e[e.Light=2]="Light",e[e.Full=3]="Full"}(s||(s={}));const r=s.None;var a;!function(e){e[e.ScrollAnimation=0]="ScrollAnimation",e[e.StopAnimation=1]="StopAnimation"}(a||(a={}));class l{constructor(e=r){this._panesOrderChanged=!1,this._keepVisibleTimeRangeOnResize=!1,this._timeAxisInvalidationLevel=r,this._invalidatedPanes=new Map,this._additionalActions=[],this._timeScaleInvalidations=[],this._invalidationLevel=e}invalidateAll(e){this._invalidationLevel!==e&&(this._invalidationLevel=Math.max(this._invalidationLevel,e),this._invalidatedPanes.forEach((e=>{e.invalidateAll(this._invalidationLevel)})))}invalidateAllPane(e,t){this._invalidatedPanes.has(e)||this._invalidatedPanes.set(e,new o(this._invalidationLevel)),(0,n.ensureDefined)(this._invalidatedPanes.get(e)).invalidateAll(t)}invalidatePriceScale(e,t,i,s){this._invalidatedPanes.has(e)||this._invalidatedPanes.set(e,new o(this._invalidationLevel)),(0,n.ensureDefined)(this._invalidatedPanes.get(e)).invalidatePriceScale(t,i,s)}setPriceScaleRangeAnimation(e,t,i){this._invalidationLevel=Math.max(this._invalidationLevel,s.Light),this._invalidatedPanes.has(e)||this._invalidatedPanes.set(e,new o(this._invalidationLevel)),(0,n.ensureDefined)(this._invalidatedPanes.get(e)).setPriceScaleRangeAnimation(t,i)}invalidateTimeScale(e){this._timeAxisInvalidationLevel=Math.max(this._timeAxisInvalidationLevel,e)}invalidatePanesOrder(){this._panesOrderChanged=!0}lockVisibleTimeRangeOnResize(){this._keepVisibleTimeRangeOnResize=!0}fullInvalidation(){return this._invalidationLevel}maxPaneInvalidation(){const e=[];return this._invalidatedPanes.forEach((t=>{e.push(t.fullInvalidation())})),Math.max(...e,this._invalidationLevel)}invalidateForPane(e){return this._invalidatedPanes.get(e)||new o(this._invalidationLevel)}invalidateForTimeScale(){return Math.max(this._timeAxisInvalidationLevel,this._invalidationLevel)}validationActions(){return this._additionalActions}addValidationAction(e){this._additionalActions.push(e)}merge(e){
this._invalidationLevel=Math.max(this._invalidationLevel,e._invalidationLevel),this._panesOrderChanged=this._panesOrderChanged||e._panesOrderChanged,this._keepVisibleTimeRangeOnResize=this._keepVisibleTimeRangeOnResize||e._keepVisibleTimeRangeOnResize,this._invalidatedPanes.forEach((e=>{e.invalidateAll(this._invalidationLevel)})),e._invalidatedPanes.forEach(((e,t)=>{this._invalidatedPanes.has(t)||this._invalidatedPanes.set(t,new o(this._invalidationLevel)),(0,n.ensureDefined)(this._invalidatedPanes.get(t)).merge(e)})),this._timeAxisInvalidationLevel=Math.max(this._timeAxisInvalidationLevel,e._timeAxisInvalidationLevel);for(let t=0;t0===e.type));if(-1!==e){const[t]=this._timeScaleInvalidations.splice(e,1);t.value.onFinish?.(!1)}}}},69186:(e,t,i)=>{"use strict";i.d(t,{lastMouseOrTouchEventInfo:()=>n,setLastMouseOrTouchEventInfo:()=>o});let s=(0,i(49483).supportTouch)()?{isTouch:!0,stylus:!1}:{isTouch:!1};function n(){return s}function o(e){s=e.isTouch?{isTouch:!0,stylus:e.stylus}:{isTouch:!1}}},65952:(e,t,i)=>{"use strict";i.d(t,{layoutInitialSizingState:()=>o});var s=i(69708);i(50151);function n(e){return e.map((t=>{if((0,s.default)(t))return{percent:1/e.length};{const i=t.slice(1);return{percent:1/e.length,substate:n(i)}}}))}function o(e){return n(e.slice(1))}},68993:(e,t,i)=>{"use strict";i.d(t,{isMultipleLayout:()=>r,isSupportedLayout:()=>a,layouts:()=>n,tryGuessingTheMostSuitableLayout:()=>l});i(87489),i(65952);let s;s={};const n={...{s:{title:"1 chart",count:1,layoutType:"s",sizer:(e,t)=>{if(0!==t)throw new RangeError("invalid index");return e},splitters:()=>[],resizeApplier:(e,t,i,s,n)=>n,syncSublayoutsBySplitter:(e,t)=>t,expression:["h",0]}},...s};function o(e){return"s"===e
}function r(e){return!o(e)}function a(e){return o(e)||s.hasOwnProperty(e)}function l(e){return"s"}},17402:(e,t,i)=>{"use strict";i.d(t,{lineToolsSelectHotkeys:()=>n});i(21251);var s=i(68335);const n={LineToolFibRetracement:{hash:s.Modifiers.Alt+70,action:"setTool",description:"Draw Fib Retracement"},LineToolHorzLine:{hash:s.Modifiers.Alt+72,action:"drawRightThere",description:"Draw Horizontal Line here"},LineToolHorzRay:{hash:s.Modifiers.Alt+74,action:"drawRightThere",description:"Draw Horizontal Ray here"},LineToolRectangle:{hash:s.Modifiers.Alt+s.Modifiers.Shift+82,action:"setTool",description:"Draw Rectangle"},LineToolTrendLine:{hash:s.Modifiers.Alt+84,action:"setTool",description:"Draw Trend Line"},LineToolVertLine:{hash:s.Modifiers.Alt+86,action:"drawRightThere",description:"Draw Vertical Line here"},LineToolCrossLine:{hash:s.Modifiers.Alt+67,action:"drawRightThere",description:"Draw Cross Line here"}}},35236:(e,t,i)=>{"use strict";i.d(t,{MouseEventHandler:()=>f,defaultPreventedHandler:()=>m,getClickPosition:()=>_,isTouchMouseEvent:()=>p});var s=i(81251),n=i(50151),o=i(49483),r=i(37265),a=i(80007),l=i(69186);const c=o.isSafari?"click":"auxclick";var h,d;!function(e){e[e.ResetClick=500]="ResetClick",e[e.LongTap=240]="LongTap",e[e.PreventFiresTouchEvents=500]="PreventFiresTouchEvents"}(h||(h={})),function(e){e[e.CancelClickManhattanDistance=5]="CancelClickManhattanDistance",e[e.CancelTapManhattanDistance=5]="CancelTapManhattanDistance",e[e.DoubleClickManhattanDistance=5]="DoubleClickManhattanDistance",e[e.DoubleTapManhattanDistance=30]="DoubleTapManhattanDistance"}(d||(d={}));const u={treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!1,ignoreClickAndTapOnDblClickOrDblTap:!1};function _(e){if(p(e))return{x:e.clientX,y:e.clientY};if("touches"in(t=e)&&void 0!==t.touches){if(1===e.touches.length){const t=(0,n.ensureNotNull)(e.target).getBoundingClientRect(),i=e.touches[0];return{x:i.clientX-t.left,y:i.clientY-t.top}}return null}var t;return{x:e.offsetX,y:e.offsetY}}function p(e){return"isTouch"in e&&"stylus"in e}function m(e){return t=>{t.preventDefault(),e(t)}}function g(e,t){let i=!1;return{clickOrTap:(...s)=>{t?.()?e.clickOrTap(...s):(i=!1,setTimeout((()=>!i&&e.clickOrTap(...s)),501))},doubleClickOrDoubleTap:(...t)=>{i=!0,e.doubleClickOrDoubleTap?.(...t)}}}class f{constructor(e,t,i){if(this._clickCount=0,this._clickTimeoutId=null,this._clickPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._tapCount=0,this._tapTimeoutId=null,this._tapPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartPosition=null,this._touchMoveStartPosition=null,this._touchMoveExceededManhattanDistance=!1,this._cancelClick=!1,this._cancelTap=!1,this._unsubscribeOutsideMouseEvents=null,this._unsubscribeOutsideTouchEvents=null,this._unsubscribeMobileSafariEvents=null,this._unsubscribeMousemove=null,this._unsubscribeRootMouseEvents=null,this._unsubscribeRootTouchEvents=null,this._pinchInfo=null,this._pinchPrevented=!1,
this._preventTouchDragProcess=!1,this._mousePressed=!1,this._lastTouchEventTimeStamp=0,this._activeTouchId=null,this._acceptMouseLeave=!o.CheckMobile.iOS(),this._onFirefoxOutsideMouseUp=e=>{this._mouseUpHandler(e)},this._onMobileSafariDoubleClick=e=>{if(this._firesTouchEvents(e)){const t=this._makeCompatEvent(e);if(++this._tapCount,this._tapTimeoutId&&this._tapCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(v(e),this._tapPosition);i<30&&!this._cancelTap&&this._processTouchEvent(t,this._handlers.doubleTapEvent),this._resetTapTimeout()}}else{const t=this._makeCompatEvent(e);if(++this._clickCount,this._clickTimeoutId&&this._clickCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(v(e),this._clickPosition);i<5&&!this._cancelClick&&this._processMouseEvent(t,this._handlers.mouseDoubleClickEvent),this._resetClickTimeout()}}},this._target=e,this._options=(0,r.merge)((0,r.clone)(u),i||{}),this._options.ignoreClickAndTapOnDblClickOrDblTap){if(t.mouseClickEvent&&t.mouseDoubleClickEvent){const e=g({clickOrTap:t.mouseClickEvent.bind(t),doubleClickOrDoubleTap:t.mouseDoubleClickEvent.bind(t)});t.mouseClickEvent=e.clickOrTap,t.mouseDoubleClickEvent=e.doubleClickOrDoubleTap}if(t.tapEvent&&t.doubleTapEvent){const e=g({clickOrTap:t.tapEvent.bind(t),doubleClickOrDoubleTap:t.doubleTapEvent.bind(t)});t.tapEvent=e.clickOrTap,t.doubleTapEvent=e.doubleClickOrDoubleTap}}this._handlers=t,this._init()}destroy(){null!==this._unsubscribeOutsideMouseEvents&&(this._unsubscribeOutsideMouseEvents(),this._unsubscribeOutsideMouseEvents=null),null!==this._unsubscribeOutsideTouchEvents&&(this._unsubscribeOutsideTouchEvents(),this._unsubscribeOutsideTouchEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null),null!==this._unsubscribeMobileSafariEvents&&(this._unsubscribeMobileSafariEvents(),this._unsubscribeMobileSafariEvents=null),this._clearLongTapTimeout(),this._resetClickTimeout()}_mouseEnterHandler(e){this._unsubscribeMousemove&&this._unsubscribeMousemove();const t=this._mouseMoveHandler.bind(this);if(this._unsubscribeMousemove=()=>{this._target.removeEventListener("mousemove",t)},this._target.addEventListener("mousemove",t),this._firesTouchEvents(e))return;const i=this._makeCompatEvent(e);this._processMouseEvent(i,this._handlers.mouseEnterEvent),this._acceptMouseLeave=!0}_resetClickTimeout(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null,this._clickPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}}_resetTapTimeout(){null!==this._tapTimeoutId&&clearTimeout(this._tapTimeoutId),this._tapCount=0,this._tapTimeoutId=null,this._tapPosition={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}}_mouseMoveHandler(e){
if(this._mousePressed||null!==this._touchMoveStartPosition)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.mouseMoveEvent),this._acceptMouseLeave=!0}_touchMoveHandler(e){const t=w(e.changedTouches,(0,n.ensureNotNull)(this._activeTouchId));if(null===t)return;if(this._lastTouchEventTimeStamp=b(e),null!==this._pinchInfo)return;if(this._preventTouchDragProcess)return;this._pinchPrevented=!0;const i=this._touchMouseMoveWithDownInfo(v(t),(0,n.ensureNotNull)(this._touchMoveStartPosition)),{xOffset:s,yOffset:o,manhattanDistance:r}=i;if(this._touchMoveExceededManhattanDistance||!(r<5)){if(!this._touchMoveExceededManhattanDistance){const e=.5*s,t=o>=e&&!this._options.treatVertTouchDragAsPageScroll,i=e>o&&!this._options.treatHorzTouchDragAsPageScroll;t||i||(this._preventTouchDragProcess=!0),this._touchMoveExceededManhattanDistance=!0,this._cancelTap=!0,this._clearLongTapTimeout(),this._resetTapTimeout()}if(!this._preventTouchDragProcess){const i=this._makeCompatEvent(e,t);this._processTouchEvent(i,this._handlers.touchMoveEvent),(0,a.preventDefault)(e)}}}_mouseMoveWithDownHandler(e){if(0!==e.button)return;const t=this._touchMouseMoveWithDownInfo(v(e),(0,n.ensureNotNull)(this._mouseMoveStartPosition)),{manhattanDistance:i}=t;if(i>=5&&(this._cancelClick=!0,this._resetClickTimeout()),this._cancelClick){const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.pressedMouseMoveEvent)}}_touchMouseMoveWithDownInfo(e,t){const i=Math.abs(t.x-e.x),s=Math.abs(t.y-e.y);return{xOffset:i,yOffset:s,manhattanDistance:i+s}}_touchEndHandler(e){let t=w(e.changedTouches,(0,n.ensureNotNull)(this._activeTouchId));if(null===t&&0===e.touches.length&&(t=e.changedTouches[0]),null===t)return;this._activeTouchId=null,this._lastTouchEventTimeStamp=b(e),this._clearLongTapTimeout(),this._touchMoveStartPosition=null,this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);const i=this._makeCompatEvent(e,t);if(this._processTouchEvent(i,this._handlers.touchEndEvent),++this._tapCount,this._tapTimeoutId&&this._tapCount>1){const{manhattanDistance:e}=this._touchMouseMoveWithDownInfo(v(t),this._tapPosition);e<30&&!this._cancelTap&&this._processTouchEvent(i,this._handlers.doubleTapEvent),this._resetTapTimeout()}else this._cancelTap||(this._processTouchEvent(i,this._handlers.tapEvent),this._handlers.tapEvent&&(0,a.preventDefault)(e));0===this._tapCount&&(0,a.preventDefault)(e),0===e.touches.length&&this._longTapActive&&(this._longTapActive=!1,(0,a.preventDefault)(e))}_touchCancelHandler(e){this._touchEndHandler(e)}_mouseUpHandler(e){if(0!==e.button)return;const t=this._makeCompatEvent(e);if(this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),o.isFF){this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp)}
if(!this._firesTouchEvents(e))if(this._processMouseEvent(t,this._handlers.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1){const{manhattanDistance:i}=this._touchMouseMoveWithDownInfo(v(e),this._clickPosition);i<5&&!this._cancelClick&&this._processMouseEvent(t,this._handlers.mouseDoubleClickEvent),this._resetClickTimeout()}else this._cancelClick||this._processMouseEvent(t,this._handlers.mouseClickEvent)}_clearLongTapTimeout(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)}_touchStartHandler(e){if(null!==this._activeTouchId)return this._clearLongTapTimeout(),void this._resetTapTimeout();const t=e.changedTouches[0];this._activeTouchId=t.identifier,this._lastTouchEventTimeStamp=b(e);const i=this._target.ownerDocument.documentElement;this._cancelTap=!1,this._touchMoveExceededManhattanDistance=!1,this._preventTouchDragProcess=!1,this._touchMoveStartPosition=v(t),this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);{const t=this._touchMoveHandler.bind(this),s=this._touchEndHandler.bind(this);this._unsubscribeRootTouchEvents=()=>{i.removeEventListener("touchmove",t),i.removeEventListener("touchend",s)},i.addEventListener("touchmove",t,{passive:!1}),i.addEventListener("touchend",s,{passive:!1}),this._clearLongTapTimeout(),this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,e),240)}const s=this._makeCompatEvent(e,t);this._processTouchEvent(s,this._handlers.touchStartEvent),this._tapTimeoutId||(this._tapCount=0,this._tapTimeoutId=setTimeout(this._resetTapTimeout.bind(this),500),this._tapPosition=v(t))}_wheelClickHandler(e){if(1!==e.button)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.wheelClickEvent)}_mouseDownHandler(e){if(0!==e.button)return;const t=this._target.ownerDocument.documentElement;o.isFF&&t.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp),this._cancelClick=!1,this._mouseMoveStartPosition=v(e),this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null);{const e=this._mouseMoveWithDownHandler.bind(this),i=this._mouseUpHandler.bind(this);this._unsubscribeRootMouseEvents=()=>{t.removeEventListener("mousemove",e),t.removeEventListener("mouseup",i)},t.addEventListener("mousemove",e),t.addEventListener("mouseup",i)}if(this._mousePressed=!0,this._firesTouchEvents(e))return;const i=this._makeCompatEvent(e);this._processMouseEvent(i,this._handlers.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickPosition=v(e))}_init(){this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._touchCancelHandler.bind(this));{const e=this._target.ownerDocument,t=e=>!e.target||!this._target.contains(e.target),i=e=>{if(!t(e))return;const i=e.changedTouches[0];this._lastTouchEventTimeStamp=b(e),
this._processTouchEvent(this._makeCompatEvent(e,i),this._handlers.touchStartOutsideEvent)},s=e=>{t(e)&&!this._firesTouchEvents(e)&&this._processMouseEvent(this._makeCompatEvent(e),this._handlers.mouseDownOutsideEvent)};this._unsubscribeOutsideTouchEvents=()=>{e.removeEventListener("touchstart",i)},this._unsubscribeOutsideMouseEvents=()=>{e.removeEventListener("mousedown",s)},e.addEventListener("mousedown",s),e.addEventListener("touchstart",i,{passive:!0})}o.CheckMobile.iOS()&&(this._unsubscribeMobileSafariEvents=()=>{this._target.removeEventListener("dblclick",this._onMobileSafariDoubleClick)},this._target.addEventListener("dblclick",this._onMobileSafariDoubleClick)),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("contextmenu",this._contextMenuHandler.bind(this)),this._target.addEventListener("touchstart",this._touchStartHandler.bind(this),{passive:!0}),(0,a.preventScrollByWheelClick)(this._target),this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._target.addEventListener(c,this._wheelClickHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",(()=>{}),{passive:!1})}_initPinch(){void 0===this._handlers.pinchStartEvent&&void 0===this._handlers.pinchEvent&&void 0===this._handlers.pinchEndEvent||(this._target.addEventListener("touchstart",(e=>this._checkPinchState(e.touches)),{passive:!0}),this._target.addEventListener("touchmove",(e=>{if(null===this._pinchInfo)return;const t=w(e.touches,(0,n.ensureNotNull)(this._activeTouchId)),i=w(e.touches,this._pinchInfo.secondTouchId);if(t&&i&&void 0!==this._handlers.pinchEvent){const{startPinchDistance:s,startPinchMiddlePoint:n}=this._pinchInfo,o=S(t,i)/s,r=y(this._target);this._handlers.pinchEvent(n,{x:t.clientX-r.left,y:t.clientY-r.top},{x:i.clientX-r.left,y:i.clientY-r.top},o),(0,a.preventDefault)(e)}}),{passive:!1}),this._target.addEventListener("touchend",(e=>{this._checkPinchState(e.touches)})))}_checkPinchState(e){1===e.length&&(this._pinchPrevented=!1),2!==e.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(e)}_startPinch(e){if(void 0!==this._handlers.pinchStartEvent&&null===this._pinchInfo){const t=y(this._target);let i,s;e[0].identifier===this._activeTouchId?(i=e[0],s=e[1]):(i=e[1],s=e[0]);const n={x:i.clientX-t.left,y:i.clientY-t.top},o={x:s.clientX-t.left,y:s.clientY-t.top},r={x:(n.x+o.x)/2,y:(n.y+o.y)/2};this._handlers.pinchStartEvent(r,n,o,{bothPointsOnTargetElement:this._target.contains(s.target)})&&(this._pinchInfo={startPinchDistance:S(i,s),startPinchMiddlePoint:r,secondTouchId:s.identifier})}this._clearLongTapTimeout()}_stopPinch(){null!==this._pinchInfo&&(this._pinchInfo=null,this._handlers.pinchEndEvent?.())}_mouseLeaveHandler(e){if(this._unsubscribeMousemove&&this._unsubscribeMousemove(),this._firesTouchEvents(e))return;if(!this._acceptMouseLeave)return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.mouseLeaveEvent),this._acceptMouseLeave=!o.CheckMobile.iOS()}_longTapHandler(e){
const t=w(e.touches,(0,n.ensureNotNull)(this._activeTouchId));if(null===t)return;const i=this._makeCompatEvent(e,t);this._processTouchEvent(i,this._handlers.longTapEvent),this._processTouchEvent(i,this._handlers.touchContextMenuEvent),this._cancelTap=!0,this._longTapActive=!0}_contextMenuHandler(e){if((0,a.preventDefault)(e),null!==this._touchMoveStartPosition)return;if(this._firesTouchEvents(e))return;const t=this._makeCompatEvent(e);this._processMouseEvent(t,this._handlers.contextMenuEvent),this._cancelClick=!0}_firesTouchEvents(e){return e.sourceCapabilities&&void 0!==e.sourceCapabilities.firesTouchEvents?e.sourceCapabilities.firesTouchEvents:b(e)this._target.getBoundingClientRect()||{left:0,top:0}));return{clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,screenX:i.screenX,screenY:i.screenY,get localX(){return i.clientX-n().left},get localY(){return i.clientY-n().top},ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,isTouch:!e.type.startsWith("mouse")&&"contextmenu"!==e.type&&"click"!==e.type,stylus:"stylus"===t?.touchType,srcType:e.type,target:i.target,view:e.view,preventDefault:()=>{"touchstart"!==e.type&&(0,a.preventDefault)(e)}}}}function y(e){return e.getBoundingClientRect()||{left:0,top:0}}function v(e){return{x:e.pageX,y:e.pageY}}function S(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return Math.sqrt(i*i+s*s)}function b(e){return e.timeStamp||performance.now()}function w(e,t){for(let i=0;i{"use strict";i.d(t,{actualBehavior:()=>a,availableValues:()=>r,navigationButtonsVisibilityKey:()=>n,property:()=>o,restoreNavigationButtonsVisibilitySettingsValue:()=>l});var s=i(17656);const n="NavigationButtons.visibility",{property:o,availableValues:r,actualBehavior:a,restoreDefaultValue:l}=(0,s.createVisibilityController)(n)},51613:(e,t,i)=>{"use strict";i.d(t,{actualBehavior:()=>a,availableValues:()=>r,property:()=>o,restorePaneButtonsVisibilitySettingsValue:()=>l});var s=i(17656),n=i(60859);const{property:o,availableValues:r,actualBehavior:a,restoreDefaultValue:l}=(0,s.createVisibilityController)("PaneButtons.visibility",n.navigationButtonsVisibilityKey)},65388:(e,t,i)=>{"use strict";i.d(t,{isCustomStudy:()=>n});const s={VbPFixed:!0,PivotPointsStandard:!0,VbPVisible:!0,VbPAnchored:!0};function n(e){return e in s}},28388:(e,t,i)=>{"use strict";i.d(t,{MetaInfoHelper:()=>u});var s=i(50151),n=i(9343),o=i(68159),r=i(94113),a=i(37265),l=i(65383);function c(e){return!e.groupId&&!e.isHidden&&e.id!==l.RangeDependentStudyInputNames.FirstBar&&e.id!==l.RangeDependentStudyInputNames.LastBar}var h=i(65388);const d=(0,n.getLogger)("Platform.GUI.PropertyDialog.Indicators.MetaInfo");class u{constructor(e){
this._metaInfo=e}hasUserEditableInputs(){return this._metaInfo.inputs.some(c)}getUserEditableInputs(){return this._metaInfo.inputs.filter(c)}hasUserEditableProperties(){return o.StudyMetaInfo.isScriptStrategy(this._metaInfo)}hasUserEditableStyles(){const e=this._metaInfo;return e.plots.length>0||void 0!==e.bands||void 0!==e.filledAreas||(0,h.isCustomStudy)(e.shortId)||o.StudyMetaInfo.isScriptStrategy(this._metaInfo)||Object.values(e.graphics).some((e=>void 0!==e))}getUserEditablePlots(){const e=new Set,t=this._metaInfo;return t.plots.filter((i=>{if((0,r.isColorerPlot)(i)||(0,r.isTextColorerPlot)(i)||(0,r.isDataOffsetPlot)(i)||(0,r.isOhlcColorerPlot)(i)||(0,r.isAlertConditionPlot)(i)||(0,r.isDataPlot)(i))return!1;if((0,r.isOhlcPlot)(i)){const n=i.target;if(e.has(n))return!1;e.add(n);const o=(0,s.ensureDefined)(t.ohlcPlots);return!(0,s.ensureDefined)(o[n]).isHidden}{const e=t.styles?t.styles[i.id]:void 0;return void 0===e||!e.isHidden}}))}hasUserEditableOptions(){return this.hasUserEditableInputs()||this.hasUserEditableProperties()||this.hasUserEditableStyles()}getStrategyProperties(){const e=this._metaInfo,t=e.inputs.filter(p),i={..._};for(const s of t){const t=s.internalID;i[t]=s,_.hasOwnProperty(t)||d.logWarn(`Unknown strategy input internal id ${t} in ${e.fullId}`)}return(0,a.clone)(i)}}const _={currency:void 0,backtest_fill_limits_assumption:void 0,calc_on_every_tick:void 0,calc_on_order_fills:void 0,commission_value:void 0,commission_type:void 0,initial_capital:void 0,pyramiding:void 0,slippage:void 0,default_qty_type:void 0,default_qty_value:void 0,margin_long:void 0,margin_short:void 0,use_bar_magnifier:void 0,process_orders_on_close:void 0,fill_orders_on_standard_ohlc:void 0};function p(e){return"strategy_props"===e.groupId}},59063:(e,t,i)=>{"use strict";i.d(t,{AbstractJsonStoreService:()=>n,CommonJsonStoreService:()=>o});var s=i(52033);class n{constructor(e,t,i,n,o){this._onChange=new s.Delegate,this._handleChange=()=>{this._onChange.fire(this.get())},this._crossTabEvents=e,this._jsonKeyValueStore=t,this.CROSSTAB_EVENT_NAME=i,this.JSON_STORE_KEY=n,this.defaultStoreValue=this._serialize(o),this._subscribe()}get(){const e=this._jsonKeyValueStore.getJSON(this.JSON_STORE_KEY,this.defaultStoreValue);return this._deserialize(e)}set(e,t){const i=this._serialize(e);this._jsonKeyValueStore.setJSON(this.JSON_STORE_KEY,i,t),this._crossTabEvents.emit(this.CROSSTAB_EVENT_NAME),this._onChange.fire(e)}getOnChange(){return this._onChange}destroy(){this._unsubscribe(),this._onChange.destroy(),delete this._onChange}_subscribe(){this._crossTabEvents.on(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.subscribe(this,this._handleChange)}_unsubscribe(){this._crossTabEvents.off(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.unsubscribe(this,this._handleChange)}}class o extends n{_serialize(e){return e}_deserialize(e){return e}}},38119:(e,t,i)=>{"use strict";i.d(t,{CustomStatusModel:()=>c});var s=i(64147)
;const n="#9598a1",o=!1,r=null,a='';class l{constructor(e){this._visible=new s.WatchedValue(o),this._tooltip=new s.WatchedValue(r),this._icon=new s.WatchedValue(a),this._color=new s.WatchedValue(n),this._tooltipContent=new s.WatchedValue(null),this._symbol=e}symbol(){return this._symbol}tooltip(){return this._tooltip}icon(){return this._icon}color(){return this._color}visible(){return this._visible}tooltipContent(){return this._tooltipContent}}class c{constructor(){this._symbolCustomStatuses=new Map}getSymbolCustomStatus(e){if(this._symbolCustomStatuses.has(e))return this._symbolCustomStatuses.get(e);const t=new l(e);return this._symbolCustomStatuses.set(e,t),t}hideAll(){for(const e of this._symbolCustomStatuses.values())e.visible().setValue(!1)}static getInstance(){return null===this._instance&&(this._instance=new c),this._instance}}c._instance=null},30141:(e,t,i)=>{"use strict";i.d(t,{restoreShowMarketOpenStatusProperty:()=>c,showMarketOpenStatusProperty:()=>l});var s=i(17625),n=i(56840);const o="Chart.ShowMarketOpenStatus",r=!0;function a(){return n.getBool(o,r)}const l=(0,s.createPrimitiveProperty)(a());function c(){l.setValue(r),n.remove(o)}n.onSync.subscribe(null,(()=>l.setValue(a()))),l.subscribe(null,(()=>n.setValue(o,l.value())))},90823:(e,t,i)=>{"use strict";i.d(t,{MarketStatusModel:()=>u});var s,n=i(50151),o=i(64147),r=i(88960),a=i(68805),l=i(17326),c=i(2740);function h(e){return window.ChartApiInstance.serverTime()/1e3-e}function d(e,t,i){return e<=i?t<=i?1/0:t/1e3:Math.min(e,t)/1e3}!function(e){e.Open="market",e.Pre="pre_market",e.Post="post_market",e.Close="out_of_session",e.Holiday="holiday",e.Delisted="delisted",e.Expired="expired"}(s||(s={}));class u{constructor(e){this._currentSession=new o.WatchedValue(null),this._delistedByTypespecs=new o.WatchedValue(!1),this._sessionsSpec=null,this._nextSessionEdgeInternal=null,this._nextSessionEdge=new o.WatchedValue(null),this._recalcNextSessionEdgeTimerId=null,this._delay=0,this._futuresContractExpirationTime=null,this._quotesProvider=e,this._marketStatus=(0,r.combine)(((e,t,i)=>null===e?e:t?"delisted":i?"expired":function(e){switch(e){case"market":return"market";case"pre_market":return"pre_market";case"post_market":return"post_market";case"out_of_session":return"out_of_session";case"holiday":return"holiday"}(0,n.ensureNever)(e)}(e)),this._currentSession.weakReference(),this._delistedByTypespecs.weakReference(),(this._futuresContractExpirationTime?.expired()??new o.WatchedValue(!1)).weakReference()),e.quotesUpdate().subscribe(this,(e=>{this._currentSession.setValue(e?.values.current_session??null)})),e.quoteSymbolChanged().subscribe(this,(()=>{this._currentSession.setValue(null)}))}destroy(){this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._quotesProvider.quoteSymbolChanged().unsubscribeAll(this),null!==this._recalcNextSessionEdgeTimerId&&clearTimeout(this._recalcNextSessionEdgeTimerId),this._marketStatus.destroy()}futuresContractExpirationTime(){
return this._futuresContractExpirationTime}setSymbolInfo(e){if(this._nextSessionEdgeInternal=null,null===e)return void(this._sessionsSpec=null);this._delay=(0,a.getSymbolDelaySeconds)(e);const t=new l.SessionsSpec(e.timezone,e.session_display??e.session,e.session_holidays,e.corrections);let i,s;const n=e.subsessions?.find((e=>"premarket"===e.id)),o=e.subsessions?.find((e=>"postmarket"===e.id));void 0!==n&&(i=new l.SessionsSpec(e.timezone,n["session-display"]??n.session,e.session_holidays,n["session-correction"])),void 0!==o&&(s=new l.SessionsSpec(e.timezone,o["session-display"]??o.session,e.session_holidays,o["session-correction"])),this._sessionsSpec={general:t,preMarket:i,postMarket:s},this._recalculateNextSessionEdge()}status(){return this._marketStatus}currentSession(){return this._currentSession}nextSessionEdge(){return this._nextSessionEdge}_getNextSessionEdgeInternal(){if(null===this._sessionsSpec)return null;const e=1e3*h(this._delay);if(null===this._nextSessionEdgeInternal||(this._nextSessionEdgeInternal.timestamp??1/0)<=e/1e3){const{general:t,preMarket:i,postMarket:s}=this._sessionsSpec,n=(0,c.get_timezone)(t.timezone()),o=(0,c.utc_to_cal)(n,e),r=d((0,c.cal_to_utc)(n,t.alignToNearestSessionStart(o,1)),(0,c.cal_to_utc)(n,t.alignToNearestSessionEnd(o,1)),e),a=d(void 0!==i?(0,c.cal_to_utc)(n,i.alignToNearestSessionStart(o,1)):1/0,void 0!==i?(0,c.cal_to_utc)(n,i.alignToNearestSessionEnd(o,1)):1/0,e),l=d(void 0!==s?(0,c.cal_to_utc)(n,s.alignToNearestSessionStart(o,1)):1/0,void 0!==s?(0,c.cal_to_utc)(n,s.alignToNearestSessionEnd(o,1)):1/0,e);let u=Math.min(r,a,l);if(u===1/0){const e=h(this._delay),i=6e4,s=new Date(Math.round(new Date(1e3*e).getTime()/i)*i).getTime()+i,o=(0,c.utc_to_cal)(n,s),r=d((0,c.cal_to_utc)(n,t.alignToNearestSessionStart(o,1)),(0,c.cal_to_utc)(n,t.alignToNearestSessionEnd(o,1)),s),_=Math.min(r,a,l);_!==1/0?(this._nextSessionEdgeInternal={timestamp:u},u=_):this._nextSessionEdgeInternal={timestamp:null}}this._nextSessionEdgeInternal=u===l?{timestamp:u,status:"post_market"}:u===a?{timestamp:u,status:"pre_market"}:{timestamp:u}}return this._nextSessionEdgeInternal}_recalculateNextSessionEdge(){const e=this._getNextSessionEdgeInternal();if(null===e||null===e.timestamp)return void this._nextSessionEdge.setValue(null);const t={status:e.status,remainingSeconds:Math.max(0,e.timestamp-h(this._delay))};if(null===this._recalcNextSessionEdgeTimerId){const e=Number.isFinite(t.remainingSeconds)?Math.ceil(t.remainingSeconds%60):1;this._recalcNextSessionEdgeTimerId=setTimeout((()=>this._recalculateNextSessionEdgeByTimer()),1e3*e)}this._nextSessionEdge.setValue(t)}_recalculateNextSessionEdgeByTimer(){this._recalcNextSessionEdgeTimerId=null,this._recalculateNextSessionEdge()}}},22118:(e,t,i)=>{"use strict";i.d(t,{CRUCIAL_REALTIME_BATS:()=>l,firstReplacedByBatsExchange:()=>c,isAmexToCboeMigratedSymbol:()=>_,isDelay:()=>d,isEod:()=>h,witoutRealtime:()=>u});i(50151);var s=i(13665),n=i.n(s);const o=["DJ","JSE","BELEX"],r=["NZX"],a=["BIVA"],l=["AMEX","NASDAQ","NYSE"];function c(e){return null}function h(e,t){
return n().hasEodSymbols(e.full_name)||6===t}function d(e){return void 0!==e&&e>0}function u(e){return"index"===e.type&&o.includes(e.listed_exchange)||"futures"===e.type&&r.includes(e.listed_exchange)||a.includes(e.listed_exchange)}function _(e,t){return"amex"===t&&"CBOE"===e}},76032:(e,t,i)=>{"use strict";i.d(t,{getStudyTemplateDescString:()=>a,getStudyTemplateMetaInfo:()=>o,getStudyTemplateSaveData:()=>r});var s=i(19466),n=i(79036);function o(e,t){return{indicators:e.orderedDataSources(!0).filter((e=>(0,n.isStudy)(e)&&!0)).map((e=>({id:e.metaInfo().id,description:e.title(s.TitleDisplayTarget.StatusLine,!0,void 0,!0)}))),interval:t}}function r(e,t,i,s){const n=t.studyTemplate(i,s);return{name:e,content:JSON.stringify(n),meta_info:o(t,n.interval)}}function a(e){const t=new Map;return e.forEach((e=>{const[i,s]=t.get(e.id)||[e.description,0];t.set(e.id,[i,s+1])})),Array.from(t.values()).map((([e,t])=>`${e}${t>1?` x ${t}`:""}`)).join(", ")}},79652:(e,t,i)=>{"use strict";i.d(t,{canShowSpreadActions:()=>n,globalKeypressMatches:()=>o});var s=i(56570);function n(){let e=!1;return s.enabled("show_spread_operators")&&(e=!0),e}function o(e){if(e.ctrlKey)return!1;if(e.metaKey)return!1;if(!e.charCode)return!1;if(!e.which||e.which<=32)return!1;const t=e.target;return!t||!/^(input|textarea)$/i.test(t.tagName)&&"listbox"!==t.getAttribute("role")}},50340:(e,t,i)=>{"use strict";function s(){return Promise.all([i.e(359),i.e(3703),i.e(3953),i.e(4524),i.e(7939),i.e(9258),i.e(5387),i.e(4178),i.e(9481),i.e(4600),i.e(2564),i.e(7384),i.e(2197),i.e(1072),i.e(9325),i.e(116),i.e(8985),i.e(4106),i.e(7444),i.e(2227),i.e(4931),i.e(9418),i.e(2544),i.e(3202),i.e(2751),i.e(1754)]).then(i.bind(i,89324))}i.d(t,{loadNewSymbolSearch:()=>s})},79320:(e,t,i)=>{"use strict";i.d(t,{tradingService:()=>o});var s=i(16216);const n={id:"TradingService"};function o(){return(0,s.hasService)(n)?(0,s.service)(n):null}},96e3:(e,t,i)=>{"use strict";i.d(t,{AbstractBarColorer:()=>s});class s{constructor(){this._backColorers=[]}barStyle(e,t,i){const s={};for(const n of this._backColorers)n.applyBarStyle(e,t,s,i);return this.applyBarStyle(e,t,s,i),s}pushBackBarColorer(e){this._backColorers.unshift(e)}firstColoredBar(e){return null}}},19475:(e,t,i)=>{"use strict";i.d(t,{addPlusButtonProperty:()=>p,restoreAddPlusButtonSettingsValue:()=>m,showPlusButtonOnCursor:()=>d});var s=i(4741),n=i(56570),o=i(56840),r=i(17625),a=i(64147);const l="add_plus_button";function c(){const e=s.keyboardPressedKeysState.value();return void 0!==e&&(Boolean(e.modifiers&s.Modifiers.Alt&&e.modifiers&s.Modifiers.Mod)&&(void 0===e.code||e.altOrOptionCode()||e.controlOrMetaCode()))}const h=new a.WatchedValue(c());s.keyboardPressedKeysState.subscribe((()=>h.setValue(c())));const d=h.readonly();function u(){return n.enabled("chart_crosshair_menu")}function _(){return o.getBool(l,u())}const p=(0,r.createPrimitiveProperty)(_());function m(){p.setValue(u()),o.remove(l)}o.onSync.subscribe(null,(()=>p.setValue(_()))),p.subscribe(null,(()=>{o.setValue(l,p.value()),
n.setEnabled("chart_crosshair_menu",!n.enabled("chart_crosshair_menu"))}))},92934:(e,t,i)=>{"use strict";i.d(t,{alignToStep:()=>o});var s=i(60521),n=i.n(s);function o(e,t){return n()(e).div(t).round(0,n().roundHalfUp).mul(t).toNumber()}},92158:(e,t,i)=>{"use strict";i.d(t,{actualAutoLogButtonsVisibility:()=>l,autoLogButtonsVisibilityOptions:()=>r,autoLogButtonsVisibilityProperty:()=>o,restoreAutoLogButtonsVisibilitySettingsValue:()=>a});var s,n=i(17656);!function(e){e.SettingsKey="PriceAxisAutoLogButtons.visibility"}(s||(s={}));const{property:o,availableValues:r,restoreDefaultValue:a,actualBehavior:l}=(0,n.createVisibilityController)("PriceAxisAutoLogButtons.visibility")},57596:(e,t,i)=>{"use strict";i.d(t,{axisLabelBackgroundColor:()=>n});var s=i(19625);const n={common:s.colorsPalette["color-tv-blue-500"],active:s.colorsPalette["color-tv-blue-800"]};var o;!function(e){e.BorderColor="#2E84A6"}(o||(o={}))},53388:(e,t,i)=>{"use strict";i.d(t,{createDwmAligner:()=>c,createTimeToBarTimeAligner:()=>d,isAlignmentEnabled:()=>h});var s=i(2740),n=i(56570),o=i(85049),r=i(42217),a=i(14381);const l=new r.SessionInfo("Etc/UTC","0000-0000:1234567");function c(e,t){if(!h()||!o.Interval.isDWM(e))return null;const i=new r.SessionInfo(t.timezone,t.session,t.session_holidays,t.corrections),n=(0,a.newBarBuilder)(e,i,l);return{timeToSessionStart:e=>n.tradingDayToSessionStart(e),timeToExchangeTradingDay:e=>{const t=(0,s.utc_to_cal)(i.timezone,e),n=i.spec.correctTradingDay(t);return(0,s.set_hms)(n,0,0,0,0,(0,s.get_timezone)("Etc/UTC")),n.getTime()}}}function h(){return!n.enabled("disable_resolution_rebuild")}function d(e,t){if(!h())return e=>e;const i=new r.SessionInfo(t.timezone,t.session,t.session_holidays,t.corrections),s=(0,a.newBarBuilder)(e,i,i,!1);return e=>s.alignTimeIfPossible(e)}},42217:(e,t,i)=>{"use strict";i.d(t,{BarBuilderBase:()=>a,SessionInfo:()=>r});var s=i(2740),n=i(83910),o=i(17326);class r{constructor(e,t,i,s){this.init(e,t,i,s),this._state={timezone:e,spec:t,holidays:i,corrections:s}}init(e,t,i,n){this.timezone=(0,s.get_timezone)(e),this.spec=new o.SessionsSpec(e,t,i,n)}state(){return this._state}static fromState(e){return new r(e.timezone,e.spec,e.holidays,e.corrections)}static wrap(e){const t=new r("Etc/UTC","24x7");return t.spec=e,t}static create(e,t,i,s){return new r(e,t,i,s)}}class a{alignTime(e){if(isNaN(e))return NaN;let t=this.indexOfBar(e);return t===n.SessionStage.POST_SESSION&&(this.moveTo(e),t=this.indexOfBar(e)),t<0?NaN:this.startOfBar(t)}}},14381:(e,t,i)=>{"use strict";i.r(t),i.d(t,{SessionInfo:()=>r.SessionInfo,alignExchangeTimeToSessionStartAndReturnUTC:()=>D,alignPeriodsBackForDataRequest:()=>M,alignPeriodsBackForVisibleRange:()=>A,getPeriodsBetweenDates:()=>k,isTradingNow:()=>E,newBarBuilder:()=>I});var s=i(2740),n=i(85049),o=i(9859),r=i(42217),a=i(83910);class l extends r.BarBuilderBase{constructor(e,t){super(),this._sessionStartMs=-Number.MAX_VALUE,this._sessionEndMs=-Number.MAX_VALUE,this._periodSec=e,this._session=t}alignTimeIfPossible(e){const t=this.alignTime(e);return isNaN(t)?e:t}
indexOfBar(e){return e=this._sessionEndMs?a.SessionStage.POST_SESSION:(0,o.toInt)((0,s.time_seconds_diff)(e,this._sessionStartMs)/this._periodSec)}startOfBar(e){if(e===a.SessionStage.PRE_SESSION){const e=(0,s.get_cal_from_unix_timestamp_ms)(this._session.timezone,this._sessionStartMs-1),t=this._session.spec.alignToNearestSessionEnd(e,-1);return(0,s.cal_to_utc)(this._session.timezone,t)}if(e===a.SessionStage.POST_SESSION)return this._sessionEndMs;if(e<0)throw new Error("Negative offset is not supported");return this._sessionStartMs+(0,s.time_seconds)(this._periodSec*e)}endOfBar(e){if(e<0)throw new Error("Index cannot be negative");const t=this.startOfBar(e)+1e3*this._periodSec;return t>this._sessionEndMs?this._sessionEndMs:t}isLastBar(e,t){return t>=this._sessionStartMs+(0,s.time_seconds)(this._periodSec*(e+1)-1)}moveTo(e){const t=this._session.timezone,i=(0,s.utc_to_cal)(t,e),n=this._session.spec.alignToSessionStart(i);this._sessionStartMs=(0,s.cal_to_utc)(t,i),(0,s.add_minutes)(i,n),this._sessionEndMs=(0,s.cal_to_utc)(t,i)}indexOfLastBarInSession(){return(0,o.toInt)((this._sessionEndMs-1-this._sessionStartMs)/1e3/this._periodSec)}moveNext(){this.moveTo(this._sessionEndMs)}static minutes(e,t){return new l(60*e,t)}static seconds(e,t){return new l(e,t)}}var c=i(50151),h=i(79324);const d=(0,s.get_timezone)("Etc/UTC");function u(e,t,i){const n=(0,s.clone)(t),o=e.businessDaysToCalendarDays(n,1);o>1&&(0,s.add_date)(n,o-1);const r=e.leftBorderOfDailyBar(n);if(null===r)throw new Error("Cannot calculate left border of daily bar");return(0,s.cal_to_utc)(i,r,!0)}class _{constructor(e,t){this.from=e,this.to=t}toString(){return`${this.from.toString()} - ${this.to.toString()}`}}class p extends r.BarBuilderBase{constructor(e,t,i,s,n=!1){super(),this._periodStart=-Number.MAX_VALUE,this._periodEnd=-Number.MAX_VALUE,this._periodLastBarStart=-Number.MAX_VALUE,this._periodStartDay=new h.BusinessDay(0,0,0),this._periodEndDay=new h.BusinessDay(0,0,0),this._period=i,this._sessionTgt=e,this._builder=s,this._useBusinessDays=n,n?((0,c.assert)(null===t,"useBusinessDays and sessionSrc are mutually exclusive arguments"),this._sessionSrc=new r.SessionInfo("Etc/UTC","24x7")):this._sessionSrc=t||e}builder(){return this._builder}alignTimeIfPossible(e){return this.tradingDayToSessionStart(e)}tradingDayToSessionStart(e){return this.moveTo(e),this.startOfBar(0)}indexOfBar(e){if(this._useBusinessDays){const t=h.BusinessDay.fromCalendar((0,s.get_cal_from_unix_timestamp_ms)(this._sessionSrc.timezone,e));return t.before(this._periodStartDay)?a.SessionStage.PRE_SESSION:this._periodEndDay.before(t)?a.SessionStage.POST_SESSION:0}return e=this._periodEnd?a.SessionStage.POST_SESSION:0}startOfBar(e){if(e===a.SessionStage.PRE_SESSION){const e=(0,s.get_cal_from_unix_timestamp_ms)(this._sessionTgt.timezone,this._periodStart-1),t=this._sessionTgt.spec.alignToNearestSessionEnd(e,-1);return(0,s.cal_to_utc)(this._sessionTgt.timezone,t)-1}
return e===a.SessionStage.POST_SESSION||e>0?this._periodEnd:e===a.SessionStage.LASTBAR_SESSION?this._periodLastBarStart:this._periodStart}moveTo(e){let t=(0,s.get_cal_from_unix_timestamp_ms)(this._sessionSrc.timezone,e);t=this._sessionSrc.spec.correctTradingDay(t);const i=(0,s.get_year)(t),n=this._indexOfPeriodInYear(t),o=n+this._period,r=this._sessionTgt.spec,a=this._sessionTgt.timezone,l=this._builder.startOfPeriod(n,i);this._periodStart=u(r,l,a);const c=r.businessDaysToCalendarDays(l,1);c>1&&(0,s.add_date)(l,c-1),this._periodStartDay=h.BusinessDay.fromCalendar(l);let d=this._builder.startOfPeriod(o,i);this._periodEnd=u(r,d,a);const _=(0,s.clone)(d);for((0,s.add_date)(_,-1);r.isCalWeekEnd(_);)(0,s.add_date)(_,-1);this._periodEndDay=h.BusinessDay.fromCalendar(_),(0,s.add_date)(d,-1),d=function(e,t){const i=(0,s.clone)(t);for(;e.isCalWeekEnd(i);)(0,s.add_date)(i,-1);return i}(this._sessionTgt.spec,d),this._periodLastBarStart=u(r,d,a),(this._periodLastBarStart=this._periodLastBarStart}moveBarsForward(e,t){(0,c.assert)(t>0);const i=(0,s.get_cal_from_unix_timestamp_ms)(this._sessionTgt.timezone,e);let n=this._sessionTgt.spec.correctTradingDay(i);for(let e=0;e=0&&(n-=7),(0,o.toInt)((n+i)/7))}class f{indexOfPeriod(e){return(0,s.get_day_of_year)(e)-1}startOfPeriod(e,t){const i=(0,s.days_per_year)(t);return(0,s.get_cal)(d,t,s.JANUARY,1+Math.min(e,i))}}class y extends f{constructor(e){super(),this._sessionsSpec=e}indexOfPeriod(e){return super.indexOfPeriod(e)-function(e,t){const i=g(e,t),n=(0,s.get_cal)(d,(0,s.get_year)(t),s.JANUARY,1);(0,s.add_date)(n,7*i);const o=i*e.weekEndsCountForSingleSession()+e.holidaysFromYearStart(n),r=(0,s.get_day_of_year)(t)-(0,s.get_day_of_year)(n);return o+r-e.calendarDaysToBusinessDays(n,r)}(this._sessionsSpec,e)}startOfPeriod(e,t){const i=7-this._sessionsSpec.weekEndsCountForSingleSession(),n=Math.max(0,Math.trunc(e/i)-1),o=(0,s.get_cal)(d,t,s.JANUARY,1),r=(0,s.days_per_year)(t);if((0,s.add_date)(o,7*n),(e-=i*n-this._sessionsSpec.holidaysFromYearStart(o))>0){const t=this._sessionsSpec.businessDaysToCalendarDays(o,e);(0,s.add_date)(o,t)}let a=(0,s.get_day_of_year)(o)-1;return t<(0,s.get_year)(o)&&(a+=r),super.startOfPeriod(a,t)}}class v extends f{constructor(e){super(),this._sessionsSpec=e}indexOfPeriod(e){return super.indexOfPeriod(e)-this._sessionsSpec.daysOffFromYearStart(e)}startOfPeriod(e,t){const i=(0,s.get_cal)(d,t,s.JANUARY,1);(0,s.add_date)(i,e);const n=this._sessionsSpec.daysOffFromYearStart(i);(0,s.add_date)(i,n);const o=this._sessionsSpec.daysOffFromYearStart(i)-n;if(o>0){const e=this._sessionsSpec.businessDaysToCalendarDays(i,o);(0,s.add_date)(i,e)}let r=(0,s.get_day_of_year)(i)-1;if(t<(0,s.get_year)(i)){r+=(0,s.days_per_year)(t)}return super.startOfPeriod(r,t)}}class S{constructor(e){this._builder=null,this._initialized=!1,this._session=e}indexOfPeriod(e){return this._getBuilder().indexOfPeriod(e)}startOfPeriod(e,t){return this._getBuilder().startOfPeriod(e,t)}_getBuilder(){return null!==this._builder&&this._initialized||(this._session.spec.hasWeekEnds()?this._builder=this._session.spec.hasHistoryCorrections()?new v(this._session.spec):new y(this._session.spec):this._builder=this._session.spec.hasHistoryCorrections()?new v(this._session.spec):new f),this._builder}}class b{constructor(e){this._spec=e}indexOfPeriod(e){let t=g(this._spec,e);return 0===t&&e.getTime()(0,s.days_per_year)((0,s.get_year)(i))?this.startOfPeriod(0,t+1):((0,
s.add_date)(i,o),i)}}class w{constructor(e){this._yearStartDataHash=new Map,this._spec=e}startOfPeriod(e,t){if(e<0){t--;const i=(0,s.get_cal)(d,t,s.DECEMBER,31,23,59,59),n=this.indexOfPeriod(i),o=-1*e,r=Math.trunc(n/o)*o;return this.startOfPeriod(r,t)}const i=this._spec.getWeekIndicesWithAdditionalWeekBars(t),n=this._getStartOfYearData(t,i),o=this._moveToWeekIndexAccountingAdditional(n.firstWeekIndex,i,e),r=7*(o-n.firstWeekIndex);let a=(0,s.clone)((0,c.ensureNotNull)(n.startOfFirstBarInYear));if((0,s.add_date)(a,r),(0,s.get_year)(a)>t){const e=t+1,i=this._spec.getWeekIndicesWithAdditionalWeekBars(e),s=this._getStartOfYearData(e,i);if(a.getTime()>=(0,c.ensureNotNull)(s.startOfFirstBarInYear).getTime())return this.startOfPeriod(0,e)}return a=this._calculateBarWeekStart(a,i,o,e),a}indexOfPeriod(e){const t=this._spec.getWeekIndex(e),i=this._spec.getWeekIndicesWithAdditionalWeekBars((0,s.get_year)(e)),n=this._getStartOfYearData((0,s.get_year)(e),i);if(e.getTime()<(0,c.ensureNotNull)(n.startOfFirstBarInYear).getTime())return-1;if(0===t&&w.isOnFirstCalendarWeekOfYear(e)||0!==t&&t===n.firstWeekIndex)return this._calculateLastWeek(e,t,i,n.firstWeekbarsCount)-1;let o=this._numberOfCalendarWeeks(e);return o+=n.firstWeekbarsCount-n.fullWeeksAdjustment,o+=this._calculateWeeksWithExtraBar(t,i,n.firstWeekIndex),o+=this._calculateLastWeek(e,t,i,w.fullWeekOfAdditionalBarsCount)-1,o}static isOnFirstCalendarWeekOfYear(e){if((0,s.get_day_of_year)(e)>s.LAST_DAY_OF_WEEK)return!1;const t=(0,s.get_cal)(d,(0,s.get_year)(e),s.JANUARY,1,0,0),i=(0,s.clone)(t);return(0,s.add_date)(i,s.LAST_DAY_OF_WEEK-(0,s.get_day_of_week)(t)),e.getTime()=s)break;s--}return s}_calculateBarWeekStart(e,t,i,n){const o=this._getIndexOfWeekWithExtraBarIfExists(t,i);if(null===o){const t=this._spec.getEntriesForWeek(i).firstDayOfWeek()-(0,s.get_day_of_week)(e),n=(0,s.clone)(e);return(0,s.add_date)(n,t),n}const r=this._spec.getHistoryByIndex(o.entryIndex);if(this.indexOfPeriod((0,c.ensureNotNull)(r.getStartDay()))===n)return(0,s.clone)((0,c.ensureNotNull)(r.getStartDay()));const a=this._spec.getHistoryByIndex(o.entryIndex-1).getEntries().firstDayOfWeek()-(0,s.get_day_of_week)(e),l=(0,s.clone)(e);return(0,s.add_date)(l,a),l}_numberOfCalendarWeeks(e){const t=(0,s.get_day_of_year)(e),i=(0,s.get_day_of_week)(e);return Math.trunc((t-i)/7)}_getStartOfYearData(e,t){let i=this._yearStartDataHash.get(e);if(void 0!==i)return i;let n=(0,s.get_cal)(d,e,s.JANUARY,1,0,0),o=this._spec.getWeekIndex(n),r=0;for((0,s.get_day_of_week)(n)===s.FIRST_DAY_OF_WEEK&&(r=1),i=this._getYearStartDataFromWeek(t,o,n);null===i.startOfFirstBarInYear;)o++,r++,n=this._moveToNextCalendarWeekStart(n),i=this._getYearStartDataFromWeek(t,o,n);return i.fullWeeksAdjustment=r,this._yearStartDataHash.set(e,i),i}_moveToNextCalendarWeekStart(e){const t=(0,s.get_day_of_week)(e),i=(0,s.clone)(e);return(0,s.add_date)(i,s.LAST_DAY_OF_WEEK-t+1),i}_getYearStartDataFromWeek(e,t,i){const n=(0,
s.get_day_of_week)(i);let o=null,r=0;const a=this._getIndexOfWeekWithExtraBarIfExists(e,t);if(null!==a){let e=this._spec.getHistoryByIndex(a.entryIndex-1).getEntries().firstDayOfWeek()-n;if(e>=0)o=(0,s.clone)(i),(0,s.add_date)(o,e),r=2;else{const t=this._spec.getHistoryByIndex(a.entryIndex);e=t.getEntries().firstDayOfWeek()-n,e>=0&&(o=t.getStartDay(),o&&(o=(0,s.clone)(o)),r=1)}}else{const e=this._spec.getEntriesForWeek(t),a=e.firstDayOfWeek()-n;a>=0&&(this._hasWorkingDays(e)||this._hasWorkingDaysNextWeek(t+1))&&(o=(0,s.clone)(i),(0,s.add_date)(o,a),r=1)}return{startOfFirstBarInYear:o,firstWeekIndex:t,firstWeekbarsCount:r,fullWeeksAdjustment:0}}_hasWorkingDays(e){if(0===e.entriesByDay().size)return!1;for(let t=e.firstDayOfWeek();t<=s.LAST_DAY_OF_WEEK;t++)if(void 0!==e.entriesByDay().get(t))return!0;return!1}_hasWorkingDaysNextWeek(e){const t=this._spec.getEntriesForWeek(e);for(let e=1;e=e)break;n.weekIndex>i&&s++}return s}_calculateLastWeek(e,t,i,n){const o=(0,s.get_day_of_week)(e),r=this._getIndexOfWeekWithExtraBarIfExists(i,t);if(null===r){return o-this._spec.getEntriesForWeek(t).firstDayOfWeek()>=0?1:0}const a=this._positionInsideWeekWithSeveralBars(r,o);return a===w.IsInNewSession?n:a===w.IsInMidSession?n-1:0}_getIndexOfWeekWithExtraBarIfExists(e,t){for(const i of e){if(i.weekIndex===t)return i;if(i.weekIndex>t)break}return null}_positionInsideWeekWithSeveralBars(e,t){let i=this._spec.getHistoryByIndex(e.entryIndex).getEntries().firstDayOfWeek()-t;if(i<=0)return w.IsInNewSession;return i=this._spec.getHistoryByIndex(e.entryIndex-1).getEntries().firstDayOfWeek()-t,i<=0?w.IsInMidSession:w.IsBeforeAnySession}}w.IsBeforeAnySession=-1,w.IsInMidSession=0,w.IsInNewSession=1,w.fullWeekOfAdditionalBarsCount=2;class C{constructor(e){this._builder=null,this._session=e}indexOfPeriod(e){return this._getBuilder().indexOfPeriod(e)}startOfPeriod(e,t){return this._getBuilder().startOfPeriod(e,t)}_getBuilder(){return null==this._builder&&(this._builder=this._session.spec.hasHistoryCorrections()?new w(this._session.spec):new b(this._session.spec)),this._builder}}class P{constructor(e){this._session=e}indexOfPeriod(e){return(0,s.get_month)(e)}startOfPeriod(e,t){if(e<0){const i=(0,o.toInt)((11-e)/12);t-=i,e+=12*i}else e>s.DECEMBER&&(t++,e=s.JANUARY);return(0,s.get_cal)(d,t,e,1)}}var T,x;function I(e,t,i,s=!1){const o=n.Interval.parse(e),r=o.multiplier();return o.isMinutes()?l.minutes(r,t):o.isSeconds()?l.seconds(r,t):o.isTicks()?new l(1,t):o.isRange()?new l(60*r,t):new p(t,i??null,r,function(e,t){switch(e){case n.ResolutionKind.Days:return new S(t);case n.ResolutionKind.Weeks:return new C(t);case n.ResolutionKind.Months:return new P(t)}throw new Error(`Unknown dwm resolution: ${e}`)}(o.kind(),t),s)}function M(e,t,i,s,n,o,r){return L(e,t,i,s,n,o,r,0)}function A(e,t,i,s,n,o,r){return L(e,t,i,s,n,o,r,1)}function L(e,t,i,o,a,l,c,h){const d=n.Interval.parse(a+o);if(d.isMonths()){
const e=new Date(c);return 0===h&&e.setUTCDate(1),function(e,t){B(e,Math.floor(t/12));let i=e.getUTCMonth()-t%12;i<0&&(B(e,1),i+=12);e.setUTCMonth(i);for(;e.getUTCMonth()!==i;)V(e,1)}(e,l*d.multiplier()),e.getTime()}const u=new r.SessionInfo("Etc/UTC",e,t,i),_=d.inMilliseconds(),p=d.isDWM();let m;if(p)m=864e5;else{const e=u.spec.getWeekIndex((0,s.get_cal_from_unix_timestamp_ms)(u.timezone,c));m=60*u.spec.getEntriesForWeek(e).maxTradingDayLength()*1e3}let g=0;if(d.isWeeks())g=7;else{const e=u.spec.getWeekIndex((0,s.get_cal_from_unix_timestamp_ms)(u.timezone,c));g=7-u.spec.getEntriesForWeek(e).weekEndsCount()}const f=m/_,y=g*f;let v;if(l=f&&(y=m/6048e5*f);return y%1<=Number.EPSILON*Math.ceil(y)?Math.round(y):Math.ceil(y)}function D(e,t){const i=(0,s.clone)(t);return e.alignToSessionStart(i),(0,s.cal_to_utc)((0,s.get_timezone)(e.timezone()),i)}function E(e,t){const i=(0,s.utc_to_cal)(t.timezone,+e);let n=(0,s.get_day_of_week)(i),o=(0,s.get_minutes_from_midnight)(i);const r=t.spec.findSession(t.spec.getWeekIndex(i),n,o).getEntry();return r.isOvernight()&&o>r.startOffset()+r.length()&&n===r.dayOfWeek()-1&&(n++,o-=1440),n===r.dayOfWeek()&&o>=r.startOffset()&&o{"use strict";i.d(t,{BusinessDay:()=>o});var s=i(2740),n=i(32956);class o{constructor(e,t,i){this.year=e,this.month=t,this.day=i}toString(){return`${(0,n.addLeadingZeros)(this.year,4)}-${(0,n.addLeadingZero)(this.month)}-${(0,n.addLeadingZero)(this.day)}`}toyyyymmdd(){return`${(0,n.addLeadingZeros)(this.year,4)}${(0,n.addLeadingZero)(this.month)}${(0,n.addLeadingZero)(this.day)}`}compareTo(e){return this.year>e.year||this.year===e.year&&this.month>e.month||this.year===e.year&&this.month===e.month&&this.day>e.day?1:this.year===e.year&&this.month===e.month&&this.day===e.day?0:-1}before(e){return-1===this.compareTo(e)}toCalendar(e){return(0,s.get_cal)(e??(0,s.get_timezone)("Etc/UTC"),this.year,this.month-1,this.day)}addDays(e){const t=this.toCalendar((0,s.get_timezone)("Etc/UTC"));return(0,
s.add_date)(t,e),o.fromCalendar(t)}firstDayOfYear(){return new o(this.year,1,1)}getDayOfWeek(){const e=this.toCalendar();return(0,s.get_day_of_week)(e)}static fromCalendar(e){return new o((0,s.get_year)(e),(0,s.get_month)(e)+1,(0,s.get_day_of_month)(e))}}},83910:(e,t,i)=>{"use strict";var s;i.d(t,{SessionStage:()=>s}),function(e){e[e.PRE_SESSION=-1]="PRE_SESSION",e[e.POST_SESSION=-2]="POST_SESSION",e[e.LASTBAR_SESSION=-3]="LASTBAR_SESSION",e[e.LAST_SESSION_END=-4]="LAST_SESSION_END",e[e.FIRST_SESSION_START=-5]="FIRST_SESSION_START"}(s||(s={}))},40644:(e,t,i)=>{"use strict";i.d(t,{extrapolateBarsFrontByCount:()=>o,extrapolateBarsFrontToTime:()=>n});var s=i(83910);function n(e,t,i,s,o=!1){if(t>i){const r=n(e,i,t,s,o);return r.count=-r.count,r}return r(e,t,1,((e,t)=>t>i||0!==s&&e>s),o)}function o(e,t,i,s=!1){const n=i<0?-1:1;return r(e,t,n,((e,t)=>e>=i*n),s)}function r(e,t,i,n,o){let r=0,a=t;e.moveTo(a);let l=0,c=Number.MAX_VALUE,h=!1,d=t;const u=[];for(;!n(r,a);){if(l>15)throw new Error("Internal error 0x10 while extrapolating.");const n=e.indexOfBar(a);if(n===s.SessionStage.PRE_SESSION&&1===i)a=e.startOfBar(0),e.moveTo(a);else if(n===s.SessionStage.PRE_SESSION&&-1===i)a=e.startOfBar(s.SessionStage.PRE_SESSION),e.moveTo(a);else if(n===s.SessionStage.POST_SESSION&&1===i)a=e.startOfBar(s.SessionStage.POST_SESSION),e.moveTo(a);else{if(n===s.SessionStage.POST_SESSION&&-1===i)throw new Error("Internal error 0x12 while extrapolating.");{const _=e.startOfBar(n);if(_>t&&i>0||t>_&&i<0){if(h&&c===_)throw new Error("Internal error 0x11 while extrapolating.");h=!0,c=_,l=0,r++,d=_,o&&u.push(d)}if(0===n&&-1===i)a=_-1;else{a=e.startOfBar(n+i);const t=e.startOfBar(s.SessionStage.POST_SESSION);a>t&&(e.moveTo(t),a=e.startOfBar(0))}}}l++}return{time:d,times:u,count:r}}},17326:(e,t,i)=>{"use strict";i.d(t,{SessionsSpec:()=>P});var s,n=i(50151),o=i(2740),r=i(29981),a=i(79324);function l(e,t){return e.compareTo(t)}!function(e){e[e.LeftFirst=-1]="LeftFirst",e[e.Unchanged=0]="Unchanged",e[e.RightFirst=1]="RightFirst"}(s||(s={}));class c{constructor(e,t,i){(0,n.assert)(Number.isFinite(e)&&Number.isFinite(t)&&Number.isFinite(i),"Invalid arguments"),this._dayOfWeek=e,this._start=t,this._length=i}start(){return this._start+o.minutesPerDay*this.sessionStartDaysOffset()}startOffset(){return this._start}sessionStartDaysOffset(){return this._start>=0?0:this._start%o.minutesPerDay==0?-Math.ceil(this._start/o.minutesPerDay):-Math.floor(this._start/o.minutesPerDay)}isOvernight(){return this._start<0}dayOfWeek(){return this._dayOfWeek}sessionStartDayOfWeek(){let e=this._dayOfWeek-this.sessionStartDaysOffset();return es?1:-1}contains(e){return this._contains((0,o.get_minutes_with_hours)(e),(0,o.get_day_of_week)(e))}_weight(){return this._dayOfWeek*o.minutesPerDay+this._start}_contains(e,t){let i=t-this._dayOfWeek;i>0&&(i-=7);const s=i*o.minutesPerDay+e
;return s>=this._start&&se.length())))}maxTradingDayLength(){if(null==this._maxTradingDayLength){const e=new Map;for(const t of this._list){const i=t.dayOfWeek();e.set(i,t.length()+(e.get(i)??0))}let t=0;e.forEach((e=>{t=Math.max(t,e)})),this._maxTradingDayLength=t}return this._maxTradingDayLength}}class u{constructor(e,t,i){this._startDay=e,this._entries=i,this._specEndDay=t}getEntries(){return this._entries}getStartDay(){return this._startDay}getSpecEndDay(){return this._specEndDay}isOpenEnded(){return null==this._specEndDay}}const _=[o.MONDAY,o.TUESDAY,o.WEDNESDAY,o.THURSDAY,o.FRIDAY],p=[o.SUNDAY,o.MONDAY,o.TUESDAY,o.WEDNESDAY,o.THURSDAY,o.FRIDAY,o.SATURDAY];function m(e){return e>=48&&e<=57}const g=[0,31,28,31,30,31,30,31,31,30,31,30,31];class f extends Map{constructor(){super(...arguments),this._keyStringsToKey=new Map}get(e){const t=this._keyStringsToKey.get(e.toString());return t&&super.get(t)}set(e,t){const i=e.toString(),s=this._keyStringsToKey.get(i);return void 0!==s&&super.delete(s),this._keyStringsToKey.set(i,e),super.set(e,t)}has(e){return this._keyStringsToKey.has(e.toString())}}function y(e){return e.length>0}class v{constructor(){this.historyEntries=[],this.timezone="",this.adjustSessionsIndexes=null}parseSessions(e,t){this._parseHistoryEntries(e,t,!1)}parseSessionsAndValidateDateTime(e,t){this._parseHistoryEntries(e,t,!0)}static parseHolidaysAndCorrections(e,t,i,s){return this._parseHolidaysAndCorrectionsImpl(e,t,i,s)}static parseHolidaysAndCorrectionsAndValidateDateTime(e,t,i){return this._parseHolidaysAndCorrectionsImpl(e,t,i,!0)}_clearAll(){this.timezone="",this.historyEntries=[],this.adjustSessionsIndexes=[]}_parseHistoryEntries(e,t,i){this._clearAll();const s=t.split("/");let n=null,o=null;this.hasHistoryCorrections=s.length>1;for(let t=0;t ${a}`);const l=this._parseSessionsImpl(e,r[0],i);n=this._adjustStartToPreviousSession(l.firstDayOfWeek());const c=new u(n,a,l);this.historyEntries.push(c),o=a}}_parseSessionsImpl(e,t,i){this.timezone=e,t=this._parseFirstDayOfWeek(t);const s=new Map,n=[]
;if("24x7"===t.toLowerCase())for(const e of p){const t=v._createSessionEntry(e,0,0,0,0);n.push(t);const i=[];i.push(t),s.set(e,i)}else{let e=!1;const o=new Map;for(const i of t.split("|")){const t=i.split(":").filter(y);if(1!==t.length&&2!==t.length)throw new Error(`bad session section: ${i}`);const s=1===t.length;if(s){if(e)throw new Error(`duplicated default section: ${i}`);e=!0}const n=s?_:v._parseWorkingDays(t[1]);for(const e of n)s&&o.has(e)||o.set(e,t[0])}for(const e of p){const t=o.get(e);if(void 0!==t)for(const o of t.split(",").filter(y)){const t=v._parseSessionEntry(e,o,i);let r=s.get(e);void 0===r&&(r=[]),r.push(t),n.push(t),s.set(e,r)}}}n.sort(l);const o=new Set;for(const e of n)o.add(e.dayOfWeek());const r=7-o.size;return new d(n,s,this._firstDayOfWeek,r)}_parseFirstDayOfWeek(e){const t=e.split(";");if(this._firstDayOfWeek=o.MONDAY,t.length>2)throw new Error(`bad sessions spec: ${e}`);if(1===t.length)return e;let i=1;let s=t[0].indexOf("-")>=0?NaN:parseInt(t[0]);if(isNaN(s)&&(i=0,s=parseInt(t[1])),so.SATURDAY)throw new Error(`bad sessions spec: ${e}`);return this._firstDayOfWeek=s,t[i]}_adjustStartToPreviousSession(e){if(0===this.historyEntries.length)return null;const t=(0,n.ensureNotNull)(this.historyEntries[this.historyEntries.length-1].getSpecEndDay()),i=e-(0,o.get_day_of_week)(t);if(0===i)return t;const s=(0,o.clone)(t);return(0,o.add_date)(s,i),t.getTime()12)&&(!(e<1||e>g[t])||!(2!==t||29!==e||!(0,o.is_leap_year)(i)))}static _parseWorkingDays(e){const t=[];for(let i=0;i7)throw new Error(`Invalid days specification: ${e}`);t.includes(s)||t.push(s)}return t}static _createSessionEntry(e,t,i,s,r){(0,n.assert)(s>=0&&s<7),(0,n.assert)(r>=0&&r<7),0===i&&(i=o.minutesPerDay),s===r&&i<=t&&(s+=1),(0,n.assert)(s>=r),s>0&&(t-=s*o.minutesPerDay),r>0&&(i-=r*o.minutesPerDay);const a=i-t;return(0,
n.assert)(e>=o.SUNDAY&&e<=o.SATURDAY),(0,n.assert)(t0),new c(e,t,a)}static _parseHolidaysAndCorrectionsImpl(e,t,i,s){const n=new f;if(""!==t){const e=[];for(const i of t.split(",")){const t=this._parseDay(i,"holiday",s);n.set(t,e)}}if(""===i)return n;for(const e of i.split(";")){const t=e.split(":");if(2!==t.length)throw new Error(`bad correction section: ${e}`);const i=[];if("dayoff"!==t[0])for(const e of t[0].split(","))i.push(this._parseSessionEntry(1,e,s));for(const e of t[1].split(",")){const t=this._parseDay(e,"correction",s),r=(0,o.get_day_of_week)(t.toCalendar()),a=[];for(let e=0;e=0);const t=e,i=this._entriesHash.get(t);if(void 0===i){return this._getHistoryAndIndexForWeek(t).getEntries()}let s=i.get();if(null!==s)return s;let r=null;const c=this._borderWeeksIndicesHash.get(t);r=void 0===c?this._getHistoryAndIndexForWeek(t).getEntries():this._prepareBorderWeekHistory(c);const h=new Map(r.entriesByDay());let u=[...r.list()];const _=this._weekIndexToLocalDateTime(e),m=this._weekIndexToLocalDateTime(e+1),g=a.BusinessDay.fromCalendar(_),f=a.BusinessDay.fromCalendar(m);for(const[e,t]of this._selectHolidays(g,f)){const i=(0,o.get_day_of_week)(e.toCalendar());u=u.filter((e=>e.dayOfWeek()!==i)),u.push(...t),0===t.length?h.delete(i):h.set(i,t)}u.sort(l);const y=p.length-h.size
;return s=new d(u,h,r.firstDayOfWeek(),y),i.set(s),s}getHistoryByIndex(e){return this._entries[e]}timezone(){return this._timezone}timezoneObj(){return this._timezoneObj}longestSessionLength(){let e=this._presentHistoryEntry.getEntries().longestSessionLength();for(let t=0;te.length())));return Math.max(t,e)}isWeekEnd(e){const t=this.getWeekIndex(e);let i;return i=void 0===this._borderWeeksIndicesHash.get(t)?this._getHistoryAndIndexForWeek(t).getEntries():this.getEntriesForWeek(t),i.isWeekEnd((0,o.get_day_of_week)(e))}isCalWeekEnd(e){const t=(0,o.get_day_of_week)(e);if(!this._isThereCorrections)return this._presentHistoryEntry.getEntries().isWeekEnd(t);const i=this.getWeekIndex(e),s=this.getEntriesForWeek(i),n=a.BusinessDay.fromCalendar(e),r=this._holidayAndCorrectionMap.get(n);return void 0===r?s.isWeekEnd(t):0===r.length}holidaysFromYearStart(e){const t=e instanceof a.BusinessDay?e:a.BusinessDay.fromCalendar(e);return this._holidaysFromYearStart(t)}daysOffFromYearStart(e){const t=(0,o.get_cal)(b,(0,o.get_year)(e),o.JANUARY,1),i=this.getWeekIndex(t),s=(0,o.get_day_of_week)(t),n=(0,o.get_day_of_week)(e)-1;if((0,o.get_day_of_year)(e)+s<=o.LAST_DAY_OF_WEEK+o.FIRST_DAY_OF_WEEK)return this._getDaysOffForWeekInBorders(i,s,n);const r=this.getWeekIndex(e);let a=this._getDaysOffForWeekInBorders(i,s,o.LAST_DAY_OF_WEEK);for(let e=i+1;et.start()%e==0&&t.length()%e==0)))return!1;return!0}intradayCanBeBuiltFrom24x7Seconds(e){for(const t of this._entries)if(!t.getEntries().list().every((t=>60*t.start()%e==0&&60*t.length()%e==0)))return!1;return!0}indexOfSession(e,t,i){(0,n.assert)(t>=o.SUNDAY&&t<=o.SATURDAY),(0,n.assert)(i>=0&&i=u.list().length)))return new h(d,l,[...u.list()])}findSession(e,t,i,s=0){const n=this.indexOfSession(e,t,i),o=n.entries;let r=n.entryIndex;if(0!==s){const e=o[r].dayOfWeek(),t=s>0?1:-1;for(;;){const i=r+t;if(i<0||i>=o.length||o[i].dayOfWeek()!==e)break;r=i}}return new h(n.weekIndex,r,o)}getWeekIndex(e){
return this._isThereCorrections?P._getWeekIndexImpl(e):0}correctTradingDay(e){const t=this._correctTradingDay(this.getWeekIndex(e),(0,o.get_day_of_week)(e),(0,o.get_minutes_with_hours)(e)),i=(0,o.clone)(e);return(0,o.add_date)(i,t),i}alignToSessionStart(e,t=0){const i=(0,o.get_day_of_week)(e),s=(0,o.get_minutes_from_midnight)(e),n=this.getWeekIndex(e),r=this.findSession(n,i,s,t),a=r.getEntry(),l=a.dayOfWeek()-i+7*Math.trunc(r.weekIndex-n);0!==l&&(0,o.add_date)(e,l);const c=a.startOffset();return(0,o.set_hms)(e,Math.trunc(c/60),c%60,0,0),a.length()}businessDaysToCalendarDays(e,t){return this._businessDaysToCalendarDays(this.getWeekIndex(e),(0,o.get_day_of_week)(e),t)}calendarDaysToBusinessDays(e,t){return this._calendarDaysToBusinessDays(this.getWeekIndex(e),(0,o.get_day_of_week)(e),t)}alignToNearestSessionStart(e,t){return this._alignToNearestSessionValue(e,t,this._entrySessionStart.bind(this))}alignToNearestSessionEnd(e,t){return this._alignToNearestSessionValue(e,t,this._entrySessionEnd.bind(this))}bordersOfDailyBar(e){const t=this._getEntriesForDay(e);if(0===t.length)return null;const i=t.slice();i.sort(l);const s=this._getLeftEntryBorder(e,i[0]),n=i[i.length-1],r=60*(n.startOffset()+n.length())-1,a=(0,o.clone)(e);return(0,o.set_seconds)(a,r),{from:s,to:a}}leftBorderOfDailyBar(e){const t=this._getEntriesForDay(e);if(0===t.length)return null;const i=t.slice();return i.sort(l),this._getLeftEntryBorder(e,i[0])}checkSession(){return this._checkEachHistorySession()&&this._checkSpecialEntries()&&this._checkTooManyCorrectionsOnWeek()}inSession(e){e=new Date(1e3*Math.floor(e.getTime()/1e3));const t=this.alignToNearestSessionStart(e,-1),i=this.alignToNearestSessionEnd(t,1);return!(e.getTime()>i.getTime())}hasWeekEnds(){for(const e of this._entries)if(0!==e.getEntries().weekEndsCount())return!0;return!1}getWeekIndicesWithAdditionalWeekBars(e){let t=this._yearToCalculatedAddedWeekIndicesHash.get(e);return void 0===t&&(t=this._calculateAddedIndices(e),this._yearToCalculatedAddedWeekIndicesHash.set(e,t)),t}_prepareSessionsBorderParams(){const e=new Map,t=new Map;let i=null;this._entries.length>1&&(i=Array.from({length:this._entries.length-1},(()=>0)));let s=0;for(let o=0;o=e){if(i=s-1,i=0&&s.compareTo(t)<0&&i.add([s,n]);return i}_prepareBorderWeekHistory(e){const t=this._entries[e-1],i=this._entries[e],s=new Map,r=[],a=(0,o.get_day_of_week)((0,n.ensureNotNull)(i.getStartDay()));for(let e=0;e0&&i>=0||c<0&&i<0)&&(0,o.add_date)(t,7*c),!r.contains(t)){let e=a-n;h&&i<0&&(e=-(7-a+n)),(0,o.add_date)(t,e),n=(0,o.get_day_of_week)(t)}if(r.isOvernight()){const e=r.sessionStartDaysOffset(),i=(n-(r.dayOfWeek()-e)+7)%7;0!==i&&(0,o.add_date)(t,-i)}const d=s(r);return(0,o.set_seconds)(t,d),t}_businessDaysToCalendarDays(e,t,i){let s=0,n=0;for(;n=i)return s;e++,t=o.SUNDAY}return s}_calendarDaysToBusinessDays(e,t,i){let s=0,n=0;for(;s=i)return n;e++,t=o.SUNDAY}return n}_entrySessionStart(e,t,i){return this._entrySessionValue(e,t,i,(e=>60*e.start()))}_entrySessionEnd(e,t,i){return this._entrySessionValue(e,t,i,(e=>60*(e.start()+e.length())-1))}_alignToNearestSessionValue(e,t,i){const s=(0,o.get_day_of_week)(e),n=(0,o.get_minutes_with_hours)(e),r=this.getWeekIndex(e);let a=this.findSession(r,s,n);if(1===t)return i(a,e,t);const l=a.getEntry(),c=l.contains(e),d=r===a.weekIndex,u=l.sessionStartDaysOffset()-l.dayOfWeek()>=0;if(c&&(d||u))return i(a,e,t);let _=a.entryIndex-1;if(_<0){let e=a.weekIndex,t=a.entries;if(0===e)e--,_+=t.length;else for(;_<0;)e--,t=this.getEntriesForWeek(e).list(),_+=t.length;a=new h(e,_,t)}else a=new h(a.weekIndex,_,a.entries);return i(a,e,t)}_getEntriesForDay(e){const t=(0,o.get_day_of_week)(e),i=this.getEntriesForWeek(this.getWeekIndex(e)).entriesByDay().get(t)
;return void 0!==i?i:[]}_getLeftEntryBorder(e,t){let i=t.startOffset();const s=-Math.trunc((i-1439)/1440);i+=1440*s;const n=(0,o.get_cal)(b,(0,o.get_year)(e),(0,o.get_month)(e),(0,o.get_day_of_month)(e),Math.trunc(i/60),i%60,0);return(0,o.add_date)(n,-s),n}_checkEachHistorySession(){for(const e of this._entries){const t=e.getEntries().list();if(!this._checkEntriesForIntersections(t,t,t))return!1}return!0}_checkEntriesForIntersections(e,t,i){const s=this._buildTestEntries(e,t,i);for(let e=0;e0;){const r=(0,o.clone)((0,n.ensureNotNull)(s.getStartDay()));if((0,o.add_date)(r,-a),!this.isCalWeekEnd(r)){const s={entryIndex:i,weekIndex:e};t.push(s);break}a--}}return t}static _getWeekIndexImpl(e){const t=(0,o.get_cal_utc)((0,o.get_year)(e),(0,o.get_month)(e),1);(0,o.add_date)(t,(0,o.get_day_of_month)(e)-(0,o.get_day_of_week)(e));const i=t.getTime()/1e3;return(0,n.assert)((i+62167219200)%86400==0),Math.trunc((i+62167219200)/86400/7)}}},15716:(e,t,i)=>{"use strict";i.d(t,{barFunctionByStyle:()=>n});var s=i(3070);function n(e,t){switch(e){case 12:return(0,s.barFunction)("low","low","close");case 2:case 18:case 20:case 14:case 15:case 3:case 10:case 13:return(0,s.barFunction)(t??"close");default:return(0,s.barFunction)("close","open")}}},91988:(e,t,i)=>{"use strict";i.d(t,{BarsRange:()=>n});var s=i(50151);class n{constructor(e,t){(0,s.assert)(e<=t,"The last bar in the bars range should be greater than or equal to the first bar"),this._firstBar=e,this._lastBar=t}firstBar(){return this._firstBar}lastBar(){return this._lastBar}count(){return this._lastBar-this._firstBar+1}contains(e){return this._firstBar<=e&&e<=this._lastBar}unite(e){return null===e?this:new n(Math.min(this._firstBar,e.firstBar()),Math.max(this._lastBar,e.lastBar()))}equals(e){
return this._firstBar===e.firstBar()&&this._lastBar===e.lastBar()}static compare(e,t){return null===e||null===t?e===t:e.equals(t)}}},42989:(e,t,i)=>{"use strict";i.d(t,{allChartStyles:()=>n});var s=i(56570);function n(){return function(){const e=[0,1,9,13,2,14,15,3,16,10];return s.enabled("chart_style_hilo")&&e.push(12),e}().concat((s.enabled("japanese_chart_styles"),[8]))}},91920:(e,t,i)=>{"use strict";var s=i(68979).makeFont,n=i(68979).parseFont,o=i(9343).getLogger;const{drawPoly:r}=i(37743);var a=o("Model.ChartTradingUtils"),l={_fontHeightCache:{},_parsedColorCache:{},_parseColor:function(e){if(this._parsedColorCache[e])return this._parsedColorCache[e];var t=document.createElement("div");t.style.color=e;var i=t.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||t.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d*\.?\d+)\s*\)$/i),s={r:i[1],g:i[2],b:i[3],a:i[4]||"1"};return this._parsedColorCache[e]=s,s},getColorFromProperties:function(e,t){var i=1-t.value()/100,s=this._parseColor(e.value());return"rgba("+s.r+","+s.g+","+s.b+","+i+")"},setColorToProperties:function(e,t,i){var s=this._parseColor(e);t.setValue("rgb("+s.r+","+s.g+","+s.b+")");var n=100*(1-s.a);i.setValue(Math.max(0,Math.min(n,100)))},getFontFromProperties:function(e,t,i,n){return s(t.value(),e.value(),n.value()?"italic":"",i.value()?"bold":"")},setFontToProperties:function(e,t,i,s,o){var r=n(e);null!==r?(r.family.length>0&&t.setValue(r.family),i.setValue(r.size),s.setValue(r.bold),o.setValue(r.italic)):a.logError("Invalid font: "+e)},fontHeight:function(e){if(!this._fontHeightCache[e]){var t=document.createElement("span");t.appendChild(document.createTextNode("height")),document.body.appendChild(t),t.style.cssText="font: "+e+"; white-space: nowrap; display: inline;";var i=t.offsetHeight;document.body.removeChild(t),this._fontHeightCache[e]=Math.ceil(i)}return this._fontHeightCache[e]},drawPolyHoverOrPress:function(e,t,i,s){s?(e.save(),e.fillStyle="rgba(0, 0, 0, 0.15)",r(e,t,!0),e.restore()):i&&(e.save(),e.fillStyle="rgba(0, 0, 0, 0.1)",r(e,t,!0),e.restore())},repaint:function(e){e.lightUpdate()},roundToMinTick:function(e,t){var i=1/e.mainSource().base();return i*Math.round(t/i)}};e.exports=l},46088:(e,t,i)=>{"use strict";var s;i.d(t,{ColorType:()=>s}),function(e){e.Solid="solid",e.Gradient="gradient"}(s||(s={}))},50788:(e,t,i)=>{"use strict";i.d(t,{actualCurrencyUnitVisibility:()=>h,currencyUnitVisibilityOptions:()=>l,currencyUnitVisibilityProperty:()=>a,migrateShowCurrencyAndShowUnitProperties:()=>u,restoreCurrencyUnitVisibilitySettingsValue:()=>c});var s,n=i(17656),o=i(56840),r=i.n(o);!function(e){e.SettingsKey="PriceAxisCurrencyAndUnit.visibility"}(s||(s={}));const{property:a,availableValues:l,restoreDefaultValue:c,actualBehavior:h}=(0,n.createVisibilityController)("PriceAxisCurrencyAndUnit.visibility");let d=!1;function u(e,t){d||(d=!0,void 0===r().getValue("PriceAxisCurrencyAndUnit.visibility")&&a().setValue(e||t?"alwaysOn":"alwaysOff"))}},28120:(e,t,i)=>{"use strict";i.d(t,{CustomSourceBase:()=>s})
;class s{constructor(e,t){this._id=e,this._model=t}id(){return this._id}isHoveredEnabled(){return!0}isSelectionEnabled(){return!1}priceScale(){return null}paneViews(e){return[]}labelPaneViews(e){return[]}priceAxisViews(e,t){return[]}updateViewsForPane(e,t){e.containsMainSeries()&&this.updateAllViews(t)}}},36915:(e,t,i)=>{"use strict";i.d(t,{isLineToolState:()=>r,isMainSeriesState:()=>n,isStudyLineToolState:()=>a,isStudyState:()=>o});var s=i(15764);function n(e){return"MainSeries"===e.type}function o(e){return Boolean(e.type)&&e.type.toLowerCase().startsWith("study")}function r(e){return Boolean(e.type)&&(0,s.isLineToolName)(e.type)}function a(e){return Boolean(e.type)&&(0,s.isStudyLineToolName)(e.type)}},29137:(e,t,i)=>{"use strict";i.d(t,{DataSource:()=>d,getTranslatedStringForSource:()=>c,toInputDisplayFlags:()=>h});var s=i(45126),n=i(19466),o=i(92184),r=i(52033),a=i(64147),l=i(65383);function c(e,t){return new s.TranslatedString(t.name(),t.title(e))}function h(e){switch(e){case n.TitleDisplayTarget.DataWindow:return l.InputDisplayFlags.DataWindow;case n.TitleDisplayTarget.StatusLine:case n.TitleDisplayTarget.Alerts:return l.InputDisplayFlags.StatusLine}}class d{constructor(e){this.isSeries=!1,this._isDestroyed=!1,this._hasAlert=new a.WatchedValue(!1),this._alertStatus=new a.WatchedValue(0),this._alertCreationAvailable=new a.WatchedValue(!1),this._zorder=0,this._priceScale=null,this._ownerSource=null,this._userEditEnabled=!0,this._priceScaleChanged=new r.Delegate,this._isSelectionEnabled=!0,this._instanceId=(0,o.randomHashN)(6),this._ownerSourceChanged=new r.Delegate,this._zOrderChanged=new r.Delegate,this._id=new a.WatchedValue(e??(0,o.randomHashN)(6))}destroy(){this._isDestroyed=!0}id(){return this._id.value()}idWV(){return this._id.readonly()}instanceId(){return this._instanceId}preferNoScale(){return!1}setId(e){this._id.setValue(e)}zorder(){return this._zorder}setZorder(e){"number"==typeof e&&this._zorder!==e&&(this._zorder=e,this._zOrderChanged.fire(e))}preferredZOrder(){return null}isSpeciallyZOrderedSource(){return!1}title(e){return this.name()}priceScale(){return this._priceScale}hasPriceScale(){return null!==this._priceScale}setPriceScale(e){this._priceScale!==e&&(this._priceScale=e,this._priceScaleChanged.fire(e))}priceScaleChanged(){return this._priceScaleChanged}ownerSource(){return this._ownerSource}setOwnerSource(e){const t=this._ownerSource;this._ownerSource=e,this._ownerSourceChanged.fire(t,e)}ownerSourceChanged(){return this._ownerSourceChanged}zOrderChanged(){return this._zOrderChanged}isSavedInChart(e){return!0}isSavedInStudyTemplates(){return!0}isRemovedByStudyTemplates(){return!0}hasContextMenu(){return!0}showInObjectTree(){return!0}setUserEditEnabled(e){this._userEditEnabled=e}userEditEnabled(){return this._userEditEnabled}canBeHidden(){return this.userEditEnabled()}isUserDeletable(){return this.userEditEnabled()}properties(){return null}propertyByPath(e){const t=e.split(".");if(t.length<1)throw new Error("Invalid path");const i=t[0];if("properties"===i){const e=this.properties()
;return 1===t.length?e:e.childByPath(t.slice(1).join("."))}throw new Error(`Unknown property root: ${i}`)}isVisible(){return this.properties().visible.value()}dataWindowView(){return null}priceAxisViews(e,t){return null}timeAxisViews(){return null}updateAllViews(e){}paneViews(e){return null}labelPaneViews(e){return null}isFailed(){return!1}isLoading(){return!1}isPhantom(){return!1}isChildStudy(){return!1}hasChildren(){return!1}canHaveChildren(){return!1}onClickOutside(e,t){}getSourceIcon(){return null}state(e){return null}doesMovingAffectsUndo(){return!0}isMultiPaneAvailable(){return!1}isMultiPaneEnabled(){return!1}copiable(){return!1}cloneable(){return!1}movable(){return!1}allowsMovingBetweenPanes(){return!0}isIncludedInAutoScale(){return!1}isHoveredEnabled(){return this.isSelectionEnabled()}showOnTopOnHovering(){return!0}isSelectionEnabled(){return this._isSelectionEnabled}setSelectionEnabled(e){this._isSelectionEnabled=e}firstValue(){return null}priceRange(e,t,i){return null}autoScaleInfo(e,t,i){return{range:this.priceRange(e,t,i)}}stateForAlert(){return null}canHasAlert(){return!1}canHasAlertOnLineTools(){return!1}hasAlert(){return this._hasAlert.readonly()}alertCreationAvailable(){return this._alertCreationAvailable.readonly()}hasStateForAlert(){return!1}idForAlert(){return this._id.value()}alertStatus(){return this._alertStatus.readonly()}_getAlertCreationAvailable(){return!1}_updateAlertCreationAvailable(){0}}},7576:(e,t,i)=>{"use strict";i.d(t,{DataWindowItem:()=>s,DataWindowView:()=>n});class s{constructor(e,t,i,s=!1){this._visible=!0,this._id=e,this._title=t,this._value=i,this._unimportant=s}id(){return this._id}title(){return this._title}setTitle(e){this._title=e}text(){return this._value}value(){return this._value}setValue(e){this._value=e}visible(){return this._visible}setVisible(e){this._visible=e}color(){return this._color}setColor(e){this._color=e}unimportant(){return this._unimportant}}class n{constructor(){this._items=[],this._header="",this._title=""}header(){return this._header}title(){return this._title}items(){return this._items}canShowItems(){return!0}update(e){}}},63829:(e,t,i)=>{"use strict";i.d(t,{dateFormatProperty:()=>l,restoreDateFormatSettingsValue:()=>c});var s=i(56840),n=i(17625),o=i(47462);const r="date_format";function a(){return s.getValue(r,(0,o.defaultDateFormat)())}const l=(0,n.createPrimitiveProperty)(a());function c(){l.setValue((0,o.defaultDateFormat)()),s.remove(r)}s.onSync.subscribe(null,(()=>l.setValue(a()))),l.subscribe(null,(()=>s.setValue(r,l.value())))},32679:(e,t,i)=>{"use strict";i.d(t,{DefaultProperty:()=>q,allowSavingDefaults:()=>R,createDefaultsState:()=>B,extractAllPropertiesKeys:()=>N,extractState:()=>F,extractThemedColors:()=>W});var s,n=i(90054),o=i(16738),r=i(81960),a=i(54029),l=i(47339),c=i(39852),h=i(50279),d=i(15943),u=i(82433),_=i(83873),p=i(50151),m=i(24377),g=i(9343);function f(e){return e<0&&(e+=2*Math.PI),e}!function(e){e[e.Pow25In7=6103515625]="Pow25In7",e[e.LWeight=1]="LWeight",e[e.CWeight=1]="CWeight",e[e.HWeight=1]="HWeight"}(s||(s={}))
;const y=[127,127,127];function v(e){const t=e[3],i=e.slice(0,3);for(let e=0;e<3;e++)i[e]=Math.round(i[e]*t+y[e]*(1-t));return i}function S(e,t){const i=function(e,t){const[i,s,n]=e,[o,r,a]=t,l=(Math.sqrt(s**2+n**2)+Math.sqrt(r**2+a**2))/2,c=.5*(1-Math.sqrt(Math.pow(l,7)/(Math.pow(l,7)+6103515625))),h=(1+c)*s,d=(1+c)*r,u=Math.sqrt(h*h+n*n),_=Math.sqrt(d*d+a*a),p=0===n&&0===h?0:f(Math.atan2(n,h)),m=0===a&&0===d?0:f(Math.atan2(a,d)),g=o-i,y=_-u;let v;const S=u*_;0===S?v=0:(v=m-p,v<-Math.PI?v+=2*Math.PI:v>Math.PI&&(v-=2*Math.PI));const b=2*Math.sqrt(S)*Math.sin(v/2),w=(i+o)/2,C=(u+_)/2;let P;const T=p+m;P=u*_==0?T:Math.abs(p-m)<=Math.PI?T/2:T<2*Math.PI?(T+2*Math.PI)/2:(T-2*Math.PI)/2;const x=1-.17*Math.cos(P-Math.PI/6)+.24*Math.cos(2*P)+.32*Math.cos(3*P+Math.PI/30)-.2*Math.cos(4*P-Math.PI/180*63),I=Math.PI/6*Math.exp(-Math.pow((P-Math.PI/180*275)/(Math.PI/180*25),2)),M=2*Math.sqrt(Math.pow(C,7)/(Math.pow(C,7)+6103515625)),A=1+.015*Math.pow(w-50,2)/Math.sqrt(20+Math.pow(w-50,2)),L=1+.045*C,k=1+.015*C*x,D=-Math.sin(2*I)*M;return Math.sqrt(Math.pow(g/(1*A),2)+Math.pow(y/(1*L),2)+Math.pow(b/(1*k),2)+D*(y/(1*L))*(b/(1*k)))}(C(b(v((0,m.parseRgba)(e)))),C(b(v((0,m.parseRgba)(t)))));return i<3}function b(e){const[t,i,s]=e,n=t/255,o=i/255,r=s/255,a=100*(n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92),l=100*(o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92),c=100*(r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92);return[.4124*a+.3576*l+.1805*c,.2126*a+.7152*l+.0722*c,.0193*a+.1192*l+.9505*c]}var w;function C(e){const[t,i,s]=e,n=t/95.047,o=i/100,r=s/108.883,a=n>.008856?Math.pow(n,1/3):7.787*n+16/116,l=o>.008856?Math.pow(o,1/3):7.787*o+16/116;return[116*l-16,500*(a-l),200*(l-(r>.008856?Math.pow(r,1/3):7.787*r+16/116))]}!function(e){e[e.X=95.047]="X",e[e.Y=100]="Y",e[e.Z=108.883]="Z"}(w||(w={}));var P=i(24633),T=i(45345),x=i(85662),I=i(52033),M=i(72595),A=i(35039),L=i(12988);const k=(0,g.getLogger)("ThemedDefaults");function D(e){return e.value()===P.StdTheme.Dark?P.StdTheme.Dark:P.StdTheme.Light}function E(e,t,i){for(const s of t)if((0,r.default)(e,s),i){const t=s.split(".");for(t.pop();t.length;){const i=(0,a.default)(e,t);if(!(0,u.default)(i)||0!==Object.keys(i).length)break;(0,r.default)(e,t),t.pop()}}}function B(e,t,i,s){const r=e?A.defaults:A.factoryDefaults,a=t.startsWith("study_")?(0,n.default)(r("study")):{};let l=(0,n.default)(r(t,s));return t.startsWith("study_")&&l.inputs&&delete l.inputs.symbol,"linetoolicon"===t&&e&&(l.icon=(0,A.defaults)(t).icon),"linetooemoji"===t&&e&&(l.emoji=(0,A.defaults)(t).emoji),"linetoolsticker"===t&&e&&(l.sticker=(0,A.defaults)(t).sticker),l=(0,n.default)(l),E(l,i),(0,o.default)(a,l),a}let V=!1;function R(e){V=e}function N(e){const t=Object.keys(e),i=[];return t.forEach((t=>{const s=e[t];if((0,u.default)(s)){N(s).forEach((e=>i.push(`${t}.${e}`)))}else i.push(t)})),i}function O(e,t,i=""){if(1===t.length&&"*"===t[0])return e;const s={};for(const n of t){const o=n.split("."),r=o[0],a=e[r],l=""===i?r:`${i}.${r}`;if(e.hasOwnProperty(r))if(o.length>1){if(!(0,u.default)(a)){
k.logError(`path ${l} must be an object, but it is a primitive`);continue}{const e=t.filter((e=>e.startsWith(`${r}.`))).map((e=>e.split(".").slice(1).join(".")));s[r]=O(a,e,l)}}else{if((0,u.default)(a)){k.logError(`path ${l} must be a primitive, but it is an object`);continue}s[r]=a}}return s}function F(e,t,i){if(!e)return{};let s=e;return t&&(s=O(e,t)),i&&E(s,i,!0),s}function W(e,t){const i=N(e),s=[];for(const n of i){const i=(0,a.default)(e,n),o=(0,a.default)(t,n);(0,p.assert)(void 0!==i,`Light theme value for ${n} is undefined`),(0,p.assert)(void 0!==o,`Dark theme value for ${n} is undefined`),s.push({path:n,colors:[i,o]})}return s}function H(e,t){e.includes(t)||e.push(t)}function z(e,t){const i=e.indexOf(t);-1!==i&&e.splice(i,1)}function U(e,t){const i=(0,c.default)(e,((e,i,s)=>{if(void 0===t[s])return e;if(!(0,h.default)(i,t[s]))if((0,u.default)(i)&&(0,u.default)(t[s])){const n=U(i,t[s]);void 0!==n&&(e[s]=n)}else e[s]=i;return e}),{});return(0,d.default)(i)?void 0:i}function j(e){return e===P.StdTheme.Dark?1:0}function G(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(!(0,_.default)(e)||!(0,_.default)(t))return!1;const i=(0,m.tryParseRgba)(e),s=(0,m.tryParseRgba)(t);return!(!i||!s)&&!!S(e,t)}class q extends L.Property{constructor(e){const{defaultName:t,nonThemedDefaultsKeys:i,themedDefaultsKeys:s,excludedDefaultsKeys:n=[],themedColors:r,replaceThemedColorsOnThemeChange:a=!1,allStateKeys:l,excludedStateKeys:c=[],excludedTemplateKeys:h=[],state:d,useUserPreferences:u=!0,saveNonDefaultUserPreferencesOnly:_=!1,ignoreAllowSavingDefaults:m=!1,alwaysSaveDefaultKeys:g=["version"],saveDefaultsConsumer:f=A.saveDefaults,factoryDefaultsSupplier:y=()=>B(!1,t,[],null),schema:v=(0,M.createPropertySchema)(y()),theme:S=T.watchedTheme.spawnOwnership()}=e;super(void 0,v),this._themedColors=[],this._restoreFactoryDefaultsEvent=new I.Delegate,this._replaceThemedColorsOnThemeChange=!1,this._forbidSavingDefaults=!1,this._defaultName=t,this._useUserPreferences=u,this._saveNonDefaultUserPreferencesOnly=_,this._ignoreAllowSavingDefaults=m,this._saveDefaultsConsumer=f,this._factoryDefaultsSupplier=y,this._allStateKeys=l,this._excludedStateKeys=c,this._nonThemedDefaultsKeys=i,this._themedDefaultsKeys=s,this._allDefaultsKeys=i||s?[...i??[],...s??[]]:void 0,this._excludedDefaultsKeys=n,this._excludedTemplateKeys=h,this._themedColors=r,this._alwaysSaveDefaultKeys=g,(0,p.assert)(void 0===this._allDefaultsKeys||0===this._excludedDefaultsKeys.length,"Defaults keys and excluded defaults keys cannot be used at the same time"),(0,p.assert)(void 0===this._allStateKeys||0===this._excludedStateKeys.length,"State keys and excluded state keys cannot be used at the same time"),this._theme=S;const b=D(this._theme);this.merge((0,o.default)(this._factoryDefaultsForTheme((0,x.isStdThemeName)(b)?b:P.StdTheme.Light),this._userSettings(),F(d,l,c))),r&&a&&this.setThemedColors(r),this._restoreFactoryDefaultsEvent=new I.Delegate}destroy(){this._theme?.release(),this._unsubscribeWatchedTheme?.(),super.destroy()}applyTemplate(e,t){this.mergeAndFire(F((0,
o.default)((0,n.default)(t),e),this._allStateKeys,this._excludedTemplateKeys))}preferences(){return F(this.state(this._excludedDefaultsKeys),this._allDefaultsKeys)}template(){return F(this.state(),void 0,this._excludedTemplateKeys)}mergePreferences(e){this.mergeAndFire(F(e,this._allDefaultsKeys,this._excludedDefaultsKeys))}addExcludedKey(e,t){1&t&&H(this._excludedDefaultsKeys,e),2&t&&H(this._excludedStateKeys,e),4&t&&H(this._excludedTemplateKeys,e)}removeExcludedKey(e,t){1&t&&z(this._excludedDefaultsKeys,e),2&t&&z(this._excludedStateKeys,e)}restoreFactoryDefaults(){const e=this.factoryDefaults();E(e,this._excludedDefaultsKeys),this.mergeAndFire(e),this._defaultName.startsWith("study_")&&!this._defaultName.startsWith("study_VbPFixed")||this.saveDefaults(),this._restoreFactoryDefaultsEvent.fire()}onRestoreFactoryDefaults(){return this._restoreFactoryDefaultsEvent}saveDefaults(){if(!this._useUserPreferences||this._forbidSavingDefaults)return;let e;if(this._saveNonDefaultUserPreferencesOnly){const t=this.state(this._excludedDefaultsKeys),i=this.factoryDefaults();if(e=U(F(t,this._nonThemedDefaultsKeys),F(i,this._nonThemedDefaultsKeys,this._excludedDefaultsKeys)),this._alwaysSaveDefaultKeys.length){const i=F(t,this._alwaysSaveDefaultKeys);e=e??{},(0,o.default)(e,i)}const s=this.themeDefaults(D(this._theme)),n=this.themeState(),r=U(n,s);(0,d.default)(r)||(e=e??{},(0,o.default)(e,n))}else e=this.preferences();this._saveDefaultsConsumer(this._defaultName,e)}themeDefaults(e){if(this._themedColors)return function(e,t){const i={};for(const{path:s,colors:n}of e)(0,l.default)(i,s,n[j(t)]);return i}(this._themedColors,e===P.StdTheme.Dark?P.StdTheme.Dark:P.StdTheme.Light);return F(this._factoryDefaultsSupplier(),this._themedDefaultsKeys,this._excludedDefaultsKeys)}factoryDefaults(){return this._factoryDefaultsForTheme(D(this._theme))}themeState(){const e=super.state(this._excludedDefaultsKeys),t=this._themedColors;return F(e,t?t.map((e=>e.path)):this._themedDefaultsKeys)}allThemePropertiesAreDefault(e){(0,p.assert)(!!this._themedColors,"This method should not be called if themed colors are not set");return function(e,t,i=[]){for(const s of i){const i=s.path;if(!G((0,a.default)(e,i),(0,a.default)(t,i)))return!1}return!0}(this.themeState(),this.themeDefaults(e),this._themedColors)}clone(e){return new q(this._options())}setThemedColors(e){if(this._themedColors=e,void 0===this._unsubscribeWatchedTheme){const e=()=>{this._updateThemedColors(!1)};this._theme.subscribe(e),this._unsubscribeWatchedTheme=()=>this._theme.unsubscribe(e)}this._updateThemedColors(!0)}applyDefaultThemedProperties(e){this._themedColors&&this.mergeAndFire(this.themeDefaults(e))}state(e,t){return F(super.state([...this._excludedStateKeys,...e??[]],t),this._allStateKeys)}_updateThemedColors(e){if(!this._themedColors)return;const t=D(this._theme),i=t===P.StdTheme.Light?P.StdTheme.Dark:P.StdTheme.Light;for(const s of this._themedColors){const n=(0,p.ensureDefined)(this.childByPath(s.path)),o=s.colors[j(i)];(""===n.value()||!e&&G(n.value(),o))&&n.setValue(s.colors[j(t)])
}}_userSettings(){if(!this._useUserPreferences)return;const e=B(!0,this._defaultName,[],null);return e?F((0,n.default)(e),this._allDefaultsKeys,this._excludedDefaultsKeys):void 0}_options(){return{defaultName:this._defaultName,factoryDefaultsSupplier:this._factoryDefaultsSupplier,state:this.state(),nonThemedDefaultsKeys:this._nonThemedDefaultsKeys,themedDefaultsKeys:this._themedDefaultsKeys,excludedDefaultsKeys:this._excludedDefaultsKeys,themedColors:this._themedColors,replaceThemedColorsOnThemeChange:this._replaceThemedColorsOnThemeChange,allStateKeys:this._allStateKeys,excludedStateKeys:this._excludedDefaultsKeys,excludedTemplateKeys:this._excludedTemplateKeys,useUserPreferences:this._useUserPreferences,saveNonDefaultUserPreferencesOnly:this._saveNonDefaultUserPreferencesOnly,ignoreAllowSavingDefaults:this._ignoreAllowSavingDefaults,saveDefaultsConsumer:this._saveDefaultsConsumer,alwaysSaveDefaultKeys:this._alwaysSaveDefaultKeys,theme:this._theme.spawnOwnership()}}_childChanged(e,t){super._childChanged(e,t),this._propertyAffectsDefaults(t)&&this.saveDefaults()}_fireMergeAndFireChangedProps(e){this._forbidSavingDefaults=!0,super._fireMergeAndFireChangedProps(e),this._forbidSavingDefaults=!1,e.some((e=>this._propertyAffectsDefaults(e.pathToRootProperty())))&&this.saveDefaults()}_factoryDefaultsForTheme(e){return(0,o.default)(this._factoryDefaultsSupplier(),this.themeDefaults(e))}_propertyAffectsDefaults(e){return(this._ignoreAllowSavingDefaults||V)&&!this._defaultName.startsWith("replayStudyStrategy")&&(!this._defaultName.startsWith("study_")||this._defaultName.startsWith("study_VbPFixed"))&&(this._allDefaultsKeys&&this._allDefaultsKeys.includes(e)||!this._allDefaultsKeys&&!this._excludedDefaultsKeys?.includes(e))&&(0,L.isPrimitiveType)(this.childByPath(e)?.value())}}},35039:(e,t,i)=>{"use strict";var s=i(80720).PlDisplay;const{generateColor:n}=i(19063),o=i(49156).colors;var r=i(80720).TradedGroupHorizontalAlignment,a=i(5171),l=i(96333).LineToolPitchforkStyle,c=i(67467).LineToolBarsPatternMode,h=i(94113),d=h.LineStudyPlotStyle,u=h.STUDYPLOTDISPLAYTARGET,_=i(55158),p=i(94164).PriceAxisLastValueMode,m=i(92693).MagnetMode,g=i(49857).LineEnd,f=i(46088).ColorType;const y=i(35578).DEFAULT_LINE_TOOL_LINE_WIDTH;var v=i(39429).StatsPosition,S=i(6290).sessionsPreferencesDefault,b=i(57596).axisLabelBackgroundColor,w=i(9624).mainSeriesProperties;const{LINESTYLE_SOLID:C,LINESTYLE_DASHED:P}=i(51056);var T=i(9343).getLogger("Chart.Defaults")
;const{colorWhite:x,colorWhiteAlpha25:I,colorTvBlue50:M,colorTvBlue500:A,colorTvBlue500Alpha30:L,colorTvBlue500Alpha25:k,colorTvBlue500Alpha20:D,colorTvBlue600:E,colorDeepBlue200:B,colorDeepBlue300:V,colorDeepBlue500:R,colorDeepBlue500Alpha20:N,colorSkyBlue500:O,colorSkyBlue500Alpha20:F,colorSkyBlue700:W,colorSkyBlue700Alpha70:H,colorDefaultRed:z,colorRipeRed200:U,colorRipeRed300:j,colorRipeRed400:G,colorRipeRed400Alpha5:q,colorRipeRed500:$,colorRipeRed500Alpha30:K,colorRipeRed500Alpha20:Y,colorRipeRed600:Z,colorGrapesPurple500:X,colorGrapesPurple500Alpha0:J,colorGrapesPurple500Alpha20:Q,colorGrapesPurple500Alpha70:ee,colorBerryPink400:te,colorBerryPink500:ie,colorBerryPink500Alpha20:se,colorMintyGreen100:ne,colorMintyGreen400:oe,colorMintyGreen500:re,colorMintyGreen500Alpha20:ae,colorIguanaGreen300:le,colorIguanaGreen500:ce,colorIguanaGreen500Alpha20:he,colorTanOrange300:de,colorTanOrange500:ue,colorTanOrange500Alpha20:_e,colorTanOrange600:pe,colorTanOrange700:me,colorColdGray150:ge,colorColdGray400:fe,colorColdGray450:ye,colorColdGray500:ve,colorColdGray900:Se,colorColdGray750:be,colorForestGreen300:we,colorForestGreen300Alpha5:Ce}=o;var Pe=function(e){var t=function(e,t){return{color:e,visible:t}},i=function(e,t,i,s){const n={coeff:e,color:t,visible:i};return s&&(n.text=""),n},h=function(e,t,i,s,n){return{coeff:e,color:t,visible:i,linestyle:void 0===s?C:s,linewidth:void 0===n?y:n}},T=function(e,t,i){return{color:e,width:void 0===i?y:i,visible:t}},Pe=function(e,t,i,s,n){return{color:e,visible:t,width:i,x:s,y:n}},Te=function(e,t,i,s,n,o){return{coeff1:e,coeff2:t,color:i,visible:s,linestyle:void 0===n?C:n,linewidth:void 0===o?y:o}};if(void 0===TradingView.defaultProperties){var Ie;switch(window.locale){case"ar_AE":Ie="Asia/Dubai";break;case"au":Ie="Australia/Sydney";break;case"br":Ie="America/Sao_Paulo";break;case"ca":Ie="America/Toronto";break;case"de_DE":case"it":Ie="Europe/Berlin";break;case"es":Ie="Europe/Madrid";break;case"he_IL":case"tr":Ie="Europe/Athens";break;case"hu_HU":case"pl":Ie="Europe/Warsaw";break;case"id":case"th_TH":case"vi_VN":Ie="Asia/Bangkok";break;case"in":Ie="Asia/Kolkata";break;case"ja":case"kr":Ie="Asia/Tokyo";break;case"ms_MY":Ie="Asia/Singapore";break;case"ru":Ie="Europe/Moscow";break;case"uk":Ie="Europe/London";break;case"zh_CN":case"zh_TW":Ie="Asia/Shanghai";break;default:Ie="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:Ie,priceScaleSelectionStrategyName:"auto",paneProperties:{backgroundType:f.Solid,gridLinesMode:"both",vertGridProperties:{style:C},horzGridProperties:{style:C},crossHairProperties:{style:P,transparency:0,width:1},topMargin:10,bottomMargin:8,axisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,indexedTo100:!1,log:!1,logDisabled:!1,alignLabels:!0,isInverted:!1},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0,showLastDayChange:!1,showBarChange:!0,showVolume:!1,showBackground:!0,showPriceSource:!0,backgroundTransparency:50,
showLogo:!0,showTradingButtons:!0,showTradingButtonsMobile:!0},separatorColor:ge},scalesProperties:{fontSize:12,scaleSeriesOnly:!1,showSeriesLastValue:!0,seriesLastValueMode:p.LastValueAccordingToScale,showSeriesPrevCloseValue:!1,showStudyLastValue:!0,showSymbolLabels:!1,showStudyPlotLabels:!1,showBidAskLabels:!1,showPrePostMarketPriceLabel:!0,showFundamentalNameLabel:!1,showFundamentalLastValue:!0,barSpacing:_.DEFAULT_BAR_SPACING,axisHighlightColor:k,axisLineToolLabelBackgroundColorCommon:b.common,axisLineToolLabelBackgroundColorActive:b.active,showPriceScaleCrosshairLabel:!0,showTimeScaleCrosshairLabel:!0,crosshairLabelBgColorLight:Se,crosshairLabelBgColorDark:be,saveLeftEdge:!1},mainSeriesProperties:w,chartEventsSourceProperties:{visible:!0,futureOnly:!0,breaks:{color:"#555555",visible:!1,style:P,width:1}},tradingProperties:{showPositions:!0,positionPL:{visibility:!0,display:s.Money},bracketsPL:{visibility:!0,display:s.Money},showOrders:!0,showExecutions:!0,showExecutionsLabels:!1,showReverse:!0,horizontalAlignment:r.Right,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:C},volumePaneSize:"large"},sessions:S,drawings:{magnet:!1,magnetMode:m.WeakMagnet,stayInDrawingMode:!1,drawOnAllCharts:!0,drawOnAllChartsMode:1},linetoolorder:{extendLeft:"inherit",lineLength:"inherit",lineLengthUnit:"percentage",lineColor:z,lineActiveBuyColor:"#4094e8",lineInactiveBuyColor:"rgba(64, 148, 232, 0.5)",lineActiveSellColor:"#e75656",lineInactiveSellColor:"rgba(231, 86, 86, 0.5)",lineStyle:"inherit",lineWidth:"inherit",bodyBorderActiveBuyColor:"#4094e8",bodyBorderInactiveBuyColor:"rgba(64, 148, 232, 0.5)",bodyBorderActiveSellColor:"#e75656",bodyBorderInactiveSellColor:"rgba(231, 86, 86, 0.5)",bodyBackgroundColor:I,bodyBackgroundTransparency:25,bodyTextInactiveLimitColor:"rgba(38, 140, 2, 0.5)",bodyTextActiveLimitColor:"#268c02",bodyTextInactiveStopColor:"rgba(231, 86, 86, 0.5)",bodyTextActiveStopColor:"#e75656",bodyTextInactiveBuyColor:"rgba(64, 148, 232, 0.5)",bodyTextActiveBuyColor:"#4094e8",bodyTextInactiveSellColor:"rgba(231, 86, 86, 0.5)",bodyTextActiveSellColor:"#e75656",bodyFontFamily:"Verdana",bodyFontSize:9,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderActiveBuyColor:"#4094e8",quantityBorderInactiveBuyColor:"rgba(64, 148, 232, 0.5)",quantityBorderActiveSellColor:"#e75656",quantityBorderInactiveSellColor:"rgba(231, 86, 86, 0.5)",quantityBackgroundInactiveBuyColor:"rgba(64, 148, 232, 0.5)",quantityBackgroundActiveBuyColor:"#4094e8",quantityBackgroundInactiveSellColor:"rgba(231, 86, 86, 0.5)",quantityBackgroundActiveSellColor:"#e75656",quantityTextColor:x,quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:9,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderActiveBuyColor:"#4094e8",cancelButtonBorderInactiveBuyColor:"rgba(64, 148, 232, 0.5)",cancelButtonBorderActiveSellColor:"#e75656",cancelButtonBorderInactiveSellColor:"rgba(231, 86, 86, 0.5)",cancelButtonBackgroundColor:I,cancelButtonBackgroundTransparency:25,cancelButtonIconActiveBuyColor:"#4094e8",
cancelButtonIconInactiveBuyColor:"rgba(64, 148, 232, 0.5)",cancelButtonIconActiveSellColor:"#e75656",cancelButtonIconInactiveSellColor:"rgba(231, 86, 86, 0.5)",tooltip:"",modifyTooltip:"",cancelTooltip:""},linetoolposition:{extendLeft:"inherit",lineLength:"inherit",lineLengthUnit:"percentage",lineBuyColor:"#4094e8",lineSellColor:"#e75656",lineStyle:"inherit",lineWidth:"inherit",bodyBorderBuyColor:"#4094e8",bodyBorderSellColor:"#e75656",bodyBackgroundColor:I,bodyBackgroundTransparency:25,bodyTextPositiveColor:"#268c02",bodyTextNeutralColor:"#646464",bodyTextNegativeColor:"#e75656",bodyFontFamily:"Verdana",bodyFontSize:9,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderBuyColor:"#4094e8",quantityBorderSellColor:"#e75656",quantityBackgroundBuyColor:"#4094e8",quantityBackgroundSellColor:"#e75656",quantityTextColor:x,quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:9,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderBuyColor:"#4094e8",reverseButtonBorderSellColor:"#e75656",reverseButtonBackgroundColor:I,reverseButtonBackgroundTransparency:25,reverseButtonIconBuyColor:"#4094e8",reverseButtonIconSellColor:"#e75656",closeButtonBorderBuyColor:"#4094e8",closeButtonBorderSellColor:"#e75656",closeButtonBackgroundColor:I,closeButtonBackgroundTransparency:25,closeButtonIconBuyColor:"#4094e8",closeButtonIconSellColor:"#e75656",tooltip:"",protectTooltip:"",closeTooltip:"",reverseTooltip:""},linetoolexecution:{direction:"buy",arrowHeight:8,arrowSpacing:1,arrowBuyColor:"#4094e8",arrowSellColor:"#e75656",text:"",textColor:o.colorBlack,textTransparency:0,fontFamily:"Verdana",fontSize:10,fontBold:!1,fontItalic:!1,tooltip:""},linetoolicon:{color:A,size:40,icon:61720,angle:.5*Math.PI},linetoolemoji:{size:40,emoji:"😀",angle:.5*Math.PI},linetoolsticker:{size:110,sticker:"bitcoin",angle:.5*Math.PI},linetoolimage:{transparency:0,cssWidth:0,cssHeight:0,angle:0},linetoolbezierquadro:{linecolor:A,linewidth:y,fillBackground:!1,backgroundColor:D,transparency:50,linestyle:C,extendLeft:!1,extendRight:!1,leftEnd:g.Normal,rightEnd:g.Normal},linetoolbeziercubic:{linecolor:R,linewidth:y,fillBackground:!1,backgroundColor:N,transparency:80,linestyle:C,extendLeft:!1,extendRight:!1,leftEnd:g.Normal,rightEnd:g.Normal},linetooltrendline:{linecolor:A,linewidth:y,linestyle:C,extendLeft:!1,extendRight:!1,leftEnd:g.Normal,rightEnd:g.Normal,showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:A,fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceLabels:!1,showPriceRange:!1,showPercentPriceRange:!1,showPipsPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:v.Right},linetoolinfoline:{linecolor:A,linewidth:y,linestyle:C,extendLeft:!1,extendRight:!1,leftEnd:g.Normal,rightEnd:g.Normal,showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:A,fontsize:14,bold:!1,italic:!1,alwaysShowStats:!0,showMiddlePoint:!1,showPriceLabels:!1,showPriceRange:!0,showPercentPriceRange:!0,showPipsPriceRange:!0,showBarsRange:!0,showDateTimeRange:!0,
showDistance:!0,showAngle:!0,statsPosition:v.Center},linetooltimecycles:{linecolor:"#159980",linewidth:y,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:C},linetoolsineline:{linecolor:"#159980",linewidth:y,linestyle:C},linetooltrendangle:{linecolor:A,linewidth:y,linestyle:C,fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceLabels:!1,showPriceRange:!1,showPercentPriceRange:!1,showPipsPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1,statsPosition:v.Right},linetooldisjointangle:{linecolor:re,linewidth:y,linestyle:C,fillBackground:!0,backgroundColor:ae,transparency:20,extendLeft:!1,extendRight:!1,leftEnd:g.Normal,rightEnd:g.Normal,textcolor:re,fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1,labelVisible:!1,labelHorzAlign:"left",labelVertAlign:"bottom",labelTextColor:re,labelFontSize:14,labelBold:!1,labelItalic:!1},linetoolflatbottom:{linecolor:ue,linewidth:y,linestyle:C,fillBackground:!0,backgroundColor:_e,transparency:20,extendLeft:!1,extendRight:!1,leftEnd:g.Normal,rightEnd:g.Normal,textcolor:ue,fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1,labelVisible:!1,labelHorzAlign:"left",labelVertAlign:"bottom",labelTextColor:ue,labelFontSize:14,labelBold:!1,labelItalic:!1},linetoolriskrewardshort:{linecolor:ve,linewidth:1,textcolor:x,fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#585858",fillBackground:!0,stopBackground:Y,profitBackground:ae,stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"#667b8b",compact:!1,riskDisplayMode:"percents",accountSize:1e3,lotSize:1,risk:25,alwaysShowStats:!1,showPriceLabels:!0,currency:"NONE"},linetoolriskrewardlong:{linecolor:ve,linewidth:1,textcolor:x,fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"#585858",fillBackground:!0,stopBackground:Y,profitBackground:ae,stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"#667b8b",compact:!1,riskDisplayMode:"percents",accountSize:1e3,lotSize:1,risk:25,alwaysShowStats:!1,showPriceLabels:!0,currency:"NONE"},linetoolarrow:{linecolor:A,linewidth:y,linestyle:C,extendLeft:!1,extendRight:!1,leftEnd:g.Normal,rightEnd:g.Arrow,showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:A,fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceLabels:!1,showPriceRange:!1,showPercentPriceRange:!1,showPipsPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:v.Right},linetoolray:{linecolor:A,linewidth:y,linestyle:C,extendLeft:!1,extendRight:!0,leftEnd:g.Normal,rightEnd:g.Normal,showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:A,fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceLabels:!1,showPriceRange:!1,showPercentPriceRange:!1,showPipsPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:v.Right},linetoolextended:{linecolor:A,
linewidth:y,linestyle:C,extendLeft:!0,extendRight:!0,leftEnd:g.Normal,rightEnd:g.Normal,showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"bottom",textcolor:A,fontsize:14,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceLabels:!1,showPriceRange:!1,showPercentPriceRange:!1,showPipsPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1,statsPosition:v.Right},linetoolhorzline:{linecolor:A,linewidth:y,linestyle:C,showPrice:!0,showLabel:!1,textcolor:A,fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"middle"},linetoolhorzray:{linecolor:A,linewidth:y,linestyle:C,showPrice:!0,showLabel:!1,textcolor:A,fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{linecolor:A,linewidth:y,linestyle:C,extendLine:!0,showTime:!0,showLabel:!1,horzLabelsAlign:"center",vertLabelsAlign:"middle",textcolor:A,textOrientation:"vertical",fontsize:14,bold:!1,italic:!1},linetoolcrossline:{linecolor:A,linewidth:y,linestyle:C,showPrice:!0,showTime:!0},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",showLabels:!0,fillBackground:!1,transparency:80,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:P},level1:h(0,ve,!0),level2:h(1,A,!0),level3:h(2,A,!0),level4:h(3,A,!0),level5:h(5,A,!0),level6:h(8,A,!0),level7:h(13,A,!0),level8:h(21,A,!0),level9:h(34,A,!0),level10:h(55,A,!0),level11:h(89,A,!0)},linetooltext:{color:A,fontsize:14,fillBackground:!1,backgroundColor:"rgba(91, 133, 191, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"#667b8b",bold:!1,italic:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:200},linetooltextabsolute:{color:A,fontsize:14,fillBackground:!1,backgroundColor:"rgba(155, 190, 213, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"#667b8b",bold:!1,italic:!1,fixedSize:!1,wordWrap:!1,wordWrapWidth:200},linetoolballoon:{color:x,backgroundColor:ee,borderColor:J,fontsize:14,transparency:30},linetoolcomment:{color:x,backgroundColor:A,borderColor:A,fontsize:16,transparency:0},linetoolbrush:{linecolor:O,linewidth:y,smooth:5,fillBackground:!1,backgroundColor:O,transparency:50,leftEnd:g.Normal,rightEnd:g.Normal},linetoolhighlighter:{linecolor:Y,smooth:5,transparency:80,width:20},linetoolpolyline:{linecolor:O,linewidth:y,linestyle:C,fillBackground:!0,backgroundColor:F,transparency:80,filled:!1},linetoolsignpost:{emoji:"🙂",showImage:!1,plateColor:A,fontSize:12,bold:!1,italic:!1},linetoolpath:{lineColor:A,lineWidth:y,lineStyle:C,leftEnd:g.Normal,rightEnd:g.Arrow},linetoolarrowmarkleft:{color:A,arrowColor:A,fontsize:14,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkup:{color:re,arrowColor:re,fontsize:14,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkright:{color:A,arrowColor:A,fontsize:14,bold:!1,italic:!1,showLabel:!0},linetoolarrowmarkdown:{color:Z,arrowColor:Z,fontsize:14,bold:!1,italic:!1,showLabel:!0},linetoolflagmark:{flagColor:A},linetoolpricelabel:{color:x,backgroundColor:A,borderColor:A,fontWeight:"bold",fontsize:14,transparency:0},linetoolarrowmarker:{backgroundColor:E,textColor:E,
bold:!0,italic:!1,fontsize:16,showLabel:!0},linetoolrotatedrectangle:{color:ce,fillBackground:!0,backgroundColor:he,transparency:50,linewidth:y},linetoolcircle:{color:ue,backgroundColor:_e,fillBackground:!0,linewidth:y,showLabel:!1,textColor:ue,fontSize:14,bold:!1,italic:!1},linetoolellipse:{color:$,fillBackground:!0,backgroundColor:Y,transparency:50,linewidth:y,showLabel:!1,textColor:$,fontSize:14,bold:!1,italic:!1},linetoolarc:{color:ie,fillBackground:!0,backgroundColor:se,transparency:80,linewidth:y},linetoolprediction:{linecolor:A,linewidth:y,sourceBackColor:A,sourceTextColor:x,sourceStrokeColor:A,targetStrokeColor:A,targetBackColor:A,targetTextColor:x,successBackground:ce,successTextColor:x,failureBackground:$,failureTextColor:x,intermediateBackColor:"#ead289",intermediateTextColor:"#6d4d22",transparency:10,centersColor:"#202020"},linetooltriangle:{color:re,fillBackground:!0,backgroundColor:ae,transparency:80,linewidth:y},linetoolcallout:{color:x,backgroundColor:H,transparency:50,linewidth:y,fontsize:14,bordercolor:W,bold:!1,italic:!1,wordWrap:!1,wordWrapWidth:200},linetoolparallelchannel:{linecolor:A,linewidth:y,linestyle:C,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:D,transparency:20,showMidline:!0,midlinecolor:A,midlinewidth:1,midlinestyle:P,labelVisible:!1,labelHorzAlign:"left",labelVertAlign:"bottom",labelTextColor:A,labelFontSize:14,labelBold:!1,labelItalic:!1},linetoolelliottimpulse:{degree:7,showWave:!0,color:"#3d85c6",linewidth:y},linetoolelliotttriangle:{degree:7,showWave:!0,color:ue,linewidth:y},linetoolelliotttriplecombo:{degree:7,showWave:!0,color:"#6aa84f",linewidth:y},linetoolelliottcorrection:{degree:7,showWave:!0,color:"#3d85c6",linewidth:y},linetoolelliottdoublecombo:{degree:7,showWave:!0,color:"#6aa84f",linewidth:y},linetoolbarspattern:{color:A,mode:c.Bars,mirrored:!1,flipped:!1},linetoolghostfeed:{averageHL:20,variance:50,candleStyle:{upColor:ne,downColor:U,drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:re,borderDownColor:$,wickColor:ve},transparency:50},study:{inputs:{},styles:{},bands:{},graphics:{},ohlcPlots:{},palettes:{},filledAreasStyle:{},filledAreas:{},visible:!0,showLegendValues:!0,showLabelsOnPriceScale:!0,precision:"default"},linetoolpitchfork:{fillBackground:!0,transparency:80,style:l.Original,median:{visible:!0,color:$,linewidth:y,linestyle:C},extendLines:!1,level0:h(.25,de,!1),level1:h(.382,le,!1),level2:h(.5,re,!0),level3:h(.618,re,!1),level4:h(.75,O,!1),level5:h(1,A,!0),level6:h(1.5,X,!1),level7:h(1.75,ie,!1),level8:h(2,j,!1)},linetoolpitchfan:{fillBackground:!0,transparency:80,median:{visible:!0,color:$,linewidth:y,linestyle:C},level0:h(.25,de,!1),level1:h(.382,le,!1),level2:h(.5,O,!0),level3:h(.618,re,!1),level4:h(.75,O,!1),level5:h(1,A,!0),level6:h(1.5,X,!1),level7:h(1.75,ie,!1),level8:h(2,j,!1)},linetoolgannfan:{linewidth:y,showLabels:!0,fillBackground:!0,transparency:80,level1:Te(1,8,ue,!0),level2:Te(1,4,re,!0),level3:Te(1,3,ce,!0),level4:Te(1,2,re,!0),level5:Te(1,1,O,!0),level6:Te(2,1,A,!0),level7:Te(3,1,X,!0),level8:Te(4,1,ie,!0),
level9:Te(8,1,$,!0)},linetoolganncomplex:{fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,scaleRatio:"",showLabels:!0,labelsStyle:{fontSize:12,bold:!1,italic:!1},levels:[T(ve,!0),T(ue,!0),T(O,!0),T(ce,!0),T(re,!0),T(ve,!0)],fanlines:[Pe(B,!1,y,8,1),Pe($,!1,y,5,1),Pe(ve,!1,y,4,1),Pe(ue,!1,y,3,1),Pe(O,!0,y,2,1),Pe(ce,!0,y,1,1),Pe(re,!0,y,1,2),Pe(re,!1,y,1,3),Pe(A,!1,y,1,4),Pe(V,!1,y,1,5),Pe(B,!1,y,1,8)],arcs:[Pe(ue,!0,y,1,0),Pe(ue,!0,y,1,1),Pe(ue,!0,y,1.5,0),Pe(O,!0,y,2,0),Pe(O,!0,y,2,1),Pe(ce,!0,y,3,0),Pe(ce,!0,y,3,1),Pe(re,!0,y,4,0),Pe(re,!0,y,4,1),Pe(A,!0,y,5,0),Pe(A,!0,y,5,1)]},linetoolgannfixed:{fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,levels:[T(ve,!0),T(ue,!0),T(O,!0),T(ce,!0),T(re,!0),T(ve,!0)],fanlines:[Pe(B,!1,y,8,1),Pe($,!1,y,5,1),Pe(ve,!1,y,4,1),Pe(ue,!1,y,3,1),Pe(O,!0,y,2,1),Pe(ce,!0,y,1,1),Pe(re,!0,y,1,2),Pe(re,!1,y,1,3),Pe(A,!1,y,1,4),Pe(V,!1,y,1,5),Pe(B,!1,y,1,8)],arcs:[Pe(ue,!0,y,1,0),Pe(ue,!0,y,1,1),Pe(ue,!0,y,1.5,0),Pe(O,!0,y,2,0),Pe(O,!0,y,2,1),Pe(ce,!0,y,3,0),Pe(ce,!0,y,3,1),Pe(re,!0,y,4,0),Pe(re,!0,y,4,1),Pe(A,!0,y,5,0),Pe(A,!0,y,5,1)]},linetoolgannsquare:{color:"rgba(21, 56, 153, 0.8)",linewidth:y,linestyle:C,showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,reverse:!1,fans:t(fe,!1),hlevel1:i(0,ve,!0),hlevel2:i(.25,ue,!0),hlevel3:i(.382,O,!0),hlevel4:i(.5,ce,!0),hlevel5:i(.618,re,!0),hlevel6:i(.75,A,!0),hlevel7:i(1,ve,!0),vlevel1:i(0,ve,!0),vlevel2:i(.25,ue,!0),vlevel3:i(.382,O,!0),vlevel4:i(.5,ce,!0),vlevel5:i(.618,re,!0),vlevel6:i(.75,A,!0),vlevel7:i(1,ve,!0)},linetoolfibspeedresistancefan:{fillBackground:!0,transparency:80,grid:{color:"rgba(21, 56, 153, 0.8)",linewidth:1,linestyle:C,visible:!0},linewidth:y,linestyle:C,showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,reverse:!1,hlevel1:i(0,ve,!0),hlevel2:i(.25,ue,!0),hlevel3:i(.382,O,!0),hlevel4:i(.5,ce,!0),hlevel5:i(.618,re,!0),hlevel6:i(.75,A,!0),hlevel7:i(1,ve,!0),vlevel1:i(0,ve,!0),vlevel2:i(.25,ue,!0),vlevel3:i(.382,O,!0),vlevel4:i(.5,ce,!0),vlevel5:i(.618,re,!0),vlevel6:i(.75,A,!0),vlevel7:i(1,ve,!0)},linetoolfibretracement:{showCoeffs:!0,showPrices:!0,fillBackground:!0,transparency:80,extendLines:!1,extendLinesLeft:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",showText:!0,horzTextAlign:"center",vertTextAlign:"middle",reverse:!1,coeffsAsPercents:!1,fibLevelsBasedOnLogScale:!1,labelFontSize:12,trendline:{visible:!0,color:ve,linewidth:y,linestyle:P},levelsStyle:{linewidth:y,linestyle:C},level1:i(0,ve,!0,!0),level2:i(.236,$,!0,!0),level3:i(.382,ue,!0,!0),level4:i(.5,ce,!0,!0),level5:i(.618,re,!0,!0),level6:i(.786,O,!0,!0),level7:i(1,ve,!0,!0),level8:i(1.618,A,!0,!0),level9:i(2.618,$,!0,!0),level10:i(3.618,X,!0,!0),level11:i(4.236,ie,!0,!0),level12:i(1.272,ue,!1,!0),level13:i(1.414,$,!1,!0),level16:i(2,re,!1,!0),level14:i(2.272,ue,!1,!0),level15:i(2.414,ce,!1,!0),level17:i(3,O,!1,!0),level18:i(3.272,ve,!1,!0),level19:i(3.414,A,!1,!0),
level20:i(4,$,!1,!0),level21:i(4.272,X,!1,!0),level22:i(4.414,ie,!1,!0),level23:i(4.618,ue,!1,!0),level24:i(4.764,re,!1,!0)},linetoolfibchannel:{showCoeffs:!0,showPrices:!0,fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,labelFontSize:12,levelsStyle:{linewidth:y,linestyle:C},level1:i(0,ve,!0),level2:i(.236,$,!0),level3:i(.382,ue,!0),level4:i(.5,ce,!0),level5:i(.618,re,!0),level6:i(.786,O,!0),level7:i(1,ve,!0),level8:i(1.618,A,!0),level9:i(2.618,$,!0),level10:i(3.618,X,!0),level11:i(4.236,ie,!0),level12:i(1.272,ue,!1),level13:i(1.414,$,!1),level16:i(2,re,!1),level14:i(2.272,ue,!1),level15:i(2.414,ce,!1),level17:i(3,O,!1),level18:i(3.272,ve,!1),level19:i(3.414,A,!1),level20:i(4,$,!1),level21:i(4.272,X,!1),level22:i(4.414,ie,!1),level23:i(4.618,ue,!1),level24:i(4.764,re,!1)},linetoolprojection:{showCoeffs:!0,fillBackground:!0,transparency:80,color1:D,color2:Q,linewidth:y,trendline:{visible:!0,color:fe,linestyle:C},level1:h(1,"#808080",!0)},linetool5pointspattern:{color:A,textcolor:x,fillBackground:!0,backgroundColor:A,fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:y},linetoolcypherpattern:{color:A,textcolor:x,fillBackground:!0,backgroundColor:A,fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:y},linetooltrianglepattern:{color:R,textcolor:x,fillBackground:!0,backgroundColor:R,fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:y},linetoolabcd:{color:re,textcolor:x,fontsize:12,bold:!1,italic:!1,linewidth:y},linetoolthreedrivers:{color:R,textcolor:x,fillBackground:!0,backgroundColor:"rgba(149, 40, 204, 0.5)",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:y},linetoolheadandshoulders:{color:re,textcolor:x,fillBackground:!0,backgroundColor:re,fontsize:12,bold:!1,italic:!1,transparency:85,linewidth:y},linetoolfibwedge:{showCoeffs:!0,fillBackground:!0,transparency:80,trendline:{visible:!0,color:"#808080",linewidth:y,linestyle:C},level1:h(.236,$,!0),level2:h(.382,ue,!0),level3:h(.5,ce,!0),level4:h(.618,re,!0),level5:h(.786,O,!0),level6:h(1,ve,!0),level7:h(1.618,A,!1),level8:h(2.618,$,!1),level9:h(3.618,R,!1),level10:h(4.236,ie,!1),level11:h(4.618,ie,!1)},linetoolfibcircles:{showCoeffs:!0,fillBackground:!0,transparency:80,coeffsAsPercents:!1,trendline:{visible:!0,color:ve,linewidth:y,linestyle:P},level1:h(.236,$,!0),level2:h(.382,ue,!0),level3:h(.5,re,!0),level4:h(.618,ce,!0),level5:h(.786,O,!0),level6:h(1,ve,!0),level7:h(1.618,A,!0),level8:h(2.618,ie,!0),level9:h(3.618,A,!0),level10:h(4.236,ie,!0),level11:h(4.618,$,!0)},linetoolfibspeedresistancearcs:{showCoeffs:!0,fillBackground:!0,transparency:80,fullCircles:!1,trendline:{visible:!0,color:ve,linewidth:y,linestyle:P},level1:h(.236,$,!0),level2:h(.382,ue,!0),level3:h(.5,re,!0),level4:h(.618,ce,!0),level5:h(.786,O,!0),level6:h(1,ve,!0),level7:h(1.618,A,!0),level8:h(2.618,ie,!0),level9:h(3.618,A,!0),level10:h(4.236,ie,!0),level11:h(4.618,$,!0)},linetooltrendbasedfibextension:{showCoeffs:!0,showPrices:!0,fillBackground:!0,transparency:80,extendLines:!1,extendLinesLeft:!1,
horzLabelsAlign:"left",vertLabelsAlign:"middle",showText:!0,horzTextAlign:"center",vertTextAlign:"middle",reverse:!1,coeffsAsPercents:!1,fibLevelsBasedOnLogScale:!1,labelFontSize:12,trendline:{visible:!0,color:ve,linewidth:y,linestyle:P},levelsStyle:{linewidth:y,linestyle:C},level1:i(0,ve,!0,!0),level2:i(.236,$,!0,!0),level3:i(.382,ue,!0,!0),level4:i(.5,ce,!0,!0),level5:i(.618,re,!0,!0),level6:i(.786,O,!0,!0),level7:i(1,ve,!0,!0),level8:i(1.618,A,!0,!0),level9:i(2.618,$,!0,!0),level10:i(3.618,X,!0,!0),level11:i(4.236,ie,!0,!0),level12:i(1.272,ue,!1,!0),level13:i(1.414,$,!1,!0),level16:i(2,re,!1,!0),level14:i(2.272,ue,!1,!0),level15:i(2.414,ce,!1,!0),level17:i(3,O,!1,!0),level18:i(3.272,ve,!1,!0),level19:i(3.414,A,!1,!0),level20:i(4,$,!1,!0),level21:i(4.272,X,!1,!0),level22:i(4.414,ie,!1,!0),level23:i(4.618,ue,!1,!0),level24:i(4.764,re,!1,!0)},linetooltrendbasedfibtime:{showCoeffs:!0,fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:ve,linewidth:y,linestyle:P},level1:h(0,ve,!0),level2:h(.382,$,!0),level3:h(.5,le,!1),level4:h(.618,ce,!0),level5:h(1,re,!0),level6:h(1.382,O,!0),level7:h(1.618,ve,!0),level8:h(2,A,!0),level9:h(2.382,ie,!0),level10:h(2.618,X,!0),level11:h(3,R,!0)},linetoolschiffpitchfork:{fillBackground:!0,transparency:80,style:l.Schiff,median:{visible:!0,color:$,linewidth:y,linestyle:C},extendLines:!1,level0:h(.25,de,!1),level1:h(.382,le,!1),level2:h(.5,re,!0),level3:h(.618,re,!1),level4:h(.75,O,!1),level5:h(1,A,!0),level6:h(1.5,X,!1),level7:h(1.75,ie,!1),level8:h(2,j,!1)},linetoolschiffpitchfork2:{fillBackground:!0,transparency:80,style:l.Schiff2,median:{visible:!0,color:$,linewidth:y,linestyle:C},extendLines:!1,level0:h(.25,de,!1),level1:h(.382,le,!1),level2:h(.5,re,!0),level3:h(.618,re,!1),level4:h(.75,O,!1),level5:h(1,A,!0),level6:h(1.5,X,!1),level7:h(1.75,ie,!1),level8:h(2,j,!1)},linetoolinsidepitchfork:{fillBackground:!0,transparency:80,style:l.Inside,median:{visible:!0,color:$,linewidth:y,linestyle:C},extendLines:!1,level0:h(.25,de,!1),level1:h(.382,le,!1),level2:h(.5,re,!0),level3:h(.618,re,!1),level4:h(.75,O,!1),level5:h(1,A,!0),level6:h(1.5,X,!1),level7:h(1.75,ie,!1),level8:h(2,j,!1)},linetoolregressiontrend:{linewidth:1,linestyle:C,styles:{upLine:{display:u.All,color:L,linestyle:C,linewidth:y},downLine:{display:u.All,color:L,linestyle:C,linewidth:y},baseLine:{display:u.All,color:K,linestyle:P,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}}},xe(TradingView.defaultProperties.chartproperties),Me()}if(void 0===TradingView.defaultProperties["study_MA@tv-basicstudies"]&&(TradingView.defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",shortDescription:"MA",inputs:{length:9,source:"close"},styles:{MovAvg:{display:u.All,color:A,linestyle:C,linewidth:1,plottype:d.Line,histogramBase:0,title:"MA"}}}),void 0===TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={fontsize:10,borderColor:A,backColor:M,textColor:Se}),
void 0===TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]){var Ae=!0;TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:Ae,"S1/R1":Ae,"S2/R2":Ae,"S3/R3":Ae,"S4/R4":Ae,"S5/R5":Ae},colors:{P:pe,"S1/R1":pe,"S2/R2":pe,"S3/R3":pe,"S4/R4":pe,"S5/R5":pe},widths:{P:1,"S1/R1":1,"S2/R2":1,"S3/R3":1,"S4/R4":1,"S5/R5":1}}}}void 0===TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:A,linewidth:2});const Le={styles:{splitByBlocks:!1},graphics:{tpoLevels:{tpo:{tpoPoc:{color:""},tpoPoorHigh:{color:""},tpoPoorLow:{color:""},tpoSingleprints:{color:""},tpoVah:{color:""},tpoVal:{color:""},volumePoc:{color:""},volumeVah:{color:""},volumeVal:{color:""}}},tpoVolumeRows:{tpo:{valuesColor:"",colors:{nonVa:"",va:""}}}}};function ke(e){const t={styles:{developingPoc:{color:""},developingVAHigh:{color:""},developingVALow:{color:""}},graphics:{horizlines:{pocLines:{color:""},vahLines:{color:""},valLines:{color:""}},hhists:{histBars2:{colors:["",""],valuesColor:""},histBarsVA:{colors:["",""],valuesColor:""}}}};return e&&(t.graphics.polygons={histBoxBg:{color:""}}),t}void 0===TradingView.defaultProperties["study_TPOPeriodic@tv-volumebyprice"]&&(TradingView.defaultProperties["study_TPOPeriodic@tv-volumebyprice"]=Le),void 0===TradingView.defaultProperties["study_TPOSessions@tv-volumebyprice"]&&(TradingView.defaultProperties["study_TPOSessions@tv-volumebyprice"]=Le),void 0===TradingView.defaultProperties["study_VbPSessions@tv-volumebyprice"]&&(TradingView.defaultProperties["study_VbPSessions@tv-volumebyprice"]=ke(!0)),void 0===TradingView.defaultProperties["study_VbPSessionsRoughDetailed@tv-volumebyprice"]&&(TradingView.defaultProperties["study_VbPSessionsRoughDetailed@tv-volumebyprice"]=ke(!0)),void 0===TradingView.defaultProperties["study_VbPPeriodic@tv-volumebyprice"]&&(TradingView.defaultProperties["study_VbPPeriodic@tv-volumebyprice"]=ke(!0)),void 0===TradingView.defaultProperties["study_VbPVisible@tv-volumebyprice"]&&(TradingView.defaultProperties["study_VbPVisible@tv-volumebyprice"]=ke(!1));const De={styles:{developingPoc:{color:""},developingVAHigh:{color:""},developingVALow:{color:""}},graphics:{hhists:{histBars2:{colors:["",""],valuesColor:""},histBarsVA:{colors:["",""],valuesColor:""}},horizlines:{pocLines:{color:""},vahLines:{color:""},valLines:{color:""}},polygons:{histBoxBg:{color:""}}}};if(void 0===TradingView.defaultProperties["study_VbPFixed@tv-volumebyprice"]&&(TradingView.defaultProperties["study_VbPFixed@tv-volumebyprice"]=De),void 0===TradingView.defaultProperties["study_VbPFixed@tv-basicstudies"]&&(TradingView.defaultProperties["study_VbPFixed@tv-basicstudies"]=De),void 0===TradingView.defaultProperties.linetoolanchoredvp&&(TradingView.defaultProperties.linetoolanchoredvp=ke(!0)),
void 0===TradingView.defaultProperties["study_VbPAutoAnchored@tv-volumebyprice"]&&(TradingView.defaultProperties["study_VbPAutoAnchored@tv-volumebyprice"]=ke(!0)),void 0===TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:t(z,!1),level1:t("#008000",!1),level2:t("#0000ff",!1),level3:t("#ff00ff",!1),level4:t("#0080ff",!0),level5:t(z,!0),level6:t("#008000",!0),level7:t("#0000ff",!0),level8:t("#ff00ff",!0)}),void 0===TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]&&(TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{display:u.All,color:L,linestyle:C,linewidth:1},downLine:{display:u.All,color:L,linestyle:C,linewidth:1},baseLine:{display:u.All,color:K,linestyle:C,linewidth:1},extendLines:!0,showPearsons:!0,backgroundColor:"rgba(153, 21, 21, 0.3)",transparency:70}}),void 0===TradingView.defaultProperties["study_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"}),void 0===TradingView.defaultProperties["study_Overlay@tv-basicstudies"]){TradingView.defaultProperties["study_Overlay@tv-basicstudies"]={style:a.STYLE_LINE,allowExtendTimeScale:!1,showPriceLine:!1,minTick:"default",candleStyle:{upColor:oe,downColor:te,drawWick:!0,drawBorder:!0,drawBody:!0,borderColor:"#378658",borderUpColor:oe,borderDownColor:te,wickColor:"#737375",wickUpColor:oe,wickDownColor:te,barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:oe,downColor:te,drawWick:!0,drawBorder:!0,drawBody:!0,borderColor:"#378658",borderUpColor:oe,borderDownColor:te,wickColor:"#737375",wickUpColor:oe,wickDownColor:te,barColorsOnPrevClose:!1},barStyle:{upColor:oe,downColor:te,barColorsOnPrevClose:!1,dontDrawOpen:!1,thinBars:!0},lineStyle:{color:me,linestyle:C,linewidth:2,priceSource:"close"},lineWithMarkersStyle:{color:me,linestyle:C,linewidth:2,priceSource:"close"},steplineStyle:{color:me,linestyle:C,linewidth:2,priceSource:"close"},areaStyle:{color1:A,color2:A,linecolor:A,linestyle:C,linewidth:2,priceSource:"close",transparency:95},baselineStyle:{baselineColor:ye,topFillColor1:Ce,topFillColor2:Ce,bottomFillColor1:q,bottomFillColor2:q,topLineColor:we,bottomLineColor:G,topLineWidth:2,bottomLineWidth:2,priceSource:"close",transparency:50,baseLevelPercentage:50},hiloStyle:{color:A,showBorders:!0,borderColor:A,showLabels:!0,labelColor:A,drawBody:!0},columnStyle:{upColor:n(re,50),downColor:n($,50),barColorsOnPrevClose:!0,priceSource:"close",baselinePosition:"bottom"},hlcAreaStyle:{highLineColor:re,highLineStyle:C,highLineWidth:2,lowLineColor:$,lowLineStyle:C,lowLineWidth:2,closeLineColor:ye,closeLineStyle:C,closeLineWidth:2,highCloseFillColor:ae,closeLowFillColor:Y},styles:{open:{display:u.All,color:z,linestyle:C,linewidth:1,plottype:d.Line,histogramBase:0},high:{display:u.All,color:z,linestyle:C,linewidth:1,plottype:d.Line,histogramBase:0},low:{display:u.All,color:z,linestyle:C,linewidth:1,plottype:d.Line,histogramBase:0},close:{display:u.All,color:z,
linestyle:C,linewidth:1,plottype:d.Line,histogramBase:0}}}}for(var Ee=e.split("."),Be=TradingView.defaultProperties,Ve=0;Ve1?h(e[n],t.slice(1),i):(e[n]&&e[n].setValue?e[n].setValue(i):e[n]=i,!0))}function d(e){i||T.logWarn("Path `"+e+"` does not exist.")}}function xe(e,t,i,s){window.__defaultsOverrides&&Te(e,t,i,window.__defaultsOverrides,s)}function Ie(e,t){window.__settingsOverrides&&Te(e,null,!1,window.__settingsOverrides,t)}function Me(){var e=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach((function(t){e.test(t)&&xe(TradingView.defaultProperties[t],null,!1,t)}))}function Ae(e,t){return t?function(e,t){var i=Pe(e);if(!window._UNIT_TESTS){var s=TradingView.clone(TVSettings.getJSON(e,null));if(function(e){var t=new Set(["linetoolregressiontrend"]);return e.startsWith("study_")||t.has(e)}(e)&&s&&function(e){if(!e)return!1;e=e.toString();var t=new RegExp("\\d+").exec(e),i=null!==t&&t[0]===e;return i}(s.version)){var n=s.inputs,o=t.updateStudyInputs(s.id,s.version,"last",n,null);s.inputs=o,s=t.updateStudyState(s,s)}TradingView.merge(i,s),Ie(i,e)}return i}(e,t):function(e){var t=Pe(e);if(!window._UNIT_TESTS){var i=TradingView.clone(TVSettings.getJSON(e,null));if(i){TradingView.merge(t,i);const s=e.split(".");Ie(t,void 0===s[1]?e:s[1])}}return t}(e)}Ae.create=function(e,t){if(t){var i=Pe(e);TradingView.defaultProperties[e]=TradingView.merge(t,i)}},Ae.remove=function(e){TradingView.defaultProperties[e]=void 0},TradingView.saveDefaults=function(e,t){void 0===t?TVSettings.remove(e):TVSettings.setJSON(e,t)},TradingView.factoryDefaults=Pe,window.applyDefaultOverridesToLinetools=Me,window.applyDefaultsOverrides=xe,window.applyPropertiesOverrides=Te,window.defaults=Ae,t.applyDefaultOverridesToLinetools=Me,t.applyDefaultsOverrides=xe,t.applyPropertiesOverrides=Te,t.defaults=Ae,t.factoryDefaults=Pe,t.saveDefaults=TradingView.saveDefaults,t.createDefaults=Ae.create,t.removeDefaults=Ae.remove},928:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DrawingSyncMode:()=>s,SelectPointMode:()=>n,activePointSelectionMode:()=>Z,alignTo45Degrees:()=>xe,barTimesUnderCursor:()=>J,beenSetLineToolLastPoint:()=>N,cancelLineTool:()=>se,cancelledLineTool:()=>R,changeLineStyle:()=>_e,changeLineTool:()=>ce,changedLineStyle:()=>q,changedLineTool:()=>z,continueLineTool:()=>ie,continuedLineTool:()=>V,copiedLineTool:()=>$,copyLineTool:()=>pe,createLineTool:()=>te,createdLineTool:()=>B,crosshairLock:()=>P,cursorTool:()=>A,drawOnAllCharts:()=>Ie,drawOnAllChartsMode:()=>Me,emojiTool:()=>I,finishChangingLineTool:()=>he,finishLineTool:()=>ue,finishMovingLineTool:()=>ae,finishedChangingLineTool:()=>U,finishedLineTool:()=>G,finishedMovingLineTool:()=>W,hideAllDrawings:()=>we,
hideAllIndicators:()=>Ce,hideMarksOnBars:()=>Te,iconTool:()=>x,init:()=>ve,isDirectionalMovementActive:()=>E,isStudyEditingNow:()=>X,isToolCreatingNow:()=>L,isToolEditingNow:()=>k,isToolMovingNow:()=>D,lockDrawings:()=>Pe,moveLineTool:()=>re,movedLineTool:()=>F,properties:()=>be,removeLineTool:()=>de,removedLineTool:()=>j,resetToCursor:()=>f,restoreLineTool:()=>me,restoreLineToolState:()=>ge,restoredLineTool:()=>K,restoredLineToolState:()=>Y,runOnDrawingStateReady:()=>Se,setLineToolLastPoint:()=>ne,startChangingLineTool:()=>le,startMovingLineTool:()=>oe,startedChangingLineTool:()=>H,startedMovingLineTool:()=>O,stickerTool:()=>M,tool:()=>T,toolIsCursor:()=>p,toolIsDemonstration:()=>m,toolIsMeasure:()=>g});var s,n,o=i(50151),r=i(17625),a=i(32679),l=i(64147),c=i(91676),h=i(52033),d=i(56840),u=i(76422);!function(e){e[e.Layout=1]="Layout",e[e.Global=2]="Global"}(s||(s={})),function(e){e[e.None=0]="None",e[e.Replay=1]="Replay",e[e.Study=2]="Study"}(n||(n={}));const _=new Set(["cursor","arrow","dot","performance","demonstration"]);function p(e){return _.has(e)}function m(e){return"demonstration"===e}function g(e){return"measure"===e}function f(e=!1){if(!e&&y){if(y.childs().stayInDrawingMode.value())return}T.setValue(A.value())}let y=null,v=null,S=null,b=null,w=null,C=null;const P=new c.WatchedObject(null),T=new l.WatchedValue,x=new l.WatchedValue,I=new l.WatchedValue,M=new l.WatchedValue,A=new l.WatchedValue,L=new l.WatchedValue(!1),k=new l.WatchedValue(!1),D=new l.WatchedValue(!1),E=new l.WatchedValue(!1),B=new h.Delegate,V=new h.Delegate,R=new h.Delegate,N=new h.Delegate,O=new h.Delegate,F=new h.Delegate,W=new h.Delegate,H=new h.Delegate,z=new h.Delegate,U=new h.Delegate,j=new h.Delegate,G=new h.Delegate,q=new h.Delegate,$=new h.Delegate,K=new h.Delegate,Y=new h.Delegate,Z=new l.WatchedValue(n.None),X=new l.WatchedValue(!1),J=new Map;function Q(e,t){const i=t||{value:!1};return t=>{i.value||(i.value=!0,e.fire(t),i.value=!1)}}const ee={value:!1},te=Q(B,ee),ie=Q(V,ee),se=Q(R,ee),ne=Q(N,ee),oe=Q(O),re=Q(F),ae=Q(W),le=Q(H),ce=Q(z),he=Q(U),de=Q(j),ue=Q(G),_e=Q(q,ee),pe=Q($,ee),me=Q(K),ge=Q(Y);let fe=!1,ye=[];function ve(){if(fe)return;const e=d.getValue("chart.cursorPreference","cursor");T.setValue(p(e)?e:"cursor"),T.subscribe((e=>p(e)&&A.setValue(e)),{callWithLast:!0}),A.subscribe((e=>{e&&"performance"!==e&&!m(e)&&d.setValue("chart.cursorPreference",e)})),y=new a.DefaultProperty({defaultName:"drawings"}),v=(0,r.createPrimitiveProperty)(!1),S=(0,r.createPrimitiveProperty)(!1),b=(0,r.createPrimitiveProperty)(!1),w=(0,r.createPrimitiveProperty)(!d.getBool("BarsMarksContainer.visibile",!0)),C=(0,r.createPrimitiveProperty)(!1),T.subscribe((e=>{(0,u.emit)("onSelectedLineToolChanged")})),fe=!0,ye.forEach((e=>e())),ye=[]}function Se(e){fe?e():ye.push(e)}function be(){return(0,o.ensureNotNull)(y)}function we(){return(0,o.ensureNotNull)(v)}function Ce(){return(0,o.ensureNotNull)(S)}function Pe(){return(0,o.ensureNotNull)(b)}function Te(){return(0,o.ensureNotNull)(w)}function xe(){return(0,o.ensureNotNull)(C)}function Ie(){
return be().childs().drawOnAllCharts}function Me(){return be().childs().drawOnAllChartsMode}},28331:(e,t,i)=>{"use strict";i.d(t,{EnvironmentState:()=>n});var s=i(49483);class n{constructor(e,t=!1){this._shift=!1,this._mod=!1,this._alt=!1,void 0!==e&&(this._shift=Boolean(e.shiftKey),this._mod=Boolean((0,s.isMac)()?e.metaKey:e.ctrlKey),this._alt=Boolean(e.altKey)),this._isApiEvent=t}shift(){return this._shift}mod(){return this._mod}alt(){return this._alt}shiftOnly(){return this._shift&&!this._mod&&!this._alt}modOnly(){return this._mod&&!this._shift&&!this._alt}altOnly(){return this._alt&&!this._shift&&!this._mod}modShift(){return this._shift&&this._mod&&!this._alt}isApiEvent(){return this._isApiEvent}static create(e=!1,t=!1,i=!1){return new n({shiftKey:e,ctrlKey:t,metaKey:t,altKey:i})}}},73698:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DEFAULT_ADJUSTMENT:()=>n,DEFAULT_SESSION:()=>s,DEFAULT_SETTLEMENT_AS_CLOSE:()=>o,compareSymbols:()=>m,decodeExtendedSymbol:()=>u,encodeExtendedSymbolOrGetSimpleSymbolString:()=>h,isEncodedExtendedSymbol:()=>d,isReplaySymbol:()=>c,isStudySymbol:()=>l,unwrapSimpleSymbol:()=>_});const s="regular",n="splits",o=!0;function r(e){return"="+JSON.stringify(a(e))}function a(e){return Object.keys(e).sort().reduce(((t,i)=>("[object Object]"===Object.prototype.toString.call(e[i])?t[i]=a(e[i]):t[i]=e[i],t)),{})}function l(e){return Boolean(e.inputs)}function c(e){return Boolean(e.replay)}function h(e){return r(e)}function d(e){return"="===e[0]}function u(e){if(!d(e))return{symbol:e};try{return JSON.parse(e.slice(1))}catch(t){return{symbol:e}}}function _(e){return"string"==typeof e?e:_(e.symbol)}const p=["symbol","session","unit-id","currency-id","adjustment","backadjustment","settlement-as-close"];function m(e,t){return p.every((i=>e[i]===t[i]))}},32956:(e,t,i)=>{"use strict";function s(e){return n(e,2)}function n(e,t=2){const i=e.toString();return"0".repeat(Math.max(0,t-i.length))+i}i.d(t,{addLeadingZero:()=>s,addLeadingZeros:()=>n})},24526:(e,t,i)=>{"use strict";i.d(t,{customFormatters:()=>s});const s={dateFormatter:null,timeFormatter:null,tickMarkFormatter:null,priceFormatterFactory:null,studyFormatterFactory:null}},47462:(e,t,i)=>{"use strict";i.d(t,{availableDateFormats:()=>v,dateFormatFunctions:()=>f,defaultDateFormat:()=>S,getDateFormatWithWeekday:()=>y});var s=i(11542),n=i(28865),o=i(58683);const r={1:()=>s.t(null,void 0,i(62310)),2:()=>s.t(null,void 0,i(2507)),3:()=>s.t(null,void 0,i(92767)),4:()=>s.t(null,void 0,i(27072)),5:()=>s.t(null,{context:"short"},i(13132)),6:()=>s.t(null,void 0,i(429)),7:()=>s.t(null,void 0,i(53786)),8:()=>s.t(null,void 0,i(46450)),9:()=>s.t(null,void 0,i(6816)),10:()=>s.t(null,void 0,i(12179)),11:()=>s.t(null,void 0,i(26899)),12:()=>s.t(null,void 0,i(32084))},a={1:()=>s.t(null,void 0,i(14568)),2:()=>s.t(null,void 0,i(13534)),3:()=>s.t(null,void 0,i(14530)),4:()=>s.t(null,void 0,i(3762))},l=(e,t)=>(t?e.getMonth():e.getUTCMonth())+1,c=(e,t)=>t?e.getFullYear():e.getUTCFullYear(),h=e=>e.toLocaleDateString(window.language?(0,
n.getIsoLanguageCodeFromLanguage)(window.language):void 0,{weekday:"short",timeZone:"UTC"}),d=(e,t)=>a[((e,t)=>Math.floor((l(e,t)-1)/3)+1)(e,t)](),u=(e,t)=>(0,o.numberToStringWithLeadingZero)(((e,t)=>t?e.getDate():e.getUTCDate())(e,t),2),_=(e,t)=>r[l(e,t)](),p=(e,t)=>(0,o.numberToStringWithLeadingZero)(l(e,t),2),m=(e,t)=>(0,o.numberToStringWithLeadingZero)(c(e,t)%100,2),g=(e,t)=>(0,o.numberToStringWithLeadingZero)(c(e,t),4),f={"qq 'yy":(e,t)=>`${d(e,t)} '${m(e,t)}`,"qq yyyy":(e,t)=>`${d(e,t)} ${g(e,t)}`,"dd MMM 'yy":(e,t)=>`${u(e,t)} ${_(e,t)} '${m(e,t)}`,"MMM 'yy":(e,t)=>`${_(e,t)} '${m(e,t)}`,"MMM dd, yyyy":(e,t)=>`${_(e,t)} ${u(e,t)}, ${g(e,t)}`,"MMM yyyy":(e,t)=>`${_(e,t)} ${g(e,t)}`,"MMM dd":(e,t)=>`${_(e,t)} ${u(e,t)}`,"dd MMM":(e,t)=>`${u(e,t)} ${_(e,t)}`,"yyyy-MM-dd":(e,t)=>`${g(e,t)}-${p(e,t)}-${u(e,t)}`,"yy-MM-dd":(e,t)=>`${m(e,t)}-${p(e,t)}-${u(e,t)}`,"yy/MM/dd":(e,t)=>`${m(e,t)}/${p(e,t)}/${u(e,t)}`,"yyyy/MM/dd":(e,t)=>`${g(e,t)}/${p(e,t)}/${u(e,t)}`,"dd-MM-yyyy":(e,t)=>`${u(e,t)}-${p(e,t)}-${g(e,t)}`,"dd-MM-yy":(e,t)=>`${u(e,t)}-${p(e,t)}-${m(e,t)}`,"dd/MM/yy":(e,t)=>`${u(e,t)}/${p(e,t)}/${m(e,t)}`,"dd/MM/yyyy":(e,t)=>`${u(e,t)}/${p(e,t)}/${g(e,t)}`,"MM/dd/yy":(e,t)=>`${p(e,t)}/${u(e,t)}/${m(e,t)}`,"MM/dd/yyyy":(e,t)=>`${p(e,t)}/${u(e,t)}/${g(e,t)}`};function y(e){return"ja"===window.language?(t,i)=>`${f[e](t,i)} (${h(t)})`:(t,i)=>`${h(t)} ${f[e](t,i)}`}const v=Object.keys(f),S=()=>-1!==["ja","ko","zh","zh_TW"].indexOf(window.language||"")?"yyyy-MM-dd":"dd MMM 'yy"},82826:(e,t,i)=>{"use strict";i.d(t,{DateFormatter:()=>o});var s=i(24526),n=i(47462);class o{constructor(e="yyyy-MM-dd",t=!1){this._dateFormatFunc=t?(0,n.getDateFormatWithWeekday)(e):n.dateFormatFunctions[e]}format(e){return s.customFormatters&&s.customFormatters.dateFormatter?s.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!1)}formatLocal(e){return s.customFormatters.dateFormatter?s.customFormatters.dateFormatter.formatLocal?s.customFormatters.dateFormatter.formatLocal(e):s.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!0)}parse(e){if(""===e)return{res:!1};let t=e;return s.customFormatters&&s.customFormatters.dateFormatter&&!s.customFormatters.dateFormatter.parse&&console.warn("You need to provide a `parse` function as part of `dateFormatter`"),s.customFormatters&&s.customFormatters.dateFormatter&&s.customFormatters.dateFormatter.parse&&(t=String(s.customFormatters.dateFormatter.parse(e))),{res:!0,value:t}}}},52388:(e,t,i)=>{"use strict";i.d(t,{DateTimeFormatter:()=>r});var s=i(15344),n=i(82826);const o={dateFormat:"yyyy-MM-dd",withWeekday:!1,timeFormat:s.hourMinuteSecondFormat,dateTimeSeparator:" "};class r{constructor(e={}){const t=Object.assign({},o,e);this._dateFormatter=new n.DateFormatter(t.dateFormat,t.withWeekday),this._timeFormatter=new s.TimeFormatter(t.timeFormat),this._separator=t.dateTimeSeparator}format(e,t){const i=t?.dateTimeSeparator??this._separator;return`${this._dateFormatter.format(e)}${i}${this._timeFormatter.format(e)}`}formatLocal(e,t){const i=t?.dateTimeSeparator??this._separator
;return`${this._dateFormatter.formatLocal(e)}${i}${this._timeFormatter.formatLocal(e)}`}}},58683:(e,t,i)=>{"use strict";i.d(t,{numDependencyFormatter:()=>o,numberToStringWithLeadingZero:()=>n});var s=i(37265);function n(e,t){if(!(0,s.isNumber)(e))return"n/a";if(!(0,s.isInteger)(t))throw new TypeError("invalid length");if(t<0||t>24)throw new TypeError("invalid length");if(0===t)return e.toString();return("0000000000000000"+e.toString()).slice(-t)}function o(e){const t=new Map;return i=>{const s=i??-1;let n=t.get(s);return n||(n=e(i),t.set(s,n)),n}}},73866:(e,t,i)=>{"use strict";i.d(t,{LimitedPrecisionNumericFormatter:()=>o});var s,n=i(59623);!function(e){e[e.DefaultPrecision=1]="DefaultPrecision"}(s||(s={}));class o{constructor(e,t){this._precision=e??1,this._numericFormatter=new n.NumericFormatter({precision:this._precision,ignoreLocaleNumberFormat:t})}format(e,t){const i=e.toFixed(this._precision),s=Math.pow(10,-this._precision);return this._numericFormatter.format(Math.max(parseFloat(i),s),t)}parse(e,t){const i=this._numericFormatter.parse(e,t);return i.res?{res:!0,value:i.value,suggest:this.format(i.value)}:i}}},53085:(e,t,i)=>{"use strict";i.d(t,{formatNumber:()=>r,parseNumber:()=>l});var s=i(60521),n=i(59332),o=i(63273);function r(e,t,i,n,o){if(!Number.isFinite(e))return`${e}`;const r=-1===Math.sign(e)?"-":"";e=Math.abs(e);let a=void 0===i?e.toString():e.toFixed(i);if(a.includes("e")){if(!n)return`${r}${a.replace(".",t.decimalSign)}`;{const t=new s.Big(e);a=t.lt(1)?t.toFixed():t.toString()}}const l=a.split("."),c=l[0];let h=l[1];const d=function(e,t){let i=e.length;const s=[];for(;i>0;)s.unshift(e.slice(Math.max(i-3,0),i)),i-=3;return s.join(t)}(c,t.groupingSeparator);return void 0!==i&&(h=0===i?void 0:e.toFixed(i).slice(-i)),void 0!==o&&void 0!==h&&(h=function(e,t){let i=e.length-1;for(let s=i;s>=t&&"0"===e[s];s-=1)i-=1;return e.slice(0,i+1)}(h,o)),h?`${r}${d}${t.decimalSign}${h}`:`${r}${d}`}const a=(0,n.default)((e=>{const t=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");return new RegExp(t,"gm")}));function l(e,t){if(/^(NaN|[+|-]?Infinity)$/.test(e))return parseFloat(e);e=(0,o.stripLTRMarks)(e);const i=a(t.groupingSeparator);return i&&(e=e.replace(i,"")),e=e.replace(t.decimalSign,"."),/^(\+|-)?\d+(\.\d+|\.)?(e(\+|-)?\d+)?$/.test(e)?parseFloat(e):NaN}},11345:(e,t,i)=>{"use strict";let s;i.d(t,{formatterOptions:()=>n,formatterOptionsLibraryOverrides:()=>o,getNumberFormat:()=>d});const n={decimalSign:".",decimalSignFractional:"'"},o={};const r={groupingSeparator:",",decimalSign:"."},a={groupingSeparator:".",decimalSign:","},l={groupingSeparator:" ",decimalSign:","},c={groupingSeparator:"",decimalSign:"."},h=new Map([["en",r],["th",r],["ja",r],["ko",r],["zh",r],["zh_TW",r],["ar",r],["he_IL",r],["ms_MY",r],["vi",r],["de",a],["es",a],["it",a],["tr",a],["pt",a],["id_ID",a],["fr",l],["pl",l],["ru",l]]);function d(e){return{...h.get(s||window.language||"")??c,...o}}},59623:(e,t,i)=>{"use strict";i.d(t,{NumericFormatter:()=>o});var s=i(53085),n=i(11345);class o{constructor(e={}){this._options=e}format(e,t){
if(!Number.isFinite(e))return String(e);const{ignoreLocaleNumberFormat:i,precision:r,minPrecision:a}=this._options,l=(0,n.getNumberFormat)(i||t?.ignoreLocaleNumberFormat);return void 0===r?o._formatNoEImpl(e,l,r,a):(0,s.formatNumber)(e,l,r,void 0,a)}parse(e,t){const{ignoreLocaleNumberFormat:i,precision:o}=this._options,r=(0,n.getNumberFormat)(i||t?.ignoreLocaleNumberFormat);let a=(0,s.parseNumber)(e,r);return Number.isFinite(a)?(o&&(a=+a.toFixed(o)),{res:!0,value:a}):{res:!1}}static formatNoE(e,t){return this._formatNoEImpl(e,t)}static _formatNoEImpl(e,t,i,n){return Number.isFinite(e)?(t=t??{groupingSeparator:"",decimalSign:"."},(0,s.formatNumber)(e,t,i,!0,n)):String(e)}}},719:(e,t,i)=>{"use strict";i.d(t,{PercentageFormatter:()=>o});var s=i(725),n=i(63273);class o extends s.PriceFormatter{constructor(e={}){void 0!==e.decimalPlaces&&(e.priceScale=Math.pow(10,e.decimalPlaces)),super(e),this.type="percentage"}state(){return{...super.state(),percent:!0}}parse(e,t){return e=e.replace("%",""),super.parse(e,t)}format(e,t={}){const{useRtlFormat:i=!0}=t,s=super.format(e,{...t,useRtlFormat:!1})+"%";return i?(0,n.forceLTRStr)(s):s}static serialize(e){return e.state()}static deserialize(e){return new o(e)}}},725:(e,t,i)=>{"use strict";i.d(t,{PriceFormatter:()=>T});var s=i(60521),n=i(9343),o=i(50151),r=i(11542),a=i(50335),l=i(37265);function c(e){return e?(0,s.Big)(e.minMove).div(e.priceScale).toNumber():NaN}function h(e){const{minTick:t,price:i,variableMinTickData:s,shouldCheckForEquality:n}=e,o=(0,a.isNumber)(t)?d(t):t;return void 0===s?o:function(e,t,i=!1){for(let s=0;s(0,l.isEven)(t)?function(e){const t=Number(e);if(Number.isFinite(t))return d(t);{const t=e.split("/");if(t.length<2||t.length>3)throw new Error(`Unexpected mintick: ${e}`);const i=Number(t[1]),s=Number(t[0]);if(!Number.isFinite(i)||!Number.isFinite(s))throw new Error(`Unexpected mintick: ${e}`);const n=3===t.length?Number(t[2]):void 0;if(void 0!==n&&!Number.isFinite(n))throw new Error(`Unexpected mintick: ${e}`);const o={priceScale:i,minMove:s};return void 0!==n&&(o.minMove2=n),o}}(e):function(e){const t=Number(e);if(Number.isNaN(t))throw new Error(`Unexpected price limit: ${e}`);return t}(e)));if((0,l.isEven)(e.length))throw new Error("Theme must not be event number of elements");const i=[];for(let t=0;t0&&t>0){let t=e
;for(i&&s&&(t/=s);t>1;)t/=10,n++}return n}function g(e,t,i){const s=(0,o.ensureNotNull)(h({price:i,minTick:null,variableMinTickData:t,shouldCheckForEquality:!0})),{priceScale:n,minMove:r,minMove2:a}=s;return{priceScale:n,minMove:r,fractionalLength:m(n,r,e,a)}}class f{constructor(e){this._formatterErrors={custom:r.t(null,void 0,i(66123)),fraction:r.t(null,void 0,i(39643)),secondFraction:r.t(null,void 0,i(70784))};const{priceScale:t,minMove:s,minMove2:n,ignoreMinMove:o,variableMinTick:a,fractionalLength:l}=e;this._priceScale=t,this._minMove=s,this._minMove2=n,this._ignoreMinMove=o,this._variableMinTickData=void 0===a?void 0:u({priceScale:t,minMove:s,minMove2:n},a),this._fractionalLength=l}formatImpl(e,t={}){const{signPositive:i,signNegative:s=!0,tailSize:n,cutFractionalByPrecision:o=!1,useRtlFormat:r=!0,variableMinTickDataPrice:a,ignoreLocaleNumberFormat:l,removeAllEndingZeros:c}=t;let h="";e<0?h=!1===s?"":"−":e&&!0===i&&(h="+");const d=h+this._formatUnsigned(Math.abs(e),n,o,a,l,c);return r?(0,_.forceLTRStr)(d):d}parse(e,t){return"+"===(e=(e=(0,_.stripLTRMarks)(e)).replace("−","-"))[0]&&(e=e.substring(1)),this._parseUnsigned(e,t)}_removeEndingZeros(e,t){for(let i=0;i=1e21)return t.toString().replace(".",h.decimalSign);if(i>1e15)return this._formatAsExponential(t,h);const d=Math.pow(10,r)*i/(a?1:n),u=1/d;let _;if(d>1)_=Math.floor(t);else{const e=Math.floor(Math.round(t/u)*u);_=0===Math.round((t-e)/u)?e:e+u}let p="";if(d>1){let e=a?new s.Big(t).mul(d).round(void 0,0).minus(new s.Big(_).mul(d)).toNumber():parseFloat((Math.round(t*d)-_*d).toFixed(o));e>=d&&(e-=d,_+=1),e=a?new s.Big(e).round(o,0).toNumber():parseFloat(e.toFixed(o))*n;const i=(0,v.numberToStringWithLeadingZero)(e,o+r),l=this._removeEndingZeros(i,c?i.length:r);p=l?h.decimalSign+l:l}return(0,
y.formatNumber)(_,h)+p}_parseAsDecimal(e,t={}){const{ignoreLocaleNumberFormat:i}=t,s=(0,S.getNumberFormat)(this._ignoreLocaleNumberFormat||i),n=(0,y.parseNumber)(e,s);return Number.isFinite(n)?{value:n,res:!0,suggest:this.formatImpl(n)}:{error:this._formatterErrors.custom,res:!1}}}const C=(0,n.getLogger)("Chart.FractionalPriceFormatter");class P extends f{constructor(e){super(e);const{minMove2:t}=e;null!=t&&t>0&&2!==t&&4!==t&&8!==t&&C.logDebug("invalid minmove2")}hasForexAdditionalPrecision(){return!1}_parseUnsigned(e){return this._minMove2?this._parseAsDoubleFractional(e):this._parseAsSingleFractional(e)}_formatUnsigned(e,t,i,s){const n={price:Math.abs(e),priceScale:this._priceScale,minMove:this._minMove,minMove2:this._minMove2,fractionalLength:(0,o.ensureDefined)(this._fractionalLength),tailSize:t};return void 0!==this._variableMinTickData&&Object.assign(n,g(!0,this._variableMinTickData,s??n.price)),this._formatAsFractional(n)}_parseAsSingleFractional(e){let t=p.exec(e);if(t){const t=parseFloat(e);return{value:t,res:!0,suggest:this.formatImpl(t)}}if(t=new RegExp("^(-?)([0-9]+)\\"+S.formatterOptions.decimalSignFractional+"([0-9]+)$").exec(e),t){const e=!!t[1],i=parseInt(t[2]),s=this._priceScale,n=this._patchFractPart(parseInt(t[3]),1,s);if(n>=s||n<0)return{error:this._formatterErrors.fraction,res:!1};let o=i+n/s;return e&&(o=-o),{value:o,res:!0,suggest:this.formatImpl(o)}}return{error:this._formatterErrors.custom,res:!1}}_parseAsDoubleFractional(e){let t=p.exec(e);if(t){const t=parseFloat(e);return{value:t,res:!0,suggest:this.formatImpl(t)}}if(t=new RegExp("^(-?)([0-9]+)\\"+S.formatterOptions.decimalSignFractional+"([0-9]+)\\"+S.formatterOptions.decimalSignFractional+"([0-9]+)$").exec(e),t){const e=!!t[1],i=parseInt(t[2]),s=void 0!==this._minMove2&&null!==this._minMove2?this._minMove2:NaN,n=this._priceScale/s,o=this._minMove2,r=this._patchFractPart(parseInt(t[3]),1,n),a=this._patchFractPart(parseInt(t[4]),2,o);if(r>=n||r<0)return{error:this._formatterErrors.fraction,res:!1};if(null!=o&&a>=o||a<0)return{error:this._formatterErrors.secondFraction,res:!1};let l=null!=o?i+r/n+a/(n*o):NaN;return e&&(l=-l),{value:l,res:!0,suggest:this.formatImpl(l)}}return{error:this._formatterErrors.custom,res:!1}}_patchFractPart(e,t,i){const s={0:0,5:1},n={0:0,2:1,5:2,7:3},o={0:0,1:1,2:2,3:3,5:4,6:5,7:6,8:7};return 2===i?void 0===s[e]?-1:s[e]:4===i?void 0===n[e]?-1:n[e]:8===i&&2===t?void 0===o[e]?-1:o[e]:e}_formatAsFractional(e){const{price:t,tailSize:i,priceScale:s,minMove:n,minMove2:o,fractionalLength:r}=e,a=s/n;let l=Math.floor(t),c=i?Math.floor(t*a)-l*a:Math.round(t*a)-l*a;c===a&&(c=0,l+=1);let h="";if(i){let e=(t-l-c/a)*a;e=Math.round(e*Math.pow(10,i)),h=(0,v.numberToStringWithLeadingZero)(e,i),h=this._removeEndingZeros(h,i)}if(!r)throw new Error("_fractionalLength is not calculated");let d="";if(o){const e=c%o;c=(c-e)/o;const t=(0,v.numberToStringWithLeadingZero)(c,r),i=this._getFractPart(e,2,o);d=t+S.formatterOptions.decimalSignFractional+i}else c=this._getFractPart(c,1,s),d=(0,v.numberToStringWithLeadingZero)(c*n,r)
;return l.toString()+S.formatterOptions.decimalSignFractional+d+h}_getFractPart(e,t,i){const s=[0,5],n=[0,2,5,7],o=[0,1,2,3,5,6,7,8];return 2===i?void 0===s[e]?-1:s[e]:4===i?void 0===n[e]?-1:n[e]:8===i&&2===t?void 0===o[e]?-1:o[e]:e}}class T{constructor(e={}){this.type="price";const{minMove2:t,fractional:i,variableMinTick:s,ignoreMinMove:n,ignoreLocaleNumberFormat:o}=e,r=!e.minMove||n?1:e.minMove,a=(0,l.isNumber)(e.priceScale)&&(0,l.isInteger)(e.priceScale)?e.priceScale:100,c=m(a,r,i,t),h={...e,minMove:r,priceScale:a,fractionalLength:c};if(a<0)throw new TypeError("invalid base");this._priceScale=a,this._minMove=r,this._minMove2=t,this._fractional=i,this._variableMinTick=s,this._ignoreMinMove=n,this._fractionalLength=c,this._ignoreLocaleNumberFormat=o,this._implementation=i?new P(h):new w(h)}isFractional(){return!!this._fractional}state(){return{minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale,variableMinTick:this._variableMinTick,ignoreMinMove:this._ignoreMinMove,fractional:this._fractional}}formatChange(e,t,i){return this._implementation.formatImpl(e-t,{...i,variableMinTickDataPrice:Math.min(Math.abs(e),Math.abs(t))})}format(e,t){return this._implementation.formatImpl(e,t)}parse(e,t){return this._implementation.parse(e,t)}hasForexAdditionalPrecision(){return this._implementation.hasForexAdditionalPrecision()}static serialize(e){return e.state()}static deserialize(e){return new T(e)}}},15344:(e,t,i)=>{"use strict";i.d(t,{TimeFormatter:()=>_,hourMinuteFormat:()=>l,hourMinuteNonZeroSecondFormat:()=>r,hourMinuteSecondFormat:()=>o,hourMinuteSecondMillisecFormat:()=>a,twelveHourMinuteFormat:()=>d,twelveHourMinuteNonZeroSecondFormat:()=>h,twelveHourMinuteSecondFormat:()=>c});var s=i(24526),n=i(58683);const o="%h:%m:%s",r="%h:%m:%s+",a="%h:%m:%s.%ss+",l="%h:%m",c="%h:%m:%s %ampm",h="%h:%m:%s+ %ampm",d="%h:%m %ampm";var u;!function(e){e.TwentyFourHours="24-hours",e.TwelveHours="12-hours"}(u||(u={}));class _{constructor(e){this._isTwelveHoursFormat=!1,this._valuesAndDelimeters=[];const t=e||o,i=new RegExp("%h|%m|%s\\+|%ss\\+|%ss|%ampm|%s","g");let s=i.exec(t),n=0;for(;null!==s;){const e=s[0];"%ampm"===e&&(this._isTwelveHoursFormat=!0);const o=t.substring(n,s.index);""!==o&&this._valuesAndDelimeters.push(o),this._valuesAndDelimeters.push(e),n=s.index+e.length,s=i.exec(t)}}format(e){return s.customFormatters.timeFormatter?s.customFormatters.timeFormatter.format(e):this._formatTime(e,!1)}formatLocal(e){return s.customFormatters.timeFormatter?s.customFormatters.timeFormatter.formatLocal?s.customFormatters.timeFormatter.formatLocal(e):s.customFormatters.timeFormatter.format(e):this._formatTime(e,!0)}_formatTime(e,t){let i=t?e.getHours():e.getUTCHours();const s=t?e.getMinutes():e.getUTCMinutes(),o=t?e.getSeconds():e.getUTCSeconds(),r=t?e.getMilliseconds():e.getUTCMilliseconds();let a="";this._isTwelveHoursFormat&&(a=i>=12?"PM":"AM",i%=12,i=i||12);let l="",c=!1;for(let e=this._valuesAndDelimeters.length-1;e>=0;e--){const t=this._valuesAndDelimeters[e];let h;switch(t){case"%h":h=(0,
n.numberToStringWithLeadingZero)(i,2);break;case"%m":h=(0,n.numberToStringWithLeadingZero)(s,2);break;case"%s+":0!==o?h=(0,n.numberToStringWithLeadingZero)(o,2):(h="",c=!0);break;case"%s":h=(0,n.numberToStringWithLeadingZero)(o,2);break;case"%ss":h=(0,n.numberToStringWithLeadingZero)(r,3);break;case"%ss+":0!==r?h=(0,n.numberToStringWithLeadingZero)(r,3):(h="",c=!0);break;case"%ampm":h=a;break;default:if(c){c=!1;continue}h=t}l=h+l}return l}}},92953:(e,t,i)=>{"use strict";i.d(t,{TimeSpanFormatter:()=>r});var s=i(11542),n=i(53085),o=i(11345);class r{format(e,t){const r=e<0;e=Math.abs(e);const a=Math.floor(e/86400);e-=86400*a;const l=Math.floor(e/3600);e-=3600*l;const c=Math.floor(e/60);e-=60*c;let h="";if(a){const e=(0,o.getNumberFormat)(t?.ignoreLocaleNumberFormat);h+=(0,n.formatNumber)(a,e)+s.t(null,{context:"dates"},i(85886))+" "}return l&&(h+=l+s.t(null,{context:"dates"},i(44634))+" "),c&&(h+=c+s.t(null,{context:"dates"},i(5977))+" "),e&&(h+=e+s.t(null,{context:"dates"},i(21492))+" "),r&&(h="-"+h),h.trim()}}},46084:(e,t,i)=>{"use strict";i.d(t,{VolumeFormatter:()=>l});var s=i(11542),n=i(59623),o=i(37265);const r=[{value:3,letter:"K"},{value:6,letter:"M"},{value:9,letter:"B"},{value:12,letter:"T"}];function a(e,t){const i=e-t;return r.find((e=>e.value>=i))??r[r.length-1]}class l{constructor(e={}){this.type="volume";const{precision:t=0,minPrecision:i=0,dimensionPrecision:s=2,dimensionMinPrecision:o=0,significantDigits:r=3,ignoreLocaleNumberFormat:a,removeSpaceBeforeDimension:l}=e;this._precision=t,this._formatter=new n.NumericFormatter({ignoreLocaleNumberFormat:a,precision:this._precision,minPrecision:i}),this._dimensionPrecision=s,this._dimensionFormatter=new n.NumericFormatter({ignoreLocaleNumberFormat:a,precision:this._dimensionPrecision,minPrecision:o}),this._significantDigits=r,this._fractionalValues=void 0!==t&&t>0,this._spaceBeforeDimension=l?"":" ",this._options=e}state(){const{ignoreLocaleNumberFormat:e,...t}=this._options;return t}format(e,t){if(!(0,o.isNumber)(e))return"---";if(Math.abs(e)>=1e100)return s.t(null,void 0,i(96935));let n="";Math.abs(e)<1&&(e=+e.toFixed(this._precision)),e<0?n="−":e>0&&t?.signPositive&&(n="+"),e=Math.abs(e);const r=!!(t?.ignoreLocaleNumberFormat??this._options.ignoreLocaleNumberFormat);let l,c,h=Math.floor(Math.log10(e))+1;if(h<=this._significantDigits&&(e=+e.toFixed(this._precision),h=Math.floor(Math.log10(e))+1),h<=this._significantDigits)l=this._formatNumber(e,r,this._formatter);else{let t=a(h,this._significantDigits);const i=Math.pow(10,t.value);e=+(e/i).toFixed(this._dimensionPrecision)*i,t=a(Math.floor(Math.log10(e))+1,this._significantDigits),l=this._formatNumber(e/Math.pow(10,t.value),r,this._dimensionFormatter),c=t.letter}return c?`${n}${l}${this._spaceBeforeDimension}${c}`:`${n}${l}`}parse(e,t){if("---"===e)return{error:"not a number",res:!1,value:NaN};const i={K:1e3,M:1e6,B:1e9,T:1e12},s=(e=e.replace("−","-")).slice(-1);if(i.hasOwnProperty(s)){const n=this._formatter.parse(e.slice(0,-1).trim(),t),r=n.res?n.value:NaN;return(0,o.isNumber)(r)?{res:!0,value:r*i[s]}:{
error:"not a number",res:!1,value:NaN}}{const i=this._formatter.parse(e.trim(),t),s=i.res?i.value:NaN;return(0,o.isNumber)(s)?{res:!0,value:s}:{error:"not a number",res:!1,value:NaN}}}static serialize(e){return e.state()}static deserialize(e){return new l(e)}_formatNumber(e,t,i){if(this._fractionalValues&&0!==e){const t=14-Math.ceil(Math.log10(e)),i=Math.pow(10,t);e=Math.round(e*i)/i}return i.format(e,{ignoreLocaleNumberFormat:t})}}},41991:(e,t,i)=>{"use strict";i.d(t,{getPriceValueFormatterForSource:()=>l,getPriceValueFormatterForStudy:()=>c,shouldBeFormattedAsIndexedTo100:()=>r,shouldBeFormattedAsPercent:()=>o});var s=i(68805),n=i(60074);function o(e){const t=e.priceScale();return!(null===t||!t.isPercentage())&&(!(0,n.isActingAsSymbolSource)(e)||(0,s.isPriceSourceStyle)(e.style()))}function r(e){const t=e.priceScale();return!(null===t||!t.isIndexedTo100())&&(!(0,n.isActingAsSymbolSource)(e)||(0,s.isPriceSourceStyle)(e.style()))}function a(e){const t=e.priceScale();return r(e)&&null!==t?(i,s)=>t.formatPriceIndexedTo100(i,e.firstValue()??100,s):o(e)&&null!==t?(i,s)=>t.formatPricePercentage(i,e.firstValue()??100,s):null}function l(e){const t=a(e);if(t)return t;const i=e.formatter();return i.format.bind(i)}function c(e,t){const i=a(e);if(i)return i;const s=e.plotFormatter(t);return s.format.bind(s)}},56468:(e,t,i)=>{"use strict";i.d(t,{AreaName:()=>s,HitTarget:()=>o,HitTestResult:()=>d,hitTestResultDataAreEqual:()=>h,shouldDefaultActionBeExecuted:()=>c,tryCallHandler:()=>l});var s,n,o,r=i(50279),a=i(50151);function l(e,t,i,s){if(e.isTouch){if(void 0!==s)return s(e,t),!0}else if(void 0!==i)return i(e,t),!0;return!1}function c(e,t,i,s){return void 0!==t.executeDefaultAction&&(e.isTouch?Boolean(t.executeDefaultAction[s]):Boolean(t.executeDefaultAction[i]))}function h(e,t){return e&&t&&e.equals&&t.equals?e.equals(t):(0,r.default)(e,t)}!function(e){e.Style="Style",e.Text="Text",e.Line="Line",e.Tooltip="Tooltip",e.Button="Button",e.SourceItemMove="SourceItemMove",e.AnchorPoint="AnchorPoint"}(s||(s={})),function(e){e[e.Both=0]="Both",e[e.Horz=1]="Horz",e[e.Vert=2]="Vert"}(n||(n={})),function(e){e[e.MovePointBackground=1]="MovePointBackground",e[e.Regular=2]="Regular",e[e.MovePoint=3]="MovePoint",e[e.ChangePoint=4]="ChangePoint",e[e.Custom=5]="Custom"}(o||(o={}));class d{constructor(e,t,i){this._target=e,this._data=t||null,this._eraseMarker=i}target(){return this._target}data(){return this._data}mergeData(e){this._data={...(0,a.ensureNotNull)(this._data),...e}}hasPressedMoveHandler(e){return null!==this._data&&function(e,t,i){if(e.isTouch){if(void 0!==i)return!0}else if(void 0!==t)return!0;return!1}(e,this._data.pressedMouseMoveHandler,this._data.touchMoveHandler)}tryCallMouseDownOrTouchStartHandler(e,t){return null!==this._data&&l(e,t,this._data.mouseDownHandler,this._data.touchStartHandler)}tryCallMouseUpOrTouchEndHandler(e,t){return null!==this._data&&l(e,t,this._data.mouseUpHandler,this._data.touchEndHandler)}tryCallMouseEnterHandler(e,t){return null!==this._data&&l(e,t,this._data.mouseEnterHandler)}
tryCallMouseLeaveHandler(e,t){return null!==this._data&&l(e,t,this._data.mouseLeaveHandler)}tryCallMouseMoveHandler(e,t){return null!==this._data&&l(e,t,this._data.mouseMoveHandler)}tryCallClickOrTapHandler(e,t){return null!==this._data&&l(e,t,this._data.clickHandler,this._data.tapHandler)}tryCallDblClickOrDblTapHandler(e,t){return null!==this._data&&l(e,t,this._data.doubleClickHandler,this._data.doubleTapHandler)}tryCallContextMenuHandler(e,t){return null!==this._data&&l(e,t,this._data.contextMenuHandler,this._data.touchContextMenuHandler)}eraseMarker(){return this._eraseMarker}}},52397:(e,t,i)=>{"use strict";i.d(t,{HorizontalLinePaneView:()=>o});var s=i(50600),n=i(51056);class o{constructor(){this._lineRendererData={y:0,color:"rgba(0, 0, 0, 0)",linewidth:1,linestyle:n.LINESTYLE_SOLID,visible:!1},this._lineRenderer=new s.HorizontalLineRenderer,this._invalidated=!0,this._lineRenderer.setData(this._lineRendererData)}update(e){this._invalidated=!0}renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._lineRenderer}}},80720:(e,t,i)=>{"use strict";var s,n,o;i.d(t,{CustomSourceLayer:()=>a,PlDisplay:()=>n,RecalcVisibleRangeStudiesReason:()=>c,TradedGroupHorizontalAlignment:()=>o,tradingPreferencesDefault:()=>r}),function(e){e[e.Initial=2]="Initial",e[e.SeriesZOrderIsAlwaysZero=3]="SeriesZOrderIsAlwaysZero",e[e.Current=3]="Current"}(s||(s={})),function(e){e[e.Money=0]="Money",e[e.Pips=1]="Pips",e[e.Percentage=2]="Percentage"}(n||(n={})),function(e){e[e.Left=0]="Left",e[e.Center=1]="Center",e[e.Right=2]="Right"}(o||(o={}));const r={showPositions:!1,positionPL:{visibility:!1,display:n.Money},bracketsPL:{visibility:!1,display:n.Money},showOrders:!1,showExecutions:!1,showExecutionsLabels:!1,showReverse:!1,extendLeft:!1,lineLength:0,horizontalAlignment:o.Right,lineWidth:0,lineStyle:0};var a,l,c,h;!function(e){e[e.Background=0]="Background",e[e.Foreground=1]="Foreground",e[e.Topmost=2]="Topmost"}(a||(a={})),function(e){e[e.Unavailable=0]="Unavailable",e[e.AvailableReadonlyAlwaysDisabled=1]="AvailableReadonlyAlwaysDisabled",e[e.AvailableReadonlyAlwaysEnabled=2]="AvailableReadonlyAlwaysEnabled",e[e.Available=3]="Available"}(l||(l={})),function(e){e[e.ViewportChangeUserAction=0]="ViewportChangeUserAction",e[e.DataUpdate=1]="DataUpdate",e[e.SeriesRestart=2]="SeriesRestart",e[e.SeriesCompleted=3]="SeriesCompleted",e[e.StudyCreation=4]="StudyCreation"}(c||(c={})),function(e){e[e.Chart=0]="Chart"}(h||(h={}))},77148:(e,t,i)=>{"use strict";var s;i.d(t,{CreateLineToolSyncMode:()=>s}),function(e){e[e.Default=0]="Default",e[e.ForceOn=1]="ForceOn",e[e.ForceOff=2]="ForceOff"}(s||(s={}))},19466:(e,t,i)=>{"use strict";var s,n,o;i.d(t,{TitleDisplayTarget:()=>o}),function(e){e[e.AfterMainSeries=0]="AfterMainSeries"}(s||(s={})),function(e){e[e.Idle=0]="Idle",e[e.Processing=1]="Processing",e[e.Active=2]="Active",e[e.Stopped=3]="Stopped"}(n||(n={})),function(e){e[e.DataWindow=1]="DataWindow",e[e.StatusLine=2]="StatusLine",e[e.Alerts=3]="Alerts"}(o||(o={}))},85049:(e,t,i)=>{"use strict";i.d(t,{Interval:()=>h,
ResolutionKind:()=>o,SpecialResolutionKind:()=>r,isHour:()=>u});const s=/^(\d*)([TSHDWMR])$/,n=/^(\d+)$/;var o,r;!function(e){e.Ticks="ticks",e.Seconds="seconds",e.Minutes="minutes",e.Days="days",e.Weeks="weeks",e.Months="months",e.Range="range",e.Invalid="invalid"}(o||(o={})),function(e){e.Hours="hours"}(r||(r={}));const a={};a[o.Ticks]=1e3,a[o.Seconds]=1e3,a[o.Minutes]=60*a[o.Seconds],a[o.Days]=1440*a[o.Minutes],a[o.Weeks]=7*a[o.Days];const l={T:o.Ticks,S:o.Seconds,D:o.Days,W:o.Weeks,M:o.Months,R:o.Range},c=new Set([o.Ticks,o.Seconds,o.Minutes]);class h{constructor(e,t){this._kind=o.Invalid,this._multiplier=0,e!==o.Invalid&&t>0&&(this._kind=e,this._multiplier=t)}kind(){return this._kind}guiKind(){return this.isMinuteHours()?r.Hours:this._kind}multiplier(){return this._multiplier}isValid(){return this.kind()!==o.Invalid&&this.multiplier()>0}isDWM(){return this.isValid()&&!this.isRange()&&!this.isIntraday()&&!this.isTicks()}isIntraday(){const e=c.has(this.kind());return this.isValid()&&e}isSeconds(){return this.kind()===o.Seconds}isMinutes(){return this.kind()===o.Minutes}isMinuteHours(){return this.kind()===o.Minutes&&u(this.multiplier())}isDays(){return this.kind()===o.Days}isWeeks(){return this.kind()===o.Weeks}isMonths(){return this.kind()===o.Months}isRange(){return this.kind()===o.Range}isTicks(){return this.kind()===o.Ticks}is1Tick(){return this.isTicks()&&1===this.multiplier()}isTimeBased(){return!this.isRange()}letter(){return this.isValid()&&this.kind()!==o.Minutes?this.kind()[0].toUpperCase():""}value(){return this.isValid()?this.kind()===o.Minutes?this.multiplier()+"":this.multiplier()+this.letter():""}isEqualTo(e){if(!(e instanceof h))throw new Error("Argument is not an Interval");return!(!this.isValid()||!e.isValid())&&(this.kind()===e.kind()&&this.multiplier()===e.multiplier())}inMilliseconds(e=Date.now()){if(!this.isValid()||this.isRange())return NaN;if(this.isMonths()){const t=new Date(e);t.setUTCMonth(t.getUTCMonth()+(this.multiplier()||1));return+t-e}const t=this.multiplier();return a[this.kind()]*t}static isEqual(e,t){return e===t||h.parse(e).isEqualTo(h.parse(t))}static parseExt(e){e=(e+"").toUpperCase().split(",")[0];let t=s.exec(e);return null!==t?"H"===t[2]?{interval:new h(o.Minutes,60*d(t[1])),guiResolutionKind:r.Hours}:{interval:new h(l[t[2]],d(t[1])),guiResolutionKind:l[t[2]]}:(t=n.exec(e),null!==t?{interval:new h(o.Minutes,d(t[1])),guiResolutionKind:o.Minutes}:{interval:new h(o.Invalid,0),guiResolutionKind:o.Invalid})}static parse(e){return h.parseExt(e).interval}static kind(e){return h.parse(e).kind()}static isValid(e){return h.parse(e).isValid()}static isDWM(e){return h.parse(e).isDWM()}static isIntraday(e){return h.parse(e).isIntraday()}static isSeconds(e){return h.parse(e).isSeconds()}static isMinutes(e){return h.parse(e).isMinutes()}static isMinuteHours(e){return h.parse(e).isMinuteHours()}static isDays(e){return h.parse(e).isDays()}static isWeeks(e){return h.parse(e).isWeeks()}static isMonths(e){return h.parse(e).isMonths()}static isRange(e){return h.parse(e).isRange()}
static isTicks(e){return h.parse(e).isTicks()}static isTimeBased(e){return h.parse(e).isTimeBased()}static normalize(e){const t=h.parse(e);return t.isValid()?t.value():null}}function d(e){return 0===e.length?1:parseInt(e,10)}function u(e){return e>=60&&!(e%60)}},31229:(e,t,i)=>{"use strict";i.d(t,{intervalsVisibilitiesDefaults:()=>s});const s={ticks:!0,seconds:!0,secondsFrom:1,secondsTo:59,minutes:!0,minutesFrom:1,minutesTo:59,hours:!0,hoursFrom:1,hoursTo:24,days:!0,daysFrom:1,daysTo:366,weeks:!0,weeksFrom:1,weeksTo:52,months:!0,monthsFrom:1,monthsTo:12,ranges:!0}},94260:(e,t,i)=>{"use strict";i.d(t,{IntervalsVisibilitiesProperty:()=>n});var s=i(12988);i(10892);class n extends s.Property{state(e,t){return super.state(e,t)}storeStateIfUndefined(){return!1}}},10892:(e,t,i)=>{"use strict";i.d(t,{getIntervalsVisibilitiesForMode:()=>_,isActualInterval:()=>d,makeIntervalsVisibilitiesVisibleAtInterval:()=>c,mergeIntervalVisibilitiesDefaults:()=>u});var s,n=i(16738),o=i(90054),r=i(50151),a=i(85049),l=i(31229);function c(e,t){let i=t.multiplier();if(t.isTicks()&&(e.ticks=!0),t.isSeconds()&&(i<60?(e.seconds=!0,e.secondsFrom=Math.min(e.secondsFrom,i),e.secondsTo=Math.max(e.secondsTo,i)):(i=Math.floor(i/60),t=new a.Interval(a.ResolutionKind.Minutes,i))),t.isMinutes())if(i<60)e.minutes=!0,e.minutesFrom=Math.min(e.minutesFrom,i),e.minutesTo=Math.max(e.minutesTo,i);else{const t=Math.floor(i/60);e.hours=!0,e.hoursFrom=Math.min(e.hoursFrom,t),e.hoursTo=Math.max(e.hoursTo,t)}t.isDays()&&(e.days=!0,e.daysFrom=Math.min(e.daysFrom,i),e.daysTo=Math.max(e.daysTo,i)),t.isWeeks()&&(e.weeks=!0,e.weeksFrom=Math.min(e.weeksFrom,i),e.weeksTo=Math.max(e.weeksTo,i)),t.isMonths()&&(e.months=!0,e.monthsFrom=Math.min(e.monthsFrom,i),e.monthsTo=Math.max(e.monthsTo,i)),t.isRange()&&(e.ranges=!0)}function h(e,t,i,s){return e&&s>=t&&s<=i}function d(e,t){const i=t.childs();switch(e.kind()){case a.ResolutionKind.Ticks:return i.ticks.value();case a.ResolutionKind.Seconds:if(e.multiplier()<60)return h(i.seconds.value(),i.secondsFrom.value(),i.secondsTo.value(),e.multiplier());{const t=Math.floor(e.multiplier()/60);return h(i.minutes.value(),i.minutesFrom.value(),i.minutesTo.value(),t)}case a.ResolutionKind.Minutes:if(e.multiplier()<60)return h(i.minutes.value(),i.minutesFrom.value(),i.minutesTo.value(),e.multiplier());{const t=Math.floor(e.multiplier()/60);return h(i.hours.value(),i.hoursFrom.value(),i.hoursTo.value(),t)}case a.ResolutionKind.Days:return h(i.days.value(),i.daysFrom.value(),i.daysTo.value(),e.multiplier());case a.ResolutionKind.Weeks:return h(i.weeks.value(),i.weeksFrom.value(),i.weeksTo.value(),e.multiplier());case a.ResolutionKind.Months:return h(i.months.value(),i.monthsFrom.value(),i.monthsTo.value(),e.multiplier());case a.ResolutionKind.Range:return i.ranges.value()}return(0,r.assert)(!1,`Unsupported resolution: ${e.value()}`),!1}function u(e){return(0,n.default)((0,o.default)(l.intervalsVisibilitiesDefaults),e??{})}function _(e,t){if(0===t||e.isTicks()&&3===t||e.isRange()&&2===t)return u();let i=!1;const s={ticks:!1,seconds:!1,
minutes:!1,hours:!1,days:!1,weeks:!1,months:!1,ranges:!1},n=e=>e.multiplier();return[{checker:e=>e.isTicks(),getIntervalMultiplier:n,markIntervalAsVisible:(e,t)=>{s.ticks=!0}},{checker:e=>e.isSeconds()&&e.multiplier()<60,getIntervalMultiplier:n,markIntervalAsVisible:(e,t)=>{s.seconds=!0,s.secondsFrom=e,s.secondsTo=t}},{checker:e=>e.isSeconds()&&e.multiplier()>=60,getIntervalMultiplier:e=>Math.floor(e.multiplier()/60),markIntervalAsVisible:(e,t)=>{s.minutes=!0,s.minutesFrom=e,s.minutesTo=t}},{checker:e=>e.isMinutes()&&e.multiplier()<60,getIntervalMultiplier:n,markIntervalAsVisible:(e,t)=>{s.minutes=!0,s.minutesFrom=e,s.minutesTo=t}},{checker:e=>e.isMinutes()&&e.multiplier()>=60,getIntervalMultiplier:e=>Math.floor(e.multiplier()/60),markIntervalAsVisible:(e,t)=>{s.hours=!0,s.hoursFrom=e,s.hoursTo=t}},{checker:e=>e.isDays(),getIntervalMultiplier:n,markIntervalAsVisible:(e,t)=>{s.days=!0,s.daysFrom=e,s.daysTo=t}},{checker:e=>e.isWeeks(),getIntervalMultiplier:n,markIntervalAsVisible:(e,t)=>{s.weeks=!0,s.weeksFrom=e,s.weeksTo=t}},{checker:e=>e.isMonths(),getIntervalMultiplier:n,markIntervalAsVisible:(e,t)=>{s.months=!0,s.monthsFrom=e,s.monthsTo=t}},{checker:e=>e.isRange(),getIntervalMultiplier:n,markIntervalAsVisible:(e,t)=>{s.ranges=!0}}].forEach((s=>{if(s.checker(e)){i=!0;const n=s.getIntervalMultiplier(e);1===t?s.markIntervalAsVisible(n,n):3===t?s.markIntervalAsVisible(n,void 0):s.markIntervalAsVisible(void 0,n)}else(!i&&2===t||i&&3===t)&&s.markIntervalAsVisible(void 0,void 0)})),u(s)}!function(e){e[e.All=0]="All",e[e.OnlyCurrent=1]="OnlyCurrent",e[e.CurrentAndBelow=2]="CurrentAndBelow",e[e.CurrentAndAbove=3]="CurrentAndAbove"}(s||(s={}))},22820:(e,t,i)=>{"use strict";var s,n,o;i.d(t,{PaneMode:()=>o}),function(e){e.Left="left",e.Right="right"}(s||(s={})),function(e){e.Tiny="tiny",e.Small="small",e.Medium="medium",e.Large="large"}(n||(n={})),function(e){e[e.Regular=0]="Regular",e[e.Widget=1]="Widget"}(o||(o={}))},8025:(e,t,i)=>{"use strict";var s;i.d(t,{PlotRowSearchMode:()=>s}),function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.Exact=0]="Exact",e[e.NearestRight=1]="NearestRight"}(s||(s={}))},66666:(e,t,i)=>{"use strict";function s(e){return Boolean(e.showInObjectTree)}i.d(t,{isDataSource:()=>s})},1819:(e,t,i)=>{"use strict";i.d(t,{isTicksEnabled:()=>n});var s=i(56570);function n(){return s.enabled("tick_resolution")}},4340:(e,t,i)=>{"use strict";var s;i.d(t,{SymbolErrorPermissionDeniedReason:()=>s,invalidSymbol:()=>o,permissionDenied:()=>n}),function(e){e.Symbol="symbol",e.GroupPermission="group"}(s||(s={}));const n="permission denied",o="invalid symbol"},60074:(e,t,i)=>{"use strict";function s(e){return e?.symbolSource&&e.symbolSource()===e||void 0!==e?.isActingAsSymbolSource}function n(e){return s(e)&&"quotesProvider"in e}function o(e){return s(e)&&e.isActingAsSymbolSource().value()}i.d(t,{isActingAsSymbolSource:()=>o,isSymbolSource:()=>s,isSymbolSourceWithQuotesProvider:()=>n})},23486:(e,t,i)=>{"use strict";i.d(t,{alwaysShowLastPriceAndLastDayChange:()=>s,lastDayChangeAvailable:()=>n});i(56570);const s=!1,n=!1},
85719:(e,t,i)=>{"use strict";i.d(t,{lineToolsDoNotAffectChartInvalidation:()=>s});const s=!1},67467:(e,t,i)=>{"use strict";var s;i.d(t,{LineToolBarsPatternMode:()=>s}),function(e){e[e.Bars=0]="Bars",e[e.Line=1]="Line",e[e.OpenClose=2]="OpenClose",e[e.LineOpen=3]="LineOpen",e[e.LineHigh=4]="LineHigh",e[e.LineLow=5]="LineLow",e[e.LineHL2=6]="LineHL2"}(s||(s={}))},81756:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolBarsPattern:()=>w});var s,n=i(50151),o=i(11542),r=i(45126),a=i(37265),l=i(29023),c=i(32679),h=i(8025),d=i(29875),u=i(67467),_=i(44672),p=i(85719),m=i(64147);!function(e){e[e.InitialVersion=1]="InitialVersion",e[e.CorrectedPrice=2]="CorrectedPrice",e[e.TheLatest=2]="TheLatest"}(s||(s={}));const g=new r.TranslatedString("mirror bars pattern",o.t(null,void 0,i(20965))),f=new r.TranslatedString("flip bars pattern",o.t(null,void 0,i(92479))),y=o.t(null,void 0,i(28941)),v=o.t(null,void 0,i(63271)),S={0:2,1:4,2:1,3:1,4:2,5:3,6:-1},b={0:3,1:4,2:4,3:1,4:2,5:3,6:-1};class w extends d.LineDataSource{constructor(e,t=w.createProperties(e.backgroundTheme().spawnOwnership()),s,n){super(e,t,s,n),this._hasEditableCoordinates=new m.WatchedValue(!1),this._pattern=[],this._scale=1,this._pointsCoordinatePricesDiff=null;const o=t.childs().mode.value();(0,a.isString)(o)&&t.childs().mode.setValue(parseInt(o)),t.childs().mirrored.subscribe(this,this._mirror),t.childs().flipped.subscribe(this,this._flip),t.childs().mode.subscribe(this,this._updateLastPoint),this.version=2,Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,52666)).then((t=>{this._setPaneViews([new t.BarsPatternPaneView(this,e)])}))}pattern(){return this._pattern}isSynchronizable(){return!1}async additionalActions(e){return{actions:[new l.Action({actionId:"Chart.LineTool.BarsPattern.ToggleMirrored",options:{checked:this.properties().childs().mirrored.value(),checkable:!0,label:y,onExecute:()=>{e.setProperty(this.properties().childs().mirrored,!this.properties().childs().mirrored.value(),g,p.lineToolsDoNotAffectChartInvalidation),this.updateAllViews((0,_.sourceChangeEvent)(this.id())),this._model.updateSource(this)}}}),new l.Action({actionId:"Chart.LineTool.BarsPattern.ToggleFlipped",options:{checked:this.properties().childs().flipped.value(),checkable:!0,label:v,onExecute:()=>{e.setProperty(this.properties().childs().flipped,!this.properties().childs().flipped.value(),f,p.lineToolsDoNotAffectChartInvalidation),this.updateAllViews((0,_.sourceChangeEvent)(this.id())),this._model.updateSource(this)}}})],placement:"CustomAction"}}pointsCount(){return 2}state(e){return{...super.state(e),pattern:this._pattern,scale:this._scale,diff:this._pointsCoordinatePricesDiff}}restoreData(e){const{pattern:t=this._pattern,scale:i=this._scale,diff:s=this._pointsCoordinatePricesDiff}=e;this._pattern=t,this._scale=i,this._pointsCoordinatePricesDiff=s}name(){return"Bars Pattern"}cloneData(e){this._pattern=(0,a.clone)(e._pattern),this._scale=e._scale,this._pointsCoordinatePricesDiff=e._pointsCoordinatePricesDiff}firstPatternPrice(){
const{mode:e,flipped:t}=this.properties().childs(),i=this._pattern[0];return e.value()===u.LineToolBarsPatternMode.LineHL2?(i[2]+i[3])/2:t.value()?i[b[e.value()]]:i[S[e.value()]]}lastPatternPrice(){const{mode:e,flipped:t}=this.properties().childs(),i=this._pattern[this._pattern.length-1];return e.value()===u.LineToolBarsPatternMode.LineHL2?(i[2]+i[3])/2:t.value()?i[S[e.value()]]:i[b[e.value()]]}addPoint(e,t,i){const s=super.addPoint(e,t,!0);if(s){const e=this._model.mainSeries(),[{index:t},{index:i}]=this.points(),s=(0,n.ensureDefined)(e.nearestIndex(Math.min(t,i),h.PlotRowSearchMode.NearestRight)),o=(0,n.ensureDefined)(e.nearestIndex(Math.max(t,i),h.PlotRowSearchMode.NearestLeft));this._pattern=this._createPattern(s,o),this._pattern.length>0&&(t>i&&this._points.reverse(),this._points[1].price=this._points[0].price+this._patternPriceDiff(),this._points[1].index=this._points[0].index+(o-s),this._normalizePoints(),this.createServerPoints()),this._updatePointsCoordinatePricesDiff()}return s}setPoint(e,t,i,s){1===e&&t.index<=this._points[0].index&&(t.index=this._points[0].index+1),0===e&&t.index>=this._points[1].index&&(t.index=this._points[1].index-1),super.setPoint(e,t,i),this._updatePointsCoordinatePricesDiff()}move(e,t,i,s){super.move(e,t,i,s),this._updatePointsCoordinatePricesDiff()}migrateVersion(e,t,i){if(1===e&&this._pattern.length>0){const e=this._patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+e),2===this._points.length&&(this._points[1].price=this._points[0].price+e)}}getScale(){return this._scale=this._calculateScale()}static createProperties(e,t){const i=new c.DefaultProperty({defaultName:"linetoolbarspattern",state:t,theme:e});return this._configureProperties(i),i}_preparePoint(e,t){const i=this._alignPointToRangeOfActualData(e),s=this._model.mainSeries(),o=(0,n.ensureNotNull)(s.bars().valueAt(i.index));this.properties().childs().mode.value()===u.LineToolBarsPatternMode.Bars?i.price=(0,n.ensure)(o[2]):i.price=(0,n.ensure)(o[4]);const r=(0,n.ensureNotNull)(this.priceScale()),a=(0,n.ensure)(this.ownerSource()?.firstValue()),l=.05*r.height(),c=r.priceToCoordinate(i.price,a)-l;return i.price=r.coordinateToPrice(c,a),super._preparePoint(i,t)}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(3401),i.e(3889),i.e(8009),i.e(6204),i.e(1963),i.e(8537)]).then(i.bind(i,1847))).BarsPatternDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.addExcludedKey("mirrored",1),e.addExcludedKey("flipped",1)}_calculatePatternCoordinatePricesDiff(){return this._pattern.length>0?this._priceCoordinateDiff([this.firstPatternPrice(),this.lastPatternPrice()])??null:null}_updatePointsCoordinatePricesDiff(){this._pointsCoordinatePricesDiff=this._calculatePointsCoordinatePricesDiff()}_calculatePointsCoordinatePricesDiff(){if(2===this._points.length){const[{price:e},{price:t}]=this.points();return this._priceCoordinateDiff([e,t])??null}return null}_createPattern(e,t){const i=this._model.mainSeries().data(),s=[]
;for(let o=e;o<=t;o++)s.push((0,a.clone)((0,n.ensureNotNull)(i.valueAt(o))));return s}_switchPointsPrice(){const e=this._points[0].price;this._timePoint[0].price=this._points[0].price=this._points[1].price,this._timePoint[1].price=this._points[1].price=e}_mirror(){const e=this._pattern;let t=Math.min(e[0][3],e[0][2]),i=Math.max(e[0][3],e[0][2]);for(let s=1;ss-(e-s);for(let t=0;tt.priceToCoordinate(e,i)))}_priceCoordinateDiff(e){const t=this._pricesToCoordinates(e);if(t)return t[1]-t[0]}_calculateScale(){let e=1;if(2===this._points.length){const t=this._calculatePatternCoordinatePricesDiff();if(!t)return e;const i=this._calculatePointsCoordinatePricesDiff();if(t&&null!==i&&(e=+(i/t).toFixed(8)),this._pointsCoordinatePricesDiff!==i){if(this._scale!==e)return this._updateLastPoint(),this._scale;this._updatePointsCoordinatePricesDiff()}}return e}_updateLastPoint(){if(this._points.length<2)return;const e=this.priceScale(),t=this.ownerSource()?.firstValue()??null;if(null===t||null===e||e.isEmpty())return;const i=this._calculatePatternCoordinatePricesDiff(),s=this._pricesToCoordinates([this.points()[0].price]);null!==i&&s&&(this._timePoint[1].price=this._points[1].price=e.coordinateToPrice(+(this._scale*i).toFixed(8)+s[0],t),this._updatePointsCoordinatePricesDiff())}}},64195:(e,t,i)=>{"use strict";i.d(t,{LineToolBrushBase:()=>r});var s=i(50151),n=i(29875),o=i(64147);class r extends n.LineDataSource{constructor(){super(...arguments),this._hasEditableCoordinates=new o.WatchedValue(!1),this._finished=!1}pointsCount(){return-1}finished(){return this._finished}finish(){this._finished=!0,this._lastPoint=null,this._normalizePoints(),this.createServerPoints()}hasOnlyOnePoint(){return 1===this._points.length}addPoint(e,t,i){if(this._finished)return!0;if(this._lastPoint=null,this._points.length>0){const t=this._points[this._points.length-1],i=(0,s.ensureNotNull)(this.pointToScreenPoint(t));if((0,s.ensureNotNull)(this.pointToScreenPoint(e)).subtract(i).length()<2)return this._finished}return super.addPoint(e),this._finished}restorePoints(e,t,i){super.restorePoints(e,t,i),this._finished=!0}}},62828:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolCallout:()=>d});var s,n=i(88960),o=i(94784),r=i(12988),a=i(32679),l=i(42752),c=i(73305),h=i(10568);!function(e){e[e.PointsCount=2]="PointsCount",e.Name="Callout"}(s||(s={}));class d extends h.InplaceTextLineDataSource{constructor(e,t,s,n){
super(e,t||d.createProperties(e.backgroundTheme().spawnOwnership()),s,n),this._barOffset=0,this._dragStartLeftEdgeIndex=NaN,this._timeScale=e.timeScale(),Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,31463)).then((e=>{this._paneView=new e.CalloutPaneView(this,this._model,this._openTextEditor.bind(this),this._closeTextEditor.bind(this),this.onSelectionChange.bind(this)),this._setPaneViews([this._paneView])}))}pointsCount(){return 2}name(){return"Callout"}getBarOffset(){return this._barOffset}editableTextProperties(){const e=this.properties().childs();return{text:e.text,textColor:e.color,wordWrap:e.wordWrap}}removeIfEditableTextIsEmpty(){return!0}activateEditingOnCreation(){return!0}shouldBeRemovedOnDeselect(){const e=this._properties.childs().text.value().trim();return this._points.length===this.pointsCount()&&""===e}addPoint(e){const t=super.addPoint(e);return t&&this._calculateBarOffset(),t}setLastPoint(e){const t=super.setLastPoint(e);return 2===this.points().length&&this._calculateBarOffset(),t}setPoint(e,t){switch(e){case 0:super.setPoint(e,t),this._calculateBarOffset();break;case 1:const i=this.properties().childs();if(!i.wordWrapWidth)return;const s=this._points,n=this._dragStartLeftEdgeIndex,o=Math.round((t.index-n)/2),r=this._model.mainSeries().interval();if(isFinite(n)&&isFinite(o)){s[1]={index:n+o,price:s[1].price,interval:r},this._calculateBarOffset(),this._normalizePoints();const e=this._timeScale.indexToCoordinate(n+2*o)-this._timeScale.indexToCoordinate(n)-8-2;if(!isFinite(e))return;i.wordWrapWidth.setValue(Math.max(100,e));break}s[1]={...t,interval:r},this._calculateBarOffset(),this._normalizePoints()}}setPoints(e){super.setPoints(e);const t=this.properties().childs();if(!t.wordWrapWidth)return;const i=this._dragStartLeftEdgeIndex,s=Math.round((e[1].index-i)/2);if(this._calculateBarOffset(),this._normalizePoints(),isFinite(i)&&isFinite(s)){const e=this._timeScale.indexToCoordinate(i+2*s)-this._timeScale.indexToCoordinate(i)-8-2;if(!isFinite(e))return;t.wordWrapWidth.setValue(Math.max(100,e))}}move(e,t,i){super.move(e,t,i),this._calculateBarOffset()}state(e){const t=super.state(e);return t.barOffset=this._barOffset,t}restoreData(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this.calculatePoint2()}setPriceScale(e){super.setPriceScale(e),e&&e.priceRange()&&this.calculatePoint2()}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}calculatePoint2(){if(this._model.lineBeingEdited()===this||this._model.sourcesBeingMoved().includes(this))return;if(this._points.length<2)return;const[e,t]=this.points();this._points[1]={price:t.price,index:e.index+this._barOffset,interval:this._model.mainSeries().interval()}}static createProperties(e,t){const i=new a.DefaultProperty({defaultName:"linetoolcallout",state:t,theme:e});return this._configureProperties(i),i}_applyTemplateImpl(e){this.properties().childs().text.setValue(e.text),super._applyTemplateImpl(e)}_correctPoints(e,t){
if(e.lengthe(t.value(),i.value())),(0,l.convertPropertyToWatchedValue)(t).ownership(),(0,l.convertPropertyToWatchedValue)(i).ownership()).ownership()}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(3401),i.e(3889),i.e(8009),i.e(6204),i.e(1963),i.e(8537)]).then(i.bind(i,29908))).CalloutDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new r.Property("")),e.addExcludedKey("text",1),e.addChild("textsColors",new c.LineToolColorsProperty([e.childs().color]))}_calculateBarOffset(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)}}},97435:(e,t,i)=>{"use strict";i.d(t,{CircleRenderer:()=>r});var s=i(34026),n=i(56468),o=i(61993);class r{constructor(e){this._data=e??null}setData(e){this._data=e}draw(e,t){if(null===this._data)return;const{center:i,radius:s,lineWidth:n,color:o,backColor:r}=this._data;e.save();const{horizontalPixelRatio:a,verticalPixelRatio:l}=t,c=Math.max(1,Math.floor(a)),h=c%2/2,d=Math.round(i.x*a)+h,u=Math.round(i.y*l)+h,_=Math.round(d+s*a),p=Math.max(1,Math.floor(n*a)),m=_-d-p;m>0&&(e.fillStyle=r,e.beginPath(),e.moveTo(d+m,u),e.arc(d,u,m,0,2*Math.PI,!1),e.fill());const g=Math.max(c/2,_-d-p/2);e.strokeStyle=o,e.lineWidth=p,e.beginPath(),e.moveTo(d+g,u),e.arc(d,u,g,0,2*Math.PI,!1),e.stroke(),e.restore()}hitTest(e){if(null===this._data||this._data.disableInteractions)return null;const{center:t,radius:i,backgroundHitTarget:r}=this._data,a=(0,o.interactionTolerance)().curve;if(!(0,s.pointInCircle)(e,t,i+a))return null;const l=i>a&&(0,s.pointInCircle)(e,t,i-a)?r??n.HitTarget.MovePointBackground:n.HitTarget.MovePoint;return new n.HitTestResult(l)}}},35578:(e,t,i)=>{"use strict";i.d(t,{DEFAULT_LINE_TOOL_LINE_WIDTH:()=>s});const s=2},65365:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolElliott:()=>m,LineToolElliottCorrection:()=>T,LineToolElliottDegree:()=>s,LineToolElliottDoubleCombo:()=>I,LineToolElliottImpulse:()=>y,LineToolElliottTriangle:()=>S,LineToolElliottTripleCombo:()=>w});var s,n,o=i(11542),r=i(45126),a=i(29875),l=i(29023),c=i(32679),h=i(73305),d=i(85719);!function(e){e[e.Supermillennium=0]="Supermillennium",
e[e.Millennium=1]="Millennium",e[e.Submillennium=2]="Submillennium",e[e.GrandSupercycle=3]="GrandSupercycle",e[e.Supercycle=4]="Supercycle",e[e.Cycle=5]="Cycle",e[e.Primary=6]="Primary",e[e.Intermediate=7]="Intermediate",e[e.Minor=8]="Minor",e[e.Minute=9]="Minute",e[e.Minuette=10]="Minuette",e[e.Subminuette=11]="Subminuette",e[e.Micro=12]="Micro",e[e.Submicro=13]="Submicro",e[e.Minuscule=14]="Minuscule"}(s||(s={})),function(e){e[e.Current=4]="Current"}(n||(n={}));const u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],_=new r.TranslatedString("change Elliott degree",o.t(null,void 0,i(47977))),p=[{value:0,title:o.t(null,void 0,i(3348))},{value:1,title:o.t(null,void 0,i(87957))},{value:2,title:o.t(null,void 0,i(63375))},{value:3,title:o.t(null,void 0,i(57726))},{value:4,title:o.t(null,void 0,i(67948))},{value:5,title:o.t(null,void 0,i(87380))},{value:6,title:o.t(null,void 0,i(59189))},{value:7,title:o.t(null,void 0,i(10268))},{value:8,title:o.t(null,{context:"wave"},i(67736))},{value:9,title:o.t(null,{context:"wave"},i(922))},{value:10,title:o.t(null,void 0,i(14724))},{value:11,title:o.t(null,void 0,i(30585))},{value:12,title:o.t(null,void 0,i(24866))},{value:13,title:o.t(null,void 0,i(1145))},{value:14,title:o.t(null,void 0,i(78273))}];class m extends a.LineDataSource{constructor(e,t,s,n){super(e,t??m.createProperties(e.backgroundTheme().spawnOwnership()),s,n),this.version=4,Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,98424)).then((e=>{this._setPaneViews([new e.ElliottLabelsPaneView(this,this._model)])}))}migrateVersion(e,t,i){if(i.properties.hasChild("background")&&i.properties.removeProperty("background"),i.properties.hasChild("backgroundColor")&&i.properties.removeProperty("backgroundColor"),i.properties.hasChild("showBackground")&&i.properties.removeProperty("showBackground"),1===e){const e=Object.assign({},this._timePoint[0]);if(this._timePoint.unshift(e),this._points.length>0){const e=Object.assign({},this._points[0]);this._points.unshift(e)}}}applyTemplate(e){const t=e;delete t.background,delete t.backgroundColor,delete t.showBackground,super.applyTemplate(e)}name(){return"Elliott Labels"}async additionalActions(e){return{actions:[new l.Action({actionId:"Chart.LineTool.Elliot.ChangeDegreeProperty",options:{label:o.t(null,void 0,i(23403)),subItems:u.map((t=>{const i=p.filter((e=>e.value===t))[0];return new l.Action({actionId:"Chart.LineTool.Elliot.ChangeDegreeProperty",options:{label:i.title,checkable:!0,checked:this.properties().childs().degree.value()===t,onExecute:()=>{e.setProperty(this.properties().childs().degree,t,_,d.lineToolsDoNotAffectChartInvalidation)}}})}))}})],placement:"CustomAction"}}label(e){const t=u.length-this.properties().childs().degree.value()-1,i=Math.floor(t/3);return{group:i,bold:!!(i%2),decoration:["","brackets","circle"][t%3],label:this.labelsGroup()[i][e]}}availableDegreesValues(){return p}static createProperties(e,t){const i=new c.DefaultProperty({defaultName:"linetoolelliott",state:t,theme:e});return this._configureProperties(i),i}static migrateState(e){const t={0:11,1:10,2:9,
3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinor"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottCircle"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize]),"LineToolElliottMajorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize])}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(3401),i.e(3889),i.e(8009),i.e(6204),i.e(1963),i.e(8537)]).then(i.bind(i,70491))).ElliottPatternDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new h.LineToolColorsProperty([e.childs().color])),e.addExcludedKey("linesColors",3)}}class g extends m{pointsCount(){return 6}}const f=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]];class y extends g{constructor(e,t,i,s){super(e,t??y.createProperties(e.backgroundTheme().spawnOwnership()),i,s)}name(){return"Elliott Impulse Wave (12345)"}labelsGroup(){return f}static createProperties(e,t){const i=new c.DefaultProperty({defaultName:"linetoolelliottimpulse",state:t,theme:e});return this._configureProperties(i),i}}const v=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]];class S extends g{constructor(e,t,i,s){super(e,t??S.createProperties(e.backgroundTheme().spawnOwnership()),i,s)}name(){return"Elliott Triangle Wave (ABCDE)"}labelsGroup(){return v}static createProperties(e,t){const i=new c.DefaultProperty({defaultName:"linetoolelliotttriangle",state:t,theme:e});return this._configureProperties(i),i}}const b=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]];class w extends g{constructor(e,t,i,s){super(e,t??w.createProperties(e.backgroundTheme().spawnOwnership()),i,s)}name(){return"Elliott Triple Combo Wave (WXYXZ)"}labelsGroup(){return b}static createProperties(e,t){const i=new c.DefaultProperty({defaultName:"linetoolelliotttriplecombo",state:t,theme:e});return this._configureProperties(i),i}}class C extends m{pointsCount(){return 4}}const P=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]];class T extends C{constructor(e,t,i,s){super(e,t??T.createProperties(e.backgroundTheme().spawnOwnership()),i,s)}name(){return"Elliott Correction Wave (ABC)"}labelsGroup(){return P}static createProperties(e,t){const i=new c.DefaultProperty({defaultName:"linetoolelliottcorrection",state:t,theme:e});return this._configureProperties(i),i}}const x=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]];class I extends C{constructor(e,t,i,s){
super(e,t??I.createProperties(e.backgroundTheme().spawnOwnership()),i,s)}name(){return"Elliott Double Combo Wave (WXY)"}labelsGroup(){return x}static createProperties(e,t){const i=new c.DefaultProperty({defaultName:"linetoolelliottdoublecombo",state:t,theme:e});return this._configureProperties(i),i}}},56991:(e,t,i)=>{"use strict";i.r(t),i.d(t,{ExecutionLineAdapter:()=>_,ExecutionsPositionController:()=>u,LineToolExecution:()=>p});var s=i(50151),n=i(29875),o=i(91920),r=i(32679),a=i(8025),l=i(56570),c=i(2718),h=i(44672);const d=c.sortSourcesPreOrdered.LineToolExecution;class u{constructor(e){this._pane=e}getXYCoordinate(e,t,i){let n=0;const o=e.getDirection(),r="buy"===o,l=this._pane.model().mainSeries();if(l.bars){const e=r?10:-10,t=l.bars().search(i,a.PlotRowSearchMode.NearestLeft);if(null!==t){i=t.index;const o=r?t.value[3]:t.value[2],a=l.priceScale(),c=(0,s.ensureNotNull)(l.firstValue());n=a.priceToCoordinate(o,c)+e}}e.setAlignedTimePointIndex(i);const c=t.visibleBarsStrictRange();if(!isFinite(i)||null===c||i>c.lastBar()||i=0;--t){const s=h[t];if(!(s instanceof p)||s.adapter().alignedTimePointIndex()!==i||s.adapter().getDirection()!==o)continue;if(s===e.line())break;const a=s.adapter().height();n=r?n+a:n-a}return{x:t.indexToCoordinate(i),y:n}}static recreateOrderedByBarsSourcesCache(e){this.clearOrderedByBarsSourcesCache();const t=e.sourcesByGroup().all();for(const e of t){if(!(e instanceof p))continue;const t=e.adapter().alignedTimePointIndex();if(void 0===t)continue;const i=u._cachedByBarIndexOrderedExecutions[t]||[];u._cachedByBarIndexOrderedExecutions[t]=i,i.push(e)}}static clearOrderedByBarsSourcesCache(){u._cachedByBarIndexOrderedExecutions={}}}u._cachedByBarIndexOrderedExecutions={};class _{constructor(e,t){this._unixtime=NaN,this._line=e,this._model=t}alignedTimePointIndex(){return this._alignedTimePointIndex}setAlignedTimePointIndex(e){this._alignedTimePointIndex=e}line(){return this._line}getIndex(){return this._model.timeScale().baseIndex()-this._line.points()[0].index}setIndex(e){const t=this._model.timeScale().baseIndex()-Math.abs(e);this._line.startMoving({logical:this._line.points()[0]});const i={...this._line.points()[0]};return i.index=t,this._line.move({logical:i}),this._line.endMoving(!1),this}getTime(){return this._unixtime}setTime(e){return this._unixtime=e,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this}getPrice(){return this._line.points().length>0?this._line.points()[0].price:this._line.normalizedPoints().length>0?this._line.normalizedPoints()[0].price:NaN}setPrice(e){return this._line.points().length>0&&(this._line.points()[0].price=e),this._line.normalizedPoints().length>0&&(this._line.normalizedPoints()[0].price=e),this}getText(){return this._line.properties().childs().text.value()}setText(e){return this._line.properties().childs().text.setValue(e||""),
this._line.updateAllViewsAndRedraw((0,h.sourceChangeEvent)(this._line.id())),this}getArrowHeight(){return this._line.properties().childs().arrowHeight.value()}setArrowHeight(e){return this._line.properties().childs().arrowHeight.setValue(e||5),this}getArrowSpacing(){return this._line.properties().childs().arrowSpacing.value()}setArrowSpacing(e){return this._line.properties().childs().arrowSpacing.setValue(e||1),this}getDirection(){return this._line.properties().childs().direction.value()}setDirection(e){return this._line.properties().childs().direction.setValue(e||"buy"),this}getArrowColor(){const e=this._line.properties().childs();return"buy"===this.getDirection()?e.arrowBuyColor.value():e.arrowSellColor.value()}setArrowColor(e){return"buy"===this.getDirection()?this.setArrowBuyColor(e):this.setArrowSellColor(e),this}setArrowBuyColor(e){return this._line.properties().childs().arrowBuyColor.setValue(e),this}setArrowSellColor(e){return this._line.properties().childs().arrowSellColor.setValue(e),this}getTextColor(){const e=this._line.properties().childs();return o.getColorFromProperties(e.textColor,e.textTransparency)}setTextColor(e){const t=this._line.properties().childs();return o.setColorToProperties(e,t.textColor,t.textTransparency),this}getFont(){const e=this._line.properties().childs();return o.getFontFromProperties(e.fontFamily,e.fontSize,e.fontBold,e.fontItalic)}setFont(e){const t=this._line.properties().childs();return o.setFontToProperties(e,t.fontFamily,t.fontSize,t.fontBold,t.fontItalic),this}setTooltip(e){return null==e?e="":e+="",this._line.properties().childs().tooltip.setValue(e),this}getTooltip(){return this._line.properties().childs().tooltip.value()}remove(){this._model.removeSource(this._line)}getPoints(){return this._line.points()}height(){const e=this.getArrowHeight(),t=this.getArrowSpacing();let i=0;this.getText()&&(i=o.fontHeight(this.getFont()));return e+t+i+10}}class p extends n.LineDataSource{constructor(e,t,s,n){super(e,t??p.createProperties(e.backgroundTheme().spawnOwnership()),s,n),this._adapter=new _(this,e),this.customization.forcePriceAxisLabel=!1,this.customization.disableErasing=!0,this.setSelectionEnabled(!1),Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,256)).then((e=>{this._setPaneViews([new e.ExecutionPaneView(this,this._model)])}))}adapter(){return this._adapter}zorder(){return d}isSpeciallyZOrderedSource(){return!0}pointsCount(){return 1}name(){return"Execution"}hasContextMenu(){return!1}state(){return{}}updateAllViews(e){if(this._isVisible())return super.updateAllViews(e)}priceAxisViews(e,t){return this._isVisible()?super.priceAxisViews(e,t):null}paneViews(){return window.TradingView.printing&&!l.enabled("snapshot_trading_drawings")?null:this._isVisible()?super.paneViews():null}userEditEnabled(){return!1}showInObjectTree(){return!1}cloneable(){return!1}copiable(){return!1}isSynchronizable(){return!1}static createProperties(e,t){const i=new r.DefaultProperty({defaultName:"linetoolexecution",state:t,useUserPreferences:!1,theme:e});return p._configureProperties(i),i}
_isVisible(){return this._model.properties().childs().tradingProperties.childs().showExecutions.value()}}},37968:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LineToolGhostFeed:()=>c});var s=i(32679),n=i(29875),o=i(50151),r=i(37265);class a{constructor(e,t,i){this._source=e,this._segmentIndex=t,this._bars=i??[]}setBars(e){this._bars=e}clone(e){return new a(e,this._segmentIndex,(0,r.clone)(this._bars))}generate(){this._bars=[];const e=this._source.points(),t=e[this._segmentIndex],i=e[this._segmentIndex+1];if(!t||!i||t.index===i.index)return;const s=this._segmentIndex?t.index+1:t.index,n=Math.sign(i.index-t.index);for(let e=s;e!==i.index;e+=n)this._bars.push(this._createBar())}bars(){return this._bars}setSize(e){if(e{this._setPaneViews([new t.GhostFeedPaneView(this,e)])}))}isSynchronizable(){return!1}destroy(){this.properties().onRestoreFactoryDefaults().unsubscribe(this,this._handleRestoringFactoryDefaults),super.destroy()}propertiesChanged(){super.propertiesChanged(),this._currentAverageHL===this.properties().childs().averageHL.value()&&this._currentVariance===this.properties().childs().variance.value()||this._regenerate()}pointsCount(){return-1}name(){return"Ghost Feed"}segmentBars(e){return this._segments[e].bars()}segments(){return this._segments}generateBars(e){this._segments.length<=e&&this._segments.push(new a(this,e)),this._segments[e].generate()}addPoint(e,t,i){if(this._finished)return!0;if(this._points.length>0){const i=this._points[this._points.length-1];if(!t?.isApiEvent()&&i.index===e.index){this._lastPoint=null,this._normalizePoints(),this.createServerPoints();for(let e=0;e1&&this.generateBars(this._points.length-2),s}finish(){this._finished=!0,this._lastPoint=null,this._normalizePoints(),this.createServerPoints()}
setPoint(e,t,i,s){if(super.setPoint(e,t,i),e>0){const i=this.points()[e-1],s=t.index-i.index;this._segments[e-1].setSize(Math.abs(s))}if(e({bars:[...e.bars()]}))),t}restoreData(e){e.segments&&(this._segments=e.segments.map(((e,t)=>new a(this,t,e.bars)))),this._currentAverageHL=this.properties().childs().averageHL.value(),this._currentVariance=this.properties().childs().variance.value()}onData(e){super.onData(e);if(!this.pointsProperty().childs().points.child("0"))for(let e=0;ee.clone(this)))}startMoving(e,t,i,s){super.startMoving(e,t,i,s),this._preparePixelSegments()}move(e,t,i,s){super.move(e,t,i,s),this._restoreSegmentsFromPixels()}endMoving(e,t){return this._segmentsPixelsWhileMoving=null,super.endMoving(e,t)}static createProperties(e,t){const i=new s.DefaultProperty({defaultName:"linetoolghostfeed",state:t,theme:e});return this._configureProperties(i),i}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(3401),i.e(3889),i.e(8009),i.e(6204),i.e(1963),i.e(8537)]).then(i.bind(i,9786))).GhostFeedDefinitionsViewModel}_handleRestoringFactoryDefaults(){const e=Math.round(this._calculateATR());this.properties().childs().averageHL.setValue(e)}_regenerate(){this._currentAverageHL=this.properties().childs().averageHL.value(),this._currentVariance=this.properties().childs().variance.value(),this._segments.forEach((e=>e.generate())),this.updateAllViews((0,l.sourceChangeEvent)(this.id())),this._model.updateSource(this)}_calculateATR(){const e=this._model.mainSeries(),t=[];e.bars().each(((e,i)=>{const s=i[2],n=i[3];return null!=s&&null!=n&&t.push(s-n),!1}));let i=0===t.length?0:t.reduce(((e,t)=>e+t),0)/t.length;return i*=e.base(),i}_preparePixelSegments(){const e=this.priceScale(),t=this.ownerSource()?.firstValue()??null;if(null===e||null===t||e.isEmpty()||!e.isLog())return;const i=this.points();this._segmentsPixelsWhileMoving=this._segments.map(((s,n)=>{const o=i[n].price,r=i[n+1].price,a=e.priceToCoordinate(o,t),l=(e.priceToCoordinate(r,t)-a)/(s.bars().length-1);return{bars:s.bars().map(((i,s)=>{const n=a+s*l,o=e.coordinateToPrice(n,t);return{open:e.priceToCoordinate(o+i.o,t)-n,high:e.priceToCoordinate(o+i.h,t)-n,low:e.priceToCoordinate(o+i.l,t)-n,close:e.priceToCoordinate(o+i.c,t)-n}}))}}))}_restoreSegmentsFromPixels(){const e=this.priceScale(),t=this.ownerSource()?.firstValue()??null;if(null===e||null===t||null===this._segmentsPixelsWhileMoving)return;const i=this.points();this._segmentsPixelsWhileMoving.forEach(((s,n)=>{const o=this._segments[n],r=i[n].price,a=i[n+1].price,l=e.priceToCoordinate(r,t),c=(e.priceToCoordinate(a,t)-l)/(s.bars.length-1),h=o.bars().map(((i,n)=>{
const o=s.bars[n],r=l+n*c,a=e.coordinateToPrice(r,t);return{...i,o:e.coordinateToPrice(o.open+r,t)-a,h:e.coordinateToPrice(o.high+r,t)-a,l:e.coordinateToPrice(o.low+r,t)-a,c:e.coordinateToPrice(o.close+r,t)-a}}));o.setBars(h)}))}}},6590:(e,t,i)=>{"use strict";i.d(t,{commonLineToolPropertiesStateKeys:()=>s});const s=["symbolStateVersion","zOrderVersion","frozen","title","interval","symbol","currencyId","unitId","visible","intervalsVisibilities.ticks","intervalsVisibilities.seconds","intervalsVisibilities.secondsFrom","intervalsVisibilities.secondsTo","intervalsVisibilities.minutes","intervalsVisibilities.minutesFrom","intervalsVisibilities.minutesTo","intervalsVisibilities.hours","intervalsVisibilities.hoursFrom","intervalsVisibilities.hoursTo","intervalsVisibilities.days","intervalsVisibilities.daysFrom","intervalsVisibilities.daysTo","intervalsVisibilities.weeks","intervalsVisibilities.weeksFrom","intervalsVisibilities.weeksTo","intervalsVisibilities.months","intervalsVisibilities.monthsFrom","intervalsVisibilities.monthsTo","intervalsVisibilities.ranges"];var n,o,r;!function(e){e[e.NotShared=0]="NotShared",e[e.SharedInLayout=1]="SharedInLayout",e[e.GloballyShared=2]="GloballyShared"}(n||(n={})),function(e){e.BeforeAllAction="BeforeAll",e.CustomAction="CustomAction"}(o||(o={})),function(e){e.FloatingToolbarButton="FloatingToolbarButton",e.Default="Default"}(r||(r={}))},25931:(e,t,i)=>{"use strict";i.d(t,{checkImageSize:()=>c,generateLink:()=>a,getMaxImageSizeInBytes:()=>d,getMaxImageSizeLabel:()=>u,imageIsOversized:()=>l,setImageStorageAdapter:()=>r,uploadImage:()=>h});var s=i(11542);const n=/data:(.+?);base64,(.+)/;let o=2e6;function r(e){o=e.getMaxImageSizeInBytes()}async function a(e){return new Promise(((t,i)=>{const s=new FileReader;s.addEventListener("load",(()=>t(s.result))),s.addEventListener("error",i),s.addEventListener("abort",i),s.readAsDataURL(e)}))}function l(e){return function(e){const t=e.match(n);if(null===t)return 1/0;const[i,s,o]=t,r=atob(o),a=new Array(r.length);for(let e=0;eo}async function c(e){return e.size<=o}async function h(e){if(!await c(e))throw new Error(s.t(null,{replace:{value:u()}},i(93738)));return a(e)}function d(){return o}function u(){const e=Math.floor(Math.log(o)/Math.log(1e3));return`${(o/Math.pow(1e3,e)).toFixed(2)}${["Bytes","KB","MB","GB","TB","PB"][e]}`}},3503:(e,t,i)=>{"use strict";i.d(t,{blobImageFilter:()=>n,checkImageSize:()=>a,generateLink:()=>r,getMaxImageSizeInBytes:()=>c,getMaxImageSizeLabel:()=>h,imageIsOversized:()=>o,uploadImage:()=>l});var s=i(25931);function n(e){return"image/png"===e.type||"image/jpeg"===e.type||"image/webp"===e.type}function o(e){return s.imageIsOversized(e)}async function r(e){return{status:"ok",data:{url:await s.generateLink(e),fields:{}},filename:"",filepath:""}}async function a(e){return s.checkImageSize(e)}async function l(e){return s.uploadImage(e)}function c(){return s.getMaxImageSizeInBytes()}function h(){
return s.getMaxImageSizeLabel()}},70262:(e,t,i)=>{"use strict";i.d(t,{drawSelection:()=>r,getSymbolCoordinatesInfo:()=>o});var s=i(63273),n=i(7114);function o(e){const{symbolPosition:t,textWidth:i,textByLines:o,lineHeight:r,font:a,textAlign:l,lineSpacing:c=0}=e;let h=0,d=0;const u=(0,s.isRtl)(),_=r+c;let p=0,m=0,g="";for(let e=0;ey.length){p+=y.length+(r&&!c?0:1),f||(h+=_);continue}f&&(h-=_);const S=r&&!c&&y.length===s&&v&&!v.hidden;if(f&&(g+=" ",s=g.length),"center"===l)if(S)d=i/2;else{const e=(0,n.measureText)(g,a).width,t=(0,n.measureText)(g.slice(0,s),a).width,o=i/2;d=u?o+e/2-t:o-e/2+t}else if("right"===l&&!u||"left"===l&&u||"end"===l)if(S)d=i;else{const e=(0,n.measureText)(g.slice(s),a).width;d=u?e:i-e}else if(S)d=0;else{const e=(0,n.measureText)(g.slice(0,s),a).width;d=u?i-e:e}S?(m=e+1,h+=_):m=e;break}return{x:d,y:h,lineNumber:m}}function r(e,t,i){const{lines:o,selectionStart:r,selectionEnd:l,left:c,right:h,color:d,font:u,lineHeight:_,lineSpacing:p=0}=i;e.save();const m=(c+h)/2,g=_+p,f=(0,s.isRtl)();e.fillStyle=d;const{horizontalPixelRatio:y,verticalPixelRatio:v}=t;if(r.lineNumber===l.lineNumber){const t=Math.round(r.x*y),i=Math.round(r.y*v),s=Math.round(l.x*y);e.fillRect(Math.min(t,s),i,Math.abs(t-s),Math.round(g*v))}else{const t=(0,n.measureText)(" ",u).width;let i=0;for(let s=r.lineNumber;s<=l.lineNumber;s+=1){const n=s===r.lineNumber,d=s===l.lineNumber,_=o[s];if(_.hidden)continue;const p=a(_.text,u);let S,b,w=!1;"center"===e.textAlign?(S=n?r.x:f?m+p/2:m-p/2,b=d?l.x:f?m-p/2:m+p/2):"right"===e.textAlign||f&&"start"===e.textAlign||!f&&"end"===e.textAlign?(S=n?r.x:h-p,b=d?l.x:h,w=!0):(S=n?r.x:c,b=d?l.x:c+p);let C=Math.min(S,b),P=Math.max(S,b);d||_.wrappedLinePart&&!_.wrappedLineEnd||(w?C-=t:P+=t);const T=Math.round(C*y),x=Math.round(P*y),I=Math.round((r.y+i*g)*v),M=Math.round((r.y+(i+1)*g)*v);e.fillRect(T,I,x-T,M-I),i+=1}}e.restore()}function a(e,t){return(0,n.measureText)(e,t).width}},10568:(e,t,i)=>{"use strict";i.d(t,{InplaceTextLineDataSource:()=>v,InplaceTextUndoCommand:()=>y});var s=i(50279),n=i(50151),o=i(86441),r=i(19625),a=i(24377),l=i(11542),c=i(45126),h=i(88960),d=i(64147),u=i(60265),_=i(29875),p=i(44672),m=i(85719);const g={selectionColor:(0,r.getHexColorByName)("color-tv-blue-500"),cursorColor:(0,r.getHexColorByName)("color-black")},f={selectionColor:(0,r.getHexColorByName)("color-white"),cursorColor:(0,r.getHexColorByName)("color-white")};class y extends u.UndoCommand{constructor(e,t,s,n){super(new c.TranslatedString("change {title} text",l.t(null,void 0,i(57122))).format({title:new c.TranslatedString(t.name(),t.translatedType())}),!0,!m.lineToolsDoNotAffectChartInvalidation),this._sourceId=t.id(),this._model=e,this._oldValue=s,this._newValue=n,this._changeVisibility=!1===t.editableTextProperties().textVisible?.value()}redo(){const e=this._source();this._textProperty(e).setValue(this._newValue),this._changeVisibility&&this._textVisibilityProperty(e)?.setValue(!0)}
undo(){const e=this._source();this._textProperty(e).setValue(this._oldValue),this._changeVisibility&&this._textVisibilityProperty(e)?.setValue(!1)}_textProperty(e){return e.editableTextProperties().text}_textVisibilityProperty(e){return e.editableTextProperties().textVisible}_source(){return(0,n.ensureNotNull)(this._model.dataSourceForId(this._sourceId))}}class v extends _.LineDataSource{constructor(e,t,s,n){super(e,t,s,n),this._container=null,this._editableText=new d.WatchedValue(""),this._activateTextEditingEl=null,this._paneView=null,this._selectionData={},this._cursorPaneView=null,this._cursorPosition=null,this._editingOnCreation=!1,this._editingActivationTime=null,this._editableText.subscribe((()=>{this.updateAllViewsAndRedraw((0,p.sourceChangeEvent)(this.id()))})),this._isDarkBackground=(0,h.combine)(((e,t)=>{if(null===t)return this._model.dark().value();const i=(0,a.blendRgba)((0,a.parseRgba)(e),(0,a.parseRgba)(t));return"black"===(0,a.rgbToBlackWhiteString)([i[0],i[1],i[2]],150)}),this._model.backgroundColor().spawnOwnership(),this._createDataSourceBackgroundColorWV()),Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,15852)).then((t=>{this._cursorPaneView=new t.InplaceTextCursorPaneView(this,e),this._additionalCursorDataGetters&&(this._cursorPaneView.setAdditionalCursorData(...this._additionalCursorDataGetters),null!==this._cursorPosition&&(this._cursorPaneView.setCursorPosition(this._cursorPosition),e.updateSource(this)))}))}destroy(){this._isDarkBackground.destroy(),this._editableText.unsubscribe(),this._closeTextEditor(),super.destroy()}editableTextStyle(){return{...this._isDarkBackground.value()?f:g}}removeIfEditableTextIsEmpty(){return!1}activateEditingOnCreation(){return!1}topPaneViews(e){return e.hasDataSource(this)&&!window.TradingView.printing&&this._cursorPaneView?(this._cursorPaneView.update((0,p.sourceChangeEvent)(this.id())),[this._cursorPaneView]):null}dataAndViewsReady(){return super.dataAndViewsReady()&&null!==this._cursorPaneView}editableText(){return this._editableText}textEditingEl(){return this._activateTextEditingEl}activateTextEditingOn(e,t){this._activateTextEditingEl=e,this._editingOnCreation=!!t,this._editingActivationTime=performance.now(),this.updateAllViewsAndRedraw((0,p.sourceChangeEvent)(this.id()))}deactivateTextEditing(){this._closeTextEditor()}textEditingActivationTime(){return this._editingActivationTime}onSelectionChange(e){const t={};if(void 0!==e){const{start:i,end:s}=e;i===s?t.cursorPosition=i:t.selectionRange=[Math.min(i,s),Math.max(i,s)]}(0,s.default)(t,this._selectionData)||(this._selectionData=t,this._paneViews.forEach((e=>{e.forEach((e=>{"setSelectionRange"in e&&e.setSelectionRange(t.selectionRange)}))})),this._cursorPaneView?this._cursorPaneView.setCursorPosition(t.cursorPosition):this._cursorPosition=t.cursorPosition??null,this.updateAllViewsAndRedraw((0,p.sourceChangeEvent)(this.id())))}setAdditionalCursorData(e,t){this._cursorPaneView?this._cursorPaneView.setAdditionalCursorData(e,t):this._additionalCursorDataGetters=[e,t]}_updateAllPaneViews(e){
super._updateAllPaneViews(e),this._cursorPaneView?.update(e)}async _openTextEditor(e,t,s,r,a){if(null!==this._container)return;null===this._editingActivationTime&&(this._editingActivationTime=performance.now()),this._activateTextEditingEl=null,this._cursorPosition=null,this._container=document.createElement("div"),this._container.style.position="absolute",this._container.style.top="0",this._container.style.bottom="0",this._container.style.left="0",this._container.style.right="0",this._container.style.overflow="hidden",this._container.style.pointerEvents="none",e.appendChild(this._container);const{updateChartEditorText:l,closeChartEditorText:c}=await Promise.all([i.e(4556),i.e(2227),i.e(5592)]).then(i.bind(i,99514));if(null===this._container||this._isDestroyed)return;this._closeChartEditorText=c;const{text:h,textColor:d,wordWrap:u}=this.editableTextProperties(),{forbidLineBreaks:_,maxLength:m}=this.editableTextStyle();this._editableText.setValue(h.value());const g=this.isFixed()?(0,n.ensureDefined)(this.fixedPoint()):(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[0])),f={position:(0,o.point)(g.x,g.y),textInfo:t,placeholder:s,text:this._editableText,textColor:d,wordWrap:u,forbidLineBreaks:_,maxLength:m,onClose:r,onSelectionChange:a,onContextMenu:this.onContextMenu?this.onContextMenu.bind(this):void 0};l(this._container,f),this.updateAllViewsAndRedraw((0,p.sourceChangeEvent)(this.id()))}_closeTextEditor(){null===this._container||this._isDestroyed||(this._editingActivationTime=null,this._saveEditedText(),this._editingOnCreation=!1,this.onSelectionChange(),this._closeChartEditorText?.(this._container),this._closeChartEditorText=void 0,this._container.remove(),this._container=null,this.updateAllViewsAndRedraw((0,p.sourceChangeEvent)(this.id())))}_saveEditedText(){const e=this.editableTextProperties().text.value(),t=this._editableText.value();e!==t&&(this._editingOnCreation?this.editableTextProperties().text.setValue(t):this._model.undoModel().undoHistory().pushUndoCommand(this._changeEditableTextUndoCommand(e,t)))}_changeEditableTextUndoCommand(e,t){return new y(this._model,this,e,t)}_createDataSourceBackgroundColorWV(){return new d.WatchedValue(null).readonly().ownership()}}},15764:(e,t,i)=>{"use strict";i.d(t,{isLineDrawnWithPressedButton:()=>l,isLineToolDrawWithoutPoints:()=>h,isLineToolFinishRequiredWhenCreatedByApi:()=>c,isLineToolName:()=>a,isMtpPredictorToolName:()=>o,isStudyLineToolName:()=>r,isTextToolName:()=>d,simpleLineToolNames:()=>n})
;const s=new Set([]),n=new Set(["LineToolFibRetracement","LineToolFibChannel","LineToolFibSpeedResistanceArcs","LineToolProjection","LineToolTrendBasedFibExtension","LineToolElliott","LineToolFibCircles","LineToolVertLine","LineToolCrossLine","LineToolBarsPattern","LineToolTrendBasedFibTime","LineToolFibTimeZone","LineToolCircleLines","LineToolDateRange","LineToolPriceRange","LineToolDateAndPriceRange","LineToolParallelChannel","LineToolTrendAngle","LineToolTrendLine","LineToolInfoLine","LineToolArrowMark","LineToolPitchfan","LineToolGannSquare","LineToolFibSpeedResistanceFan","LineToolGannComplex","LineToolGannFixed","LineToolGannFan","LineToolFibWedge","LineToolPitchfork","LineToolDisjointAngle","LineToolFlatBottom","LineToolIcon","LineToolEmoji","LineToolSticker","LineToolRotatedRectangle","LineToolFibSpiral","LineToolHeadAndShoulders","LineToolTriangle","LineToolTrianglePattern","LineTool5PointsPattern","LineToolThreeDrivers","LineToolABCD","LineToolPolyline","LineToolPath","LineToolPrediction","LineToolPriceLabel","LineToolPriceNote","LineToolTextNote","LineToolNote","LineToolNoteAbsolute","LineToolArrowMarker","LineToolSignpost","LineToolBrush","LineToolArc","LineToolCallout","LineToolBalloon","LineToolComment","LineToolText","LineToolHorzLine","LineToolHorzRay","LineToolRectangle","LineToolCircle","LineToolEllipse","LineToolTimeCycles","LineToolSineLine","LineToolGhostFeed","LineToolBezierQuadro","LineToolBezierCubic","LineToolArrow","LineToolRay","LineToolExtended","LineToolSchiffPitchfork","LineToolSchiffPitchfork2","LineToolInsidePitchfork","LineToolTextAbsolute","LineToolArrowMarkLeft","LineToolArrowMarkRight","LineToolArrowMarkUp","LineToolArrowMarkDown","LineToolFlagMark","LineToolCypherPattern","LineToolElliottImpulse","LineToolElliottTriangle","LineToolElliottTripleCombo","LineToolElliottCorrection","LineToolElliottDoubleCombo","LineToolRiskRewardLong","LineToolRiskRewardShort","LineToolPosition","LineToolOrder","LineToolHighlighter","LineToolTable","LineToolImage"]);function o(e){return s.has(e)}function r(e){return"LineToolRegressionTrend"===e||"LineToolVbPFixed"===e||"LineToolFixedRangeVolumeProfile"===e||"LineToolAnchoredVolumeProfile"===e||"LineToolAnchoredVWAP"===e}function a(e){return n.has(e)||r(e)}function l(e){return"LineToolBrush"===e||"LineToolHighlighter"===e}function c(e){return l(e)||"LineToolPath"===e||"LineToolPolyline"===e||"LineToolGhostFeed"===e}function h(e){return"LineToolTweet"===e||"LineToolIdea"===e||"LineToolImage"===e}function d(e){switch(e){case"LineToolBalloon":case"LineToolComment":case"LineToolText":case"LineToolTextAbsolute":case"LineToolCallout":case"LineToolNote":case"LineToolNoteAbsolute":case"LineToolSignpost":return!0}return!1}n.add("LineToolExecution")},78956:(e,t,i)=>{"use strict";i.d(t,{isLineTool:()=>n});var s=i(29875);function n(e){return e instanceof s.LineDataSource}},20834:(e,t,i)=>{"use strict";i.d(t,{LineDataSourcePointIndexProperty:()=>n});var s=i(12988);class n extends s.Property{constructor(e,t){super(),this._waitingPointsetUpdate=!1,this._lineSource=e,
this._pointIndex=t,this._cachedIndex=this.value()}value(){const e=this._lineSource.points();return 0===e.length?this._cachedIndex:e[this._pointIndex].index}setValue(e){this._cachedIndex=e;const t=this._lineSource.points(),i=e=>{const t=this._lineSource.points()[this._pointIndex];if(t.index===e)return;t.index=e,this._lineSource.startChanging(this._pointIndex,t),this._setPointImpl(t),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this,"");const i=this._lineSource.endChanging(!0,!1);this._lineSource.syncMultichartState(i)};if(0===t.length){const e=()=>{i(this._cachedIndex),this._waitingPointsetUpdate=!1};if(this._waitingPointsetUpdate)return;this._lineSource.pointsetUpdated().subscribe(this,e,!0),this._waitingPointsetUpdate=!0}else i(e)}_setPointImpl(e){this._lineSource.setPoint(this._pointIndex,e)}}},90793:(e,t,i)=>{"use strict";i.d(t,{LineToolPriceAxisView:()=>r});var s=i(50151),n=i(98558),o=i(19063);class r extends n.PriceAxisView{constructor(e,t){super(),this._source=e,this._data=t,this._properties=e.model().properties().childs().scalesProperties}_updateRendererData(e,t,i){e.visible=!1;const s=this._source.model();if(!s.timeScale()||s.timeScale().isEmpty())return;const n=this._source.priceScale();if(null===n||n.isEmpty())return;if(!s.selection().isSelected(this._source)&&!this._source.isForcedDrawPriceAxisLabel())return;if(null===s.timeScale().visibleBarsStrictRange())return;const r=this._source.priceAxisPoints(),a=this._data.pointIndex;if(r.length<=a)return;const l=r[a];if(!isFinite(l.price))return;const c=this._source.ownerSource(),h=null!==c?c.firstValue():null;if(null===h)return;let d=this._data.backgroundPropertyGetter?this._data.backgroundPropertyGetter():null;null===d&&(d=this._getBgColor()),i.background=(0,o.resetTransparency)(d),i.borderColor="#2E84A6",i.textColor=this.generateTextColor(i.background),i.coordinate=n.priceToCoordinate(l.price,h),e.text=this._formatPrice(l.price,h),e.visible=!0}_getBgColor(){return this._active?this._properties.childs().axisLineToolLabelBackgroundColorActive.value():this._properties.childs().axisLineToolLabelBackgroundColorCommon.value()}_formatPrice(e,t){return(0,s.ensureNotNull)(this._source.priceScale()).formatPrice(e,t)}}},38039:(e,t,i)=>{"use strict";i.d(t,{LineDataSourceProperty:()=>a});var s=i(90054),n=i(16738),o=i(50151),r=i(32679);class a extends r.DefaultProperty{constructor({templateKeys:e,...t}){super({ignoreAllowSavingDefaults:!0,saveNonDefaultUserPreferencesOnly:!0,...t}),this._templateKeys=(0,o.ensureDefined)(e||this._allDefaultsKeys)}template(){return(0,r.extractState)(this.state(),this._templateKeys,[])}applyTemplate(e){this.mergeAndFire((0,r.extractState)((0,n.default)((0,s.default)(this._factoryDefaultsSupplier()),e),this._templateKeys))}}},14169:(e,t,i)=>{"use strict";i.d(t,{LineDataSourceTimeAxisView:()=>n});var s=i(66156);class n extends s.TimeAxisView{constructor(e,t){super(e.model()),this._active=!1,this._source=e,this._pointIndex=t,this._properties=e.model().properties().childs().scalesProperties}setActive(e){
this._active=e}_getBgColor(){return this._active?this._properties.childs().axisLineToolLabelBackgroundColorActive.value():this._properties.childs().axisLineToolLabelBackgroundColorCommon.value()}_getIndex(){if(!this._model.selection().isSelected(this._source))return null;const e=this._source.timeAxisPoints();return e.length<=this._pointIndex?null:e[this._pointIndex].index}_isVisible(){return!0}}},29875:(e,t,i)=>{"use strict";i.d(t,{LineDataSource:()=>z,changePointUndoText:()=>H});var s=i(7029),n=i(86441),o=i(50151),r=i(76422),a=i(9343),l=i(56570),c=i(53388),h=i(2740),d=i(52033),u=i(18832),_=i(64147),p=i(62288),m=i(45687),g=i(10892),f=i(31229),y=i(68805),v=i(76350),S=i(85049),b=i(12988),w=i(928),C=i(29137),P=i(94260),T=i(37265),x=i(44672),I=i(60074),M=i(45126),A=i(20834);class L extends b.Property{constructor(e,t){super(),this._lineSource=e,this._pointIndex=t,e.pointAdded().subscribe(this,(e=>{this._pointIndex===e&&this._listeners.fire(this,`${e}`)})),e.pointChanged().subscribe(this,(e=>{this._pointIndex===e&&this._listeners.fire(this,`${e}`)}))}value(){const e=this._lineSource.points()[this._pointIndex].price,t=(0,o.ensureNotNull)(this._lineSource.ownerSource()).formatter();if(t.parse){const i=t.format(e),s=t.parse(i);return s.res?s.value:e}return e}setValue(e){const t=this._lineSource.points()[this._pointIndex];t.price=parseFloat(""+e),this._lineSource.startChanging(this._pointIndex,t),this._lineSource.setPoint(this._pointIndex,t),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this,"");const i=this._lineSource.endChanging(!0,!1);this._lineSource.syncMultichartState(i)}}var k=i(14169),D=i(90793),E=i(73305),B=i(98523),V=i(35039),R=i(7927);const N=(0,a.getLogger)("Chart.LineDataSource"),O=l.enabled("datasource_copypaste");class F{constructor(){this._states=[]}start(e){this._states.push(e)}finish(e){const t=(0,o.ensureDefined)(this._states.pop());return s=t,(i=e).length!==s.length?{indexesChanged:!0,pricesChanged:!0}:i.reduce(((e,t,i)=>{const n=s[i];return e.indexesChanged=e.indexesChanged||t.index!==n.index,e.pricesChanged=e.pricesChanged||t.price!==n.price,e}),{indexesChanged:!1,pricesChanged:!1});var i,s}isEmpty(){return 0===this._states.length}}let W=0;const H=new M.TranslatedString("change point",s.t(null,void 0,i(76660)));class z extends C.DataSource{constructor(e,t,i,s){if(super(s),this.version=1,this.toolname="",this.customization={forcePriceAxisLabel:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},this._currentPointsetAndSymbolId=null,this._pointChanged=new d.Delegate,this._pointAdded=new d.Delegate,this._priceAxisViews=[],this._timeAxisViews=[],this._timePoint=[],this._points=[],this._lastPoint=null,this._paneViews=new Map,this._normalizedPointsChanged=new d.Delegate,this._fixedPointsChanged=new d.Delegate,this._changeStatesStack=new F,this._startMovingPoint=null,this._currentMovingPoint=null,this._isActualSymbol=!1,this._isActualInterval=!1,this._isActualCurrency=!1,this._isActualUnit=!1,this._sharingMode=new _.WatchedValue(0),this._onTemplateApplying=new d.Delegate,
this._onTemplateApplied=new d.Delegate,this._syncStateExclusions=["interval"],this._definitionsViewModel=null,this._hasEditableCoordinates=new _.WatchedValue(!0),this._syncLineStyleMuted=!1,this._onIsActualIntervalChange=new d.Delegate,this._onPointsetUpdatedDelegate=new d.Delegate,this._onServerUpdateTime=new d.Delegate,this._linkKey=new _.WatchedValue(null),this._serverUpdateTime=null,this._boundCalcIsActualSymbol=this.calcIsActualSymbol.bind(this),this._alignerCache=null,this._alertUndoMode=!1,this._onAlertStatusChanged=()=>{this.updateAllViewsAndRedraw((0,x.sourceChangeEvent)(this.id()))},this._model=e,this._properties=t,this._localAndServerAlertsMismatch=!1,this._properties.hasChild("interval")||this._properties.addChild("interval",new b.Property(e.mainSeries().interval())),this.calcIsActualSymbol(),this._properties.childs().intervalsVisibilities.subscribe(this,this.calcIsActualSymbol),this._properties.subscribe(this,this.propertiesChanged.bind(this,!1,void 0)),this.zOrderChanged().subscribe(this,this.propertiesChanged.bind(this,!0,void 0)),this._createPointsProperties(),this.pointsCount()>0)for(let e=0;e{const t=!1===(0,w.hideAllDrawings)().value();e.value()?e.value()&&t&&r.emit("drawing_event",this._id.value(),"show"):(this._model.selection().isSelected(this)&&this._model.selectionMacro((e=>{e.removeSourceFromSelection(this)})),t&&r.emit("drawing_event",this._id.value(),"hide")),this._onSourceHiddenMayChange()})),(0,w.hideAllDrawings)().subscribe(this,this._onSourceHiddenMayChange),this._sessionConnected=this._model.chartApi().isConnected().spawn(),this._sessionConnected.subscribe((e=>{e||(this._currentPointsetAndSymbolId=null)})),this._alertStatus.subscribe(this._onAlertStatusChanged),this._definitionsViewModel=null,this._properties.setNameInOwner((0,R.propertyPathForSource)(this))}destroy(){this._paneViews.forEach(((e,t)=>this._destroyPanePaneViews(t))),this.stop(),null!==this._definitionsViewModel&&(this._definitionsViewModel.destroy(),this._definitionsViewModel=null),null!==this._ownerSource&&(this._ownerSource.currencyChanged().unsubscribeAll(this),this._ownerSource.unitChanged().unsubscribeAll(this),(0,I.isSymbolSource)(this._ownerSource)&&(this._ownerSource.symbolResolved().subscribe(this,this._boundCalcIsActualSymbol),this._ownerSource.isActingAsSymbolSource().unsubscribe(this._boundCalcIsActualSymbol))),this.ownerSourceChanged().unsubscribeAll(this),(0,w.hideAllDrawings)().unsubscribeAll(this),this._sessionConnected.destroy(),this._alertStatus.unsubscribe(this._onAlertStatusChanged),this._properties.destroy(),super.destroy()}setId(e){super.setId(e),this._properties.setNameInOwner((0,R.propertyPathForSource)(this))}priceScale(){return this._ownerSource?this._ownerSource.priceScale():null}createPriceAxisView(e){return new D.LineToolPriceAxisView(this,{pointIndex:e})}model(){return this._model}symbol(){
return this._properties.childs().symbol.value()}linkKey(){return this._linkKey}serverUpdateTime(){return this._serverUpdateTime}setServerUpdateTime(e){this._serverUpdateTime=e,this._onServerUpdateTime.fire()}serverUpdateTimeChanged(){return this._onServerUpdateTime}boundToSymbol(){return!0}isAvailableInFloatingWidget(){return!0}points(){const e=[];for(let t=0;t{const i=(0,o.ensureNotNull)(this.pointToScreenPoint(t)),s=i.x/this._model.timeScale().width(),r=i.y/e.height();return new n.Point(s,r)}))}widthsProperty(){return this._properties.childs().linesWidths??null}lineColorsProperty(){return this._properties.childs().linesColors??null}backgroundColorsProperty(){return this._properties.childs().backgroundsColors??null}textColorsProperty(){return this._properties.childs().textsColors??null}pointsProperty(){return this._pointsProperty}hasEditableCoordinates(){return this._hasEditableCoordinates}startMoving(e,t,i,s){this.isFixed()&&this.restoreFixedPoint(),this._startMovingPoint=e}move(e,t,i,s){if(i&&(i.shiftOnly()||i.modShift()))if(this.isFixed()){const t=this._alignScreenPointHorizontallyOrVertically((0,o.ensureDefined)(e.screen));this._currentMovingPoint={screen:t}}else{const t=this._alignPointHorizontallyOrVertically((0,o.ensureDefined)(e.logical)),i=(0,o.ensureNotNull)(this.pointToScreenPoint(t));this._currentMovingPoint={logical:t,screen:i}}else this._currentMovingPoint=e;this.updateAllViews((0,x.sourceChangeEvent)(this.id()))}endMoving(e,t,i){let s=!1,n=!1;if(this._currentMovingPoint&&this._startMovingPoint){if(this.isFixed()){const e=this._correctFixedPoint((0,o.ensureDefined)(this._fixedPoint));e.didCorrect&&(this._fixedPoint=e.point,this._fixedPointsChanged.fire())}else{const e=(0,o.ensureDefined)(this._currentMovingPoint.logical),t=(0,o.ensureDefined)(this._startMovingPoint.logical);s=e.index!==t.index,n=e.price!==t.price
;if(this._correctPoints(this._points,i)){const e=this._id.value();r.emit("drawing_event",e,"move"),r.emit("drawing_event",e,"points_changed");for(let e=0;ee.interval=this._model.mainSeries().interval())),this.updateAllViews((0,x.sourceChangeEvent)(this.id())),s&&!e?(this._properties.childs().interval.setValue(this._model.mainSeries().interval()),this._normalizePoints(),this.createServerPoints()):(this._copyPricesWithoutNormalization(),this._normalizedPointsChanged.fire()),a)}startMovingPoint(){return this._startMovingPoint?{...this._startMovingPoint}:null}currentMovingPoint(){return this._currentMovingPoint?{...this._currentMovingPoint}:null}changePointUndoText(e){return H}startChanging(e,t){this.isFixed()&&this.restoreFixedPoint(),void 0!==e&&void 0!==t&&(e({...e,interval:e.interval??t})))}isForcedDrawPriceAxisLabel(){return this.customization.forcePriceAxisLabel}clearData(){this._points=[]}denormalizeTimePoints(){let e=[];const t=this._model.mainSeries().interval();for(let i=0;i0&&(this._points=e)}restorePoints(e,t,i){const s=this._timePoint.length>0&&!(0,T.deepEquals)(this._timePoint,e)[0],n=this._properties.childs().interval.value();this._timePoint=e.map((e=>({...e,interval:e.interval??n})));const o=this._model.mainSeries().interval()
;this._points=t.map((e=>({...e,interval:o}))),i||this.denormalizeTimePoints(),s&&this._normalizedPointsChanged.fire()}restorePositionPercents(e){this._positionPercents=e,this.restoreFixedPoint()}calcIsActualSymbol(){const e=this.ownerSource();if(null===e)this._isActualSymbol=!1;else{const t=(0,o.ensureNotNull)(e.symbolSource()),i=t.symbolInfo();if(i){this._migrateSymbolProperty(i);const e=this._properties.childs().symbol,s=e.value();if(this._isActualSymbol=t.symbolSameAsCurrent(s),this._isActualSymbol){const n=(0,y.extractLineToolSymbolFromSymbolInfo)(i,t.symbol());(0,v.areEqualSymbols)(s,n)||(N.logWarn('Possible drawing "migrating" detected from "'+s+'" to "'+n+'"'),N.logWarn("Series symbolInfo: "+JSON.stringify(t.symbolInfo())),N.logWarn(`${(new Error).stack}`)),e.setValue(n)}}}this.calcIsActualInterval(),this.calcIsActualCurrency(),this.calcIsActualUnit(),this._onSourceHiddenMayChange()}calcIsActualCurrency(){const e=this.ownerSource();if(null===e)return void(this._isActualCurrency=!1);let t=this._properties.childs().currencyId.value();if(null!==t){const i=e.symbolSource();0,this._isActualCurrency=t===(0,y.symbolCurrency)(i.symbolInfo(),void 0,!0)}else{const t=(0,o.ensureNotNull)(e.symbolSource());this._isActualCurrency=null!==t.symbolInfo()&&!t.isConvertedToOtherCurrency()}this._onSourceHiddenMayChange()}calcIsActualUnit(){const e=this.ownerSource();if(null===e)return void(this._isActualUnit=!1);const t=this._properties.childs().unitId.value();if(null!==t)this._isActualUnit=t===(0,o.ensureNotNull)(e.symbolSource()).unit();else{const t=(0,o.ensureNotNull)(e.symbolSource());this._isActualUnit=null!==t.symbolInfo()&&!t.isConvertedToOtherUnit()}this._onSourceHiddenMayChange()}calcIsActualInterval(){const e=this._isActualInterval,t=this._properties,i=this._model.mainSeries();this._isActualInterval=(0,g.isActualInterval)(S.Interval.parse(i.interval()),t.childs().intervalsVisibilities),!this._isActualInterval&&this._model.selection().isSelected(this)&&this._model.selectionMacro((e=>e.removeSourceFromSelection(this))),this._isActualInterval!==e&&this._onIsActualIntervalChange.fire(),this._onSourceHiddenMayChange()}paneViews(e){if(this.isSourceHidden())return null;const t=this._getPaneViews(this.isMultiPaneAvailable()?e:void 0);if(null===t)return null;if(1===t.length)return[t[0]];const i=[];for(let e=t.length-1;e>=0;--e)i.push(t[e]);return i}priceAxisViews(e,t){if(this.isFixed())return null;if(t!==this.priceScale()||this.isSourceHidden())return null;if(this._model.lineBeingEdited()===this){const e=this._model.linePointBeingEdited();if(null!==e&&e0}pointAdded(){return this._pointAdded}pointChanged(){return this._pointChanged}pointsetUpdated(){return this._onPointsetUpdatedDelegate}pointToScreenPoint(e){const t=this._model.timeScale(),i=this.priceScale(),s=this.ownerSource()?.firstValue()
;if(!i||i.isEmpty()||t.isEmpty()||null==s)return null;const o=t.indexToCoordinate(e.index),r=i.priceToCoordinate(e.price,s);return new n.Point(o,r)}screenPointToPoint(e,t){const i=this.priceScale(),s=this.ownerSource()?.firstValue();if(null==s||!isFinite(s)||null===i)return null;const n=this._model.timeScale(),o=t?n.coordinateToFloatIndex(e.x):n.coordinateToIndex(e.x);return{price:i.coordinateToPrice(e.y,s),index:o}}calcMiddlePoint(e,t){return new n.Point((e.x+t.x)/2,(e.y+t.y)/2)}addPoint(e,t,i){const s=this._preparePoint(e,t);return this._addPointIntenal(s,t,i)}addFixedPoint(e){return this._fixedPoint=e,this.calcPositionPercents(),!0}calcPositionPercents(){const e=this.priceScale();if(!e||e.isEmpty()||void 0===this._fixedPoint)return;const t=this._fixedPoint.x/this._model.timeScale().width(),i=this._fixedPoint.y/e.height();return this._positionPercents={x:t,y:i},this._positionPercents}restoreFixedPoint(){this._fixedPoint=this.fixedPoint()}propertiesChanged(e,t){this.calcIsActualInterval(),this.updateAllViewsAndRedraw((0,x.sourceChangeEvent)(this.id())),t||this._syncLineStyleIfNeeded(e),e||void 0!==this._pendingPropertyChangedEvent||(this._pendingPropertyChangedEvent=setTimeout((()=>{this._pendingPropertyChangedEvent=void 0,r.emit("drawing_event",this._id.value(),"properties_changed")}),0))}state(e){const t={type:this.toolname,id:this.id(),state:this.properties().state(this._propertiesStateExclusions()),points:(0,u.deepCopy)(this._timePoint),zorder:this.zorder(),ownerSource:this.ownerSource()?.id()};return t.isSelectionEnabled=this.isSelectionEnabled(),t.userEditEnabled=this.userEditEnabled(),this.linkKey().value()&&(t.linkKey=this.linkKey().value()),delete t.state.points,e&&(t.indexes=this._points),this.isFixed()&&(t.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(t.version=this.version),t}updateAllViews(e){this.isSourceHidden()||"data-source-change"===e.type&&this._ignoreSourceEvent(e)||(this._updateAllPaneViews(e),this._priceAxisViews.forEach((t=>t.update(e))),this._timeAxisViews.forEach((t=>t.update(e))))}updateAllViewsAndRedraw(e){this.updateAllViews(e),this._model.updateSource(this)}tags(){return[this.toolname]}properties(){return this._properties}restoreExternalPoints(e,t){if(this._timePoint=(0,u.deepCopy)(e.points),t.indexesChanged){if(this.properties().childs().interval.setValue(e.interval),!this.isActualSymbol())return this._clearServerPoints(),void this._normalizedPointsChanged.fire();this.createServerPoints()}else{const t=Math.min(this._points.length,e.points.length);for(let i=0;i0&&this._normalizePoints(),!this._readyToCreatePointset())return;const e=this._pointsForPointset();if(0===e.length)return;++W,this._currentPointsetAndSymbolId={pointsetId:W,symbolId:(0,o.ensureNotNull)(this._model.mainSeries().seriesSource().symbolInstanceId())};const t=(0,m.getServerInterval)(this.properties().childs().interval.value());this._model.chartApi().createPointset(this._currentPointsetIdWithPrefix(),"turnaround",this._currentPointsetAndSymbolId.symbolId,t,e,this.onData.bind(this))}finish(){}realign(){this.calcIsActualSymbol(),this.isFixed()||this.isSourceHidden()||this._model.lineBeingCreated()===this||this._model.lineBeingEdited()===this||this._currentPointsetAndSymbolId?.symbolId===this._model.mainSeries().seriesSource().symbolInstanceId()||this._clearServerPoints(),null===this._model.mainSeries().symbolInfo()&&(this._alignerCache=null),this.updateAllViews((0,x.sourceChangeEvent)(this.id()))}stop(){this._clearServerPoints()}restart(){this.isFixed()||(this._currentPointsetAndSymbolId=null,this.createServerPoints())}isStarted(){return null!==this._currentPointsetAndSymbolId}convertYCoordinateToPriceForMoving(e,t){const i=(0,o.ensureNotNull)(this.priceScale());if(i.isEmpty())return null;const s=this.ownerSource(),n=(0,o.ensure)((s||t)?.firstValue());return i.coordinateToPrice(e,n)}syncMultichartState(e){const t={points:this._timePoint,pointPositionPercents:this.positionPercents(),interval:this._model.mainSeries().interval()},i=this.linkKey().value();if(null!==i&&this.isSynchronizable()){const s={model:this._model,linkKey:i,symbol:this._model.mainSeries().symbol(),finalState:t,changes:e};(0,w.finishChangingLineTool)(s)}}enableCurrentIntervalVisibility(){let e=this.properties().childs().intervalsVisibilities.state();void 0!==e&&(e=(0,g.mergeIntervalVisibilitiesDefaults)(e),(0,
g.makeIntervalsVisibilitiesVisibleAtInterval)(e,this._model.mainSeries().intervalObj()),this.properties().childs().intervalsVisibilities.mergeAndFire(e))}clonePositionOffset(){return this.isFixed()?{barOffset:0,xCoordOffset:20,yCoordOffset:20}:{barOffset:0,xCoordOffset:0,yCoordOffset:-40}}sharingMode(){return this._sharingMode}share(e){this.isSynchronizable()&&this._sharingMode.setValue(e)}syncLineStyleState(e){if(e)return{zOrder:this.zorder()};const{intervalsVisibilities:t,...i}=this.properties().state(this._syncStateExclusions);return{...i,intervalsVisibilities:(0,g.mergeIntervalVisibilitiesDefaults)(t),zOrder:this.zorder()}}moveLineTool(e){const t=this._model.mainSeries().interval();e.forEach(((e,i)=>this._setPoint(i,{...e,interval:t}))),this._normalizePoints()}snapTo45DegreesAvailable(){return!1}alignTo45DegreesPoints(){if(this.snapTo45DegreesAvailable()){const[e,t]=this.points();if(e&&t)return[{...e,pointIndex:0},{...t,pointIndex:1}]}return null}snapPoint45Degree(e,t,i){const s=this._model.timeScale(),n=s.indexToCoordinate(t.index),r=s.indexToCoordinate(e.index)-n,a=(0,o.ensureNotNull)(this.priceScale()),l=t.price,c=e.price,h=(0,o.ensureNotNull)((0,o.ensureNotNull)(this.ownerSource()).firstValue()),d=a.priceToCoordinate(l,h),u=a.priceToCoordinate(c,h)-d,_=Math.round(Math.atan2(r,u)/Math.PI*4);if(2===Math.abs(_))i||(e.price=l);else if(0===Math.abs(_)||4===Math.abs(_))i||(e.index=t.index);else{const t=Math.sqrt(r*r+u*u),i=r<0?-1:1,o=u<0?-1:1;let l=Math.max(Math.abs(u),Math.abs(r));l/=l*Math.sqrt(2)/t;const c=Math.round(s.coordinateToIndex(n+l*i)),_=Math.abs(s.indexToCoordinate(c)-n),p=a.coordinateToPrice(d+_*o,h);e.index=c,e.price=p}}_ignoreSourceEvent(e){return e.sourceId!==this.id()}_pointsForPointset(){return this._timePoint.map((e=>e.interval?[e.time_t,e.offset,(0,m.getServerInterval)(e.interval)]:[e.time_t,e.offset]))}_setPoint(e,t){this._points[e]&&(this._points[e].index===t.index?this._points[e].price=t.price:this._points[e]=t,this._pointChanged.fire(e))}_correctLastPoint(e){return(0,T.clone)(e)}_snapTo45DegreesApplicable(e){return this.snapTo45DegreesAvailable()&&(e?.shift()||(0,w.alignTo45Degrees)().value())}_normalizePoint(e,t){return{...this._model.timeScale().normalizeBarIndex(e.index),price:e.price,interval:e.interval}}_normalizePointWithoutOffset(e){const t=this._model.timeScale().indexToTimePoint(e.index)??this._utcTimeInCurrentResolution(e);return null===t?null:{price:e.price,time_t:t,offset:0,interval:e.interval}}_normalizePoints(){let e=[];const t=this._model.mainSeries().interval();for(let i=0;ithis._destroyPanePaneViews(t))),this._model.lightUpdate()}_getPaneViews(e){return this._paneViews.get(e)||null}_updateAllPaneViews(e){this._paneViews.forEach((t=>{for(const i of t)i.update(e)}))}_alignPointHorizontallyOrVertically(e){const t=(0,o.ensureNotNull)(this.pointToScreenPoint(e)),i=(0,o.ensureDefined)((0,o.ensureNotNull)(this._startMovingPoint).logical),s=(0,o.ensureDefined)((0,o.ensureNotNull)(this._startMovingPoint).screen),n=Math.abs(s.x-t.x),r=Math.abs(s.y-t.y);if(n<10&&r<10)return e;return{index:n=1?{didCorrect:!0,point:e.add(s)}:{didCorrect:!1,point:e}}_currentPointsetIdWithPrefix(){return"pointset_"+(0,o.ensureNotNull)(this._currentPointsetAndSymbolId).pointsetId}_clearServerPoints(){null!==this._currentPointsetAndSymbolId&&this._model.chartApi().isConnected().value()&&this._model.chartApi().removePointset(this._currentPointsetIdWithPrefix()),this._currentPointsetAndSymbolId=null}_createPointProperty(e){const t=this._pointsProperty.childs().points;t.addChild(""+e,new b.Property({}));const i=t[e];i.addChild("price",new L(this,e)),i.addChild("bar",new A.LineDataSourcePointIndexProperty(this,e))}_createPointsProperties(){this._pointsProperty=new b.Property,this._pointsProperty.addChild("points",new b.Property);for(let e=0;e=2&&this.snapPoint45Degree(i,this.points()[this.points().length-2]),i}_addPointIntenal(e,t,i){this._points.push({...e,interval:this._model.mainSeries().interval()});const s=this._points.length===this.pointsCount();return s?(this._lastPoint=null,i||(this._normalizePoints(),this.createServerPoints())):this._lastPoint=e,this._pointAdded.fire(this._points.length-1),s}_onSourceHiddenMayChange(){this.isSourceHidden()&&this._model.selectionMacro((e=>{e.removeSourceFromSelection(this)})),this._model.invalidate(p.InvalidationMask.validateAction((()=>{this!==this._model.lineBeingCreated()&&(this._isDestroyed||this.processHibernate())})))}_saveAlertIdInState(){return!0}_onPointsetUpdated(e){if(0===e.length)return;const t=this.properties().childs().interval.value();for(let i=0;i0}_propertiesStateExclusions(){return[]}_syncLineStyleIfNeeded(e){const t=this.linkKey().value();t&&!this._syncLineStyleMuted&&this._syncLineStyleChanges(t,this.syncLineStyleState(e))}_muteSyncLineStyle(){this._syncLineStyleMuted=!0}_unmuteSyncLineStyleWithoutApplyingChanges(){this.propertiesChanged(),this._syncLineStyleMuted=!1}_applyTemplateImpl(e){e.intervalsVisibilities=(0,g.mergeIntervalVisibilitiesDefaults)(e.intervalsVisibilities);const t=this.properties();t.applyTemplate(e,(0,V.factoryDefaults)(this.toolname.toLowerCase())),t.saveDefaults(),this.propertiesChanged()}_getPropertyDefinitionsViewModelClass(){return Promise.resolve(null)}_getAlertPlots(){return[]}_getUndoHistory(){
return this._model.undoModel().undoHistory()}_synchronizeAlert(e){}_linePointsToAlertPlot(e,t,i,s){return null}_getAlertCreationAvailable(){return!1}_onAnchoredChange(){if(this.isFixed()){const e=(0,o.ensureNotNull)(this.pointToScreenPoint(this.points()[0]));this.addFixedPoint(e)}else{if(!this._fixedPoint)return;const e=(0,o.ensureNotNull)(this.screenPointToPoint(this._fixedPoint));this._points[0]={...e,interval:this._model.mainSeries().interval()},this.startChanging(),this.setPoint(0,e),this.endChanging(!1,!1),this._timePoint[0]=this._normalizePoint(this._points[0],0),this.clearFixedPoint()}const e=this.linkKey().value();null!==e&&this.isSynchronizable()&&(0,w.restoreLineToolState)({model:this._model,linkKey:e,state:this.state()})}_syncLineStyleChanges(e,t,i){this.anchorable()&&this.isFixed()!==Boolean(this._positionPercents)&&this._onAnchoredChange(),(0,w.changeLineStyle)({linkKey:e,state:t,alertId:i,model:this._model})}static _configureProperties(e){if(this._addCollectedProperties(e),e.hasChild("symbolStateVersion")||e.addChild("symbolStateVersion",new b.Property(1)),e.hasChild("zOrderVersion")||e.addChild("zOrderVersion",new b.Property(1)),e.hasChild("visible")||e.addChild("visible",new b.Property(!0)),e.hasChild("frozen")||e.addChild("frozen",new b.Property(!1)),e.hasChild("symbol")||e.addChild("symbol",new b.Property("")),e.hasChild("currencyId")||e.addChild("currencyId",new b.Property(null)),e.hasChild("unitId")||e.addChild("unitId",new b.Property(null)),e.hasChild("intervalsVisibilities")){const t=(0,T.merge)((0,T.clone)(f.intervalsVisibilitiesDefaults),e.childs().intervalsVisibilities.state());e.removeProperty("intervalsVisibilities"),e.addChild("intervalsVisibilities",new P.IntervalsVisibilitiesProperty(t))}else e.addChild("intervalsVisibilities",new P.IntervalsVisibilitiesProperty(f.intervalsVisibilitiesDefaults));e.hasChild("title")||e.addChild("title",new b.Property("")),["symbolStateVersion","zOrderVersion","visible","frozen","symbol","currencyId","unitId","symbolInfo","points","interval","title"].forEach((t=>e.addExcludedKey(t,5))),e.hasChild("singleChartOnly")&&e.removeProperty("singleChartOnly"),e.hasChild("font")&&e.removeProperty("font")}static _addCollectedProperties(e){e.hasChild("linewidth")&&e.addChild("linesWidths",new E.LineToolWidthsProperty([(0,o.ensureDefined)(e.child("linewidth"))])),e.hasChild("linecolor")&&e.addChild("linesColors",new E.LineToolColorsProperty([(0,o.ensureDefined)(e.child("linecolor"))])),e.hasChild("backgroundColor")&&e.addChild("backgroundsColors",new E.LineToolColorsProperty([(0,o.ensureDefined)(e.child("backgroundColor"))])),e.hasChild("textColor")&&e.addChild("textsColors",new E.LineToolColorsProperty([(0,o.ensureDefined)(e.child("textColor"))])),e.hasChild("linestyle")&&e.addChild("linesStyles",new E.LineToolCollectedProperty([(0,o.ensureDefined)(e.child("linestyle"))])),["linesWidths","linesColors","backgroundsColors","textsColors","linesStyles"].forEach((t=>{e.addExcludedKey(t,7)}))}_areAlertsOnLineToolProhibited(){
return null!==this._ownerSource&&!this._ownerSource.canHasAlertOnLineTools()}_removeAlertSubscriptions(){this._unsubscribeAlertCallbacks?.(),this._unsubscribeAlertCallbacks=void 0}_addAlertSubscriptions(e,t={}){}_destroyPanePaneViews(e){const t=this._paneViews.get(e);if(void 0!==t)for(const e of t)e.destroy&&e.destroy();void 0!==e&&e.onDestroyed().unsubscribeAll(this),this._paneViews.delete(e)}_copyPricesWithoutNormalization(){const e=Math.min(this._points.length,this._timePoint.length);for(let t=0;t{"use strict";i.d(t,{LineToolCollectedProperty:()=>c,LineToolColorsProperty:()=>d,LineToolWidthsProperty:()=>h,MultipleLineColorsProperty:()=>p,MultipleLineWidthsProperty:()=>_});var s=i(9343),n=i(34776),o=i(23073);const r=(0,s.getLogger)("Chart.LineToolCollectedProperty");class a{applyValue(e,t){e.setValue(t)}}class l extends o.PropertyBase{constructor(e,t){super(),this._properties=e,e.forEach(((e,t)=>e.subscribe(this,((e,i)=>{this._listeners.fire(this,`${t}.${i}`)})))),this._showIfProperty=t}visible(){return!this._showIfProperty||this._showIfProperty?.value()}value(){if(0===this._properties.length)return r.logError("Incorrect call, should not request value of 0 properties"),"mixed";const e=this._properties[0].value();return 1===this._properties.length||this._properties.every((t=>t.value()===e))?e:"mixed"}setValueSilently(e){"mixed"!==e&&this._properties.forEach((t=>t.setValueSilently(e)))}hasChild(e){const t=parseInt(e,10);return!isNaN(t)&&t>=0&&tt.toString()))}child(e){const t=parseInt(e,10);return!isNaN(t)&&t>=0&&te.unsubscribeAll(this))),this._listeners.destroy()}storeStateIfUndefined(){return!0}weakReference(){return(0,n.weakReference)(this)}ownership(){return(0,n.ownership)(this)}}class c extends l{setValue(e,t,i){if("mixed"===e)return;const s=i??new a;this._properties.forEach((t=>s.applyValue(t,e)))}}class h extends c{}class d extends c{firstColor(){return this._properties[0].value()}}class u extends l{setValue(e,t,i){if("mixed"===e)return;const s=i??new a;this._properties.forEach((t=>t.setValue(e,void 0,s)))}}class _ extends u{}class p extends u{}},77336:(e,t,i)=>{"use strict";i.d(t,{ensureLineToolLoaded:()=>u,getLoadedLineTool:()=>_,isAsyncGenericLineToolName:()=>l,
isAsyncStudyLineToolName:()=>c,isLineToolLoaded:()=>h,loadLineTool:()=>d});var s=i(50151);const n=new Map;const o=new Map([["LineToolPriceNote",async()=>(await Promise.all([i.e(8940),i.e(3889),i.e(8009),i.e(380)]).then(i.bind(i,36875))).LineToolPriceNote],["LineToolTextNote",async()=>(await Promise.all([i.e(1606),i.e(3889),i.e(8009),i.e(2211),i.e(9123)]).then(i.bind(i,46902))).LineToolTextNote],["LineToolNote",async()=>(await Promise.all([i.e(6128),i.e(3889),i.e(8009),i.e(2211),i.e(3248)]).then(i.bind(i,40258))).LineToolNote],["LineToolFibSpiral",async()=>(await Promise.all([i.e(3181),i.e(3889),i.e(8009),i.e(8090)]).then(i.bind(i,22717))).LineToolFibSpiral],["LineToolCircleLines",async()=>(await Promise.all([i.e(2787),i.e(3889),i.e(8009),i.e(9445)]).then(i.bind(i,9093))).LineToolCyclicLines],["LineToolNoteAbsolute",async()=>(await Promise.all([i.e(6128),i.e(3889),i.e(8009),i.e(2211),i.e(3248)]).then(i.bind(i,40258))).LineToolNoteAbsolute],["LineToolTable",async()=>(await Promise.all([i.e(577),i.e(3889),i.e(8009),i.e(2211),i.e(6204),i.e(319)]).then(i.bind(i,56176))).LineToolTable]]);o.set("LineToolFibRetracement",(async()=>(await Promise.all([i.e(5111),i.e(3723)]).then(i.bind(i,33168))).LineToolFibRetracement)),o.set("LineToolFibChannel",(async()=>(await Promise.all([i.e(5111),i.e(2283)]).then(i.bind(i,42851))).LineToolFibChannel)),o.set("LineToolFibSpeedResistanceArcs",(async()=>(await Promise.all([i.e(5111),i.e(3710)]).then(i.bind(i,88588))).LineToolFibSpeedResistanceArcs)),o.set("LineToolProjection",(async()=>(await i.e(3945).then(i.bind(i,12120))).LineToolProjection)),o.set("LineToolTrendBasedFibExtension",(async()=>(await Promise.all([i.e(5111),i.e(4731)]).then(i.bind(i,68554))).LineToolTrendBasedFibExtension)),o.set("LineToolElliott",(async()=>(await Promise.resolve().then(i.bind(i,65365))).LineToolElliott)),o.set("LineToolFibCircles",(async()=>(await Promise.all([i.e(5111),i.e(2816)]).then(i.bind(i,57994))).LineToolFibCircles)),o.set("LineToolVertLine",(async()=>(await i.e(1282).then(i.bind(i,56096))).LineToolVertLine)),o.set("LineToolCrossLine",(async()=>(await i.e(7203).then(i.bind(i,92007))).LineToolCrossLine)),o.set("LineToolBarsPattern",(async()=>(await Promise.resolve().then(i.bind(i,81756))).LineToolBarsPattern)),o.set("LineToolTrendBasedFibTime",(async()=>(await Promise.all([i.e(5111),i.e(7127)]).then(i.bind(i,27172))).LineToolTrendBasedFibTime)),o.set("LineToolFibTimeZone",(async()=>(await Promise.all([i.e(5111),i.e(1506)]).then(i.bind(i,8532))).LineToolFibTimeZone)),o.set("LineToolDateRange",(async()=>(await i.e(4273).then(i.bind(i,42214))).LineToolDateRange)),o.set("LineToolPriceRange",(async()=>(await i.e(6477).then(i.bind(i,23234))).LineToolPriceRange)),o.set("LineToolDateAndPriceRange",(async()=>(await i.e(1455).then(i.bind(i,70791))).LineToolDateAndPriceRange)),o.set("LineToolParallelChannel",(async()=>(await Promise.resolve().then(i.bind(i,56621))).LineToolParallelChannel)),o.set("LineToolTrendAngle",(async()=>(await Promise.resolve().then(i.bind(i,83776))).LineToolTrendAngle)),
o.set("LineToolTrendLine",(async()=>(await i.e(8673).then(i.bind(i,99294))).LineToolTrendLine)),o.set("LineToolInfoLine",(async()=>(await i.e(7488).then(i.bind(i,51065))).LineToolInfoLine)),o.set("LineToolArrowMark",(async()=>(await i.e(569).then(i.bind(i,27621))).LineToolArrowMark)),o.set("LineToolPitchfan",(async()=>(await Promise.all([i.e(5111),i.e(1313)]).then(i.bind(i,83779))).LineToolPitchfan)),o.set("LineToolGannSquare",(async()=>(await i.e(9478).then(i.bind(i,9770))).LineToolGannSquare)),o.set("LineToolFibSpeedResistanceFan",(async()=>(await Promise.all([i.e(5111),i.e(906)]).then(i.bind(i,20701))).LineToolFibSpeedResistanceFan)),o.set("LineToolGannComplex",(async()=>(await i.e(1963).then(i.bind(i,99083))).LineToolGannComplex)),o.set("LineToolGannFixed",(async()=>(await i.e(6336).then(i.bind(i,8308))).LineToolGannFixed)),o.set("LineToolGannFan",(async()=>(await Promise.all([i.e(5111),i.e(4981)]).then(i.bind(i,85259))).LineToolGannFan)),o.set("LineToolFibWedge",(async()=>(await Promise.all([i.e(5111),i.e(3314)]).then(i.bind(i,23591))).LineToolFibWedge)),o.set("LineToolPitchfork",(async()=>(await Promise.all([i.e(8763),i.e(5055)]).then(i.bind(i,64002))).LineToolPitchfork)),o.set("LineToolDisjointAngle",(async()=>(await i.e(9581).then(i.bind(i,57897))).LineToolDisjointChannel)),o.set("LineToolFlatBottom",(async()=>(await i.e(9310).then(i.bind(i,90921))).LineToolFlatBottom)),o.set("LineToolIcon",(async()=>(await i.e(7806).then(i.bind(i,15510))).LineToolIcon)),o.set("LineToolEmoji",(async()=>(await i.e(5529).then(i.bind(i,72939))).LineToolEmoji)),o.set("LineToolSticker",(async()=>(await i.e(8949).then(i.bind(i,86915))).LineToolSticker)),o.set("LineToolRotatedRectangle",(async()=>(await i.e(4015).then(i.bind(i,23550))).LineToolRotatedRectangle)),o.set("LineToolHeadAndShoulders",(async()=>(await i.e(3378).then(i.bind(i,47267))).LineToolHeadAndShoulders)),o.set("LineToolTriangle",(async()=>(await i.e(6432).then(i.bind(i,39737))).LineToolTriangle)),o.set("LineToolTrianglePattern",(async()=>(await i.e(3383).then(i.bind(i,33865))).LineToolTrianglePattern)),o.set("LineTool5PointsPattern",(async()=>(await i.e(1155).then(i.bind(i,17658))).LineTool5PointsPattern)),o.set("LineToolThreeDrivers",(async()=>(await i.e(4602).then(i.bind(i,46660))).LineToolThreeDrivers)),o.set("LineToolABCD",(async()=>(await i.e(5283).then(i.bind(i,30906))).LineToolABCD)),o.set("LineToolPolyline",(async()=>(await i.e(3866).then(i.bind(i,51691))).LineToolPolyline)),o.set("LineToolPath",(async()=>(await i.e(961).then(i.bind(i,14150))).LineToolPath)),o.set("LineToolPrediction",(async()=>(await i.e(9534).then(i.bind(i,29356))).LineToolPrediction)),o.set("LineToolPriceLabel",(async()=>(await i.e(6484).then(i.bind(i,83710))).LineToolPriceLabel)),o.set("LineToolArrowMarker",(async()=>(await i.e(1470).then(i.bind(i,66403))).LineToolArrowMarker)),o.set("LineToolSignpost",(async()=>(await i.e(4674).then(i.bind(i,28820))).LineToolSignpost)),o.set("LineToolBrush",(async()=>(await i.e(5122).then(i.bind(i,28462))).LineToolBrush)),
o.set("LineToolArc",(async()=>(await i.e(5967).then(i.bind(i,87654))).LineToolArc)),o.set("LineToolCallout",(async()=>(await Promise.resolve().then(i.bind(i,62828))).LineToolCallout)),o.set("LineToolBalloon",(async()=>(await i.e(1277).then(i.bind(i,11924))).LineToolBalloon)),o.set("LineToolComment",(async()=>(await i.e(3966).then(i.bind(i,74451))).LineToolComment)),o.set("LineToolText",(async()=>(await i.e(2312).then(i.bind(i,424))).LineToolText)),o.set("LineToolHorzLine",(async()=>(await i.e(4201).then(i.bind(i,43636))).LineToolHorzLine)),o.set("LineToolHorzRay",(async()=>(await i.e(574).then(i.bind(i,47845))).LineToolHorzRay)),o.set("LineToolRectangle",(async()=>(await i.e(8422).then(i.bind(i,63397))).LineToolRectangle)),o.set("LineToolCircle",(async()=>(await i.e(6748).then(i.bind(i,17333))).LineToolCircle)),o.set("LineToolEllipse",(async()=>(await i.e(7660).then(i.bind(i,59002))).LineToolEllipse)),o.set("LineToolTimeCycles",(async()=>(await i.e(8334).then(i.bind(i,97409))).LineToolTimeCycles)),o.set("LineToolSineLine",(async()=>(await i.e(1713).then(i.bind(i,8066))).LineToolSineLine)),o.set("LineToolGhostFeed",(async()=>(await Promise.resolve().then(i.bind(i,37968))).LineToolGhostFeed)),o.set("LineToolBezierQuadro",(async()=>(await i.e(8061).then(i.bind(i,28904))).LineToolBezierQuadro)),o.set("LineToolBezierCubic",(async()=>(await i.e(9014).then(i.bind(i,20925))).LineToolBezierCubic)),o.set("LineToolArrow",(async()=>(await i.e(8607).then(i.bind(i,96068))).LineToolArrow)),o.set("LineToolRay",(async()=>(await i.e(4934).then(i.bind(i,36224))).LineToolRay)),o.set("LineToolExtended",(async()=>(await i.e(925).then(i.bind(i,6921))).LineToolExtended)),o.set("LineToolSchiffPitchfork",(async()=>(await Promise.all([i.e(8763),i.e(7175)]).then(i.bind(i,63533))).LineToolSchiffPitchfork)),o.set("LineToolSchiffPitchfork2",(async()=>(await Promise.all([i.e(8763),i.e(341)]).then(i.bind(i,68802))).LineToolSchiffPitchfork2)),o.set("LineToolInsidePitchfork",(async()=>(await Promise.all([i.e(8763),i.e(8468)]).then(i.bind(i,20690))).LineToolInsidePitchfork)),o.set("LineToolTextAbsolute",(async()=>(await i.e(2312).then(i.bind(i,424))).LineToolTextAbsolute)),o.set("LineToolArrowMarkLeft",(async()=>(await i.e(569).then(i.bind(i,27621))).LineToolArrowMarkLeft)),o.set("LineToolArrowMarkRight",(async()=>(await i.e(569).then(i.bind(i,27621))).LineToolArrowMarkRight)),o.set("LineToolArrowMarkUp",(async()=>(await i.e(569).then(i.bind(i,27621))).LineToolArrowMarkUp)),o.set("LineToolArrowMarkDown",(async()=>(await i.e(569).then(i.bind(i,27621))).LineToolArrowMarkDown)),o.set("LineToolFlagMark",(async()=>(await i.e(8820).then(i.bind(i,41124))).LineToolFlagMark)),o.set("LineToolCypherPattern",(async()=>(await i.e(6740).then(i.bind(i,16628))).LineToolCypherPattern)),o.set("LineToolElliottImpulse",(async()=>(await Promise.resolve().then(i.bind(i,65365))).LineToolElliottImpulse)),o.set("LineToolElliottTriangle",(async()=>(await Promise.resolve().then(i.bind(i,65365))).LineToolElliottTriangle)),
o.set("LineToolElliottTripleCombo",(async()=>(await Promise.resolve().then(i.bind(i,65365))).LineToolElliottTripleCombo)),o.set("LineToolElliottCorrection",(async()=>(await Promise.resolve().then(i.bind(i,65365))).LineToolElliottCorrection)),o.set("LineToolElliottDoubleCombo",(async()=>(await Promise.resolve().then(i.bind(i,65365))).LineToolElliottDoubleCombo)),o.set("LineToolRiskRewardLong",(async()=>(await Promise.all([i.e(2342),i.e(1667),i.e(2277)]).then(i.bind(i,21986))).LineToolRiskRewardLong)),o.set("LineToolRiskRewardShort",(async()=>(await Promise.all([i.e(2342),i.e(1667),i.e(6768)]).then(i.bind(i,65137))).LineToolRiskRewardShort)),o.set("LineToolPosition",(async()=>(await i.e(1314).then(i.t.bind(i,40265,19))).LineToolPosition)),o.set("LineToolOrder",(async()=>(await i.e(2232).then(i.t.bind(i,64732,19))).LineToolOrder)),o.set("LineToolHighlighter",(async()=>(await i.e(2087).then(i.bind(i,65539))).LineToolHighlighter)),o.set("LineToolImage",(async()=>(await Promise.all([i.e(5402),i.e(5231)]).then(i.bind(i,18181))).LineToolImage)),o.set("LineToolExecution",(async()=>(await Promise.resolve().then(i.bind(i,56991))).LineToolExecution));const r=new Map,a=new Map([["LineToolAnchoredVWAP",async()=>(await i.e(5500).then(i.bind(i,13099))).LineToolAnchoredVWAP],["LineToolRegressionTrend",async()=>(await i.e(9748).then(i.bind(i,10986))).LineToolRegressionTrend],["LineToolVbPFixed",async()=>(await i.e(5695).then(i.bind(i,71131))).LineToolVbPFixed],["LineToolFixedRangeVolumeProfile",async()=>(await i.e(5695).then(i.bind(i,25937))).LineToolFixedRangeVolumeProfile]]);function l(e){return o.has(e)||a.has(e)||n.has(e)}function c(e){return a.has(e)}function h(e){return!l(e)||n.has(e)||r.has(e)}async function d(e){if(h(e))return _(e);const t=c(e),i=(0,s.ensureDefined)((t?a:o).get(e)),l=await i();return t?(r.set(e,(0,s.ensureDefined)(l)),_(e)):(n.set(e,(0,s.ensureDefined)(l)),_(e))}async function u(e){l(e)&&!h(e)&&await d(e)}function _(e){return c(e)?(0,s.ensureDefined)(r.get(e),`Study line tool ${e}`):(0,s.ensureDefined)(n.get(e),`Line tool ${e}`)}},98523:(e,t,i)=>{"use strict";i.d(t,{lineToolsLocalizedNames:()=>n});var s=i(11542);const n={LineTool5PointsPattern:s.t(null,void 0,i(42231)),LineToolABCD:s.t(null,void 0,i(46712)),LineToolArc:s.t(null,void 0,i(59324)),LineToolArrow:s.t(null,void 0,i(11858)),LineToolArrowMarkDown:s.t(null,void 0,i(73193)),LineToolArrowMarkLeft:s.t(null,void 0,i(1949)),LineToolArrowMarkRight:s.t(null,void 0,i(86275)),LineToolArrowMarkUp:s.t(null,void 0,i(62453)),LineToolBalloon:s.t(null,void 0,i(70540)),LineToolComment:s.t(null,void 0,i(9818)),LineToolBarsPattern:s.t(null,void 0,i(81994)),LineToolBezierCubic:s.t(null,void 0,i(77125)),LineToolBezierQuadro:s.t(null,void 0,i(78609)),LineToolBrush:s.t(null,void 0,i(43539)),LineToolCallout:s.t(null,void 0,i(25381)),LineToolCircleLines:s.t(null,void 0,i(84031)),LineToolCypherPattern:s.t(null,void 0,i(93191)),LineToolDateAndPriceRange:s.t(null,void 0,i(47017)),LineToolDateRange:s.t(null,void 0,i(85444)),LineToolDisjointAngle:s.t(null,void 0,i(91544)),
LineToolElliottCorrection:s.t(null,void 0,i(80943)),LineToolElliottDoubleCombo:s.t(null,void 0,i(75112)),LineToolElliottImpulse:s.t(null,void 0,i(61114)),LineToolElliottTriangle:s.t(null,void 0,i(72359)),LineToolElliottTripleCombo:s.t(null,void 0,i(76129)),LineToolEllipse:s.t(null,void 0,i(78996)),LineToolExtended:s.t(null,void 0,i(52788)),LineToolFibChannel:s.t(null,void 0,i(59005)),LineToolFibCircles:s.t(null,void 0,i(82330)),LineToolFibRetracement:s.t(null,void 0,i(55986)),LineToolFibSpeedResistanceArcs:s.t(null,void 0,i(33880)),LineToolFibSpeedResistanceFan:s.t(null,void 0,i(2395)),LineToolFibSpiral:s.t(null,void 0,i(39014)),LineToolFibTimeZone:s.t(null,void 0,i(30622)),LineToolFibWedge:s.t(null,void 0,i(85042)),LineToolFlagMark:s.t(null,void 0,i(14600)),LineToolImage:s.t(null,void 0,i(68065)),LineToolFlatBottom:s.t(null,void 0,i(45051)),LineToolAnchoredVWAP:s.t(null,void 0,i(84541)),LineToolGannComplex:s.t(null,void 0,i(44763)),LineToolGannFixed:s.t(null,void 0,i(60707)),LineToolGannFan:s.t(null,void 0,i(48683)),LineToolGannSquare:s.t(null,void 0,i(47460)),LineToolHeadAndShoulders:s.t(null,void 0,i(21928)),LineToolHorzLine:s.t(null,void 0,i(21795)),LineToolHorzRay:s.t(null,void 0,i(25487)),LineToolIcon:s.t(null,void 0,i(37913)),LineToolEmoji:s.t(null,void 0,i(73456)),LineToolSticker:s.t(null,void 0,i(43114)),LineToolInsidePitchfork:s.t(null,void 0,i(41686)),LineToolNote:s.t(null,void 0,i(86631)),LineToolTextNote:s.t(null,void 0,i(94389)),LineToolSignpost:s.t(null,void 0,i(67751)),LineToolParallelChannel:s.t(null,void 0,i(59256)),LineToolPitchfan:s.t(null,void 0,i(34156)),LineToolPitchfork:s.t(null,void 0,i(19634)),LineToolPolyline:s.t(null,void 0,i(39949)),LineToolPath:s.t(null,void 0,i(371)),LineToolPrediction:s.t(null,void 0,i(20138)),LineToolPriceLabel:s.t(null,void 0,i(91282)),LineToolArrowMarker:s.t(null,void 0,i(36352)),LineToolPriceRange:s.t(null,void 0,i(68941)),LineToolProjection:s.t(null,void 0,i(75747)),LineToolRay:s.t(null,void 0,i(50318)),LineToolRectangle:s.t(null,void 0,i(26001)),LineToolCircle:s.t(null,void 0,i(91944)),LineToolRegressionTrend:s.t(null,void 0,i(2460)),LineToolRiskRewardLong:s.t(null,void 0,i(74832)),LineToolRiskRewardShort:s.t(null,void 0,i(8075)),LineToolFixedRangeVolumeProfile:s.t(null,{context:"study"},i(25705)),LineToolAnchoredVolumeProfile:s.t(null,{context:"study"},i(89633)),LineToolRotatedRectangle:s.t(null,void 0,i(56820)),LineToolSchiffPitchfork:s.t(null,void 0,i(57681)),LineToolSchiffPitchfork2:s.t(null,void 0,i(42608)),LineToolSineLine:s.t(null,void 0,i(39090)),LineToolText:s.t(null,{context:"tool"},i(91405)),LineToolTextAbsolute:s.t(null,void 0,i(42669)),LineToolThreeDrivers:s.t(null,void 0,i(46982)),LineToolTimeCycles:s.t(null,void 0,i(46852)),LineToolTrendAngle:s.t(null,void 0,i(35757)),LineToolTrendBasedFibExtension:s.t(null,void 0,i(80583)),LineToolTrendBasedFibTime:s.t(null,void 0,i(72159)),LineToolTrendLine:s.t(null,void 0,i(97339)),LineToolInfoLine:s.t(null,void 0,i(15992)),LineToolTriangle:s.t(null,void 0,i(1671)),
LineToolTrianglePattern:s.t(null,void 0,i(90148)),LineToolVertLine:s.t(null,void 0,i(29535)),LineToolCrossLine:s.t(null,void 0,i(74334)),LineToolHighlighter:s.t(null,void 0,i(69476)),LineToolPriceNote:s.t(null,void 0,i(97512)),LineToolVbPFixed:s.t(null,void 0,i(40693)),LineToolGhostFeed:s.t(null,void 0,i(46808)),LineToolTable:s.t(null,void 0,i(17981))}},15491:(e,t,i)=>{"use strict";i.d(t,{lineToolsStudyIds:()=>s});const s={LineToolAnchoredVWAP:"AnchoredVWAP@tv-basicstudies",LineToolRegressionTrend:"RegressionTrend@tv-basicstudies",LineToolFixedRangeVolumeProfile:"VbPFixed@tv-basicstudies",LineToolVbPFixed:"VbPFixed@tv-volumebyprice"}},32755:(e,t,i)=>{"use strict";i.d(t,{cloneLineTool:()=>N,createLineTool:()=>x,createLineToolProperties:()=>M,createStudyLineToolProperties:()=>A,ensureAllLineToolsLoadedForLayout:()=>P,initAllLineToolsFromContent:()=>T,initLineTool:()=>S,isBrushBasedLineTool:()=>k,isEditableTextLineTool:()=>V,isLineTool:()=>g.isLineTool,isStudyLineTool:()=>D,isTrading:()=>E,prepareLineToolPropertiesByOwnerSource:()=>I,setNewToolProperties:()=>y,supportsPhantomMode:()=>L,tryFindStudyLineToolNameByStudyId:()=>R,unsetNewToolProperties:()=>v});var s=i(82433),n=i(50151),o=i(86441),r=i(10892),a=i(43156),l=i(36009),c=i(68805),h=i(15764),d=i(16638),u=i(15491),_=i(64195),p=i(77336),m=i(9343),g=i(78956);let f=null;function y(e,t,i){return null!==f&&f.tool===e&&f.toolData===t||(v(!0),f={properties:M(i.backgroundTheme().spawnOwnership(),e,!i.readOnly()),tool:e,toolData:t}),f.properties}function v(e){e&&f?.properties.destroy(),f=null}async function S(e){["LineToolRiskRewardLong","LineToolRiskRewardShort"].includes(e);const t=e;(D(t)||(0,p.isAsyncStudyLineToolName)(t))&&await(0,d.studyMetaInfoRepository)().findAllJavaStudies(),(0,p.isLineToolLoaded)(t)||(0,h.isLineToolName)(t)&&await(0,p.loadLineTool)(t)}function b(e,t){const i="charts"in e?e.charts:[e];for(const e of i){for(const i of e.panes)for(const e of i.sources)t(e.type);e.lineToolsGroups?.groups.forEach((e=>{e.tools.forEach((e=>t(e)))}))}}class w extends Error{constructor(e,t){super(`Failed to load line tool: ${e}`),this.name="LineToolLoadError",this.toolName=e,this.originalError=t}}const C=(0,m.getLogger)("LineToolsSynchronizer");async function P(e){const t=new Set,i=e=>{(0,p.isAsyncGenericLineToolName)(e)&&t.add(e)};for(const t of e)b(t,i);const s=[...t],n=(await Promise.allSettled(s.map((e=>(0,p.ensureLineToolLoaded)(e).catch((t=>{throw new w(e,t)})))))).filter((e=>"rejected"===e.status));n.length>0&&n.forEach((e=>{const t=e.reason;C.logError(`Failed to load line tool: ${t.toolName}`)}))}async function T(e){if(!e)return;const t=new Set;b(e,(e=>{(0,h.isLineToolName)(e)&&t.add(e)})),await Promise.all(Array.from(t).map((e=>S(e))))}function x(e,t,i,s,o,r){(0,n.assert)((0,h.isLineToolName)(e),"Unknown line tool: "+e);const a=e;let l;if((0,n.assert)((0,p.isLineToolLoaded)(a),`Line tool ${a} is not loaded`),o||i||null===f||f.tool!==e||(i=f.properties,v(!1)),(0,p.isAsyncStudyLineToolName)(a)){l=new((0,p.getLoadedLineTool)(a))(t,i,(0,n.ensureDefined)(s),o,r)}else{
l=new((0,p.getLoadedLineTool)(a))(t,i,o,r)}return l.toolname=e,v(!0),l}function I(e,t){const i=(0,n.ensureNotNull)(t.symbolSource()),s=i.symbolInfo(),o=s?(0,c.extractLineToolSymbolFromSymbolInfo)(s,i.symbol()):i.symbol();e.childs().symbol.setValue(o),i.model().currencyConversionEnabled()&&i.isConvertedToOtherCurrency()&&e.childs().currencyId.setValue(i.currency()),i.model().unitConversionEnabled()&&i.isConvertedToOtherUnit()&&e.childs().unitId.setValue(i.unit()),e.childs().symbolStateVersion.setValue(2),e.childs().zOrderVersion.setValue(2)}function M(e,t,i,s){(0,n.assert)((0,h.isLineToolName)(t),`${t} should be name of the line tool`);const o=t;if((0,n.assert)((0,p.isLineToolLoaded)(o),`Line tool ${o} is not loaded`),(0,p.isAsyncStudyLineToolName)(o)){return(0,p.getLoadedLineTool)(o).createProperties(e,s)}return(0,p.getLoadedLineTool)(o).createProperties(e,s,i)}function A(e,t,i,s,o,r){(0,n.assert)((0,h.isStudyLineToolName)(t),`${t} should be name of the study line tool`);const a=t;if((0,p.isAsyncStudyLineToolName)(a)){return(0,p.getLoadedLineTool)(a).createPropertiesFromStudyMetaInfoAndState(i,s,o,r,e)}throw new Error(`Property creation is not implemented for study line tool ${t}`)}function L(e){(0,n.assert)((0,h.isLineToolName)(e),`${e} should be name of the line tool`);const t=e;(0,n.assert)((0,p.isLineToolLoaded)(t),`Line tool ${t} is not loaded`);const i=(0,p.getLoadedLineTool)(t);return void 0!==i&&Boolean(i.supportPhantomMode)}function k(e){return e instanceof _.LineToolBrushBase}function D(e){return e instanceof a.StudyLineDataSource}function E(e){return e instanceof l.LineToolTrading}const B=["editableTextStyle","editableText","editableTextProperties"];function V(e){return(0,s.default)(e)&&B.every((t=>t in e))}function R(e){let t=null;return e===u.lineToolsStudyIds.LineToolRegressionTrend?t="LineToolRegressionTrend":e===u.lineToolsStudyIds.LineToolVbPFixed?t="LineToolVbPFixed":e===u.lineToolsStudyIds.LineToolFixedRangeVolumeProfile&&(t="LineToolFixedRangeVolumeProfile"),t}function N(e,t,i,s){const a=t.toolname,l=t.properties().state();l.intervalsVisibilities=(0,r.mergeIntervalVisibilitiesDefaults)(l?.intervalsVisibilities);const c=M(e.backgroundTheme().spawnOwnership(),t.toolname,!e.readOnly(),l);c.childs().visible.setValue(!0);const h=(0,n.ensureNotNull)(t.ownerSource()),d=x(a,e,c);void 0!==s&&d.setId(s),d.setOwnerSource(h),d.toolname=a;const u=d.clonePositionOffset();if(t.isFixed()){const e=(0,n.ensureDefined)(t.fixedPoint()),s=i?e.add(new o.Point(u.xCoordOffset,u.yCoordOffset)):e;d.addFixedPoint(s)}const _=t.normalizedPoints(),p=i?function(e,t,i){const s=(0,n.ensureNotNull)(t.priceScale()),o=(0,n.ensureNotNull)(t.firstValue());return e.map((e=>{const t=e.price,n=s.priceToCoordinate(t,o)+i.yCoordOffset,r=s.coordinateToPrice(n,o),a=e.interval;return{time_t:e.time_t,price:r,offset:e.offset+i.barOffset,interval:a}}))}(_,h,u):_,m=t.points();return d.restorePoints(p,m),d.cloneData&&d.cloneData(t),d.recalculateStateByData&&d.recalculateStateByData(),d}},56621:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Constants:()=>s,
LineToolParallelChannel:()=>d});var s,n=i(50151),o=i(86441),r=i(37265),a=i(29875),l=i(12988),c=i(14267);!function(e){e[e.LeftBottomAnchor=0]="LeftBottomAnchor",e[e.RightBottomAnchor=1]="RightBottomAnchor",e[e.LeftTopAnchor=2]="LeftTopAnchor",e[e.RightTopAnchor=3]="RightTopAnchor",e[e.TopMiddleAnchor=4]="TopMiddleAnchor",e[e.BottomMiddleAnchor=5]="BottomMiddleAnchor",e[e.VirtualPriceOffsetPoint=6]="VirtualPriceOffsetPoint"}(s||(s={}));class h extends l.Property{constructor(e){super(0),this._source=e}value(){const e=this._source.points();if(3!==e.length)return 0;const t=e[2].price-e[0].price,i=this._source.ownerSource()?.symbolSource().symbolInfo(),s=i?i.pricescale/i.minmov:100;return Math.round(t*s)/s}setValue(e){const t=this._source.points();if(3===t.length){const i={...t[2],price:t[0].price+e},s=this._source.model();s.startChangingLinetool(this._source,{...i},6),s.changeLinePoint({...i}),s.endChangingLinetool(!1),this._listeners.fire(this,"")}}}class d extends a.LineDataSource{constructor(e,t,s,n){super(e,t??d.createProperties(e.backgroundTheme().spawnOwnership()),s,n),this.version=2,this._priceOffsetProperty=new h(this),this._priceAxisViews.push(this.createPriceAxisView(3)),this._coordOffsetWhileMovingOrChanging=null,this._pendingPriceOffset=null,Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,86595)).then((({ParallelChannelPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}levelsCount(){return c.coeffs.length}paneViews(e){return null!==this._pendingPriceOffset&&this._applyPendingPriceOffset(),super.paneViews(e)}snapTo45DegreesAvailable(){return!0}setLastPoint(e,t){this._snapTo45DegreesApplicable(t)&&2===this.points().length&&this.snapPoint45Degree(e,this.points()[0]);const i=(0,r.clone)(e);return super.setLastPoint(e,t,!1),i}startMoving(e,t,i,s){super.startMoving(e,t,i,s),this._coordOffsetWhileMovingOrChanging=this._findPixelsHeight()}endMoving(e,t,i){return this._coordOffsetWhileMovingOrChanging=null,super.endMoving(e,t,i)}startChanging(e,t){super.startChanging(e,t),this._coordOffsetWhileMovingOrChanging=this._findPixelsHeight()}endChanging(e,t,i){return this._coordOffsetWhileMovingOrChanging=null,super.endChanging(e,t,i)}restoreExternalPoints(e,t){if(super.restoreExternalPoints(e,t),t.pricesChanged&&this._points.length===e.points.length)for(let t=0;t=4)return;this._snapPointBeforeChange(e,t,i);const o=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[0])),r=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[1])),a=(0,n.ensureNotNull)(this.pointToScreenPoint(t)),l=(0,n.ensureNotNull)(this._coordOffsetWhileMovingOrChanging),c=(0,n.ensureNotNull)(this.priceScale()),h=(0,n.ensure)(this.ownerSource()?.firstValue()),d=this._model.mainSeries().interval();switch(e){case 0:
super._setPoint(e,{...t,interval:d}),this._points[2].price=c.coordinateToPrice(a.y+l,h),this._points[2].index=t.index,this._points[2].interval=d;break;case 1:super._setPoint(e,{...t,interval:d});break;case 2:super._setPoint(e,{...t,interval:d}),this._points[0].price=c.coordinateToPrice(a.y-l,h),this._points[0].index=t.index,this._points[0].interval=d;break;case 3:this._points[1].price=c.coordinateToPrice(a.y-l,h),this._points[1].index=t.index,this._points[1].interval=d;break;case 4:{const e=r.subtract(o),t=(a.x-o.x)/e.x,i=o.addScaled(e,t),s=a.y-i.y;this._points[2].price=c.coordinateToPrice(o.y+s,h);break}case 5:{const e=r.subtract(o),t=(a.x-o.x)/e.x,i=o.addScaled(e,t),s=a.y-i.y;this._points[0].price=c.coordinateToPrice(o.y+s,h),this._points[1].price=c.coordinateToPrice(r.y+s,h);break}case 6:this._points[2].price=t.price}const u=this.linkKey().value();u&&!s&&e<4&&this._syncLineStyleChanges(u,{prices:this._points.map((e=>e.price))})}state(e){const t=super.state(e);return this._pendingPriceOffset&&(t.priceOffset=this._pendingPriceOffset),t}restoreExternalState(e){const{prices:t,...i}=e;if(t&&this.isActualSymbol())for(let e=0;ee.index<=t.index?[e,t]:[t,e],s=i(t[0],t[1]),n=i(t[2],t[3])
;let o,r,a,l;t[2].pricenull!==e))}_correctLastPoint(e){if(this._points.length<2||this._points[1].index===this._points[0].index)return e;const t=(0,n.ensureNotNull)(this.pointToScreenPoint(e)),i=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[1])),s=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[0])),r=i.subtract(s),a=(t.x-s.x)/r.x,l=s.addScaled(r,a),c=t.y-l.y,h=s.add(new o.Point(0,c));return(0,n.ensureNotNull)(this.screenPointToPoint(h))}static _configureProperties(e){super._configureProperties(e),e.hasChild("labelText")||e.addChild("labelText",new l.Property("")),e.addExcludedKey("labelText",1)}_isTimePointsValid(){return this._timePoint.every((e=>Number.isFinite(e.price)))}_axisPoints(){const e=this.points(),t=this._points[0]?this.pointToScreenPoint(this._points[0]):null,i=this._points[1]?this.pointToScreenPoint(this._points[1]):null,s=this._points[2]?this.pointToScreenPoint(this._points[2]):null;if(t&&i&&s){const r=i.y-t.y,a=s.add(new o.Point(0,r));e.push((0,n.ensureNotNull)(this.screenPointToPoint(a)))}return e}_convertLastPointTo3rdPoint(e){const t=(0,n.ensureNotNull)(this.pointToScreenPoint(e)),i=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[1])),s=(0,n.ensureNotNull)(this.pointToScreenPoint(this._points[0])),r=i.subtract(s),a=(t.x-s.x)/r.x,l=s.addScaled(r,a),c=t.y-l.y,h=s.add(new o.Point(0,c));return(0,n.ensureNotNull)(this.screenPointToPoint(h))}_findPixelsHeight(){const e=this.pointToScreenPoint(this._points[2]),t=this.pointToScreenPoint(this._points[0]);return e&&t?e.y-t.y:null}_applyPendingPriceOffset(){const e=this._pendingPriceOffset;if(null===e||this._points.length<3)return;const t=this.priceScale(),i=(0,n.ensureNotNull)(this.ownerSource()).firstValue();if(!t||t.isEmpty()||null===i)return;const s=e+this._points[0].price,o=e+this._points[1].price,r=.5*(s+o)-e,a=.5*(s+o),l=t.priceToCoordinate(r,i),c=t.priceToCoordinate(a,i)-l,h=t.priceToCoordinate(this._points[0].price,i)+c,d=t.coordinateToPrice(h,i);this._points[2].price=d,this._timePoint[2].price=d,this._points[2].index=this._points[0].index,this._timePoint[2].time_t=this._timePoint[0].time_t,this._timePoint[2].offset=this._timePoint[0].offset,this._pendingPriceOffset=null}_snapPointBeforeChange(e,t,i){if(this._snapTo45DegreesApplicable(i))switch(e){case 0:case 1:this.snapPoint45Degree(t,this._points[1-e]);break;case 2:case 3:const i=(0,n.ensureNotNull)(this.getPoint(5-e));this.snapPoint45Degree(t,i)}}}},14267:(e,t,i)=>{"use strict";i.d(t,{LineToolParallelChannelPropertiesImpl:()=>I,coeffs:()=>f});var s=i(90054),n=i(16738),o=i(50151),r=i(49156),a=i(24633),l=i(51056),c=i(30699),h=i(6590),d=i(31229),u=i(32679),_=i(38039),p=i(73305),m=i(11402),g=i(45345);const f=[-.25,0,.25,.5,.75,1,1.25];const y={intervalsVisibilities:{
...d.intervalsVisibilitiesDefaults},...function(){const e={};return f.forEach(((t,i)=>{e[`level${i+1}`]={visible:[1,3,5].includes(i),coeff:t,lineStyle:3===i?l.LINESTYLE_DASHED:l.LINESTYLE_SOLID,lineWidth:[1,5].includes(i)?2:1}})),e}(),extendLeft:!1,extendRight:!1,fillBackground:!0,transparency:80,labelVisible:!1,labelHorzAlign:c.HorizontalAlign.Left,labelVertAlign:c.VerticalAlign.Bottom,labelFontSize:14,labelBold:!1,labelItalic:!1,version:2};const v={...function(){const e={};for(let t=0;t(0,o.ensureDefined)(this.child(`level${t+1}`)).childs().color)))),this.addChild("linesWidths",new p.LineToolWidthsProperty(f.map(((e,t)=>(0,o.ensureDefined)(this.child(`level${t+1}`)).childs().lineWidth))))}applyTemplate(e){1===("version"in e?e.version:1)&&(e=x(e),e=(0,u.extractState)(e,this._templateKeys)),super.applyTemplate(e)}static create(e,t){return new this({defaultName:b,factoryDefaultsSupplier:()=>(0,m.factoryDefaultsForCurrentTheme)(y,S),nonThemedDefaultsKeys:C,themedDefaultsKeys:w,templateKeys:P,allStateKeys:T,state:t,theme:e})}_userSettings(){let e=(0,u.createDefaultsState)(!0,b,[],null);return 1===(e&&"version"in e?e.version:1)&&(e=x(e)),(0,u.extractState)((0,s.default)(e),this._allDefaultsKeys,this._excludedDefaultsKeys)}}},96333:(e,t,i)=>{"use strict";var s;i.d(t,{LineToolPitchforkStyle:()=>s}),function(e){e[e.Original=0]="Original",e[e.Schiff=1]="Schiff",e[e.Inside=2]="Inside",e[e.Schiff2=3]="Schiff2"}(s||(s={}))},43156:(e,t,i)=>{"use strict";i.d(t,{StudyLineDataSource:()=>b});var s=i(64755),n=i(29875),o=i(32679),r=i(68159),a=i(14019),l=i(65383),c=i(71838),h=i(678);class d extends c.StudyDataSource{constructor(e,t,i,s){super(e,t.seriesSource(),i,s),this._series=t}_createStudyError(e){return(0,h.createStudyError)(this._getStudyErrorDescription(e),this._series.symbolInfo()?.exchange)}}var u=i(16685),_=i(82349),p=i(17534),m=i(44672),g=i(27538);class f extends g.StatusProviderBase{constructor(e){super(),this._source=e}
errorStatus(){const e=this._source.status();return e.type===h.StudyStatusType.Error?{error:this.sourceStatusText(),solutionId:(0,h.studyStatusSolutionId)(e),title:(0,h.studyStatusTitle)(e),studyFeature:(0,h.studyStatusFeature)(e)}:null}getSplitTitle(){return this._source.titleInParts()}text(){return this._source.translatedType()}sourceStatusText(){return(0,h.convertStudyStatusToString)(this._source.status(),!0)}}var y=i(62288),v=i(27777);class S extends v.StatusView{constructor(e){super(e.statusProvider({}))}getSplitTitle(){return this._statusProvider.getSplitTitle()}}class b extends n.LineDataSource{constructor(e,t,s,n,o,r){super(e,n,o,r),this._indexes=null,this._inputs=null,this._definitionsViewModel=null,this._pointsetPoints=null,this._loadedPlots=null,this._loadedGraphics=null,this._beingCreatedPaneView=null,this._anchorsPaneView=null,this._isLegendDisplayed=!1,Promise.all([Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,8938)),Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,19583))]).then((t=>{const{LineToolBeingCreatedPaneView:i}=t[0],{StudyLineDataSourceAnchorsPaneView:s}=t[1];this._beingCreatedPaneView=new i(this,e),this._anchorsPaneView=new s(this,this.model()),this._model.lightUpdate()})),this._metaInfo=t,this._dataSource=new d(e.chartApi(),e.mainSeries(),s,t),this._dataSource.dataCleared().subscribe(this,this._onDataCleared),this._dataSource.dataUpdated().subscribe(this,this._onDataUpdated),this._dataSource.studyStatusChanged().subscribe(this,this._onStudyStatusChanged),this._statusProvider=new f(this),this._statusView=new S(this),this._showStudyArgumentsProperty=e.properties().childs().paneProperties.childs().legendProperties.childs().showStudyArguments}isDisplayedInLegend(){return this._isLegendDisplayed}titleInParts(){const e=[];if(this._showStudyArgumentsProperty.value()&&this._inputs)for(const t of this._metaInfo.inputs){if(!0===t.isHidden||"bool"===t.type)continue;const i=this._inputs[t.id];e.push(i.toString())}return[this.name(),e]}destroy(){this._dataSource.dataUpdated().unsubscribeAll(this),this._dataSource.dataCleared().unsubscribeAll(this),this._dataSource.studyStatusChanged().unsubscribeAll(this),this._dataSource.destroy(),null!==this._definitionsViewModel&&(this._definitionsViewModel.destroy(),this._definitionsViewModel=null),this._unsubscribeApplyInputsOnSeriesCompleted(),this._isDestroyed=!0,super.destroy()}stop(){super.stop(),this._isDestroyed||(this._dataSource.stop(),this.clearData())}start(){super.start(),this._isDestroyed||null===this._inputs||this._dataSource.start()}metaInfo(){return this._metaInfo}graphicsInfo(){return this._metaInfo.graphics}series(){return this._model.mainSeries()}translatedType(){return this._metaInfo.description}name(){return this._metaInfo.description}studyId(){return this._metaInfo.id}setPoint(e,t,i){super.setPoint(e,this._preparePoint(t,i))}move(e){}clearData(){this._clearAllDataExceptPointsetPoints(),this._pointsetPoints=null,this.updateAllViews((0,m.sourceChangeEvent)({sourceId:this.id(),clearData:!0})),super.clearData()}data(){
return this.plots()}plots(){return this._loadedPlots||this._dataSource.plots()}graphics(){return this._loadedGraphics||this._dataSource.graphics()}valueAt(e,t){return this.ownerSource()?.symbolSource().valueAt(e,t)??null}firstValue(){return this._model.mainSeries().firstValue()}state(e){const t={...super.state(e),metaInfo:this.metaInfo().state()};return e&&(t.data=this.plots().state(),t.nonseriesindexes=this._indexes,t.graphics=(0,a.saveStudyGraphics)(this.graphics(),null)),t}restoreData(e){void 0!==e.data&&(this._loadedPlots=new s.PlotList((0,_.studyPlotFunctionMap)(this._metaInfo),_.studyEmptyPlotValuePredicate),this._loadedPlots.restoreState(e.data)),this._indexes=e.nonseriesindexes??this._indexes,this._loadedGraphics=e.graphics?(0,a.loadStudyGraphics)(e.graphics):this._loadedGraphics}getPropertyDefinitionsViewModel(){return null===this._definitionsViewModel?this._getPropertyDefinitionsViewModelClass().then((e=>null===e||this._isDestroyed?null:(null===this._definitionsViewModel&&(this._definitionsViewModel=new e(this._model.undoModel(),this)),this._definitionsViewModel))):Promise.resolve(this._definitionsViewModel)}paneViews(e){let t=[];if(this.isSourceHidden())return t;if(this._isReady()&&this._changeStatesStack.isEmpty()){const i=super.paneViews(e);null!==i&&(t=t.concat(i))}else null!==this._beingCreatedPaneView&&t.push(this._beingCreatedPaneView);return null!==this._anchorsPaneView&&t.push(this._anchorsPaneView),t}propertiesChanged(e){super.propertiesChanged(e),this._onStudyInputsMayChange()}dataAndViewsReady(){return super.dataAndViewsReady()&&this._isReady()}endChanging(e,t){const i=super.endChanging(e,t);return i.indexesChanged?this.clearData():this._updateAnchorsPrice(!0),i}moveData(e){this._dataSource.moveData(e)}restorePoints(e,t,i){super.restorePoints(e,t,i),this._updateAnchorsPrice(!0)}statusProvider(e){return this._statusProvider}statusView(){return this._statusView}legendView(){return null}dataProblemModel(){return null}dataUpdatedModeModel(){return null}marketStatusModel(){return null}onStatusChanged(){return this._dataSource.studyStatusChanged()}status(){return this._dataSource.studyStatus()}recalcStudyIfNeeded(){}static createPropertiesFromStudyMetaInfoAndState(e,t,i,s,n){const o=(0,p.prepareStudyPropertiesForLoadChart)(e,t,i,s,void 0,n);return this._configureProperties(o),o}_getPointsetPoints(){return this._pointsetPoints}_onStudyStatusChanged(e,t){let i;switch(t.type){case u.StudyStatusType.Error:i=!0;break;case u.StudyStatusType.Completed:i=!1;break;default:return}if(i===this._isLegendDisplayed)return;this._isLegendDisplayed=i;const s=this._model.paneForSource(this);if(s){const e=this._model.panes().indexOf(s),t=y.InvalidationMask.invalidateLegendWidgetLayout(e);this.model().invalidate(t)}}_studyId(){return this._dataSource.studyId()}_isReady(){return!0}_updateAllPaneViews(e){super._updateAllPaneViews(e),this._beingCreatedPaneView?.update(),this._anchorsPaneView?.update(e)}_getPointTime(e,t){const i=e.index,s=this._model.timeScale().indexToTimePoint(i)
;return null!==s?s:t||void 0===e.time?null:this._utcTimeInCurrentResolution(e)}_updateAnchorsPrice(e){}_onPointsetUpdated(e){super._onPointsetUpdated(e),this._pointsetPoints=this._points.map((e=>({price:e.price,index:e.index,time:e.time}))),this._onStudyInputsMayChange()}_onDataCleared(){this.updateAllViews((0,m.sourceChangeEvent)({sourceId:this.id(),clearData:!0})),this._model.updateSource(this)}_onDataUpdated(e,t,i){this._updateAnchorsPrice(),this.updateAllViews((0,m.sourceChangeEvent)({sourceId:this.id(),firstUpdatedTimePointIndex:e[0]?.index})),this._model.updateSource(this)}_onStudyInputsMayChange(){let e=null;if(null!==this._pointsetPoints&&this._pointsetPoints.length===this.pointsCount()&&(e=this._studyInputs(this._pointsetPoints),null===e&&(this._clearAllDataExceptPointsetPoints(),this.updateAllViews((0,m.sourceChangeEvent)(this.id())))),null!==e){const t=this.metaInfo().inputs.map((e=>e.id)),i=Object.keys(e);for(const s of i)t.includes(s)||delete e[s]}this._areInputsEqual(this._inputs,e)||this._applyStudyInputs(e)}_preparePoint(e,t){return super._preparePoint(this._alignPointToRangeOfActualData(e),t)}_getPropertyDefinitionsViewModelClass(){return Promise.resolve(null)}_subscribeApplyInputsOnSeriesCompleted(){this._unsubscribeApplyInputsOnSeriesCompleted(),this._model.mainSeries().dataEvents().completed().subscribe(this,(()=>this._onStudyInputsMayChange()),!0)}_unsubscribeApplyInputsOnSeriesCompleted(){this._model.mainSeries().dataEvents().completed().unsubscribeAll(this)}_onInputsChanged(){0}_clearAllDataExceptPointsetPoints(){this._inputs=null,this._dataSource.clearData(),this._loadedPlots=null,this._indexes=null,this._loadedGraphics=null}static _createPropertiesFromStudyIdAndState(e,t){const i=r.StudyMetaInfo.getStudyPropertyRootNameById(e),s=new o.DefaultProperty({defaultName:i,state:t});return this._configureProperties(s),s}static _configureProperties(e){super._configureProperties(e),e.removeExcludedKey("intervalsVisibilities",1)}_areInputsEqual(e,t){return null===t?null===e:null!==e&&(0,l.areStudyInputsEqual)(this._metaInfo.inputs,e,t)}_applyStudyInputs(e){const t=this._inputs;this._inputs=e,null!==e&&(this._unsubscribeApplyInputsOnSeriesCompleted(),this._dataSource.setInputs(e),null===t&&this.isStarted()&&!this._dataSource.isStarted()&&this._dataSource.start()),this._onInputsChanged()}}},36009:(e,t,i)=>{"use strict";const s=i(29875).LineDataSource,n=i(92934).alignToStep,o=i(24526).customFormatters,r=i(68805).createSeriesFormatter;class a extends s{constructor(e,t){super(e,t),this.customization.forcePriceAxisLabel=!0,this.customization.disableErasing=!0,this.customization.showInObjectsTree=!1,this._createFormatter(e.mainSeries().symbolInfo()),this.setSelectionEnabled(!1)}isSynchronizable(){return!1}pointsCount(){return a.POINTS_COUNT}hasContextMenu(){return!1}state(){return null}startMoving(){super.startMoving.apply(this,arguments),this._cursorMoved=!1}endMoving(){super.endMoving.apply(this,arguments),this._cursorMoved=!1}userEditEnabled(){return!0}movable(){return!1}canBeHidden(){return!1}
isUserDeletable(){return!1}showInObjectTree(){return!1}doesMovingAffectsUndo(){return!1}isAvailableInFloatingWidget(){return!1}timeAxisViews(){return null}cloneable(){return!1}copiable(){return!1}_correctPoints(e,t){this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.logical.price-this._startMovingPoint.logical.price&&(this._cursorMoved=!0):this._cursorMoved=!1;for(var i=1/this.priceScale().mainSource().base(),s=0;s{"use strict";i.r(t),i.d(t,{LineToolTrendAngle:()=>h});var s=i(86441),n=i(50151),o=i(32679),r=i(10568),a=i(12988),l=i(44672);class c extends a.Property{constructor(e){super(),this._lineSource=e}value(){return Math.round(100*this._lineSource.angle()*180/Math.PI)/100}setValue(e){const t=e%360*Math.PI/180,i=this._lineSource.model().timeScale().barSpacing(),o=Math.cos(t),r=-Math.sin(t),a=this._lineSource.distance();let c;if(1!==Math.abs(r)){const e=a*o,t=e%i,s=i-e%i,n=Math.abs((e-t)/o),r=Math.abs((e+s)/o);c=Math.max(n,r)}else c=a;const h=(0,n.ensureNotNull)(this._lineSource.pointToScreenPoint(this._lineSource.points()[0])).add(new s.Point(o*c,r*c)),d=(0,n.ensureNotNull)(this._lineSource.screenPointToPoint(h));this._lineSource.setPoint(1,d);const u=this._lineSource.model();u.updateSource(this._lineSource),this._lineSource.updateAllViews((0,l.sourceChangeEvent)(this._lineSource.id())),u.updateSource(this._lineSource)}notifyChanged(){this._listeners.fire(this,"")}}class h extends r.InplaceTextLineDataSource{constructor(e,t,s,n){const o=t??h.createProperties(e.backgroundTheme().spawnOwnership());super(e,o,s,n),this._angle=0,this._distance=0,o.addChild("angle",new c(this)),Promise.all([i.e(2870),i.e(2211),i.e(1583)]).then(i.bind(i,82595)).then((({TrendAnglePaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)}))}isSynchronizable(){return!1}pointsCount(){return 2}name(){return"Trend Angle"}angle(){return this._angle}distance(){return this._distance}addPoint(e,t){const i=super.addPoint(e,t);return i&&this._calculateAngle(),i}setLastPoint(e,t){const i=super.setLastPoint(e,t);return this.points().length>1&&this._calculateAngle(),i}axisPoints(){if(this.points().length<2)return[];const e=[this.points()[0]],t=(0,n.ensureNotNull)(this.pointToScreenPoint(this.points()[0])),i=Math.cos(this._angle)*this._distance,o=-Math.sin(this._angle)*this._distance,r=t.add(new s.Point(i,o)),a=(0,n.ensureNotNull)(this.screenPointToPoint(r));return e.push(a),e}timeAxisPoints(){return this.axisPoints()}priceAxisPoints(){return this.axisPoints()}setPoint(e,t,i){super.setPoint(e,t,i),this.points().length>1&&1===e&&this._calculateAngle()}restoreData(e){this._angle=e.angle??0,this._distance=e.distance??0}state(e){const t=super.state(e);return t.angle=this._angle,
t.distance=this._distance,t}cloneData(e){this._angle=e.angle(),this._distance=e.distance()}canHasAlert(){return!0}editableTextProperties(){(0,n.assert)(!1,"unexpected method call")}snapTo45DegreesAvailable(){return!0}static createProperties(e,t){t&&void 0===t.showPercentPriceRange&&(t.showPercentPriceRange=t.showPriceRange,t.showPipsPriceRange=t.showPriceRange);const i=new o.DefaultProperty({defaultName:"linetooltrendangle",state:t,theme:e});return this._configureProperties(i),i}_getAlertPlots(){const e=this._linePointsToAlertPlot(this._points,null,this._properties.childs().extendLeft.value(),this._properties.childs().extendRight.value());return null===e?[]:[e]}_calculateAngle(){const e=(0,n.ensureNotNull)(this.pointToScreenPoint(this.points()[0]));let t=(0,n.ensureNotNull)(this.pointToScreenPoint(this.points()[1])).subtract(e);const i=t.length();i>0?(t=t.normalized(),this._angle=Math.acos(t.x),t.y>0&&(this._angle=-this._angle),this._distance=i):this._angle=0;this.properties().childs().angle.notifyChanged()}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(3401),i.e(3889),i.e(8009),i.e(6204),i.e(1963),i.e(8537)]).then(i.bind(i,30574)).then((e=>e.TrendAngleDefinitionsViewModel))}}},58519:(e,t,i)=>{"use strict";i.r(t),i.d(t,{loadTheme:()=>o});var s=i(85662),n=i(35039);async function o(e,t){const{themeName:i,standardTheme:o,syncState:r=!0,noUndo:a=!1,applyOverrides:l=!1,onlyActiveChart:c=!1}=t,h=await(o?Promise.resolve((0,s.getStdTheme)(i)):(0,s.getTheme)(i)),d=!o;if(void 0!==h.content){const t=!o||c;l&&(void 0!==(u=h.content).chartProperties&&(0,n.applyDefaultsOverrides)(u.chartProperties),void 0!==u.mainSourceProperties&&(0,n.applyDefaultsOverrides)(u.mainSourceProperties,void 0,!0,"mainSeriesProperties")),await e.applyTheme({theme:h.content,onlyActiveChart:t,restoreNonThemeDefaults:d,themeName:i,standardTheme:o,syncState:r,noUndo:a})}var u;return h}},92693:(e,t,i)=>{"use strict";var s;i.d(t,{MagnetMode:()=>s}),function(e){e[e.WeakMagnet=0]="WeakMagnet",e[e.StrongMagnet=1]="StrongMagnet"}(s||(s={}))},81171:(e,t,i)=>{"use strict";i.d(t,{magnetEnabled:()=>p,magnetMode:()=>m,setIsMagnetEnabled:()=>g,setMagnetMode:()=>f});var s=i(32679),n=i(64147),o=i(92693),r=i(928),a=i(15764),l=i(43550);const c=new n.WatchedValue(!1),h=new n.WatchedValue(o.MagnetMode.WeakMagnet),d=(0,l.modifierPressed)(),u=(0,l.shiftPressed)();function _(){const e=d.value();if(u.value()&&(r.isToolEditingNow.value()||r.isToolCreatingNow.value()))return void c.setValue(!1);let t,i;if(r.activePointSelectionMode.value()===r.SelectPointMode.Replay)t=i=!1;else{const s=r.tool.value(),n=r.isStudyEditingNow.value()||r.activePointSelectionMode.value()===r.SelectPointMode.Study;t=e&&((0,a.isLineToolName)(s)||r.isToolEditingNow.value()||(0,r.toolIsMeasure)(s)||n),i=(0,r.properties)().childs().magnet.value()}h.setValue(!i&&t?o.MagnetMode.StrongMagnet:(0,r.properties)().childs().magnetMode.value()),c.setValue(t?!i:i)}function p(){return c}function m(){return h}function g(e){(0,s.allowSavingDefaults)(!0),(0,r.properties)().childs().magnet.setValue(e),(0,
s.allowSavingDefaults)(!1)}function f(e){(0,s.allowSavingDefaults)(!0),(0,r.properties)().childs().magnetMode.setValue(e),(0,r.properties)().childs().magnet.setValue(!0),(0,s.allowSavingDefaults)(!1)}(0,r.runOnDrawingStateReady)((()=>{(0,r.properties)().childs().magnet.subscribe(null,_),(0,r.properties)().childs().magnetMode.subscribe(null,_),d.subscribe(_),u.subscribe(_),r.tool.subscribe(_),r.isToolEditingNow.subscribe(_),_()}))},44672:(e,t,i)=>{"use strict";i.d(t,{globalChangeEvent:()=>a,hoverChangeEvent:()=>_,selectionChangeEvent:()=>d,sourceChangeEvent:()=>o,viewportChangeEvent:()=>c});var s,n=i(83873);function o(e){return(0,n.default)(e)?{type:"data-source-change",sourceId:e}:{type:"data-source-change",...e}}!function(e){e.DataSourceChange="data-source-change",e.ViewportChange="viewport-change",e.GlobalChange="global-change",e.SelectionChange="selection-change",e.HoverChange="hover-change"}(s||(s={}));const r={type:"global-change"};function a(){return r}const l={type:"viewport-change"};function c(e){return e?{type:"viewport-change",pane:e}:l}const h={type:"selection-change"};function d(){return h}const u={type:"hover-change"};function _(){return u}},18172:(e,t,i)=>{"use strict";i.d(t,{unpackNonSeriesData:()=>o});var s=i(30551),n=i(50151);async function o(e){if(""===e)return null;const t=JSON.parse(e);if(!(0,s.isObject)(t)||"function"==typeof t)throw new Error("Non-object content in the non-series envelope");if((0,s.hasProperty)(t,"indexes_replace"))return{indexes_replace:!0};const i={indexes_replace:!1};if((0,s.hasProperty)(t,"offsets")&&(i.offsets=t.offsets),(0,s.hasProperty)(t,"isUpdate")){if("boolean"!=typeof t.isUpdate)throw new Error('Invalid type of "isUpdate" field');i.isUpdate=t.isUpdate}return(0,s.hasProperty)(t,"data")&&(i.data=t.data),(0,s.hasProperty)(t,"graphicsCmds")&&(i.graphicsCmds=function(e){if(!(0,s.isObject)(e))throw new Error("Graphics commands should be wrapped in an object");if((0,s.hasProperty)(e,"create"),(0,s.hasProperty)(e,"erase")){const t=e.erase;(0,n.assert)(Array.isArray(t),"Collection of erase commands should be array");for(const e of t){if(!(0,s.isObject)(e)||!(0,s.hasProperty)(e,"action"))throw new Error("Command should be an object with 'action' property");(0,n.assert)("all"===e.action||"one"===e.action,"Erase command action should be 'all' or 'one'")}}return e}(t.graphicsCmds)),i}},82587:(e,t,i)=>{"use strict";i.d(t,{notAvailable:()=>n});var s=i(11542);const n=i(56570).enabled("use_na_string_for_not_available_values")?s.t(null,void 0,i(90091)):"∅"},74079:(e,t,i)=>{"use strict";i.d(t,{getNumericFormatter:()=>c,getPercentageFormatter:()=>h,getPipFormatter:()=>_,getVolumeFormatter:()=>d});var s=i(59623),n=i(719);var o=i(725);class r extends o.PriceFormatter{constructor(e){const{priceScale:t,minMove:i=1,type:s,typespecs:n,minMove2:o,ignoreLocaleNumberFormat:r}=e;("forex"===s||function(e,t){return!!t?.includes("cfd")&&["commodity","futures","index","stock","fund"].includes(e)}(s,n))&&o?(super({priceScale:o,ignoreLocaleNumberFormat:r}),this._isForex=!0):(super({priceScale:1,
ignoreLocaleNumberFormat:r}),this._isForex=!1),this._pipPriceScale=t,this._pipMinMove=i,this._pipMinMove2=o}format(e,t={}){const{signPositive:i,tailSize:s,ignoreLocaleNumberFormat:n}=t;let o=this._isForex?this._pipMinMove2:this._pipMinMove;return void 0===o&&(o=NaN),super.format(e*this._pipPriceScale/o,{signPositive:i,tailSize:s,ignoreLocaleNumberFormat:n})}}var a=i(46084),l=i(58683);const c=(0,l.numDependencyFormatter)((e=>new s.NumericFormatter({precision:e}))),h=(0,l.numDependencyFormatter)((e=>new n.PercentageFormatter({priceScale:Math.pow(10,e??2),minMove:1}))),d=(0,l.numDependencyFormatter)((e=>new a.VolumeFormatter({precision:e}))),u=new WeakMap;function _(e){let t=u.get(e);return t||(t=new r({priceScale:e.pricescale,minMove:e.minmov,minMove2:e.minmove2,type:e.type,typespecs:e.typespecs}),u.set(e,t)),t}},33030:(e,t,i)=>{"use strict";i.d(t,{CLOSE_PLOT:()=>s});const s=4},72791:(e,t,i)=>{"use strict";var s;i.d(t,{PaneCursorType:()=>s}),function(e){e[e.Default=0]="Default",e[e.Pointer=1]="Pointer",e[e.Eraser=2]="Eraser",e[e.Dot=3]="Dot",e[e.Grabbing=4]="Grabbing",e[e.ZoomIn=5]="ZoomIn",e[e.VerticalResize=6]="VerticalResize",e[e.HorizontalResize=7]="HorizontalResize",e[e.DiagonalNeSwResize=8]="DiagonalNeSwResize",e[e.DiagonalNwSeResize=9]="DiagonalNwSeResize",e[e.Text=10]="Text"}(s||(s={}))},65458:(e,t,i)=>{"use strict";i.d(t,{PanePriceAxisView:()=>o});var s=i(2844);class n{constructor(e){this._priceAxisViewRenderer=null,this._rendererOptions=null,this._align="right",this._textWidthCache=e}setParams(e,t,i,s,n){this._priceAxisViewRenderer=e,this._rendererOptions=t,this._align=n}draw(e,t){null!==this._rendererOptions&&null!==this._priceAxisViewRenderer&&this._priceAxisViewRenderer.draw(e,t,this._rendererOptions,this._textWidthCache,this._align)}hitTest(e,t){return void 0===this._priceAxisViewRenderer?.hitTest?null:this._priceAxisViewRenderer?.hitTest(e,t,this._align)}}class o{constructor(e,t,i){this._renderer=null,this._invalidated=!0,this._priceAxisView=e,this._textWidthCache=new s.TextWidthCache(100),this._dataSource=t,this._chartModel=i,this._fontSize=-1,this._panePriceAxisViewRenderer=new n(this._textWidthCache)}update(e){this._invalidated=!0}renderer(e){return this._invalidated&&this._updateImpl(e),this._renderer}_position(){const e=this._chartModel.crosshairSource(),t=this._dataSource===e?e.pane:this._chartModel.paneForSource(this._dataSource);if(null===t)return null;const i=this._priceScale();if(null===i)return null;let s=t.priceScalePosition(i);return"overlay"===s&&(s=t.priceScalePosition(t.defaultPriceScale())),"overlay"===s?null:s}_updateImpl(e){this._renderer=null;const t=this._position();if(null===t)return;const i=this._chartModel.priceAxisRendererOptions();i.fontSize!==this._fontSize&&(this._fontSize=i.fontSize,this._textWidthCache.reset()),this._panePriceAxisViewRenderer.setParams(this._priceAxisView.paneRenderer(),i,e.mediaSize.width,e.mediaSize.height,t),this._renderer=this._panePriceAxisViewRenderer,this._invalidated=!1}_priceScale(){return this._dataSource.priceScale()}}},52977:(e,t,i)=>{
"use strict";i.d(t,{applyColor:()=>c});var s=i(83873),n=i(5201),o=i(46088);const r=new WeakMap;var a,l;function c(e,t,i=0,a=3){const{context:l,bitmapSize:c,mediaSize:h}=e;let d;if((0,s.default)(t))d=t;else if(t.type===o.ColorType.Solid)d=t.color;else{let e=r.get(l);void 0===e&&(e=new n.CircularCacheBuffer(1e3),r.set(l,e));const s=0===i?h.height:c.height,o=`${t.startColor}_${t.endColor}_${s}`;let a=e.get(o);void 0===a&&(a=l.createLinearGradient(0,0,0,s),a.addColorStop(0,t.startColor),a.addColorStop(1,t.endColor),e.set(o,a)),d=a}1&a&&(l.strokeStyle=d),2&a&&(l.fillStyle=d)}!function(e){e[e.Stroke=1]="Stroke",e[e.Fill=2]="Fill",e[e.Both=3]="Both"}(a||(a={})),function(e){e[e.Media=0]="Media",e[e.Bitmap=1]="Bitmap"}(l||(l={}))},67716:(e,t,i)=>{"use strict";i.d(t,{AreaBackgroundItem:()=>h,AreaBackgroundItemsGroup:()=>l,AreaBackgroundRenderer:()=>d,CachedMap:()=>c});var s,n,o=i(50151),r=i(30125),a=i(59152);!function(e){e[e.Solid=0]="Solid",e[e.Gradient=1]="Gradient"}(s||(s={})),function(e){e[e.PurgeCachedMapCacheIterations=50]="PurgeCachedMapCacheIterations"}(n||(n={}));class l extends a.CachedContainer{constructor(e){super(),this.color=e}}class c{constructor(){this._map=new Map,this._usedKeys=new Set,this._invalidations=0}invalidateCache(){this._invalidations+=1,50===this._invalidations&&(this._deleteUnused(),this._invalidations=0),this._usedKeys.clear(),this._map.forEach(((e,t)=>e.invalidateCache()))}get(e){const t=this._map.get(e);return void 0!==t&&this._usedKeys.add(e),t}set(e,t){this._usedKeys.add(e),this._map.set(e,t)}[Symbol.iterator](){const e=Array.from(this._usedKeys)[Symbol.iterator]();return{[Symbol.iterator](){return this},next:()=>{const t=e.next();return t.value?{value:[t.value,(0,o.ensureDefined)(this._map.get(t.value))],done:!1}:{value:void 0,done:!0}}}}forEach(e){this._map.forEach(((t,i)=>{this._usedKeys.has(i)&&e(t,i)}))}delete(e){const t=this._map.get(e);void 0!==t&&t.invalidateCache(),this._usedKeys.delete(e)}_deleteUnused(){const e=[];this._map.forEach(((t,i)=>{this._usedKeys.has(i)||e.push(i)}));for(const t of e)this._map.delete(t)}}class h extends a.CachedContainer{constructor(){super(),this.points1=new a.CachedContainer,this.points2=new a.CachedContainer,this.push(this.points1),this.push(this.points2)}addPoints1Point(e,t){let i=this.points1.newItem();null!==i?(i.x=e,i.y=t):i={x:e,y:t},this.points1.push(i)}addPoints2Point(e,t){let i=this.points2.newItem();null!==i?(i.x=e,i.y=t):i={x:e,y:t},this.points2.push(i)}invalidateCache(){this.points1.invalidateCache(),this.points2.invalidateCache()}}class d extends r.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._data=e??null}setData(e){this._data=e}hitTest(e){return null}_drawImpl(e){if(null===this._data)return;const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s}=e,n=.25*this._data.barSpacing;for(const[,e]of this._data.colorAreas){t.beginPath();for(let o=0;o{"use strict";i.d(t,{PaneRendererArea:()=>a});var s=i(74010),n=i(61993),o=i(37743),r=i(52977);class a extends s.PaneRendererLine{constructor(e){e.forceLineColor=!1,super(e)}_drawImpl(e){const t=this._data;if(0===t.items.length)return;let i=this._data.visibleItemsRange?.startItemIndex??0,a=(this._data.visibleItemsRange?.endItemIndex??this._data.items.length)-1;for(;i=0&&!(0,n.coordinateIsValid)(t.items[a].y);)a--;if(i>a)return;const{context:l,horizontalPixelRatio:c,verticalPixelRatio:h}=e;l.save(),l.scale(c,h),l.lineCap="round",(0,r.applyColor)(e,t.lineColor,0,1),l.lineWidth=t.lineWidth,(0,o.setLineStyle)(l,t.lineStyle),l.lineWidth=1;const d=new Map,u=new s.PaneRendererLineItemsIterator(this._data.items,i,a+1,this._data.skipHoles);for(;u.next();){const e=u.currentValue();let i;i=(0,s.isValidPoint)(e)&&e.style?e.style.color:t.lineColor;const n=u.nextValue();if((0,s.isValidPoint)(n)&&n?.style){const t=n.style.color;if(i!==t){const i=d.get(t)??[];i.push(e),d.set(t,i)}}const o=d.get(i)??[];o.push(e),d.set(i,o)}for(const[i,n]of d){l.beginPath();let o=0;for(let e=0;e{"use strict";i.d(t,{BitmapCoordinatesPaneRenderer:()=>n});var s=i(27714);class n{draw(e,t){new s.CanvasRenderingTarget2D(e,t.mediaSize,t.bitmapSize).useBitmapCoordinateSpace((e=>this._drawImpl(e)))}drawBackground(e,t){new s.CanvasRenderingTarget2D(e,t.mediaSize,t.bitmapSize).useBitmapCoordinateSpace((e=>this._drawBackgroundImpl(e)))}_drawBackgroundImpl(e){}}},95201:(e,t,i)=>{"use strict";i.d(t,{CompositeRenderer:()=>s});class s{constructor(){this._renderers=[],this._globalAlpha=1}setGlobalAlpha(e){this._globalAlpha=e}append(e){e&&this._renderers.push(e)}insert(e,t){this._renderers.splice(t,0,e)}clear(){this._renderers.length=0}isEmpty(){return 0===this._renderers.length}draw(e,t){
for(let i=0;i=0;s--){const n=this._renderers[s].hitTest(e,t);null!==n&&(null===i||n.target()>i.target())&&(i=n)}return i}doesIntersectWithBox(e,t){return this._renderers.some((i=>!!i.doesIntersectWithBox&&i.doesIntersectWithBox(e,t)))}}},37743:(e,t,i)=>{"use strict";i.r(t),i.d(t,{addHorizontalLineToPath:()=>d,addLineToPath:()=>T,addPixelPerfectLineToPath:()=>I,addVerticalLineToPath:()=>_,clearRectWithGradient:()=>c,clipPolygonByEdge:()=>A,computeDashPattern:()=>P,createCircle:()=>b,drawHorizontalLine:()=>u,drawLine:()=>x,drawPixelPerfectLine:()=>M,drawPoly:()=>w,drawRoundRect:()=>f,drawRoundRectWithInnerBorder:()=>y,drawVerticalLine:()=>p,fillRectInnerBorder:()=>h,fillRectWithBorder:()=>S,scaleDrawRoundRectRadii:()=>m,scaledDashPattern:()=>v,setLineStyle:()=>C});var s=i(86441),n=i(5531),o=i(51056),r=i(85904),a=i(7114),l=i(64034);function c(e,t,i,s,n,o,r){e.save(),e.globalCompositeOperation="copy";const a=e.createLinearGradient(0,0,0,n);a.addColorStop(0,o),a.addColorStop(1,r),e.fillStyle=a,e.fillRect(t,i,s,n),e.restore()}function h(e,t,i,s,n,o){e.fillRect(t+o,i,s-2*o,o),e.fillRect(t+o,i+n-o,s-2*o,o),e.fillRect(t,i,o,n),e.fillRect(t+s-o,i,o,n)}function d(e,t,i,s){const n=e.lineWidth%2?.5:0;e.moveTo(i,t+n),e.lineTo(s,t+n)}function u(e,t,i,s){e.beginPath(),d(e,t,i,s),e.stroke()}function _(e,t,i,s){const n=e.lineWidth%2?.5:0;e.moveTo(t+n,i),e.lineTo(t+n,s)}function p(e,t,i,s){e.beginPath(),_(e,t,i,s),e.stroke()}function m(e,t){return Array.isArray(e)?e.map((e=>Math.round(e*t))):Math.round(e*t)}function g(e,t){return Array.isArray(e)?e.map((e=>0===e?e:e+t)):e+t}function f(e,t,i,s,n,o,r){let a,l,c,h;if(Array.isArray(o))if(2===o.length){const e=Math.max(0,o[0]),t=Math.max(0,o[1]);a=e,l=e,c=t,h=t}else{if(4!==o.length)throw new Error("Wrong border radius - it should be like css border radius");a=Math.max(0,o[0]),l=Math.max(0,o[1]),c=Math.max(0,o[2]),h=Math.max(0,o[3])}else{const e=Math.max(0,o);a=e,l=e,c=e,h=e}r||e.beginPath(),e.moveTo(t+a,i),e.lineTo(t+s-l,i),0!==l&&e.arcTo(t+s,i,t+s,i+l,l),e.lineTo(t+s,i+n-c),0!==c&&e.arcTo(t+s,i+n,t+s-c,i+n,c),e.lineTo(t+h,i+n),0!==h&&e.arcTo(t,i+n,t,i+n-h,h),e.lineTo(t,i+a),0!==a&&e.arcTo(t,i,t+a,i,a)}function y(e,t,i,s,n,o,a=0,l=0,c="",h=r.LineStyle.Solid){if(e.save(),!l||!c||c===o)return f(e,t,i,s,n,a),e.fillStyle=o,e.fill(),void e.restore();const d=l/2;if("transparent"!==o){const d="transparent"!==c&&h!==r.LineStyle.Solid;f(e,d?t:t+l,d?i:i+l,d?s:s-2*l,d?n:n-2*l,d?a:g(a,-l)),e.fillStyle=o,e.fill()}if("transparent"!==c){f(e,t+d,i+d,s-l,n-l,g(a,-d)),e.lineWidth=l,e.strokeStyle=c,C(e,h),e.closePath(),e.stroke()}e.restore()}function v(e,t){return t=Math.max(1,t),e.map((e=>e*t))}function S(e,t,i,s,n,l,c,h,d){const{context:_}=e,p=l%2/2,m=t+p,g=s+p
;let f,y;if(h){const{borderMode:e,borderWidth:r,color:a,dashPattern:c,lineStyle:d}=h;switch(e){case"outer":{const e=-l/2-r/2,t=-r/2;y={left:m+e,right:g-e,top:i+t,bottom:n-t};break}case"center":{const e=r%2/2;y={left:t+e,right:s+e,top:i+e,bottom:n+e};break}case"inner":{const e=-l/2+r/2,t=r/2;y={left:m+e,right:g-e,top:i+t,bottom:n-t}}}_.strokeStyle=a,_.lineWidth=r;let u=-1;c?_.setLineDash(v(c,r)):void 0!==d&&(C(_,d),d===o.LINESTYLE_SOLID&&(u=1)),f={left:y.left+u*r/2,top:y.top+u*r/2,right:y.right-u*r/2,bottom:y.bottom-u*r/2}}if(c&&(_.fillStyle=c.color,f||(f={left:m-l/2,right:g+l/2,top:i,bottom:n}),_.fillRect(f.left,f.top,f.right-f.left,f.bottom-f.top)),d){const{lineWidth:o,lineColor:r,lineStyle:l,excludeBoundaries:c}=d;_.save(),_.lineCap="butt",_.lineWidth=o,_.strokeStyle=r,C(_,l);const p=()=>u(_,Math.floor((i+n)/2),h?.rightToLeftStroke?s:t,h?.rightToLeftStroke?t:s);c?(0,a.drawWithExclusionAreaByScope)(e,c,p):p(),_.restore()}if(y){if((h?.lineStyle??r.LineStyle.Solid)===r.LineStyle.Solid)_.strokeRect(y.left,y.top,y.right-y.left,y.bottom-y.top);else{const e=h?.rightToLeftStroke?y.right:y.left,t=h?.rightToLeftStroke?y.left:y.right,i=y.top,s=y.bottom;_.lineCap="butt",[[e,i,t,i],[e,s,t,s],[e,i,e,s],[t,i,t,s]].forEach((([e,t,i,s])=>{_.beginPath(),_.moveTo(e,t),_.lineTo(i,s),_.stroke()}))}}}function b(e,t,i,s){e.beginPath(),e.arc(t,i,s,0,2*Math.PI,!1),e.closePath()}function w(e,t,i){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(const i of t)e.lineTo(i.x,i.y);e.closePath(),e.stroke(),i&&e.fill()}function C(e,t){let i=[];t!==o.LINESTYLE_SOLID&&(i=P(e.lineWidth,t)),e.setLineDash(i)}function P(e,t){return[[e,2*e],[5*e,6*e],[6*e,6*e],[e,4*e],[2*e,e]][t-1]}function T(e,t,i,s,n){e.moveTo(t,i),e.lineTo(s,n)}function x(e,t,i,s,n){isFinite(t)&&isFinite(s)&&isFinite(i)&&isFinite(n)&&(e.beginPath(),T(e,t,i,s,n),e.stroke())}function I(e,t,i,s,n,o){const{horizontalPixelRatio:r,verticalPixelRatio:a}=o;let l;return t===s?(l=[Math.round(t*r),i*a,Math.round(t*r),n*a],_(e,l[0],l[1],l[3])):i===n?(l=[t*r,Math.round(i*a),s*r,Math.round(i*a)],d(e,l[1],l[0],l[2])):(l=[t*r,i*a,s*r,n*a],T(e,l[0],l[1],l[2],l[3])),l}function M(e,t,i,s,n,o=l.dpr1PixelRatioInfo){e.beginPath(),I(e,t,i,s,n,o),e.stroke()}function A(e,t,i,o){const r=(0,s.equalPoints)(i,o[0])?(0,s.equalPoints)(i,o[1])?null:o[1]:o[0];return null!==e&&null!==r?(0,n.intersectPolygonAndHalfplane)(e,(0,s.halfplaneThroughPoint)((0,s.lineThroughPoints)(t,i),r)):null}},61993:(e,t,i)=>{"use strict";i.d(t,{coordinateIsValid:()=>g,extendAndClipLineSegment:()=>h,fillScaledRadius:()=>y,getArrowPoints:()=>d,interactionTolerance:()=>m,optimalBarWidth:()=>u,optimalCandlestickWidth:()=>_,optimalHiLoWidth:()=>p,roundToMax:()=>S,setValidLineStyle:()=>f,strokeScaledRadius:()=>v});var s=i(86441),n=i(5531),o=i(69186),r=i(37265),a=i(37743);const l={common:13,line:13,minDistanceBetweenPoints:10,series:14,curve:10,anchor:13,esd:4},c={common:3,line:3,minDistanceBetweenPoints:5,series:2,curve:3,anchor:2,esd:0};function h(e,t,i,o,r,a){if((0,s.equalPoints)(e,t))return null;const l=new s.Point(0,0),c=new s.Point(i,o);if(r){
if(a){const i=(0,n.intersectLineAndBox)((0,s.lineThroughPoints)(e,t),(0,s.box)(l,c));return Array.isArray(i)?i:null}{const i=(0,n.intersectRayAndBox)(t,e,(0,s.box)(l,c));return null===i||(0,s.equalPoints)(t,i)?null:(0,s.lineSegment)(t,i)}}if(a){const i=(0,n.intersectRayAndBox)(e,t,(0,s.box)(l,c));return null===i||(0,s.equalPoints)(e,i)?null:(0,s.lineSegment)(e,i)}{const i=(0,n.intersectLineSegmentAndBox)((0,s.lineSegment)(e,t),(0,s.box)(l,c));return Array.isArray(i)?i:null}}function d(e,t,i,s,n){const o=.5*i,r=Math.sqrt(2),a=t.subtract(e),l=a.normalized();let c=5*i;s&&(c=Math.min(c,.35*a.length()));const h=1*o;if(c*r*.2<=h)return[];const d=l.scaled(c),u=t.subtract(d),_=l.transposed(),p=1*c,m=_.scaled(p),g=u.add(m),f=u.subtract(m),y=g.subtract(t).normalized().scaled(h),v=f.subtract(t).normalized().scaled(h),S=n?t:t.add(y),b=n?t:t.add(v),w=o*(r-1),C=_.scaled(w),P=Math.min(c-1*o/r,o*r*1),T=l.scaled(P),x=t.subtract(C),I=t.add(C),M=t.subtract(T);return[[g,S],[b,f],[x,M.subtract(C)],[I,M.add(C)]]}function u(e,t){return t=t||1,Math.floor(.3*e*t)}function _(e,t){if(e>=2.5&&e<=4)return Math.floor(3*t);const i=1-.2*Math.atan(Math.max(4,e)-4)/(.5*Math.PI),s=Math.floor(e*i*t),n=Math.floor(e*t),o=Math.min(s,n);return Math.max(Math.floor(t),o)}function p(e){return.4*e}function m(){return(0,o.lastMouseOrTouchEventInfo)().isTouch?l:c}function g(e){return null!=e&&!(0,r.isNaN)(e)}function f(e,t){void 0!==t&&(0,a.setLineStyle)(e,t)}function y(e,t){const i=Math.max(1,Math.floor(t))%2?.5:0;return Math.round(e*t)+i}function v(e,t,i){const s=Math.max(1,Math.floor(t))%2?.5:0;return Math.round(e*t)+(s!==i%2?.5:0)}function S(e){return Math.max(Math.floor(e),1)}},50600:(e,t,i)=>{"use strict";i.d(t,{HorizontalLineRenderer:()=>l});var s=i(56468),n=i(37743),o=i(61993),r=i(30125),a=i(7114);class l extends r.BitmapCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null,this._hitTest=new s.HitTestResult(s.HitTarget.Regular)}setData(e){this._data=e}setHitTest(e){this._hitTest=e}hitTest(e){if(null===this._data||!1===this._data.visible||null===this._hitTest)return null;const t=(0,o.interactionTolerance)().line,i=Math.abs(e.y-this._data.y)<=t+this._data.linewidth/2,s=void 0===this._data.left||this._data.left-e.x<=t,n=void 0===this._data.right||e.x-this._data.right<=t;return i&&s&&n?this._hitTest:null}_drawImpl(e){if(null===this._data||!1===this._data.visible)return;const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s,mediaSize:o}=e;if(this._data.y<-this._data.linewidth/2||this._data.y>o.height+this._data.linewidth/2)return;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=Math.max(1,Math.floor(this._data.linewidth*i)),void 0!==this._data.linestyle&&(0,n.setLineStyle)(t,this._data.linestyle);const r=void 0!==this._data.left?Math.max(this._data.left,0):0,l=void 0!==this._data.right?Math.min(this._data.right,o.width):o.width,c=Math.round(this._data.y*s),h=Math.round(r*i),d=Math.round(l*i),u=this._data.excludeBoundaries;void 0!==u&&(0,a.addExclusionAreaByScope)(e,u),(0,n.drawHorizontalLine)(t,c,h,d)}}},49857:(e,t,i)=>{
"use strict";var s;i.d(t,{LineEnd:()=>s}),function(e){e[e.Normal=0]="Normal",e[e.Arrow=1]="Arrow",e[e.Circle=2]="Circle"}(s||(s={}))},74010:(e,t,i)=>{"use strict";i.d(t,{PaneRendererLine:()=>p,PaneRendererLineItemsIterator:()=>_,isValidPoint:()=>u});var s=i(50151),n=i(86441),o=i(4652),r=i(56468),a=i(61993),l=i(37743),c=i(30125),h=i(52977);const d={y:NaN};function u(e){return null!==e&&!isNaN(e.y)}class _{constructor(e,t,i,n){this._calculatedPrev={index:null,currentBreakProcessed:!1,value:null},this._calculatedCurrent={index:null,currentBreakProcessed:!1,value:null},this._calculatedNext={index:null,currentBreakProcessed:!1,value:null},this._preallocatedVariable={index:null,currentBreakProcessed:!1,value:null},e.length&&((0,s.assert)(t<=i,"First index must be less or equal to last index"),(0,s.assert)(t2;){const t=Math.round((s+i)/2);this._data.items[t].center<=e.x?i=t:s=t}i=Math.max(1,i-1),s=Math.min(this._data.items.length-1,s+1);for(let a=i;a<=s;++a){const i=this._data.items[a-1],s=this._data.items[a],l=i.center,c=s.center;if((0,o.distanceToSegment)(new n.Point(l,i.y),new n.Point(c,s.y),new n.Point(e.x,e.y)).distance<=t)return this._data.hittest?this._data.hittest:new r.HitTestResult(r.HitTarget.Regular)}return null}_drawImpl(e){const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s}=e;t.scale(i,s),t.lineCap="round",t.lineJoin="round",(0,h.applyColor)(e,this._data.lineColor,0,3),t.lineWidth=this._data.lineWidth,(0,l.setLineStyle)(t,this._data.lineStyle),(0,a.setValidLineStyle)(t,this._data.lineStyle),this._data.simpleMode?this._drawSimpleMode(e):this._drawLines(t)}_drawSimpleMode(e){const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s}=e;t.beginPath(),this._walkLine(t,this._data.items,!1,NaN),t.stroke();const n=this._data.lineWidth+2;if(this._data.withMarkers&&2*n=l;){const n=this._data.items[e];if(n){const e=Math.round(n.center*i)+o,l=n.y*s;t.moveTo(e,l),t.arc(e,l,r,0,a)}}t.fill()}}_walkLine(e,t,i,s,n){if(!t)return;const o=.25*this._data.barSpacing;let r,a,l=null;const c=n?0:this._data.visibleItemsRange?.startItemIndex??0,h=n?t.length:Math.min(this._data.visibleItemsRange?.endItemIndex??t.length,t.length);if(c>h||c>=t.length)return;const d=new _(t,c,h,this._data.skipHoles);for(;d.next();){if(r=d.currentValue(),a=d.nextValue(),u(r)){const t=Math.round(r.center);l&&u(l)?(e.lineTo(t,r.y),i&&!u(a)&&e.lineTo(t,s)):a&&u(a)?i?(d.atStart()||e.lineTo(t,s),e.lineTo(t,r.y)):e.moveTo(t,r.y):i?(d.atStart()||e.lineTo(t-o,s),e.lineTo(t-o,r.y),e.lineTo(t+o,r.y),e.lineTo(t+o,s)):(e.moveTo(t-o,r.y),e.lineTo(t+o,r.y))}l=r}}_drawLines(e){if(!this._data.items.length)return;let t,i,s=null;const n=.25*this._data.barSpacing;e.beginPath()
;const o=this._data.visibleItemsRange?.startItemIndex??0,r=this._data.visibleItemsRange?.endItemIndex??this._data.items.length;if(o>r||o>=this._data.items.length)return;const l=this._data.items[o];l&&e.moveTo(l.center,l.y);let c,h=e.strokeStyle,d=e.lineWidth;const p=new _(this._data.items,o,r,this._data.skipHoles);for(;p.next();){let o,r,l;s=p.prevValue(),t=p.currentValue(),i=p.nextValue();let _=!1;if(u(t)&&(t.style&&!this._data.forceLineColor?(o=t.style.color,r=t.style.width,l=t.style.style):(o=this._data.lineColor,r=this._data.lineWidth,l=this._data.lineStyle),this._data.ignorePaletteLineWidth&&(r=this._data.lineWidth),_=o!==h||r!==d||l!==c),_)if(h=o,d=r,c=l,e.stroke(),e.beginPath(),e.strokeStyle=o,e.lineWidth=r,(0,a.setValidLineStyle)(e,l),u(s))e.moveTo(s.center,s.y);else{const i=t;e.moveTo(i.center,i.y)}m=s,f=i,u(g=t)&&(u(m)?e.lineTo(g.center,g.y):f&&u(f)?e.moveTo(g.center,g.y):(e.moveTo(g.center-n,g.y),e.lineTo(g.center+n,g.y)))}var m,g,f;e.stroke()}}},75919:(e,t,i)=>{"use strict";i.d(t,{MediaCoordinatesPaneRenderer:()=>n});var s=i(27714);class n{draw(e,t){new s.CanvasRenderingTarget2D(e,t.mediaSize,t.bitmapSize).useMediaCoordinateSpace((e=>this._drawImpl(e)))}drawBackground(e,t){new s.CanvasRenderingTarget2D(e,t.mediaSize,t.bitmapSize).useMediaCoordinateSpace((e=>this._drawBackgroundImpl(e)))}_drawBackgroundImpl(e){}}},59152:(e,t,i)=>{"use strict";var s;i.d(t,{CachedContainer:()=>o,ObjectValuesCache:()=>r}),function(e){e[e.PurgeCachedContainerCacheIterations=3e3]="PurgeCachedContainerCacheIterations"}(s||(s={}));class n{constructor(e,t,i,s){this._items=e,this._actualLength=t,this._step=s?-1:1,this._currentIndex=i-this._step}[Symbol.iterator](){return this}next(){return this._currentIndex+=this._step,this._currentIndex>=this._actualLength||this._currentIndex<0?{value:void 0,done:!0}:{done:!1,value:this._items[this._currentIndex]}}}class o{constructor(){this._items=[],this._actualLength=0,this._invalidations=0}push(e){this._items.length===this._actualLength?this._items.push(e):this._items[this._actualLength]!==e&&(this._items[this._actualLength]=e),this._actualLength+=1}newItem(){const e=this._items.length>this._actualLength?this._items[this._actualLength]:null;return null!==e&&Boolean(e.invalidateCache)&&e.invalidateCache(),e}invalidateCache(){this._invalidations+=1,3e3===this._invalidations&&(this._items.splice(this._actualLength),this._invalidations=0),this._actualLength=0}at(e){return this._items[e]}data(){return this._items}length(){return this._actualLength}isEmpty(){return 0===this._actualLength}iterator(e,t){return new n(this._items,this._actualLength,e,t)}}class r extends o{constructor(){super(...arguments),this._startIndex=0}setStartIndex(e){this._startIndex=e}isValidIndex(e){return e>=this._startIndex}at(e){const t=e-this._startIndex;for(;t>=this._actualLength;)this._items.length<=t?this._items.push(this._newObject()):this._clearObject(this._items[this._actualLength]),this._actualLength+=1;return this._items[t]}}},62189:(e,t,i)=>{"use strict";i.d(t,{RectangleRenderer:()=>_})
;var s,n=i(50151),o=i(86441),r=i(34026),a=i(4652),l=i(19063),c=i(56468),h=i(85904),d=i(37743),u=i(30125);!function(e){e[e.HitTestTolerance=3]="HitTestTolerance"}(s||(s={}));class _ extends u.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._forceOverrideTransparency=Boolean(e)}setData(e){this._data=e}hitTest(e,t){if(null===this._data||this._data.points.length<2||this._data.disableInteractions)return null;const i=t.mediaSize.width,s=(0,o.box)(...this._data.points),n=s.min,r=s.max,l=new o.Point(r.x,n.y),h=new o.Point(n.x,r.y),d=this._extendAndHitTestLineSegment(e,n,l,i);if(null!==d)return d;const u=this._extendAndHitTestLineSegment(e,h,r,i);if(null!==u)return u;let _=(0,a.distanceToSegment)(l,r,e);if(_.distance<=3)return new c.HitTestResult(c.HitTarget.MovePoint);if(_=(0,a.distanceToSegment)(n,h,e),_.distance<=3)return new c.HitTestResult(c.HitTarget.MovePoint);if(this._data.middleLine){const t=s.min.add(s.max).scaled(.5),n=this._extendAndHitTestLineSegment(e,new o.Point(s.min.x,t.y),new o.Point(s.max.x,t.y),i);if(null!==n)return n}return this._data.fillBackground?this._hitTestBackground(e,n,r,i):null}getColor(){const e=(0,n.ensure)(this._data);return void 0===e.transparency?e.backcolor:(0,l.generateColor)(e.backcolor,e.transparency,this._forceOverrideTransparency)}visibleRectSegment(e){const t=this._data;if(null===t)return null;const i=(0,o.box)(...t.points),s=i.min,n=i.max,r=e.width,a=e.height,l=t.extendLeft?0:Math.max(s.x,0),c=t.extendRight?r:Math.min(n.x,r);if(l>c||c<=0||l>=r)return null;const h=Math.max(s.y,0),d=Math.min(n.y,a);return h>d||d<=0||h>a?null:[new o.Point(l,h),new o.Point(c,d)]}_drawImpl(e){if(null===this._data||this._data.points.length<2||this._data.linewidth<=0&&!this._data.fillBackground)return;const{horizontalPixelRatio:t,verticalPixelRatio:i,bitmapSize:s}=e,{extendLeft:n,extendRight:r,linewidth:a,middleLine:l}=this._data,c=(0,o.box)(...this._data.points),u=this._data.linewidth?Math.max(1,Math.floor(this._data.linewidth*t)):0,_=this._data.fillBackground?this.getColor():void 0,p=Math.max(1,Math.floor(t)),m=n?-a:Math.round(c.min.x*t),g=r?s.width+a:Math.round(c.max.x*t),f=Math.round(c.min.y*i),y=Math.round(c.max.y*i);(0,d.fillRectWithBorder)(e,m,f,g,y,p,void 0===_?void 0:{color:_},0===u?void 0:{color:this._data.color,lineStyle:this._data.linestyle??h.LineStyle.Solid,borderWidth:u,borderMode:"center",rightToLeftStroke:n&&!r},l?{...l,lineWidth:Math.max(1,Math.floor(l.lineWidth*i))}:void 0)}_extendAndHitTestLineSegment(e,t,i,s){const n=this._extendAndClipLineSegment(t,i,s);if(null!==n){if((0,a.distanceToSegment)(n[0],n[1],e).distance<=3)return new c.HitTestResult(c.HitTarget.MovePoint)}return null}_extendAndClipLineSegment(e,t,i){const s=(0,n.ensureNotNull)(this._data);if((0,o.equalPoints)(e,t)&&!s.extendLeft&&!s.extendRight)return null;const r=Math.min(e.x,t.x),a=Math.max(e.x,t.x),l=s.extendLeft?0:Math.max(r,0),c=s.extendRight?i:Math.min(a,i);return l>c||c<=0||l>=i?null:[new o.Point(l,e.y),new o.Point(c,t.y)]}_hitTestBackground(e,t,i,s){
const n=this._extendAndClipLineSegment(t,i,s);return null!==n&&(0,r.pointInBox)(e,(0,o.box)(n[0],n[1]))?new c.HitTestResult(this._data?.backgroundHitTarget??c.HitTarget.MovePointBackground):null}}},12027:(e,t,i)=>{"use strict";i.d(t,{svgRenderer:()=>x});var s=i(50151),n=i(9343);const o=(0,n.getLogger)("Chart.SvgParser");function r(e,t){const i=e.split(/[,\s]/).map((e=>parseFloat(e.trim())));let s=0;for(const e of i){if(!Number.isFinite(e)&&s(0,s.ensureDefined)(t.getStyle(e,i)):e=>o}const r=e.getAttribute("stroke");if(null!==r){const e=u(r);n.getStrokeStyle=null!==e?i=>(0,s.ensureDefined)(t.getStyle(e,i)):e=>r}const a=h(e,"stroke-width");Number.isFinite(a)&&(n.strokeWidth=a);const c=h(e,"opacity");Number.isFinite(c)&&(n.fillOpacity=c,n.strokeOpacity=c);const d=h(e,"stroke-opacity");Number.isFinite(d)&&(n.strokeOpacity=d);const _=h(e,"fill-opacity");if(Number.isFinite(_)&&(n.fillOpacity=_),i){const t=l(e);null!==t&&(n.transform=t)}return n}class p{constructor(e){this._transformOperations=e}apply(e,t){null!==this._transformOperations?(e.save(),c(e,this._transformOperations)):e.restore()}}class m{constructor(e,t,i){this._styleData={...i,..._(e,t,!0)}}apply(e,t){if(!this._isValid())return;const{getFillStyle:i,getStrokeStyle:s,strokeWidth:n,transform:o,strokeOpacity:r,fillOpacity:a}=this._styleData,l=void 0!==o||void 0!==r||void 0!==a;l&&(e.save(),void 0!==o&&c(e,o)),this._render(e);const h=i?.(e);"none"!==h&&(t.doNotApplyColors||(void 0!==a&&(e.globalAlpha=a),e.fillStyle=h??"black"),this._fill(e));const d=s?.(e);void 0!==d&&"none"!==d&&(void 0!==n&&(e.lineWidth=n),t.doNotApplyColors||(void 0!==a&&(e.globalAlpha=a),e.strokeStyle=d),this._stroke(e)),l&&e.restore()}_fill(e){e.fill()}_stroke(e){e.stroke()}}class g extends m{constructor(e,t,i){super(e,t,i);const s=e.getAttribute("d")
;this._path=null!==s?new Path2D(s):null,this._fillRule=e.getAttribute("fill-rule")??void 0}_fill(e){e.fill((0,s.ensureNotNull)(this._path),this._fillRule)}_stroke(e){e.stroke((0,s.ensureNotNull)(this._path))}_render(e){}_isValid(){return null!==this._path}}class f extends m{constructor(e,t,i){super(e,t,i),this._cx=h(e,"cx"),this._cy=h(e,"cy"),this._r=h(e,"r")}_render(e){e.beginPath(),e.arc(this._cx,this._cy,this._r,0,2*Math.PI)}_isValid(){return Number.isFinite(this._cx)&&Number.isFinite(this._cy)&&Number.isFinite(this._r)}}class y extends m{constructor(e,t,i){super(e,t,i),this._cx=h(e,"cx"),this._cy=h(e,"cy"),this._rx=h(e,"rx"),this._ry=h(e,"ry")}_render(e){e.beginPath(),e.ellipse(this._cx,this._cy,this._rx,this._ry,0,0,2*Math.PI)}_isValid(){return Number.isFinite(this._cx)&&Number.isFinite(this._cy)&&Number.isFinite(this._rx)&&Number.isFinite(this._ry)}}class v{constructor(e){this._originalViewBox=e}apply(e,t){const i=t.targetViewBox;e.translate(i.x,i.y),e.scale(i.width/this._originalViewBox.width,i.height/this._originalViewBox.height),e.beginPath(),e.rect(0,0,this._originalViewBox.width,this._originalViewBox.height),e.clip(),e.translate(-this._originalViewBox.x,-this._originalViewBox.y)}}const S=(0,n.getLogger)("Chart.SvgParser");function b(e){const t=e.getAttribute("gradientUnits");if("objectBoundingBox"===t)return void S.logWarn(`Unsupported linearGradient gradientUnits: ${t}`);const i=[],s=e.getElementsByTagName("stop");for(let e=0;e{const t=e.createLinearGradient(n,o,r,a);for(const e of i)t.addColorStop(e[0],e[1]);return t}}const w=(0,n.getLogger)("Chart.SvgParser");const C=new DOMParser,P=(0,n.getLogger)("Chart.SvgParser");function T(e,t,i,s){const n=e.children;let o,r=s;"g"!==e.tagName&&"svg"!==e.tagName||(r={...r,..._(e,i,!1)},o=l(e)??void 0),void 0!==o&&t.push(new p(o));for(let e=0;e{}};const l=n.getElementsByTagName("defs");return l.length>0&&(a=function(e){const t={},i=e.children;for(let e=0;e{const n=t[e];if(!n)return;let o=s.get(i);void 0===o&&(o=new Map,s.set(i,o));const r=o.get(e);if(void 0!==r)return r;const a=n(i);return o.set(e,a),a}}}(l[0])),T(n,i,a),{viewBox:()=>r,
render:(e,t)=>{e.save();for(const s of i)s.apply(e,t);e.restore()}}}},39429:(e,t,i)=>{"use strict";var s;i.d(t,{StatsPosition:()=>s}),function(e){e[e.Left=0]="Left",e[e.Center=1]="Center",e[e.Right=2]="Right",e[e.Auto=3]="Auto"}(s||(s={}))},3385:(e,t,i)=>{"use strict";i.d(t,{PaneRendererStepLine:()=>f,StepLineDecoration:()=>s});var s,n,o=i(4652),r=i(86441),a=i(56468),l=i(61993),c=i(37743),h=i(30125),d=i(74010),u=i(52977);!function(e){e[e.None=0]="None",e[e.Diamonds=1]="Diamonds"}(s||(s={})),function(e){e[e.SmallDiamondsSize=8]="SmallDiamondsSize",e[e.SmallDiamondsRadius=2]="SmallDiamondsRadius",e[e.LargeDiamondsSize=21]="LargeDiamondsSize",e[e.LargeDiamondsRadius=5]="LargeDiamondsRadius",e[e.LargeDiamondsAlpha=.15]="LargeDiamondsAlpha",e[e.LeftUnplottableXCoord=-50]="LeftUnplottableXCoord"}(n||(n={}));class _{constructor(e){this._forceExtendFirstBar=!!e}initialize(e,t,i){const{context:s,horizontalPixelRatio:n,verticalPixelRatio:o}=t,r=e.lineStyle;s.lineCap="butt",s.lineJoin="round";const a=Math.max(Math.floor(i.style?.width??e.lineWidth*n));void 0!==r&&(0,c.setLineStyle)(s,r);const l=a%2?.5:0;s.moveTo(Math.round(i.center*n)+l,Math.round(i.y*o)+l),(0,u.applyColor)(t,i.style?.color??e.lineColor,1,1),s.lineWidth=a}startFragment(e,t,i,s){e.beginPath();const n=i.firstItem&&i.extendToBarsEndings?t.center:t.left;e.moveTo(isNaN(n)?-50:n,t.y)}finishFragment(e,t,i){t&&i&&e.lineTo(t.left,i.y),e.stroke()}hitTest(e,t,i,s){if(!(0,d.isValidPoint)(t))return!1;const n=t.style?.width??e.lineWidth,a=(0,l.interactionTolerance)().series+n/2,{left:c,y:h}=t,u=isNaN(c)?-50:c;let _,p;return i&&(0,d.isValidPoint)(i)?(_=i.left,p=i.y):(_=t.right,p=t.y),!(us.x+a&&_>s.x+a)&&((0,o.distanceToSegment)((0,r.point)(u,h),(0,r.point)(_,h),s).distancethis._drawDecorationItem(e,t)))}_drawDecorationItem(e,t){if(null===this._data||0===this._data.items.length)return;const{lineWidth:i,lineColor:s,items:n,visibleItemsRange:o,skipHoles:r,extendToBarsEndings:a}=this._data,{context:l,horizontalPixelRatio:c,verticalPixelRatio:h}=e;let u=Math.max(Math.floor((n[0].style?.width??i)*c)),_=u%2?.5:0;t.initialize(this._data,e,n[0]);const p=o?.startItemIndex??0,m=o?.endItemIndex??n.length;if(m<=p)return;let g,f,y;l.beginPath(),t.applyColor(e,n[p].style?.color??s),t.applyLineWidth(l,u);let v=!1;const S=new d.PaneRendererLineItemsIterator(n,p,m,r);for(;S.next();){const n=S.currentValue();if(!(0,d.isValidPoint)(n)){g=void 0,v=!0;continue}const o=n.style?.color??s,r=n.style?.width??i,p=o!==f,m=r!==y,b={firstItem:S.currentValueIsFirst(),lastItem:S.currentValueIsLast(),extendToBarsEndings:a,valIsNotSameAsPrev:n.valIsNotSameAsPrev},w={y:Math.round(n.y*h)+_,left:Math.round(n.left*c)+_,center:Math.round(n.center*c)+_,right:Math.round(n.right*c)+_};(p||m||v)&&(f&&y&&t.finishFragment(l,w,g),p&&t.applyColor(e,o),m&&(u=Math.max(1,Math.floor(r*c)),_=u%2?.5:0,t.applyLineWidth(l,u)),t.startFragment(l,w,b,g),v=!1,f=o,y=r),t.drawItem(e,w,b,g),g=w}t.finishFragment(l)}}},17330:(e,t,i)=>{"use strict";i.d(t,{TextRenderer:()=>D,calculateLabelPosition:()=>g,fontSize:()=>M,getTextAlignInBox:()=>k,getTextBoundaries:()=>f,lineSpacing:()=>I,needTextExclusionPath:()=>y,wordWrap:()=>b});var s=i(86441),n=i(50151),o=i(34026),r=i(63273),a=i(30699),l=i(56468),c=i(37743),h=i(70262),d=i(37265),u=i(7114),_=i(51056),p=i(29981),m=i(2844);function g(e,t,i,n,o){const r=.5*(t.x+i.x);let a=i.y;return t.y>i.y?(a-=e.height/2+n.y,a=Math.max(e.height/2,a)):(a+=e.height/2+n.y,a=Math.min(o-e.height/2,a)),new s.Point(r,a)}function f(e,t,i){if(e.isOutOfScreen(t,i))return null;const s=e.getPolygonPoints();return 0===s.length?null:s}
function y(e){const t=e.getLinesInfo().lines;if(t.length%2==0)return!1;if(""===t[Math.floor(t.length/2)].text.trim())return!1;return!0}function v(e){const t=[];do{const i=e.match(/\s+/);if(!i||void 0===i.index||-1===i.index){t.push({word:e,spaces:""});break}t.push({word:e.slice(0,i.index),spaces:i[0]}),e=e.slice(i.index+i[0].length)}while(e.length);return t}function S(e,t,i,s){const n=[],o=[];for(let t=0;t(0,u.measureText)(e.slice(0,n+1),t,i).width>s),0,e.length));n.push(e.slice(0,r)),e=e.slice(r)}return n}function b(e,t,i,s=!0,n){n=(0,d.isString)(n)?parseInt(n):n;const o=(e+="").split(/\r\n|\r|\n|$/).map((e=>({text:e,hidden:!1,wrappedLinePart:!1,wrappedLineEnd:!1})));if(!(0,d.isNumber)(n)||!isFinite(n)||n<=0)return o;if((0,u.measureText)("x",t,i).width>n)return o;const r=[];for(let e=0;en){if(""!==h)r.push({text:h,hidden:!1,wrappedLinePart:c,wrappedLineEnd:!1}),h="";else if(1===o.length)r.push({text:o,hidden:!1,wrappedLinePart:c,wrappedLineEnd:!0}),e.word="";else{const s=S(o,t,i,n);for(let e=0;e0,wrappedLinePart:c,wrappedLineEnd:d===l.length-1&&e===p.length-1};i.hidden&&s||r.push(i)}h="",d+=1}""!==h&&r.push({text:h,wrappedLinePart:c,hidden:!1,wrappedLineEnd:!0})}return r}function w(e,t,i){if(0===i)return e.clone();const n=(e.x-t.x)*Math.cos(i)-(e.y-t.y)*Math.sin(i)+t.x,o=(e.x-t.x)*Math.sin(i)+(e.y-t.y)*Math.cos(i)+t.y;return new s.Point(n,o)}function C(e){return void 0!==e.boxPaddingVert?e.boxPaddingVert*L(e):void 0!==e.boxPadding?e.boxPadding*L(e):M(e)/3}function P(e){return void 0!==e.boxPaddingHorz?e.boxPaddingHorz*L(e):void 0!==e.boxPadding?e.boxPadding*L(e):M(e)/3}function T(e){return void 0!==e.boxPaddingLeft?e.boxPaddingLeft*L(e):P(e)}function x(e){return void 0!==e.boxPaddingRight?e.boxPaddingRight*L(e):P(e)}function I(e){let t=e.lineSpacing;return void 0===t&&e.lineHeight&&(t=(e.lineHeight-1)*A(e)),(t??0)*L(e)}function M(e){return Math.ceil(A(e)*L(e))}function A(e){return e.fontsize||e.fontSize||30}function L(e){const t=Math.min(1,Math.max(.2,e.scale||1));if(1===t)return t;const i=A(e);return Math.ceil(t*i)/i}function k(e){const{horzAlign:t,extendLeft:i=!1,extendRight:n=!1,width:o,leftPoint:r,rightPoint:l}=e,c=(r.x<=o||i)&&(l.x>=0||n);let h,d,u=t;switch(u){case a.HorizontalAlign.Left:d=r.y,i?h=c?0:l.x:(h=r.x,u=a.HorizontalAlign.Right);break;case a.HorizontalAlign.Right:d=l.y,n?h=c?o:r.x:(h=l.x,u=a.HorizontalAlign.Left);break;default:h=((i&&c?0:r.x)+(n&&c?o:l.x))/2,d=(r.y+l.y)/2;break}return[(0,
s.point)(h,d),u]}class D{constructor(e,t){this._data=null,this._textWidthCache=new m.TextWidthCache,this._internalData=null,this._boxSize=null,this._box=null,this._polygonPoints=null,this._linesInfo=null,this._fontInfo=null,this._centerTextRotationPoint=null,this._rotationPoint=null,this._hitTest=t||new l.HitTestResult(l.HitTarget.MovePoint,{areaName:l.AreaName.Text}),void 0!==e&&this.setData(e)}setHitTest(e){this._hitTest=e}data(){return this._data}updateData(e){this.setData({...(0,n.ensureNotNull)(this._data),...e})}setData(e){null!==e?((0,n.assert)(!e.decorator||void 0===e.wordWrapWidth,"Decorator is not supported with wordWrapWidth"),void 0===e.text&&(e.text=""),e.horzTextAlign||(e.horzTextAlign=e.horzAlign),!function(e,t){if(null===e||null===t)return null===e==(null===t);if(void 0===e.points!=(void 0===t.points))return!1;if(void 0!==e.points&&void 0!==t.points){if(e.points.length!==t.points.length)return!1;for(let n=0;ne){const i=(0,s.box)(new s.Point(0,0),new s.Point(e,t));return this.getPolygonPoints().every((e=>!(0,o.pointInBox)(e,i)))}return!1}setPoints(e,t){(0,
n.ensureNotNull)(this._data).points=e,this._hitTest=t||new l.HitTestResult(l.HitTarget.MovePoint)}setPoint(e,t,i){const s=(0,n.ensureNotNull)(this._data);this.setData({...s,points:[e],offsetX:t??s.offsetX,offsetY:i??s.offsetY})}point(){return this._data?.points?.[0]??null}fontStyle(e){return null===this._data?"":this._getFontInfo().fontStyle}lineHeight(){return null===this._data?0:M(this._data)}lineSpacing(){return null===this._data?0:I(this._data)}draw(e,t){if(null===this._data||void 0===this._data.points||0===this._data.points.length)return;const{mediaSize:i,horizontalPixelRatio:o,verticalPixelRatio:r}=t;if(this.isOutOfScreen(i.width,i.height))return;const a=this._getInternalData(),l=(0,n.ensureNotNull)(this.rotation()),h=(0,s.point)(l.x*o,l.y*r);e.save(),0!==l.angle&&(e.translate(h.x,h.y),e.rotate(l.angle),e.translate(-h.x,-h.y));const d=this._getFontInfo().fontSize;e.textBaseline=a.textBaseLine,e.textAlign=a.textAlign,e.font=this.fontStyle();const{scaledLeft:p,scaledRight:m,scaledTop:g,scaledBottom:f}=function(e,t){const{horizontalPixelRatio:i,verticalPixelRatio:s}=t,n=Math.round(e.boxLeft*i),o=Math.round(e.boxTop*s);return{scaledLeft:n,scaledRight:n+Math.round(e.boxWidth*i),scaledTop:o,scaledBottom:o+Math.round(e.boxHeight*s)}}(a,t);if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){const t=this._data.borderWidth||Math.max(d/12,1),i=Math.round(t*o),s=i/2;let n=!1;if(this._data.boxShadow){e.save();const{shadowColor:t,shadowBlur:i,shadowOffsetX:s=0,shadowOffsetY:a=0}=this._data.boxShadow;e.shadowColor=t,e.shadowBlur=i*o,e.shadowOffsetX=s*o,e.shadowOffsetY=a*r,n=!0}if(this._data.backgroundRoundRect)this._data.backgroundColor&&((0,c.drawRoundRect)(e,p,g,m-p,f-g,this._data.backgroundRoundRect*o),e.fillStyle=this._data.backgroundColor,e.fill(),n&&(e.restore(),n=!1)),this._data.borderColor&&((0,c.drawRoundRect)(e,p-s,g-s,m-p+i,f-g+i,this._data.backgroundRoundRect*o+i),e.strokeStyle=this._data.borderColor,e.lineWidth=i,e.stroke(),n&&(e.restore(),n=!1));else if(this._data.backgroundColor&&(e.fillStyle=this._data.backgroundColor,e.fillRect(p,g,m-p,f-g),n&&(e.restore(),n=!1)),this._data.borderColor||this._data.highlightBorder){let t;this._data.borderColor?(e.strokeStyle=this._data.borderColor,t=i):(e.strokeStyle=this._data.highlightBorderColor||this._data.color,(0,c.setLineStyle)(e,_.LINESTYLE_DASHED),t=Math.max(1,Math.floor(o))),e.lineWidth=t,e.beginPath(),e.moveTo(p-t/2,g-t/2),e.lineTo(p-t/2,f+t/2),e.lineTo(m+t/2,f+t/2),e.lineTo(m+t/2,g-t/2),e.lineTo(p-t/2,g-t/2),e.stroke(),n&&e.restore()}}this._drawSelectionIfNeeded(e,t),e.fillStyle=this._data.color;const y=(p+Math.round(a.textHorizStart*o))/o,v=.05*d;let S=(g+Math.round((a.textVertStart+v)*r))/r;const b=I(this._data),w=this.getLinesInfo();for(const t of w.lines)(0,u.drawScaled)(e,o,r,(()=>e.fillText(t.text,y,S))),S+=d+b;this._data.decorator?.draw(e,t,this._data,a),e.restore()}getPolygonPoints(){if(null!==this._polygonPoints)return this._polygonPoints;if(null===this._data)return[]
;const e=this._data.angle||0,{boxLeft:t,boxTop:i,boxWidth:n,boxHeight:o}=this._getBox(),r=this._getRotationPoint();return this._polygonPoints=[w(new s.Point(t,i),r,e),w(new s.Point(t+n,i),r,e),w(new s.Point(t+n,i+o),r,e),w(new s.Point(t,i+o),r,e)],this._polygonPoints}centerTextRotation(){if(null===this._centerTextRotationPoint&&null!==this._data){const e=this._data.angle??0,t=this._getRotationPoint(),{textLeft:i,textTop:n,textRight:o,textBottom:r}=this._getInternalData(),a=w(new s.Point((i+o)/2,(n+r)/2),t,e);this._centerTextRotationPoint={x:a.x,y:a.y,angle:e}}return this._centerTextRotationPoint}rotation(){if(null===this._rotationPoint&&null!==this._data){const e=this._data.angle??0,t=this._getRotationPoint();this._rotationPoint={x:t.x,y:t.y,angle:e}}return this._rotationPoint}getLinesInfo(){if(null===this._linesInfo){const e=(0,n.ensureNotNull)(this._data),t=b(e.text,this.fontStyle(),this._textWidthCache,!1,e.wordWrapWidth);let i=t.filter((e=>!e.hidden));if(void 0!==e.maxHeight){const t=function(e){const t=(0,n.ensureDefined)(e.maxHeight),i=M(e),s=I(e);return Math.floor((t+s)/(i+s))}(e);i.length>t&&(i=i.slice(0,t))}this._linesInfo={linesMaxWidth:this._getLinesMaxWidth(i),linesIncludingHidden:t,lines:i}}return this._linesInfo}positionToCoordinate(e){const t=(0,n.ensureNotNull)(this._data),i=this._getInternalData(),s=this.getLinesInfo(),{x:o,y:r,lineNumber:a}=(0,h.getSymbolCoordinatesInfo)({symbolPosition:e,textWidth:i.textRight-i.textLeft,textByLines:s.linesIncludingHidden,lineHeight:M(t),font:this.fontStyle(),textAlign:i.textAlign,lineSpacing:this.lineSpacing()});return{x:o+i.textLeft,y:r+i.textTop,lineNumber:a}}_getInternalData(){if(null!==this._internalData)return this._internalData;const e=(0,n.ensureNotNull)(this._data),{boxLeft:t,boxTop:i,boxWidth:s,boxHeight:o,textBoxWidth:l,textBoxHeight:c}=this._getBox(),h=T(e),d=x(e),u=C(e),_=e.decorator?.geometry(e),p=_?.width??0,m=0===e.text.length?0:_?.decoratorAndTextMargin??0,g=_?.ignoreRtl,f=p+m;let y;const v=i+u+M(e)/2;let S;const b=(0,r.isRtl)(),w=b&&!g,P=w?t+s-d-p:t+h;switch((0,n.ensureDefined)(e.horzTextAlign)){case a.HorizontalAlign.Left:S="start",y=P+f,b&&(e.forceTextAlign?S="left":(y=w?P-m:t+s-d,S="right"));break;case a.HorizontalAlign.Center:S="center";const i=s-h-d-f;y=w?P-m-i/2:P+f+i/2;break;case a.HorizontalAlign.Right:S="end",y=w?P-m:t+s-d,b&&e.forceTextAlign&&(S="right")}return this._internalData={boxLeft:t,boxTop:i,boxWidth:s,boxHeight:o,textBoxWidth:l,textBoxHeight:c,textLeft:t+h+(w?0:f),textRight:t+s-d-(w?f:0),textTop:i+u,textBottom:i+o-u,textHorizStart:y-t,textVertStart:v-i,textAlign:S,textBaseLine:"middle",decoratorLeft:P,decoratorWidth:p},this._internalData}_getFontInfo(){if(null===this._fontInfo){const e=(0,n.ensureNotNull)(this._data),t=M(e),i=`${e.bold?"bold ":""}${e.italic?"italic ":""}${t}px ${e.font}`;this._fontInfo={fontStyle:i,fontSize:t}}return this._fontInfo}_drawSelectionIfNeeded(e,t){const i=(0,n.ensureNotNull)(this._data),s=M((0,n.ensureNotNull)(this._data));if(i.selectionHighlight){
const n=this.positionToCoordinate(i.selectionHighlight.start),o=this.positionToCoordinate(i.selectionHighlight.end),r=this._getInternalData();(0,h.drawSelection)(e,t,{lines:this.getLinesInfo().linesIncludingHidden,selectionStart:n,selectionEnd:o,left:r.textLeft,right:r.textRight,color:i.selectionHighlight.color,font:this.fontStyle(),lineHeight:s,lineSpacing:this.lineSpacing()})}}_getLinesMaxWidth(e){const t=this.fontStyle();if(null!==this._data&&this._data.wordWrapWidth&&!this._data.forceCalculateMaxLineWidth)return this._data.wordWrapWidth*L(this._data);let i=0;for(const s of e)i=Math.max(i,(0,u.measureText)(s.text,t,this._textWidthCache).width);return i}_getBoxSize(){if(null===this._boxSize){const e=this.getLinesInfo(),t=(0,n.ensureNotNull)(this._data),i=function(e,t){const i=e.decorator?.geometry(e),s=Math.round(t+T(e)+x(e)+(i?.width??0)+(0===e.text.length?0:i?.decoratorAndTextMargin??0));return s%2?s+1:s}(t,e.linesMaxWidth),s=function(e,t){return M(e)*t+I(e)*(t-1)+2*C(e)}(t,e.lines.length);this._boxSize={textBoxWidth:i,textBoxHeight:s,boxWidth:t.boxWidth??i,boxHeight:t.boxHeight??s}}return this._boxSize}_getBox(){if(this._box)return this._box;const e=(0,n.ensureNotNull)(this._data),[t]=(0,n.ensureDefined)(e.points),{boxWidth:i,boxHeight:s,textBoxWidth:o,textBoxHeight:r}=this._getBoxSize();let{y:l,x:c}=t;switch(e.vertAlign){case a.VerticalAlign.Bottom:l-=s+e.offsetY;break;case a.VerticalAlign.Middle:l-=s/2;break;case a.VerticalAlign.Top:l+=e.offsetY}switch(e.horzAlign){case a.HorizontalAlign.Left:c+=e.offsetX;break;case a.HorizontalAlign.Center:c-=i/2;break;case a.HorizontalAlign.Right:c-=i+e.offsetX}return this._box={boxLeft:c,boxTop:l,boxWidth:i,boxHeight:s,textBoxWidth:o,textBoxHeight:r}}_getRotationPoint(){const{boxLeft:e,boxTop:t,boxWidth:i,boxHeight:o}=this._getBox(),{horzAlign:r,vertAlign:l}=(0,n.ensureNotNull)(this._data);let c,h;switch(r){case a.HorizontalAlign.Center:c=e+i/2;break;case a.HorizontalAlign.Left:c=e;break;case a.HorizontalAlign.Right:c=e+i}switch(l){case a.VerticalAlign.Middle:h=t+o/2;break;case a.VerticalAlign.Top:h=t;break;case a.VerticalAlign.Bottom:h=t+o}return new s.Point(c,h)}}},91046:(e,t,i)=>{"use strict";i.d(t,{TrendLineRenderer:()=>_,drawArrow:()=>u});var s=i(50151),n=i(4652),o=i(49857),r=i(56468),a=i(37743),l=i(61993),c=i(7114),h=i(51056);function d(e,t,i,s,n){t.save(),t.fillStyle="#000000",t.beginPath(),t.arc(e.x*n,e.y*n,i*n,0,2*Math.PI,!1),t.fill(),s.strokeWidth&&(t.lineWidth=s.strokeWidth,t.stroke()),t.restore()}function u(e,t,i,s,n,o=!1){if(t.subtract(e).length()<1)return;const r=(0,l.getArrowPoints)(e,t,s,o,!0).slice(0,2);let a=null;const{horizontalPixelRatio:c,verticalPixelRatio:h}=n;for(let e=0;e1)&&i.moveTo(t.x*c,t.y*h),i.lineTo(s.x*c,s.y*h),a=s}}class _{constructor(){this._data=null,this._hittest=new r.HitTestResult(r.HitTarget.MovePoint)}setData(e){this._data=e}setHitTest(e){this._hittest=e}draw(e,t){const i=this._data;if(null===i)return;if("points"in i&&i.points.length<2)return
;const{horizontalPixelRatio:s}=t;if(void 0!==i.excludeBoundaries){e.save();for(const s of i.excludeBoundaries)(0,c.addExclusionArea)(e,t,s)}const{linestyle:n,lineCap:o=(n===h.LINESTYLE_SOLID?"round":"butt")}=i;e.lineCap=o,e.lineJoin="round",e.strokeStyle=i.color,e.lineWidth=Math.max(1,Math.floor(i.linewidth*s)),(0,a.setLineStyle)(e,n);const r=i.points[0],l=i.points[1];let d=[];e.beginPath(),i.overlayLineEndings?d=[r.clone(),l.clone()]:this._drawEnds(e,[r,l],i.linewidth,t);const u=this._extendAndClipLineSegment(r,l,t);null!==u&&i.linewidth>0&&(0,a.addPixelPerfectLineToPath)(e,u[0].x,u[0].y,u[1].x,u[1].y,t),i.overlayLineEndings&&this._drawEnds(e,d,i.linewidth,t),e.stroke(),void 0!==i.excludeBoundaries&&e.restore()}hitTest(e,t){const i=this._data;if(null===i)return null;if("points"in i&&i.points.length<2)return null;const s=(i.hitTestTolerance??(0,l.interactionTolerance)().line)+i.linewidth/2,o=i.points[0],r=i.points[1],a=this._extendAndClipLineSegment(o,r,t);if(null!==a){if((0,n.distanceToSegment)(a[0],a[1],e).distance<=s)return this._hittest}return null}_extendAndClipLineSegment(e,t,i){const n=(0,s.ensureNotNull)(this._data);return(0,l.extendAndClipLineSegment)(e,t,i.mediaSize.width,i.mediaSize.height,n.extendleft,n.extendright)}_drawEnds(e,t,i,n){const r=t[0],a=t[1],l=(0,s.ensureNotNull)(this._data);switch(l.leftend){case o.LineEnd.Arrow:u(a,r,e,i,n);break;case o.LineEnd.Circle:d(r,e,i,(0,s.ensureDefined)(l.endstyle),n.horizontalPixelRatio)}switch(l.rightend){case o.LineEnd.Arrow:u(r,a,e,i,n);break;case o.LineEnd.Circle:d(a,e,i,(0,s.ensureDefined)(l.endstyle),n.horizontalPixelRatio)}}}},95173:(e,t,i)=>{"use strict";i.d(t,{VerticalLineRenderer:()=>l});var s=i(56468),n=i(37743),o=i(61993),r=i(7114),a=i(30125);class l extends a.BitmapCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null,this._hitTest=new s.HitTestResult(s.HitTarget.MovePoint)}setData(e){this._data=e}setHitTest(e){this._hitTest=e}hitTest(e){if(null===this._data||null===this._hitTest)return null;const t=(0,o.interactionTolerance)().line,i=Math.abs(e.x-this._data.x)<=t+this._data.linewidth/2,s=void 0===this._data.top||this._data.top-e.y<=t,n=void 0===this._data.bottom||e.y-this._data.bottom<=t;return i&&s&&n?this._hitTest:null}_drawImpl(e){if(null===this._data||this._data.linewidth<=0)return;const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s,mediaSize:o}=e;if(this._data.x<-this._data.linewidth/2||this._data.x>o.width+this._data.linewidth/2)return;t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=Math.max(1,Math.floor(this._data.linewidth*i)),void 0!==this._data.linestyle&&(0,n.setLineStyle)(t,this._data.linestyle);const a=void 0!==this._data.top?Math.max(this._data.top,0):0,l=void 0!==this._data.bottom?Math.min(this._data.bottom,o.height):o.height,c=Math.round(this._data.x*i),h=Math.floor(a*s),d=Math.ceil(l*s),u=this._data.excludeBoundaries;void 0!==u&&(0,r.addExclusionAreaByScope)(e,u),(0,n.drawVerticalLine)(t,c,h,d)}}},2718:(e,t,i)=>{"use strict";i.d(t,{sortSources:()=>n,sortSourcesPreOrdered:()=>s});const s={
KeyFactsToday:10000001,LatestUpdates:10000002,BarMarks:10000003,TimeScaleMarks:10000004,ChartEventsSource:10000005,Dividends:10000006,Splits:10000007,Earnings:10000008,RollDates:10000009,FutureContractExpiration:10000010,LineToolOrder:10000011,LineToolPosition:10000012,LineToolExecution:10000013,AlertLabelInactive:10000014,AlertLabel:10000015};function n(e,t){if(0===e.length)return[];if(!t)return[...e].sort(((e,t)=>e.zorder()-t.zorder()));if(!(t.model().mainPane()===t))return[...e].sort(((e,t)=>e.zorder()-t.zorder()));const i=t.model().panes(),s=i.indexOf(t),n=e=>i.findIndex((t=>t.hasDataSource(e)));return e.map((e=>{const i=!t.hasDataSource(e);return{source:e,isMultipane:i,aboveSeries:e.zorder()>t.model().mainSeries().zorder(),paneIndex:i?n(e):s}})).sort(((e,t)=>e.isMultipane||t.isMultipane?e.isMultipane&&!t.isMultipane?t.aboveSeries?-1:1:!e.isMultipane&&t.isMultipane?e.aboveSeries?1:-1:e.paneIndex-t.paneIndex:e.source.zorder()-t.source.zorder())).map((e=>e.source))}},64755:(e,t,i)=>{"use strict";i.d(t,{PlotList:()=>u,mergeMinMax:()=>_});var s=i(50151),n=i(29981),o=i(50503),r=i(9343),a=i(8025);const l=(0,r.getLogger)("Chart.PlotList"),c=30;function h(e){return e.index}function d(e){return e.value[0]}class u{constructor(e=null,t=null){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCacheByIndex=new Map,this._rowSearchCacheByIndexWithoutEmptyValues=new Map,this._rowSearchCacheByTime=new Map,this._rowSearchCacheByTimeWithoutEmptyValues=new Map,this._plotFunctions=e||new Map,this._emptyValuePredicate=t}clear(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._invalidateSearchCaches()}first(){return this.size()>0?this._items[this._start]:null}last(){return this.size()>0?this._items[this._end-1]:null}firstIndex(){return this.size()>0?this._indexAt(this._start):null}lastIndex(){return this.size()>0?this._indexAt(this._end-1):null}clone(){const e=this.firstIndex(),t=this.lastIndex();return null===e||null===t?new u:this.range(e,t)}size(){return this._end-this._start}isEmpty(){return 0===this.size()}contains(e){return null!==this.search(e,a.PlotRowSearchMode.Exact)}valueAt(e){const t=this.search(e);return null!==t?t.value:null}add(e,t){if(this._shareRead)return l.logDebug("add: readonly collection modification attempt"),!1;const i={index:e,value:t},s=this._nonCachedSearch(e,a.PlotRowSearchMode.Exact,h);return this._invalidateSearchCaches(),null===s?(this._items.splice(this._lowerbound(e,h),0,i),this._start=0,this._end=this._items.length,!0):(this._items[s]=i,!1)}search(e,t=a.PlotRowSearchMode.Exact,i){return this._searchImpl(e,t,this._rowSearchCacheByIndex,this._rowSearchCacheByIndexWithoutEmptyValues,h,i)}searchByTime(e,t=a.PlotRowSearchMode.Exact,i){return this._searchImpl(e,t,this._rowSearchCacheByTime,this._rowSearchCacheByTimeWithoutEmptyValues,d,i)}fold(e,t){let i=t;for(let t=this._start;t=i;--t){const i=this._indexAt(t),s=this._valueAt(t);if(e(i,s))return{index:i,value:s}}return null}each(e){for(let t=this._start;tthis._start&&(t._start-=1),t}rangeCountback(e,t){if(null===this.firstIndex())return new u;const i=new u(this._plotFunctions,this._emptyValuePredicate);return i._items=this._items,i._end=this._upperbound(e),i._start=Math.max(this._start,i._end-t),i._shareRead=!0,i}rangeIterator(e,t){const i=this._lowerbound(e,h),s=this._upperbound(t);return this._rangeIteratorImpl(i,s)}fullRangeIterator(){return this._rangeIteratorImpl(this._start,this._end)}minMaxOnRangeCached(e,t,i){if(this.isEmpty())return null;let s=null;for(const n of i){s=_(s,this._minMaxOnRangeCachedImpl(e-n.offset,t-n.offset,n.name))}return s}minMaxOnRange(e,t,i){if(this.isEmpty())return null;let s=null;for(const n of i){s=_(s,this._minMaxOnRange(e-n.offset,t-n.offset,n.name))}return s}merge(e){return this._shareRead?(l.logDebug("merge: readonly collection modification attempt"),null):0===e.length?null:this.isEmpty()||e[e.length-1].indexthis._items[this._items.length-1].index?this._append(e):1===e.length&&e[0].index===this._items[this._items.length-1].index?(this._updateLast(e[0]),e[0]):this._merge(e)}addTail(e,t=!1){if(0===e.length)return;let i=0;t&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=e[0].value);for(let t=i;tvoid 0!==e)).sort(((e,t)=>e.index-t.index)),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._start=0,this._end=this._items.length}remove(e){
if(this._shareRead)return l.logDebug("remove: readonly collection modification attempt"),null;const t=this._nonCachedSearch(e,a.PlotRowSearchMode.NearestRight,h);if(null===t)return null;const i=this._items.splice(t);return this._end=this._items.length,this._minMaxCache.clear(),this._invalidateSearchCaches(),i.length>0?i[0]:null}state(){const e=this._items.slice(this._start,this._end);return{start:0,end:e.length,data:e}}restoreState(e){e?(this._start=e.start,this._end=e.end,this._shareRead=!1,this._items=e.data,this._minMaxCache.clear(),this._invalidateSearchCaches()):this.clear()}_indexAt(e){return this._items[e].index}_valueAt(e){return this._items[e].value}_length(){return this._items.length}_searchImpl(e,t,i,s,n,o){const r=void 0!==o?i:s,a=void 0!==o?1e4*(t+1)+o:t;let l=r.get(e);if(void 0!==l){const e=l.get(a);if(void 0!==e)return e}const c=this._nonCachedSearch(e,t,n,o);if(null===c)return null;const h={index:this._indexAt(c),value:this._valueAt(c)};return void 0===l&&(l=new Map,r.set(e,l)),l.set(a,h),h}_nonCachedSearch(e,t,i,s){const n=this._lowerbound(e,i),o=n===this._end||e!==i(this._items[n]);if(o&&t!==a.PlotRowSearchMode.Exact)switch(t){case a.PlotRowSearchMode.NearestLeft:return this._searchNearestLeft(n,s);case a.PlotRowSearchMode.NearestRight:return this._searchNearestRight(n,s);default:throw new TypeError("Unknown search mode")}if(void 0===s||o||t===a.PlotRowSearchMode.Exact)return o?null:n;switch(t){case a.PlotRowSearchMode.NearestLeft:return this._nonEmptyNearestLeft(n,s);case a.PlotRowSearchMode.NearestRight:return this._nonEmptyNearestRight(n,s);default:throw new TypeError("Unknown search mode")}}_nonEmptyNearestRight(e,t){const i=(0,s.ensure)(this._emptyValuePredicate),n=(0,s.ensure)(t);for(;e=this._start&&i(this._valueAt(e),n);)e-=1;return et(e)t.index>e),this._start,this._end)}_plotMinMax(e,t,i){let s=null;const n=this._plotFunctions.get(i);if(void 0===n)throw new Error(`Plot "${i}" is not registered`);for(let i=e;is.max&&(s.max=e)))}return s}_invalidateCacheForRow(e){const t=Math.floor(e.index/c);this._minMaxCache.forEach((e=>e.delete(t)))}_prepend(e){return(0,s.assert)(!this._shareRead,"collection should not be readonly"),(0,s.assert)(0!==e.length,"plotRows should not be empty"),
this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=e.concat(this._items),this._start=0,this._end=this._items.length,e[0]}_append(e){return(0,s.assert)(!this._shareRead,"collection should not be readonly"),(0,s.assert)(0!==e.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=this._items.concat(e),this._start=0,this._end=this._items.length,e[0]}_updateLast(e){(0,s.assert)(!this.isEmpty(),"plot list should not be empty");const t=this._items[this._end-1];(0,s.assert)(t.index===e.index,"last row index should match new row index"),this._invalidateCacheForRow(e),this._invalidateSearchCaches(),this._items[this._end-1]=e}_merge(e){return(0,s.assert)(0!==e.length,"plot rows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=function(e,t){const i=function(e,t){const i=e.length,s=t.length;let n=i+s,o=0,r=0;for(;ot[r].index?r++:(o++,r++,n--);return n}(e,t),s=new Array(i);let n=0,o=0;const r=e.length,a=t.length;let l=0;for(;nt[o].index?(s[l]=t[o],o++):(s[l]=t[o],n++,o++),l++;for(;n(i+=1,i>=t?{done:!0,value:void 0}:{done:!1,value:this._items[i]})}}_invalidateSearchCaches(){this._rowSearchCacheByIndex.clear(),this._rowSearchCacheByIndexWithoutEmptyValues.clear(),this._rowSearchCacheByTime.clear(),this._rowSearchCacheByTimeWithoutEmptyValues.clear()}}function _(e,t){if(null===e)return t;if(null===t)return e;return{min:Math.min(e.min,t.min),max:Math.max(e.max,t.max)}}},98558:(e,t,i)=>{"use strict";i.d(t,{PriceAxisView:()=>_});var s,n=i(86441),o=i(34026),r=i(69186),a=i(63273),l=i(7114),c=i(56468),h=i(37743);!function(e){e[e.HitTestTolerance=0]="HitTestTolerance",e[e.HitTestToleranceTouch=10]="HitTestToleranceTouch",e[e.AdditionalVisibilityTolerance=3]="AdditionalVisibilityTolerance",e[e.IconLabelExistingAlertWidth=12]="IconLabelExistingAlertWidth",e[e.IconLabelExistingAlertHeight=10.73]="IconLabelExistingAlertHeight",e[e.IconLabelExistingAlertHorzMargin=11]="IconLabelExistingAlertHorzMargin"}(s||(s={}));new Path2D("");class d{constructor(e,t){this._bodyBox=null,
this.setData(e,t)}setData(e,t){this._data=e,this._commonData=t}lastDrawnBodyBox(){return this._bodyBox}draw(e,t,i,s,o){const r=this._data,{mediaSize:c,bitmapSize:d,horizontalPixelRatio:u,verticalPixelRatio:_}=t;if(!r.visible||this._isOutOfScreen(i,c.height))return;const p=this._commonData,m=void 0!==r.labelIcon,g=i.paddingTop+p.additionalPaddingTop,f=i.paddingBottom+p.additionalPaddingBottom,{paddingOuter:y,paddingInner:v,fontSize:S,borderSize:b}=i,w=r.ignoreAdditionalPaddingInner?0:i.additionalPaddingInner;let C=r.text,P=r.textColor||p.textColor,T=r.secondLine||"",x=p.secondLineTextColor||P,I=r.thirdLine||"";const M=p.thirdLineTextColor||P;0===T.length&&(T=I,x=M,I=""),0===C.length&&(C=T,P=x,T=I,x=M,I=""),e.save(),void 0!==p.globalAlpha&&(e.globalAlpha*=p.globalAlpha),e.font=i.font;const A=s.yMidCorrection(e,C)*_,L=S+g+f,k=(r.labelIconMinWidth??0)*u,D=Boolean(T),E=Boolean(I),B=v+y+w,V=[Math.ceil(s.measureText(e,C)),D?Math.ceil(s.measureText(e,T)):0,E?Math.ceil(s.measureText(e,I)):0],R=Math.max(1,Math.floor(_));let N=Math.round(L*_);N%2!=R%2&&(N+=1);const O=Math.round((S+i.lineSpacing)*_),F=Math.round(2*(S+i.lineSpacing)*_),W=Math.max(1,Math.floor(b*u)),H=r.separatorVisible?W:0,z=r.borderVisible?W:0,U=m?Math.max(N,k):Math.round((Math.max(...V)+B)*u),j=Math.round(w*u),G=d.width,q=Math.ceil(v*u),$=Math.round((p.fixedCoordinate??p.coordinate)*_)-Math.floor(.5*_),K=Math.floor($+R/2-N/2),Y=K+N,Z="right"===o,X=void 0!==r.xCoord?Math.round(r.xCoord*u)+(Z?1:-1)*Math.round(U/2):Z?G-H:H;let J,Q=X;const ee=r.backgroung??p.background;e.fillStyle=ee;const te=2*_;if(e.textAlign=Z?"right":"left",e.textBaseline="middle",Z?(Q=X-U,J=X-j-q+H):(Q=X+U,J=X+j+q-H),this._bodyBox=null,C||m){const t=E?N+F:D?N+O:N,i=p.borderColor??ee,s=void 0!==r.xCoord?te:0;if(((i,o,a)=>{if(Z){(0,h.drawRoundRectWithInnerBorder)(e,Q,K,U,t,i,r.overridenRadius?(0,h.scaleDrawRoundRectRadii)(r.overridenRadius,_):[te,s,s,te],z,o,a);const l=(0,n.point)(Q/u,K/_),c=l.add((0,n.point)(U/u,t/_));this._bodyBox=(0,n.box)(l,c)}else{(0,h.drawRoundRectWithInnerBorder)(e,X,K,U,t,i,r.overridenRadius?(0,h.scaleDrawRoundRectRadii)(r.overridenRadius,_):[s,te,te,s],z,o,a);const l=(0,n.point)(X/u,K/_),c=l.add((0,n.point)(U/u,t/_));this._bodyBox=(0,n.box)(l,c)}})(ee,i,p.borderStyle),m){if(0===r.labelIcon)this._drawPlusIcon(e,X,Q,K,$,Y,R);return void e.restore()}e.save(),e.translate(J,(K+Y)/2+A),(0,l.drawScaled)(e,u,_,(()=>{e.fillStyle=P,e.fillText(C,0,0)})),e.restore()}D&&(e.fillStyle=x,e.save(),e.translate(J,(K+Y)/2+A+O),(0,l.drawScaled)(e,u,_,(()=>{e.fillText((0,a.startWithLTR)(T),0,0)})),e.restore()),E&&(e.fillStyle=M,e.save(),e.translate(J,(K+Y)/2+A+F),(0,l.drawScaled)(e,u,_,(()=>{e.fillText((0,a.startWithLTR)(I),0,0)})),e.restore()),e.restore()}topBottomTotalHeight(e){const t=this._lines();if(!this._data.visible||0===t)return{top:0,bottom:0,total:0};const i=e.fontSize/2+e.paddingTop+this._commonData.additionalPaddingTop,s=(t-.5)*e.fontSize+(t-1)*e.lineSpacing+e.paddingBottom+this._commonData.additionalPaddingBottom;return{top:i,bottom:s,total:i+s}}hitTest(e){return function(e,t){
const i=(0,r.lastMouseOrTouchEventInfo)().isTouch?10:0,s=e.hitTestData;if(void 0===s||!e.visible)return null;const{itemBox:a,clickHandler:l,tooltip:h}=s;if(a){const r=(0,n.box)(new n.Point(a.min.x-i,a.min.y-i),new n.Point(a.max.x+i,a.max.y+i));if((0,o.pointInBox)(t,r))return new c.HitTestResult(e.hitTarget??c.HitTarget.Custom,{clickHandler:l?.bind(null,t),tapHandler:l?.bind(null,t),hoverModelFromAxis:s.hoverModelFromAxis,activeItem:s.activeItem,tooltip:h})}return null}(this._data,e)}_drawPlusIcon(e,t,i,s,n,o,r){e.fillStyle=this._commonData.textColor,e.strokeStyle=this._commonData.textColor,e.lineWidth=r;const a=Math.abs(t-i);let l=Math.round(.35*a);l%2!=r%2&&(l+=1);let c=Math.round(.65*a);c%2!=r%2&&(c+=1);const h=Math.floor((a-l)/2),d=Math.min(t,i),u=d+Math.floor(a/2-r/2);e.fillRect(d+h,n,l,r),e.fillRect(u,s+h,r,l),e.beginPath(),e.arc(u+r/2,n+r/2,c/2,0,2*Math.PI,!1),e.stroke()}_drawClockExistingAlertIcon(e,t,i,s,n,o){}_lines(){const e=this._data;return(e.text?1:0)+(e.secondLine?1:0)+(e.thirdLine?1:0)}_isOutOfScreen(e,t){const i=this._commonData,s=i.fixedCoordinate??i.coordinate,{total:n}=this.topBottomTotalHeight(e),o=n/this._lines();return s-o/2-3>t||s+(n-o/2)+3<0}}var u=i(19063);class _{constructor(e){this._commonRendererData={coordinate:0,textColor:"#FFF",background:"#000",additionalPaddingBottom:0,additionalPaddingTop:0},this._axisRendererData={text:"",visible:!1,separatorVisible:!0,borderVisible:!1,ignoreAdditionalPaddingInner:!1},this._paneRendererData={text:"",visible:!1,separatorVisible:!1,borderVisible:!1,ignoreAdditionalPaddingInner:!0},this._invalidated=!0,this._active=!1,this._axisRenderer=new(e||d)(this._axisRendererData,this._commonRendererData),this._paneRenderer=new(e||d)(this._paneRendererData,this._commonRendererData)}setActive(e){this._active=e}text(){return this._updateRendererDataIfNeeded(),this._axisRendererData.text}secondLineText(){return this._updateRendererDataIfNeeded(),this._axisRendererData.secondLine}thirdLineText(){return this._updateRendererDataIfNeeded(),this._axisRendererData.thirdLine}background(){return this._updateRendererDataIfNeeded(),this._commonRendererData.background}color(){return this._updateRendererDataIfNeeded(),this.generateTextColor(this.background())}generateTextColor(e){return(0,u.colorFromBackground)(e)}coordinate(){return this._updateRendererDataIfNeeded(),this._commonRendererData.coordinate}floatCoordinate(){return this._updateRendererDataIfNeeded(),this._commonRendererData.floatCoordinate??this._commonRendererData.coordinate}update(e){this._invalidated=!0}topBottomTotalHeight(e){this._updateRendererDataIfNeeded();const{top:t,bottom:i,total:s}=this._axisRenderer.topBottomTotalHeight(e),{top:n,bottom:o,total:r}=this._paneRenderer.topBottomTotalHeight(e);return{top:Math.max(t,n),bottom:Math.max(i,o),total:Math.max(s,r)}}getFixedCoordinate(){return this._commonRendererData.fixedCoordinate||0}setFixedCoordinate(e){this._commonRendererData.fixedCoordinate=e}isVisible(){return this._updateRendererDataIfNeeded(),
this._axisRendererData.visible||this._paneRendererData.visible}isAxisLabelVisible(){return this._updateRendererDataIfNeeded(),this._axisRendererData.visible}isPaneLabelVisible(){return this._updateRendererDataIfNeeded(),this._paneRendererData.visible}renderer(){return this._updateRendererDataIfNeeded(),this._axisRenderer}paneRenderer(){return this._updateRendererDataIfNeeded(),this._paneRenderer}setPaneRendererLabelIcon(e){this._paneRendererData.labelIcon=e}setPaneLabelVisible(e){this._paneRendererData.visible=e,this._invalidated=!0}ignoreAlignment(){return!1}_updateRendererDataIfNeeded(){this._invalidated&&(this._commonRendererData.fixedCoordinate=void 0,this._updateRendererData(this._axisRendererData,this._paneRendererData,this._commonRendererData),this._invalidated=!1)}}},45579:(e,t,i)=>{"use strict";i.d(t,{PriceDataSource:()=>a,isPriceDataSource:()=>r});var s=i(29137),n=i(52033),o=i(60074);function r(e){return e instanceof a}class a extends s.DataSource{constructor(e,t){super(t),this._formatterChanged=new n.Delegate,this._priceStepChanged=new n.Delegate,this._currencyChanged=new n.Delegate,this._unitChanged=new n.Delegate,this._priceRangeReadyChanged=new n.Delegate,this._priceStep=null,this._priceRangeReady=!0,this._model=e}base(){return 0}model(){return this._model}currencyChanged(){return this._currencyChanged}isCurrencySource(){return!0}isDisplayedInLegend(){return!0}unitChanged(){return this._unitChanged}isUnitSource(){return!0}priceRange(e,t,i){return null}isDraggable(){return!0}priceLineColor(e){return e}formatterChanged(){return this._formatterChanged}priceStep(e){return this._priceStep}priceStepChanged(){return this._priceStepChanged}isIncludedInAutoScale(){return!0}correctScaleMargins(e){return e}priceRangeReady(){return this._priceRangeReady}priceRangeReadyChanged(){return this._priceRangeReadyChanged}disablePriceRangeReady(){const e=this.priceScale();null===e||e.isAutoScale()||e.mainSource()!==this||(this._priceRangeReady=!1,e.recalculatePriceRangeOnce()),this._priceRangeReadyChanged.fire(!1)}statusView(){return null}legendView(){return null}marketStatusModel(){return null}dataUpdatedModeModel(){return null}dataProblemModel(){return null}canHasAlertOnLineTools(){return!0}_enablePriceRangeReady(){this._priceRangeReady=!0,this._priceRangeReadyChanged.fire(!0)}_onSourceCurrencyChanged(){(0,o.isActingAsSymbolSource)(this)||this._currencyChanged.fire()}_onSourceUnitChanged(){(0,o.isActingAsSymbolSource)(this)||this._unitChanged.fire()}_onSourcePriceRangeReadyChanged(e){(0,o.isActingAsSymbolSource)(this)||e||this.disablePriceRangeReady()}}},37626:(e,t,i)=>{"use strict";i.d(t,{PriceLineAxisView:()=>l,SeriesPriceLineAxisView:()=>c,StudyPriceLineAxisView:()=>h});var s=i(98558),n=i(50151),o=i(51056),r=i(37743);class a{constructor(e,t){this.setData(e,t)}setData(e,t){this._data=e,this._commonData=t}draw(e,t,i,s,a){if(!this._data.visible)return;const{bitmapSize:l,verticalPixelRatio:c}=t,h=this._commonData.fixedCoordinate??this._commonData.coordinate;e.lineWidth=Math.max(1,Math.floor((0,
n.ensureDefined)(this._data.linewidth)*c)),e.lineCap="butt",(0,r.setLineStyle)(e,void 0===this._data.linestyle?o.LINESTYLE_DOTTED:this._data.linestyle),e.strokeStyle=this._commonData.textColor,(0,r.drawHorizontalLine)(e,Math.round(h*c),0,l.width)}topBottomTotalHeight(e){return{top:0,bottom:0,total:0}}}class l extends s.PriceAxisView{constructor(e){super(e||a)}ignoreAlignment(){return!0}_updateRendererData(e,t,i){if(t.visible=!1,e.visible=!1,!this._isVisible())return;const s=this._value();s.noData||(i.background="",i.textColor=this._priceLineColor(s.color),i.coordinate=s.coordinate,i.floatCoordinate=s.floatCoordinate,e.linewidth=this._lineWidth(),e.linestyle=this._lineStyle(),e.backgroundAreaVisible=this._backgroundAreaVisible(),e.backgroundAreaColor=this._backgroundAreaColor(),e.backgroundAreaHeight=this._backgroundAreaHeight(),e.visible=!0)}_lineStyle(){return o.LINESTYLE_DOTTED}_backgroundAreaVisible(){return!1}_backgroundAreaColor(){return""}_backgroundAreaHeight(){return 0}}class c extends l{constructor(e){super(),this._series=e}_value(){return this._series.lastValueData(void 0,!0)}_priceLineColor(e){return this._series.priceLineColor(e)}_lineWidth(){return this._series.properties().childs().priceLineWidth.value()}_isVisible(){const e=this._series.model().properties().childs().scalesProperties.childs().showSeriesLastValue.value();return this._series.properties().childs().showPriceLine.value()&&e}}class h extends l{constructor(e,t){super(),this._study=e,this._plotname=t}update(e){"hover-change"!==e.type&&super.update(e)}_value(){return this._study.lastValueData(this._plotname,!0)}_lineWidth(){return this._study.properties().childs().styles.childs()[this._plotname].childs().linewidth.value()}_lineStyle(){return o.LINESTYLE_DOTTED}_priceLineColor(e){return e}_isVisible(){const e=this._study.model().properties().childs().scalesProperties.childs().showStudyLastValue.value(),t=this._study.isPlotVisibleAt(this._plotname,1);return this._study.properties().childs().styles.childs()[this._plotname].childs().trackPrice.value()&&e&&t}}},94164:(e,t,i)=>{"use strict";var s;i.d(t,{PriceAxisLastValueMode:()=>s}),function(e){e[e.LastPriceAndPercentageValue=0]="LastPriceAndPercentageValue",e[e.LastValueAccordingToScale=1]="LastValueAccordingToScale"}(s||(s={}))},49256:(e,t,i)=>{"use strict";i.d(t,{fromIndexedTo100:()=>h,fromLog:()=>p,fromPercent:()=>a,getCurrentModePriceText:()=>f,getOppositeModePriceText:()=>y,logFormulaForBase:()=>m,logFormulasAreSame:()=>g,toIndexedTo100:()=>d,toIndexedTo100Range:()=>u,toLog:()=>_,toPercent:()=>l,toPercentRange:()=>c});var s=i(93280),n=i(9859);const o={logicalOffset:4,coordOffset:1e-4},r=305;function a(e,t){return t<0&&(e=-e),e/100*t+t}function l(e,t){const i=100*(e-t)/(t||1);return t<0?-i:i}function c(e,t){const i=l(e.minValue(),t),n=l(e.maxValue(),t);return new s.PriceRange(i,n)}function h(e,t){return t<0&&(e=-e),(e-=100)/100*t+t}function d(e,t){const i=100*(e-t)/t+100;return t<0?-i:i}function u(e,t){const i=d(e.minValue(),t),n=d(e.maxValue(),t);return new s.PriceRange(i,n)}function _(e,t){
const i=Math.min(10**r-t.coordOffset,Math.abs(e));if(i<1e-25)return 0;const s=(0,n.log10)(i+t.coordOffset)+t.logicalOffset;return e<0?-s:s}function p(e,t){const i=Math.abs(e);if(i<1e-15)return 0;const s=Math.pow(10,Math.min(i-t.logicalOffset,r))-t.coordOffset;return e<0?-s:s}function m(e){if(null===e)return o;const t=1/e;if(t>=o.coordOffset||t<1e-15)return o;const i=Math.abs(Math.log10(e));return{logicalOffset:i,coordOffset:1/Math.pow(10,i)}}function g(e,t){return e.logicalOffset===t.logicalOffset&&e.coordOffset===t.coordOffset}function f(e,t){return e.isPercentage()?t.formattedPricePercentage:e.isIndexedTo100()?t.formattedPriceIndexedTo100:t.formattedPriceAbsolute}function y(e,t){return e.isPercentage()||e.isIndexedTo100()?t.formattedPriceAbsolute:t.formattedPricePercentage}},93280:(e,t,i)=>{"use strict";i.d(t,{PriceRange:()=>o});var s=i(97085);const n=(0,i(9343).getLogger)("Chart.PriceRange");class o{constructor(e,t){if(null!==e&&"object"==typeof e){const t=e;this._minValue=t.m_minValue,this._maxValue=t.m_maxValue}else{const i=e;this._minValue=i,void 0!==t&&(this._maxValue=t)}}equals(e){return this._minValue===e._minValue&&this._maxValue===e._maxValue}clone(){return new o(this._minValue,this._maxValue)}minValue(){return this._minValue}setMinValue(e){this._minValue=e}maxValue(){return this._maxValue}setMaxValue(e){this._maxValue=e}length(){return this._maxValue-this._minValue}isEmpty(){return this._maxValue===this._minValue||this._maxValue!=this._maxValue||this._minValue!=this._minValue}serialize(){return{m_maxValue:this._maxValue,m_minValue:this._minValue}}state(){return{max:this._maxValue,min:this._minValue}}merge(e){return new o(Math.min(this.minValue(),e.minValue()),Math.max(this.maxValue(),e.maxValue()))}apply(e,t){this._minValue=Math.min(this._minValue,e),this._maxValue=Math.max(this._maxValue,t)}set(e,t){this._minValue=e,this._maxValue=t}scaleAroundCenter(e){if(!(0,s.isNumber)(e))return void n.logDebug("PriceRange.scaleAroundCenter: invalid coeff");if(0===this._maxValue-this._minValue)return;const t=.5*(this._maxValue+this._minValue);let i=this._maxValue-t,o=this._minValue-t;i*=e,o*=e,this._maxValue=t+i,this._minValue=t+o}shift(e){(0,s.isNumber)(e)?(this._maxValue+=e,this._minValue+=e):n.logDebug("PriceRange.shift: invalid coeff")}containsStrictly(e){return e.minValue()>this._minValue&&e.maxValue()=this._minValue&&e<=this._maxValue}intersection(e){return this.containPrice(e.minValue())||this.containPrice(e.maxValue())||e.containPrice(this._minValue)?new o(Math.max(this._minValue,e.minValue()),Math.min(this._maxValue,e.maxValue())):null}static compare(e,t){return null===e||null===t?e===t:e.equals(t)}static mergedWithProgress(e,t,i){const s=e.minValue()+(t.minValue()-e.minValue())*i,n=e.maxValue()+(t.maxValue()-e.maxValue())*i;return new o(s,n)}}},17625:(e,t,i)=>{"use strict";i.d(t,{createPrimitiveProperty:()=>n});var s=i(12988);function n(e){return new s.Property(e)}},7927:(e,t,i)=>{"use strict";i.d(t,{isRootPath:()=>a,propertyByPath:()=>r,propertyPathForSource:()=>n})
;var s=i(50151);function n(e,t="properties"){return`charts.${e.model().id()}.sources.${e.id()}.${t}`}function o(e,t){if(t.length<4)throw new Error("Invalid chart path");const i=function(e,t){return(0,s.ensureDefined)(e.getAll().find((e=>e.hasModel()&&e.model().model().id()===t))).model().model()}(e,t[0]),n=t[1];if("sources"===n){return(0,s.ensureNotNull)(i.dataSourceForId(t[2])).propertyByPath(t.slice(3).join("."))}throw new Error(`Invalid chart path, unknown root: ${n}`)}function r(e,t){const i=t.split(".");if(i.length<1)throw new Error("Invalid path");const s=i[0];if("charts"===s)return o(e,i.slice(1));throw new Error(`Invalid path, unknown root: ${s}`)}function a(e){return e.startsWith("charts.")}},11402:(e,t,i)=>{"use strict";i.d(t,{factoryDefaultsForCurrentTheme:()=>l});var s=i(16738),n=i(90054),o=i(50151),r=i(45345),a=i(24633);function l(e,t){const i=r.watchedTheme.value()??a.StdTheme.Light,l=(0,n.default)(e);return(0,s.default)(l,(0,o.ensureDefined)(t.get(i))),l}},23073:(e,t,i)=>{"use strict";i.d(t,{PropertyBase:()=>o});var s=i(50151),n=i(52033);class o{constructor(){this._listeners=new n.Delegate,this._muteChildChanges=!1,this._owner=null,this._name=""}nameInOwner(){return this._name}setNameInOwner(e){this._name=e}owner(){return this._owner}setOwner(e){this._owner=e}pathToRoot(){const e=this._owner?.pathToRoot();return e?`${e}.${this._name}`:this._name}pathToRootProperty(){if(!this._owner)return"";const e=this._owner.pathToRootProperty?.();return e?`${e}.${this._name}`:this._name}removeProperty(e){(0,s.assert)(!1,`Trying to call "removeProperty" on property ${this.pathToRoot()}`)}addChild(e,t){(0,s.assert)(!1,`Trying to call "addChild" on property ${this.pathToRoot()}`)}hasChild(e){return!1}childCount(){return 0}childNames(){return[]}childs(){(0,s.assert)(!1,`Trying to call "childs" on property ${this.pathToRoot()}`)}state(e,t){return this.value()}merge(e,t){(0,s.assert)(!1,`Trying to call "merge" on property ${this.pathToRoot()}`)}mergeAndFire(e){(0,s.assert)(!1,`Trying to call "mergeAndFire" on property ${this.pathToRoot()}`)}child(e){if(this.hasChild(e))return this.childs()[e]}muteChildChanges(e){this._muteChildChanges=e}fireChanged(){this._listeners.fire(this,this.pathToRootProperty())}listeners(){return this._listeners}subscribe(e,t){this.listeners().subscribe(e,t,!1)}unsubscribe(e,t){this.listeners().unsubscribe(e,t)}unsubscribeAll(e){this.listeners().unsubscribeAll(e)}}},72595:(e,t,i)=>{"use strict";i.d(t,{DataTypes:()=>s,createPropertySchema:()=>d,dataType:()=>l,isArraySchema:()=>h,validateSchema:()=>c});var s,n=i(69708),o=i(83873),r=i(83350),a=i(56052);function l(e){return(0,n.default)(e)?s.NUMBER:(0,o.default)(e)?s.STRING:(0,r.default)(e)?s.BOOLEAN:(0,a.default)(e)?s.ARRAY:null===e?s.UNKNOWN:"object"==typeof e?s.OBJECT:s.UNKNOWN}function c(e,t){const i=l(e);switch(t.type){case s.ARRAY:return i===s.ARRAY&&e.every((e=>c(e,t.subschema)));case s.OBJECT:{if(i!==s.OBJECT)return!1;const n=Object.entries(t.subschema);for(const t of n)if(!c(e[t[0]],t[1]))return!1;return!0}default:
return i===t.type||t.type===s.UNKNOWN}}function h(e){return e.type===s.ARRAY}function d(e,t){let i;const n=l(e);switch(n){case s.NUMBER:case s.STRING:case s.BOOLEAN:i={type:n,saveFlags:t};break;case s.ARRAY:i={type:s.ARRAY,saveFlags:t,subschema:d(e[0],t)};break;case s.OBJECT:{const n={};for(const[i,s]of Object.entries(e))n[i]=d(s,t);i={type:s.OBJECT,saveFlags:t,subschema:n};break}default:i={type:s.UNKNOWN,saveFlags:t}}return i}!function(e){e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.UNKNOWN="unknown"}(s||(s={}))},39158:(e,t,i)=>{"use strict";i.d(t,{combineProperty:()=>n});var s=i(17625);function n(e,...t){const i=()=>e(...t.map((e=>e.value()))),n=(0,s.createPrimitiveProperty)(i()),o=()=>n.setValue(i()),r={};for(const e of t)e.subscribe(r,o);return n.destroy=()=>{t.forEach((e=>e.unsubscribeAll(r))),t.forEach((e=>e.release()))},n}},42752:(e,t,i)=>{"use strict";i.d(t,{convertPropertyToWatchedValue:()=>n});var s=i(64147);function n(e){const t=new s.WatchedValue(e.value());let i=!1;e.subscribe(t,(()=>{i||(i=!0,t.setValue(e.value()),i=!1)}));const n=()=>{i||(i=!0,e.setValue(t.value()),i=!1)};return t.subscribe(n),t.spawn((()=>{e.unsubscribeAll(t),t.unsubscribe(n)}))}},84425:(e,t,i)=>{"use strict";i.d(t,{combineProperty:()=>r.combineProperty,createWVFromGetterAndSubscription:()=>s.createWVFromGetterAndSubscription,createWVFromGetterAndSubscriptions:()=>n.createWVFromGetterAndSubscriptions,createWVFromProperty:()=>o.createWVFromProperty});var s=i(12184),n=i(23869),o=i(43042);i(17625);var r=i(39158)},12184:(e,t,i)=>{"use strict";i.d(t,{createWVFromGetterAndSubscription:()=>n});var s=i(64147);function n(e,t){const i=new s.WatchedValue(e()),n={};t.subscribe(n,(()=>{i.setValue(e())}));return i.readonly().spawn((()=>t.unsubscribeAll(n)))}},23869:(e,t,i)=>{"use strict";i.d(t,{createWVFromGetterAndSubscriptions:()=>n});var s=i(64147);function n(e,t){const i=new s.WatchedValue(e()),n={};t.forEach((t=>t.subscribe(n,(()=>{i.setValue(e())}))));return i.readonly().spawn((()=>t.forEach((e=>e.unsubscribeAll(n)))))}},43042:(e,t,i)=>{"use strict";i.d(t,{createWVFromProperty:()=>n});var s=i(12184);function n(e){return(0,s.createWVFromGetterAndSubscription)((()=>e.value()),e)}},12988:(e,t,i)=>{"use strict";i.d(t,{Property:()=>m,isPrimitiveType:()=>p});var s=i(69708),n=i(83873),o=i(83350),r=i(88987),a=i(56052),l=i(50151),c=i(9343),h=i(34776),d=i(23073),u=i(72595);const _=(0,c.getLogger)("Property");function p(e){return null===e||(0,s.default)(e)&&Number.isFinite(e)||(0,n.default)(e)||(0,o.default)(e)}class m extends d.PropertyBase{constructor(e,t){if(super(),this._childs=[],this._dependents=[],this._schema=t||(0,u.createPropertySchema)(e),void 0!==e)if((0,u.validateSchema)(e,this._schema)||_.logWarn(`The state with a data type: ${(0,u.dataType)(e)} does not match a schema`),p(e))this._value=e;else{let t=Object.entries(e);(0,u.isArraySchema)(this._schema)&&(t=t.filter((([e])=>!Number.isNaN(+e))));for(const[e,i]of t)this.addProperty(e,i)}}destroy(){this.listeners().destroy()
;for(const e of this._childs)this.child(e)?.destroy?.()}merge(e,t){let i=null,s=0;if(t&&(i=[],s=i.length),void 0===e)return i;if(p(e))return this._value!==e&&i?.push(this),this._value=e,i;if((0,a.default)(e)){(0,u.isArraySchema)(this._schema)||_.logWarn("Property is not an array");for(let s=0;s!Number.isNaN(+e))));for(const[e,n]of s){const s=this.childs()[e];if(s){const e=s.merge(n,t);i?.push(...e)}else{const t=this.addProperty(e,n);i?.push(t)}}}return i&&i.length>s&&i.push(this),i}mergeAndFire(e){const t=(0,l.ensureNotNull)(this.merge(e,!0));this._fireMergeAndFireChangedProps(t)}state(e,t){const i=(0,r.default)(this.value)?this.value():void 0;if(void 0!==i)return i;const s=(0,u.isArraySchema)(this._schema)?[]:{};for(const i of this._childs){if(e&&-1!==e.indexOf(i))continue;if((0,u.isArraySchema)(this._schema)&&Number.isNaN(+i))continue;if(void 0!==t&&"subschema"in this._schema){const e=(0,u.isArraySchema)(this._schema)?this._schema.subschema:this._schema.subschema[i];if(void 0!==this._schema.saveFlags&&!e)continue;if(void 0!==e.saveFlags&&!(e.saveFlags&t))continue}const n=this.childs()[i];let o;if(e){const s=[];for(const t of e)t.startsWith(i+".")&&s.push(t.substring(i.length+1));o=n?.state(s,t)}else o=n?.state();(void 0!==o||n?.storeStateIfUndefined())&&((0,a.default)(s)?s[+i]=o:s[i]=o)}return s}clone(){return new m(this.state())}value(){return this._value}childCount(){return this._childs.length}childNames(){return this._childs}childByPath(e){let t=this;for(const i of e.split(".")){if(void 0===t)break;t=t.child(i)}return t}hasChild(e){return this._childs.includes(e)}setValue(e,t){(this._value!==e||t)&&(this._value=e,this.fireChanged())}setValueSilently(e){this._value=e}addProperty(e,t){let i;(0,u.isArraySchema)(this._schema)&&Number.isNaN(+e)&&_.logWarn("Property is an array"),this.removeProperty(e),this._schema.type===u.DataTypes.OBJECT?i=this._schema.subschema[e]:this._schema.type===u.DataTypes.ARRAY&&(i=this._schema.subschema);const s=new m(t,i);return this[e]=s,this._childs.push(e),s.subscribe(this,((e,t)=>{this._childChanged(e,t)})),s.setOwner(this),s.setNameInOwner(e),s}removeProperty(e){const t=this.child(e);t&&(t.setNameInOwner(""),t.setOwner(null),t.unsubscribeAll(this),delete this[e],this._childs=this._childs.filter((t=>t!==e)))}addChild(e,t){if((0,u.isArraySchema)(this._schema)&&Number.isNaN(+e))throw new Error("Property is an array");this[e]&&this.removeProperty(e),this[e]=t,-1===this._childs.indexOf(e)&&this._childs.push(e),t.subscribe(this,((e,t)=>this._childChanged(e,t))),t.setOwner(this),t.setNameInOwner(e)}childs(){return this}storeStateIfUndefined(){return!0}ownership(){return(0,h.ownership)(this)}weakReference(){return(0,h.weakReference)(this)}addDependent(e){this._dependents.push(e)}removeDependent(e){const t=this._dependents.indexOf(e);t>=0&&this._dependents.splice(t,1)}
dependents(){return this._dependents}_childChanged(e,t){this._muteChildChanges||this._listeners.fire(this,t)}_fireMergeAndFireChangedProps(e){this.muteChildChanges(!0);for(const t of e)t.muteChildChanges(!0);for(const t of e)t.muteChildChanges(!1),t.fireChanged();this.muteChildChanges(!1)}}},76742:(e,t,i)=>{"use strict";i.d(t,{QuotesProvider:()=>r});var s=i(42003),n=i(52033),o=i(92184);class r{constructor(e="full",t){this._quotes=null,this._quoteSessionSymbol=null,this._quoteSessionClientId="",this._pausedQuoteSessionSymbol=null,this._quotesUpdate=new n.Delegate,this._quoteSymbolChanged=new n.Delegate,this._multiplexerType=e,this._hibernated=t,this._hibernated?.subscribe((e=>{e?this.pause():this.resume()}))}setQuotesSessionSymbol(e){this._quoteSessionSymbol!==e&&(this._pausedQuoteSessionSymbol=null,this._quoteSessionClientId||(this._quoteSessionClientId="series-"+(0,o.guid)()),this._unsubscribeQuoteSession(),this._quoteSessionSymbol=e,this._quoteSymbolChanged.fire(),e&&this._subscribeQuoteSession(e))}symbol(){return this._quoteSessionSymbol}quotesUpdate(){return this._quotesUpdate}quoteSymbolChanged(){return this._quoteSymbolChanged}quotes(){return this._quotes}async quotesSnapshot(e){return(0,s.getQuoteSessionInstance)("simple").snapshot(e)}isPaused(){return null!==this._pausedQuoteSessionSymbol}pause(){null===this._pausedQuoteSessionSymbol&&(this._pausedQuoteSessionSymbol=this._quoteSessionSymbol,this._unsubscribeQuoteSession())}resume(){null!==this._pausedQuoteSessionSymbol&&(this._subscribeQuoteSession(this._pausedQuoteSessionSymbol),this._pausedQuoteSessionSymbol=null)}destroy(){this._unsubscribeQuoteSession(),this._hibernated?.release()}_onUpdate(e,t){this._quotes=e&&e.values||null,t&&t.values&&this._quotesUpdate.fire(e,t)}_subscribeQuoteSession(e){this._quoteSessionSymbol=e,(0,s.getQuoteSessionInstance)(this._multiplexerType).subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,this._onUpdate.bind(this))}_unsubscribeQuoteSession(){this._quoteSessionSymbol&&((0,s.getQuoteSessionInstance)(this._multiplexerType).unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=null,this._quotes=null)}}},64034:(e,t,i)=>{"use strict";i.d(t,{dpr1PixelRatioInfo:()=>s,equalPixelRatios:()=>n});i(27714);const s={horizontalPixelRatio:1,verticalPixelRatio:1};function n(e,t){return e.horizontalPixelRatio===t.horizontalPixelRatio&&e.verticalPixelRatio===t.verticalPixelRatio}},10074:(e,t,i)=>{"use strict";i.d(t,{compareResolutions:()=>m,convertResolutionsFromSettings:()=>x,getApplicableIntervalForFrequency:()=>g,getCustomResolutions:()=>A,getMaxResolutionValue:()=>T,getResolutionByChartStyle:()=>w,getTranslatedResolution:()=>L,getTranslatedResolutionModel:()=>k,intervalIsSupported:()=>R,isAvailable:()=>S,isIntervalEnabled:()=>V,isResolutionMultiplierValid:()=>C,isSecondsEnabled:()=>E,mergeResolutions:()=>I,normalizeIntervalString:()=>v,setLastUsedResolution:()=>b,sortResolutions:()=>M});var s=i(11542),n=i(85049),o=i(68805),r=i(56840),a=i(82992),l=i(97144),c=i(37265),h=i(56570),d=i(1819)
;const u={[n.ResolutionKind.Ticks]:1,[n.ResolutionKind.Seconds]:60,[n.ResolutionKind.Minutes]:1440,[n.SpecialResolutionKind.Hours]:24,[n.ResolutionKind.Days]:365,[n.ResolutionKind.Weeks]:52,[n.ResolutionKind.Months]:12,[n.ResolutionKind.Range]:1e6,[n.ResolutionKind.Invalid]:NaN},_={[n.ResolutionKind.Ticks]:0,[n.ResolutionKind.Seconds]:1,[n.ResolutionKind.Minutes]:2,[n.SpecialResolutionKind.Hours]:3,[n.ResolutionKind.Days]:4,[n.ResolutionKind.Weeks]:5,[n.ResolutionKind.Months]:6,[n.ResolutionKind.Range]:7,[n.ResolutionKind.Invalid]:8};function p(e){const t=n.Interval.parse(e),i=t.multiplier()||1;return t.isMinuteHours()?[n.SpecialResolutionKind.Hours,i/60]:[t.kind(),i]}function m(e,t){if(e===t)return 0;const[i,s]=p(e),[n,o]=p(t);return i!==n?_[i]-_[n]:s-o}function g(e,t){return m(t,e)>=0?t:e}const f=[1,10,100,1e3];var y;function v(e){return n.Interval.parse(e).value()}function S(e){const t=n.Interval.parse(e);if(!E()&&t.isSeconds())return!1;if(!(0,d.isTicksEnabled)()&&t.isTicks())return!1;const i=t.value(),s=a.linking.dataFrequencyResolution.value();if(void 0!==s&&m(i,s)<0)return!1;const o=a.linking.supportedResolutions.value();return void 0!==o?void 0!==o.find((e=>v(e)===i)):t.isSeconds()?Boolean(a.linking.seconds.value()):t.isTicks()?Boolean(a.linking.ticks.value()):t.isIntraday()?Boolean(a.linking.intraday.value()):t.isDWM()}function b(e){n.Interval.isValid(e)&&(n.Interval.isRange(e)?r.setValue("chart.lastUsedRangeResolution",e):r.setValue("chart.lastUsedTimeBasedResolution",e))}function w(e,t,i){const s=o.isRangeStyle(e),a=n.Interval.isRange(t);return!s&&a?function(e){const t=r.getValue("chart.lastUsedTimeBasedResolution");if(void 0!==t&&n.Interval.isTimeBased(t))return t;let i="1D";for(const t of e){const e=n.Interval.parse(t);if(e.isTimeBased()){const t=e.value();if("1D"===t)return t;i=t}}return i}(i):s&&!a?function(e){const t=r.getValue("chart.lastUsedRangeResolution");if(void 0!==t&&n.Interval.isRange(t))return t;let i="100R";for(const t of e){const e=n.Interval.parse(t);if(e.isRange()){const t=e.value();if("100R"===t)return t;i=t}}return i}(i):t}function C(e){const{interval:t,guiResolutionKind:i}=n.Interval.parseExt(e);if(!t.isValid())return!1;const s=t.multiplier();if((0,d.isTicksEnabled)()&&i===n.ResolutionKind.Ticks)return f.includes(s);return(i===n.SpecialResolutionKind.Hours?s/60:s)<=P(i)}function P(e){const t=u[e];return Number.isNaN(t)?1:t}function T(e){return P(n.Interval.parseExt(e).guiResolutionKind)}function x(e){return Array.isArray(e)?e:Object.keys(e).map(n.Interval.normalize).filter(c.notNull)}function I(...e){let t=[].concat(...e);return t=(0,l.uniq)(t.filter(C).map(v)),M(t)}function M(e){return e.sort(m)}function A(){return[]}function L(e){const{multiplier:t,shortKind:i}=k(e);return`${t}${i}`}function k(e,t){const i=n.Interval.parse(e);let s=i.multiplier(),o=i.kind();if(!i.isValid()){if(t)return null;throw new TypeError(`Can't translate invalid interval: ${e}`)}return i.isMinuteHours()&&(s=Math.floor(s/60),o=n.SpecialResolutionKind.Hours),{multiplier:s.toString(),shortKind:D(o),
hint:`${s} ${D(o,s)}`,mayOmitMultiplier:i.isDWM()&&1===s,mayOmitShortKind:i.isMinutes()&&!i.isMinuteHours()}}function D(e,t){if(!t)return{[n.ResolutionKind.Invalid]:"",[n.ResolutionKind.Ticks]:s.t(null,{context:"interval_short"},i(82901)),[n.ResolutionKind.Seconds]:s.t(null,{context:"interval_short"},i(68823)),[n.ResolutionKind.Minutes]:s.t(null,{context:"interval_short"},i(68430)),[n.SpecialResolutionKind.Hours]:s.t(null,{context:"interval_short"},i(38048)),[n.ResolutionKind.Days]:s.t(null,{context:"interval_short"},i(38691)),[n.ResolutionKind.Weeks]:s.t(null,{context:"interval_short"},i(7408)),[n.ResolutionKind.Months]:s.t(null,{context:"interval_short"},i(77995)),[n.ResolutionKind.Range]:s.t(null,{context:"interval_short"},i(93934))}[e];switch(e){case n.ResolutionKind.Ticks:return s.t(null,{plural:"ticks",count:t},i(11913));case n.ResolutionKind.Days:return s.t(null,{plural:"days",count:t},i(41807));case n.ResolutionKind.Weeks:return s.t(null,{plural:"weeks",count:t},i(48898));case n.ResolutionKind.Months:return s.t(null,{plural:"months",count:t},i(98393));case n.ResolutionKind.Seconds:return s.t(null,{plural:"seconds",count:t},i(33232));case n.ResolutionKind.Minutes:return s.t(null,{plural:"minutes",count:t},i(78318));case n.SpecialResolutionKind.Hours:return s.t(null,{plural:"hours",count:t},i(42328));case n.ResolutionKind.Range:return s.t(null,{plural:"ranges",count:t},i(89937));default:return e}}function E(){return h.enabled("seconds_resolution")}function B(e){return!(!E()&&e.isSeconds())&&!(!(0,d.isTicksEnabled)()&&e.isTicks())}function V(e){return B(n.Interval.parse(e))}function R(e){if(h.enabled("allow_supported_resolutions_set_only")){const t=n.Interval.normalize(e);return null!==t&&S(t)}{const t=n.Interval.parse(e);if(!t.isValid()||!B(t))return!1;if(!h.enabled("custom_resolutions")){const t=n.Interval.normalize(e),i=window.ChartApiInstance.defaultResolutions().filter(V);if(!t||-1===i.indexOf(t))return!1}const i=a.linking.dataFrequencyResolution.value();if(void 0!==i&&g(i,t.value())!==t.value())return!1;if(t.isTicks())return a.linking.ticks.value();if(t.isIntraday())return a.linking.intraday.value();{const e=a.linking.supportedResolutions.value();return!e||e.includes(t.value())}}}!function(e){e.CustomUserResolutionsKey="IntervalWidget.intervals",e.LastUsedRangeResolutionKey="chart.lastUsedRangeResolution",e.LastUsedTimeBasedResolutionKey="chart.lastUsedTimeBasedResolution",e.DefaultRangeResolution="100R",e.DefaultTimeBasedResolution="1D"}(y||(y={}))},59769:(e,t,i)=>{"use strict";i.d(t,{barSpacingByScaleRatio:()=>a,priceRangeByScaleRatio:()=>r,scaleRatio:()=>o});var s=i(93280);const n=1e-10;function o(e,t){if(t.isLog()||e.isEmpty()||t.isEmpty())return null;const i=function(e){if(e.isEmpty())return null;const t=e.priceRange();if(null===t)return null;const i=t.length();return e.internalHeight()/i}(t);if(null===i)return null;return e.getValidBarSpacing()/Math.max(n,i)}function r(e,t,i){if(e.isLog()||null===i||e.isEmpty())return null;const n=e.priceRange();if(null===n||n.isEmpty())return null
;const o=e.internalHeight()/(t/i),r=n.length();if(o===r)return n;const a=(o-r)/2;return new s.PriceRange(n.minValue()-a,n.maxValue()+a)}function a(e,t){if(e.isLog()||null===t||e.isEmpty())return null;const i=e.priceRange();if(null===i)return null;const s=i.length();return e.internalHeight()/s*t}},34391:(e,t,i)=>{"use strict";i.d(t,{allPriceScaleSelectionStrategyInfo:()=>c,createPriceScaleSelectionStrategy:()=>l});var s=i(50151),n=i(11542),o=i(79036);class r{constructor(e){this._priceScalesLimit=8,this._metaInfo=e}metaInfo(){return this._metaInfo}findSuitableScale(e,t,i,s){if(void 0!==s)return this._tryToGetDesiredPriceScale(e,t,s,i);if((0,o.isStudy)(t)){const s=t.metaInfo();if("Volume"===s.shortId&&e.containsMainSeries())return e.createPriceScaleAtPosition("overlay");const n=t.desiredPriceScalePosition();if(null!==n)return this._tryToGetDesiredPriceScale(e,t,n,i);if(void 0!==i&&((0,o.isStudy)(i)||e.isMainPane().value())&&s.is_price_study)return this._getPriceScaleTheSameAsForSource(i,e)}let n=!1;if((0,o.isStudy)(t)){const i=t.metaInfo().groupingKey;if(void 0!==i){const t=e.model().findNonOverlayStudyWithGroupingKey(i,e);if(null!==t)return this._getPriceScaleTheSameAsForSource(t.study,t.pane)}n=Boolean(t.metaInfo().is_price_study)}else t===e.model().mainSeries()&&(n=!0);if(n){const t=this._findFirstScaleForPriceStudy(e);if(null!==t)return t}return this.createNewPriceScaleIfPossible(e)}canCreateNewPriceScale(e){return e.leftPriceScales().length+e.rightPriceScales().lengthi&&this._priceScaleIsPrice(e.rightPriceScales()[i],t))return e.rightPriceScales()[i];if(e.leftPriceScales().length>i&&this._priceScaleIsPrice(e.leftPriceScales()[i],t))return e.leftPriceScales()[i]}return null}_targetPriceScaleIndex(e,t){if(e.mainSource()===t.mainSeries())return 0}_tryToGetDesiredPriceScale(e,t,i,n){switch(i){case"left":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay");case"right":return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay");case"as-series":return void 0!==n?(0,s.ensureNotNull)(n.priceScale()):e.isMainPane().value()?(0,s.ensureNotNull)((0,s.ensureNotNull)(e.mainDataSource()).priceScale()):this.createNewPriceScaleIfPossible(e);case"overlay":return e.createPriceScaleAtPosition("overlay")}}}const a=[{name:"left",title:n.t(null,void 0,i(61507)),ctor:class extends r{constructor(e){super(e)}apply(e){const t=e.model();e.rightPriceScales().slice(0).forEach((i=>e.movePriceScale(i,"left",this._targetPriceScaleIndex(i,t))))}createNewPriceScaleIfPossible(e){
return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("left"):e.createPriceScaleAtPosition("overlay")}}},{name:"right",title:n.t(null,void 0,i(97800)),ctor:class extends r{constructor(e){super(e)}apply(e){const t=e.model();e.leftPriceScales().slice(0).forEach((i=>e.movePriceScale(i,"right",this._targetPriceScaleIndex(i,t))))}createNewPriceScaleIfPossible(e){return this.canCreateNewPriceScale(e)?e.createPriceScaleAtPosition("right"):e.createPriceScaleAtPosition("overlay")}}},{name:"auto",title:n.t(null,void 0,i(21469)),ctor:class extends r{constructor(e){super(e)}apply(e){if(e.containsMainSeries()){const t=(0,s.ensureNotNull)((0,s.ensureNotNull)(e.mainDataSource()).priceScale());e.movePriceScale(t,"right",0)}const t=e.model();for(;e.leftPriceScales().length>e.rightPriceScales().length;){const i=e.leftPriceScales()[e.leftPriceScales().length-1];e.movePriceScale(i,"right",this._targetPriceScaleIndex(i,t))}for(;e.rightPriceScales().length-e.leftPriceScales().length>1;){const i=e.rightPriceScales()[e.rightPriceScales().length-1];e.movePriceScale(i,"left",this._targetPriceScaleIndex(i,t))}}createNewPriceScaleIfPossible(e){if(!this.canCreateNewPriceScale(e))return e.createPriceScaleAtPosition("overlay");const t=e.leftPriceScales().lengtht.name===e)));return new t.ctor(t)}function c(){return a}},66540:(e,t,i)=>{"use strict";i.d(t,{SelectionIndexes:()=>n});var s=i(50151);class n{constructor(e){this._baseIndex=null,this._offsetInBar=null,this._offsetInTime=null,this._barsBetweenPoints=null,this._timescale=e}indexes(){const e=this._timescale.visibleBarsStrictRange();if(null===e)return[];const t=e.firstBar(),i=e.lastBar();if(null===this._offsetInTime||null===this._barsBetweenPoints){const e=this._timescale.barSpacing();this._barsBetweenPoints=Math.floor(120/e),this._offsetInBar=i%this._barsBetweenPoints,this._offsetInTime=this._timescale.indexToTimePoint(this._offsetInBar),this._baseIndex=this._timescale.baseIndex()}const n=this._timescale.baseIndex();this._baseIndex!==n&&(this._baseIndex=n,this._offsetInBar=(0,s.ensureNotNull)(this._timescale.timePointToIndex(this._offsetInTime)));const o=(0,s.ensureNotNull)(this._offsetInBar),r=[];let a=Math.floor((t-o)/this._barsBetweenPoints);const l=Math.floor((i-o)/this._barsBetweenPoints);for(;a<=l;a++)r.push(o+a*this._barsBetweenPoints);return r}clear(){this._offsetInBar=null,this._offsetInTime=null,this._baseIndex=null,this._barsBetweenPoints=null}}},11064:(e,t,i)=>{"use strict";i.d(t,{SelectionRenderer:()=>d});var s=i(86441),n=i(34026),o=i(19625),r=i(56468),a=i(72791),l=i(30125);const c=o.colorsPalette["color-tv-blue-600"];var h;!function(e){e[e.Radius=4]="Radius",e[e.Tolerance=2]="Tolerance"}(h||(h={}));class d extends l.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=e||null}setData(e){this._data=e}hitTest(e){if(!this._data||!this._data.visible)return null;for(let t=0;t(0,n.pointInBox)(t.point,e)))}_drawImpl(e){if(null===this._data||!this._data.visible)return;const{points:t,bgColors:i,vertOffset:n=0}=this._data;for(let r=0;r{"use strict";i.d(t,{SeriesBarColorer:()=>_});var s=i(19625),n=i(50151),o=(i(20596),i(8025)),r=i(96e3);const a=(0,s.getHexColorByName)("color-minty-green-500"),l=(0,s.getHexColorByName)("color-ripe-red-500");function c(e){return{barColor:e.upColor.value(),barBorderColor:e.borderUpColor?e.borderUpColor.value():e.borderColor.value()}}function h(e){return{barColor:e.downColor.value(),barBorderColor:e.borderDownColor?e.borderDownColor.value():e.borderColor.value()}}function d(e,t){return e.borderUpColorProjection&&e.borderUpColor?{barColor:t?e.upColorProjection.value():e.upColor.value(),barBorderColor:t?e.borderUpColorProjection.value():e.borderUpColor.value()}:{barColor:t?e.upColorProjection.value():e.upColor.value()}}function u(e,t){return e.borderDownColorProjection&&e.borderDownColor?{barColor:t?e.downColorProjection.value():e.downColor.value(),barBorderColor:t?e.borderDownColorProjection.value():e.borderDownColor.value()}:{barColor:t?e.downColorProjection.value():e.downColor.value()}}class _ extends r.AbstractBarColorer{constructor(e){super(),this._series=e}applyBarStyle(e,t,i,s){const n=i;n.barColor=void 0,n.barBorderColor=void 0,n.barWickColor=void 0,n.isBarHollow=void 0,n.isBarUp=void 0,n.upColor=void 0,n.downColor=void 0,n.isTwoColorBar=void 0,n.isMergedBar=void 0;const o=this._series.properties();switch(o.childs().style.value()){case 2:case 14:case 15:this._applyLineStyle(e,t,i,s,o);break;case 18:this._applyLineStyle(e,t,i,s,o,!0);break;case 3:this._applyAreaStyle(i,o);break;case 16:this._applyHLCAreaStyle(e,t,i,s,o);break;case 0:this._applyBarStyle(e,i,s,o);break;case 17:case 1:case 19:this._applyCandleStyle(e,i,s,o);break;case 9:this._applyHollowCandleStyle(e,i,s,o);break;case 8:this._applyHAStyle(e,t,i,s,o);break;case 10:this._applyBaseLineStyle(e,t,i,s,o);break;case 12:this._applyHiLoStyle(t,i,o);break;case 13:this._applyColumnStyle(e,i,s,o);break;case 4:this._applyRenkoStyle(e,t,i,s,o);break;case 7:this._applyPBStyle(e,t,i,s,o);break;case 5:this._applyKagiStyle(e,t,i,s,o);break;case 6:
this._applyPnfStyle(e,t,i,s,o);break;case 11:this._applyRangeStyle(e,t,i,s,o)}return i}static upColor(e,t){const i=e.childs(),s=i.style.value();switch(s){case 18:return{barColor:i.tpoStyle.childs().color.value()};case 20:return{barColor:i.svpStyle.childs().volumeProfile.childs().volumeColorUp.value()};case 2:return{barColor:i.lineStyle.childs().color.value()};case 14:return{barColor:i.lineWithMarkersStyle.childs().color.value()};case 15:return{barColor:i.steplineStyle.childs().color.value()};case 3:return{barColor:i.areaStyle.childs().linecolor.value()};case 16:return{barColor:i.hlcAreaStyle.childs().closeLineColor.value(),barBorderColor:a};case 0:return{barColor:i.barStyle.childs().upColor.value()};case 17:return c(i.volFootprintStyle.childs());case 19:return c(i.volCandlesStyle.childs());case 1:return c(i.candleStyle.childs());case 9:return c(i.hollowCandleStyle.childs());case 8:return c(i.haStyle.childs());case 10:return{barColor:i.baselineStyle.childs().topLineColor.value()};case 12:return{barColor:i.hiloStyle.childs().color.value(),barBorderColor:e.childs().hiloStyle.childs().borderColor.value()};case 13:return{barColor:i.columnStyle.childs().upColor.value()};case 4:return d(i.renkoStyle.childs(),t);case 7:return d(i.pbStyle.childs(),t);case 5:return d(i.kagiStyle.childs(),t);case 6:return d(i.pnfStyle.childs(),t);case 11:return{barColor:""}}(0,n.ensureNever)(s)}static downColor(e,t){const i=e.childs(),s=i.style.value();switch(s){case 2:return{barColor:i.lineStyle.childs().color.value()};case 18:return{barColor:i.tpoStyle.childs().color.value()};case 20:return{barColor:i.svpStyle.childs().volumeProfile.childs().volumeColorUp.value()};case 14:return{barColor:i.lineWithMarkersStyle.childs().color.value()};case 15:return{barColor:i.steplineStyle.childs().color.value()};case 3:return{barColor:i.areaStyle.childs().linecolor.value()};case 16:return{barColor:i.hlcAreaStyle.childs().closeLineColor.value(),barBorderColor:l};case 0:return{barColor:i.barStyle.childs().downColor.value()};case 17:return h(i.volFootprintStyle.childs());case 1:return h(i.candleStyle.childs());case 19:return h(i.volCandlesStyle.childs());case 9:return h(i.hollowCandleStyle.childs());case 8:return h(i.haStyle.childs());case 10:return{barColor:i.baselineStyle.childs().bottomLineColor.value()};case 12:return{barColor:i.hiloStyle.childs().color.value(),barBorderColor:e.childs().hiloStyle.childs().borderColor.value()};case 13:return{barColor:i.columnStyle.childs().downColor.value()};case 4:return u(i.renkoStyle.childs(),t);case 7:return u(i.pbStyle.childs(),t);case 5:return u(i.kagiStyle.childs(),t);case 6:return u(i.pnfStyle.childs(),t);case 11:return{barColor:""}}(0,n.ensureNever)(s)}_applyLineStyle(e,t,i,s,o,r){if(i.barColor=_.upColor(o).barColor,r)return;const a=this._findBar(e,t,s),l=this._series.barFunction()(a),c=this._series.priceScale(),h=this._series.firstValue();if(null==l||c.isEmpty()||null==h)return;const d=c.priceToCoordinate(l,h);i.barColor=(0,n.ensureNotNull)(this._series.lineColorAtYPercentFromTop(d/c.height()))}
_applyAreaStyle(e,t){e.barColor=_.upColor(t).barColor}_applyHLCAreaStyle(e,t,i,s,n){const o=this._isUp(e,!1,s,this._series.data().first()?.index!==e)?_.upColor(n,t):_.downColor(n,t);i.barColor=o.barColor,i.barBorderColor=o.barBorderColor}_applyBarStyle(e,t,i,s){const n=this._isUp(e,!1,i,s.childs().barStyle.childs().barColorsOnPrevClose.value())?_.upColor(s):_.downColor(s);t.barColor=n.barColor,t.barBorderColor=n.barBorderColor}_applyCandleStyle(e,t,i,s){const n=s.childs(),o=1===n.style.value()?n.candleStyle.childs():19===n.style.value()?n.volCandlesStyle.childs():n.volFootprintStyle.childs(),r=this._isUp(e,!1,i,o.barColorsOnPrevClose.value()&&this._series.data().first()?.index!==e),a=r?_.upColor(s):_.downColor(s);t.barColor=a.barColor,t.barBorderColor=a.barBorderColor,t.barWickColor=r?o.wickUpColor?o.wickUpColor.value():o.wickColor.value():o.wickDownColor?o.wickDownColor.value():o.wickColor.value()}_applyHollowCandleStyle(e,t,i,s){const n=s.childs().hollowCandleStyle.childs(),o=this._isUp(e,!1,i,this._series.data().first()?.index!==e),r=o?_.upColor(s):_.downColor(s);t.barColor=r.barColor,t.barBorderColor=r.barBorderColor,t.barWickColor=o?n.wickUpColor?n.wickUpColor.value():n.wickColor.value():n.wickDownColor?n.wickDownColor.value():n.wickColor.value();const a=this._findBar(e,!1,i);t.isBarHollow=a[1]<=a[4]}_applyHAStyle(e,t,i,s,n){const o=n.childs().haStyle.childs(),r=this._isUp(e,t,s,o.barColorsOnPrevClose.value()),a=r?_.upColor(n):_.downColor(n);i.barColor=a.barColor,i.barBorderColor=a.barBorderColor,i.barWickColor=r?o.wickUpColor.value():o.wickDownColor.value()}_applyBaseLineStyle(e,t,i,s,o){const r=this._findBar(e,t,s),a=o.childs().baselineStyle.childs(),l=this._series.priceScale(),c=Math.round(l.height()*(Math.abs(100-a.baseLevelPercentage.value())/100)),h=(0,n.ensureNotNull)(this._series.firstValue()),d=l.coordinateToPrice(c,h);r[4]>d?i.barColor=_.upColor(o,t).barColor:i.barColor=_.downColor(o,t).barColor}_applyHiLoStyle(e,t,i){const s=_.upColor(i,e);t.barColor=s.barColor,t.barBorderColor=s.barBorderColor}_applyColumnStyle(e,t,i,s){const n=s.childs().columnStyle.childs(),o=this._isUp(e,!1,i,n.barColorsOnPrevClose.value())?_.upColor(s):_.downColor(s);t.color=o.barColor,t.barColor=t.color}_applyRenkoStyle(e,t,i,s,n){}_applyPBStyle(e,t,i,s,n){}_applyKagiStyle(e,t,i,s,n){}_applyPnfStyle(e,t,i,s,n){}_applyRangeStyle(e,t,i,s,n){}_applySVPStyle(e,t,i,s){}_findBar(e,t,i){return i?i.value:this._getSeriesBars(t).valueAt(e)||[]}_findPrevBar(e,t,i){if(i&&i.previousValue)return i.previousValue;const s=this._series.bars().search(e-1,o.PlotRowSearchMode.NearestLeft,4);return null!==s?s.value:[]}_getSeriesBars(e){return e?this._series.nsBars():this._series.bars()}_isUp(e,t,i,s){const n=this._findBar(e,t,i);if(s){return this._findPrevBar(e,t,i)[4]<=n[4]}return n[1]<=n[4]}}},5171:(e,t,i)=>{"use strict";var s;i.r(t),i.d(t,{ChartStyle:()=>W,OldLineStyleTypes:()=>w,SERIES_STATUS_TEXT:()=>b,STATUS_CALCULATION_ERROR:()=>f,STATUS_DELAYED:()=>u,STATUS_DELAYED_STREAMING:()=>_,STATUS_EOD:()=>h,STATUS_ERROR:()=>g,
STATUS_INVALID_SYMBOL:()=>l,STATUS_LOADING:()=>r,STATUS_NO_BARS:()=>p,STATUS_OFFLINE:()=>n,STATUS_PULSE:()=>d,STATUS_READY:()=>a,STATUS_REPLAY:()=>m,STATUS_RESOLVING:()=>o,STATUS_SNAPSHOT:()=>c,STATUS_UNSUPPORTED_RESOLUTION:()=>y,STYLE_AREA:()=>x,STYLE_BARS:()=>C,STYLE_BASELINE:()=>E,STYLE_CANDLES:()=>P,STYLE_COLUMNS:()=>R,STYLE_HEIKEN_ASHI:()=>k,STYLE_HILO:()=>V,STYLE_HLC_AREA:()=>F,STYLE_HOLLOW_CANDLES:()=>D,STYLE_KAGI:()=>M,STYLE_LINE:()=>T,STYLE_LINE_WITH_MARKERS:()=>N,STYLE_PB:()=>L,STYLE_PNF:()=>A,STYLE_RANGE:()=>B,STYLE_RENKO:()=>I,STYLE_SHORT_NAMES:()=>H,STYLE_STEPLINE:()=>O,SYMBOL_STRING_DATA:()=>z,Status:()=>s,chartStylesWithAttachedStudies:()=>U,seriesLoadingStatuses:()=>S,seriesReadyStatuses:()=>v}),function(e){e[e.Offline=0]="Offline",e[e.Resolving=1]="Resolving",e[e.Loading=2]="Loading",e[e.Ready=3]="Ready",e[e.InvalidSymbol=4]="InvalidSymbol",e[e.Snapshot=5]="Snapshot",e[e.EOD=6]="EOD",e[e.Pulse=7]="Pulse",e[e.Delayed=8]="Delayed",e[e.DelayedSteaming=9]="DelayedSteaming",e[e.NoBars=10]="NoBars",e[e.Replay=11]="Replay",e[e.Error=12]="Error",e[e.CalculationError=13]="CalculationError",e[e.UnsupportedResolution=14]="UnsupportedResolution"}(s||(s={}));const n=0,o=1,r=2,a=3,l=4,c=5,h=6,d=7,u=8,_=9,p=10,m=11,g=12,f=13,y=14,v=new Set([3,6,7,8,9,11]),S=new Set([1,2]),b={[n]:"connecting",[o]:"loading",[r]:"loading",[a]:"realtime",[l]:"invalid",[c]:"snapshot",[h]:"endofday",[d]:"endofday",[u]:"delayed",[_]:"delayed_streaming",[p]:"forbidden",[m]:"replay",[g]:"error",[f]:"calculation_error",[y]:"unsupported_resolution"};var w;!function(e){e[e.Markers=0]="Markers",e[e.Stepline=1]="Stepline",e[e.Simple=2]="Simple"}(w||(w={}));const C=0,P=1,T=2,x=3,I=4,M=5,A=6,L=7,k=8,D=9,E=10,B=11,V=12,R=13,N=14,O=15,F=16;var W;!function(e){e[e.Bar=0]="Bar",e[e.Candle=1]="Candle",e[e.Line=2]="Line",e[e.Area=3]="Area",e[e.Renko=4]="Renko",e[e.Kagi=5]="Kagi",e[e.PnF=6]="PnF",e[e.LineBreak=7]="LineBreak",e[e.HeikinAshi=8]="HeikinAshi",e[e.HollowCandle=9]="HollowCandle",e[e.Baseline=10]="Baseline",e[e.Range=11]="Range",e[e.HiLo=12]="HiLo",e[e.Column=13]="Column",e[e.LineWithMarkers=14]="LineWithMarkers",e[e.Stepline=15]="Stepline",e[e.HLCArea=16]="HLCArea",e[e.VolFootprint=17]="VolFootprint",e[e.TPO=18]="TPO",e[e.VolCandle=19]="VolCandle",e[e.SVP=20]="SVP"}(W||(W={}));const H={0:"bar",1:"candle",9:"hollowCandle",2:"line",14:"lineWithMarkers",15:"stepline",3:"area",16:"hlcArea",4:"renko",7:"pb",5:"kagi",6:"pnf",8:"ha",10:"baseline",11:"range",12:"hilo",13:"column",17:"volFootprint",18:"tpo",19:"volCandles",20:"svp"},z={4:{type:"BarSetRenko@tv-prostudies",basicStudyVersion:73},7:{type:"BarSetPriceBreak@tv-prostudies",basicStudyVersion:34},5:{type:"BarSetKagi@tv-prostudies",basicStudyVersion:73},6:{type:"BarSetPnF@tv-prostudies",basicStudyVersion:73},8:{type:"BarSetHeikenAshi@tv-basicstudies",basicStudyVersion:60},11:{type:"BarSetRange@tv-basicstudies",basicStudyVersion:72},17:{type:"Footprint@tv-volumebyprice",basicStudyVersion:104},18:{type:"TPOPeriodic@tv-volumebyprice",basicStudyVersion:104},20:{type:"VbPSessions@tv-volumebyprice",
basicStudyVersion:126}},U=[17,18,20]},3070:(e,t,i)=>{"use strict";i.d(t,{SeriesData:()=>m,barFunction:()=>u,seriesPlotFunctionMap:()=>h});var s,n,o=i(50151),r=i(64755),a=i(29981);!function(e){e[e.FromLeft=-1]="FromLeft",e[e.FromRight=1]="FromRight"}(s||(s={})),function(e){e[e.Time=0]="Time",e[e.Open=1]="Open",e[e.High=2]="High",e[e.Low=3]="Low",e[e.Close=4]="Close",e[e.Volume=5]="Volume",e[e.Adt=6]="Adt"}(n||(n={}));const l={open:e=>e[1],high:e=>e[2],low:e=>e[3],close:e=>e[4],hl2:e=>(e[2]+e[3])/2,hlc3:e=>(e[2]+e[3]+e[4])/3,ohlc4:e=>(e[1]+e[2]+e[3]+e[4])/4},c=["open","high","low","close","hl2","hlc3","ohlc4"];function h(){const e=new Map;return c.forEach(((t,i)=>{e.set(t,u(t))})),e}var d;function u(e,t,i){const s=l[t??e],n=l[e],o=l[i??e];return(e,t)=>{switch(t){case 0:return s(e);case 2:return o(e);default:return n(e)}}}function _(e,t){return null==e[t]}!function(e){e[e.FirstPrice=0]="FirstPrice",e[e.LastPrice=1]="LastPrice",e[e.LastValuePrice=2]="LastValuePrice"}(d||(d={}));const p=[{barsToMerge:10,forBarspacingLargerThen:.03},{barsToMerge:30,forBarspacingLargerThen:.01},{barsToMerge:100,forBarspacingLargerThen:.003},{barsToMerge:500,forBarspacingLargerThen:0}];class m{constructor(){this._pressedChunks={chunks:new Map,priceSource:"uninitialized"},this.m_bars=new r.PlotList(h(),_),this.m_nsBars=new r.PlotList(h(),_),this._clearPressedChunks()}bars(){return this.m_bars}nsBars(){return this.m_nsBars}pressedChunks(e,t){if(t!==this._pressedChunks.priceSource){this._pressedChunks.priceSource=t;const e=this.m_bars.first();e&&(this._clearPressedChunks(),this._rebuildPressedChunks(e))}const i=(0,o.ensureDefined)(p.find((t=>t.forBarspacingLargerThen<=e)));return(0,o.ensureDefined)(this._pressedChunks.chunks.get(i.barsToMerge))}mergeRegularBars(e){const t=this.m_bars.size(),i=this.m_bars.merge(e);return i&&"uninitialized"!==this._pressedChunks.priceSource&&(t===this.m_bars.size()&&i.index===this.m_bars.lastIndex()?this._updateLatestChunks():this._rebuildPressedChunks(i)),i}size(){return this.m_bars.size()+this.m_nsBars.size()}each(e){this.m_bars.each(e),this.m_nsBars.each(e)}clear(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0,this._clearPressedChunks()}clone(){const e=new m;return e.lastProjectionPrice=this.lastProjectionPrice,e.boxSize=this.boxSize,e.reversalAmount=this.reversalAmount,e.m_bars=this.m_bars.clone(),e.m_nsBars=this.m_bars.clone(),e}isEmpty(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()}first(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()}last(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()}search(e,t,i){return this.nsBars().isEmpty()?this.bars().search(e,t,i):this.bars().isEmpty()||(0,o.ensureNotNull)(this.nsBars().firstIndex())<=e?this.nsBars().search(e,t,i):this.bars().search(e,t,i)}valueAt(e){const t=this.search(e);return null!==t?t.value:null}plotValueToTimePointIndex(e,t,i){if(i===s.FromRight){const i=(i,s)=>{const n=s[t];return null!=n&&e>=n},s=this.m_bars.findLast(i);if(null!==s)return s.index
;const n=this.m_nsBars.findLast(i);return null!==n?n.index:this.m_bars.firstIndex()}if(i===s.FromLeft){const i=(i,s)=>{const n=s[t];return null!=n&&e<=n},s=this.m_bars.findFirst(i);if(null!==s)return s.index;const n=this.m_nsBars.findFirst(i);return null!==n?n.index:this.m_bars.lastIndex()}throw new Error("plotValueToTimePointIndex: unsupported search mode")}moveData(e){this.m_bars.move(e),this.m_nsBars.move(e),this.m_bars.size()>0&&this._rebuildPressedChunks((0,o.ensureNotNull)(this.m_bars.first()))}_rebuildPressedChunks(e){const t=this._pressedChunks.priceSource;if("uninitialized"===t)return;const i=e.index,s=l[t],n=(e,t,i)=>{let n=null;for(const o of e){const e=s(o.value);n&&o.index-n.startTime>=i.barsToMerge&&(t.push(n),n=null),n?(n.endTime=o.index,n.high=Math.max(n.high,e),n.low=Math.min(n.low,e),n.close=e):n={startTime:o.index,endTime:o.index,open:e,high:e,low:e,close:e}}n&&t.push(n)};p.forEach((e=>{const t=(0,o.ensureDefined)(this._pressedChunks.chunks.get(e.barsToMerge)),s=(0,a.lowerbound)(t,i,((e,t)=>e.endTime0){const i=t[0].startTime-1,s=(0,o.ensureNotNull)(this.m_bars.firstIndex()),r=this.m_bars.rangeIterator(s,i),a=[];n(r,a,e);const l=a.concat(t);this._pressedChunks.chunks.set(e.barsToMerge,l)}else{const i=(0,o.ensureNotNull)(this.m_bars.lastIndex());t.splice(s);let r=(0,o.ensureNotNull)(this.m_bars.firstIndex());t.length&&(r=t[t.length-1].endTime+1);const a=this.m_bars.rangeIterator(r,i);n(a,t,e)}}))}_updateLatestChunks(){const e=(0,o.ensureNotNull)(this.m_bars.last());p.forEach((t=>{const i=(0,o.ensureDefined)(this._pressedChunks.chunks.get(t.barsToMerge)),s=e.value[4],n=i[i.length-1];n.high=Math.max(n.high,s),n.low=Math.min(n.low,s),n.close=s,n.endTime=e.index}))}_clearPressedChunks(){p.forEach((e=>this._pressedChunks.chunks.set(e.barsToMerge,[])))}}},61105:(e,t,i)=>{"use strict";i.d(t,{SeriesTimeRangeVolumeCalculator:()=>s});class s{constructor(e){this._value=null,this._series=e,this._series.dataEvents().dataUpdated().subscribe(this,this._onSeriesUpdated)}destroy(){this._series.dataEvents().dataUpdated().unsubscribeAll(this)}volume(e,t){if(null!==this._value&&this._value.from===e&&this._value.to===t)return this._value.value;let i=0;const s=this._series.data().bars(),n=s.firstIndex(),o=s.lastIndex();if(null!==n&&eo&&t>o)i=NaN;else{const s=this._series.data().bars().rangeIterator(Math.min(e,t),Math.max(e,t));for(const e of s){const t=e.value[5];if(void 0===t){i=NaN;break}i+=t}}return this._value={from:e,to:t,value:i},i}_onSeriesUpdated(e,t){if(null===this._value)return;if(t)return void(this._value=null);const i=this._series.data().bars().lastIndex();(null===i||i<=this._value.to)&&(this._value=null)}}},68805:(e,t,i)=>{"use strict";i.d(t,{actualSymbol:()=>le,chartStyleStudyId:()=>R,createSeriesFormatter:()=>W,displayedSymbolExchange:()=>ae,displayedSymbolName:()=>re,extractLineToolSymbolFromSymbolInfo:()=>te,extractSymbolNameFromSymbolInfo:()=>ee,getChartStyleByResolution:()=>V,getDefaultStyle:()=>B,getLastUsedSingleValueBasedStyle:()=>E,getLastUsedStyle:()=>D,
getSeriesDisplayErrorWV:()=>fe,getSeriesPriceFormattingState:()=>F,getSourceForEconomySymbol:()=>ne,getSymbolDelaySeconds:()=>ye,getSymbolExchange:()=>ge,getTranslatedChartStyleName:()=>C,hasVolume:()=>pe,isCloseBasedSymbol:()=>de,isConvertedToOtherCurrency:()=>G,isConvertedToOtherUnit:()=>Y,isEconomicSymbol:()=>me,isMeasureUnitSymbol:()=>ue,isPriceSourceStyle:()=>O,isRangeBasedStyle:()=>T,isRangeStyle:()=>I,isRegularSessionId:()=>he,isSingleValueBasedStyle:()=>L,isTimeBasedStyle:()=>M,isValidStyle:()=>A,measureUnitId:()=>_e,preparePriceAxisProperties:()=>N,proSymbol:()=>ce,setLastUsedStyle:()=>k,styleChangeRequiresRestart:()=>x,symbolBaseCurrency:()=>j,symbolCurrency:()=>z,symbolCurrencyConvertible:()=>H,symbolHasElectronicSession:()=>J,symbolHasPreOrPostMarket:()=>X,symbolHasSeveralSessions:()=>Q,symbolOriginalCurrency:()=>U,symbolOriginalUnit:()=>K,symbolTitle:()=>oe,symbolTitleSeparator:()=>se,symbolToSaveInState:()=>ie,symbolUnit:()=>$,symbolUnitConvertibleGroupsIfExist:()=>Z});var s=i(11542),n=i(56840),o=(i(49483),i(5171)),r=i(85049),a=i(725),l=i(56570),c=i(46084),h=i(719),d=i(88960),u=i(84425);const _=l.enabled("pay_attention_to_ticker_not_symbol"),p=l.enabled("uppercase_instrument_names"),m=l.enabled("charting_library_single_symbol_request"),g=l.enabled("use_ticker_on_symbol_info_update"),f=l.enabled("hide_object_tree_and_price_scale_exchange_label");var y;!function(e){e.LastUsedStyleKey="chart.lastUsedStyle",e.LastUsedSingleValueBasedStyle="chart.lastUsedSingleValueBasedStyle",e.LastUsedRawDataStyle="chart.rawDataStyle"}(y||(y={}));const v=[4,5,6,7,8],S=[4,5,6,7,11],b=[0,1,9,19,2,14,15,3,16,10,8,12,13,18,17,20],w=[2,14,15,10,3,13,18];function C(e){return{0:s.t(null,void 0,i(27377)),1:s.t(null,void 0,i(45054)),2:s.t(null,void 0,i(3554)),14:s.t(null,void 0,i(9394)),15:s.t(null,void 0,i(69217)),3:s.t(null,void 0,i(34456)),16:s.t(null,void 0,i(99906)),9:s.t(null,void 0,i(13459)),10:s.t(null,void 0,i(59213)),12:s.t(null,void 0,i(98236)),13:s.t(null,void 0,i(55761)),4:s.t(null,void 0,i(88130)),7:s.t(null,void 0,i(43588)),5:s.t(null,void 0,i(83490)),6:s.t(null,void 0,i(76519)),11:s.t(null,void 0,i(55169)),8:s.t(null,void 0,i(63876)),17:s.t(null,void 0,i(92763)),18:s.t(null,void 0,i(17809)),19:s.t(null,void 0,i(93722)),20:s.t(null,void 0,i(83298))}[e]}function P(e){return-1!==v.indexOf(e)}function T(e){return-1!==S.indexOf(e)}function x(e,t){return!I(e)&&!I(t)&&!(e===t||!P(e)&&!P(t))}function I(e){return 11===e}function M(e){return-1!==b.indexOf(e)}function A(e){return T(e)||M(e)}function L(e){switch(e){case 3:case 10:case 2:case 14:case 15:case 13:return!0;default:return!1}}function k(e,t){var i;A(e)&&(11!==e&&n.setValue("chart.lastUsedStyle",e),i=e,o.SYMBOL_STRING_DATA[i]||function(e){n.setValue("chart.rawDataStyle",e)}(e),de(t)&&L(e)&&n.setValue("chart.lastUsedSingleValueBasedStyle",e))}function D(){const e=n.getInt("chart.lastUsedStyle");return void 0===e?1:e}function E(){const e=n.getInt("chart.lastUsedSingleValueBasedStyle");return void 0===e?14:e}function B(e){return e?11:1}function V(e,t){
const i=I(t),s=r.Interval.isRange(e);return!i&&s?B(!0):i&&!s?B(!1):t}function R(e,t){const i=o.SYMBOL_STRING_DATA[e];return void 0===i?null:t?`${i.type}-${i.basicStudyVersion}`:i.type}function N(e){const t=e.priceAxisProperties,i=t.lockScale.value(),s=6===e.style.value();(s||i)&&(t.log.setValue(!1),t.percentage.setValue(!1)),t.logDisabled.setValue(!(!s&&!i)),t.percentageDisabled.setValue(!(!s&&!i))}function O(e){return w.includes(e)}function F(e,t="default",i=!1){let s,n,o,r=100,a=1;if("default"===t)null!=e&&(({pricescale:r,minmov:a,minmove2:n,fractional:s}=e),o=e.variable_tick_size||void 0);else{let e=t.split(",");3!==e.length&&(e=["100","1","false"]),r=parseInt(e[0]),a=parseInt(e[1]),s="true"===e[2]}return i&&(a=1),{priceScale:r,minMove:a,fractional:s,minMove2:n,variableMinTick:o,ignoreMinMove:i}}function W(e,t,i=!1){const{priceScale:s,minMove:n,fractional:o,minMove2:r,variableMinTick:l}=F(e,t,i);if(null!=e){const a=e.format;if("default"===t&&"volume"===a)return new c.VolumeFormatter({precision:2});if("percent"===a)return new h.PercentageFormatter({priceScale:s,minMove:n,fractional:o,minMove2:r,variableMinTick:l,ignoreMinMove:i})}return new a.PriceFormatter({priceScale:s,minMove:n,fractional:o,minMove2:r,variableMinTick:l,ignoreMinMove:i})}function H(e){return null!==e&&"spread"!==e.type}function z(e,t,i){if(null===e)return null;const s=!t||i?e.currency_id:e.currency_code;return void 0===s||""===s?null:s}function U(e,t){return(t?e.original_currency_code:e.original_currency_id)??z(e,t)}function j(e){return e.base_currency_id||null}function G(e){if(null===e||!H(e))return!1;const t=U(e);return null!==t&&t!==z(e)}function q(e,t){return t&&null!==e&&"spread"!==e.type}function $(e,t){if(null===e||!t)return null;const i=e.unit_id;return void 0===i||""===i?null:i}function K(e,t){return t?e.original_unit_id||$(e,t):null}function Y(e,t){return!(null===e||!q(e,t))&&(void 0!==e.original_unit_id&&e.original_unit_id!==e.unit_id)}function Z(e,t){return null!==e&&q(e,t)?e.unit_conversion_types||null:[]}function X(e){return null!==e&&void 0!==e.subsessions&&e.subsessions.some((e=>"premarket"===e.id||"postmarket"===e.id))}function J(e){return null!==e&&void 0!==e.subsessions&&(e.subsessions.some((e=>"regular"===e.id))&&e.subsessions.some((e=>"us_regular"===e.id)))}function Q(e){return null!==e&&void 0!==e.subsessions&&e.subsessions.filter((e=>!e.private)).length>1}function ee(e,t,i,s){let n=e&&(i&&e.pro_name||e.full_name||e.name);return m&&t?n=t:(g||!s&&_)&&e&&e.ticker&&(n=e.ticker),p&&n&&(n=n.toUpperCase()),n}function te(e,t){return ee(e,null,!0,!0)||t}function ie(e,t){return e?e.ticker??e.pro_name??t:t}const se="·";function ne(e,t){return me(e)?e.source2?.description??null:null}function oe(e,t,i="exchange"){const s=ne(e)??e[i];return t||f?e.name:`${e.name} ${se} ${s}`}function re(e){let t=e&&(function(e){return"futures"===e.type&&e.front_contract||null}(e)||e.name)||"";return t.length>40&&(t=t.substring(0,37)+"..."),t.trim()}function ae(e){const t=e?e.exchange:"";return p?t.toUpperCase():t}function le(e,t){
return null!==e?e.full_name:t}function ce(e,t){return e?.pro_name??t}function he(e,t){return["stock","fund","index"].includes(t.type)&&"regular"===e||"futures"===t.type&&"us_regular"===e}function de(e){return"c"===e?.visible_plots_set}function ue(e){return null!==e&&("unit"===e.measure&&null!==_e(e))}function _e(e){return e?.value_unit_id??null}function pe(e){return"ohlcv"===e.visible_plots_set}function me(e){return null!==e&&"economic"===e.type}function ge(e){const t=ne(e);if(null!==t)return t;return e.exchange}function fe(e){return(0,d.combine)(((t,i)=>{switch(t){case 4:{const t=e.seriesErrorMessage();return null!==t&&("resolution_not_entitled"===t||"custom_resolution"===t||"seconds_not_entitled"===t||"ticks_not_entitled"===t||t.startsWith("study_not_auth:"))?null:{type:"invalid_symbol"}}case 13:{const t=e.seriesErrorMessage();return null===t?null:{type:"calculations_error",errorMessage:t}}case 14:{const t=e.unsupportedResolutionState().value();return null===t?null:{type:"unsupported_resolution",reason:t.reason}}case 1:case 2:return null;default:if(i)return{type:"no_data"}}return null}),e.statusWV().weakReference(),(0,u.createWVFromGetterAndSubscription)((()=>!e.bars().size()&&!e.isInReplay().value()),e.dataEvents().dataUpdated()).ownership(),(0,u.createWVFromGetterAndSubscription)((()=>({})),e.model().onChartThemeLoaded()).ownership())}function ye(e){return Math.max(0,e?.delay??0)}},98017:(e,t,i)=>{"use strict";i.d(t,{Series:()=>_i});var s=i(50151),n=i(51768),o=i(76422),r=i(9343),a=i(14426),l=i(45579),c=i(80720),h=i(3070),d=i(64755),u=i(8025),_=i(93280),p=i(12988),m=i(68805),g=i(91007),f=i(725),y=i(5171),v=i(27777),S=i(11542),b=i(56570),w=i(22365),C=i(27538),P=(i(56530),i(24708));i(64671);function T(e){const t="QUANDL"===(e=e||{}).exchange,s={title:"",description:"",interval:"",exchange:"",provider:"",chartStyle:"",sessionDescription:"",priceSource:""};let n="";if(e.description&&t)if(2===e.description.split("/").length)n=e.description.split("/")[1];else{e.description.split("'").filter((e=>e.length)).forEach((e=>{let t=[];t=e&&("/"===e[0]||/\d+\/\(?/.test(e))?[e]:e.split("/").filter((e=>e.length)),n+=t[2===t.length?1:0]}))}else n=e.description?e.description:e.symbol;if(e.ticker?(s.title=e.ticker,s.description=x(n)):s.title=x(n),e.interval&&(s.interval=(0,P.translatedIntervalString)(e.interval)),t&&e.description){const t=/[\w_]+\/[\w_]+/.exec(e.description);t&&t[0]?s.provider=x(t[0].split("/")[0]):s.provider=x(e.description.split("/")[0])}return e.exchange&&(s.exchange=x(e.exchange)),s.chartStyle=x(function(e){return e.inputs,8===e.style?S.t(null,void 0,i(63876)):""}(e)),e.sessionDescription&&(s.sessionDescription=x(e.sessionDescription)),void 0!==e.priceSource&&(s.priceSource=x(e.priceSource)),s}function x(e){return e.replace(/'/g,"")}var I=i(62825);const M=S.t(null,void 0,i(70963)),A=S.t(null,void 0,i(75546)),L=b.enabled("hide_unresolved_symbols_in_legend"),k=b.enabled("symbol_info_price_source");class D extends C.StatusProviderBase{constructor(e,t,i){super(),this._series=e,this._statusViewProperties=t,
this._options=i||{}}text(){return function(e){const t=T(e);return(e.ticker?t.description:t.title)+(t.interval?", "+t.interval:"")+function(e,t=", "){return(e.provider?`${t}${e.provider}`:"")+(e.exchange?`${t}${e.exchange}`:"")+(e.chartStyle?`${t}${e.chartStyle}`:"")+(e.branding?`${t}${e.branding}`:"")+(e.sessionDescription?`${t}${e.sessionDescription}`:"")+(e.priceSource?`${t}${e.priceSource}`:"")}(t)}(this._getTitleGenerationOptions())}getSplitTitle(){return T(this._getTitleGenerationOptions())}bold(){return!1}size(){return this._statusViewProperties.childs().fontSize.value()+"px"}errorStatus(){const e=this._series.unsupportedResolutionState().value(),t=e?(0,I.getErrorFromUnsupportedResolutionState)(e):this._series.seriesErrorMessage();return null!==t?{error:t,title:e?A:M}:null}_getTitleGenerationOptions(){const e=this._series.symbolInfo(),t=this._statusViewProperties.childs(),i=this._series.symbolTextSourceProxyProperty().value();let s;t.showExchange.value()&&e&&(s=(0,m.getSymbolExchange)(e));const n=(k&&e?.price_source_id?this._series.model().availablePriceSources(this._series.getSymbolString()).name(e.price_source_id):null)??void 0,o=this._series.getInputsProperties().state();return 17===this._series.style()&&(o.type=this._series.properties().childs().volFootprintStyle.childs().type.value()),{description:B(i,e),exchange:s,symbol:L&&null===e?"":this._series.symbol(),interval:t.showInterval.value()&&!this._options.hideResolution?this._series.interval():void 0,style:this._series.properties().childs().style.value(),inputs:o,boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,ticker:E(i,e),priceSource:n}}}function E(e,t){return"ticker-and-description"!==e?"":null!==t?t.name:void 0}function B(e,t){if(null!==t)return"ticker"===e?t.name:"long-description"===e&&void 0!==t.long_description?t.long_description:(0,w.getTranslatedSymbolDescription)({pro_name:t.pro_name||void 0,short_name:t.name||void 0,description:t.description||void 0,short_description:t.short_description||void 0,local_description:t.local_description||void 0,language:t.language||void 0})}class V extends v.StatusView{constructor(e,t,i){super(new D(e,t,i)),this._invalidated=!0,this._series=e,this._series.onRestarted().subscribe(this,this.update),this._series.dataEvents().symbolResolved().subscribe(this,this.update),this._series.dataEvents().completed().subscribe(this,this.update),this._series.boxSizeValue().subscribe(this.update.bind(this)),t.childs().symbolTextSource.subscribe(this,this.update)}getSeriesPrecision(){let e=4;const t=this._series.symbolInfo();return t&&t.pricescale&&(e=Math.round(Math.log(t.pricescale)/Math.log(10))),e}round(e){const t=this.getSeriesPrecision(),i=Math.round(e*Math.pow(10,t))/Math.pow(10,t);return i?i.toString():""}update(){this._invalidated=!0}text(){return this._updateImpl(),super.text()}bold(){return this._updateImpl(),super.bold()}size(){return this._updateImpl(),super.size()}getSplitTitle(){return this._updateImpl(),this._statusProvider.getSplitTitle()}_updateImpl(){
this._invalidated&&(this._bold=this._statusProvider.bold(),this._size=this._statusProvider.size(),this._text=this._statusProvider.text(),this._invalidated=!1)}}var R=i(50335),N=i(7576),O=i(49483),F=i(928),W=i(15764);const H=O.CheckMobile.any(),z=b.enabled("hide_resolution_in_legend");class U extends N.DataWindowView{constructor(e,t){super(),this._invalidated=!0,this._series=e,this._model=t,this.update()}update(){this._invalidated=!0}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}series(){return this._series}canShowItems(){return!!this._model.mainPane()?.maximized().value()||void 0===this._model.panes().find((e=>e.maximized().value()))}_updateImpl(){const e=this._getValuesProvider();this._valuesProvider!==e&&(this._valuesProvider=e,this._items=this._valuesProvider.getItems().map((e=>new N.DataWindowItem(e.id,e.title,"",e.unimportant))));const t=this._series.symbolInfo();if(t){const e=[t.name];if(z||e.push((0,P.translatedIntervalString)(this._series.interval())),(0,m.isEconomicSymbol)(t)){const i=(0,m.getSourceForEconomySymbol)(t);null!==i&&e.push(i)}else e.push((0,O.onWidget)()||"forex"===t.type?t.exchange:t.listed_exchange);this._header=e.join(` ${m.symbolTitleSeparator} `),this._title=t.description}else this._header=this._series.symbol();let i=this._model.crosshairSource().appliedIndex();b.enabled("use_last_visible_bar_value_in_legend")&&!(0,R.isNumber)(i)&&(i=this._model.timeScale().visibleBarsStrictRange()?.lastBar()??NaN);const s=this._valuesProvider.getValues(i);for(let e=0;e`${e}:${t}:${i}:${s}`),i.showBarChange.weakReference(),i.showSeriesOHLC.weakReference(),i.showVolume.weakReference(),i.showLastDayChange.weakReference()),this._visibilityProperty.subscribe(this,this.update)}areValuesVisible(){return this._visibilityProperty.value().includes("true")}additional(){return null}marketTitle(){const e=this._series.marketStatusModel().status().value();return this._showLastPriceAndChangeOnly()&&("pre_market"===e||"post_market"===e)?`${G}:`:""}destroy(){this._backgroundColorSpawn.destroy(),this._visibilityProperty.destroy()}_getValuesProvider(){return this._series.legendValuesProvider()}}var $,K=i(90823),Y=i(50788),Z=i(85049),X=i(14381),J=i(40644),Q=i(92184);!function(e){e[e.ExtrapolateBarsLimit=2e3]="ExtrapolateBarsLimit"}($||($={}));let ee=0;class te{constructor(e,t){
this._extrapolatedData=[],this._cacheForFuture=!1,this._modelId=ee++,this._builderCache=null,this._uniqueId=(0,Q.randomHashN)(6),this._resolution=t,this._symbolInfo=e,this._valid=Boolean(e.timezone)&&Boolean(e.session),this._session=new X.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections)}syncSourceTarget(){return{uniqueId:this._uniqueId,resolution:this._resolution,session:this._session.state()}}getSymbolInfo(){return this._symbolInfo}getSession(){return this._session}getResolution(){return this._resolution}uniqueId(){return this._modelId}distance(e,t){if(!this.isValid())return{success:!1};if(e>t)return{success:!1};if(e===t)return{success:!0,result:0};let i=this._extrapolatedData.length,s=0!==i?this._extrapolatedData[0]:null,n=null!==s?this._extrapolatedData[i-1]:null;const o=en){const s=(0,J.extrapolateBarsFrontToTime)(this.barBuilder(),n||1e3*e,1e3*t,2e3,!0);this._extrapolatedData=this._extrapolatedData.concat(s.times),i=this._extrapolatedData.length,this._cacheForFuture=o}if(n=this._extrapolatedData[i-1],n<1e3*t)return{success:!1};const r=this._extrapolatedData.indexOf(1e3*t);return-1===r?{success:!1}:{success:!0,result:r}}projectTime(e,t){if(!this.isValid())return e;let i=this._extrapolatedData.length,s=i>0?this._extrapolatedData[0]:null,n=null!==s?this._extrapolatedData[i-1]:null;const o=t>=0;1e3*e===s&&this._cacheForFuture===o||(this._extrapolatedData=[1e3*e],i=1,s=null,n=null);const r=Math.abs(t);if(null===s||r>=i){const s=(0,J.extrapolateBarsFrontByCount)(this.barBuilder(),n||1e3*e,Math.sign(t)*(r-i+1),!0);this._extrapolatedData=this._extrapolatedData.concat(s.times),i=this._extrapolatedData.length,this._cacheForFuture=o}return i0?e.delay:900;return Math.round(t/60)}listedExchange(){const e=this._symbolInfo.value();return null!==e?e.listed_exchange:""}async description(){const e=this._symbolInfo.value();if(null===e)return"";return{}.description||e.listed_exchange}exchange(){const e=this._symbolInfo.value();return null!==e?e.exchange:""}proName(){const e=this._symbolInfo.value();return null!==e?e.pro_name:""}country(){return this._symbolInfo.value()?.country||""}proPerm(){const e=this._symbolInfo.value();return null!==e?e.pro_perm:""}firstReplacedByBatsExchange(){const e=this._symbolInfo.value();return e&&(0,se.firstReplacedByBatsExchange)(e)}isSpread(){const e=this._symbolInfo.value();return null!==e&&"spread"===e.type}isDelay(){const e=this._symbolInfo.value();return Boolean(e?.delay)}async _update(){const e=this._symbolInfo.value();if(null===e)return void this._dataUpdatedInfoStatus.setValue(null);const t=this._status.value();if("string"==typeof t)return void this._dataUpdatedInfoStatus.setValue(null);if(2===t||1===t)return;const i=await oe(e,t,this._updatePeriod.value());0!==i.length?this._dataUpdatedInfoStatus.setValue(i):this._dataUpdatedInfoStatus.setValue(null)}}i(84906);var ae=i(37265);(0,r.getLogger)("Chart.DataProblemModel");class le{constructor(e,t){this._mainDataProblem=new ie.WatchedObject(null),this._supportPortalProblems=new ie.WatchedObject([]),this._allDataProblems=new ie.WatchedObject([]),this._pushStreamHandler=null,this._destroyed=!1,this._quotesProvider=e,this._quotesProvider.quotesUpdate().subscribe(this,this._update.bind(this)),this._symbolInfo=t,this._symbolInfo.subscribe((e=>{e||this._mainDataProblem.setValue(null)})),this._mainDataProblem.subscribe((()=>this._updateAllDataProblems())),this._supportPortalProblems.subscribe((()=>this._updateAllDataProblems())),this._requestSupportPortalProblems()}destroy(){this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._symbolInfo.release(),this._destroyed=!0}dataProblems(){return this._allDataProblems}_resetStatus(){this._mainDataProblem.setValue(null)}_update(e){void 0===e.values||void 0===e.values.data_problem?this._resetStatus():this._mainDataProblem.setValue((0,ae.clone)(e.values.data_problem))}_updateAllDataProblems(){const e=this._mainDataProblem.value(),t=this._supportPortalProblems.value();this._allDataProblems.setValue(null===e?t:[e,...t])}async _requestSupportPortalProblems(){0}}var ce=i(76742),he=i(19063),de=i(98558),ue=i(94164),_e=i(32956),pe=i(49256),me=i(44672);const ge=b.enabled("force_exchange_as_title"),fe=b.enabled("chart_style_hilo_last_price");const ye={alwaysShowGlobalLast:!1,visibleOnHistoryOnly:!1,showCountdown:!0,showSymbolLabel:!0,useSolidBodyColor:!0};class ve extends de.PriceAxisView{constructor(e,t,i){super(),this._previousCountdown="",this._source=e,this._model=t,this._options={...ye,...i}}updateCountdown(){this._countdownText()!==this._previousCountdown&&(this.update((0,me.sourceChangeEvent)(this._source.id())),this._model.updateSourcePriceScale(this._source))}_getSource(){
return this._source}_getModel(){return this._model}_isCountdownEnabled(){return this._options.showCountdown}_countdownText(){const e=Z.Interval.parse(this._source.interval());if(e.isDWM()||e.isTicks()||e.isSeconds()&&1===e.multiplier())return"";const t=this._source.data().bars().last();if(null===t)return"";const i=1e3*(0,s.ensure)(t.value[0]),n=Z.Interval.parse(this._source.interval()).inMilliseconds(),o=i.valueOf()+n;let r=Math.round((o-this._currentTime())/1e3);if(r<=0)return"";r=Math.min(r,n/1e3);let a=null;r>=3600&&(a=(0,_e.addLeadingZero)(Math.floor(r/3600))),r%=3600;const l=(0,_e.addLeadingZero)(Math.floor(r/60));r%=60;const c=(0,_e.addLeadingZero)(Math.floor(r));return null!==a?`${a}:${l}:${c}`:`${l}:${c}`}_updateRendererData(e,t,i){if(e.visible=!1,t.visible=!1,!this._source.isVisible())return;const n=this._source.properties().childs();if(!fe&&12===n.style.value())return;const o=this._model.timeScale().visibleBarsStrictRange(),r=this._source.data().last();if(null===o||null===r)return;if(this._options.visibleOnHistoryOnly&&o.contains(r.index))return;const a=this._model.properties().childs().scalesProperties.childs();let l=a.showSeriesLastValue.value(),c=this._isCountdownEnabled()&&n.showCountdown.value()&&(12===(h=n.style.value())?fe:(0,m.isTimeBasedStyle)(h))&&(this._options.alwaysShowGlobalLast||o.contains(r.index));var h;let d=this._options.showSymbolLabel&&a.showSymbolLabels.value();const u=a.seriesLastValueMode.value()===ue.PriceAxisLastValueMode.LastPriceAndPercentageValue,_=this._source.lastValueData(void 0,this._options.alwaysShowGlobalLast);if(_.noData)return;const p=8===n.style.value();if((l||c||d)&&p&&n.haStyle.childs().showRealLastPrice.value()){const e=this._source.lastValueData(void 0,!1),t=this._source.lastValueData(void 0,!0);e.noData||t.noData||e.index!==t.index||(l=!1,c=!1,d=!1)}const g=(0,he.resetTransparency)(this._source.priceLineColor(_.color));if(this._options.useSolidBodyColor?(i.background=g,i.borderColor=void 0):(i.background=this._model.backgroundColorAtYPercentFromTop((i.fixedCoordinate??i.coordinate)/(0,s.ensureNotNull)(this._model.paneForSource(this._source)).height()),i.borderColor=g),i.coordinate=_.coordinate,i.floatCoordinate=_.floatCoordinate,l||c){const t=this._axisFirstLineText(_,l);e.text=t,this._options.useSolidBodyColor?(i.textColor=this.generateTextColor(i.background),e.borderVisible=!1):(e.borderVisible=!0,i.textColor=g),e.textColor=i.textColor;const s=l&&u?(0,pe.getOppositeModePriceText)(this._source.priceScale(),_):"";e.secondLine=s,i.secondLineTextColor=i.textColor;const n=c?this._countdownText():"";this._previousCountdown=n,e.thirdLine=n,i.thirdLineTextColor=(0,he.generateColor)(i.textColor,25),0===t.length&&0===s.length&&0===n.length||(e.visible=!0)}d&&(t.text=this._paneText(d),t.visible=t.text.length>0)}_paneText(e){let t="";const i=this._source.symbolInfo();return ge?t=(0,m.displayedSymbolExchange)(i):e&&(t=(0,m.displayedSymbolName)(i)),t}_axisFirstLineText(e,t){return t?(0,pe.getCurrentModePriceText)(this._source.priceScale(),e):""}_currentTime(){
return window.ChartApiInstance.serverTime()}}var Se=i(18112),be=i(39772),we=i(37626);class Ce extends ve{lastPrice(){return this._getSource().data().lastProjectionPrice}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const n=this._getModel(),o=this._getSource(),r=o.priceScale(),a=n.timeScale(),l=this.lastPrice();if(a.isEmpty()||r.isEmpty()||void 0===l)return;const c=a.visibleBarsStrictRange();if(null===c)return;const h=c.firstBar(),d=c.lastBar(),_=o.data(),p=_.search(d,u.PlotRowSearchMode.NearestLeft);if(null===p)return;const m=o.nearestIndex(h,u.PlotRowSearchMode.NearestRight);if(void 0===m)return;const g=o.model().properties().childs().scalesProperties.childs(),f=(0,s.ensureNotNull)(_.valueAt(m))[4];let y=i.background,v=g.showSeriesLastValue.value(),S=!1,b=!1,w=!1;const C=o.lastValueData(4,!1),P=o.properties().childs();if(8===P.style.value()&&P.haStyle.childs().showRealLastPrice.value()){const e=o.lastValueData(4,!0);if(e.noData||e.color===i.background||(y=(0,he.resetTransparency)(e.color)),!e.noData&&!C.noData){const t=e.index===C.index;S=t&&g.showSymbolLabels.value(),b=g.seriesLastValueMode.value()===ue.PriceAxisLastValueMode.LastPriceAndPercentageValue,v=v&&t,w=t&&this._isCountdownEnabled()&&P.showCountdown.value()}}else{const e=o.barColorer().barStyle(p.index,!0);y=(0,he.resetTransparency)(e.barColor)}if(i.background=y,i.textColor=this.generateTextColor(y),i.secondLineTextColor=i.textColor,i.thirdLineTextColor=(0,he.generateColor)(i.textColor,25),i.coordinate=r.priceToCoordinate(l,f),e.visible=v||w,!C.noData){const i=o.priceScale().isPercentage();C.formattedPriceAbsolute=r.formatPriceAbsolute(l),C.formattedPricePercentage=r.formatPricePercentage(l,f,{signPositive:!0}),C.text=i?C.formattedPricePercentage:C.formattedPriceAbsolute,e.text=this._axisFirstLineText(C,v),e.secondLine=v&&b?i?C.formattedPriceAbsolute:C.formattedPricePercentage:"",e.thirdLine=w?this._countdownText():"",t.text=this._paneText(S)}t.visible=S}}var Pe=i(65458),Te=i(52397),xe=i(19625),Ie=i(51056);const Me={light:{lineStyle:Ie.LINESTYLE_DOTTED,lineWidth:1,backgroundColor:xe.colorsPalette["color-tv-blue-50"],lineColor:xe.colorsPalette["color-cold-gray-500"]},dark:{lineStyle:Ie.LINESTYLE_DOTTED,lineWidth:1,backgroundColor:xe.colorsPalette["color-tv-blue-a800"],lineColor:xe.colorsPalette["color-cold-gray-500"]}};function Ae(e){return e?Me.dark:Me.light}class Le extends Te.HorizontalLinePaneView{constructor(e,t,i){super(),this._model=e,this._isVisible=t.lineVisible,this._lineColor=t.lineColor,this._lineWidth=t.lineWidth,this._getValue=i}_updateImpl(){const e=this._lineRendererData;if(e.visible=!1,!this._isVisible.value())return;const t=this._model.mainSeries(),i=t.priceScale(),s=t.firstValue(),n=this._getValue();if(null===s||null===n)return;const o=Ae(this._model.dark().value()),r=this._lineColor.value()||o.lineColor,a=this._lineWidth.value()||o.lineWidth;e.visible=!0,e.y=i.priceToCoordinate(n,s),e.linestyle=o.lineStyle,e.linewidth=a,e.color=r}}class ke extends de.PriceAxisView{constructor(e,t,i,s){super(),this._model=e,this._label=t,
this._isVisible=i.labelVisible,this._backgroundColor=i.lineColor,this._getValue=s}_updateRendererData(e,t,i){if(e.visible=!1,t.visible=!1,!this._isVisible.value())return;const s=this._model.mainSeries(),n=s.priceScale(),o=s.firstValue(),r=this._getValue();if(null===o||null===r)return;const a=Ae(this._model.dark().value()),l=(0,he.resetTransparency)(this._backgroundColor.value()||a.backgroundColor);e.visible=!0,t.visible=!0,e.text=n.formatPriceAbsolute(r),t.text=this._label,i.coordinate=n.priceToCoordinate(r,o),i.background=l,i.textColor=this.generateTextColor(l)}}class De extends we.PriceLineAxisView{constructor(e,t,i){super(),this._model=e,this._isLineVisible=t,this._getValue=i}_isVisible(){return this._isLineVisible.value()}_lineWidth(){return Ae(this._model.dark().value()).lineWidth}_lineStyle(){return Ae(this._model.dark().value()).lineStyle}_priceLineColor(e){return Ae(this._model.dark().value()).lineColor}_value(){const e=this._model.mainSeries(),t=e.priceScale(),i=e.firstValue(),s=this._getValue();if(null===i||null===s)return{noData:!0};const n=t.priceToCoordinate(s,i);return{noData:!1,floatCoordinate:n,coordinate:n,color:"",formattedPricePercentage:"",formattedPriceAbsolute:"",formattedPriceIndexedTo100:"",text:"",index:0}}}var Ee;!function(e){e[e.High=0]="High",e[e.Low=1]="Low"}(Ee||(Ee={}));const Be=S.t(null,void 0,i(78254)),Ve=S.t(null,void 0,i(65318));function Re(e,t,i,s){const n=new Le(e,i,s),o=new ke(e,i.label,i,s);return{paneView:n,panePriceAxisView:new Pe.PanePriceAxisView(o,t,e),priceAxisView:o,priceLineAxisView:new De(e,i.lineVisible,s)}}const Ne={light:{lineStyle:Ie.LINESTYLE_DOTTED,lineWidth:1,textColor:(0,xe.getHexColorByName)("color-cold-gray-900"),backgroundColor:(0,xe.getHexColorByName)("color-tv-blue-50"),lineColor:(0,xe.getHexColorByName)("color-cold-gray-500")},dark:{lineStyle:Ie.LINESTYLE_DOTTED,lineWidth:1,textColor:(0,xe.getHexColorByName)("color-white"),backgroundColor:(0,xe.getHexColorByName)("color-tv-blue-a800"),lineColor:(0,xe.getHexColorByName)("color-cold-gray-500")}};function Oe(e){return e?Ne.dark:Ne.light}class Fe extends Te.HorizontalLinePaneView{constructor(e,t,i){super(),this._model=e,this._isVisible=t.lineVisible,this._lineColor=t.lineColor,this._lineWidth=t.lineWidth,this._getValue=i}_updateImpl(){const e=this._lineRendererData;if(e.visible=!1,!this._isVisible.value())return;const t=this._model.mainSeries(),i=t.priceScale(),s=t.firstValue(),n=this._getValue();if(null===s||null===n)return;const o=Oe(this._model.dark().value()),r=this._lineColor.value()?this._lineColor.value():o.lineColor,a=this._lineWidth.value()?this._lineWidth.value():o.lineWidth;e.visible=!0,e.y=i.priceToCoordinate(n,s),e.linestyle=o.lineStyle,e.linewidth=a,e.color=r}}class We extends de.PriceAxisView{constructor(e,t,i,s){super(),this._model=e,this._label=t,this._isVisible=i,this._getValue=s}_updateRendererData(e,t,i){if(e.visible=!1,t.visible=!1,!this._isVisible.value())return;const s=this._model.mainSeries(),n=s.priceScale(),o=s.firstValue(),r=this._getValue();if(null===o||null===r)return
;const a=Oe(this._model.dark().value());e.visible=!0,t.visible=!0,e.text=n.formatPriceAbsolute(r),t.text=this._label,i.coordinate=n.priceToCoordinate(r,o),i.background=a.backgroundColor,i.textColor=a.textColor}}class He extends we.PriceLineAxisView{constructor(e,t,i){super(),this._model=e,this._isLineVisible=t,this._getValue=i}_isVisible(){return this._isLineVisible.value()}_lineWidth(){return Oe(this._model.dark().value()).lineWidth}_lineStyle(){return Oe(this._model.dark().value()).lineStyle}_priceLineColor(e){return Oe(this._model.dark().value()).lineColor}_value(){const e=this._model.mainSeries(),t=e.priceScale(),i=e.firstValue(),s=this._getValue();if(null===i||null===s)return{noData:!0};const n=t.priceToCoordinate(s,i);return{noData:!1,floatCoordinate:n,coordinate:n,color:"",formattedPricePercentage:"",formattedPriceAbsolute:"",formattedPriceIndexedTo100:"",text:"",index:0}}}var ze;!function(e){e[e.Avg=0]="Avg"}(ze||(ze={}));const Ue=S.t(null,void 0,i(73025));function je(e,t,i,s){const n=i.childs(),o=function(e,t,i,s){const n=new Fe(e,i,s),o=new We(e,i.label,i.labelVisible,s),r=new Pe.PanePriceAxisView(o,t,e),a=new He(e,i.lineVisible,s);return{paneView:n,panePriceAxisView:r,priceAxisView:o,priceLineAxisView:a}}(e,t,{label:Ue,labelVisible:n.averageClosePriceLabelVisible,lineVisible:n.averageClosePriceLineVisible,lineColor:n.averagePriceLineColor,lineWidth:n.averagePriceLineWidth},(()=>s(0)));return{paneViews:[o.paneView],panePriceAxisViews:[o.panePriceAxisView],priceAxisViews:[o.priceAxisView],priceLineAxisViews:[o.priceLineAxisView]}}var Ge=i(76748);const qe={open:S.t(null,{context:"in_legend"},i(46728)),high:S.t(null,{context:"in_legend"},i(43253)),low:S.t(null,{context:"in_legend"},i(89923)),close:S.t(null,{context:"in_legend"},i(2696)),hl2:S.t(null,{context:"in_legend"},i(61372)),hlc3:S.t(null,{context:"in_legend"},i(55096)),ohlc4:S.t(null,{context:"in_legend"},i(94174))};class $e extends Ge.SeriesValuesProvider{constructor(e,t){super(e,t);const i=t.properties().childs().paneProperties.childs().legendProperties.childs();this._showBarChange=i.showBarChange,this._showLastDayChange=i.showLastDayChange,this._showSeriesOHLC=i.showSeriesOHLC,this._showVolume=i.showVolume,this._seriesStyle=e.properties().childs().style;const s=this._emptyValues[0],n=this._emptyValues[1],o=this._emptyValues[2];s.title=qe.open,n.title=qe.high,o.title=qe.low,s.unimportant=!0,n.unimportant=!0,o.unimportant=!0,this._emptyValues[6].title="",this._emptyValues[8].title="",this._emptyValues[4].title=""}getValues(e){const t=super.getValues(e),i=this._series.style(),s=12!==i,n=this._showSeriesOHLC.value(),o=s&&this._showBarChange.value(),r=s&&this._showLastDayChange.value();if(this._showLastPriceAndChangeOnly()){const e=t[5];return e.visible=e.visible&&n,t[6].visible&&=o,t[8].visible=!1,t}const a=12!==i&&16!==i,l=12!==i,c=this._series.intervalObj().is1Tick(),h=t[7];h.visible=h.visible&&this._showVolume.value();const d=(0,m.isPriceSourceStyle)(this._seriesStyle.value()),u=n&&!d,_=n&&d;if(t[0].visible=u&&a&&!c,t[1].visible=u&&!c,
t[2].visible=u&&!c,t[3].visible=u&&l,t[3].title=c?"":qe.close,t[4].visible=_,t[6].visible&&=o,t[8].visible&&=r,16===i){const e=this._series.properties().childs().hlcAreaStyle.childs();t[1].color=e.highLineColor.value(),t[2].color=e.lowLineColor.value(),t[3].color=e.closeLineColor.value()}return t}}var Ke,Ye=i(52033),Ze=i(76350),Xe=i(73698),Je=i(86441);class Qe{constructor(){this._data=null}setData(e){this._data=e}data(){return this._data}draw(e,t){const i=this._data;if(null===i)return;const{horizontalPixelRatio:s,verticalPixelRatio:n}=t;e.save();const o=Math.max(1,Math.floor(s)),r=o%2/2,a=Math.round(i.center.x*s)+r,l=i.center.y*n;e.fillStyle=i.seriesLineColor,e.beginPath();const c=Math.max(2,1.5*i.seriesLineWidth)*s;e.arc(a,l,c,0,2*Math.PI,!1),e.fill(),e.fillStyle=i.fillColor,e.beginPath(),e.arc(a,l,i.radius*s,0,2*Math.PI,!1),e.fill(),e.lineWidth=o,e.strokeStyle=i.strokeColor,e.beginPath(),e.arc(a,l,i.radius*s+o/2,0,2*Math.PI,!1),e.stroke(),e.restore()}hitTest(e){return null}}function et(e){return e}!function(e){e[e.AnimationPeriod=2600]="AnimationPeriod",e[e.Stage1Period=.25]="Stage1Period",e[e.Stage2Period=.275]="Stage2Period",e[e.Stage3Period=.475]="Stage3Period",e[e.Stage1StartCircleRadius=4]="Stage1StartCircleRadius",e[e.Stage1EndCircleRadius=10]="Stage1EndCircleRadius",e[e.Stage1StartFillAlpha=.25]="Stage1StartFillAlpha",e[e.Stage1EndFillAlpha=0]="Stage1EndFillAlpha",e[e.Stage1StartStrokeAlpha=.4]="Stage1StartStrokeAlpha",e[e.Stage1EndStrokeAlpha=.8]="Stage1EndStrokeAlpha",e[e.Stage2StartCircleRadius=10]="Stage2StartCircleRadius",e[e.Stage2EndCircleRadius=14]="Stage2EndCircleRadius",e[e.Stage2StartFillAlpha=0]="Stage2StartFillAlpha",e[e.Stage2EndFillAlpha=0]="Stage2EndFillAlpha",e[e.Stage2StartStrokeAlpha=.8]="Stage2StartStrokeAlpha",e[e.Stage2EndStrokeAlpha=0]="Stage2EndStrokeAlpha",e[e.Stage3StartCircleRadius=14]="Stage3StartCircleRadius",e[e.Stage3EndCircleRadius=14]="Stage3EndCircleRadius",e[e.Stage3StartFillAlpha=0]="Stage3StartFillAlpha",e[e.Stage3EndFillAlpha=0]="Stage3EndFillAlpha",e[e.Stage3StartStrokeAlpha=0]="Stage3StartStrokeAlpha",e[e.Stage3EndStrokeAlpha=0]="Stage3EndStrokeAlpha"}(Ke||(Ke={}));const tt=[{start:0,end:.25,startRadius:4,endRadius:10,startFillAlpha:.25,endFillAlpha:0,startStrokeAlpha:.4,endStrokeAlpha:.8,easing:et},{start:.25,end:.525,startRadius:10,endRadius:14,startFillAlpha:0,endFillAlpha:0,startStrokeAlpha:.8,endStrokeAlpha:0,easing:et},{start:.525,end:1,startRadius:14,endRadius:14,startFillAlpha:0,endFillAlpha:0,startStrokeAlpha:0,endStrokeAlpha:0,easing:et}];function it(e,t,i,s){const n=i+(s-i)*t;return(0,he.applyTransparency)(e,(0,he.alphaToTransparency)(n))}const st=(0,xe.getHexColorByName)("color-minty-green-400"),nt=(0,xe.getHexColorByName)("color-ripe-red-500");function ot(e,t,i){const s=e%2600/2600;let n;for(const e of tt)if(s>=e.start&&s<=e.end){n=e;break}if(void 0===n)throw new Error("Last price animation internal logic error");const o=n.easing((s-n.start)/(n.end-n.start));return{fillColor:it(i,o,n.startFillAlpha,n.endFillAlpha),
strokeColor:it(i,o,n.startStrokeAlpha,n.endStrokeAlpha),radius:(r=o,a=n.startRadius,l=n.endRadius,a+(l-a)*r)};var r,a,l}class rt{constructor(e){this._renderer=new Qe,this._invalidated=!0,this._stageInvalidated=!0,this._startTime=performance.now(),this._endTime=this._startTime-1,this._prevRenderedPrice=null,this._series=e}update(e){if(this._invalidated=!0,"data-source-change"===e.type&&e.sourceId===this._series.id()&&e.realtime&&this._series.seriesLoaded()){const e=performance.now(),t=this._endTime-e;if(t>0)return void(t<650&&(this._endTime+=2600));this._startTime=e,this._endTime=e+2600}}invalidateStage(){this._stageInvalidated=!0}animationActive(){return performance.now()<=this._endTime}stopAnimation(){this._endTime=this._startTime-1}renderer(e){return this._invalidated?(this._updateImpl(e),this._invalidated=!1,this._stageInvalidated=!1):this._stageInvalidated&&(this._updateRendererDataStage(),this._stageInvalidated=!1),this._renderer}_updateImpl(e){this._renderer.setData(null);const t=this._series.model().timeScale(),i=t.visibleBarsStrictRange(),s=this._series.firstValue(),n=this._series.lastValueData(void 0,!0,!0);if(null===i||null===s||void 0===n.index||void 0===n.price||!i.contains(n.index))return;const o=new Je.Point(t.indexToCoordinate(n.index),this._series.priceScale().priceToCoordinate(n.price,s)),r=n.color,a=this._series.properties().childs();let l;switch(this._series.style()){case 3:l=a.areaStyle.childs().linewidth.value();break;case 10:const t=a.baselineStyle,i=Math.round(e.mediaSize.height*(Math.abs(100-t.childs().baseLevelPercentage.value())/100));l=o.y<=i?t.childs().topLineWidth.value():t.childs().bottomLineWidth.value();break;case 14:l=a.lineWithMarkersStyle.childs().linewidth.value();break;case 15:l=a.steplineStyle.childs().linewidth.value();break;default:l=a.lineStyle.childs().linewidth.value()}this._lastBaseColor=null===this._prevRenderedPrice||this._prevRenderedPrice===n.price?r:this._prevRenderedPricethis._clearDataImpl())):this._clearDataImpl()}dataEvents(){return this._dataEvents}turnaround(){return`${this._turnaroundPrefix}${this._turnaroundCounter}`}symbolInstanceId(){return this._symbolInstanceId}symbol(){return this._extSymbol}moveData(e){this._enqueueUpdate((()=>this._data.moveData(e)))}setInitialRequestOptions(e){this._createSeriesOverriddenParams=ft(e)}symbolSameAsResolved(e){return null!==this._extSymbol&&(0,ut.symbolSameAsResolved)(e,yt(this._extSymbol),this._lastResolvedSymbol)}resolvedSymbol(){return null===this._extSymbol?null:yt(this._extSymbol)}_resolveSymbol(){null!==this._extSymbol&&(this._symbolInstanceId=this._gateway.resolveSymbol("sds_sym_"+mt++,(0,Xe.encodeExtendedSymbolOrGetSimpleSymbolString)(this._extSymbol),this._onMessage.bind(this)))}_clearDataImpl(){this._data.clear()}_changeStatusTo(e){(0,s.assert)(this._status!==e,"Source and destination status should be distinct"),_t.logNormal(`Status changed from ${pt[this._status]} to ${pt[e]}`),this._status=e}_createSeries(){(0,s.assert)(this._status!==pt.Active,'Status should not be "Active" when creating a study'),this._instanceId="sds_"+gt++,this._resolveSymbol();const e=this._createSeriesOverriddenParams||this._createSeriesParams;this._createSeriesOverriddenParams&&(this._createSeriesOverriddenParams=0),this._gateway.createSeries(this._instanceId,this.turnaround(),(0,s.ensureNotNull)(this._symbolInstanceId),(0,s.ensureNotNull)(this._resolution),e,this._timeFrame,this._onMessage.bind(this)),this._timeFrame=null,this._changeStatusTo(pt.AwaitingFirstDataUpdate),this._dataEvents.fireCreated(this._instanceId)}_onGatewayIsConnectedChanged(e){e?this._onGatewayConnected():this._onGatewayDisconnected()}_onGatewayConnected(){this._status===pt.AwaitingConnection&&this._createSeries()}_onGatewayDisconnected(){this._status!==pt.Idle&&this._status!==pt.AwaitingConnection&&(this._instanceId=null,this._changeStatusTo(pt.AwaitingConnection)),this._turnaroundCounter=1}_onMessage(e){this._enqueueUpdate((()=>this._onMessageImpl(e)))}async _onMessageImpl(e){switch(e.method){case"symbol_resolved":{const[t,i]=e.params;if(t!==this._symbolInstanceId){null!==this._symbolInstanceId&&_t.logNormal(`Resolve for old symbol, expected: ${this._symbolInstanceId}, actual ${e.params[0]}`);break}this._onSymbolResolved(i);break}case"symbol_error":
if(e.params[0]!==this._symbolInstanceId){null!==this._symbolInstanceId&&_t.logNormal(`Symbol error for old symbol, expected: ${this._symbolInstanceId}, actual ${e.params[0]}`);break}this._onSymbolError(e);break;case"series_timeframe":{const[t,i,s,n,o,r,a]=e.params;if(!this._checkTurnaround(t,i)){_t.logNormal(`Time frame for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${i})`);break}this._onSeriesTimeFrame(s,n,o,r,a);break}case"series_error":{const[t,i]=e.params;if(!this._checkTurnaround(t,i)){_t.logNormal(`Series error for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${i})`);break}this._onSeriesError(e.params[2]);break}case"series_loading":{const[t,i]=e.params;if(!this._checkTurnaround(t,i))break;this._onSeriesLoading(e.time);break}case"series_completed":{const[t,i,s,n]=e.params;if(!this._checkTurnaround(t,s)){_t.logNormal(`Series completed for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${t} (${s})`);break}this._onSeriesCompleted(i,e.time,n);break}case"data_update":if(!this._checkTurnaround(e.params.customId,e.params.turnaround)){_t.logNormal(`Data update for old data, expected: ${this._symbolInstanceId} (${this.turnaround()}), actual ${e.params.customId} (${e.params.turnaround})`);break}await this._onDataUpdate(e.params.plots,e.params.nonseries,e.params.lastBar);break;case"clear_data":if(e.params.turnaround!==this.turnaround()){_t.logNormal(`Clear data for old data, expected: ${this.turnaround()}, actual ${e.params.turnaround}`);break}this._clearDataImpl(),this._dataEvents.fireDataUpdated(void 0,!1,null,!1)}}_onSeriesError(e){let t,i;if("string"==typeof e)i={error:e},t=e;else if(i=e,e.ctx){const i={};Object.entries(e.ctx).forEach((([e,t])=>{i[e]=t.toString()})),t=e.error.format(i)}else t=e.error;if(t.startsWith("study_not_auth:")){const e=t.split(":",2)[1].split("@",2)[0];if(["BarSetRenko","BarSetPriceBreak","BarSetKagi","BarSetPnF"].includes(e))this._dataEvents.fireChartTypeNotPermitted(e);else{if("BarSetSpread"===e)return void this._dataEvents.fireIntradaySpreadNotPermitted();if("BarSetRange"===e){const e=`${(0,s.ensureNotNull)(this._extSymbol).inputs.range}R`;this._dataEvents.fireCustomIntervalNotPermitted(e)}}}else{if(t.startsWith("unsupported"))return void this._dataEvents.fireUnsupportedResolutionRequested();"resolution_not_entitled"===t?this._dataEvents.fireIntradayExchangeNotPermitted():"custom_resolution"===t?this._dataEvents.fireCustomIntervalNotPermitted((0,s.ensureNotNull)(this._resolution)):"seconds_not_entitled"===t?this._dataEvents.fireSecondsIntervalNotPermitted():"ticks_not_entitled"===t&&this._dataEvents.fireTicksIntervalNotPermitted()}this._dataEvents.fireSeriesError(i)}_onSeriesTimeFrame(e,t,i,s,n){this._dataEvents.fireSeriesTimeFrame(e,t,i,s??!0,n)}_onSymbolError(e){if(e.params[1]===ht.permissionDenied)switch(e.params[2]){case ht.SymbolErrorPermissionDeniedReason.Symbol:this._dataEvents.fireSymbolNotPermitted(e.params[3]);break;case ht.SymbolErrorPermissionDeniedReason.GroupPermission:
this._dataEvents.fireSymbolGroupNotPermitted(e.params[3]);break;default:this._dataEvents.fireSymbolNotPermitted(e.params[2])}else e.params[1]===ht.invalidSymbol&&this._dataEvents.fireSymbolInvalid();this._dataEvents.fireSymbolError(e.params[1])}_onSymbolResolved(e){this._lastResolvedSymbol=(0,s.ensureNotNull)((0,m.extractSymbolNameFromSymbolInfo)(e,"")),this._dataEvents.fireSymbolResolved(e)}async _onDataUpdate(e,t,i){this._onDataUnpacked(e,i,await async function(e){if(void 0===e)return{projectionPlots:[],boxSize:null};if(""===e.d||"nochange"===e.indexes)return null;const t=await(0,ct.unpackNonSeriesData)(e.d);if(null===t||t.indexes_replace)return null;const i=e.indexes,{bars:s,price:n,boxSize:o,reversalAmount:r}=t.data,a=(s||[]).map((e=>{let t;return"factor"in e?t=e.factor:"additionalPrice"in e&&(t=e.additionalPrice),{index:i[e.time],value:[0,e.open,e.high,e.low,e.close,e.volume,t]}}));return{lastPrice:n,projectionPlots:a,reversalAmount:r,boxSize:o}}(t))}_enqueueUpdate(e){return this._ongoingDataUpdate=this._ongoingDataUpdate.then(e,e),this._ongoingDataUpdate}_onDataUnpacked(e,t,i){if(this._status===pt.Idle)return;this._status===pt.AwaitingFirstDataUpdate&&(this._changeStatusTo(pt.Active),this._clearDataImpl());const s=this._data.bars().size(),n=this._data.bars().firstIndex(),o=this._data.mergeRegularBars(e);null!==i&&(this._data.nsBars().clear(),this._data.nsBars().merge(i.projectionPlots),this._data.lastProjectionPrice=i.lastPrice,null!==i.boxSize&&(this._data.boxSize=i.boxSize),this._data.reversalAmount=i.reversalAmount);const r=null===n,a=r||null!==o&&o.indexe.value.splice(7,1))),t}function ui(e){const{seriesStatus:t,additionalStudyStatus:i}=e;if(y.seriesLoadingStatuses.has(t))return 2;if(i){if(4!==t&&i.type===Xt.StudyStatusType.Error)return 13;if(y.seriesReadyStatuses.has(t)&&(i.type===Xt.StudyStatusType.Loading||i.type===Xt.StudyStatusType.Undefined))return 2}return t}class _i extends l.PriceDataSource{constructor(e,t,i,n){t.removeProperty("currencyId"),super(e,"_seriesId"),this.isSeries=!0,this.requestingStyleIsNotSupported=new Ye.Delegate,this.requestingStyleSupportRecovered=new Ye.Delegate,this._paneView=null,this._futureBarsPaneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._priceLineView=null,this._gotoDateView=null,this._baseHorizontalLineView=null,this._priceStep=null,this._symbolInfo=new lt.WatchedValue(null),this._isPrePostMarketPricesAvailableProperty=new p.Property(!1),this._isBackAdjustmentForbiddenProperty=new p.Property(!0),this._isSettlementAsCloseForbiddenProperty=new p.Property(!0),this._highLowPriceCache=new Map,this._averagePriceCache=new Map,this._prevClosePriceAxisView=null,
this._priceScaleAboutToBeChanged=new Ye.Delegate,this._onRestarted=new Ye.Delegate,this._onStatusChanged=new Ye.Delegate,this._tagsChanged=new Ye.Delegate,this._intervalChanged=new Ye.Delegate,this._sessionIdChanged=new Ye.Delegate,this._requestMoreDataAvailable=!0,this._lineStyleLastPriceCirclePaneView=new rt(this),this._prevClosePriceLineView=null,this._dataPoweredBy=null,this._symbolResolvingActive=new lt.WatchedValue(!1),this._predictBars=0,this._syncModel=null,this._data=null,this._lastCompleteFlags=null,this._haStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(8,!0))},this._renkoStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(4,!0))},this._pbStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(7,!0))},this._kagiStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(5,!0))},this._pnfStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(6,!0))},this._rangeStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(11,!0))},this._volFootprintStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(17,!0))},this._tpoStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(18,!0))},this._svpStyle={studyId:(0,s.ensureNotNull)((0,m.chartStyleStudyId)(20,!0))},this._barColorerCache=null,this._boxSizeValue=new lt.WatchedValue,this._base=100,this._pointValue=1,this._formattingDeps=null,this._defaultFormatter=new f.PriceFormatter({priceScale:this._base}),this._formatter=new f.PriceFormatter({priceScale:this._base}),this._ignoreMinMoveFormatter=new f.PriceFormatter({priceScale:this._base}),this._ignoreMinMovePriceStep=null,this._lastBarCloseTime=null,this._onSessionIdPropertyChangedBound=this._onSessionIdPropertyChanged.bind(this),this._ignoreSessionIdProxyPropertyChanges=!1,this._textSourceIsAlwaysTickerRestrictionEnabled=!1,this._lastPriceAnimationActive=!1,this._currentSession="out_of_session",this._onStyleChanged=new Ye.Delegate,this._intervalObj=null,this._obsoleteZOrder=0,this._seriesErrorMessage=null,this._seriesAlwaysFalseHibernatedVW=new lt.WatchedValue(!1),this._styleToRecover=null,this._precomputedBarStyles=new WeakMap,this._doNotShowLastAvailableBar=!1,this._gotoDateResultCleared=!1,this._endOfDataPaneView=null,this._pendingTimeRange=null,this._replaySubscriber=new lt.WatchedValue(null),this._symbolIntervalChanged=new Ye.Delegate,this._isReplayResolutionAvailableForUser=null,this._onInReplayStateChanged=new Ye.Delegate,this._onReplaySubscriberSeriesModified=new Ye.Delegate,this._paramsNotApplicableForReplay=new Ye.Delegate,this._onTimeFrameApplied=new Ye.Delegate,this._seriesLoaded=!1,this._seriesCompleted=!1,this._status=new lt.WatchedValue({seriesStatus:0}),this._prevRequestedInterval="",this._isActingAsSymbolSource=new lt.WatchedValue(!0),this._unsupportedResolutionState=new lt.WatchedValue(null),this._countdownUpdateTimer=null,this._deferredDestroyed=(0,a.createDeferredPromise)(),this._volumePointWeights=null,this._studyBindings=null,this._lineColorAtYPercentFromTop=new be.GradientColorCache,this._savedLeftEdge=null,this._pendingScrollToLeftEdge=null,
this._updateTimeScaleTimePointWeights=()=>{0},this._seriesStatus=(0,Zt.combine)(ui,this._status.weakReference()),this._seriesSource=new St(e.chartApi(),"s",n);const o=this._seriesSource.dataEvents();o.symbolResolved().subscribe(this,this._onSymbolResolved),o.symbolError().subscribe(this,this._onSymbolError),o.seriesTimeFrame().subscribe(this,this._onSeriesTimeFrame),o.seriesError().subscribe(this,this._onSeriesError),o.loading().subscribe(this,this._onSeriesLoading),o.completed().subscribe(this,this._onSeriesCompleted),o.dataUpdated().subscribe(this,this._onDataUpdated),o.barReceived().subscribe(this,this._onBarReceived),o.unsupportedResolutionRequested().subscribe(this,this._onUnsupportedResolutionRequested),this._quotesProvider=new ce.QuotesProvider(void 0,e.collapsed().spawnOwnership()),this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate);const r=t.childs();if(t.hasChild("extendedHours")){(0,s.ensureDefined)(r.extendedHours).value()&&!t.hasChild("sessionId")&&t.addChild("sessionId",new p.Property("extended")),t.removeProperty("extendedHours")}t.hasChild("sessionId")||t.addChild("sessionId",new p.Property(g.SubsessionId.Regular)),(0,Kt.allChartStyles)().includes(r.style.value())||r.style.setValueSilently(2);const l=r.lineStyle.childs();if(r.lineStyle.hasChild("styleType")){let e,t;const i=l.styleType.value();0===i&&(t=14,e=r.lineWithMarkersStyle.childs()),1===i&&(t=15,e=r.steplineStyle.childs()),e&&(e.color.setValueSilently(l.color.value()),e.linestyle.setValueSilently(l.linestyle.value()),e.linewidth.setValueSilently(l.linewidth.value()),e.priceSource.setValueSilently(l.priceSource.value())),void 0!==t&&2===r.style.value()&&r.style.setValue(t),r.lineStyle.removeProperty("styleType")}this._studyBindings?.bindToSeriesProperties(t),this._setProperties(t),this._sessionIdProxyProperty=new p.Property(r.sessionId.value()),r.sessionId.subscribe(this,(()=>this._updateSessionIdProxyProperty())),this._sessionIdProxyProperty.subscribe(this,this._onSessionIdProxyPropertyChanged),this._symbolTextSourceProxyProperty=new p.Property,this._recalcSymbolTextSourceProxyProperty(),r.statusViewStyle.childs().symbolTextSource.subscribe(this,this._recalcSymbolTextSourceProxyProperty),this._symbolTextSourceProxyProperty.subscribe(this,(()=>e.lightUpdate())),this._options=(0,ae.merge)((0,ae.clone)(ci),i),this._prevChartStyle=r.style.value(),this._priceAxisView=new ve(this,e,{alwaysShowGlobalLast:!ii,showCountdown:i.countdownEnabled});let c=null;Qt||ii||(c=new ve(this,e,{visibleOnHistoryOnly:!0,showSymbolLabel:!1,showCountdown:!1,alwaysShowGlobalLast:!1,useSolidBodyColor:!1})),this._priceLinePriceAxisView=new we.SeriesPriceLineAxisView(this),this._priceLineAxisViews=[this._priceLinePriceAxisView],this._projectionPriceAxisView=new Ce(this,e,{showCountdown:i.countdownEnabled}),this._priceAxisViews=[this._priceAxisView,this._projectionPriceAxisView],null!==c&&this._priceAxisViews.push(c),this._panePriceAxisView=new Pe.PanePriceAxisView(this._priceAxisView,this,e),
this._historyPricePanePriceAxisView=null!==c?new Pe.PanePriceAxisView(c,this,e):null,this._projectionPanePriceAxisView=new Pe.PanePriceAxisView(this._projectionPriceAxisView,this,e),this._labelPaneViews=[this._panePriceAxisView,this._projectionPanePriceAxisView],null!==this._historyPricePanePriceAxisView&&this._labelPaneViews.push(this._historyPricePanePriceAxisView),this._highLowAvgPaneViews=[],this._averagePaneViews=[],si&&this._createAverageViews(),this._createHighLowAvgViews(),this._subscribeRestartToSessionIdChange(),r.visible.subscribe(this,this._updateLastPriceAnimationActive),this._updateLastPriceAnimationActive(),r.minTick.subscribe(this,this._onFormatterPropsChanged),this._dataWindowView=new U(this,e),this._legendView=new q(this,e),this._statusView=new V(this,r.statusViewStyle),this._marketStatusModel=new K.MarketStatusModel(this._quotesProvider),this._dataUpdatedModeModel=ei?new re(this._symbolInfo.spawn().ownership(),this._seriesStatus.spawn().ownership(),(0,j.createWVFromGetterAndSubscription)((()=>this._lastCompleteFlags?.rt_update_period),o.completed()).ownership()):null,this._dataProblemModel=new le(this._quotesProvider,this._symbolInfo.spawn().ownership()),this._symbolResolvingActive.subscribe((()=>e.realignLineTools())),this._intervalChanged.subscribe(this,(()=>e.realignLineTools())),this._intervalChanged.subscribe(this,(()=>this._checkChartStyle())),this._studyBindings?.syncStudy(this.style()),this.createPaneView(),this._properties.addExcludedKey("visible",1),this._properties.addExcludedKey("currencyId",1),this._futureBarsPaneView=null,this._priceLineView=null,this._baseHorizontalLineView=new Yt(this);for(const[,e]of Object.entries(y.STYLE_SHORT_NAMES))this._properties.child(`${e}Style`)?.subscribe(this,(()=>this.invalidateBarStylesCache()));const h=r.renkoStyle.childs().inputs.childs();h.boxSize.subscribe(this,this.restart),h.style.subscribe(this,this.restart),h.atrLength.subscribe(this,this.restart),h.percentageLTP.subscribe(this,this.restart),h.wicks.subscribe(this,this.restart),h.sources.subscribe(this,this.restart),r.pbStyle.childs().inputs.childs().lb.subscribe(this,this.restart);const d=r.kagiStyle.childs().inputs.childs();d.reversalAmount.subscribe(this,this.restart),d.style.subscribe(this,this.restart),d.atrLength.subscribe(this,this.restart),d.percentageLTP.subscribe(this,this.restart);const u=r.pnfStyle.childs().inputs.childs();u.boxSize.subscribe(this,this.restart),u.reversalAmount.subscribe(this,this.restart),u.sources.subscribe(this,this.restart),u.style.subscribe(this,this.restart),u.atrLength.subscribe(this,this.restart),u.percentageLTP.subscribe(this,this.restart),u.oneStepBackBuilding.subscribe(this,this.restart),r.rangeStyle.childs().inputs.childs().phantomBars.subscribe(this,this.restart),this._isDWMProperty=new p.Property(this.isDWM()),this._onRestarted.subscribe(this,(()=>this._isDWMProperty.setValue(this.isDWM()))),r.showCountdown.subscribe(this,this._onShowCountdownChanged),this._onShowCountdownChanged(r.showCountdown),this._recreatePriceFormattingDependencies(),
r.lineStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.lineWithMarkersStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.steplineStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.areaStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.baselineStyle.childs().priceSource.subscribe(this,this._updateBarFunction),r.columnStyle.childs().priceSource.subscribe(this,this._updateBarFunction),this._updateBarFunction(),this._isInReplay=(0,Zt.combine)((e=>null!==e),this._replaySubscriber.weakReference()),this._legendValuesProvider=new $e(this,this.model()),this._dataWindowValuesProvider=new Ge.SeriesValuesProvider(this,this.model())}setId(e){super.setId(e),(0,Se.getPersistentLogger)()?.addPersistentLogEntry(`Set series Id to ${e}`,r.LOGLEVEL.INFO,"chart.series")}supportsPressedChunks(){return!0}pressedChunks(e,t){return this.data().pressedChunks(e,t)}seriesErrorMessage(){const{seriesStatus:e,additionalStudyStatus:t}=this._status.value();return this.isFailed()?this._seriesErrorMessage:y.seriesLoadingStatuses.has(e)?null:t?.type===Xt.StudyStatusType.Error?(0,Xt.convertStudyStatusToString)({type:Xt.StudyStatusType.Error,errorDescription:t.errorDescription},!0):null}destroy(){this._seriesStatus.destroy(),this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._quotesProvider.destroy(),this.clearGotoDateResult(),this._legendView.destroy(),this._marketStatusModel.destroy(),this._studyBindings&&this._studyBindings.destroy(),null!==this._dataUpdatedModeModel&&this._dataUpdatedModeModel.destroy(),this._dataProblemModel.destroy(),this._paneView&&this._paneView.destroy&&this._paneView.destroy(),this._seriesSource.destroy(),this._quotesProvider.quotesUpdate().unsubscribeAll(this),this._model.timeScale().visibleBarsStrictRangeChanged().unsubscribeAll(this),this._unsubscribeRestartToSessionIdChange(),this._paramsNotApplicableForReplay.destroy(),this._onTimeFrameApplied.destroy(),this._deferredDestroyed.resolve(),this._properties.destroy(),this._isInReplay.destroy(),super.destroy()}isActingAsSymbolSource(){return this._isActingAsSymbolSource.readonly()}barColorer(){if(this._barColorerCache)return this._barColorerCache;let e=null;const t=this._model.dataSources();for(let i=t.length-1;i>=0;i--){const n=t[i];if((0,jt.isStudy)(n)&&n.hasBarColorer()&&!n.isSourceHidden()){const t=(0,s.ensureNotNull)(n.barColorer());null===e?e=t:e.pushBackBarColorer(t)}}return null===e?e=new Ut.SeriesBarColorer(this):e.pushBackBarColorer(new Ut.SeriesBarColorer(this)),this._barColorerCache=e,e}createPaneView(){this._paneView=null,this._projectionBarsPaneView=null,this._waterlineView=null,this._priceLineView=this.hasClosePrice()?new xt(this):null;const e=this._properties.childs().style.value();switch(e){case 0:this._paneView=new Lt.SeriesBarsPaneView(this,this._model);break;case 17:case 19:case 1:this._paneView=new kt.SeriesCandlesPaneView(this,this._model,1===e||19===e?1:.2);break;case 2:case 18:case 14:case 15:this._paneView=new Dt.SeriesLinePaneView(this,this._model);break;case 3:
this._paneView=new Et.SeriesAreaPaneView(this,this._model);break;case 16:this._paneView=new Bt.SeriesHLCAreaPaneView(this,this._model);break;case 8:this._paneView=new Ft(this,this._model);break;case 9:this._paneView=new Wt.SeriesHollowCandlesPaneView(this,this._model);break;case 13:this._paneView=new At.SeriesColumnsPaneView(this,this._model);break;case 10:{this._paneView=new Ht.SeriesBaselinePaneView(this,this._model);const e=this._properties.childs().baselineStyle.childs();this._waterlineView=new It.SeriesWaterlinePaneView({paneHeight:()=>this.priceScale().height(),color:()=>e.baselineColor.value(),baseLevelPercentage:()=>e.baseLevelPercentage.value()});break}case 12:this._paneView=new Mt.SeriesHiLoPaneView(this,this._model)}if(null===this._paneView)throw Error("Unknown chart style assigned: "+e)}properties(){return this._properties}zorder(){return 0}quotesProvider(){return this._quotesProvider}currentSession(){return this._currentSession}syncModel(){if(!this._syncModel){const e=this.symbolInfo(),t=this.interval();if(!e||!t)return null;this._syncModel=new te(e,t)}return this._syncModel}labelPaneViews(){return this._labelPaneViews}topPaneViews(){const e=[];if(null!==this._gotoDateView&&e.push(this._gotoDateView),this._lastPriceAnimationActive){const t=this._lineStyleLastPriceCirclePaneView;t.animationActive()&&setTimeout((()=>this._model.invalidate(at.InvalidationMask.cursor())),0),t.invalidateStage(),e.push(t)}return 0!==e.length?e:null}paneViews(e){if(!this.properties().childs().visible.value()||!this._model.isSnapshot()&&!this._wasCompletedBefore())return null;const t=e===this._model.paneForSource(this),i=t?[(0,s.ensureNotNull)(this._baseHorizontalLineView),(0,s.ensureNotNull)(this._paneView)]:[];return i.push(...this._studyBindings?.paneViews(e)??[]),t&&(this._endOfDataPaneView&&i.push(this._endOfDataPaneView),this._futureBarsPaneView&&i.push(this._futureBarsPaneView),this._projectionBarsPaneView&&i.push(this._projectionBarsPaneView),null!==this._waterlineView&&i.push(this._waterlineView),null!==this._priceLineView&&i.push(this._priceLineView),window.TradingView.printing&&this._lastPriceAnimationActive&&(this._lineStyleLastPriceCirclePaneView.stopAnimation(),i.push(this._lineStyleLastPriceCirclePaneView)),i.push(...this._highLowAvgPaneViews),i.push(...this._averagePaneViews)),i}widgetSideAreaViews(e){return this._studyBindings?.widgetSideAreaViews(e)??null}priceAxisViews(e,t){return e.findTargetPriceAxisViews(this,t,this._priceAxisViews,this._priceLineAxisViews)}clearHighLowPriceCache(){this._highLowPriceCache.clear()}clearAveragePriceCache(){this._averagePriceCache.clear()}priceScale(){return(0,s.ensureNotNull)(this._priceScale)}setPriceScale(e){this._priceScale!==e&&(this._priceScaleAboutToBeChanged.fire(),this._priceScale=e,this._properties.removeProperty("priceAxisProperties"),this._properties.addChild("priceAxisProperties",e.properties()),this._properties.childs().priceAxisProperties.fireChanged(),(0,o.emit)("series_event","price_scale_changed"),this._priceScaleChanged.fire(e))}priceScaleChanged(){
return this._priceScaleChanged}priceScaleAboutToBeChanged(){return this._priceScaleAboutToBeChanged}applyPreferences(e){const t=(0,ae.clone)(e);this.priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),this.setChartStyleWithIntervalIfNeeded(t.style);const{style:i,interval:s,...n}=t;this._properties.mergePreferences(n),this._properties.saveDefaults(),this.createPaneView(),this.invalidateBarStylesCache()}disconnect(){this._studyBindings?.stop(),this._seriesSource.stop(),this._predictBars=0,this._updateStatus({...this._status.value(),seriesStatus:0}),this._model.isSnapshot()||this._symbolInfo.setValue(null)}isStarted(){return this._seriesSource.isStarted()}isCompleted(){return this._seriesCompleted}restart(e,t,i){if(5===this._status.value().seriesStatus)return;this._seriesLoaded=!1,this._seriesCompleted=!1,this._lastCompleteFlags=null,this._onRestarted.fire(),this._setStatus(1),this._updateSymbolInfo(null);const s=this._properties.childs().interval.value();Z.Interval.isEqual(s,this._prevRequestedInterval)&&this._notifyIntervalChanged(s);let n=null;this._pendingTimeRange&&(n=this._pendingTimeRange,this._pendingTimeRange=null),this._onBeforeModifySeries(this.getSymbolString(),s),this._onTimeFrameApplied.fire(n);const o=(0,Ct.getServerInterval)(s);this._data=null,this.model().recalcVisibleRangeStudies(c.RecalcVisibleRangeStudiesReason.SeriesRestart),this._seriesSource.modifySeries(this._getResolvingSymbolObject(),o,n),this._seriesSource.isStarted()||this._seriesSource.start(),this._prevRequestedInterval=this.interval(),this.updateAllViews((0,me.sourceChangeEvent)(this.id())),this._model.lightUpdate()}isSymbolInvalid(){return 4===this._status.value().seriesStatus}getSymbolString(){return(0,Xe.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject())}getAlertSymbolString(){return(0,Xe.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject(this.actualSymbol()))}invalidateBarStylesCache(e){ai.logDebug("Invalidate style cache starting from "+e),this._clearStylePlot(this.bars(),e),this._clearStylePlot(this.nsBars())}isLoading(){return y.seriesLoadingStatuses.has(this.statusWV().value())}isFailed(){const e=this.status();return 12===e||4===e||10===e||14===e}isStatusError(){return 12===this.status()}unsupportedResolutionState(){return this._unsupportedResolutionState.readonly()}actualSymbol(){return(0,m.actualSymbol)(this.symbolInfo(),this.symbol())}proSymbol(){return(0,m.proSymbol)(this.symbolInfo(),this.symbol())}onStyleChanged(){return this._onStyleChanged}style(){return this.properties().childs().style.value()}setStyle(e){this.setSymbolParams({style:e})}isRangeBasedStyle(){return(0,m.isRangeBasedStyle)(this.style())}symbolSameAsCurrent(e){return this.symbol()===e||(0,Ze.symbolSameAsCurrent)(e,this.symbolInfo())}symbolSameAsResolved(e){return this._model.isSnapshot()?this.symbolSameAsCurrent(e):this._seriesSource.symbolSameAsResolved(e)}status(){return this._seriesStatus.value()
}statusWV(){return this._seriesStatus}compositeStatusVW(){return this._status}symbol(){return this.properties().childs().symbol.value()}symbolChanged(){return this.properties().childs().symbol}seriesSource(){return this._seriesSource}symbolInfo(){return this._symbolInfo.value()}symbolResolved(){return this.dataEvents().symbolResolved()}symbolResolvingActive(){return this._symbolResolvingActive}symbolHibernated(){return this._seriesAlwaysFalseHibernatedVW}getSymbolName(){return this.symbolInfo()?.name??""}firstValue(){const e=this.firstBar();return null===e?null:this._barFunction(e,0)}firstBar(){const e=this.model().timeScale().visibleBarsStrictRange();if(null===e)return null;const t=e.firstBar(),i=this.data().search(t,u.PlotRowSearchMode.NearestRight);return null!==i?i.value:null}formatter(e=!0){return e?this._formatter:this._ignoreMinMoveFormatter}defaultFormatter(){return this._defaultFormatter}priceStep(e=!0){return e?this._priceStep:this._ignoreMinMovePriceStep}bars(){return this.data().bars()}nsBars(){return this.data().nsBars()}interval(){return this.properties().childs().interval.value()}setInterval(e){this.setSymbolParams({interval:e})}intervalObj(){const e=this.interval();if(null!==this._intervalObj&&this._intervalObj.resolutionString===e)return this._intervalObj.interval;const t=Z.Interval.parse(e);return this._intervalObj={resolutionString:e,interval:t},t}prevClose(){const e=this.priceScale();if(e.isEmpty()||this.data().isEmpty())return null;const t=this.quotes(),i=this.firstValue();if(null===t||null===i)return null;const s=t.prev_close_price;return void 0===s?null:{coordinate:e.priceToCoordinate(s,i),floatCoordinate:e.priceToCoordinate(s,i),formattedPricePercentage:e.formatPricePercentage(s,i,{signPositive:!0}),formattedPriceAbsolute:e.formatPriceAbsolute(s),formattedPriceIndexedTo100:e.formatPriceIndexedTo100(s,i)}}priceLineColor(e){return this.properties().childs().priceLineColor.value()||e}hasClosePrice(){return ri||12!==this.properties().childs().style.value()}lastValueData(e,t,i){const s={noData:!0},n=this.priceScale();if(this.model().timeScale().isEmpty()||n.isEmpty()||this.data().isEmpty())return s;const o=this.model().timeScale().visibleBarsStrictRange(),r=this.firstValue();if(null===o||null===r)return s;let a,l;if(t){const e=this.data().bars().last();if(null===e)return s;a=e.value,l=e.index}else{const e=this.data().bars().search(o.lastBar(),u.PlotRowSearchMode.NearestLeft);if(null===e)return s;a=e.value,l=e.index}const c=(void 0!==e?a[e]:this._barFunction(a,2))??NaN,h=this.barColorer().barStyle(l,!1),d=n.priceToCoordinate(c,r),_={...n.getFormattedValues(c,r,!0),noData:!1,color:h.barColor,floatCoordinate:d,coordinate:d,index:l};return i&&(_.price=c),_}isDWM(){return this.intervalObj().isDWM()}isPulse(){const e=this.symbolInfo();return null!==e&&(e.resolutions??[]).length>0}data(){return this._data??this._seriesSource.data()}clearData(){(0,s.assert)(null===this._data,"Cannot clear loaded data"),this._studyBindings?.clearData(),this._seriesSource.clearData()}nearestData(e,t){
return this.data().search(e,t)??void 0}nearestIndex(e,t){return this.nearestData(e,t)?.index}nearestValue(e,t,i){const s=this.nearestData(e,i);return s?.value[t]??void 0}onSymbolIntervalChanged(){return this._symbolIntervalChanged}onIntervalChanged(){return this._intervalChanged}onStatusChanged(){return this._onStatusChanged}onRestarted(){return this._onRestarted}fixLastBar(e){0}requestMoreData(e){if(!y.seriesReadyStatuses.has(this._status.value().seriesStatus))return;if(this._model.timeScale().isEmpty())return;const t=this._model.timeScale().visibleBarsStrictRange();if(null===t)return;if(0===this.bars().size())return;const i=t.lastBar()-(0,s.ensureNotNull)(this.data().last()).index;if(this._predictBarse.isVisible())),o=(e,t)=>void 0===e?t:void 0===t?e:Math.max(e,t),r=n.map((s=>s.autoScaleInfo(e,t,{...i,forceOverlayOnly:!0})))
;this._studyBindings&&r.push(...this._studyBindings.autoScaleInfos(e,t,i));const a=(e,t)=>({range:e.range?t.range?e.range.merge(t.range):e.range:t.range,topPixelMargin:o(e.topPixelMargin,t.topPixelMargin),bottomPixelMargin:o(e.bottomPixelMargin,t.bottomPixelMargin)});s=r.reduce(a,s)}return s}onChartStyleChanged(){this._updateBarFunction(),this.isNeedRestart()&&(this.data().clear(),this._saveLeftEdgeIfRequired(!1)||this.model().timeScale().scrollToRealtime(!1),this.restart());const e=this.properties();this._prevChartStyle!==e.childs().style.value()&&this._studyBindings?.syncStudy(this.style()),this._prevChartStyle=e.childs().style.value(),this._onStyleChanged.fire(e.childs().style.value()),this.invalidateBarStylesCache(),this._updateLastPriceAnimationActive(),this._styleToRecover?.originalStyle!==this.style()&&(this._styleToRecover=null),this._updateTimeScaleTimePointWeights()}setChartStyleWithIntervalIfNeeded(e,t){const i=this.interval(),s=t??(0,wt.getResolutionByChartStyle)(e,i,this._model.defaultResolutions()),n=Z.Interval.isEqual(s,i);this.setSymbolParams({interval:n?void 0:s,style:e})}getInputsProperties(){const e=this._properties.child(`${this.getStyleShortName()}Style`);return e?.childs().inputs??new p.Property}getInputsInfoProperties(){const e=this._studyBindings?.getInputsInfoProperties();if(e)return e;const t=this._properties.child(`${this.getStyleShortName()}Style`);return t?.childs().inputInfo??new p.Property}getSourceIcon(){return{type:"loadSvg",svgId:`series.${this.style()}`}}onSourceIconChanged(){return this._onStyleChanged}purgeSymbolInfo(){this._symbolInfo.setValue(null)}idForAlert(){return super.idForAlert()}hasStateForAlert(){return!1}stateForAlert(){throw new Error("Not implemented")}styleStudyInfos(){return{haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle,volFootprintStyle:this._volFootprintStyle,tpoStyle:this._tpoStyle,svpStyle:this._svpStyle}}dataEvents(){return this._seriesSource.dataEvents()}isSpread(){return"spread"===this.symbolInfo()?.type}isYield(){const e=this.symbolInfo();return null!==e&&(0,qt.isYield)(e)}dividendsAdjustmentProperty(){return null}sessionIdProxyProperty(){return this._sessionIdProxyProperty}symbolTextSourceProxyProperty(){return this._symbolTextSourceProxyProperty}setTextSourceIsAlwaysTickerRestrictionEnabled(e){this._textSourceIsAlwaysTickerRestrictionEnabled=e,this._recalcSymbolTextSourceProxyProperty()}isDWMProperty(){return this._isDWMProperty}isPrePostMarketPricesAvailableProperty(){return this._isPrePostMarketPricesAvailableProperty}isSettlementAsCloseForbiddenProperty(){return this._isSettlementAsCloseForbiddenProperty}isBackAdjustmentForbiddenProperty(){return this._isBackAdjustmentForbiddenProperty}getStyleShortName(){const e=this.style(),t=y.STYLE_SHORT_NAMES[e];return(0,s.assert)(!!t,`Missed short name for style ${e}`),t}invalidateBarColorerCache(){this._barColorerCache=null,this.invalidateBarStylesCache()}paramsNotApplicableForReplay(){
throw new Error("Not implemented")}onTimeFrameApplied(){return this._onTimeFrameApplied}onInReplayStateChanged(){throw new Error("Not implemented")}onReplayModified(){throw new Error("Not implemented")}dataWindowView(){return this._dataWindowView}statusView(){return ti?this._statusView:null}legendView(){return this._legendView}marketStatusModel(){return this._marketStatusModel}isMainSeries(){return!0}dataUpdatedModeModel(){return this._dataUpdatedModeModel}dataProblemModel(){return this._dataProblemModel}setDefaultTimeframe(e){this._pendingTimeRange=e}loadDataTo(e){const t=this._properties.childs().interval.value();this._onTimeFrameApplied.fire(e),this._seriesSource.modifySeries(this._getResolvingSymbolObject(),(0,Ct.getServerInterval)(t),e)}isInReplay(){return this._isInReplay}quotes(){return this.data().isEmpty()?null:this._quotesProvider.quotes()}base(){return this._base}pointValue(){return this._pointValue}barCloseTime(){return this._lastBarCloseTime}priceSource(){let e=null;const t=this._properties.childs();switch(t.style.value()){case 2:e=t.lineStyle.childs().priceSource.value();break;case 18:e=t.tpoStyle.childs().priceSource.value();break;case 14:e=t.lineWithMarkersStyle.childs().priceSource.value();break;case 15:e=t.steplineStyle.childs().priceSource.value();break;case 3:e=t.areaStyle.childs().priceSource.value();break;case 10:e=t.baselineStyle.childs().priceSource.value();break;case 13:e=t.columnStyle.childs().priceSource.value()}return e}lineColorAtYPercentFromTop(e){let t;switch(this.style()){case 2:t=this.properties().childs().lineStyle.childs();break;case 14:t=this.properties().childs().lineWithMarkersStyle.childs();break;case 15:t=this.properties().childs().steplineStyle.childs();break;default:t=null}return t?t.colorType?.value()===Jt.ColorType.Solid?t.color.value():this._lineColorAtYPercentFromTop.gradientColor((0,s.ensureDefined)(t.gradientStartColor).value(),(0,s.ensureDefined)(t.gradientEndColor).value(),e):null}updateAllViews(e){if("hover-change"===e.type)return;this._paneView?.update(e),this._dataWindowView.update(),this._legendView.update(),this._statusView.update(),this._averagePaneViews.forEach((t=>t.update(e))),this._highLowAvgPaneViews.forEach((t=>t.update(e))),this._labelPaneViews.forEach((t=>t.update(e))),this._priceAxisViews.forEach((t=>t.update(e))),this._priceLineAxisViews.forEach((t=>t.update(e))),this._futureBarsPaneView?.update(e),this._projectionBarsPaneView?.update(e),this._waterlineView?.update(e),this._priceLineView?.update(e),this._gotoDateView?.update(e),this._endOfDataPaneView?.update(e),this._baseHorizontalLineView?.update(e);const t=this._model.activeStrategySource().value();t?.updateAllViews(e),this._model.replayStudyStrategy().value()?.updateAllViews(e),this._lineStyleLastPriceCirclePaneView.update(e),this._studyBindings?.updateAllViews(e)}styleStudyInfo(e){return this.styleStudyInfos()[e]}barFunction(){return this._barFunction}precomputedBarStyle(e){return this._precomputedBarStyles.get(e)}setPrecomputedBarStyle(e,t){this._precomputedBarStyles.set(e,t)}symbolParams(){
return(0,Ze.symbolParams)(this)}compareSymbolParams(e){return(0,Ze.compareSymbolParams)(this,e,this._model.unitConversionEnabled())}setSymbolParams(e){const{symbol:t,currency:i,unit:n,style:o,interval:r}=e,{symbolChanged:a,intervalChanged:l,currencyChanged:c,unitChanged:h,styleChanged:d}=this.compareSymbolParams(e),u=[hi("symbol",t,a),hi("interval",r,l),hi("currency",i,c),hi("unit",n,h),hi("style",o,d)].filter((e=>null!==e)).join("; ");ai.logInfo(`Applying series symbol params: ${u}`);const _=this.properties().childs();void 0!==t&&_.symbol.setValue(t),void 0!==i&&_.currencyId.setValue(i),void 0!==n&&_.unitId.setValue(n),l&&_.interval.setValue((0,s.ensureDefined)(r)),void 0!==o&&d&&_.style.setValue(o);let p=!1;d&&(p=this.isNeedRestart(),this.onChartStyleChanged());let m=Promise.resolve();return!p&&(a||l||c||h)&&(m=this._applySymbolParamsChanges({symbolChanged:a,currencyChanged:c,unitChanged:h,intervalChanged:l,styleChanged:d})),(a||c||h)&&this.model().checkLineToolSelection(),m}setSymbol(e){this.setSymbolParams({symbol:e})}currency(){return this.properties().childs().currencyId.value()||null}setCurrency(e){this.setSymbolParams({currency:e})}isConvertedToOtherCurrency(){return(0,m.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this.properties().childs().unitId.value()||null}setUnit(e){this.setSymbolParams({unit:e})}measureUnitId(){return(0,m.measureUnitId)(this.symbolInfo())}isConvertedToOtherUnit(){return(0,m.isConvertedToOtherUnit)(this.symbolInfo(),this._model.unitConversionEnabled())}valueAt(e,t){return this.data().search(e)?.value[t]??null}symbolSource(){return this}barsProvider(){return this}title(e){return this.symbolTitle(e)}name(){return this.symbolTitle($t.TitleDisplayTarget.StatusLine)}symbolTitle(e,t,i,s="exchange"){let n=this.properties().childs().symbol.value();const o=this.symbolInfo();if(null!==o){const{type:e}=o;n=(0,m.symbolTitle)(o,t,"forex"===e?"exchange":s)}return i?n:`${n}, ${(0,P.translatedIntervalString)(this.properties().childs().interval.value())}`}setObsoleteZOrder(e){this._obsoleteZOrder=e}obsoleteZOrder(){return this._obsoleteZOrder}legendValuesProvider(){return this._legendValuesProvider}dataWindowValuesProvider(){return this._dataWindowValuesProvider}statusProvider(e){return new D(this,this.properties().childs().statusViewStyle,e)}moveItem(e,t,i){if(10===this.style()&&0===t){const t=this.priceScale(),i=this.properties().childs().baselineStyle,s=t.height(),n=100-e.y/s*100,o=n<0?0:Math.round(10*n)/10;i.childs().baseLevelPercentage.setValue(Math.max(Math.min(o,100),0))}}rerequestData(){this._applySymbolParamsChanges({force:!0})}switchToReplay(e,t){throw new Error("Not implemented")}switchToRealtime(){throw new Error("Not implemented")}async canChangeResolution(e){return!0}async canChangeSymbol(e){return{result:!0}}requestMoreDataAvailable(){return this._requestMoreDataAvailable}seriesLoaded(){return this._seriesLoaded}endOfData(){return void 0!==this._lastCompleteFlags?.data_completed}endOfDataType(){return this._lastCompleteFlags?.data_completed??null}dataPoweredBy(){
return null}boxSizeValue(){return this._boxSizeValue}isUserDeletable(){return!1}changeTimeFrame(){(0,n.trackEvent)("GUI","Change timeframe")}onTagsChanged(){return this._tagsChanged}state(e){const t=this.obsoleteZOrder();let i={type:"MainSeries",id:this.id(),zorder:t,haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle,rangeStyle:this._rangeStyle,volFootprintStyle:this._volFootprintStyle,tpoStyle:this._tpoStyle,svpStyle:this._svpStyle,formattingDeps:this._formattingDeps,studyBindings:this._studyBindings?.state(!!e)};const s=this.properties().state(void 0,2);if(s.symbol=(0,m.symbolToSaveInState)(this.symbolInfo()??this._model.chartApi().lastSymbolResolveInfo(s.symbol),s.symbol),this._model.unitConversionEnabled()||(s.unitId=null),i.state=s,e){let e=this.bars();const t=this._model.timeScale().visibleExtendedDataRange(e,0);null!==t&&(e=e.range(t.firstBar(),t.lastBar())),i={...i,bars:di(e),nsBars:di(this.nsBars()),symbolInfo:this.symbolInfo(),rtPrice:this.data().lastProjectionPrice,boxSize:this.data().boxSize,reversalAmount:this.data().reversalAmount}}return i}restoreState(e,t){t&&this._setStatus(5),!this._model.unitConversionEnabled()&&e.state&&delete e.state.unitId,e.state&&Z.Interval.isRange(e.state.interval)&&(e.state.style=11);const i=e.state;if(void 0!==i){const e=i.style,t=void 0;t&&!this._model.isSnapshot()&&(i.style=2,runOrGoProWithoutSync((()=>{i.style=e}),t.feature,{feature:t.featureName}))}if(this._properties.mergeAndFire(e.state),this._prevChartStyle=this.properties().childs().style.value(),this.createPaneView(),t){const t=e;this.restoreData(t.bars,t.nsBars,t.symbolInfo,t.rtPrice,t.boxSize,t.reversalAmount)}e.formattingDeps&&(this._formattingDeps=e.formattingDeps,this._recreatePriceFormattingDependencies()),this._studyBindings?.restoreState(e.studyBindings??{},t),this._studyBindings?.syncStudy(this.style())}restoreData(e,t,i,s,n,o){this._updateStatus({seriesStatus:5}),this._data=new h.SeriesData,this._data.bars().restoreState(e),this._data.nsBars().restoreState(t),this._updateSymbolInfo(i),this._data.lastProjectionPrice=s,this._data.boxSize=n;const r=this.properties().childs();n||(6===r.style.value()?this._data.boxSize=r.pnfStyle.childs().inputs.childs().boxSize.value():4===r.style.value()&&(this._data.boxSize=r.renkoStyle.childs().inputs.childs().boxSize.value())),this._data.reversalAmount=o,o||5===r.style.value()&&(this._data.reversalAmount=r.kagiStyle.childs().inputs.childs().reversalAmount.value())}async setGotoDateResult(e,t){this._gotoDateResultCleared=!1;const s=await Promise.all([i.e(6778),i.e(4079)]).then(i.bind(i,40481));this._gotoDateResultCleared||(this._gotoDateView=new s.GotoDateView(this,e,t),this._gotoDateView.doNotShowLastAvailableBar(this._doNotShowLastAvailableBar),this._model.updateSource(this))}clearGotoDateResult(){this._gotoDateView=null,this._gotoDateResultCleared=!0}doNotShowLastAvailableBar(e){this._doNotShowLastAvailableBar=e,this._gotoDateView?.doNotShowLastAvailableBar(e)}dataUpdated(){
return this.dataEvents().dataUpdated()}moveData(e){this._seriesSource.moveData(e),null!==this._volumePointWeights&&this._volumePointWeights.moveData(e)}async seriesCreated(){const e=this._seriesSource.instanceId();if(null!==e)return e;const t=await Promise.race([this._deferredDestroyed.promise.then((()=>{})),this._model.isSnapshot()?Promise.resolve(null):new Promise((e=>{this.dataEvents().created().subscribe(this,e,!0)}))]);if(void 0===t)throw new Error("Series has been destroyed");return t}activeStudyBinding(){return this._studyBindings?.activeStudy()??null}_updateBarFunction(){this._barFunction=(0,zt.barFunctionByStyle)(this.style(),this.priceSource())}_setProperties(e){e.hasChild("timeframe")||e.merge({timeframe:""}),e.hasChild("shortName")||e.merge({shortName:""}),e.hasChild("currencyId")||e.addChild("currencyId",new p.Property(null)),e.hasChild("unitId")||e.addChild("unitId",new p.Property(null)),this._properties=e;const t=e.childs();t.currencyId.subscribe(this,this._onCurrencyChanged),t.unitId.subscribe(this,this._onUnitChanged),t.timeframe.subscribe(this,this.changeTimeFrame),e.subscribe(this,this._onPropertiesChanged)}_updateSessionIdProxyProperty(e){const t=this._properties.childs().sessionId.value();let i=t;if(e){const e=this.symbolInfo();null!==e&&(i=e.subsession_id||t)}this._ignoreSessionIdProxyPropertyChanges=!0,this._sessionIdProxyProperty.setValue(i),this._ignoreSessionIdProxyPropertyChanges=!1}_onSessionIdProxyPropertyChanged(){this._ignoreSessionIdProxyPropertyChanges||this._properties.childs().sessionId.setValue(this._sessionIdProxyProperty.value()),this._updateLastPriceAnimationActive()}_onSymbolResolved(e){this._seriesErrorMessage=null,this._updateSymbolInfo(e),this._model.updateSource(this),this._model.onWidget()||((0,n.trackEvent)("Symbol",e.listed_exchange,e.name),(0,n.trackEvent)("Symbol Type",e.type,e.listed_exchange));const t=e.minmov/e.pricescale,i=this.properties().childs();4===i.style.value()&&i.renkoStyle.childs().inputs.childs().boxSize.value(){e[t]=i[t].toString()})),t=t.format(e)}oi&&ai.logNormal("Error reason: "+t),this._seriesErrorMessage=t;const s="unknown_symbol"!==t?12:ni&&this.symbolInfo()?10:4;this._setStatus(s),this._seriesLoaded=!0,this._enablePriceRangeReady()}_onSeriesLoading(e){this._setStatus(2)}_onDataUpdated(e,t,i,n){this.symbolInfo();if(null!==this._volumePointWeights){const e=t?this.bars().fullRangeIterator():i?this.bars().rangeIterator(i.index,(0,s.ensureNotNull)(this.bars().lastIndex())):null;if(null!==e)for(const t of e)this._volumePointWeights.setVolume(t.index,t.value[5])}t?this._requestMoreDataAvailable=!0:this._lastPriceAnimationActive&&this._seriesLoaded&&this._lineStyleLastPriceCirclePaneView.update((0,me.sourceChangeEvent)(this.id())),this._lastBarCloseTime=e&&e.closeTime||null,this._boxSizeValue.setValue(this.data().boxSize),this._statusView.update(),this.clearAveragePriceCache(),this.clearHighLowPriceCache();const o=this.model(),r=(0,s.ensureNotNull)(o.paneForSource(this));o.recalculatePane(r,(0,me.sourceChangeEvent)({sourceId:this.id(),realtime:!t,firstUpdatedTimePointIndex:i?.index??void 0})),o.updateSource(this)}_setStatus(e){const t={...this._status.value(),seriesStatus:e};this._updateStatus(t),this._statusView.update(),this.model().updateSource(this),this._onStatusChanged.fire()}_onBarReceived(e){this.model().recalcVisibleRangeStudies(c.RecalcVisibleRangeStudiesReason.DataUpdate)}_onUnsupportedResolutionRequested(){const e=(0,s.ensureNotNull)(this._getStateForUnsupportedResolution());this._seriesErrorMessage=e.reason,this._unsupportedResolutionState.setValue(e),this._setStatus(14),this._seriesLoaded=!0,this._seriesSource.clearData(),this._model.timeScale().points().clear(),this._enablePriceRangeReady()}_getStateForUnsupportedResolution(){const e=this.symbolInfo();if(null===e)return null;const t=this.interval(),i=(0,I.getResolutionUnsupportedReason)(e,t);if(null===i)return null;const n=e.name;if("less_than_frequency"!==i){let s=["D","W","M"];return s=e.supported_resolutions,{ticker:n,reason:i,unsupportedResolution:t,applicableResolution:s[0],supportedResolutions:s}}{const o=(0,s.ensureDefined)(e.data_frequency);let r=(0,wt.getApplicableIntervalForFrequency)(o,t);this._model.defaultResolutions();return{ticker:n,reason:i,applicableResolution:r,unsupportedResolution:t,supportedResolutions:[]}}}_recreateFormatter(){let e=null;e=Gt.customFormatters?.priceFormatterFactory?.(this.symbolInfo(),this.properties().childs().minTick.value())??null,null!==e?(this._formatter=e,this._ignoreMinMoveFormatter=e):(this._defaultFormatter=(0,m.createSeriesFormatter)(this.symbolInfo()??this._formattingDeps,"default"),this._formatter=(0,
m.createSeriesFormatter)(this.symbolInfo()??this._formattingDeps,this.properties().childs().minTick.value()),this._ignoreMinMoveFormatter=(0,m.createSeriesFormatter)(this.symbolInfo(),this.properties().childs().minTick.value(),!0)),this._priceScale?.updateFormatter(),this._formatterChanged.fire()}_recreatePriceStep(){const{minMove:e,priceScale:t}=(0,m.getSeriesPriceFormattingState)(this.symbolInfo()),i=e/t;this._ignoreMinMovePriceStep=1/t,this._priceStep!==i&&(this._priceStep=i,this._priceStepChanged.fire())}_recreatePriceFormattingDependencies(){this._recreateFormatter(),this._recreatePriceStep()}_onQuotesUpdate(e,t){void 0!==e.values.current_session&&e.values.current_session!==this._currentSession&&(this._currentSession=e.values.current_session,this._updateLastPriceAnimationActive())}_updateIsPrePostMarketPricesForbiddenProperty(){const e=this.symbolInfo(),t=(0,m.symbolHasPreOrPostMarket)(e)&&(this.isDWM()||!!e&&(0,m.isRegularSessionId)(this.sessionIdProxyProperty().value(),e));this._isPrePostMarketPricesAvailableProperty.setValue(t)}_updateSettlementAsCloseForbiddenProperty(){}_updateBackAdjustmentForbiddenProperty(){}_removeReplaySubscriber(){throw new Error("Not implemented")}_getSymbolForApi(){return this.symbol()}_getSymbolObject(e){const t=this._getExtendedSymbolObject(e),i=this.properties().childs().style.value();if(y.SYMBOL_STRING_DATA.hasOwnProperty(i)&&!y.chartStylesWithAttachedStudies.includes(i)){return{symbol:t,type:this.styleStudyInfo(this.getStyleShortName()+"Style").studyId+"!",inputs:this.getInputsProperties().state()}}return t}_getExtendedSymbolObject(e){const t={symbol:e??this._getSymbolForApi()},i=this.properties().childs();null!==this.currency()&&(t["currency-id"]=this.currency());const s=this.unit();return this._model.unitConversionEnabled()&&null!==s&&(t["unit-id"]=s),!this.isDWM()&&li&&(t.session=i.sessionId.value()),t}_checkChartStyle(){const e=this.style();(0,m.isCloseBasedSymbol)(this.symbolInfo())||this.intervalObj().is1Tick()?(0,m.isSingleValueBasedStyle)(e)||(this.requestingStyleIsNotSupported.fire(),this._styleToRecover={correctedStyle:this.style(),originalStyle:e}):null!==this._styleToRecover&&(this.requestingStyleSupportRecovered.fire(this._styleToRecover.originalStyle),this._styleToRecover=null)}_updateSymbolInfo(e){if(this._symbolInfo.setValue(e),e){const t=this._properties.childs();t.shortName.setValue(e.name);const i=(0,m.extractSymbolNameFromSymbolInfo)(e,this.symbol());i&&t.symbol.setValue(i);const s=(0,m.symbolCurrency)(e),n=(0,m.symbolUnit)(e,this._model.unitConversionEnabled());"alwaysOff"===(0,Y.currencyUnitVisibilityProperty)().value()||s===t.currencyId.value()&&n===t.unitId.value()||this._model.fullUpdate(),t.currencyId.setValue(s),t.unitId.setValue(n),this._updateSessionIdProxyProperty(!0)}this._base=e?e.pricescale/e.minmov:100,this._pointValue=e&&e.pointvalue||1;const t=(0,Xe.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getExtendedSymbolObject());this._quotesProvider.setQuotesSessionSymbol(t),this._marketStatusModel.setSymbolInfo(e),
e&&this._recreatePriceFormattingDependencies(),this._statusView.update(),this.priceScale().updateFormatter(),this._symbolResolvingActive.setValue(!e),li&&this._updateIsPrePostMarketPricesForbiddenProperty()}_createHighLowAvgViews(){const e=this.properties().childs().highLowAvgPrice,t=this._getHighLowPrice.bind(this),i=function(e,t,i,s){const n=i.childs(),o=Re(e,t,{label:Be,labelVisible:n.highLowPriceLabelsVisible,lineVisible:n.highLowPriceLinesVisible,lineColor:n.highLowPriceLinesColor,lineWidth:n.highLowPriceLinesWidth},(()=>s(0))),r=Re(e,t,{label:Ve,labelVisible:n.highLowPriceLabelsVisible,lineVisible:n.highLowPriceLinesVisible,lineColor:n.highLowPriceLinesColor,lineWidth:n.highLowPriceLinesWidth},(()=>s(1)));return{paneViews:[o.paneView,r.paneView],panePriceAxisViews:[o.panePriceAxisView,r.panePriceAxisView],priceAxisViews:[o.priceAxisView,r.priceAxisView],priceLineAxisViews:[o.priceLineAxisView,r.priceLineAxisView]}}(this._model,this,e,t);this._highLowAvgPaneViews.push(...i.paneViews),this._labelPaneViews.push(...i.panePriceAxisViews),this._priceAxisViews.push(...i.priceAxisViews),this._priceLineAxisViews.push(...i.priceLineAxisViews)}_createAverageViews(){const e=this.properties().childs().highLowAvgPrice,t=this._getAveragePrice.bind(this),i=je(this._model,this,e,t);this._averagePaneViews.push(...i.paneViews),this._labelPaneViews.push(...i.panePriceAxisViews),this._priceAxisViews.push(...i.priceAxisViews),this._priceLineAxisViews.push(...i.priceLineAxisViews)}_getHighLowPrice(e){if(!this._highLowPriceCache.has(e)){const e=this._model.timeScale().visibleBarsStrictRange();if(null===e)return null;const t=function(e,t,i){return e.minMaxOnRangeCached(t,i,[{name:"low",offset:0},{name:"high",offset:0}])}(this._model.mainSeries().bars(),e.firstBar(),e.lastBar());if(null===t)return null;this._highLowPriceCache.set(1,t.min),this._highLowPriceCache.set(0,t.max)}return this._highLowPriceCache.get(e)}_getAveragePrice(e){if(!this._averagePriceCache.has(e)){const e=this._model.timeScale().visibleBarsStrictRange();if(null===e)return null;const t=function(e,t,i){0;const s=(0,h.barFunction)("close");let n=0,o=0;for(let r=t;r<=i;r++){const t=e.valueAt(r);null!==t&&(n+=s(t),o++)}return o?n/o:null}(this._model.mainSeries().bars(),e.firstBar(),e.lastBar());if(null===t)return null;this._averagePriceCache.set(0,t)}return this._averagePriceCache.get(e)}_updateCompleteStatusMode(e){switch(e="pulsed"===e?"delayed":e){case"streaming":this._setStatus(3);break;case"endofday":this._setStatus(6);break;case"delayed":this._setStatus(8);break;case"replay":this._setStatus(11)}e.match(/delayed_streaming/)&&this._setStatus(9)}_onSeriesCompleted(e){if(14===this._status.value().seriesStatus)return;this._seriesErrorMessage=null,this._updateCompleteStatusMode(e.updateMode),this._lastCompleteFlags=e.flags??null;const t=(0,s.ensureNotNull)(this._model.paneForSource(this));t.recalculatePriceScale(this.priceScale(),(0,me.sourceChangeEvent)(this.id()));const i=at.InvalidationMask.full()
;if(null!==this._model.appliedTimeFrame().value()&&i.lockVisibleTimeRangeOnResize(),this._model.invalidate(i),!this.priceScale().isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale().correctOffset(),this.model().timeScale().correctBarSpacing(),this.model().resetPriceScale(t,this.priceScale())),this._seriesLoaded=!0,this._seriesCompleted=!0,this.model().recalcVisibleRangeStudies(c.RecalcVisibleRangeStudiesReason.SeriesCompleted),this.model().recalcStudyBasedLineTools(),null!==this._savedLeftEdge&&2!==this._status.value().seriesStatus){const e=1e3*this._savedLeftEdge,t=this._pendingScrollToLeftEdge;setTimeout((()=>{this._model.syncTimeWithModel((0,s.ensureNotNull)(this.syncModel()).syncSourceTarget(),e,{targetPointAlignment:"left",alignIfTargetPointIsVisible:!0,autoscaleAfterScroll:!1}).then((()=>{t?.resolve()})).catch((()=>{}))}),0),this._savedLeftEdge=null,this._pendingScrollToLeftEdge=null}this._enablePriceRangeReady()}_notifyIntervalChanged(e){const t={timeframe:this._pendingTimeRange??void 0};this._intervalChanged.fire(e,t),this._pendingTimeRange=t.timeframe??null}_onCurrencyChanged(){this._currencyChanged.fire()}_onUnitChanged(){this._unitChanged.fire()}_saveLeftEdgeIfRequired(e,t=null){if(this._savedLeftEdge=null,!t&&!e&&this._model.properties().childs().scalesProperties.childs().saveLeftEdge.value()){const e=this._model.timeScale();if(!e.isEmpty()){let t=e.visibleBarsStrictRange()?.firstBar();if(void 0!==t){const i=this._seriesSource.data()?.bars().first();return null!=i&&(t=Math.max(t,i.index)),this._savedLeftEdge=e.indexToTimePoint(t),this._pendingScrollToLeftEdge=(0,a.createDeferredPromise)(),!0}}}return!1}async _processReplayOnApplySymbolParamsChanges(e,t){}async _applySymbolParamsChanges(e){this._lastCompleteFlags=null,this.clearGotoDateResult();const t=this.interval();this.currency(),this.unit();Z.Interval.isRange(t)&&this._properties.childs().rangeStyle.childs().inputs.childs().range.setValue(Z.Interval.parse(t).multiplier());const{symbolChanged:i,intervalChanged:s,currencyChanged:n,unitChanged:o,force:r}=e,a=li&&s&&Z.Interval.parse(t).isDWM()!=Z.Interval.parse(t).isDWM();if(this._syncModel=null,this._prevRequestedInterval=t,5!==this._status.value().seriesStatus&&(!this._seriesSource.isStarted()||i||n||o||a)&&this._updateSymbolInfo(null),this._processReplayOnApplySymbolParamsChanges(!!s,t),5===this._status.value().seriesStatus)return void this._model.realignLineTools();this._setStatus(1),li&&this._updateIsPrePostMarketPricesForbiddenProperty(),this._symbolIntervalChanged.fire(),s&&this._notifyIntervalChanged(t),this._onRestarted.fire(),this._seriesLoaded=!1,this._seriesCompleted=!1,this._lineStyleLastPriceCirclePaneView.stopAnimation();let l=null;this._pendingTimeRange&&(l=this._pendingTimeRange,this._pendingTimeRange=null),this._onTimeFrameApplied.fire(l),this._onBeforeModifySeries(this.getSymbolString(),t);const h=this._shouldDefineNumberOfBarsForModifySeries(e)&&this._visibleBarsCount()||null
;this.model().recalcVisibleRangeStudies(c.RecalcVisibleRangeStudiesReason.SeriesRestart),this._saveLeftEdgeIfRequired(!!i,l),this._data=null,this._seriesSource.modifySeries(this._getResolvingSymbolObject(),(0,Ct.getServerInterval)(t),l,r,h),this._seriesSource.isStarted()||(this._predictBars=0,this._seriesSource.start()),(i||n||o)&&this.disablePriceRangeReady(),this.updateAllViews((0,me.sourceChangeEvent)(this.id())),this._model.lightUpdate(),this._pendingScrollToLeftEdge&&await this._pendingScrollToLeftEdge.promise}async _onBeforeModifySeries(e,t){const i=null;i?.modifySeries(e,t)}_getResolvingSymbolObject(){let e=this._getSymbolObject(this._symbolForResolve());const t=null;return t&&(e=t.generateReplaySymbol(e)),e}_onSessionIdPropertyChanged(){this._sessionIdChanged.fire(),this.isDWM()||(this._saveLeftEdgeIfRequired(!1),this.restart(this._properties.childs().sessionId,"sessionId",!0),this._updateLastPriceAnimationActive())}_subscribeRestartToSessionIdChange(){this.properties().childs().sessionId.subscribe(this,this._onSessionIdPropertyChangedBound)}_unsubscribeRestartToSessionIdChange(){this.properties().childs().sessionId.unsubscribe(this,this._onSessionIdPropertyChangedBound)}_updateLastPriceAnimationActive(){if(!this._options.lastPriceAnimationEnabled||b.enabled("disable_pulse_animation"))return;const e=this._lastPriceAnimationActive,t=this.properties().childs(),i=t.style.value(),s=3===i||10===i||2===i||14===i||15===i,n=this.symbolInfo();if(!this._model.isSnapshot()&&t.visible.value()&&s&&n){const e=this.currentSession(),t=!(0,m.isRegularSessionId)(this.sessionIdProxyProperty().value(),n)&&!this.isDWM();this._lastPriceAnimationActive="market"===e||t&&("pre_market"===e||"post_market"===e)}else this._lastPriceAnimationActive=!1;this._lastPriceAnimationActive&&e!==this._lastPriceAnimationActive&&this.model().invalidate(at.InvalidationMask.cursor())}_onPropertiesChanged(e){const t=this._properties.childs();if(e===t.symbol||e===t.interval||e===t.timeframe)return;const i=this._id.value();this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews((0,me.sourceChangeEvent)(i)),this.model().updateSource(this),(0,o.emit)("series_properties_changed",i)}_recalcSymbolTextSourceProxyProperty(){this._textSourceIsAlwaysTickerRestrictionEnabled?this._symbolTextSourceProxyProperty.setValue("ticker"):this._symbolTextSourceProxyProperty.setValue(this._properties.childs().statusViewStyle.childs().symbolTextSource.value())}_clearStylePlot(e,t){if(0===e.size())return;if(void 0===t&&e!==this.nsBars())return void(this._precomputedBarStyles=new WeakMap);const i=t??(0,s.ensureNotNull)(e.firstIndex()),n=(0,s.ensureNotNull)(e.lastIndex())+1;e.range(i,n).each(((e,t)=>(this._precomputedBarStyles.delete(t),!1)))}_visibleBarsCount(){const e=this._model.timeScale().visibleBarsStrictRange();return e?.count()}_symbolForResolve(){const e=this.symbol();return this._seriesSource.symbolSameAsResolved(e)?this._seriesSource.resolvedSymbol()??e:e}_shouldDefineNumberOfBarsForModifySeries(e){
return b.enabled("request_only_visible_range_on_reset")&&e.force||!1}_onShowCountdownChanged(e){e.value()?this._countdownUpdateTimer=this._model.setInterval((()=>{this._priceAxisView.updateCountdown?.(),this._projectionPriceAxisView.updateCountdown?.()}),500):null!==this._countdownUpdateTimer&&(this._model.clearInterval(this._countdownUpdateTimer),this._countdownUpdateTimer=null)}_onFormatterPropsChanged(){this._recreateFormatter(),this._model.fullUpdate()}_updateStatus(e){14!==e.seriesStatus&&this._unsupportedResolutionState.setValue(null),this._status.setValue(e)}_wasCompletedBefore(){return this.isCompleted()&&(this._studyBindings?.wasCompletedBefore()??!0)}_updateTpoSummary(){if(this._model.isInRestoreState())return;const e=this._model.dataSourceForId(tpoSummaryDataSourceId);if(18!==this.style()||!isFeatureEnabled("tpo_summary"))return void(e&&this._model.removeSource(e));const t=this._properties.childs().tpoStyle.childs().summary.childs().visible.value();if(t&&!e){const e=(0,s.ensureNotNull)(this._model.paneForSource(this)),t=this._model.panes().indexOf(e);this._model.createPane(t+1,void 0,void 0,bt.PaneMode.Widget).insertDataSource(new TpoSummaryDataSource(this._model),null,0)}else!t&&e&&this._model.removeSource(e)}}},84626:(e,t,i)=>{"use strict";i.d(t,{SeriesAreaPaneView:()=>l});var s=i(19063),n=i(2271),o=i(95201),r=i(11064),a=i(36897);class l extends a.SeriesSingleLinePaneView{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e=this._source.priceScale();if(!e)return null;const t=this._source.properties().childs().areaStyle.childs(),i=t.transparency.value(),a={simpleMode:!1,barSpacing:this._model.timeScale().barSpacing(),items:this._items,lineColor:t.linecolor.value(),lineStyle:t.linestyle.value(),lineWidth:t.linewidth.value(),isSeries:!0,withMarkers:!1,bottom:e.height(),color1:(0,s.generateColor)(t.color1.value(),i),color2:(0,s.generateColor)(t.color2.value(),i),skipHoles:!0},l=new o.CompositeRenderer;return l.append(new n.PaneRendererArea(a)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&l.append(new r.SelectionRenderer(this._selectionData)),l}}},59432:(e,t,i)=>{"use strict";i.d(t,{PaneRendererBars:()=>o});var s=i(61993),n=i(3774);class o extends n.PaneRendererSeriesBase{constructor(e){super(),this._bars=e.bars,this._dontDrawOpen=e.dontDrawOpen,this._thinBars=e.thinBars}_drawImpl(e){const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s}=e;t.save();let n=null;for(const e of this._bars){let o=this._calcRealBarWidth(e.right-e.left,i);if(o>=2){Math.max(1,Math.floor(i))%2!=o%2&&o--}const r=this._thinBars?Math.min(o,Math.floor(i)):o,a=r<=o&&e.right-e.left>=Math.floor(1.5*i);n!==e.color&&(t.fillStyle=e.color,n=e.color);const l=Math.floor(.5*r),c=Math.round(e.center*i),h=c-l,d=r,u=h+d-1,_=Math.min(e.high,e.low),p=Math.max(e.high,e.low),m=Math.round(_*s)-l,g=Math.round(p*s)+l,f=Math.max(g-m,r);t.fillRect(h,m,d,f);const y=Math.ceil(1.5*o);if(a){const i=c-y,n=c+y,o=Math.min(h-i,n-u);if(!this._dontDrawOpen){
let n=Math.max(m,Math.round(e.open*s)-l),r=n+d-1;r>m+f-1&&(r=m+f-1,n=r-d+1),t.fillRect(i,n,o,r-n+1)}let r=Math.max(m,Math.round(e.close*s)-l),a=r+d-1;a>m+f-1&&(a=m+f-1,r=a-d+1),t.fillRect(u+1,r,o,a-r+1)}}t.restore()}_getTolerance(){return(0,s.interactionTolerance)().series}_calcRealBarWidth(e,t){const i=Math.floor(t);return Math.max(i,Math.floor((0,s.optimalBarWidth)(e,t)))}}},99800:(e,t,i)=>{"use strict";i.d(t,{SeriesBarsPaneView:()=>a});var s=i(95201),n=i(11064),o=i(24997),r=i(59432);class a extends o.SeriesBarCandlesPaneView{renderer(){this._invalidated&&(this._updateImpl(null),this._invalidated=!1);const e=this._source.properties().childs(),t={bars:this._bars,dontDrawOpen:e.barStyle.childs().dontDrawOpen.value(),thinBars:11===e.style.value()?e.rangeStyle.childs().thinBars.value():e.barStyle.childs().thinBars.value()},i=new s.CompositeRenderer;return i.append(new r.PaneRendererBars(t)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&i.append(new n.SelectionRenderer(this._selectionData)),i}_createItem(e,t,i){const s={center:NaN,open:NaN,high:NaN,low:NaN,close:NaN,color:i.barColor,left:NaN,right:NaN,timePointIndex:e};return(0,o.baseBarCandlesUpdater)(t,s)?s:null}}},93250:(e,t,i)=>{"use strict";i.d(t,{SeriesBaselinePaneView:()=>g});var s,n=i(19063),o=i(95201),r=i(86441),a=i(5531),l=i(4652),c=i(61993),h=i(29981),d=i(75919),u=i(56468);!function(e){e[e.Top=0]="Top",e[e.Bottom=1]="Bottom"}(s||(s={}));class _ extends d.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null}setData(e){this._data=e}hitTest(e){if(null===this._data)return null;const{items:t,topLineWidth:i,bottomLineWidth:s}=this._data,n=(0,c.interactionTolerance)().series+(i+s)/4,o=(0,h.lowerbound)(t,e,((e,t)=>e.center<=t.x)),a=Math.max(1,o-1),d=Math.min(t.length-1,o+1);for(let i=a;i<=d;++i){const s=t[i-1],o=t[i],{distance:a}=(0,l.distanceToSegment)((0,r.point)(s.center,s.y),(0,r.point)(o.center,o.y),(0,r.point)(e.x,e.y));if(a<=n)return new u.HitTestResult(u.HitTarget.Regular)}return null}_drawImpl(e){if(null===this._data)return;const{items:t,baseLevelCoordinate:i,bottom:s,bottomFillColor1:n,bottomFillColor2:o,topFillColor1:l,topFillColor2:h,topLineColor:d,bottomLineColor:u,topLineWidth:_,bottomLineWidth:p}=this._data;if(!function(e){if(0===e.length)return!1;const t=e.findIndex((e=>(0,c.coordinateIsValid)(e.y)));if(-1===t)return!1;let i=e.length-1;for(;i>t&&!(0,c.coordinateIsValid)(e[i].y);)i--;return!(t>i)}(t))return;const m=e.context,{topItems:g,bottomItems:f}=function(e,t){const i=[],s=[];let n=null;for(let o=0;o=t&&s.push(l),n=l;else{if(null===n)continue;l=n}if((0,c.coordinateIsValid)(h.y)&&(l.y>t&&h.yt))if(Math.abs(l.center-h.center)<1){const e={center:l.center,y:t};i.push(e),s.push(e)}else{const e=(0,a.intersectLineSegments)((0,r.point)(l.center,l.y),(0,r.point)(h.center,h.y),(0,r.point)(l.center,t),(0,r.point)(h.center,t));if(null!==e){const t={
center:l.center+(h.center-l.center)*e,y:l.y+(h.y-l.y)*e};i.push(t),s.push(t)}}}return{topItems:i,bottomItems:s}}(t,i);m.lineCap="round",m.lineJoin="round",0!==g.length&&(m.beginPath(),m.moveTo(g[0].center,i),this._makeLine(m,g,!0,0),m.closePath(),m.fillStyle=this._makeLinearGradient(m,l,h,i-s,i),m.fill(),m.beginPath(),this._makeLine(m,g,!1,0),m.lineWidth=_,m.strokeStyle=d,m.stroke()),0!==f.length&&(m.beginPath(),m.moveTo(f[0].center,i),this._makeLine(m,f,!0,1),m.closePath(),m.fillStyle=this._makeLinearGradient(m,n,o,i,i+s),m.fill(),m.beginPath(),this._makeLine(m,f,!1,1),m.lineWidth=p,m.strokeStyle=u,m.stroke())}_makeLine(e,t,i,s){if(null===this._data)return;const n=t.findIndex((e=>(0,c.coordinateIsValid)(e.y)));if(-1===n)return;const{barSpacing:o,baseLevelCoordinate:r}=this._data,a=.25*o;let l;const h=t.length;for(let o=n;o=r&&h.y>=r){e.moveTo(h.center,h.y);continue}}else if(l&&l.y<=r&&h.y<=r){e.moveTo(h.center,h.y);continue}if(l&&(0,c.coordinateIsValid)(l.y))e.lineTo(h.center,h.y),i&&!(0,c.coordinateIsValid)(d.y)&&e.lineTo(h.center,r);else if(d&&(0,c.coordinateIsValid)(d.y))i?(o!==n&&e.lineTo(h.center,r),e.lineTo(h.center,h.y)):e.moveTo(h.center,h.y);else if(i){if(0===o)continue;o!==n&&e.lineTo(h.center-a,r),e.lineTo(h.center-a,h.y),e.lineTo(h.center+a,h.y),e.lineTo(h.center+a,r)}else e.moveTo(h.center-a,h.y),e.lineTo(h.center+a,h.y);l=h}}}_makeLinearGradient(e,t,i,s,n){const o=e.createLinearGradient(0,s,0,n);return o.addColorStop(0,t),o.addColorStop(1,i),o}}var p=i(11064),m=i(36897);class g extends m.SeriesSingleLinePaneView{constructor(){super(...arguments),this._renderer=new _,this._topFillColor1="",this._topFillColor2="",this._bottomFillColor1="",this._bottomFillColor2="",this._topLineColor="",this._bottomLineColor="",this._topLineWidth=0,this._bottomLineWidth=0,this._barSpacing=0,this._bottom=0,this._baseLevelCoordinate=0}renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData({items:this._items,topFillColor1:this._topFillColor1,topFillColor2:this._topFillColor2,bottomFillColor1:this._bottomFillColor1,bottomFillColor2:this._bottomFillColor2,topLineColor:this._topLineColor,bottomLineColor:this._bottomLineColor,topLineWidth:this._topLineWidth,bottomLineWidth:this._bottomLineWidth,barSpacing:this._barSpacing,baseLevelCoordinate:this._baseLevelCoordinate,bottom:this._bottom});const e=new o.CompositeRenderer;return e.append(this._renderer),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&e.append(new p.SelectionRenderer(this._selectionData)),e}_updateImpl(){super._updateImpl();const e=this._source.priceScale();if(!e)return;const t=this._source.properties().childs().baselineStyle.childs(),i=t.transparency.value();this._topFillColor1=(0,n.generateColor)(t.topFillColor1.value(),i),this._topFillColor2=(0,n.generateColor)(t.topFillColor2.value(),i),this._bottomFillColor1=(0,n.generateColor)(t.bottomFillColor1.value(),i),this._bottomFillColor2=(0,
n.generateColor)(t.bottomFillColor2.value(),i),this._topLineColor=t.topLineColor.value(),this._bottomLineColor=t.bottomLineColor.value(),this._topLineWidth=t.topLineWidth.value(),this._bottomLineWidth=t.bottomLineWidth.value(),this._barSpacing=this._model.timeScale().barSpacing(),this._bottom=e.height(),this._baseLevelCoordinate=Math.round(this._bottom*(Math.abs(100-t.baseLevelPercentage.value())/100))}}},12374:(e,t,i)=>{"use strict";i.d(t,{SeriesWaterlinePaneView:()=>a});var s=i(52397),n=i(72791),o=i(56468),r=i(51056);class a extends s.HorizontalLinePaneView{constructor(e){super(),this._getters=e;const t={cursorType:n.PaneCursorType.VerticalResize,activeItem:0,areaName:o.AreaName.SourceItemMove};this._lineRenderer.setHitTest(new o.HitTestResult(o.HitTarget.MovePoint,t)),this._lineRendererData.visible=!0,this._lineRendererData.linestyle=r.LINESTYLE_SPARSE_DOTTED}_updateImpl(){const{baseLevelPercentage:e,paneHeight:t,color:i}=this._getters,s=Math.abs(100-e());this._lineRendererData.y=Math.round(t()*(s/100)),this._lineRendererData.color=i()}}},3774:(e,t,i)=>{"use strict";i.d(t,{PaneRendererSeriesBase:()=>o});var s=i(56468),n=i(30125);class o extends n.BitmapCoordinatesPaneRenderer{constructor(){super(...arguments),this._bars=[]}hitTest(e){const t=this._bars;if(0===t.length)return null;const i=this._getTolerance(),s=t[0],n=t[t.length-1];if(e.xn.right+i)return null;let o=0,r=t.length-1,a=-1;for(;o<=r;){const i=Math.floor((o+r)/2),s=t[i];if(e.x>=s.left&&e.x<=s.right){a=i;break}e.x>s.right?o=i+1:r=i-1}if(-1===a)return null;if(this._isPointAtBar(t[a],e.y,i))return this._getHitTest();let l=a;for(;l>=1&&e.x-t[l-1].right{"use strict";i.d(t,{PaneRendererCandles:()=>h});var s,n=i(50151),o=i(56468),r=i(37743),a=i(61993),l=i(3774);function c(e,t,i,s){const n=Math.floor(t);return e.map((e=>{let o=(0,a.optimalCandlestickWidth)((e.right-e.left)*s,t);o>=2&&n%2!=o%2&&o--;const r=Math.floor(.5*o),l=function(e,t){let i=Math.floor(1*t);e<=2*i&&(i=Math.floor(.5*(e-1)));const s=Math.max(Math.floor(t),i);if(e<=2*s)return Math.max(Math.floor(t),Math.floor(1*t));return s}(o,t),c=Math.round(e.center*t),h=c-r,d=h+o-1,u=Math.abs(Math.max(e.open,e.close)-Math.min(e.open,e.close))*i,_=Math.round(Math.min(e.open,e.close)*i),p=Math.round(Math.max(e.open,e.close)*i);let m=Math.min(Math.floor(t),Math.floor(o*t));m=Math.max(Math.floor(t),Math.min(m,o));const g=Math.floor(.5*m);return{rawBodyHeight:u,top:_,bottom:p,center:c,left:h,right:d,candleWidth:o,high:Math.round(e.high*i),low:Math.round(e.low*i),wickWidth:m,wickOffset:g,borderWidth:l}}))}!function(e){e[e.BarBorderWidth=1]="BarBorderWidth"}(s||(s={}));class h extends l.PaneRendererSeriesBase{
constructor(e){super(),this._scaleCoeff=1,this._borderVisible=!1,this._wickVisible=!1,this._bodyVisible=!0,this._borderColor=void 0,this._wickColor=void 0,this._hittest=void 0,this._isPriceScaleInverted=!1,e&&this.setData(e)}setData(e){this._bars=e.bars,this._scaleCoeff=e.scaleCoeff??1,this._borderVisible=e.borderVisible,this._bodyVisible=e.bodyVisible,this._wickVisible=e.wickVisible,this._borderColor=e.borderColor,this._wickColor=e.wickColor,this._hittest=e.hittest,this._isPriceScaleInverted=e.isPriceScaleInverted}hitTest(e){return this._wickVisible||this._borderVisible||this._bodyVisible?super.hitTest(e):null}_drawImpl(e){const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s}=e;if(0===this._bars.length)return;const n=c(this._bars,i,s,this._scaleCoeff);this._wickVisible&&this._drawWicks(t,n),this._borderVisible&&this._drawBorder(t,n),this._bodyVisible&&this._drawCandles(t,n)}_getTolerance(){return(0,a.interactionTolerance)().series}_getHitTest(){return this._hittest||new o.HitTestResult(o.HitTarget.Regular)}_isPointAtBar(e,t,i){const s=this._bodyVisible||this._borderVisible,n=this._wickVisible;if(!s&&!n)return!1;if(s){const s=n?Math.min(e.high,e.low):Math.min(e.open,e.close),o=n?Math.max(e.high,e.low):Math.max(e.open,e.close);return s-i<=t&&t<=o+i}{const s=Math.min(e.open,e.close),n=Math.max(e.open,e.close);return e.high-i<=t&&t<=s+i||n-i<=t&&t<=e.low+i}}_drawWicks(e,t){let i="",s=null;this._bars.forEach(((o,r)=>{const a=o.wickColor?o.wickColor:(0,n.ensureDefined)(this._wickColor);a!==i&&(e.fillStyle=a,i=a);let{top:l,bottom:c}=t[r];const{rawBodyHeight:h,borderWidth:d,center:u,high:_,low:p,wickWidth:m,wickOffset:g}=t[r];this._isPriceScaleInverted&&([c,l]=[l,c]);let f=u-g;const y=f+m-1;null!==s&&(f=Math.max(s+1,f),f=Math.min(f,y));const v=y-f+1;h<=d&&(l!==_&&(l=Math.round(l-.5*d)),c=c!==p?Math.round(l-.5*d)+d-1:p-1),l!==_&&e.fillRect(f,_,v,l-_),p-c-1&&e.fillRect(f,c+1,v,p-c-1),s=y}))}_drawBorder(e,t){let i="",s=null;this._bars.forEach(((o,a)=>{if(o.borderColor!==i&&(e.fillStyle=o.borderColor?o.borderColor:(0,n.ensureDefined)(this._borderColor),i=o.borderColor),this._bodyVisible&&o.hollow)return;let{left:l}=t[a];const{rawBodyHeight:c,top:h,bottom:d,right:u,borderWidth:_}=t[a];null!==s&&(l=Math.max(s+1,l),l=Math.min(l,u));const p=u-l+1;c<=_?e.fillRect(l,Math.round(h-.5*_),p,_):p>2*_?(0,r.fillRectInnerBorder)(e,l,h,u-l+1,d-h+1,_):e.fillRect(l,h,p,d-h+1),s=u}))}_drawCandles(e,t){let i="";this._bars.forEach(((s,n)=>{let{top:o,bottom:a,left:l,right:c}=t[n];const{rawBodyHeight:h,borderWidth:d,candleWidth:u}=t[n];if(!(this._borderVisible&&u<=2*d)||s.hollow){if(s.color!==i){const t=s.color;e.fillStyle=t,i=t}if(s.hollow)e.fillStyle=s.color,h<=d?e.fillRect(l,Math.round(o-.5*d),u,d):(0,r.fillRectInnerBorder)(e,l,o,c-l+1,a-o+1,d);else{if(!this._borderVisible&&h<=d)return void e.fillRect(l,Math.round(o-.5*d),u,d);if(this._borderVisible&&(l+=d,o+=d,c-=d,a-=d),o>a)return;e.fillRect(l,o,c-l+1,a-o+1)}}}))}}},72476:(e,t,i)=>{"use strict";i.d(t,{SeriesCandlesPaneView:()=>l})
;var s=i(95201),n=i(61993),o=i(11064),r=i(24997),a=i(25201);class l extends r.SeriesBarCandlesPaneView{constructor(e,t,i=1){super(e,t),this._scaleCoeff=1,this._scaleCoeff=i}renderer(){this._invalidated&&(this._updateImpl(null),this._invalidated=!1);const e=this._source.priceScale();if(!e)return null;const t=this._source.properties().childs(),i=1===t.style.value()?t.candleStyle.childs():19===t.style.value()?t.volCandlesStyle.childs():t.volFootprintStyle.childs(),r=this._model.timeScale().barSpacing(),l={bars:this._bars,barSpacing:r,bodyVisible:i.drawBody.value(),borderVisible:i.drawBorder.value(),borderColor:i.borderColor.value(),wickColor:i.wickColor.value(),barWidth:(0,n.optimalBarWidth)(r),wickVisible:i.drawWick.value(),isPriceScaleInverted:e.isInverted(),scaleCoeff:this._scaleCoeff},c=new s.CompositeRenderer;return c.append(new a.PaneRendererCandles(l)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&c.append(new o.SelectionRenderer(this._selectionData)),c}_createItem(e,t,i){const s={center:NaN,open:NaN,high:NaN,low:NaN,close:NaN,left:NaN,right:NaN,timePointIndex:e,color:i.barColor,borderColor:i.barBorderColor,wickColor:i.barWickColor,hollow:i.isBarHollow};return(0,r.baseBarCandlesUpdater)(t,s)?s:null}}},53766:(e,t,i)=>{"use strict";i.d(t,{SeriesColumnsPaneView:()=>p});var s=i(50151),n=i(86441),o=i(56570),r=i(69708),a=i(56468),l=i(95201),c=i(8025),h=i(66540),d=i(11064),u=i(81368),_=i(49256);class p{constructor(e,t){this._items=[],this._invalidated=!0,this._isMarkersEnabled=(0,o.enabled)("source_selection_markers"),this._selectionData=null,this._histogramBase=0,this._source=e,this._model=t,this._selectionIndexer=new h.SelectionIndexes(t.timeScale())}update(){this._invalidated=!0}renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e={barSpacing:this._model.timeScale().barSpacing(),items:this._items,lineColor:"",histogramBase:this._histogramBase},t=new l.CompositeRenderer;return t.append(new u.PaneRendererColumns(e)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&t.append(new d.SelectionRenderer(this._selectionData)),t}_updateImpl(){this._items=[];const e=this._model.timeScale(),t=this._source.priceScale();if(e.isEmpty()||!t||t.isEmpty())return;const i=e.visibleBarsStrictRange();if(null===i)return;if(0===this._source.bars().size())return;const o=this._source.nearestIndex(i.firstBar(),c.PlotRowSearchMode.NearestRight),l=this._source.nearestIndex(i.lastBar(),c.PlotRowSearchMode.NearestLeft);if(void 0===o||void 0===l)return;const h=this._source.barColorer(),d={},u=this._source.barFunction();for(const{index:e,value:t}of this._source.bars().rangeIterator(o,l)){const i=u(t);if(!(0,r.default)(i))continue;d.value=t;let s=this._source.precomputedBarStyle(t);void 0===s&&(s=h.barStyle(e,!1,d),this._source.setPrecomputedBarStyle(t,s)),this._items.push({timePointIndex:e,left:NaN,center:NaN,right:NaN,y:i,style:s}),d.previousValue=t}const p=this._source.firstValue();if(null===p)return
;t.pointsArrayToCoordinates(this._items,p),e.fillBarBorders(this._items);const m=this._source.properties().childs().columnStyle.childs().baselinePosition?.value();if("zero"===m){const e=t.isPercentage()?(0,_.fromPercent)(0,p):0;this._histogramBase=t.priceToCoordinate(e,p)}else this._histogramBase=t.isInverted()?0:t.height();if(this._model.selection().isSelected(this._source)){const i=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0,barSpacing:e.barSpacing(),hittestResult:a.HitTarget.Regular};const o=(0,s.ensureNotNull)(this._model.paneForSource(this._source)).height();this._selectionData.hittestResult=a.HitTarget.Regular;for(let s=0;s{"use strict";i.d(t,{SeriesHiLoPaneView:()=>f});var s=i(59332),n=i(68979),o=i(29981),r=i(61993),a=i(56468),l=i(75919);class c extends l.MediaCoordinatesPaneRenderer{constructor(){super(...arguments),this._data=null,this._barWidth=null}setData(e){this._data=e,this._barWidth=Math.max(1,Math.round((0,r.optimalHiLoWidth)(e.barSpacing)))}hitTest(e){if(null===this._data||null===this._barWidth)return null;const t=this._data.bars,i=.5*this._data.barSpacing;if(0===t.length)return null;if(e.xt[t.length-1].center+i)return null;const s=t[(0,o.lowerbound)(t,e.x-i,((e,t)=>e.centers.center+i)return null;const n=(0,r.interactionTolerance)().series+this._barWidth/2,l=Math.min(s.high,s.low),c=Math.max(s.high,s.low),h=this._data.fontSize;return l-n-h<=e.y&&e.y<=l+n||c-n<=e.y&&e.y<=c+n+h?new a.HitTestResult(a.HitTarget.Regular):null}_drawImpl(e){if(null===this._data||null===this._barWidth)return;const{font:t,fontSize:i,labelColor:s,bars:o,inverted:r,labelsPadding:a}=this._data,l=e.context;l.textAlign="center",l.fillStyle=s,l.font=(0,n.makeFont)(i,t);for(let e=0;eMath.max(1,(0,o.lowerboundExt)((e=>e+1),null,(i=>{const s=(0,n.makeFont)(i,_.CHART_FONT_FAMILY);return(0,p.measureText)(e,s).width<=t}),7,36))),((e,t)=>`${e}/${t}`))}renderer(){const e=this._source.priceScale();if(!e||e.isEmpty())return null
;const t=new d.CompositeRenderer,i=this._needLabels(),s=this._source.properties().childs().hiloStyle.childs(),n=this._model.timeScale().barSpacing();if(this._invalidated){const e=this._source.formatter();this._maxLengthLabel="",this._updateImpl({generateLabels:i,formatter:e}),this._invalidated=!1}if(this._candlesRenderer.setData({bars:this._bars,wickVisible:!1,bodyVisible:s.drawBody.value(),barSpacing:n,borderVisible:s.showBorders.value(),barWidth:(0,r.optimalHiLoWidth)(n),isPriceScaleInverted:e.isInverted()}),t.append(this._candlesRenderer),i){const i=this._calculateLabelFontSize();i&&i>=8&&(this._labelsRenderer.setData({bars:this._bars,barSpacing:n,font:_.CHART_FONT_FAMILY,fontSize:i,labelColor:s.labelColor.value(),inverted:e.isInverted(),labelsPadding:.4*i}),t.append(this._labelsRenderer))}return this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&t.append(new u.SelectionRenderer(this._selectionData)),t}topPixelMargin(){return this._margin()}bottomPixelMargin(){return this._margin()}_createItem(e,t,i,s){const n={center:NaN,left:NaN,right:NaN,open:NaN,high:NaN,low:NaN,close:NaN,color:i.barColor,borderColor:i.barBorderColor,hollow:!1,highLabel:"",lowLabel:"",timePointIndex:e};if(!(0,g.baseBarCandlesUpdater)(t,n))return null;if(n.open=n.high,n.close=n.low,s.generateLabels){const e=s.formatter.format(n.high),t=s.formatter.format(n.low);n.highLabel=e,n.lowLabel=t;const i=(e.length>t.length?e:t).replace(/\d/g,"0");i.length>this._maxLengthLabel.length&&(this._maxLengthLabel=i)}return n}_margin(){if(this._needLabels()){const e=this._calculateLabelFontSize();if(e&&e>=8)return 1.4*e}return 0}_calculateLabelFontSize(){return""===this._maxLengthLabel?null:this._calculateFontSize(this._maxLengthLabel,Math.floor(this._model.timeScale().barSpacing())-2)}_needLabels(){const e=this._source.properties().childs().hiloStyle.childs().showLabels.value(),t=this._model.timeScale().barSpacing();return e&&t>5}}},70527:(e,t,i)=>{"use strict";i.d(t,{SeriesHLCAreaPaneView:()=>g});var s=i(86441),n=i(50151),o=i(56570),r=i(67716),a=i(66540),l=i(11064),c=i(8025),h=i(61993),d=i(95201),u=i(56468),_=i(74010),p=i(59152);class m extends p.ObjectValuesCache{_newObject(){return{high:void 0,close:void 0,low:void 0}}_clearObject(e){e.high=void 0,e.close=void 0,e.low=void 0}}class g{constructor(e,t){this._isMarkersEnabled=(0,o.enabled)("source_selection_markers"),this._hlcAreaCache=new m,this._highPoints=new p.CachedContainer,this._closePoints=new p.CachedContainer,this._lowPoints=new p.CachedContainer,this._barsBorders=new p.CachedContainer,this._filledAreas=new r.CachedMap,this._renderer=new d.CompositeRenderer,this._invalidated=!0,this._source=e,this._model=t,this._selectionIndexer=new a.SelectionIndexes(t.timeScale())}update(){this._invalidated=!0}renderer(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer}_updateImpl(){this._renderer.clear();const e=this._model.timeScale(),t=this._source.priceScale();if(e.isEmpty()||!t||t.isEmpty())return;const i=e.visibleBarsStrictRange()
;if(null===i)return;if(0===this._source.bars().size())return;const o=this._source.firstValue();if(null===o)return;const a=this._source.nearestIndex(i.firstBar()-1,c.PlotRowSearchMode.NearestLeft)??i.firstBar()-1,d=this._source.nearestIndex(i.lastBar()+1,c.PlotRowSearchMode.NearestRight)??i.lastBar()+1;this._hlcAreaCache.invalidateCache(),this._hlcAreaCache.setStartIndex(a),this._barsBorders.invalidateCache(),this._highPoints.invalidateCache(),this._lowPoints.invalidateCache(),this._closePoints.invalidateCache(),this._filledAreas.invalidateCache();let p,m,g;this._source.bars().range(a,d).each(((e,t)=>{if(this._hlcAreaCache.isValidIndex(e)){const i=this._hlcAreaCache.at(e);i.close=t[4],i.high=t[2],i.low=t[3]}return!1}));const f=new Map,y=a+this._hlcAreaCache.length();for(let e=a;e{"use strict";i.d(t,{SeriesHollowCandlesPaneView:()=>l});var s=i(95201),n=i(61993),o=i(11064),r=i(25201),a=i(72476);class l extends a.SeriesCandlesPaneView{renderer(){this._invalidated&&(this._updateImpl(null),this._invalidated=!1);const e=this._source.priceScale();if(!e)return null;const t=this._source.properties().childs().hollowCandleStyle.childs(),i=this._model.timeScale().barSpacing(),a={bars:this._bars,barSpacing:i,bodyVisible:t.drawBody.value(),borderVisible:t.drawBorder.value(),borderColor:t.borderColor.value(),wickColor:t.wickColor.value(),barWidth:(0,n.optimalBarWidth)(i),wickVisible:t.drawWick.value(),isPriceScaleInverted:e.isInverted()},l=new s.CompositeRenderer;return l.append(new r.PaneRendererCandles(a)),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData&&l.append(new o.SelectionRenderer(this._selectionData)),l}}},80941:(e,t,i)=>{"use strict";i.d(t,{SeriesLinePaneView:()=>h});var s=i(56468),n=i(95201),o=i(74010),r=i(3385),a=i(11064),l=i(36897),c=i(46088);class h extends l.SeriesSingleLinePaneView{renderer(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);const e=this._source.properties().childs(),t=e.style.value();let i,l=!1;2===t?i=e.lineStyle.childs():14===t?(i=e.lineWithMarkersStyle.childs(),l=!0):15===t?i=e.steplineStyle.childs():18===t&&(i=e.tpoStyle.childs());const h=this._model.timeScale().barSpacing(),d=i.colorType?.value()!==c.ColorType.Gradient?{type:c.ColorType.Solid,color:i.color.value()}:{type:c.ColorType.Gradient,startColor:i.gradientStartColor.value(),endColor:i.gradientEndColor.value()},u={barSpacing:h,items:this._items,lineColor:d,lineStyle:i.linestyle.value(),withMarkers:l,lineWidth:i.linewidth.value(),simpleMode:!0,hitTestResult:s.HitTarget.Regular,skipHoles:!0};let _,p;if(_=15===t?new r.PaneRendererStepLine(u):new o.PaneRendererLine(u),this._model.selection().isSelected(this._source)&&this._isMarkersEnabled&&this._selectionData){const e=new n.CompositeRenderer;e.append(_),e.append(new a.SelectionRenderer(this._selectionData)),p=e}else p=_;return p}}},24997:(e,t,i)=>{"use strict";i.d(t,{SeriesBarCandlesPaneView:()=>h,baseBarCandlesUpdater:()=>c});var s=i(86441),n=i(56570),o=i(66540),r=i(8025),a=i(56468);function l(e){return null!=e}function c(e,t){const i=e[1],s=e[2],n=e[3],o=e[4];return!!(l(i)&&l(s)&&l(n)&&l(o))&&(t.open=i,t.high=s,
t.low=n,t.close=o,!0)}class h{constructor(e,t){this._bars=[],this._invalidated=!0,this._isMarkersEnabled=(0,n.enabled)("source_selection_markers"),this._selectionData=null,this._source=e,this._model=t,this._selectionIndexer=new o.SelectionIndexes(t.timeScale())}items(){return this._bars}update(){this._invalidated=!0}_updateImpl(e){const t=this._model.timeScale(),i=this._source.priceScale();if(this._bars=[],t.isEmpty()||!i||i.isEmpty())return;const n=t.visibleBarsStrictRange();if(null===n)return;if(0===this._source.bars().size())return;let o=this._source.nearestIndex(n.firstBar(),r.PlotRowSearchMode.NearestRight);const l=this._source.nearestIndex(n.lastBar(),r.PlotRowSearchMode.NearestLeft);if(void 0===o||void 0===l)return;for(;o<=l;o++){if(null!==this._source.bars().valueAt(o))break}if(o>l)return;const c=this._source.bars().range(o,l),h=this._source.barColorer(),d={};if(c.each(((t,i)=>{d.value=i;const s=h.firstColoredBar(t);let n;null!==s&&s>=t?this._source.setPrecomputedBarStyle(i,void 0):n=this._source.precomputedBarStyle(i),void 0===n&&(n=h.barStyle(t,!1,d),this._source.setPrecomputedBarStyle(i,n));const o=this._createItem(t,i,n,e);return!!o&&(d.previousValue=i,this._bars.push(o),!1)})),0===this._bars.length)return;const u=this._source.firstValue();if(null!==u)if(i.barPricesToCoordinates(this._bars,u),t.fillBarBorders(this._bars),this._model.selection().isSelected(this._source)){const e=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0,hittestResult:a.HitTarget.Regular,barSpacing:t.barSpacing()};const n=this._model.paneForSource(this._source);if(!n)return;const o=n.height();for(let n=0;n{"use strict";i.d(t,{mainSeriesProperties:()=>o});var s=i(51056),n=(i(85904),i(64671),i(20596));const o={style:1,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdFlagSize:2,showContinuousContractSwitches:!0,showContinuousContractSwitchesBreaks:!1,showFuturesContractExpiration:!0,showLastNews:!0,showCountdown:!0,bidAsk:{visible:!1,lineStyle:s.LINESTYLE_DOTTED,lineWidth:1},prePostMarket:{visible:!0,lineStyle:s.LINESTYLE_DOTTED,lineWidth:1},highLowAvgPrice:{highLowPriceLinesVisible:!1,highLowPriceLabelsVisible:!1,averageClosePriceLineVisible:!1,averageClosePriceLabelVisible:!1,highLowPriceLinesWidth:1,averagePriceLineWidth:1},visible:!0,showPriceLine:!0,priceLineWidth:1,showPrevClosePriceLine:!1,prevClosePriceLineWidth:1,minTick:"default",dividendsAdjustment:void 0,backAdjustment:!1,settlementAsClose:!0,sessionId:"regular",sessVis:!1,statusViewStyle:{fontSize:16,showExchange:!0,showInterval:!0,symbolTextSource:"description"},candleStyle:{drawWick:!0,drawBorder:!0,
barColorsOnPrevClose:!1,drawBody:!0},volCandlesStyle:{drawWick:!0,drawBorder:!0,barColorsOnPrevClose:!1,drawBody:!0},hollowCandleStyle:{drawWick:!0,drawBorder:!0,drawBody:!0},haStyle:{drawWick:!0,drawBorder:!0,showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{},inputInfo:{},drawBody:!0},barStyle:{barColorsOnPrevClose:!1,dontDrawOpen:!1,thinBars:!0},hiloStyle:{showBorders:!0,showLabels:!0,drawBody:!0},columnStyle:{barColorsOnPrevClose:!0,priceSource:"close",baselinePosition:"bottom"},lineStyle:{linestyle:s.LINESTYLE_SOLID,linewidth:2,priceSource:"close"},tpoStyle:{},svpStyle:{},lineWithMarkersStyle:{linestyle:s.LINESTYLE_SOLID,linewidth:2,priceSource:"close"},steplineStyle:{linestyle:s.LINESTYLE_SOLID,linewidth:2,priceSource:"close"},areaStyle:{linestyle:s.LINESTYLE_SOLID,linewidth:2,priceSource:"close"},hlcAreaStyle:{highLineStyle:s.LINESTYLE_SOLID,highLineWidth:2,lowLineStyle:s.LINESTYLE_SOLID,lowLineWidth:2,closeLineStyle:s.LINESTYLE_SOLID,closeLineWidth:2},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,indexedTo100:!1,log:!1,logDisabled:!1,isInverted:!1,alignLabels:!0},renkoStyle:{inputs:{source:"close",sources:"Close",boxSize:3,style:"ATR",atrLength:14,percentageLTP:1,wicks:!0},inputInfo:{source:{name:"Source"},sources:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR length"},percentageLTP:{name:"Percentage"},wicks:{name:"Wicks"}}},pbStyle:{inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{inputs:{source:"close",style:"ATR",atrLength:14,percentageLTP:1,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR length"},percentageLTP:{name:"Percentage"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{inputs:{sources:"Close",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14,percentageLTP:1,oneStepBackBuilding:!1},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR length"},percentageLTP:{name:"Percentage"},oneStepBackBuilding:{name:"One step back building"}}},baselineStyle:{topLineWidth:2,bottomLineWidth:2,priceSource:"close",transparency:50,baseLevelPercentage:50},rangeStyle:{barStyle:n.RangeBarStyle.Bars,thinBars:!0,inputs:{range:10,phantomBars:!1},inputInfo:{range:{name:"Range"},phantomBars:{name:"Phantom bars"}}},volFootprintStyle:{}}},36897:(e,t,i)=>{"use strict";i.d(t,{SeriesSingleLinePaneView:()=>d});var s=i(69708),n=i(86441),o=i(50151),r=i(56570),a=i(66540),l=i(8025),c=i(56468),h=i(29981);class d{constructor(e,t){this._items=[],this._invalidated=!0,this._isMarkersEnabled=(0,r.enabled)("source_selection_markers"),this._selectionData=null,this._source=e,this._model=t,this._selectionIndexer=new a.SelectionIndexes(t.timeScale())}update(){this._invalidated=!0}_updateImpl(){this._items=[];const e=this._model.timeScale(),t=this._source.priceScale();if(e.isEmpty()||!t||t.isEmpty())return;const i=e.visibleBarsStrictRange();if(null===i)return
;if(0===this._source.bars().size())return;const r=this._source.nearestIndex(i.firstBar()-1,l.PlotRowSearchMode.NearestLeft)??i.firstBar()-1,a=this._source.nearestIndex(i.lastBar()+1,l.PlotRowSearchMode.NearestRight)??i.lastBar()+1,d=this._source.barFunction(),u=this._model.timeScale().barSpacing();if(u<.1&&this._source.supportsPressedChunks()){const e=this._source.pressedChunks(u,(0,o.ensureNotNull)(this._source.priceSource())),t=(0,h.lowerbound)(e,r,((e,t)=>e.startTimee.endTime{this._items.push({timePointIndex:t.startTime,y:e,left:NaN,center:NaN,right:NaN})}))}}else for(const{index:e,value:t}of this._source.bars().rangeIterator(r,a)){const i=d(t);(0,s.default)(i)&&this._items.push({timePointIndex:e,y:i,left:NaN,center:NaN,right:NaN})}const _=this._source.firstValue();if(null!==_)if(t.pointsArrayToCoordinates(this._items,_),e.fillBarBorders(this._items),this._model.selection().isSelected(this._source)){const i=this._selectionIndexer.indexes();this._selectionData={points:[],bgColors:[],visible:!0,barSpacing:e.barSpacing(),hittestResult:c.HitTarget.Regular};const s=(0,o.ensureNotNull)(this._model.paneForSource(this._source)).height();this._selectionData.hittestResult=c.HitTarget.Regular;for(let o=0;o{"use strict";i.d(t,{RangeBarStyle:()=>f,areaStylePreferencesDefault:()=>l,barStylePreferencesDefault:()=>r,baselineStylePreferencesDefault:()=>h,candleStylePreferencesDefault:()=>n,columnStylePreferencesDefault:()=>v,haStylePreferencesDefault:()=>u,hiloStylePreferencesDefault:()=>d,hlcAreaStylePreferencesDefault:()=>c,hollowCandlePreferencesStyleDefault:()=>o,kagiStylePreferencesDefault:()=>m,lineStyleDefault:()=>a,pbStylePreferencesDefault:()=>p,pnfStylePreferencesDefault:()=>g,rangeStylePreferencesDefault:()=>y,renkoStylePreferencesDefault:()=>_});var s=i(46088);const n={upColor:"",downColor:"",drawWick:!1,drawBorder:!1,drawBody:!0,borderColor:"",borderUpColor:"",borderDownColor:"",wickColor:"",wickUpColor:"",wickDownColor:"",barColorsOnPrevClose:!1},o={upColor:"",downColor:"",drawWick:!1,drawBorder:!1,drawBody:!0,borderColor:"",borderUpColor:"",borderDownColor:"",wickColor:"",wickUpColor:"",wickDownColor:""},r={upColor:"",downColor:"",barColorsOnPrevClose:!1,dontDrawOpen:!1,thinBars:!0},a={color:"",linestyle:0,linewidth:0,colorType:s.ColorType.Gradient,gradientStartColor:"",gradientEndColor:""},l={color1:"",color2:"",linecolor:"",linestyle:0,linewidth:0,transparency:0},c={highLineColor:"",highLineStyle:0,highLineWidth:0,lowLineColor:"",lowLineStyle:0,lowLineWidth:0,closeLineColor:"",closeLineStyle:0,closeLineWidth:0,
highCloseFillColor:"",closeLowFillColor:""},h={topFillColor1:"",topFillColor2:"",bottomFillColor1:"",bottomFillColor2:"",topLineColor:"",bottomLineColor:"",baselineColor:"",topLineWidth:0,bottomLineWidth:0,transparency:0,baseLevelPercentage:0},d={color:"",showBorders:!1,borderColor:"",showLabels:!1,labelColor:"",drawBody:!0},u={upColor:"",downColor:"",drawWick:!1,drawBorder:!1,drawBody:!0,borderColor:"",borderUpColor:"",borderDownColor:"",wickColor:"",wickUpColor:"",wickDownColor:"",showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{}},_={upColor:"",downColor:"",borderUpColor:"",borderDownColor:"",upColorProjection:"",downColorProjection:"",borderUpColorProjection:"",borderDownColorProjection:"",wickUpColor:"",wickDownColor:"",inputs:{boxSize:0,style:"",atrLength:0,percentageLTP:0,wicks:!1,sources:"",source:""}},p={upColor:"",downColor:"",borderUpColor:"",borderDownColor:"",upColorProjection:"",downColorProjection:"",borderUpColorProjection:"",borderDownColorProjection:"",inputs:{source:"",lb:0}},m={upColor:"",downColor:"",upColorProjection:"",downColorProjection:"",inputs:{style:"",atrLength:0,percentageLTP:0,reversalAmount:0}},g={upColor:"",downColor:"",upColorProjection:"",downColorProjection:"",inputs:{reversalAmount:0,boxSize:0,style:"",atrLength:0,percentageLTP:0,oneStepBackBuilding:!1,sources:"Close"}};var f;!function(e){e[e.Bars=0]="Bars",e[e.Candles=1]="Candles"}(f||(f={}));const y={barStyle:0,upColor:"",downColor:"",upColorProjection:"",downColorProjection:"",thinBars:!1,candlesUpColor:"",candlesDownColor:"",candlesBorderUpColor:"",candlesBorderDownColor:"",candlesWickUpColor:"",candlesWickDownColor:"",inputs:{range:0,phantomBars:!1}},v={upColor:"",downColor:"",barColorsOnPrevClose:!1,baselinePosition:"bottom"}},62825:(e,t,i)=>{"use strict";i.d(t,{getErrorFromUnsupportedResolutionState:()=>c,getResolutionUnsupportedReason:()=>h});var s=i(11542),n=i(85049),o=i(10074);const r=s.t(null,void 0,i(64818)),a=s.t(null,void 0,i(80254)),l=s.t(null,void 0,i(80185));function c(e,t=!1){const i=t?`${e.ticker}`:e.ticker;switch(e.reason){case"unsupported_resolution":{const s=t?`${e.supportedResolutions.join(", ")}`:e.supportedResolutions.join(", ");return r.format({ticker:i,availableResolutions:s})}case"unsupported_ticks":return a.format({ticker:i});case"less_than_frequency":{const s=t?`${e.applicableResolution}`:e.applicableResolution;return l.format({ticker:i,resolution:s})}}}function h(e,t){if(null===e)return null;const i=e.data_frequency;if(void 0!==i){if((0,o.getApplicableIntervalForFrequency)(i,t)!==t)return"less_than_frequency"}if(n.Interval.isIntraday(t)&&!e.has_intraday)return"unsupported_resolution";if(n.Interval.isTicks(t)&&!e["is-tickbars-available"])return"unsupported_ticks";{const i=n.Interval.isSeconds(t)&&!e.has_seconds,s=n.Interval.isDays(t)&&!e.has_daily;if(i||s)return"unsupported_resolution"}return null}},76748:(e,t,i)=>{"use strict";i.d(t,{SeriesValuesProvider:()=>I,calculateColor:()=>T,changesData:()=>x})
;var s=i(50151),n=i(50335),o=i(24377),r=i(11542),a=i(49483),l=i(19063),c=i(63273),h=i(8025),d=i(928),u=i(74079),_=i(90799);function p(e,t){return 100*(t-e)/Math.abs(e||1)}var m=i(41991),g=i(15764),f=i(82587),y=i(23486);const v=y.lastDayChangeAvailable||y.alwaysShowLastPriceAndLastDayChange,S=a.CheckMobile.any(),b=(0,u.getPercentageFormatter)(),w=(0,u.getVolumeFormatter)(2),C=`${f.notAvailable} (${f.notAvailable}%)`;var P;function T(e,t){const i=(0,o.parseRgb)(t),s=(0,o.parseRgb)(e);return(0,o.distanceRgb)(i,s)<70?(0,o.rgbToHexString)((0,o.invertRgb)(i)):t}function x(e,t,i,s,n){let o,r;if(null!==t){const e=n[4],i=t.change||0;r={change:i,currentPrice:e,prevPrice:e-i,percentChange:t.change_percent||0}}const a=i[4],l=e.search(s-1,h.PlotRowSearchMode.NearestLeft,1),c=l?.value[4]??null;return null!==c&&null!=a&&(o={change:a-c,currentPrice:a,prevPrice:c,percentChange:p(c,a)}),{barChange:o,lastDayChange:r}}!function(e){e[e.Open=0]="Open",e[e.High=1]="High",e[e.Low=2]="Low",e[e.Close=3]="Close",e[e.Source=4]="Source",e[e.LastPrice=5]="LastPrice",e[e.Change=6]="Change",e[e.Volume=7]="Volume",e[e.LastDayChange=8]="LastDayChange"}(P||(P={}));class I{constructor(e,t){this._series=e,this._model=t,this._emptyValues=[{title:r.t(null,void 0,i(16610)),visible:!1,value:"",index:0,id:""},{title:r.t(null,void 0,i(78254)),visible:!1,value:"",index:1,id:""},{title:r.t(null,void 0,i(65318)),visible:!1,value:"",index:2,id:""},{title:r.t(null,void 0,i(62578)),visible:!1,value:"",index:3,id:""},{title:"",visible:!1,value:"",index:4,id:""},{title:"",visible:!1,value:"",index:5,id:""},{title:r.t(null,void 0,i(37276)),visible:!1,value:"",index:6,id:""},{title:r.t(null,{context:"study"},i(24261)),visible:!1,value:"",index:7,id:""},{title:r.t(null,void 0,i(63815)),visible:!1,value:"",index:8,id:""}]}getItems(){return this._emptyValues}getValues(e){const t=this._showLastPriceAndChangeOnly(),i=this._emptyValues.map(((e,i)=>({...e,value:6===i||8===i?C:f.notAvailable,visible:5!==i&&4!==i&&!t})));if(this._model.timeScale().isEmpty()||0===this._series.bars().size()||this._series.priceScale().isEmpty())return i;const o=(0,s.ensureNotNull)(this._series.data().bars().last());(0,n.isNumber)(e)||(e=o.index);const r=this._series.nearestIndex(e,h.PlotRowSearchMode.NearestLeft);if(void 0===r)return i;const a=this._series.data().valueAt(r),d=this._model.backgroundTopColor().value();if(null===a)return i;const u=a[1],_=a[2],p=a[3],g=a[4],{barChange:y,lastDayChange:S}=x(this._series.data(),this._series.quotes(),a,r,o.value),P=(0,m.getPriceValueFormatterForSource)(this._series);if((0,m.shouldBeFormattedAsPercent)(this._series)||(0,m.shouldBeFormattedAsIndexedTo100)(this._series))i[6].value="",i[8].value="";else{const e=this._series.formatter(),t={signPositive:!0};if(void 0!==y){const{currentPrice:s,prevPrice:n,change:o,percentChange:r}=y,a=e.formatChange?.(s,n,t)??e.format(o,t);i[6].value=(0,c.forceLTRStr)(`${a} (${b.format(r,t)})`)}if(void 0!==S){const{currentPrice:s,prevPrice:n,change:o,percentChange:r}=S,a=e.formatChange?.(s,n,t)??e.format(o,t);i[8].value=(0,
c.forceLTRStr)(`${a} (${b.format(r,t)})`)}}let I=null;if(t)i[5].value=null==g?f.notAvailable:P(g),i[5].visible=!0,I=this._getChangeColor(y?.change,r),i[6].visible=void 0!==y,i[8].visible=void 0!==S||v;else{i[0].value=null==u?f.notAvailable:P(u),i[1].value=null==_?f.notAvailable:P(_),i[2].value=null==p?f.notAvailable:P(p),i[3].value=null==g?f.notAvailable:P(g),i[4].value=P(this._series.barFunction()(a));const e=a[5];(0,n.isNumber)(e)?i[7].value=w.format(e):i[7].visible=!1;const t=this._series.intervalObj().is1Tick();i[0].visible=!t,i[1].visible=!t,i[2].visible=!t,i[8].visible=void 0!==S||v,i[6].visible=void 0!==y;const s=this._series.barColorer().barStyle(r,!1);I=T(d,s.barBorderColor??s.barColor)}I=(0,l.resetTransparency)(T(d,I));for(const e of i)e.color||(e.color=I);return i[8].visible&&(i[8].color=(0,l.resetTransparency)(T(d,this._getChangeColor(S?.change,o.index)))),i}_mobileNonTrackingMode(){return S&&(null===this._model.crosshairSource().pane||(0,g.isLineToolName)(d.tool.value())||null!==this._model.lineBeingEdited())}_showLastPriceAndChangeOnly(){return y.alwaysShowLastPriceAndLastDayChange||this._mobileNonTrackingMode()}_getChangeColor(e,t){const i=this._series.style();if(2===i||15===i||14===i)return this._series.barColorer().barStyle(t,!1).barColor;const s=void 0===e||e>=0?_.SeriesBarColorer.upColor(this._series.properties()):_.SeriesBarColorer.downColor(this._series.properties());return s.barBorderColor??s.barColor}}},6290:(e,t,i)=>{"use strict";i.d(t,{sessionsPreferencesDefault:()=>n});var s=i(19625);const n={sessionHighlight:{backgrounds:{preMarket:{color:"#FF9800",transparency:92,visible:!0},postMarket:{color:s.colorsPalette["color-tv-blue-500"],transparency:92,visible:!0},electronic:{color:s.colorsPalette["color-tv-blue-500"],transparency:92,visible:!0},outOfSession:{color:s.colorsPalette["color-tv-blue-500"],transparency:92,visible:!0}},vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}}}},300:(e,t,i)=>{"use strict";i.d(t,{sourcesAffectState:()=>o});var s=i(78956),n=i(85719);function o(e){return!n.lineToolsDoNotAffectChartInvalidation||e.some((e=>!(0,s.isLineTool)(e)))}},27538:(e,t,i)=>{"use strict";i.d(t,{StatusProviderBase:()=>s});class s{size(){return"13px"}bold(){return!1}}},27777:(e,t,i)=>{"use strict";i.d(t,{StatusView:()=>s});class s{constructor(e){this._text="",this._color="",this._size="13px",this._bold=!1,this._statusProvider=e}text(){return this._text}getSplitTitle(){return[this._text]}bold(){return this._bold}size(){return this._size}}},47806:(e,t,i)=>{"use strict";i.d(t,{AbstractFilledAreaPaneView:()=>p});var s=i(50151),n=i(86441),o=i(5531),r=i(29981),a=i(94784),l=i(67716),c=i(62499);function h(e,t){return Array.from({length:e},((e,i)=>({timePointIndex:i+t})))}function d(e,t,i){let s,n;const o=e.length;for(let r=t;r>=0&&re.id))}_plotIndex1(){return null===this._plIndex1&&(this._plIndex1=this._plotNames().indexOf(this._plotAId())+1),this._plIndex1}_plotIndex2(){return null===this._plIndex2&&(this._plIndex2=this._plotNames().indexOf(this._plotBId())+1),this._plIndex2}_updateImplFull(e){if(this._areaRenderer.setData(null),this._dataInvalidated?.clearData&&(this._items=[]),!this._visible())return!1;if(null===this._priceScale())return!1;if(null===this._firstValue())return!1;const t=this._source.plots().plottableRange(),i=t.size();if(0===i)return!1;const n=this._source.offset(this._plotAId()),o=this._source.offset(this._plotBId()),a=Math.min(n,o),l=Math.max(n,o);let c=e.firstIndex;const d=i+(l-a)+1,u=this._plotIndex1(),_=this._plotIndex2();d!==this._items.length&&(void 0===c||0===this._items.length||ce.timePointIndex=0&&te.timePointIndex=this._items.length)return;const y=Math.min(this._items.length-1,(0,r.lowerbound)(this._items,c.lastBar(),((e,t)=>e.timePointIndex{if(this._model.timeScale().barSpacing()<1||!this._fillToIntersection||void 0===w||void 0===w.xCoordinate||void 0===w.plot1Coordinate||void 0===w.plot2Coordinate||null===P||null===C||0===C.points1.length()||void 0===e||void 0===t)return;const s=new n.Point(w.xCoordinate,w.plot1Coordinate),r=new n.Point(w.xCoordinate,w.plot2Coordinate),a=new n.Point(i,e),l=new n.Point(i,t),c=(0,o.intersectLineSegments)(s,a,r,l);if(null!==c){const e=s.add(s.subtract(a).scaled(-c));P.addPoints1Point(C.points1.at(C.points1.length()-1).x,C.points1.at(C.points1.length()-1).y),P.addPoints2Point(C.points2.at(C.points1.length()-1).x,C.points2.at(C.points1.length()-1).y),P.addPoints1Point(e.x,e.y),P.addPoints1Point(e.x,e.y),C.points1.at(C.points1.length()-1).x=e.x,C.points1.at(C.points1.length()-1).y=e.y,C.points2.at(C.points2.length()-1).x=e.x,C.points2.at(C.points2.length()-1).y=e.y}},I=this._commonColor();let M;1===I.type?(I.coordinate1=h(I.value1),I.coordinate2=h(I.value2),I.color1=I.color1&&this._generateColor(I.color1,p),I.color2=I.color2&&this._generateColor(I.color2,p)):I.color=this._generateColor(I.color,p);for(let e=v;e<=S;e+=1){const t=this._items[e],s=t.timePointIndex;let n,o;!this._fillGaps&&void 0!==M&&s-M>1&&(C=null),void 0!==i?(n=i.level1,o=i.level2):(n=t.plot1Coordinate=void 0===t.plot1Value?void 0:h(t.plot1Value),o=t.plot2Coordinate=void 0===t.plot2Value?void 0:h(t.plot2Value));const r=t.xCoordinate=a.indexToCoordinate(t.timePointIndex);if(t.color&&1===t.color.type&&(t.color.coordinate1=h(t.color.value1),t.color.coordinate2=h(t.color.value2)),
this._fillGaps?void 0!==n||void 0!==o:void 0!==n&&void 0!==o){const i=null!==this._colorPlotIndex?t.color||_:I;if(x(n,o,r),L=i,!(null===(A=T)||null===L?A===L:0===A.type&&0===L.type?A.color===L.color:1===A.type&&1===L.type&&A.color1===L.color1&&A.color2===L.color2&&A.coordinate1===L.coordinate1&&A.coordinate2===L.coordinate2)||null===C){if(null!==C&&(void 0!==n&&C.addPoints1Point(r,n),void 0!==o&&C.addPoints2Point(r,o)),e===S)continue;T=i;const t=u(i),s=b.get(t)??new l.AreaBackgroundItemsGroup(i);P=C,C=s.newItem()??new l.AreaBackgroundItem,s.push(C),b.set(t,s)}void 0!==n&&C.addPoints1Point(r,n),void 0!==o&&C.addPoints2Point(r,o)}else this._fillGaps||(T=null,C=null,P=null);M=s,w=t}var A,L;b.delete(u(_));const k={barSpacing:this._model.timeScale().barSpacing(),colorAreas:b};this._areaRenderer.setData(k)}}},46463:(e,t,i)=>{"use strict";i.d(t,{AreaBackgroundPaneView:()=>o});var s=i(50151),n=i(47806);class o extends n.AbstractFilledAreaPaneView{constructor(e,t){super(e,t)}_plotAId(){return(0,s.ensureDefined)(this._source.metaInfo().area)[0].name}_plotBId(){return(0,s.ensureDefined)(this._source.metaInfo().area)[1].name}_commonColor(){return{type:0,color:this._source.properties().areaBackground.backgroundColor.value()}}_transparency(){return this._source.properties().areaBackground.transparency?.value()??0}_visible(){return this._source.properties().areaBackground.fillBackground.value()}_getColorByPlotValue(e){return this._commonColor()}}},17534:(e,t,i)=>{"use strict";i.d(t,{prepareStudyProperties:()=>w,prepareStudyPropertiesForLoadChart:()=>g});var s=i(16738),n=i(30551),o=i(9343),r=i(68159),a=i(37265),l=i(51056),c=i(35039),h=i(79303),d=i(31229),u=i(32679),_=i(94260),p=i(94113);const m=(0,o.getLogger)("Chart.Study");function g(e,t,i,n,o,l){return function(e,t,i,n,o,l,h){const d=function(e,t,i,n,o){e.version&&i.version&&e.version!==i.version&&m.logWarn("Serialized metaInfo version "+e.version+" is not equal to the saved state version "+i.version);const l=t||e,h=(0,a.clone)(l.defaults)??{},d=r.StudyMetaInfo.getStudyPropertyRootName(l),u=r.StudyMetaInfo.getStudyPropertyRootName(e);let _=y();(0,s.default)(_,f(e)),(0,s.default)(_,(0,a.clone)(e.defaults)),(0,s.default)(_,h),(0,s.default)(_,(0,c.factoryDefaults)(d)),(0,s.default)(_,(0,c.factoryDefaults)(u)),(0,s.default)(_,v(l,n,d)),(0,s.default)(_,v(e,n,u)),(0,s.default)(_,i),_=n.updateStudyState(_,e,t),void 0!==o&&t&&(_=o(i,_,e,t));r.StudyMetaInfo.versionOf(l)>=1&&(0,s.default)(_,S(h,_));return _}(e,t,i,n,l);return P(t||e,o,d,h)}(e,t,i,n,r.StudyMetaInfo.getStudyPropertyRootName(e),o,l)}function f(e){const t={};if(e.plots)for(let i=0;i= 1");const l=r.StudyMetaInfo.getStudyPropertyRootName(e),h=(0,a.clone)(e.defaults),d=(0,c.factoryDefaults)(l),u=y();if((0,s.default)(u,f(e)),(0,s.default)(u,h),(0,s.default)(u,d),(0,s.default)(u,v(e,o,l)),(0,s.default)(u,t),(0,s.default)(u,S(h,u)),null!==i){const t=i.model().studiesColorRotatorFactory().getColorRotator(e);null!==t&&("Overlay@tv-basicstudies"===e.id?u.lineStyle.color=t.getColor(u.lineStyle.color,d.lineStyle.color===u.lineStyle.color):(0,s.default)(u,function(e,t){for(const i of Object.keys(e.styles)){const s=e.styles[i];if((0,n.isObject)(s)&&"color"in s){const e=s.color;s.color=t.getColor(e)}}return e}(u,t)))}return o.updateStudyInputsIfNeeded(u,u.version??e.version,e),u}function w(e,t,i,s,n){return function(e,t,i,s,n,o){const l=b(e,t,i,s),c=r.StudyMetaInfo.getSourceInputIds(e);return c.forEach(((e,t)=>{const i=l.inputs[e];t{"use strict";i.d(t,{containsBackgroundTimePointIndexes:()=>r,dematerializeBackground:()=>l,isBackgroundInBarsRange:()=>c,materializeBackground:()=>a});var s=i(50151),n=i(50503),o=i(65039);const r=!0;function a(e,t){if(e.start>=t.length||e.stop>=t.length)return null;const i=t[e.start],o=t[e.stop];return o===n.INVALID_TIME_POINT_INDEX?null:((0,s.assert)(i===n.INVALID_TIME_POINT_INDEX||i<=o,"start should not exceed stop"),{start:i===n.INVALID_TIME_POINT_INDEX?null:i,stop:o})}function l(e,t,i){return{id:t,start:(0,o.ensureTimePointIndexIndex)(i.indexOf(null!==e.start?e.start:n.INVALID_TIME_POINT_INDEX)),stop:(0,o.ensureTimePointIndexIndex)(i.indexOf(e.stop))}}function c(e,t){if(null===e.start)return t.firstBar()<=e.stop;const i=Math.min(e.start,e.stop),s=Math.max(e.start,e.stop);return t.contains(i)||t.contains(s)||it.lastBar()}},14019:(e,t,i)=>{"use strict";i.d(t,{LiveStudyGraphics:()=>r.LiveStudyGraphics,createGraphicsPaneViews:()=>_,createGraphicsPriceAxisViews:()=>m,emptyStudyGraphics:()=>o.emptyStudyGraphics,isStudyGraphicsEmpty:()=>n.isStudyGraphicsEmpty,loadStudyGraphics:()=>o.loadStudyGraphics,saveStudyGraphics:()=>o.saveStudyGraphics});var s=i(9343),n=i(58137),o=i(22837),r=i(26246),a=i(98558),l=i(19063);class c extends a.PriceAxisView{constructor(e,t){super(),this._source=e,this._data=t}_updateRendererData(e,t,i){e.visible=!1;const s=this._source.priceScale(),n=this._source.properties().childs(),o=n.visible.value();if(!s||s.isEmpty()||!o)return;const r=n.graphics.childs()[this._data.lineType]?.childs()[this._data.styleId]?.childs();if(!(void 0!==r&&r.visible&&r.visible.value()&&r.showPrice&&r.showPrice.value()&&this._isLabelVisibleAccordinglyToProperties()))return;const a=this._source.firstValue();if(null===a)return;const c=this._data.line.level,h=(0,l.resetTransparency)(r.color.value());i.background=h,i.textColor=this.generateTextColor(h),i.coordinate=s.priceToCoordinate(c,a),e.text=s.formatPrice(c,a,{signPositive:s.isPercentage()}),e.visible=!0}_isLabelVisibleAccordinglyToProperties(){return!!this._source.model().properties().childs().scalesProperties.childs().showStudyLastValue.value()&&this._source.properties().childs().showLabelsOnPriceScale.value()}}const h=(0,s.getLogger)("Chart.StudyGraphics"),d=new Set(["dwgtablecells","tpoBlockSets","tpoLevels","tpoVolumeRows","logs","performance"]);async function u(e,t,s,n){const o=e=>({regularPaneView:new e(t,s,n)});switch(e){case"hhists":return o((await i.e(507).then(i.bind(i,56208))).HHistPaneView);case"horizlines":return o((await i.e(507).then(i.bind(i,95258))).HorizLinePaneView);case"vertlines":return o((await i.e(507).then(i.bind(i,51914))).VertLinePaneView);case"polygons":return o((await i.e(507).then(i.bind(i,38332))).PolygonPaneView);case"backgrounds":return o((await i.e(507).then(i.bind(i,55269))).BackgroundPaneView)}return null}async function _(e,t,i){const s=[],n=[],o=Object.keys(e.graphicsInfo());o.sort(((e,t)=>p(e)-p(t)));for(const r of o){const o=await u(r,e,t,i);null!==o?(s.push(o.regularPaneView),
o.forceOverlayPaneView&&n.push(o.forceOverlayPaneView)):d.has(r)||h.logWarn(`${r} is not supported by this build of graphics subsystem, skipping`)}return{regularPaneViews:s,forceOverlayPaneViews:n}}function p(e){return n.primitivesZOrders.get(e)??0}function m(e){const t=Object.keys(e.graphicsInfo()),i=[];for(const s of t)switch(s){case"hlines":e.graphics().hlines().forEach(((t,n)=>{t.forEach((t=>{void 0!==t.level&&i.push(new c(e,{line:{level:t.level},styleId:n,lineType:s}))}))}));break;case"horizlines":e.graphics().horizlines().forEach(((t,n)=>{t.forEach((t=>{void 0!==t.level&&i.push(new c(e,{line:{level:t.level},styleId:n,lineType:s}))}))}))}return i}},9233:(e,t,i)=>{"use strict";i.d(t,{HHistDirection:()=>s,HHistLocation:()=>n,HHistVolumeMode:()=>o,containsHHistTimePointIndexes:()=>c,dematerializeHHist:()=>d,isHHistInBarsRange:()=>u,materializeHHist:()=>h});var s,n,o,r=i(50151),a=i(50503),l=i(65039);!function(e){e.LeftToRight="left_to_right",e.RightToLeft="right_to_left"}(s||(s={})),function(e){e.Relative="relative",e.Absolute="absolute"}(n||(n={})),function(e){e.UpDown="Up/Down",e.Total="Total",e.Delta="Delta"}(o||(o={}));const c=!0;function h(e,t){if(e.lastBarTime>=t.length)return null;const i=t[e.firstBarTime],s=t[e.lastBarTime];return s===a.INVALID_TIME_POINT_INDEX?null:((0,r.assert)(i<=s,"firstBarTime should not exceed lastBarTime"),(0,r.assert)(e.priceLow<=e.priceHigh,"priceLow should not exceed priceHigh"),{firstBarTime:i===a.INVALID_TIME_POINT_INDEX?null:i,lastBarTime:s,rate:e.rate,priceHigh:e.priceHigh,priceLow:e.priceLow})}function d(e,t,i){const s=(0,l.ensureTimePointIndexIndex)(i.indexOf(e.firstBarTime??a.INVALID_TIME_POINT_INDEX)),n=(0,l.ensureTimePointIndexIndex)(i.indexOf(e.lastBarTime));return{id:t,...e,firstBarTime:s,lastBarTime:n}}function u(e,t){const i=Math.min(e.firstBarTime??a.INVALID_TIME_POINT_INDEX,e.lastBarTime),s=Math.max(e.firstBarTime??a.INVALID_TIME_POINT_INDEX,e.lastBarTime);return t.contains(i)||t.contains(s)||it.lastBar()}},45721:(e,t,i)=>{"use strict";i.d(t,{containsHorizLineTimePointIndexes:()=>r,dematerializeHorizLine:()=>l,isHorizLineInBarsRange:()=>c,materializeHorizLine:()=>a});var s=i(50151),n=i(50503),o=i(65039);const r=!0;function a(e,t){if(e.startIndex>=t.length||e.endIndex>=t.length)return null;const i=t[e.startIndex],o=t[e.endIndex];return o===n.INVALID_TIME_POINT_INDEX?null:((0,s.assert)(i<=o,"startIndex should not exceed endIndex"),{startIndex:i===n.INVALID_TIME_POINT_INDEX?null:i,endIndex:o,level:e.level,extendLeft:e.extendLeft,extendRight:e.extendRight})}function l(e,t,i){const s=(0,o.ensureTimePointIndexIndex)(i.indexOf(e.startIndex??n.INVALID_TIME_POINT_INDEX)),r=(0,o.ensureTimePointIndexIndex)(i.indexOf(e.endIndex));return{id:t,...e,startIndex:s,endIndex:r}}function c(e,t){if(null===e.startIndex)return t.firstBar()<=e.endIndex;const i=Math.min(e.startIndex,e.endIndex),s=Math.max(e.startIndex,e.endIndex);if(t.contains(i)||t.contains(s)||it.lastBar())return!0
;const n=e.startIndext.lastBar()&&n}},26246:(e,t,i)=>{"use strict";i.d(t,{LiveStudyGraphics:()=>_});var s=i(50151),n=i(29981),o=i(52033),r=i(9233),a=i(45721),l=i(28656),c=i(55257),h=i(28490),d=i(58137),u=i(22837);class _{constructor(e={}){this._indexes=[],this._hhistsByTimePointIndex=new Map,this._primitivesCollection=function(e){const t={};for(const i of d.primitiveNames){t[i]=new Map;const s=e[i];if(void 0!==s)for(const e in s)if(s.hasOwnProperty(e))switch(i){case"horizlines":t[i].set(e,v.horizlines());break;case"vertlines":t[i].set(e,v.vertlines());break;case"backgrounds":t[i].set(e,v.backgrounds());break;case"polygons":t[i].set(e,v.polygons());break;case"hhists":t[i].set(e,v.hhists())}}0;return t}(e)}horizlines(){return this._primitivesCollection.horizlines}vertlines(){return this._primitivesCollection.vertlines}lines(){return this._primitivesCollection.lines}hlines(){return this._primitivesCollection.hlines}textmarks(){return this._primitivesCollection.textmarks}shapemarks(){return this._primitivesCollection.shapemarks}backgrounds(){return this._primitivesCollection.backgrounds}polygons(){return this._primitivesCollection.polygons}trendchannels(){return this._primitivesCollection.trendchannels}hhists(){return this._primitivesCollection.hhists}dwglabels(){return this._primitivesCollection.dwglabels}dwglines(){return this._primitivesCollection.dwglines}dwgpolylines(){return this._primitivesCollection.dwgpolylines}dwgboxes(){return this._primitivesCollection.dwgboxes}dwgtables(){return this._primitivesCollection.dwgtables}dwgtablecells(){return this._primitivesCollection.dwgtablecells}dwglinefills(){return this._primitivesCollection.dwglinefills}tpos(){return this._primitivesCollection.tpos}tpoBlockSets(){return this._primitivesCollection.tpoBlockSets}tpoLevels(){return this._primitivesCollection.tpoLevels}tpoVolumeRows(){return this._primitivesCollection.tpoVolumeRows}tpoSummaryInfo(){return this._primitivesCollection.tpoSummaryInfo}logs(){return this._primitivesCollection.logs}observableLogs(){return this._primitivesCollection.logs}performance(){return this._primitivesCollection.performance}observablePerformance(){return this._primitivesCollection.performance}footprints(){return this._primitivesCollection.footprints}footprintLevels(){return this._primitivesCollection.footprintLevels}hhistsByTimePointIndex(){return this._hhistsByTimePointIndex}clear(){this._indexes=[];for(const e of d.regularPrimitiveNames)this._primitivesCollection[e].forEach((e=>e.clear()));for(const e of d.groupedPrimitiveNames)this._primitivesCollection[e].forEach((e=>{e.forEach((e=>e.clear()))}));this._hhistsByTimePointIndex=new Map}extract(){const e={indexes:this._indexes,horizlines:g(this._primitivesCollection.horizlines),vertlines:g(this._primitivesCollection.vertlines),lines:g(this._primitivesCollection.lines),hlines:g(this._primitivesCollection.hlines),textmarks:g(this._primitivesCollection.textmarks),
shapemarks:g(this._primitivesCollection.shapemarks),backgrounds:g(this._primitivesCollection.backgrounds),polygons:g(this._primitivesCollection.polygons),trendchannels:g(this._primitivesCollection.trendchannels),hhists:g(this._primitivesCollection.hhists),dwglabels:f(this._primitivesCollection.dwglabels),dwglines:f(this._primitivesCollection.dwglines),dwgpolylines:f(this._primitivesCollection.dwgpolylines),dwgboxes:f(this._primitivesCollection.dwgboxes),dwgtables:f(this._primitivesCollection.dwgtables),dwgtablecells:g(this._primitivesCollection.dwgtablecells),dwglinefills:g(this._primitivesCollection.dwglinefills),tpos:g(this._primitivesCollection.tpos),tpoBlockSets:f(this._primitivesCollection.tpoBlockSets),tpoLevels:f(this._primitivesCollection.tpoLevels),tpoVolumeRows:f(this._primitivesCollection.tpoVolumeRows),tpoSummaryInfo:f(this._primitivesCollection.tpoSummaryInfo),logs:new Map,performance:new Map,footprints:g(this._primitivesCollection.footprints),footprintLevels:g(this._primitivesCollection.footprintLevels)};return this._hhistsByTimePointIndex=new Map,new u.StaticStudyGraphics("data",e)}replaceIndexesTo(e){this._indexes=e;const t=e=>e.replaceIndexesTo(this._indexes);for(const e of d.regularPrimitiveNames)this._primitivesCollection[e].forEach(t);for(const e of d.groupedPrimitiveNames)this._primitivesCollection[e].forEach((e=>{e.forEach(t)}));this._hhistsByTimePointIndex=(0,d.splitHHistsByTimePointIndex)(this._primitivesCollection.hhists)}processCommands(e){void 0!==e.erase&&this._processEraseCommands(e.erase),void 0!==e.create&&this._processCreateCommands(e.create)}_processCreateCommands(e){for(const t in e){if(!e.hasOwnProperty(t))continue;const i=t;switch(i){case"hhists":y(this._indexes,this._primitivesCollection.hhists,e[i]);break;case"horizlines":y(this._indexes,this._primitivesCollection.horizlines,e[i]);break;case"vertlines":y(this._indexes,this._primitivesCollection.vertlines,e[i]);break;case"polygons":y(this._indexes,this._primitivesCollection.polygons,e[i]);break;case"backgrounds":y(this._indexes,this._primitivesCollection.backgrounds,e[i])}}this._hhistsByTimePointIndex=(0,d.splitHHistsByTimePointIndex)(this._primitivesCollection.hhists)}_processEraseCommands(e){for(const t of e)if("all"===t.action){for(const e of d.regularPrimitiveNames)this._primitivesCollection[e].forEach((e=>e.clearPrimitives()));for(const e of d.groupedPrimitiveNames)this._primitivesCollection[e].forEach((e=>{e.forEach((e=>e.clearPrimitives()))}))}else{const e=e=>e.deleteById(t.id);(0,d.isRegularPrimiriveName)(t.type)?this._primitivesCollection[t.type].forEach(e):this._primitivesCollection[t.type].forEach((t=>{t.forEach(e)}))}this._hhistsByTimePointIndex=(0,d.splitHHistsByTimePointIndex)(this._primitivesCollection.hhists)}}class p{constructor(e,t){this._primitivesDataById=new Map,this._primitiveById=new Map,this._changed=new o.Delegate,this._cleared=new o.Delegate,this._materializePrimitive=e,this._isRematerializationRequiredWithNewIndexes=t}changed(){return this._changed}cleared(){return this._cleared}forEach(e,t){
this._primitiveById.forEach((i=>{e.call(t,i,i,this)}))}has(e){let t=!1;return this._primitiveById.forEach((i=>{t=t||i===e})),t}get size(){return this._primitiveById.size}[Symbol.iterator](){return this._primitiveById.values()}entries(){throw new Error("Not implemented")}keys(){throw new Error("Not implemented")}union(){throw new Error("Not implemented")}intersection(){throw new Error("Not implemented")}difference(){throw new Error("Not implemented")}symmetricDifference(){throw new Error("Not implemented")}isSubsetOf(){throw new Error("Not implemented")}isSupersetOf(){throw new Error("Not implemented")}isDisjointFrom(){throw new Error("Not implemented")}values(){return this._primitiveById.values()}hasId(e){return this._primitiveById.has(e)}addData(e,t){const i=[];e.forEach((e=>{this._primitivesDataById.set(e.id,e);const s=this._tryMaterialize(t,e);null!==s&&i.push(s)})),i.length>0&&this._changed.fire({created:i,removed:[]})}deleteById(e){const t=this._primitiveById.get(e);t&&(this._primitiveById.delete(e),this._primitivesDataById.delete(e),this._changed.fire({created:[],removed:[t]}))}clear(){this.clearPrimitives()}clearPrimitives(){this._primitivesDataById.clear(),this._primitiveById.clear(),this._cleared.fire()}replaceIndexesTo(e){if(!this._isRematerializationRequiredWithNewIndexes)return;const t=Array.from(this._primitiveById.values());this._primitiveById.clear(),this._primitivesDataById.forEach(this._tryMaterialize.bind(this,e),this);const i=Array.from(this._primitiveById.values());this._changed.fire({created:i,removed:t})}extract(){const e=new Set(this._primitivesDataById.values());return this.clearPrimitives(),e}_tryMaterialize(e,t){const i=this._materializePrimitive(t,e);return null!==i&&((0,s.assert)(!this._primitiveById.has(t.id),"primitive with specified id should not exist"),this._primitiveById.set(t.id,i)),i}}function m(e){const t=new Map;for(const[o,r]of e)t.set(o,(i=r,(s=t.get(o))?(0,n.join)(s,i.extract()):i.extract()));var i,s;return t}function g(e){return m((0,n.mapEntriesGenerator)(e))}function f(e){return m((0,n.nestedMapGenerator)(e))}function y(e,t,i=[]){for(const n of i){const i=n.styleId,o=t.get(i);(0,s.assert)(void 0!==o,"Every style used by graphics primitive should be declared in study metainfo"),o.addData(n.data,e)}}const v={horizlines:()=>new p(a.materializeHorizLine,a.containsHorizLineTimePointIndexes),vertlines:()=>new p(l.materializeVertLine,l.containsVertLineTimePointIndexes),lines:()=>new p(materializeLine,containsLineTimePointIndexes),hlines:()=>new p(materializeLevel,containsLevelTimePointIndexes),textmarks:()=>new p(materializeTextMark,containsTextMarkTimePointIndexes),shapemarks:()=>new p(materializeShapeMark,containsShapeMarkTimePointIndexes),backgrounds:()=>new p(h.materializeBackground,h.containsBackgroundTimePointIndexes),polygons:()=>new p(c.materializePolygon,c.containsPolygonTimePointIndexes),trendchannels:()=>new p(materializeTrendChannel,containsTrendChannelTimePointIndexes),hhists:()=>new p(r.materializeHHist,r.containsHHistTimePointIndexes),
dwglines:()=>new p(materializeDwgLine,containsDwgLineTimePointIndexes),dwglinefills:()=>new p(materializeDwgLineFill,containsDwgLineFillTimePointIndexes),dwglabels:()=>new p(materializeDwgLabel,containsDwgLabelTimePointIndexes),dwgtablecells:()=>new p(materializeDwgTableCell,containsDwgTableCellTimePointIndexes),dwgpolylines:()=>new p(materializeDwgPolyline,containsDwgPolylineTimePointIndexes),dwgboxes:()=>new p(materializeDwgBox,containsDwgBoxTimePointIndexes),dwgtables:()=>new p(materializeDwgTable,containsDwgTableTimePointIndexes),tpos:()=>new p(materializeTpo,containsTpoTimePointIndexes),tpoBlockSets:()=>new p(materializeTpoBlockSet,containsTpoBlockSetTimePointIndexes),tpoLevels:()=>new p(materializeTpoLevelGroup,containsTpoLevelGroupTimePointIndexes),tpoVolumeRows:()=>new p(materializeTpoVolumeRow,containsTpoVolumeRowTimePointIndexes),tpoSummary:()=>new p(materializeTpoSummary,containsTpoSummaryTimePointIndexes),logs:()=>new p(materializeLog,containsLogTimePointIndexes),footprints:()=>new p(materializeVolumeFootprint,containsFootprintTimePointIndexes),footprintLevels:()=>new p(materializeVolumeFootprintPriceLevel,containsFootprintPriceLevelTimePointIndexes)}},55257:(e,t,i)=>{"use strict";i.d(t,{containsPolygonTimePointIndexes:()=>o,dematerializePolygon:()=>a,isPolygonInBarsRange:()=>l,materializePolygon:()=>r});var s=i(50503),n=i(65039);const o=!0;function r(e,t){for(const i of e.points){if(i.index>=t.length)return null;if(t[i.index]===s.INVALID_TIME_POINT_INDEX)return null}return{points:e.points.map((e=>({index:t[e.index],offset:e.offset,level:e.level})))}}function a(e,t,i){return{id:t,points:e.points.map((e=>({...e,index:(0,n.ensureTimePointIndexIndex)(i.indexOf(e.index))})))}}function l(e,t){if(e.points.some((e=>t.contains(e.index+(e.offset??0)))))return!0;let i=!1,s=!1;const n=t.firstBar();for(const t of e.points)t.index+(t.offset??0){"use strict";function s(e){if(e<0)throw new Error("TimePointIndexIndex should be non-negative integer");return e}i.d(t,{ensureTimePointIndexIndex:()=>s})},22837:(e,t,i)=>{"use strict";i.d(t,{StaticStudyGraphics:()=>d,emptyStudyGraphics:()=>g,loadStudyGraphics:()=>f,saveStudyGraphics:()=>y});var s=i(50503),n=i(45721),o=i(28656),r=i(9233),a=i(55257),l=i(28490),c=i(58137),h=i(37265);class d{constructor(e,t){if(this._indexes=[],this._horizlines=new Map,this._vertlines=new Map,this._lines=new Map,this._hlines=new Map,this._textmarks=new Map,this._shapemarks=new Map,this._backgrounds=new Map,this._polygons=new Map,this._trendchannels=new Map,this._hhists=new Map,this._dwglabels=new Map,this._dwglines=new Map,this._dwgpolylines=new Map,this._dwgboxes=new Map,this._dwgtables=new Map,this._dwgtablecells=new Map,this._dwglinefills=new Map,this._tpos=new Map,this._tpoBlockSets=new Map,this._tpoLevelGroups=new Map,this._tpoVolumeRows=new Map,this._tpoSummaryInfo=new Map,this._logs=new Map,this._performance=new Map,this._footprints=new Map,this._footprintLevels=new Map,"data"===e){const e=t;this._indexes=e.indexes,
this._vertlines=u(e.vertlines,this._indexes,o.materializeVertLine),this._horizlines=u(e.horizlines,this._indexes,n.materializeHorizLine),this._polygons=u(e.polygons,this._indexes,a.materializePolygon),this._hhists=u(e.hhists,this._indexes,r.materializeHHist),this._backgrounds=u(e.backgrounds,this._indexes,l.materializeBackground)}else if("state"===e){const e=t;this._indexes=e.indexes||[],this._vertlines=_(e.vertlines,this._indexes,o.materializeVertLine),this._horizlines=_(e.horizlines,this._indexes,n.materializeHorizLine),this._polygons=_(e.polygons,this._indexes,a.materializePolygon),this._hhists=_(e.hhists,this._indexes,r.materializeHHist),this._backgrounds=_(e.backgrounds,this._indexes,l.materializeBackground)}this._hhistsByTimePointIndex=(0,c.splitHHistsByTimePointIndex)(this._hhists)}horizlines(){return this._horizlines}vertlines(){return this._vertlines}lines(){return this._lines}hlines(){return this._hlines}textmarks(){return this._textmarks}shapemarks(){return this._shapemarks}backgrounds(){return this._backgrounds}polygons(){return this._polygons}trendchannels(){return this._trendchannels}hhists(){return this._hhists}dwglabels(){return this._dwglabels}dwglines(){return this._dwglines}dwgpolylines(){return this._dwgpolylines}dwgboxes(){return this._dwgboxes}dwgtables(){return this._dwgtables}dwgtablecells(){return this._dwgtablecells}dwglinefills(){return this._dwglinefills}tpos(){return this._tpos}tpoBlockSets(){return this._tpoBlockSets}tpoLevels(e){return this._tpoLevelGroups}tpoVolumeRows(e){return this._tpoVolumeRows}tpoSummaryInfo(e){return this._tpoSummaryInfo}logs(){return this._logs}performance(){return this._performance}footprints(){return this._footprints}footprintLevels(){return this._footprintLevels}hhistsByTimePointIndex(){return this._hhistsByTimePointIndex}}function u(e,t,i){return new Map(Array.from(e.entries()).map((e=>[e[0],new Set(Array.from(e[1]).map((e=>i(e,t))).filter(h.notNull))])))}function _(e,t,i){const s=new Map;if(void 0===e)return s;for(const n of e){const e=n.styleId,o=s.get(e)||new Set;n.data.forEach((e=>{const s=i(e,t);null!==s&&o.add(s)})),s.set(e,o)}return s}function p(e,t,i){let s=null;for(const i of e)i.styleId===t&&(s=i);null===s&&(s={styleId:t,data:[]},e.push(s)),s.data.push(i)}function m(e,t,i,s,n,o){const r=[];return e.forEach(((e,a)=>{e.forEach((e=>{(null===n||s(e,n))&&p(r,a,o(e,t(e),i))}))})),r.length>0?r:void 0}function g(){return new d}function f(e){return new d("state",e)}function y(e,t){const i=function(e){const t=new Set,i=e=>{null!=e&&t.add(e)};e.horizlines().forEach(((e,i)=>{e.forEach((e=>{t.add(e.startIndex??s.INVALID_TIME_POINT_INDEX),t.add(e.endIndex)}))})),e.vertlines().forEach(((e,i)=>{e.forEach((e=>{t.add(e.index)}))})),e.lines().forEach(((e,i)=>{e.forEach((e=>{t.add(e.startIndex),t.add(e.endIndex)}))})),e.textmarks().forEach(((e,i)=>{e.forEach((e=>{t.add(e.time)}))})),e.shapemarks().forEach(((e,i)=>{e.forEach((e=>{t.add(e.time)}))})),e.backgrounds().forEach(((e,i)=>{e.forEach((e=>{t.add(null!==e.start?e.start:s.INVALID_TIME_POINT_INDEX),t.add(e.stop)}))
})),e.polygons().forEach(((e,i)=>{e.forEach((e=>{e.points.forEach((e=>{t.add(e.index)}))}))})),e.trendchannels().forEach(((e,i)=>{e.forEach((e=>{t.add(e.startIndex),t.add(e.endIndex)}))})),e.hhists().forEach(((e,i)=>{e.forEach((e=>{t.add(e.firstBarTime??s.INVALID_TIME_POINT_INDEX),t.add(e.lastBarTime)}))})),e.dwglabels().forEach((e=>{e.forEach((e=>{e.forEach((e=>{t.add(e.x)}))}))})),e.dwglines().forEach((e=>{e.forEach((e=>{e.forEach((e=>{t.add(e.x1??s.INVALID_TIME_POINT_INDEX),t.add(e.x2??s.INVALID_TIME_POINT_INDEX)}))}))})),e.dwgpolylines().forEach((e=>{e.forEach((e=>{e.forEach((e=>{for(const i of e.points)t.add(i.x??s.INVALID_TIME_POINT_INDEX)}))}))})),e.dwgboxes().forEach((e=>{e.forEach((e=>{e.forEach((e=>{t.add(e.left??s.INVALID_TIME_POINT_INDEX),t.add(e.right??s.INVALID_TIME_POINT_INDEX)}))}))})),e.tpos().forEach((e=>{e.forEach((e=>{t.add(e.firstBarTime),t.add(e.lastBarTime)}))})),e.tpoLevels().forEach((e=>{e.forEach((e=>{e.forEach((e=>{i(e.poorHighExtendTo),i(e.poorLowExtendTo),i(e.tpoPocExtendTo),(e.singleprints??[]).map((e=>e.extendTo)).map(i)}))}))})),e.footprints().forEach((e=>{e.forEach((e=>{t.add(e.index)}))})),e.footprintLevels().forEach((e=>{e.forEach((e=>{t.add(e.startIndex),i(e.extendTo)}))}));const n=Array.from(t);return n.sort(((e,t)=>e-t)),n}(e),c={indexes:i};let h=0;const d=()=>++h;return c.vertlines=m(e.vertlines(),d,i,o.isVertLineInBarsRange,t,o.dematerializeVertLine),c.horizlines=m(e.horizlines(),d,i,n.isHorizLineInBarsRange,t,n.dematerializeHorizLine),c.polygons=m(e.polygons(),d,i,a.isPolygonInBarsRange,t,a.dematerializePolygon),c.hhists=m(e.hhists(),d,i,r.isHHistInBarsRange,t,r.dematerializeHHist),c.backgrounds=m(e.backgrounds(),d,i,l.isBackgroundInBarsRange,t,l.dematerializeBackground),c}},85904:(e,t,i)=>{"use strict";var s,n,o,r;i.d(t,{HAlign:()=>n,LineStyle:()=>r,MarkLocation:()=>s}),function(e){e.AboveBar="AboveBar",e.BelowBar="BelowBar",e.Top="Top",e.Bottom="Bottom",e.Right="Right",e.Left="Left",e.Absolute="Absolute",e.AbsoluteUp="AbsoluteUp",e.AbsoluteDown="AbsoluteDown"}(s||(s={})),function(e){e.Left="left",e.Center="center",e.Right="right"}(n||(n={})),function(e){e.Top="top",e.Middle="middle",e.Bottom="bottom"}(o||(o={})),function(e){e[e.Solid=0]="Solid",e[e.Dotted=1]="Dotted",e[e.Dashed=2]="Dashed"}(r||(r={}))},58137:(e,t,i)=>{"use strict";i.d(t,{groupedPrimitiveNames:()=>o,hasForceOverlayPrimitives:()=>d,isRegularPrimiriveName:()=>a,isStudyGraphicsEmpty:()=>c,primitiveNames:()=>r,primitivesZOrders:()=>l,regularPrimitiveNames:()=>n,splitHHistsByTimePointIndex:()=>h});const s=["dwglines","dwgboxes","dwglabels","dwgpolylines","dwgtables"];const n=["horizlines","vertlines","lines","hlines","textmarks","shapemarks","backgrounds","polygons","trendchannels","hhists","dwgtablecells","dwglinefills","tpos","logs","performance","footprints","footprintLevels"],o=s.concat(["tpoBlockSets","tpoLevels","tpoVolumeRows","tpoSummaryInfo"]),r=n.concat(o);function a(e){return n.includes(e)}
const l=new Map([["logs",-4],["performance",-4],["polygons",-4],["trendchannels",-3],["textmarks",-2],["shapemarks",-2],["backgrounds",-1],["footprints",1],["footprintLevels",1],["hlines",1],["horizlines",1],["hhists",1],["dwglinefills",2],["vertlines",3],["lines",3],["dwglines",3],["dwgpolylines",3],["dwgboxes",4],["dwglabels",5],["dwgtables",6],["dwgtablecells",6],["tpos",7],["tpoBlockSets",7],["tpoLevels",7],["tpoVolumeRows",7],["tpoSummaryInfo",1]]);function c(e){return!r.some((t=>{const i=e[t]();for(const[,e]of i)if(e.size>0)return!0;return!1}))}function h(e){const t=new Map;return e.forEach(((e,i)=>{e.forEach((e=>{const s={...e,styleId:i},n=e.firstBarTime;let o=t.get(n);void 0===o&&(o=new Set,t.set(n,o)),o.add(s)}))})),t}function d(e){return!!(e.graphics.dwglines||e.graphics.dwgboxes||e.graphics.dwglabels||e.graphics.dwgpolylines||e.graphics.dwgtables)}},28656:(e,t,i)=>{"use strict";i.d(t,{containsVertLineTimePointIndexes:()=>o,dematerializeVertLine:()=>a,isVertLineInBarsRange:()=>l,materializeVertLine:()=>r});var s=i(50503),n=i(65039);const o=!0;function r(e,t){if(e.index>=t.length)return null;const i=t[e.index];return i===s.INVALID_TIME_POINT_INDEX?null:{startPrice:e.startPrice,endPrice:e.endPrice,index:i,extendTop:e.extendTop,extendBottom:e.extendBottom}}function a(e,t,i){const s=(0,n.ensureTimePointIndexIndex)(i.indexOf(e.index));return{id:t,...e,index:s}}function l(e,t){return t.contains(e.index)}},64671:(e,t,i)=>{"use strict";var s;!function(e){e.BuyAndSell="Buy and sell",e.Delta="Delta",e.Total="Total"}(s||(s={}))},7015:(e,t,i)=>{"use strict";i.d(t,{HHistBasedValuesProvider:()=>m});var s=i(50335),n=i(50151),o=i(49483),r=i(8025),a=i(928),l=i(74079),c=i(9233),h=i(15764),d=i(82587);function u(e,t="",i=""){return{id:t,index:e,title:i,value:"",visible:!1}}const _=o.CheckMobile.any(),p=(0,l.getVolumeFormatter)();class m{constructor(e,t,i=!1){this._emptyValues=[],this._study=e,this._model=t,this._emptyTitles=i,void 0!==this._study.metaInfo().graphics.hhists&&this._emptyValues.push(u(0),u(1),u(2))}getItems(){return this._emptyValues}getValues(e){const t=this._emptyValues.map((e=>({...e})));t.forEach((e=>{e.visible=this._study.isVisible(),e.value=d.notAvailable}));const i=this._study.properties().childs().inputs.childs().volume.value();switch(i){case c.HHistVolumeMode.UpDown:this._emptyTitles||(t[0].title="Up",t[1].title="Down",t[2].title="Total");break;case c.HHistVolumeMode.Total:this._emptyTitles||(t[0].title="Total"),t[1].visible=!1,t[2].visible=!1;break;case c.HHistVolumeMode.Delta:this._emptyTitles||(t[0].title="Delta",t[1].title="Max(Up, Down)",t[2].title="Total")}const o=this._study.priceScale(),a=this._model.timeScale();if(null===o||o.isEmpty()||a.isEmpty()||this._hideValues())return t;if(null===e||!isFinite(e)){const i=this._study.data().last();if(null===i)return t;e=i.index}const l=this._model.crosshairSource(),h=l.price;if(!isFinite(l.y)&&null===(e=function(e,t){const i=e.visibleBarsStrictRange()?.lastBar();if(!i)return null;const s=t.data().search(i,r.PlotRowSearchMode.NearestLeft)
;return s?s.index:null}(this._model.timeScale(),this._model.mainSeries())))return t;const u=function(e,t,i,s){if(0===e.size)return null;if(!i){const e=(0,n.ensureNotNull)(s.data().valueAt(t));i=s.barFunction()(e)}const o=function(e,t){let i=null;return e.forEach(((e,s)=>{null!==s&&s<=t&&(null===i||s>i)&&(i=s)})),i}(e,t);if(null===o)return null;const r=e.get(o);if(!r||0===r.size)return null;return function(e,t){let i=null;return e.forEach((e=>{e.priceLow<=t&&t{e.value="0"})),t;const _=this._study.metaInfo().graphics.hhists;if(void 0===_)return t;if(void 0===_[u.styleId])return t;const m=this._study.properties().childs().graphics.childs().hhists?.childs()[u.styleId]?.childs(),g=e=>(0,s.isNumber)(e)?p.format(e):"";if(i!==c.HHistVolumeMode.Delta){if(u.rate.forEach(((e,i)=>{t[i].value=g(e),t[i].color=(0,n.ensureDefined)(m).colors[i].value()})),i===c.HHistVolumeMode.UpDown){const e=u.rate[0]+u.rate[1];t[2].value=g(e),t[2].color=(0,n.ensureDefined)(m).valuesColor.value()}}else{const e=u.rate[0]>u.rate[1]?0:1,i=(0,n.ensureDefined)(m).colors[e].value(),s=u.rate[0]+u.rate[1];[2*u.rate[e]-s,u.rate[e],s].forEach(((e,s)=>{t[s].value=g(e),t[s].color=i}))}return t}_hideValues(){return _&&(null===this._model.crosshairSource().pane||(0,h.isLineToolName)(a.tool.value())||null!==this._model.lineBeingEdited())}}},16685:(e,t,i)=>{"use strict";var s;i.d(t,{StudyStatusType:()=>s}),function(e){e[e.Undefined=0]="Undefined",e[e.Loading=1]="Loading",e[e.Completed=2]="Completed",e[e.Error=3]="Error"}(s||(s={}))},3462:(e,t,i)=>{"use strict";i.d(t,{makeNextStudyId:()=>r,makeNextSymbolId:()=>n});let s=0;function n(){return s++,"ss_"+s}let o=0;function r(){return o++,"st"+o}},62499:(e,t,i)=>{"use strict";function s(e,t){if(null===e)return t;const i=e.firstIndex,s=t.firstIndex,n=e.clearData||t.clearData;return{firstIndex:n||void 0===i||void 0===s?void 0:Math.min(i,s),clearData:n}}i.d(t,{mergeDataInvalidation:()=>s})},72530:(e,t,i)=>{"use strict";i.d(t,{migrateMetaInfoAndPropState:()=>p});var s=i(50151),n=i(68159),o=i(37265);const r=["Moving Average@tv-basicstudies","Moving Average Exponential@tv-basicstudies"];class a{targetMetaInfoVersion(){return 53}migrateMetaInfo(e){const t=e;e._metainfoVersion=53,r.includes(t.id)}migratePropState(e){r.includes(e.id)&&(e.inputs.length=e.inputs.length??e.inputs.in_0,e.inputs.source=e.inputs.source??e.inputs.in_1,e.inputs.offset=e.inputs.offset??e.inputs.in_2,delete e.inputs.in_0,delete e.inputs.in_1,delete e.inputs.in_2,e.plots[1]={id:"smoothedMA",type:"line"},e.styles.smoothedMA={display:0,linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#0496ff",histogramBase:0,joinPoints:!1,title:"Smoothed MA"})}}const l=["Volume@tv-basicstudies"];class c{targetMetaInfoVersion(){return 53}migrateMetaInfo(e){const t=e;e._metainfoVersion=53,l.includes(t.id)}migratePropState(e){l.includes(e.id)&&(e.inputs.maLength=e.inputs.length??e.inputs.maLength,
delete e.inputs.length,delete e.inputs.offset,delete e.inputs.source,e.plots[1]={id:"smoothedMA",type:"line"},e.styles.smoothedMA={display:0,linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#0496ff",histogramBase:0,joinPoints:!1,title:"Smoothed MA"})}}const h=["Relative Strength Index@tv-basicstudies","Commodity Channel Index@tv-basicstudies","On Balance Volume@tv-basicstudies"];class d{targetMetaInfoVersion(){return 53}migrateMetaInfo(e){const t=e,i=e;i._metainfoVersion=53,h.includes(t.id)&&(i.styles[t.id]={title:"Smoothed MA",histogramBase:0,joinPoints:!1})}migratePropState(e){h.includes(e.id)&&(e.plots[1]={id:"smoothedMA",type:"line"},e.styles.smoothedMA={display:0,linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:0,color:"#0496ff"})}}var u;!function(e){e[e.InMetaInfoVersion=52]="InMetaInfoVersion",e[e.OutMetaInfoVersion=53]="OutMetaInfoVersion"}(u||(u={}));const _=[new class{targetMetaInfoVersion(){return 47}migrateMetaInfo(e){const t=e,i=e;if(i._metainfoVersion=47,!t.defaults||void 0===t.defaults.precision)return void(i.format={type:"inherit"});const s=t.defaults&&t.defaults.precision,n=(0,o.isNumber)(s)?s:parseInt(s);0===n?i.format={type:"volume"}:isFinite(n)?i.format={type:"price",precision:n}:i.format={type:"inherit"},delete t.defaults.precision}migratePropState(e){}},new class{targetMetaInfoVersion(){return 50}migrateMetaInfo(e){const t=e,i=e;if(i._metainfoVersion=50,void 0===t.defaults||void 0===t.defaults.ohlcPlots||void 0===t.ohlcPlots)return;const n=t.ohlcPlots,o=t.defaults.ohlcPlots,r=(0,s.ensureDefined)((0,s.ensureDefined)(i.defaults).ohlcPlots);for(const e of Object.keys(o)){const t=o[e];if("ohlc_candles"===t.plottype){let i=!1;const s=n[e];void 0!==s&&(i=!!s.drawBorder,delete s.drawBorder),r[e]={borderColor:"#000000",drawBorder:i,...t}}}}migratePropState(e){}},new class{targetMetaInfoVersion(){return 53}migrateMetaInfo(e){const t=e,i=e;if(i._metainfoVersion=53,void 0!==t.defaults){if(void 0!==t.defaults.ohlcPlots&&void 0!==t.ohlcPlots){const e=Object.keys(t.ohlcPlots),n=t.defaults.ohlcPlots,o=(0,s.ensureDefined)((0,s.ensureDefined)(i.defaults).ohlcPlots);for(const t of e){const e=n[t];if(void 0===e||void 0===e.visible)continue;const i=e.visible?15:0;delete e.visible,o[t]={display:i,...e}}}if(void 0!==t.defaults.styles&&void 0!==t.plots){const e=t.plots.map((e=>e.id)),n=t.defaults.styles,o=(0,s.ensureDefined)((0,s.ensureDefined)(i.defaults).styles);for(const t of e){const e=n[t];if(void 0===e||void 0===e.visible)continue;const i=e.visible?15:0;delete e.visible,o[t]={display:i,...e}}}}}migratePropState(e){if(e.ohlcPlots)for(const t of Object.keys(e.ohlcPlots)){const i=(0,s.ensureDefined)(e.ohlcPlots[t]);void 0!==i.visible&&(i.display=i.visible?15:0,delete i.visible)}if(e.styles)for(const t of Object.keys(e.styles)){const i=(0,s.ensureDefined)(e.styles[t]);void 0!==i.visible&&(i.display=i.visible?15:0,delete i.visible)}}}];function p(e,t){const i=n.StudyMetaInfo.versionOf(e),o=e;void 0===o._serverMetaInfoVersion&&(o._serverMetaInfoVersion=i)
;const r=["PennantCP@tv-basicstudies","WedgeCP@tv-basicstudies"].includes(e.id);_.forEach((n=>{(i<0||i>=n.targetMetaInfoVersion())&&!r||(n.migrateMetaInfo(e),void 0!==t&&n.migratePropState(t),(0,s.assert)(e._metainfoVersion===n.targetMetaInfoVersion()))}))}_.push(new a),_.push(new c),_.push(new d),_.sort((function(e,t){return e.targetMetaInfoVersion()-t.targetMetaInfoVersion()}))},25149:(e,t,i)=>{"use strict";i.d(t,{NonSeriesStudy:()=>r,isNonSeriesStudy:()=>o});var s=i(50151),n=i(46806);function o(e){return e instanceof r}class r extends n.Study{clearData(){this._customData=null,this._indexes=null}restoreData(e,t,i){super.restoreData(e),this._customData=t,this._indexes=i}state(e){const t=super.state(e);return e&&(t.nonSeriesData=this._customData,t.indexes=this._indexes),t}customData(){return this._customData}_setPaneViews(e){this._paneViews=e,this.model().lightUpdate()}_onDataUpdated(e,t,i){null!==t&&(t.indexes_replace?((0,s.assert)("nochange"!==i),this._indexes=i):(this._customData=t.data,"nochange"!==i&&(this._indexes=i))),super._onDataUpdated(e,t,i)}}},13380:(e,t,i)=>{"use strict";var s;function n(e){e.lineWidth=void 0,e.lineStyle=void 0;for(let t=0;tn,createEmptyStyle:()=>o}),function(e){e[e.Main=0]="Main",e[e.Background=1]="Background",e[e.Text=2]="Text",e[e.Border=3]="Border",e[e.Wick=4]="Wick",e[e.Up=5]="Up",e[e.Down=6]="Down"}(s||(s={}))},81368:(e,t,i)=>{"use strict";i.d(t,{PaneRendererColumns:()=>o});var s=i(30125),n=i(56468);class o extends s.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=null,this._precalculatedCache=[],this.setData(e)}setData(e){this._data=e,this._precalculatedCache=[]}hitTest(e){if(null===this._data)return null;const t=this._data.visibleItemsRange?.startItemIndex??0,i=(this._data.visibleItemsRange?.endItemIndex??this._data.items.length)-1;for(let s=t;s<=i;s++){const t=this._data.items[s];if(e.x>=t.left&&e.x<=t.right){const i=t.y;if(e.y>=Math.min(i,this._data.histogramBase)&&e.y<=Math.max(i,this._data.histogramBase))return new n.HitTestResult(n.HitTarget.Regular)}}return null}_drawImpl(e){if(null===this._data||0===this._data.items.length)return;const{context:t,horizontalPixelRatio:i,verticalPixelRatio:s}=e;this._precalculatedCache.length||this._fillPrecalculatedCache(i);const n=Math.max(1,Math.floor(i)),o=Math.max(1,Math.floor(s)),r=Math.round(this._data.histogramBase*s)-Math.floor(n/2),a=r+n,l=this._data.lineColor,c=this._data.visibleItemsRange?.startItemIndex??0,h=(this._data.visibleItemsRange?.endItemIndex??this._data.items.length)-1;for(let e=c;e<=h;e++){const i=this._data.items[e],n=this._precalculatedCache[e-c],h=Math.round(i.y*s);let d,u;t.fillStyle=i.style?i.style.color:l,h<=r?(d=h,u=a):(d=r,u=h-Math.floor(o/2)+o),t.fillRect(n.left,d,n.right-n.left+1,u-d)}}_fillPrecalculatedCache(e){if(null===this._data||0===this._data.items.length)return void(this._precalculatedCache=[])
;const{barSpacing:t,visibleItemsRange:i,items:s}=this._data,n=Math.ceil(t*e)<=1?0:Math.max(1,Math.floor(e)),o=i?.startItemIndex??0,r=(i?.endItemIndex??s.length)-1,a=r-o+1;if(a<=0)return void(this._precalculatedCache=[]);this._precalculatedCache=new Array(a);for(let t=o;t<=r;t++){const i=s[t],r=Math.round(i.center*e);let a,l;const c=Math.round((i.right-i.left)*e)-n;if(c%2){const e=(c-1)/2;a=r-e,l=r+e}else{const e=c/2;a=r-e,l=r+e-1}this._precalculatedCache[t-o]={left:a,right:l,roundedCenter:r,center:i.center*e,time:i.timePointIndex}}for(let e=o+1;e<=r;e++){const t=this._precalculatedCache[e-o],i=this._precalculatedCache[e-o-1];t.time===i.time+1&&(t.left-i.right!==n+1&&(i.roundedCenter>i.center?i.right=t.left-n-1:t.left=i.right+n+1))}let l=Math.ceil(t*e);for(let e=o+1;e<=r;e++){const t=this._precalculatedCache[e-o];t.right0&&l<4)for(let e=o+1;e<=r;e++){const t=this._precalculatedCache[e-o];t.right-t.left+1>l&&(t.roundedCenter>t.center?t.right-=1:t.left+=1)}}}},78198:(e,t,i)=>{"use strict";i.d(t,{StudyPlotPaneView:()=>V});var s=i(50151),n=i(24377),o=i(56570),r=i(9859),a=i(37265),l=i(19063),c=i(18832);function h(e,t){const i=new Map;return function(...s){const n=""+(t?t.apply(null,s):s[0]);if(!i.has(n)){const t=e.apply(this,s);return i.set(n,t),t}return i.get(n)}}var d=i(2271),u=i(95201),_=i(74010),p=i(3385),m=i(11064),g=i(13380),f=i(86441),y=i(61993),v=i(56468),S=i(30125),b=i(49483);class w extends S.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=e}hitTest(e){const t=this._data,i=t.lineWidth,s=t.vertOffset||0,n=(0,y.interactionTolerance)().series+i,o=t.visibleItemsRange?.startItemIndex??0,r=t.visibleItemsRange?.endItemIndex??t.items.length;for(let a=o;a{const t=(0,n.rgbToHsl)((0,n.parseRgb)(e)),i=t[0]+.05;return t[0]=i-Math.floor(i),(0,n.rgbToHexString)((0,n.hslToRgb)(t))},E=h(D),B=new Set([I.LineStudyPlotStyle.Line,I.LineStudyPlotStyle.Area,I.LineStudyPlotStyle.Circles,I.LineStudyPlotStyle.Cross,I.LineStudyPlotStyle.StepLine,I.LineStudyPlotStyle.StepLineWithDiamonds]);class V extends L.StudyPaneViewInplaceUpdatable{constructor(e,t,i,s,n=!1){super(t,i,s),this._histogramBase=null,this._lineColor="",this._lineWidth=1,this._color1="",this._color2="",this._renderer=new u.CompositeRenderer,this._isMarkersEnabled=o.enabled("source_selection_markers"),this._study=e,this._plotIndex=e.metaInfo().plots.findIndex((e=>e.id===s)),this._colorProvider=(0,M.createStudyPlotColorProvider)(e.metaInfo(),e.properties(),s),this._extendStepLineToBarsEndings=n,this._isFundamental=!1;const r=this._study.properties().styles[this._plotName].plottype.value()
;this._isStepLinePlot=r===I.LineStudyPlotStyle.StepLine||r===I.LineStudyPlotStyle.StepLineWithBreaks||r===I.LineStudyPlotStyle.StepLineWithDiamonds}items(){return this._items}renderer(){return this._makeSureRendererIsValid(),this._renderer}_getTranspValue(){const e=this._study.properties(),t=e.styles[this._plotName];let i=0;const s=this._study.metaInfo();return"Volume@tv-basicstudies"===s.id&&s.version<=46&&"transparency"in e?(i=e.transparency.value(),i=(0,a.isNumber)(i)?i:0,i):(t.transparency&&(i=t.transparency.value(),i=(0,a.isNumber)(i)?i:0),i)}_updateImplFull(e){if(this._renderer.clear(),this._dataInvalidated?.clearData&&(this._items=[]),!this._study.isPlotVisibleAt(this._plotName,1))return!1;const t=this._priceScale();if(!t||t.isEmpty())return!1;if(null===this._study.firstValue(void 0,this.isForceOverlay()))return!1;this._histogramBase=null;const i=this._study.properties().styles[this._plotName],n=i.plottype.value(),o=this._isFundamental&&this._isStepLinePlot,a=this._study.plots().plottableRange(o);if(0===a.size())return!1;const c=this._study.offset(this._plotName),h=B.has(n),d=this._preallocateItems(a,((e,t)=>({y:NaN,left:NaN,center:NaN,right:NaN,origPrices:{price:t??NaN,timePointIndex:e+c},timePointIndex:e+c})));let u=NaN,_=NaN;const p=new Map,m=(e,t)=>{let i=p.get(e);void 0===i&&(i=new Map,p.set(e,i));let s=i.get(t);if(void 0===s){const n=!this._plotName||"vol"!==this._plotName;s=(0,l.generateColor)(e,t,n),i.set(t,s)}return s},f=(0,g.createEmptyStyle)(),y=(0,r.clamp)(this._getTranspValue(),0,100),v=this._model.timeScale().visibleBarsStrictRange();if(null===v)return!1;const{startBar:S,endBar:b}=this._calculateStartEnd(v);if(null===S||null===b||0===this._items.length)return!1;const w=d??(0,s.ensureNotNull)(a.firstIndex()),C=(0,s.ensureNotNull)(a.lastIndex())+1,P=a.rangeIterator(w,C);let T,x=(0,A.lowerbound)(this._items,w+c,((e,t)=>e.timePointIndex0&&(this._items[x].breakBefore=!0),_=n,u=t,x++,T=r}return this._updateImplLight(),!0}_correctVisibleItemIndexes(e,t){return super._correctVisibleItemIndexes(e,t)}_updateRenderer(e,t){this._renderer.clear();const i=this._study.properties().styles.childs()[this._plotName].childs(),n=this._study.metaInfo().styles?.[this._plotName],o=(0,r.clamp)(this._getTranspValue(),0,100);this._lineColor=(0,l.generateColor)(i.color.value(),o),this._lineWidth=i.linewidth.value();let h=i.color.value();const u=this._colorProvider.getDefaultPlotPointStyle();u&&(h=u.colors[0]||h,
this._lineWidth=u.lineWidth??this._lineWidth,this._lineColor=h?(0,l.generateColor)(h,o):this._lineColor),this._color2=(0,l.generateColor)(h,o);const g=this._study.metaInfo().isRGB?D(h):E(h);this._color1=(0,l.generateColor)(g,o);const f=this._histogramBase?this._histogramBase:(0,s.ensureNotNull)(this._priceScale()).height(),y=i.plottype.value(),v={barSpacing:this._model.timeScale().barSpacing(),items:this._items,histogramBase:f,lineIndex:0,lineStyle:i.linestyle.value(),lineColor:this._lineColor,lineWidth:(0,a.isNumber)(this._lineWidth)?this._lineWidth:1,color1:this._color1,color2:this._color2,bottom:f,visibleItemsRange:{startItemIndex:e,endItemIndex:t},simpleMode:this._colorProvider.singleColor(),skipHoles:[I.LineStudyPlotStyle.Line,I.LineStudyPlotStyle.Area,I.LineStudyPlotStyle.Cross,I.LineStudyPlotStyle.Circles,I.LineStudyPlotStyle.StepLine,I.LineStudyPlotStyle.StepLineWithDiamonds].includes(y)},S=this._renderer,b=Boolean(n?.joinPoints);switch(y){case I.LineStudyPlotStyle.Line:case I.LineStudyPlotStyle.LineWithBreaks:S.append(new _.PaneRendererLine({...v,lineColor:{type:k.ColorType.Solid,color:this._lineColor}}));break;case I.LineStudyPlotStyle.Area:case I.LineStudyPlotStyle.AreaWithBreaks:S.append(new d.PaneRendererArea({...v,lineColor:{type:k.ColorType.Solid,color:this._lineColor}}));break;case I.LineStudyPlotStyle.Histogram:S.append(new x(v));break;case I.LineStudyPlotStyle.Columns:S.append(new C.PaneRendererColumns(v));break;case I.LineStudyPlotStyle.Cross:S.append(new T(v)),b&&S.append(new _.PaneRendererLine({...(0,c.deepCopy)(v),lineWidth:1,lineColor:{type:k.ColorType.Solid,color:this._lineColor},forceLineWidth:!0}));break;case I.LineStudyPlotStyle.Circles:S.append(new w(v)),b&&S.append(new _.PaneRendererLine({...(0,c.deepCopy)(v),lineWidth:1,lineColor:{type:k.ColorType.Solid,color:this._lineColor},ignorePaletteLineWidth:!0}));break;case I.LineStudyPlotStyle.StepLine:case I.LineStudyPlotStyle.StepLineWithBreaks:case I.LineStudyPlotStyle.StepLineWithDiamonds:{const e=new p.PaneRendererStepLine;e.setData({...v,lineColor:{type:k.ColorType.Solid,color:this._lineColor},decoration:i.plottype.value()===I.LineStudyPlotStyle.StepLineWithDiamonds?p.StepLineDecoration.Diamonds:p.StepLineDecoration.None,extendToBarsEndings:this._extendStepLineToBarsEndings}),S.append(e);break}default:S.append(new _.PaneRendererLine({...v,lineColor:{type:k.ColorType.Solid,color:this._lineColor}}))}this._model.selection().isSelected(this._study)&&this._isMarkersEnabled&&this._selectionData&&S.append(new m.SelectionRenderer(this._selectionData))}_updateAdditionalPrices(e,t){const i=this._study.metaInfo().styles?.[this._plotName];void 0!==i?.histogramBase&&(this._histogramBase=e.priceToCoordinate(i.histogramBase,t))}}},64559:(e,t,i)=>{"use strict";i.d(t,{StudyForceOverlayPlotView:()=>s});class s{constructor(e,t,i){this._series=e,this._model=t,this._plotName=i}isForceOverlay(){return!!this._study.metaInfo().isPlotForceOverlay(this._plotName)}_priceScale(){
return this.isForceOverlay()?this._model.mainSeries().priceScale():this._study.priceScale()}}},35864:(e,t,i)=>{"use strict";i.d(t,{StudyPaneViewInplaceUpdatable:()=>u});var s=i(50151),n=i(86441),o=i(37265),r=i(62499),a=i(8025),l=i(29981),c=i(66540),h=i(56468),d=i(64559);class u extends d.StudyForceOverlayPlotView{constructor(e,t,i){super(e,t,i),this._selectionData=null,this._dataInvalidated=null,this._viewportInvalidated=!1,this._items=[],this._selectionIndexer=new c.SelectionIndexes(t.timeScale())}update(e){if("hover-change"!==e.type){if("global-change"===e.type)return this._dataInvalidated=(0,r.mergeDataInvalidation)(this._dataInvalidated,{}),void(this._viewportInvalidated=!0);if("data-source-change"!==e.type)this._viewportInvalidated=!0;else{if((e.sourceId===this._study.id()||this._dependsOnSeriesData()&&e.sourceId===this._model.mainSeries().id())&&!e.nonSeriesOnly){const t=(0,r.mergeDataInvalidation)(this._dataInvalidated,{firstIndex:e.firstUpdatedTimePointIndex,clearData:e.clearData});this._dataInvalidated=t}}}}_dependsOnSeriesData(){return!1}_makeSureRendererIsValid(){this._dataInvalidated?this._updateImplFull(this._viewportInvalidated)&&(this._dataInvalidated=null):this._viewportInvalidated&&this._updateImplLight(),this._viewportInvalidated=!1}_preallocateItems(e,t){const i=e.size();let n=this._dataInvalidated?.firstIndex;if(0===i)return n;const o=this._study.offset(this._plotName);if(i!==this._items.length){const i=void 0!==n?n+o:void 0;if(void 0===i||0===this._items.length||i<(0,s.ensureDefined)(this._items[0].timePointIndex))return this._items=[],e.each(((e,i)=>{const s=i[this._plotIndex+1];return this._items.push(t(e,s)),!1})),this._items.length?(0,s.ensureDefined)(this._items[0].timePointIndex)-o:void 0;{const i=(0,s.ensureDefined)(n),r=o>=0?0:o,a=o>=0?o:0;let c=(0,l.lowerbound)(this._items,i+r,((e,t)=>e.timePointIndex=0?0:o,i=o>=0?o:0;let r=(0,l.lowerbound)(this._items,n+t,((e,t)=>e.timePointIndexn+1)return{startBar:null,endBar:null};let r=this._study.plots();r=r.range(o,(0,s.ensureNotNull)(r.lastIndex())),i=Math.max(i,o),n=Math.max(n,o);const l=r.search(i,a.PlotRowSearchMode.NearestLeft,this._plotIndex+1),c=r.search(n,a.PlotRowSearchMode.NearestRight,this._plotIndex+1);return null!==l&&(i=l.index),null!==c&&(n=c.index),
i=Math.max(o,i),{startBar:i,endBar:n}}_updateImplLight(){const e=this._study.firstValue(void 0,this.isForceOverlay());if(null===e)return this._selectionData=null,void this._updateRenderer(0,-1);const t=this._priceScale();if(null===t||t.isEmpty())return this._selectionData=null,void this._updateRenderer(0,-1);const i=this._model.timeScale().visibleBarsStrictRange();if(null===i)return this._selectionData=null,void this._updateRenderer(0,-1);const{startBar:s,endBar:n}=this._calculateStartEnd(i);if(null===s||null===n||0===this._items.length)return this._selectionData=null,void this._updateRenderer(0,-1);const{startItemIndex:o,endItemIndex:r}=this._correctVisibleItemIndexes(Math.max(0,(0,l.lowerbound)(this._items,s,((e,t)=>e.timePointIndexe=r)return this._selectionData=null,void this._updateRenderer(0,-1);this._convertItemsToCoordinates(t,e,o,r),this._createSelection(e),this._updateRenderer(o,r)}_correctVisibleItemIndexes(e,t){return{startItemIndex:e,endItemIndex:t}}_convertItemsToCoordinates(e,t,i,s){this._convertItemsToCoordinatesImpl(e,t,i,s)}_convertItemsToCoordinatesImpl(e,t,i,s){for(let e=i;e{"use strict";i.d(t,{createStudyPlotColorProvider:()=>_});var s=i(94113),n=i(50151),o=i(13380);const r=new Map([[0,"color"],[2,"textColor"],[3,"borderColor"],[4,"wickColor"],[5,"colorup"],[6,"colordown"]]);class a{constructor(e){this._plotStyle=e}getPlotPointStyle(e,t){const i=t?(0,o.clearStyle)(t):(0,o.createEmptyStyle)();return r.forEach(((e,t)=>{this._plotStyle[e]&&(i.colors[t]=this._plotStyle[e].value())})),i.lineWidth=this._plotStyle.linewidth?this._plotStyle.linewidth.value():void 0,i.lineStyle=this._plotStyle.linestyle?this._plotStyle.linestyle.value():void 0,i}isColorDefined(){return!0}singleColor(){return!0}
getDefaultPlotPointStyle(){return null}}const l=[0,1,2,3,4,5,6];class c{constructor(e,t,i,s){this._palettesColors=new Map,this._defaultPlotColors=new Map,this._indexes=s;const o=t.styles[i];if(o)for(const[e,t]of r)this._defaultPlotColors.set(e,o[t]);const a=(0,n.ensureDefined)(e.palettes),l=e.plots;s.forEach(((e,i)=>{const s=l[e];if(s&&"palette"in s){const e=a[s.palette],n=t.palettes[s.palette];if(e&&n){const{valToIndex:t}=e,{colors:s}=n,o={...s};t&&Object.keys(t).forEach((e=>{const i=t[e];void 0!==i&&(o[e]=s[i])})),this._palettesColors.set(i,o)}}}))}getPlotPointStyle(e,t){const i=t?(0,o.clearStyle)(t):(0,o.createEmptyStyle)();return l.forEach((t=>{if(this._palettesColors.has(t)){const s=e[(0,n.ensureDefined)(this._indexes.get(t))+1];if("number"==typeof s){const e=this._palettesColors.get(t)?.[s];0===t&&e&&(i.lineWidth=e.width.value(),i.lineStyle=e.style.value()),i.colors[t]=e?.color.value()}else i.colors[t]="transparent"}else i.colors[t]=this._defaultPlotColors.get(t)?.value()})),i}getDefaultPlotPointStyle(){const e=this._palettesColors.get(0)?.[0];if(void 0!==e){return{colors:[e.color.value(),void 0,void 0,void 0,void 0,void 0,void 0],lineStyle:void 0,lineWidth:e.width.value()}}return null}isColorDefined(){return!!this._palettesColors.size}singleColor(){return!1}}var h=i(31599);class d{constructor(e){this._rgbaFromInteger=(0,h.rgbaFromIntegerCached)(),this._indexes=e}getPlotPointStyle(e,t){const i=t?(0,o.clearStyle)(t):(0,o.createEmptyStyle)();return this._indexes.forEach(((t,s)=>{const n=e[t+1];if(null!=n){const e=this._rgbaFromInteger(n);i.colors[s]=e}else i.colors[s]="transparent"})),i}isColorDefined(){return!0}singleColor(){return!1}getDefaultPlotPointStyle(){return null}}const u=new Map([[0,function(e,t){const i=(0,s.isColorerPlot)(t)||(0,s.isOhlcColorerPlot)(t);return"target"in t&&t.target===e&&i}],[2,function(e,t){const i=(0,s.isTextColorerPlot)(t);return"target"in t&&t.target===e&&i}],[1,function(e,t){return(0,s.isBgColorerPlot)(t)&&t.id===e}],[3,function(e,t){const i=(0,s.isCandleBorderColorerPlot)(t);return"target"in t&&t.target===e&&i}],[4,function(e,t){const i=(0,s.isCandleWickColorerPlot)(t);return"target"in t&&t.target===e&&i}],[5,function(e,t){const i=(0,s.isUpColorerPlot)(t);return"target"in t&&t.target===e&&i}],[6,function(e,t){const i=(0,s.isDownColorerPlot)(t);return"target"in t&&t.target===e&&i}]]);function _(e,t,i){const{colorers:s}=function(e,t){const i=e.plots,s=i.findIndex((e=>e.id===t)),n=new Map;return i.forEach(((e,i)=>{u.forEach(((s,o)=>{s(t,e)&&n.set(o,i)}))})),{plotIndex:-1===s?null:s,colorers:n}}(e,i);if(s.size)return e.isRGB?new d(s):new c(e,t,i,s);{const e=t.ohlcPlots;if(e&&e[i])return new a(e[i]);const s=t.styles[i];return new a(s)}}},94113:(e,t,i)=>{"use strict";var s,n,o,r,a,l,c;function h(e){return"line"===e.type}function d(e){return"shapes"===e.type}function u(e){return"chars"===e.type}function _(e){return"arrows"===e.type}function p(e){return"data"===e.type}function m(e){return"dataoffset"===e.type}function g(e){return"ohlc_open"===e.type}function f(e){
return"ohlc_high"===e.type}function y(e){return"ohlc_low"===e.type}function v(e){return"ohlc_close"===e.type}function S(e){return g(e)||f(e)||y(e)||v(e)}function b(e){return"colorer"===e.type&&"palette"in e}function w(e){return"colorer"===e.type&&!("palette"in e)}function C(e){return"colorer"===e.type}function P(e){return"bar_colorer"===e.type}function T(e){return"bg_colorer"===e.type}function x(e){return"text_colorer"===e.type}function I(e){return"ohlc_colorer"===e.type}function M(e){return"wick_colorer"===e.type}function A(e){return"border_colorer"===e.type}function L(e){return"up_colorer"===e.type}function k(e){return"down_colorer"===e.type}function D(e){return"alertcondition"===e.type}function E(e){return h(e)||d(e)||u(e)||_(e)}function B(e){return"Plot"!==e}function V(e){return"ohlc_bars"===e.plottype}function R(e){return"ohlc_candles"===e.plottype}function N(e){return C(e)||P(e)||T(e)||p(e)||m(e)||I(e)||D(e)||L(e)||k(e)||A(e)||M(e)||x(e)}function O(e){return C(e)||x(e)||P(e)||p(e)||m(e)||I(e)||M(e)||A(e)||L(e)||k(e)||D(e)}i.r(t),i.d(t,{InternalStudyPlotType:()=>o,LineStudyPlotStyle:()=>s,OhlcStudyPlotStyle:()=>l,PlotSymbolSize:()=>c,STUDYPLOTDISPLAYTARGET:()=>a,StudyPlotDisplayTarget:()=>r,StudyPlotType:()=>n,isAlertConditionPlot:()=>D,isArrowsPlot:()=>_,isBarColorerPlot:()=>P,isBgColorerPlot:()=>T,isCandleBorderColorerPlot:()=>A,isCandleWickColorerPlot:()=>M,isCharsPlot:()=>u,isColorerPlot:()=>C,isDataOffsetPlot:()=>m,isDataPlot:()=>p,isDownColorerPlot:()=>k,isLinePlot:()=>h,isNonVisualPlot:()=>O,isOhlcClosePlot:()=>v,isOhlcColorerPlot:()=>I,isOhlcHighPlot:()=>f,isOhlcLowPlot:()=>y,isOhlcOpenPlot:()=>g,isOhlcPlot:()=>S,isOhlcPlotStyleBars:()=>V,isOhlcPlotStyleCandles:()=>R,isPaletteColorerPlot:()=>b,isPlotSupportDisplay:()=>E,isPlotTitleDefined:()=>B,isPlotWithTechnicalValues:()=>N,isRgbaColorerPlot:()=>w,isShapesPlot:()=>d,isTextColorerPlot:()=>x,isUpColorerPlot:()=>L}),function(e){e[e.Line=0]="Line",e[e.Histogram=1]="Histogram",e[e.Cross=3]="Cross",e[e.Area=4]="Area",e[e.Columns=5]="Columns",e[e.Circles=6]="Circles",e[e.LineWithBreaks=7]="LineWithBreaks",e[e.AreaWithBreaks=8]="AreaWithBreaks",e[e.StepLine=9]="StepLine",e[e.StepLineWithDiamonds=10]="StepLineWithDiamonds",e[e.StepLineWithBreaks=11]="StepLineWithBreaks"}(s||(s={})),function(e){e.Line="line",e.Colorer="colorer",e.BarColorer="bar_colorer",e.BgColorer="bg_colorer",e.TextColorer="text_colorer",e.OhlcColorer="ohlc_colorer",e.CandleWickColorer="wick_colorer",e.CandleBorderColorer="border_colorer",e.UpColorer="up_colorer",e.DownColorer="down_colorer",e.Shapes="shapes",e.Chars="chars",e.Arrows="arrows",e.Data="data",e.DataOffset="dataoffset",e.OhlcOpen="ohlc_open",e.OhlcHigh="ohlc_high",e.OhlcLow="ohlc_low",e.OhlcClose="ohlc_close"}(n||(n={})),function(e){e.AlertCondition="alertcondition"}(o||(o={})),function(e){e[e.None=0]="None",e[e.Pane=1]="Pane",e[e.DataWindow=2]="DataWindow",e[e.PriceScale=4]="PriceScale",e[e.StatusLine=8]="StatusLine",e[e.All=15]="All"}(r||(r={})),function(e){e[e.None=0]="None",e[e.Pane=1]="Pane",e[e.DataWindow=2]="DataWindow",
e[e.PriceScale=4]="PriceScale",e[e.StatusLine=8]="StatusLine",e[e.All=15]="All"}(a||(a={})),function(e){e.OhlcBars="ohlc_bars",e.OhlcCandles="ohlc_candles"}(l||(l={})),function(e){e.Auto="auto",e.Tiny="tiny",e.Small="small",e.Normal="normal",e.Large="large",e.Huge="huge"}(c||(c={}))},49822:(e,t,i)=>{"use strict";function s(e,t="shift",i){return{studyConstructorAsyncGetter:e,colorRotationMode:t,colorRotationComparator:i}}i.d(t,{addStudyInfoToMap:()=>o,createStudyInfo:()=>s,getStudyClassName:()=>a,getStudyInfoByName:()=>r});const n=new Map;function o(e,t){n.set(e,t)}function r(e){return n.get(e)}function a(e){for(const[t,i]of n.entries())if(i.studyConstructor===e)return t;return null}},79036:(e,t,i)=>{"use strict";i.d(t,{createStudy:()=>S,hasConfirmInputs:()=>P,hasPendingStudiesModuleLoading:()=>v,isCompareOrOverlayStudy:()=>f,isFundamentalStudy:()=>m,isOverlayStudy:()=>g,isStudy:()=>u,isStudyStrategy:()=>_,isStudyStub:()=>p,isSymbolicStudy:()=>x,studyColorRotationMode:()=>b,useSameColorRotationComparator:()=>C});var s=i(50151),n=i(56570),o=i(68159),r=i(21239);const a="study_Internal$STD;Fund_";function l(e){const t="study_"+(e.classId||e.shortId);return t.startsWith(a)?a:t}var c=i(49822);i(29137);const h=(0,c.createStudyInfo)((()=>Promise.all([i.e(4821),i.e(7539)]).then(i.bind(i,46806)).then((e=>e.Study))));(0,c.addStudyInfoToMap)("Study",h),(0,c.addStudyInfoToMap)("study_PivotPointsStandard",(0,c.createStudyInfo)((()=>Promise.all([i.e(4821),i.e(7539)]).then(i.bind(i,93378)).then((e=>e.study_PivotPointsStandard))))),(0,c.addStudyInfoToMap)("study_Overlay",(0,c.createStudyInfo)((()=>Promise.all([i.e(4821),i.e(7539)]).then(i.bind(i,38496)).then((e=>e.study_Overlay))),"sexyColors")),(0,c.addStudyInfoToMap)("study_Compare",(0,c.createStudyInfo)((()=>Promise.all([i.e(4821),i.e(7539)]).then(i.bind(i,85604)).then((e=>e.StudyCompare))),"sexyColors")),(0,c.addStudyInfoToMap)("study_Volume",(0,c.createStudyInfo)((()=>Promise.all([i.e(4821),i.e(7539)]).then(i.bind(i,7021)).then((e=>e.VolumeStudy))))),(0,c.addStudyInfoToMap)("study_VbPVisible",(0,c.createStudyInfo)((()=>Promise.all([i.e(4821),i.e(7539)]).then(i.bind(i,34425)).then((e=>e.VbPVisibleWrapper))),"noRotations")),(0,c.addStudyInfoToMap)("study_VbPFixed",(0,c.createStudyInfo)((()=>Promise.all([i.e(4821),i.e(7539)]).then(i.bind(i,34425)).then((e=>e.VolumeProfileStudyWithThemedColors))),"noRotations")),(0,c.addStudyInfoToMap)("study_ScriptWithDataOffset",(0,c.createStudyInfo)((()=>Promise.all([i.e(4821),i.e(7539)]).then(i.bind(i,31257)).then((e=>e.study_ScriptWithDataOffset))))),n.enabled("moving_average_study_changable_currency_unit")&&(0,c.addStudyInfoToMap)("study_Moving Average",(0,c.createStudyInfo)((()=>i.e(5248).then(i.bind(i,55288)).then((e=>e.study_MovingAverage)))));const d=["getStudyName","guiPlotName","isLinkedToSeries"];function u(e){return d.every((t=>t in e))}function _(e){return!1}function p(e){return e instanceof r.StudyStub}function m(e){return!1}function g(e){return u(e)&&"Overlay@tv-basicstudies"===e.metaInfo().id}function f(e){
return g(e)||u(e)&&"Compare@tv-basicstudies"===e.metaInfo().id}let y=0;function v(){return y>0}async function S(e,t,i,n,o,r){let a;const d=2===r;if(!a){const e=l(n);a=(0,c.getStudyInfoByName)(e??"Study")??h}a.studyConstructor||(y+=1,a.studyConstructor=await(0,s.ensureDefined)(a.studyConstructorAsyncGetter)(),y-=1);const u=new((0,s.ensureDefined)(a?.studyConstructor))(e,t,i,n,d);return void 0!==o&&u.setId(o),u}function b(e){const t=l(e),i=(0,c.getStudyInfoByName)(t);return i?i.colorRotationMode:void 0===e.pine||o.StudyMetaInfo.isStandardPine(e.id)?1!==e.plots.length?"shift":"loop":null}function w(e,t){return e.id===t.id&&(s=t,((i=e).pine?i.pine.version:void 0)===(s.pine?s.pine.version:void 0));var i,s}function C(e){const t=l(e),i=(0,c.getStudyInfoByName)(t);if(i){const e=i.colorRotationComparator;if(void 0!==e)return e}return w}function P(e){return(e??[]).some((e=>e.confirm))}const T=["Overlay@tv-basicstudies","CorrelationCoefficient@tv-basicstudies","Correlation Coeff@tv-basicstudies","Spread@tv-basicstudies","Ratio@tv-basicstudies"];function x(e){return T.includes(e.id)}},14878:(e,t,i)=>{"use strict";i.d(t,{StudyBaseWindowView:()=>o});var s=i(7576),n=i(19466);class o extends s.DataWindowView{constructor(e,t){super(),this._invalidated=!0,this._study=e,this._model=t,this._valueProvider=this._createValuesProvider(e,t),this._items=this._valueProvider.getItems().map((e=>new s.DataWindowItem(e.id,e.title,"")))}update(e){"hover-change"!==e.type&&(this._invalidated=!0)}items(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items}study(){return this._study}_updateImpl(){this._header=this._study.title(n.TitleDisplayTarget.DataWindow,!0),this._title=this._study.title(n.TitleDisplayTarget.DataWindow);const e=this._valueProvider.getValues(this._currentIndex());for(let t=0;t{"use strict";i.d(t,{StudyDataSource:()=>_});var s=i(50151),n=i(52033),o=i(64755),r=i(18172),a=i(3462),l=i(82349),c=i(26246),h=i(16685);const d=(0,i(9343).getLogger)("Chart.StudyDataSource");var u;!function(e){e[e.Idle=0]="Idle",e[e.AwaitingConnection=1]="AwaitingConnection",e[e.AwaitingParent=2]="AwaitingParent",e[e.AwaitingFirstDataUpdate=3]="AwaitingFirstDataUpdate",e[e.Active=4]="Active"}(u||(u={}));class _{constructor(e,t,i,s){this._inputs=null,this._status=u.Idle,this._studyId=null,this._turnaroundCounter=1,this._studyStatus={type:h.StudyStatusType.Undefined},this._studyStatusChanged=new n.Delegate,this._dataCleared=new n.Delegate,this._dataUpdated=new n.Delegate,this._boundOnGatewayIsConnectedChanged=this._onGatewayIsConnectedChanged.bind(this),this._ongoingDataUpdate=Promise.resolve(),this._gateway=e,this._metaInfo=s,this._seriesSource=t,this._turnaroundPrefix=i,this._plots=new o.PlotList((0,l.studyPlotFunctionMap)(s),l.studyEmptyPlotValuePredicate),
this._gateway.isConnected().subscribe(this._boundOnGatewayIsConnectedChanged),this._graphics=new c.LiveStudyGraphics(s.graphics)}destroy(){this.stop(),this._gateway.isConnected().unsubscribe(this._boundOnGatewayIsConnectedChanged),this._seriesSource.dataEvents().created().unsubscribeAll(this)}metaInfo(){return this._metaInfo}inputs(){return this._inputs}setInputs(e){this._inputs=e,null!==this._studyId&&(this._turnaroundCounter++,this._onStudyStatusChangedTo({type:h.StudyStatusType.Undefined}),this._gateway.modifyStudy(this._studyId,this._turnaround(),e,this._onMessage.bind(this)),this._status===u.Active&&this._changeStatusTo(u.AwaitingFirstDataUpdate))}isStarted(){return this._status!==u.Idle}isActive(){return this._status===u.Active}start(){this.isStarted()?d.logNormal("start: data source is already started, nothing to do"):((0,s.assert)(null!==this._inputs,"Inputs should be defined when starting a study data source"),this._gateway.isConnected().value()?this._createStudy():this._changeStatusTo(u.AwaitingConnection))}stop(){this.isStarted()?(null!==this._studyId&&(this._gateway.removeStudy(this._studyId),this._studyId=null,this._onStudyStatusChangedTo({type:h.StudyStatusType.Undefined})),this._changeStatusTo(u.Idle)):d.logNormal("stop: data source is already stopped, nothing to do")}studyId(){return this._studyId}studyStatus(){return this._studyStatus}studyStatusChanged(){return this._studyStatusChanged}plots(){return this._plots}graphics(){return this._graphics}clearData(){this._plots.clear(),this._graphics.clear(),this._dataCleared.fire()}stopAndStealData(){(0,s.assert)(this._status===u.Active,"Couldn't steal data from non-active data source"),this.stop();const e=this._plots,t=this._graphics.extract();return this._plots=new o.PlotList((0,l.studyPlotFunctionMap)(this._metaInfo),l.studyEmptyPlotValuePredicate),{plots:e,graphics:t}}dataCleared(){return this._dataCleared}dataUpdated(){return this._dataUpdated}moveData(e){this._ongoingDataUpdate=this._ongoingDataUpdate.then((()=>{this._plots.move(e)}))}pendingUpdatesReady(){return this._ongoingDataUpdate}_createStudyError(e){return{type:h.StudyStatusType.Error,errorDescription:this._getStudyErrorDescription(e)}}_getStudyErrorDescription(e){return"string"==typeof e?{error:e.split(":",2)[0]}:e}_changeStatusTo(e){(0,s.assert)(this._status!==e,"Source and destination status should be distinct"),d.logNormal(`Status changed from ${u[this._status]} to ${u[e]}`),this._status=e}_createStudy(){const e=this._seriesSource.instanceId();null!==e?this._createStudyUsingParentId(e):(this._changeStatusTo(u.AwaitingParent),this._seriesSource.dataEvents().created().subscribe(this,this._onSeriesCreated,!0))}_createStudyUsingParentId(e){(0,s.assert)(this._status!==u.Active,'Status should not be "Active" when creating a study'),(0,s.assert)(this._studyStatus.type===h.StudyStatusType.Undefined,'Study status should be "Undefined" when creating a study'),(0,s.assert)(null===this._studyId,"Study id should be empty when creating a study"),this._studyId=(0,a.makeNextStudyId)(),
this._gateway.createStudy(this._studyId,this._turnaround(),e,this._metaInfo.fullId+("tv-basicstudies"===this._metaInfo.packageId?"":"!"),(0,s.ensureNotNull)(this._inputs),this._onMessage.bind(this),{id:this._metaInfo.id}),this._changeStatusTo(u.AwaitingFirstDataUpdate)}_onGatewayIsConnectedChanged(e){e?this._onGatewayConnected():this._onGatewayDisconnected()}_onGatewayConnected(){this._status===u.AwaitingConnection&&this._createStudy()}_onGatewayDisconnected(){this._status!==u.Idle&&this._status!==u.AwaitingConnection&&(this._studyId=null,this._changeStatusTo(u.AwaitingConnection),this._studyStatus.type!==h.StudyStatusType.Undefined&&this._onStudyStatusChangedTo({type:h.StudyStatusType.Undefined})),this._turnaroundCounter=1}_onSeriesCreated(){this._status===u.AwaitingParent&&this._createStudyUsingParentId((0,s.ensure)(this._seriesSource.instanceId()))}_onStudyStatusChangedTo(e){const t=this._studyStatus;this._studyStatus=e,d.logNormal(`Study status type changed from ${h.StudyStatusType[t.type]} to ${h.StudyStatusType[e.type]}`),this._studyStatusChanged.fire(t,e)}_onMessage(e){if("data_update"===e.method){const{customId:t,turnaround:i,plots:n,nonseries:o}=e.params;t===this._studyId&&this._checkTurnaround(i)&&this._onDataUpdate(n,(0,s.ensureDefined)(o))}else if("study_loading"===e.method){const[t,i]=e.params;t===this._studyId&&this._checkTurnaround(i)&&this._onStudyLoading(e.time)}else if("study_completed"===e.method){const[t,i]=e.params;t===this._studyId&&this._checkTurnaround(i)&&this._onStudyCompleted(e.time)}else if("study_error"===e.method){const[t,i,s,n]=e.params;t===this._studyId&&this._checkTurnaround(i)&&this._onStudyError(s,n,e.time)}else"clear_data"===e.method&&this._checkTurnaround(e.params.turnaround)&&this.clearData()}_onDataUpdate(e,t){const i=(0,r.unpackNonSeriesData)(t.d);return this._ongoingDataUpdate=this._ongoingDataUpdate.then((()=>i),(()=>i)).then(this._onDataUnpacked.bind(this,e,t.indexes)),this._ongoingDataUpdate}_onDataUnpacked(e,t,i){this._status!==u.Idle&&(this._status===u.AwaitingFirstDataUpdate&&(this._changeStatusTo(u.Active),this.clearData()),this._mergePlots(e),null!==i&&(i.indexes_replace?((0,s.assert)("nochange"!==t),this._graphics.replaceIndexesTo(t)):("nochange"!==t&&this._graphics.replaceIndexesTo(t),void 0!==i.graphicsCmds&&this._graphics.processCommands(i.graphicsCmds))),this._dataUpdated.fire(e,i,t))}_onStudyLoading(e){this._onStudyStatusChangedTo({type:h.StudyStatusType.Loading,startTime:Date.now()})}_onStudyError(e,t,i){this.clearData(),this._onStudyStatusChangedTo(this._createStudyError(e))}_onStudyCompleted(e){this._onStudyStatusChangedTo({type:h.StudyStatusType.Completed})}_mergePlots(e){this._plots.merge(e)}_turnaround(){return`${this._turnaroundPrefix}${this._turnaroundCounter}`}_checkTurnaround(e){const t=this._turnaround();return e===t||e===this._seriesSource.turnaround()||e===`${this._seriesSource.turnaround()}_${t}`}}},22839:(e,t,i)=>{"use strict";i.d(t,{StudyDataWindowView:()=>a});var s=i(14878),n=i(22739),o=i(7015);class r{constructor(e,t){this._study=e,
this._model=t,this._hhistBasedStudy=void 0!==e.metaInfo().graphics.hhists,this._valuesProvider=this._createValuesProvider(e,t)}getItems(){return this._valuesProvider.getItems()}getValues(e){const t=this._valuesProvider.getValues(e),i=e=>!!this._hhistBasedStudy||this._study.isPlotVisibleAt(e,2);for(const e of t)e.visible=e.visible&&i(e.id);return t}_createValuesProvider(e,t){return this._hhistBasedStudy?new o.HHistBasedValuesProvider(e,t):new n.StudyValuesProvider(e,t)}}class a extends s.StudyBaseWindowView{canShowItems(){const e=this._model.paneForSource(this._study);return!!e?.maximized().value()||this._model.panes().every((e=>!e.maximized().value()))}_createValuesProvider(e,t){return new r(e,t)}}},82349:(e,t,i)=>{"use strict";function s(e){const t=new Map;return e.plots.forEach(((e,i)=>{t.set(e.id,(e=>e[i+1]))})),t}function n(e,t){return null==e[t]}i.d(t,{studyEmptyPlotValuePredicate:()=>n,studyPlotFunctionMap:()=>s})},65383:(e,t,i)=>{"use strict";i.d(t,{ChartColorDependentStudyInputNames:()=>p,InputDisplayFlags:()=>n,RangeDependentStudyInputNames:()=>_,areStudyInputsEqual:()=>m,editableStudyInputs:()=>f,getInputValue:()=>l,isExtendedInput:()=>r,isExtendedInputSource:()=>a,isStudyInputDependsOnChartColors:()=>y,isStudyInputOptionsInfo:()=>c,isTimeOrPriceNotHiddenInput:()=>g});var s,n,o=i(82433);function r(e){return(0,o.default)(e)}function a(e){return"source"===e.t}function l(e){return r(e)?e.v:e}!function(e){e.Integer="integer",e.Float="float",e.Price="price",e.Bool="bool",e.Text="text",e.Symbol="symbol",e.Session="session",e.Source="source",e.Resolution="resolution",e.Time="time",e.BarTime="bar_time",e.Color="color",e.Textarea="text_area"}(s||(s={})),function(e){e[e.None=0]="None",e[e.DataWindow=2]="DataWindow",e[e.StatusLine=8]="StatusLine",e[e.All=15]="All"}(n||(n={}));function c(e){return["text","integer","float","price","session","resolution"].includes(e.type)&&e.hasOwnProperty("options")}var h,d,u,_,p;function m(e,t,i){for(const s of e)if(t[s.id]!==i[s.id])return!1;return!0}function g(e){return("time"===e.type||"price"===e.type)&&!0!==e.isHidden}function f(e){return[]}function y(e){return Object.values(p).map((e=>e)).includes(e.id)}!function(e){e.InitialCapital="initial_capital",e.Currency="currency",e.DefaultQTYValue="default_qty_value",e.DefaultQTYType="default_qty_type",e.Pyramiding="pyramiding",e.ComissionValue="commission_value",e.ComissionType="commission_type",e.BacktestFillLimitsAssumtion="backtest_fill_limits_assumption",e.Slippage="slippage",e.CalcOnOrderFills="calc_on_order_fills",e.CalcOnEveryTick="calc_on_every_tick",e.MarginLong="margin_long",e.MarginShort="margin_short",e.UseBarMagnifier="use_bar_magnifier",e.ProcessOrdersOnClose="process_orders_on_close",e.FillOrdersOnStandardOHLC="fill_orders_on_standard_ohlc"}(h||(h={})),function(e){e.Fixed="fixed",e.CashPerOrder="cash_per_order",e.PercentOfEquity="percent_of_equity"}(d||(d={})),function(e){e.Percent="percent",e.CashPerContract="cash_per_contract",e.CashPerOrder="cash_per_order"}(u||(u={})),function(e){e.FirstBar="first_visible_bar_time",
e.LastBar="last_visible_bar_time",e.Realtime="subscribeRealtime"}(_||(_={})),function(e){e.FgColor="__chart_fgcolor",e.BgColor="__chart_bgcolor"}(p||(p={}))},16638:(e,t,i)=>{"use strict";i.d(t,{isStudyDescriptor:()=>u,studyMetaInfoRepository:()=>g});var s=i(81251),n=i(11542),o=i(50151),r=i(68159),a=i(72530),l=i(1640),c=i(79303),h=i(9343),d=i(14426);(0,h.getLogger)("Chart.Studies.StudyMetaInfoRepository",{color:"#606"});function u(e){return"object"==typeof e&&null!==e&&"type"in e&&("java"===e.type&&"studyId"in e||"pine"===e.type&&"pineId"in e)}class _{constructor(e){this._isReady=!1,this._studyVersioning=null,this._rawStudiesMetaInfo=[],this._rawStudiesMetaInfoDeferredPromise=null,this._javaStudiesMetaInfo=[],this._pineMetaInfoCache=[],this._compileErrors=new WeakMap,this._studiesMigrations=[],this._chartApi=e}async requestMetaInfo(){if(null===this._rawStudiesMetaInfoDeferredPromise){this._rawStudiesMetaInfoDeferredPromise=(0,d.createDeferredPromise)();const e=(await this._chartApi.requestMetadata()).params[1].metainfo.slice();this._processLibraryMetaInfo(e),this._studyVersioning=new c.StudyVersioning(this._javaStudiesMetaInfo,this._studiesMigrations),this._requestFinished(),this._rawStudiesMetaInfoDeferredPromise.resolve(this._rawStudiesMetaInfo)}return this._rawStudiesMetaInfoDeferredPromise.promise}async findById(e){this._isReady||await this.requestMetaInfo();const t=this._findStudyMetaInfo(e);if(null!==t){const e=this._compileErrors.get(t);return e?Promise.reject(e):Promise.resolve(t)}return"pine"===e.type?this._compilePine(e):Promise.reject(`unexpected study id=${e.studyId} with type=${e.type}`)}findByIdSync(e){return this._findStudyMetaInfo(e)}isReady(){return this._isReady}async findAllJavaStudies(){return this._isReady||await this.requestMetaInfo(),this._javaStudiesMetaInfo}studyVersioning(){return(0,o.ensureNotNull)(this._studyVersioning)}getInternalMetaInfoArray(){return this._javaStudiesMetaInfo}addPineMetaInfo(e,t){const i=m(this._pineMetaInfoCache,e);return t&&(!Array.isArray(t)||t.length>0)&&(t=Array.isArray(t)?new PineCompileFailErrorImpl({warnings:[],errors:t},e):t,this._compileErrors.set(i,t)),i}async getLatestMetaInfoForPineStudy(e,t){return null}_processMigrations(e){throw new Error("not implemented")}_processSiteMetaInfo(e,t){throw new Error("not implemented")}_processLibraryMetaInfo(e){for(const t of e)p(t),m(this._javaStudiesMetaInfo,t);this._javaStudiesMetaInfo=this._javaStudiesMetaInfo.sort(((e,t)=>{const i=e.description_localized||e.description,s=t.description_localized||t.description;return i>s?1:it.id===e.studyId))||null):this._pineMetaInfoCache.find((t=>t.scriptIdPart===e.pineId&&(void 0===e.pineVersion||(0,o.ensureDefined)(t.pine).version===e.pineVersion)))||null}_compilePine(e){throw new Error("unsupported")}}
function p(e){e.description_localized=n.t(e.description,{context:"study"},i(83477))}function m(e,t){const i=new r.StudyMetaInfo(t).state();(0,a.migrateMetaInfoAndPropState)(i);const s=new r.StudyMetaInfo(i);let n=!0;const o=e.findIndex((e=>e.id===s.id));if(-1===o)e.push(s);else{const t=e[o],i=void 0!==t.pine?l.Version.parse(t.pine.version):null,r=void 0!==s.pine?l.Version.parse(s.pine.version):null;null===r||null===i||r.isGreaterOrEqual(i)?(t.removeDefaults(),e[o]=s):n=!1}return n&&s.createDefaults(),s}const g=(0,s.default)((()=>new _(window.ChartApiInstance)))},70294:(e,t,i)=>{"use strict";i.d(t,{StudyStatusProviderBase:()=>l});var s=i(27538),n=i(678),o=i(19466);const r={NONE:"Default"},a=!1;class l extends s.StatusProviderBase{constructor(e){super(),this._source=e}getSplitTitle(){return this._source.titleInParts(o.TitleDisplayTarget.StatusLine,!0,r,void 0,a)}text(){return this._source.isActualInterval()?this._source.isFailed()?`${this._source.title(o.TitleDisplayTarget.StatusLine,!0,r,void 0,a)}: ${this.sourceStatusText()}`:`${this._source.title(o.TitleDisplayTarget.StatusLine,!0,r,void 0,a)} ${this.sourceStatusText()}`:this._source.title(o.TitleDisplayTarget.StatusLine,!0,r,void 0,a)}sourceStatusText(){return(0,n.convertStudyStatusToString)(this._source.status(),!0)}errorStatus(){if(!this._source.isActualInterval()||this._source.isSymbolInvalid())return null;const e=this._source.status();return e.type===n.StudyStatusType.Error?{showReportItButton:e.errorDescription.showReportItButton,error:this.sourceStatusText(),solutionId:(0,n.studyStatusSolutionId)(e),title:(0,n.studyStatusTitle)(e),studyFeature:(0,n.studyStatusFeature)(e),stackTrace:(0,n.studyErrorStatusStackTrace)(e.errorDescription.stack_trace),editorError:e.errorDescription.editorError}:null}}},44158:(e,t,i)=>{"use strict";i.d(t,{StudyStatusProvider:()=>o});var s=i(11542),n=(i(678),i(70294));s.t(null,void 0,i(24077));class o extends n.StudyStatusProviderBase{sourceStatusText(){this._source.status();return super.sourceStatusText()}}},49936:(e,t,i)=>{"use strict";i.d(t,{StudyStatusView:()=>n});var s=i(27777);class n extends s.StatusView{constructor(e){super(e.statusProvider())}getSplitTitle(){return this._statusProvider.getSplitTitle()}update(e){this._text=this._statusProvider.text()}}},678:(e,t,i)=>{"use strict";i.d(t,{StudyStatusType:()=>h,convertStudyStatusToString:()=>d,createStudyError:()=>g,studyErrorStatusStackTrace:()=>m,studyStatusFeature:()=>p,studyStatusSolutionId:()=>u,studyStatusTitle:()=>_});var s=i(11542),n=i(82236);const o=s.t(null,void 0,i(50910));const r=new Map,a=new Map,l="loading...",c=s.t(null,void 0,i(62011));var h;function d(e,t){if(e.type===h.Loading)return t?c:l;if(e.type===h.Error){const i=e.errorDescription,s=t?(0,n.triesTranslateError)(i.error):i.error;if(i.ctx){const e={};return Object.entries(i.ctx).forEach((([t,i])=>{e[t]=i.toString()})),s.format(e)}return s}return""}function u(e){if(e.type===h.Error)return e.errorDescription.solution_id?e.errorDescription.solution_id:function(e){
for(const t of Array.from(r.keys()))if(e.includes(t))return r.get(t)}(e.errorDescription.error)}function _(e){if(e.type===h.Error)return function(e){const t=e.toLowerCase();return t.includes("the data vendor doesn't provide volume data for this symbol.")||t.includes("no volume is provided by the data vendor")}(e.errorDescription.error)?o:(0,n.triesTranslateError)(e.errorDescription.title??"Runtime error")}function p(e){const{errorDescription:{error:t}}=e;for(const[e,i]of a)if(t.startsWith(e))return i}function m(e){if(void 0===e)return;const t=[];for(const i of e){const e={functionOrScopeName:i.n,lineNumber:i.p};"id"in i&&(e.id=i.id),"v"in i&&(e.versionScript=i.v),t.push(e)}return t}function g(e,t){const i="check study unexpected error"===e.error;return{type:h.Error,errorDescription:{...e,showReportItButton:i}}}!function(e){e[e.Undefined=0]="Undefined",e[e.Loading=1]="Loading",e[e.Completed=2]="Completed",e[e.Error=3]="Error"}(h||(h={}))},21239:(e,t,i)=>{"use strict";i.d(t,{StudyStub:()=>b,isStudyStubDescriptor:()=>w});var s=i(50279),n=i(30551),o=i(50151),r=i(64147),a=(i(88960),i(62288)),l=i(49936),c=i(45579),h=i(725),d=i(52033),u=i(12988),_=i(70294),p=i(19466);class m extends _.StudyStatusProviderBase{text(){return this._source.isActualInterval()?`${this._source.title(p.TitleDisplayTarget.StatusLine)} ${this.sourceStatusText()}`:this._source.title(p.TitleDisplayTarget.StatusLine)}}var g=i(678),f=i(36915),y=i(16638);class v{getItems(){return[]}getValues(e){return[]}}const S=new d.Delegate;class b extends c.PriceDataSource{constructor(e,t,i,s,n=null){super(e),this._priceStep=.01,this._origState=null,this._descriptor=null,this._status={type:g.StudyStatusType.Undefined},this._statusChanged=new d.Delegate,this._descriptorChanged=new d.Delegate,this._formatter=new h.PriceFormatter({priceScale:100}),this._showPineVersionInStatusLine=new r.WatchedValue(!1).spawn(),this._pineSourceCodeModel=null,(0,y.isStudyDescriptor)(t)?this._descriptor=t:this._origState=t,this._title=i,this._alwaysShowInLegend=void 0!==s,this._isOverlay=s,this._studyMetaInfo=n;this._properties=new u.Property({visible:!0}),this._statusView=new l.StudyStatusView(this)}destroy(){this._pineSourceCodeModel?.get()?.destroy(),this._pineSourceCodeModel?.destroy(),this._showPineVersionInStatusLine.destroy(),super.destroy()}barColorer(){return null}properties(){return this._properties}statusView(){return this._statusView}legendView(){return null}state(e){return this._origState}getDescriptor(){return null===this._descriptor?null:{descriptor:this._descriptor,title:this._title,isOverlay:this._isOverlay,id:this.id(),status:this._status}}updateDescriptor(e){(0,s.default)(this._descriptor,e)||(this._descriptor=e,this._descriptorChanged.fire())}onDescriptorChanged(){return this._descriptorChanged}metaInfo(){return this._studyMetaInfo}setMetaInfo(e){this._studyMetaInfo=e}setStatus(e){const t=this.isDisplayedInLegend();if(this._status=e,this._statusChanged.fire(),this.isDisplayedInLegend()!==t){const e=this._model.paneForSource(this);if(e){
const t=this._model.panes().indexOf(e),i=a.InvalidationMask.invalidateLegendWidgetLayout(t);this.model().invalidate(i)}}}formatter(){return this._formatter}name(){return this._title}title(){return this.titleInParts().join(" ")}titleInParts(){const e=[this._title];return this._showPineVersionInStatusLine.value()&&e.push((0,o.ensureDefined)(this._studyMetaInfo?.pine).version),e}isFailed(){return this._status.type===g.StudyStatusType.Error}isLoading(){return this._status.type===g.StudyStatusType.Loading}isDisplayedInLegend(){return this._alwaysShowInLegend||this.isFailed()}setFailed(e){this.setStatus({type:g.StudyStatusType.Error,errorDescription:{error:e}}),this._model.updateSource(this)}isSymbolInvalid(){return!1}isActualInterval(){return!0}onIsActualIntervalChange(){return S}start(){}status(){return this._status}onStatusChanged(){return this._statusChanged}firstValue(){return null}currency(){return null}sessionId(){return this._model.mainSeries().sessionId()}sessionIdChanged(){return this._model.mainSeries().sessionIdChanged()}unit(){return null}symbolSource(){return this._model.mainSeries()}barsProvider(){return this._model.mainSeries()}legendValuesProvider(){return new v}statusProvider(e){return new m(this)}isRemovedByStudyTemplates(){return null!==this._origState&&(0,f.isStudyState)(this._origState)}pineSourceCodeModel(){return Promise.resolve(null)}}function w(e){return(0,n.isObject)(e)&&"descriptor"in e&&(0,y.isStudyDescriptor)(e.descriptor)}},22739:(e,t,i)=>{"use strict";i.d(t,{StudyValuesProvider:()=>v});var s=i(50335),n=i(49483),o=i(19063),r=i(56570),a=i(8025),l=i(15764),c=i(928),h=i(94113),d=i(83085),u=i(41991),_=i(50151),p=i(82587),m=i(19466);const g=n.CheckMobile.any(),f=r.enabled("hide_last_na_study_output"),y=r.enabled("always_show_legend_values_on_mobile");class v{constructor(e,t,i){this._emptyValues=[],this._colorProviders=new Map,this._study=e,this._model=t,this._studyMetaInfo=this._study.metaInfo(),this._studyProperties=this._study.properties().childs(),this._isFundamental=!1;const s=this._studyMetaInfo.plots;s&&s.forEach(((e,t)=>{if((0,h.isPlotWithTechnicalValues)(e))return;const s=e.id;this._emptyValues.push(function(e,t="",i=""){return{id:t,index:e,title:i,value:"",visible:!1}}(t,s,i?"":this._study.guiPlotName(m.TitleDisplayTarget.StatusLine,s)));const n=(0,h.isOhlcPlot)(e)?e.target:s;this._colorProviders.set(n,(0,d.createStudyPlotColorProvider)(this._studyMetaInfo,this._study.properties(),n))}))}getItems(){return this._emptyValues}getPlotColor(e,t){const i=t[e+1];if(!(0,s.isNumber)(i))return"";const n=i>0;let o;const r=this._studyMetaInfo.plots[e];let a=r.id;const l=this._studyProperties;if((0,h.isOhlcPlot)(r))a=r.target||a,o=(0,_.ensureDefined)(l.ohlcPlots.childs()[a].childs().color).value();else if((0,h.isArrowsPlot)(r)){const e=(0,_.ensureDefined)(l.styles.childs()[a]);o=n?e.childs().colorup.value():e.childs().colordown.value()}else o=(0,_.ensureDefined)(l.styles.childs()[a]?.child("color")).value();let c=o;const d=this._colorProviders.get(a),u=d&&d.getPlotPointStyle(t);return u&&((0,
h.isArrowsPlot)(r)?(n&&void 0!==u.colors[5]&&(c=u.colors[5]),n||void 0===u.colors[6]||(c=u.colors[6])):void 0!==u.colors[0]&&(c=u.colors[0])),"transparent"===c&&(c=o),c}getValues(e){const t=this._emptyValues.map((e=>({...e})));let i=null;const n=this._study.data().lastIndex(),r=this._studyProperties;if(null!==n)for(const e of t){const t=r.styles.childs()[e.id]?.childs().display.value();if(0===t)continue;const s=this._study.nearestIndex(n,a.PlotRowSearchMode.NearestLeft,e.index+1);if(void 0===s)continue;const o=s+this._study.offset(e.id);i=null!==i?Math.max(o,i):o}(null===e||null!==i&&e>i)&&(e=i);const l=this._hideValues(),c=this._study.isVisible()&&!l?p.notAvailable:"";for(const e of t)e.value=c;if(l)return t;f&&t.length&&(t[t.length-1].value="");const d=this._study.priceScale();if(!this._study.isVisible()||null===e||null===d||d.isEmpty()||this._model.timeScale().isEmpty())return t;const m={};for(const i of t){const t=i.id,l=(0,u.getPriceValueFormatterForStudy)(this._study,t),c=(0,_.ensureDefined)(r.styles.childs()[t]),d=c.childs().display.value();if(i.visible=0!==d,!i.visible)continue;const p=c.hasChild("plottype")?c.child("plottype")?.value():null,g=this._isFundamental&&(p===h.LineStudyPlotStyle.StepLine||p===h.LineStudyPlotStyle.StepLineWithDiamonds),f=i.index,y=e-this._study.offset(t),v=g||null!==n&&y>n?a.PlotRowSearchMode.NearestLeft:a.PlotRowSearchMode.Exact,S=this._study.nearestIndex(y,v);if(void 0===S)continue;let b=m[t];if(void 0===b&&(b=this._study.getMinFirstBarIndexForPlot(t),Number.isFinite(b)&&(m[t]=b)),b>S)continue;const w=this._study.data().last(),C=this._study.data().valueAt(S)||(null!==w?w.value:null);if(null===C)continue;const P=C[f+1];(0,s.isNumber)(P)&&(i.value=l(P),i.color=(0,o.resetTransparency)(this.getPlotColor(f,C)))}return t}_hideValues(){return y?(0,l.isLineToolName)(c.tool.value())||null!==this._model.lineBeingEdited():g&&(null===this._model.crosshairSource().pane||(0,l.isLineToolName)(c.tool.value())||null!==this._model.lineBeingEdited())}}},85604:(e,t,i)=>{"use strict";i.r(t),i.d(t,{StudyCompare:()=>H});var s=i(50151),n=i(50788),o=i(46806),r=i(68805),a=i(12988),l=i(73698),c=i(56570),h=i(94164),d=i(98558),u=i(49256),_=i(19063);const p=c.enabled("force_exchange_as_title");class m extends d.PriceAxisView{constructor(e,t){super(),this._studyCompare=e,this._data=t}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const n=this._studyCompare.priceScale(),o=this._studyCompare.lastValueData(this._data.plotIndex,!1);if(o.noData||null===n||n.isEmpty())return;const r=this._studyCompare.model(),a=r.timeScale().visibleBarsStrictRange(),l=r.mainSeries().bars().lastIndex();if(null===a||null===l)return;if(l<=a.lastBar())i.background=(0,_.resetTransparency)(o.color),i.textColor=this.generateTextColor(i.background),i.borderColor=void 0,e.borderVisible=!1,t.borderVisible=!1;else{const n=r.backgroundColorAtYPercentFromTop(o.coordinate/(0,s.ensureNotNull)(r.paneForSource(this._studyCompare)).height());i.background=n,i.textColor=(0,_.resetTransparency)(o.color),i.borderColor=i.textColor,e.borderVisible=!0,
t.borderVisible=!0}i.coordinate=o.coordinate,i.floatCoordinate=o.floatCoordinate;const c=r.properties().childs().scalesProperties.childs();c.showSeriesLastValue.value()&&(e.text=(0,u.getCurrentModePriceText)(n,o),c.seriesLastValueMode.value()!==h.PriceAxisLastValueMode.LastPriceAndPercentageValue?e.secondLine="":e.secondLine=(0,u.getOppositeModePriceText)(n,o),e.visible=!0),t.text="",c.showSymbolLabels.value()&&(t.text=this._paneText(),t.visible=t.text.length>0)}_paneText(){let e="";const t=this._studyCompare.symbolInfo();return p?e=(0,r.displayedSymbolExchange)(t):this._studyCompare.model().properties().childs().scalesProperties.childs().showSymbolLabels.value()&&(e=(0,r.displayedSymbolName)(t)),e}}i(11542);var g=i(22839),f=i(22739),y=i(928),v=i(49483),S=i(15764),b=i(37265),w=i(19466);const C=v.CheckMobile.any();class P extends f.StudyValuesProvider{constructor(e,t){super(e,t),this._emptyValues[0].title=e.guiPlotName(w.TitleDisplayTarget.StatusLine,"")}getValues(e){return(0,b.isNumber)(e)||(this._showLastPriceAndChangeOnly()?e=this._study.data().lastIndex():(e=this._model.crosshairSource().appliedIndex(),(0,b.isNumber)(e)||(e=this._study.data().lastIndex()))),super.getValues(e)}_hideValues(){return!1}_showLastPriceAndChangeOnly(){return C&&(null===this._model.crosshairSource().pane||(0,S.isLineToolName)(y.tool.value())||null!==this._model.lineBeingEdited())}}class T extends g.StudyDataWindowView{constructor(e,t){super(e,t),this._studyCompare=e}_hideValues(){return!1}_createValuesProvider(e,t){return new P(e,t)}}var x=i(44672);class I extends T{constructor(e,t){super(e,t),this._additional=null,this._showSeriesOHLC=t.properties().childs().paneProperties.childs().legendProperties.childs().showSeriesOHLC,this._showSeriesOHLC.subscribe(this,(()=>this.update((0,x.sourceChangeEvent)(e.id()))))}areValuesVisible(){return this._showSeriesOHLC.value()}destroy(){this._showSeriesOHLC.unsubscribeAll(this)}additional(){return this._additional}_updateImpl(){super._updateImpl()}}var M=i(49936),A=i(24526),L=i(44158);class k extends L.StudyStatusProvider{getSplitTitle(){return this._source.titleInParts(w.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}text(){return this._source.isActualInterval()?this._source.isFailed()?`${this._source.title(w.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}: ${this.sourceStatusText()}`:`${this._source.title(w.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)} ${this.sourceStatusText()}`:this._source.title(w.TitleDisplayTarget.StatusLine,!0,void 0,!1,!1)}}var D=i(76350),E=i(52270),B=i(64147);const V=c.enabled("study_overlay_compare_legend_option"),R=c.enabled("force_exchange_as_title"),N=!c.enabled("hide_study_compare_legend_item"),O=c.enabled("hide_unresolved_symbols_in_legend"),F=c.enabled("symbol_info_price_source");var W;!function(e){e.SnapShotSymbolInfoKey="___snapshot"}(W||(W={}));class H extends o.Study{constructor(e,t,i,s,n){super(e,function(e){return e.hasChild("currencyId")||e.addChild("currencyId",new a.Property(null)),e.hasChild("unitId")||e.addChild("unitId",new a.Property(null)),
e.addExcludedKey("currencyId",1),e.addExcludedKey("unitId",1),e}(t),i,s,n),this._isActingAsSymbolSource=new B.WatchedValue(!0),this._realignToolsLastParams=null,this._lastResolvedSymbolSource="",this.properties().childs().minTick.subscribe(null,(()=>this._recreatePriceFormattingDependencies())),this.properties().childs().minTick.subscribe(null,(()=>this._model.fullUpdate())),this.properties().childs().currencyId.subscribe(this,this._onCurrencyChanged),this.properties().childs().unitId.subscribe(this,this._onUnitChanged),this._symbolResolvingActive=new B.WatchedValue(!1),this._symbolHibernated=new B.WatchedValue(!1),e.mainSeries().onIntervalChanged().subscribe(this,(()=>e.realignLineTools(this)))}destroy(){this._model.mainSeries().onIntervalChanged().unsubscribeAll(this),super.destroy()}properties(){return this._properties}isActingAsSymbolSource(){return this._isActingAsSymbolSource.readonly()}symbolParams(){return(0,D.symbolParams)(this)}compareSymbolParams(e){return(0,D.compareSymbolParams)(this,e,this._model.unitConversionEnabled())}async setSymbolParams(e){this._setSymbolCurrencyUnitInternal(e)}symbol(){return this.properties().childs().inputs.childs().symbol.value()}symbolChanged(){return this.properties().childs().inputs.childs().symbol}setSymbol(e){this.setSymbolParams({symbol:e})}symbolInfo(){if(!this._resolvedSymbols)return null;const e=this.symbol();if(!e)return null;let t;return t=this._resolvedSymbols[this._getSymbolForResolve(e)]||null,t}symbolResolved(){return this.symbolsResolved()}symbolResolvingActive(){return this._symbolResolvingActive}symbolHibernated(){return this._symbolHibernated}isVisible(){const e=super.isVisible();return this._symbolHibernated.setValue(!e),e}symbolSameAsCurrent(e){return(0,D.symbolSameAsCurrent)(e,this.symbolInfo())}symbolSameAsResolved(e){return(0,E.symbolSameAsResolved)(e,this._lastResolvedSymbolSource,this.symbol())}currency(){return this.properties().childs().currencyId.value()||null}setCurrency(e){this.setSymbolParams({currency:e})}isConvertedToOtherCurrency(){return(0,r.isConvertedToOtherCurrency)(this.symbolInfo())}unit(){return this.properties().childs().unitId.value()||null}setUnit(e){this.setSymbolParams({unit:e})}isConvertedToOtherUnit(){return(0,r.isConvertedToOtherUnit)(this.symbolInfo(),this._model.unitConversionEnabled())}style(){return 2}setStyle(e){}interval(){return this._model.mainSeries().interval()}setInterval(e){}symbolSource(){return this}valueAt(e,t){return this.data().search(e)?.value[1]??null}state(e,t){const i=super.state(e,t);this._model.unitConversionEnabled()||delete i.state.unitId;const n=this.symbol();return i.state.inputs.symbol=(0,r.symbolToSaveInState)(this.symbolInfo()??this._model.chartApi().lastSymbolResolveInfo(n),n),e&&((0,s.ensureDefined)(i.data).symbols={___snapshot:this.symbolInfo()||void 0}),i}symbolTitle(e,t,i){return this.title(e,!0,{},!1,t)}titleInParts(e,t,i,s,n){const o=this._titleInParts(e,t,i,s,n);return[[o[0],...o[1]??[]].join(", ")]}tags(){const e=this.symbol();return e?[e]:[]}statusView(){return N?super.statusView():null}
guiPlotName(e,t){return this.properties().childs().inputs.childs().symbol.value()}canOverrideMinTick(){return!0}canBeHiddenByGlobalFlag(){return!1}legendValuesProvider(){return new P(this,this.model())}statusProvider(e){return new k(this)}measureUnitId(){return(0,r.measureUnitId)(this.symbolInfo())}getSymbolString(e){return void 0===e&&(e=this._getSymbolForApi(this.symbol())),(0,l.encodeExtendedSymbolOrGetSimpleSymbolString)(this._getSymbolObject(e))}_createPriceAxisView(e){return new m(this,{plotIndex:"compare"})}_createViews(){this._legendView||(this._legendView=new I(this,this._model)),this._dataWindowView||(this._dataWindowView=new T(this,this._model)),this._statusView||(this._statusView=new M.StudyStatusView(this)),super._createViews()}_onUnitChanged(){"alwaysOff"!==(0,n.currencyUnitVisibilityProperty)().value()&&this._model.fullUpdate(),this._model.unitConversionEnabled()&&this.isStarted()&&this._tryChangeInputs(),this._unitChanged.fire()}_getSymbolObject(e){const t=super._getSymbolObject(e),i=this.currency();null!==i&&(t["currency-id"]=i);const s=this.unit();return this._model.unitConversionEnabled()&&null!==s&&(t["unit-id"]=s),t}_onSymbolResolvingStart(e,t){this._lastResolvedSymbolSource=t,super._onSymbolResolvingStart(e,t),this._symbolResolvingActive.setValue(!0)}_onSymbolError(){super._onSymbolError(),this._symbolResolvingActive.setValue(!1)}_onSymbolResolved(e,t,i){super._onSymbolResolved(e,t,i),this._recreatePriceFormattingDependencies();const s=t===this.symbol()?(0,r.extractSymbolNameFromSymbolInfo)(i,this.symbol()):null,n=(0,r.symbolCurrency)(i),o=(0,r.symbolUnit)(i,this._model.unitConversionEnabled());this._setSymbolCurrencyUnitInternal({symbol:s??void 0,currency:n,unit:o},i),this._symbolResolvingActive.setValue(!1)}async _changeInputsImpl(e,t){await super._changeInputsImpl(e,t),this._realignLineToolsIfParamsChanged()}_createStudyOnServer(){const e=super._createStudyOnServer();return this._realignLineToolsIfParamsChanged(),e}_tryCreateFormatter(){const e=A.customFormatters?.priceFormatterFactory?.(this.symbolInfo(),this.properties().childs().minTick.value())??null;return null!==e?e:(0,r.createSeriesFormatter)(this.symbolInfo(),this.properties().childs().minTick.value())}_tryCreateDefaultFormatter(){return(0,r.createSeriesFormatter)(this.symbolInfo(),"default")}_titleInParts(e,t,i,s,n){const o=this.symbolInfo();return[this._getSymbolTitlePart(o),[this._getExchangeTitlePart(o,n),this._getPriceSourceTitlePart(o)].filter((e=>null!==e))]}_skipHistogramBaseOnAutoScale(){return!0}_getSymbolTitlePart(e){if(null===e)return O?"":this.properties().childs().inputs.childs().symbol.value();const t=(0,r.getSymbolExchange)(e);if(R&&void 0!==t)return t;if(V)switch(this._model.mainSeries().symbolTextSourceProxyProperty().value()){case"description":return e.description;case"ticker-and-description":return`${e.name}, ${e.description}`;case"long-description":return e.long_description??e.description}return e.name}_getExchangeTitlePart(e,t){return null===e||t?null:(0,r.getSymbolExchange)(e)}_getPriceSourceTitlePart(e){
return F&&!1!==this._model.properties().childs().paneProperties.childs().legendProperties.childs().showPriceSource.value()&&void 0!==e?.price_source_id?this._model.availablePriceSources(this.getSymbolString(this._getSymbolForApi(this.symbol()))).name(e.price_source_id)??null:null}_setSymbolCurrencyUnitInternal(e,t){const{symbol:i,currency:s,unit:n}=e,o=this.properties().childs(),a=o.inputs.childs().symbol.value(),l=o.currencyId.value(),c=o.unitId.value();if(void 0!==i&&o.inputs.childs().symbol.setValueSilently(i),void 0!==s&&o.currencyId.setValueSilently(s),void 0!==n&&o.unitId.setValueSilently(n),t)this._resolvedSymbolsByInput[this.symbol()]=t,this._resolvedSymbols[this._getSymbolForResolve(this.symbol())]=t,this._realignToolsLastParams=null;else{const e=this.symbolInfo();null!==e&&(o.currencyId.setValueSilently((0,r.symbolCurrency)(e)),o.unitId.setValueSilently((0,r.symbolUnit)(e,this._model.unitConversionEnabled())))}o.inputs.childs().symbol.value()!==a&&o.inputs.childs().symbol.fireChanged(),o.currencyId.value()!==l&&o.currencyId.fireChanged(),o.unitId.value()!==c&&o.unitId.fireChanged(),this._realignLineToolsIfParamsChanged()}_realignLineToolsIfParamsChanged(){let e=null===this._realignToolsLastParams;if(null!==this._realignToolsLastParams){const t=this.compareSymbolParams(this._realignToolsLastParams);e=t.symbolChanged||t.intervalChanged||t.currencyChanged||t.unitChanged}e&&(this._model.realignLineTools(this),this._realignToolsLastParams=this.symbolParams())}}},16227:(e,t,i)=>{"use strict";i.d(t,{StudyPriceAxisView:()=>r});var s=i(50151),n=i(98558),o=i(19063);class r extends n.PriceAxisView{constructor(e,t){super(),this._model=e.model(),this._source=e,this._data=t,this._isForceOverlay=!!this._source.metaInfo().isPlotForceOverlay(this._data.plotIndex)}update(e){"hover-change"!==e.type&&super.update(e)}_updateRendererData(e,t,i){e.visible=!1,t.visible=!1;const n=this._source.model(),r=this._isForceOverlay?n.mainSeries().priceScale():this._source.priceScale();if(null===r)return;if(!n.isPriceScaleVisible(r))return;const a=this._source.lastValueData(this._data.plotIndex,!1);if(a.noData)return;const l=n.timeScale().visibleBarsStrictRange(),c=n.mainSeries().bars().lastIndex();if(null!==l&&null!==c){if(c<=l.lastBar()){i.background=(0,o.resetTransparency)(a.color);let s=a.color;"transparent"===s&&(s=this._model.properties().childs().scalesProperties.childs().backgroundColor.value()),i.textColor=this.generateTextColor(s),i.borderColor=void 0,e.borderVisible=!1,t.borderVisible=!1}else{const r=n.backgroundColorAtYPercentFromTop(a.coordinate/(0,s.ensureNotNull)(n.paneForSource(this._source)).height());i.background=r,i.textColor=(0,o.resetTransparency)(a.color),i.borderColor=(0,o.resetTransparency)(i.textColor),e.borderVisible=!0,t.borderVisible=!0}i.coordinate=a.coordinate,i.floatCoordinate=a.floatCoordinate,this._showAxisLabel()&&(e.text=a.text,e.visible=!0),this._updatePaneRendererData(t)}}_showPaneLabel(){
return!!this._model.properties().childs().scalesProperties.childs().showStudyPlotLabels.value()&&this._source.properties().childs().showLabelsOnPriceScale.value()&&this._source.isPlotVisibleAt(this._data.plotIndex,4)}_showAxisLabel(){return!!this._model.properties().childs().scalesProperties.childs().showStudyLastValue.value()&&this._source.properties().childs().showLabelsOnPriceScale.value()&&this._source.isPlotVisibleAt(this._data.plotIndex,4)}_updatePaneRendererData(e){e.text="",this._showPaneLabel()&&(e.text=this._source.priceLabelText(this._data.plotIndex),e.visible=!0)}}},78749:(e,t,i)=>{"use strict";i.d(t,{applyOverridesToStudy:()=>d,applyOverridesToStudyDefaults:()=>u});var s=i(50151),n=i(94113),o=i(9343);const r={line:n.LineStudyPlotStyle.Line,histogram:n.LineStudyPlotStyle.Histogram,cross:n.LineStudyPlotStyle.Cross,area:n.LineStudyPlotStyle.Area,columns:n.LineStudyPlotStyle.Columns,circles:n.LineStudyPlotStyle.Circles,line_with_breaks:n.LineStudyPlotStyle.LineWithBreaks,area_with_breaks:n.LineStudyPlotStyle.AreaWithBreaks,step_line:n.LineStudyPlotStyle.StepLine,step_line_with_breaks:n.LineStudyPlotStyle.StepLineWithBreaks,step_line_with_diamonds:n.LineStudyPlotStyle.StepLineWithDiamonds},a=(0,o.getLogger)("Chart.Model.StudyPropertiesOverrider");var l,c;function h(e,t,i,s){const n=i.split(".");if(0===n.length||0===n[0].length)return;const o=function(e){const t=e.split(":");return{name:t[0],type:2===t.length?t[1]:null}}(n[0]),r=o.name,h=o.type,d=null!==h,u=!d||"band"===h,_=!d||"area"===h,p=!d||"input"===h,m=!d||"plot"===h?c.getPlotIdByTitle(e,r):null,g=u?c.getBandIndexByName(e,r):null,f=_?c.getFilledAreaIdByTitle(e,r):null,y=p?c.getInputByName(e,r):null,v=t.hasOwnProperty(r);if((null!==m?1:0)+(null!==g?1:0)+(null!==f?1:0)+(null!==y?1:0)+(v?1:0)>1)return void a.logWarn(`Study '${e.description}' has ambiguous identifier '${r}'`);const S=n[1];if(null!==m){if(1===n.length)return void a.logWarn(`Path of sub-property of '${r}' plot for study '${e.description}' must be not empty`);const i=n.slice(1);l.applyPlotProperty(e,t,m,i,s)}else if(null!==y)l.applyInputValue(t,y,s);else if(null!==g){if(void 0===S)return void a.logWarn(`Property name of '${r}' band for study '${e.description}' must be set`);l.applyBandProperty(t,g,S,s)}else if(null!==f){if(void 0===S)return void a.logWarn(`Property name of '${r}' area for study '${e.description}' must be set`);l.applyFilledAreaProperty(t,f,S,s)}else v?l.setRootProperty(t,n,s):a.logWarn(`Study '${e.description}' has no plot or input '${r}'`)}function d(e,t){const i=e.properties(),s=i.state();for(const i in t)t.hasOwnProperty(i)&&h(e.metaInfo(),s,i,t[i]);i.mergeAndFire(s)}function u(e,t,i){for(const s in e){if(!e.hasOwnProperty(s))continue;const n=s.indexOf(".");if(-1===n)continue;const o=s.substring(0,n),r=c.getMetaInfoByDescription(t,o);if(null===r){a.logWarn(`There is no such study ${o}`);continue}const l=i(r);null!==l?h(r,l,s.substring(n+1),e[s]):a.logWarn(`Cannot apply overrides for study ${o}`)}}!function(e){e.applyPlotProperty=function(e,t,i,o,l){
if(void 0===t.styles)return void a.logWarn("Study does not have styles");const c=o[0];if("color"===c){const r=function(e,t,i){if(void 0===e.plots)return null;for(const s of e.plots){if(!(0,n.isPaletteColorerPlot)(s)||void 0===t.palettes)continue;const e=t.palettes[s.palette];if(s.target===i&&void 0!==e)return e}return null}(e,t,i);return void function(e,t,i,n,o){void 0!==e.styles?null===t&&!isNaN(n)&&n>0?a.logWarn(`Study plot does not have color #${n}`):((0===n||isNaN(n))&&((0,s.ensureDefined)(e.styles[i]).color=String(o),n=0),null!==t&&((0,s.ensureDefined)(t.colors?.[n]).color=String(o))):a.logWarn("Study does not have styles")}(t,r,i,o.length>1?parseInt(o[1]):NaN,l)}const h=t.styles[i];if(void 0!==h&&h.hasOwnProperty(c)){if("plottype"===c){const e=r[String(l)];if(void 0===e)return void a.logWarn(`Unsupported plot type for plot: ${l}`);l=e}h[c]=l}else a.logWarn(`Study plot does not have property '${c}'`)},e.applyBandProperty=function(e,t,i,s){if(void 0===e.bands)return void a.logWarn("Study does not have bands");const n=e.bands[t];if(void 0!==n&&n.hasOwnProperty(i)){if("plottype"===i){const e=r[String(s)];if(void 0===e)return void a.logWarn(`Unsupported plot type for band: ${s}`);s=e}n[i]=s}else a.logWarn(`Study band does not have property '${i}'`)},e.applyFilledAreaProperty=function(e,t,i,s){if(void 0===e.filledAreasStyle)return void a.logWarn("Study does not have areas");const n=e.filledAreasStyle[t];void 0!==n&&n.hasOwnProperty(i)?n[i]=s:a.logWarn(`Study area does not have property '${i}'`)},e.applyInputValue=function(e,t,i){void 0!==e.inputs&&e.inputs.hasOwnProperty(t)?e.inputs[t]=i:a.logWarn(`Study does not have input '${t}'`)},e.setRootProperty=function(e,t,i){if(0===t.length)return;let s=e;for(const e of t.slice(0,-1)){if(null==s||!s.hasOwnProperty(e))break;s=s[e]}const n=t[t.length-1];null!=s&&s.hasOwnProperty(n)?s[n]=i:a.logWarn(`Study does not have property ${t.join(".")}`)}}(l||(l={})),function(e){e.getInputByName=function(e,t){if(void 0===e.inputs)return null;t=t.toLowerCase();for(const i of e.inputs)if(i.name.toLowerCase()===t)return i.id;return null},e.getPlotIdByTitle=function(e,t){if(void 0===e.styles)return null;t=t.toLowerCase();for(const i in e.styles){const s=e.styles[i];if((void 0!==s&&void 0!==s.title?s.title:i).toLowerCase()===t)return i}return null},e.getFilledAreaIdByTitle=function(e,t){if(void 0===e.filledAreas)return null;t=t.toLowerCase();for(const i of e.filledAreas)if(i.title.toLowerCase()===t)return i.id;return null},e.getBandIndexByName=function(e,t){if(void 0===e.bands)return null;t=t.toLowerCase();for(let i=0;i{"use strict";i.r(t),i.d(t,{StudiesChunkName:()=>Et,Study:()=>Kt,studyFormatter:()=>qt});var s=i(50279),n=i(90054),o=i(16738),r=i(50151),a=i(11542),l=i(9343),c=i(49822);function h(e){
const{name:t,group:i}=e;return t.length>0?`${i?`${i}.`:""}${t}`:void 0}var d=i(71885),u=i(52033),_=i(19063),p=i(58137),m=i(18172),g=i(45579),f=i(93280),y=i(64755),v=i(68159),S=i(14019),b=i(8025),w=i(85904),C=i(14878),P=i(44672),T=i(22739),x=i(7015);class I{constructor(e,t,i,s){this._study=e,this._model=t,this._showStudyValues=s??t.properties().childs().paneProperties.childs().legendProperties.childs().showStudyValues,this._hhistBasedStudy=void 0!==e.metaInfo().graphics.hhists,this._valuesProvider=this._createValuesProvider(e,t,i)}getItems(){return this._valuesProvider.getItems()}getValues(e){const t=this._valuesProvider.getValues(e),i=this._study.properties(),s=this._showStudyValues.value()&&i.childs().showLegendValues.value(),n=e=>!!this._hhistBasedStudy||this._study.isPlotVisibleAt(e,8);for(const e of t)e.visible=e.visible&&s&&n(e.id);return t}_createValuesProvider(e,t,i){return this._hhistBasedStudy?new x.HHistBasedValuesProvider(e,t,i):new T.StudyValuesProvider(e,t,i)}}var M=i(94113);class A extends C.StudyBaseWindowView{constructor(e,t){super(e,t),this._showStudyValues=t.properties().childs().paneProperties.childs().legendProperties.childs().showStudyValues,this._showStudyValues.subscribe(this,(()=>this.update((0,P.sourceChangeEvent)(e.id()))));const i=this._study.properties();i.childs().showLegendValues.subscribe(this,(()=>this.update((0,P.sourceChangeEvent)(e.id()))));const s=this._study.metaInfo().plots,n=new Set;s.forEach((t=>{if((0,M.isOhlcPlot)(t)){const s=t.target;if(n.has(s))return;n.add(s),i.childs().ohlcPlots.childs()[s].childs().display.subscribe(this,(()=>this.update((0,P.sourceChangeEvent)(e.id()))))}else(0,M.isPlotSupportDisplay)(t)&&i.childs().styles.childs()[t.id]?.childs().display.subscribe(this,(()=>this.update((0,P.sourceChangeEvent)(e.id()))))}))}areValuesVisible(){return this._showStudyValues.value()}additional(){return null}destroy(){this._showStudyValues.unsubscribeAll(this);const e=this._study.properties();e.childs().showLegendValues.unsubscribeAll(this);const t=this._study.metaInfo().plots,i=new Set;t.forEach((t=>{if((0,M.isOhlcPlot)(t)){const s=t.target;if(i.has(s))return;i.add(s),e.childs().ohlcPlots.childs()[s].childs().display.unsubscribeAll(this)}else(0,M.isPlotSupportDisplay)(t)&&e.childs().styles.childs()[t.id]?.childs().display.unsubscribeAll(this)}))}_createValuesProvider(e,t){return new I(e,t)}}var L=i(928),k=i(49936),D=i(73698),E=i(3462),B=i(4340),V=i(44158),R=i(37265);i(19466),i(84425);function N(e,t){return e.studyId.localeCompare(t.studyId)}function O(e){const t=new Set,i=[];return e.forEach((e=>{t.has(e.studyId)||(t.add(e.studyId),i.push(e))})),i}function F(e){const t=e.model().mainSeries();return{studyId:(0,r.ensureNotNull)(e.sourceId()),turnaround:e.turnaround(),sourceStudies:e.parentSources().filter((e=>e!==t)).map((e=>F(e)))}}var W=i(65383),H=i(56570),z=i(95201),U=i(30125);class j extends U.BitmapCoordinatesPaneRenderer{constructor(e){super(),this._data=e}hitTest(e){return null}_drawImpl(e){}_drawBackgroundImpl(e){
const{context:t,horizontalPixelRatio:i,bitmapSize:s}=e,n=this._data;for(let e=0;e0?(i-=n,s+=n):(i+=n,s-=n);const o=this._study.getMinFirstBarIndexForPlot(this._plotName);if(o>s)return;i=Math.max(o,i);const a=this._study.data();for(const e of a.rangeIterator(i,s)){let i=e.index;const s=e.value;i+=n;const o={timePointIndex:Math.floor(i),left:NaN,center:NaN,right:NaN};let a=(0,R.isNumber)(t)?t:50;a=Math.min(a,100),a=Math.max(a,0);const l=this._colorProvider.getPlotPointStyle(s);void 0!==l.colors[1]&&(o.color=(0,_.generateColor)((0,r.ensureDefined)(l.colors[1]),a)),this._items.push(o)}this._model.timeScale().fillBarBorders(this._items)}}var K,Y=i(86129),Z=i(11064),X=i(31785),J=i(9859),Q=i(66540),ee=i(3070),te=i(13380),ie=i(86441),se=i(34026),ne=i(50335),oe=i(30699),re=i(56468),ae=i(63812),le=i(68979),ce=i(27714),he=i(7114);!function(e){e.Left="left",e.Center="center",e.Right="right"}(K||(K={}));const de=(0,he.createDisconnectedCanvas)(document,(0,ce.size)({width:0,height:0}),1);class ue{constructor(e,t,i,s,n,o="center",a=0){this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=function(e,t,i,s){return(0,le.makeFont)(s,i,`${e?"bold ":""}${t?"italic ":""}`)}(t,i,s,n),this._fontSize=n,
this._verticalPadding=~~(n/6),this._textAlign=o,this._lineSpacing=a;const l=(0,r.ensureNotNull)(de.getContext("2d"));l.font=this._font,l.textBaseline="top";let c=0;for(let e=0;e