PageSourceSearch

https://www.sbo.co.at/_next/static/chunks/d0709137-d0973071f72494aa.js?dpl=dpl_7GGaAwHHrt4iSMBtH3PLnJb8nWux

js sbo.co.at collected 2026-09-29 18:19:32 UTC 143,532 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[426],{4004:(t,i,s)=>{s.d(i,{R9:()=>s1,ti:()=>en});var e,h,l,n,r,o,a,u,c,d,f=s(1054);let p={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};function m(t,i){let s={0:[],1:[t.lineWidth,t.lineWidth],2:[2*t.lineWidth,2*t.lineWidth],3:[6*t.lineWidth,6*t.lineWidth],4:[t.lineWidth,4*t.lineWidth]}[i];t.setLineDash(s)}function g(t,i,s,e){t.beginPath();let h=t.lineWidth%2?.5:0;t.moveTo(s,i+h),t.lineTo(e,i+h),t.stroke()}function v(t,i){if(!t)throw Error("Assertion failed"+(i?": "+i:""))}function w(t){if(void 0===t)throw Error("Value is undefined");return t}function b(t){if(null===t)throw Error("Value is null");return t}function y(t){return b(w(t))}!function(t){t[t.Simple=0]="Simple",t[t.WithSteps=1]="WithSteps",t[t.Curved=2]="Curved"}(e||(e={})),function(t){t[t.Solid=0]="Solid",t[t.Dotted=1]="Dotted",t[t.Dashed=2]="Dashed",t[t.LargeDashed=3]="LargeDashed",t[t.SparseDotted=4]="SparseDotted"}(h||(h={}));class M{constructor(){this.t=[]}i(t,i,s){this.t.push({h:t,l:i,o:!0===s})}_(t){let i=this.t.findIndex(i=>t===i.h);i>-1&&this.t.splice(i,1)}u(t){this.t=this.t.filter(i=>i.l!==t)}p(t,i,s){let e=[...this.t];this.t=this.t.filter(t=>!t.o),e.forEach(e=>e.h(t,i,s))}v(){return this.t.length>0}m(){this.t=[]}}function S(t,...i){for(let s of i)for(let i in s)void 0!==s[i]&&Object.prototype.hasOwnProperty.call(s,i)&&!["__proto__","constructor","prototype"].includes(i)&&("object"!=typeof s[i]||void 0===t[i]||Array.isArray(s[i])?t[i]=s[i]:S(t[i],s[i]));return t}function x(t){return"number"==typeof t&&isFinite(t)}function _(t){return"number"==typeof t&&t%1==0}function C(t){return"string"==typeof t}function T(t){return"boolean"==typeof t}function k(t){let i,s,e;if(!t||"object"!=typeof t)return t;for(s in i=Array.isArray(t)?[]:{},t)t.hasOwnProperty(s)&&(e=t[s],i[s]=e&&"object"==typeof e?k(e):e);return i}function R(t){return null!==t}function E(t){return null===t?void 0:t}let N="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function P(t,i,s){return void 0===i&&(i=N),`${s=void 0!==s?`${s} `:""}${t}px ${i}`}class z{constructor(t){this.M={S:1,C:5,P:NaN,k:"",T:"",R:"",D:"",V:0,I:0,B:0,A:0,L:0},this.O=t}N(){let t=this.M,i=this.W(),s=this.F();return t.P===i&&t.T===s||(t.P=i,t.T=s,t.k=P(i,s),t.A=2.5/12*i,t.V=t.A,t.I=i/12*t.C,t.B=i/12*t.C,t.L=0),t.R=this.H(),t.D=this.U(),this.M}H(){return this.O.N().layout.textColor}U(){return this.O.$()}W(){return this.O.N().layout.fontSize}F(){return this.O.N().layout.fontFamily}}function Y(t){return t<0?0:t>255?255:Math.round(t)||0}function V(t){return .199*t[0]+.687*t[1]+.114*t[2]}class F{constructor(t,i){this.q=new Map,this.Y=t,i&&(this.q=i)}j(t,i){if("transparent"===t)return t;let s=this.K(t),e=s[3];return`rgba(${s[0]}, ${s[1]}, ${s[2]}, ${i*e})`}X(t){let i=this.K(t);return{Z:`rgb(${i[0]}, ${i[1]}, ${i[2]})`,G:V(i)>160?"black":"white"}}J(t){return V(this.K(t))}tt(t,i,s){var e;let[h,l,n,r]=this.K(t),[o,a,u,c]=this.K(i),d=[Y(h+s*(o-h)),Y(l+s*(a-l)),Y(n+s*(u-n)),(e=r+s*(c-r))<=0||e>1?Math.min(Math.max(e,0),1):Math.round(1e4*e)/1e4];return`rgba(${d[0]}, ${d[1]}, ${d[2]}, ${d[3]})`}K(t){let i=this.q.get(t);if(i)return i;let s=(function(t){let i=document.createElement("div");i.style.display="none",document.body.appendChild(i),i.style.color=t;let s=window.getComputedStyle(i).color;return document.body.removeChild(i),s})(t).match(/^rgba?\s*\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)$/);if(!s){if(this.Y.length)for(let i of this.Y){let s=i(t);if(s)return this.q.set(t,s),s}throw Error(`Failed to parse color: ${t}`)}let e=[parseInt(s[1],10),parseInt(s[2],10),parseInt(s[3],10),s[4]?parseFloat(s[4]):1];return this.q.set(t,e),e}}class B{constructor(){this.it=[]}st(t){this.it=t}nt(t,i,s){this.it.forEach(e=>{e.nt(t,i,s)})}}class W{nt(t,i,s){t.useBitmapCoordinateSpace(t=>this.et(t,i,s))}}class L extends W{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et({context:t,horizontalPixelRatio:i,verticalPixelRatio:s}){if(null===this.rt||null===this.rt.lt)return;let e=this.rt.lt,h=this.rt,l=Math.max(1,Math.floor(i))%2/2,n=n=>{t.beginPath();for(let r=e.to-1;r>=e.from;--r){let e=h.ot[r],o=Math.round(e._t*i)+l,a=e.ut*s,u=n*s+l;t.moveTo(o,a),t.arc(o,a,u,0,2*Math.PI)}t.fill()};h.ct>0&&(t.fillStyle=h.dt,n(h.ft+h.ct)),t.fillStyle=h.vt,n(h.ft)}}function O(){return{ot:[{_t:0,ut:0,wt:0,gt:0}],vt:"",dt:"",ft:0,ct:0,lt:null}}let A={from:0,to:1};class D{constructor(t,i,s){this.Mt=new B,this.bt=[],this.xt=[],this.St=!0,this.O=t,this.Ct=i,this.yt=s,this.Mt.st(this.bt)}Pt(t){this.kt(),this.St=!0}Tt(){return this.St&&(this.Rt(),this.St=!1),this.Mt}
1kt(){let t=this.yt.Dt();t.length!==this.bt.length&&(this.xt=t.map(O),this.bt=this.xt.map(t=>{let i=new L;return i.ht(t),i}),this.Mt.st(this.bt))}Rt(){let t=2===this.Ct.N().mode||!this.Ct.Vt(),i=this.yt.It(),s=this.Ct.Bt(),e=this.O.At();this.kt(),i.forEach((i,h)=>{let l=this.xt[h],n=i.Et(s),r=i.zt();!t&&null!==n&&i.Vt()&&null!==r?(l.vt=n.Lt,l.ft=n.ft,l.ct=n.Ot,l.ot[0].gt=n.gt,l.ot[0].ut=i.Wt().Nt(n.gt,r.Ft),l.dt=n.Ht??this.O.Ut(l.ot[0].ut/i.Wt().$t()),l.ot[0].wt=s,l.ot[0]._t=e.qt(s),l.lt=A):l.lt=null})}}class $ extends W{constructor(t){super(),this.Yt=t}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:e}){if(null===this.Yt)return;let h=this.Yt.jt.Vt,l=this.Yt.Kt.Vt;if(!h&&!l)return;let n=Math.round(this.Yt._t*s),r=Math.round(this.Yt.ut*e);t.lineCap="butt",h&&n>=0&&(t.lineWidth=Math.floor(this.Yt.jt.ct*s),t.strokeStyle=this.Yt.jt.R,t.fillStyle=this.Yt.jt.R,m(t,this.Yt.jt.Xt),function(t,i,s,e){t.beginPath();let h=t.lineWidth%2?.5:0;t.moveTo(i+h,0),t.lineTo(i+h,e),t.stroke()}(t,n,0,i.height)),l&&r>=0&&(t.lineWidth=Math.floor(this.Yt.Kt.ct*e),t.strokeStyle=this.Yt.Kt.R,t.fillStyle=this.Yt.Kt.R,m(t,this.Yt.Kt.Xt),g(t,r,0,i.width))}}class I{constructor(t,i){this.St=!0,this.Zt={jt:{ct:1,Xt:0,R:"",Vt:!1},Kt:{ct:1,Xt:0,R:"",Vt:!1},_t:0,ut:0},this.Gt=new $(this.Zt),this.Jt=t,this.yt=i}Pt(){this.St=!0}Tt(t){return this.St&&(this.Rt(),this.St=!1),this.Gt}Rt(){let t=this.Jt.Vt(),i=this.yt.Qt().N().crosshair,s=this.Zt;if(2===i.mode)return s.Kt.Vt=!1,void(s.jt.Vt=!1);s.Kt.Vt=t&&this.Jt.ti(this.yt),s.jt.Vt=t&&this.Jt.ii(),s.Kt.ct=i.horzLine.width,s.Kt.Xt=i.horzLine.style,s.Kt.R=i.horzLine.color,s.jt.ct=i.vertLine.width,s.jt.Xt=i.vertLine.style,s.jt.R=i.vertLine.color,s._t=this.Jt.si(),s.ut=this.Jt.ni()}}function Q(t,i,s,e,h,l){t.save(),t.globalCompositeOperation="copy",t.fillStyle=l,t.fillRect(i,s,e,h),t.restore()}function X(t,i,s,e,h,l){t.beginPath(),t.roundRect?t.roundRect(i,s,e,h,l):(t.lineTo(i+e-l[1],s),0!==l[1]&&t.arcTo(i+e,s,i+e,s+l[1],l[1]),t.lineTo(i+e,s+h-l[2]),0!==l[2]&&t.arcTo(i+e,s+h,i+e-l[2],s+h,l[2]),t.lineTo(i+l[3],s+h),0!==l[3]&&t.arcTo(i,s+h,i,s+h-l[3],l[3]),t.lineTo(i,s+l[0]),0!==l[0]&&t.arcTo(i,s,i+l[0],s,l[0]))}function Z(t,i,s,e,h,l,n=0,r=[0,0,0,0],o=""){var a;if(t.save(),!n||!o||o===l)return X(t,i,s,e,h,r),t.fillStyle=l,t.fill(),void t.restore();let u=n/2;X(t,i+u,s+u,e-n,h-n,(a=-u,r.map(t=>0===t?t:t+a))),"transparent"!==l&&(t.fillStyle=l,t.fill()),"transparent"!==o&&(t.lineWidth=n,t.strokeStyle=o,t.closePath(),t.stroke()),t.restore()}function J(t,i,s,e,h,l,n){t.save(),t.globalCompositeOperation="copy";let r=t.createLinearGradient(0,0,0,h);r.addColorStop(0,l),r.addColorStop(1,n),t.fillStyle=r,t.fillRect(i,s,e,h),t.restore()}class j{constructor(t,i){this.ht(t,i)}ht(t,i){this.Yt=t,this.ei=i}$t(t,i){return this.Yt.Vt?t.P+t.A+t.V:0}nt(t,i,s,e){if(!this.Yt.Vt||0===this.Yt.ri.length)return;let h=this.Yt.R,l=this.ei.Z,n=t.useBitmapCoordinateSpace(t=>{let n=t.context;n.font=i.k;let r=this.hi(t,i,s,e),o=r.ai;return r.li?Z(n,o.oi,o._i,o.ui,o.ci,l,o.di,[o.ft,0,0,o.ft],l):Z(n,o.fi,o._i,o.ui,o.ci,l,o.di,[0,o.ft,o.ft,0],l),this.Yt.pi&&(n.fillStyle=h,n.fillRect(o.fi,o.mi,o.wi-o.fi,o.gi)),this.Yt.Mi&&(n.fillStyle=i.D,n.fillRect(r.li?o.bi-o.di:0,o._i,o.di,o.xi-o._i)),r});t.useMediaCoordinateSpace(({context:t})=>{let s=n.Si;t.font=i.k,t.textAlign=n.li?"right":"left",t.textBaseline="middle",t.fillStyle=h,t.fillText(this.Yt.ri,s.Ci,(s._i+s.xi)/2+s.yi)})}hi(t,i,s,e){let h,l,n;let{context:r,bitmapSize:o,mediaSize:a,horizontalPixelRatio:u,verticalPixelRatio:c}=t,d=this.Yt.pi||!this.Yt.Pi?i.C:0,f=this.Yt.ki?i.S:0,p=i.A+this.ei.Ti,m=i.V+this.ei.Ri,g=i.I,v=i.B,w=this.Yt.ri,b=i.P,y=s.Di(r,w),M=Math.ceil(s.Vi(r,w)),S=i.S+g+v+M+d,x=Math.max(1,Math.floor(c)),_=Math.round((b+p+m)*c);_%2!=x%2&&(_+=1);let C=f>0?Math.max(1,Math.floor(f*u)):0,T=Math.round(S*u),k=Math.round(d*u),R=Math.round((this.ei.Ii??this.ei.Bi)*c)-Math.floor(.5*c),E=Math.floor(R+x/2-_/2),N=E+_,P="right"===e,z=P?a.width-f:f,Y=P?o.width-C:C;return P?(h=Y-T,l=Y-k,n=z-d-g-f):(h=Y+T,l=Y+k,n=z+d+g),{li:P,ai:{_i:E,mi:R,xi:N,ui:T,ci:_,ft:2*u,di:C,oi:h,fi:Y,wi:l,gi:x,bi:o.width},Si:{_i:E/c,xi:N/c,Ci:n,yi:y}}}}class H{constructor(t){this.Ai={Bi:0,Z:"#000",Ri:0,Ti:0},this.Ei={ri:"",Vt:!1,pi:!0,Pi:!1,Ht:"",R:"#FFF",Mi:!1,ki:!1},this.zi={ri:"",Vt:!1,pi:!1,Pi:!0,Ht:"",R:"#FFF",Mi:!0,ki:!0},this.St=!0,this.Li=new(t||j)(this.Ei,this.Ai),this.Oi=new(t||j)(this.zi,this.Ai)}ri(){return this.Ni(),this.Ei.ri}Bi(){return this.Ni(),this.Ai.Bi}Pt(){this.St=!0}$t(t,i=!1){return Math.max(this.Li.$t(t,i),this.Oi.$t(t,i))}Wi(){return this.Ai.Ii||0}Fi(t){this.Ai.Ii=t}Hi(){return this.Ni(),this.Ei.Vt||this.zi.Vt}Ui(){return this.Ni(),this.Ei.Vt}Tt(t){return this.Ni(),this.Ei.pi=this.Ei.pi&&t.N().ticksVisible,this.zi.pi=this.zi.pi&&t.N().ticksVisible,this.Li.ht(this.Ei,this.Ai),this.Oi.ht(this.zi,this.Ai),this.Li}$i(){return this.Ni(),this.Li.ht(this.Ei,this.Ai),this.Oi.ht(this.zi,this.Ai),this.Oi}Ni(){this.St&&(this.Ei.pi=!0,this.zi.pi=!1,this.qi(this.Ei,this.zi,this.Ai))}}class K extends H{constructor(t,i,s){super(),this.Jt=t,this.Yi=i,this.ji=s}qi(t,i,s){if(t.Vt=!1,2===this.Jt.N().mode)return;let e=this.Jt.N().horzLine;if(!e.labelVisible)return;let h=this.Yi.zt();if(!this.Jt.Vt()||this.Yi.Ki()||null===h)return;
1let l=this.Yi.Xi().X(e.labelBackgroundColor);s.Z=l.Z,t.R=l.G;let n=2/12*this.Yi.P();s.Ti=n,s.Ri=n;let r=this.ji(this.Yi);s.Bi=r.Bi,t.ri=this.Yi.Zi(r.gt,h),t.Vt=!0}}let U=/[1-9]/g;class G{constructor(){this.Yt=null}ht(t){this.Yt=t}nt(t,i){if(null===this.Yt||!1===this.Yt.Vt||0===this.Yt.ri.length)return;let s=t.useMediaCoordinateSpace(({context:t})=>(t.font=i.k,Math.round(i.Gi.Vi(t,b(this.Yt).ri,U))));if(s<=0)return;let e=i.Ji,h=s+2*e,l=h/2,n=this.Yt.Qi,r=this.Yt.Bi,o=Math.floor(r-l)+.5;o<0?(r+=Math.abs(0-o),o=Math.floor(r-l)+.5):o+h>n&&(r-=Math.abs(n-(o+h)),o=Math.floor(r-l)+.5);let a=o+h,u=Math.ceil(0+i.S+i.C+i.A+i.P+i.V);t.useBitmapCoordinateSpace(({context:t,horizontalPixelRatio:s,verticalPixelRatio:e})=>{let h=b(this.Yt);t.fillStyle=h.Z;let l=Math.round(o*s),n=Math.round(0*e),r=Math.round(a*s),c=Math.round(u*e),d=Math.round(2*s);if(t.beginPath(),t.moveTo(l,n),t.lineTo(l,c-d),t.arcTo(l,c,l+d,c,d),t.lineTo(r-d,c),t.arcTo(r,c,r,c-d,d),t.lineTo(r,n),t.fill(),h.pi){let l=Math.round(h.Bi*s),r=Math.round((n+i.C)*e);t.fillStyle=h.R;let o=Math.max(1,Math.floor(s)),a=Math.floor(.5*s);t.fillRect(l-a,n,o,r-n)}}),t.useMediaCoordinateSpace(({context:t})=>{let s=b(this.Yt),h=0+i.S+i.C+i.A+i.P/2;t.font=i.k,t.textAlign="left",t.textBaseline="middle",t.fillStyle=s.R;let l=i.Gi.Di(t,"Apr0");t.translate(o+e,h+l),t.fillText(s.ri,0,0)})}}class q{constructor(t,i,s){this.St=!0,this.Gt=new G,this.Zt={Vt:!1,Z:"#4c525e",R:"white",ri:"",Qi:0,Bi:NaN,pi:!0},this.Ct=t,this.ts=i,this.ji=s}Pt(){this.St=!0}Tt(){return this.St&&(this.Rt(),this.St=!1),this.Gt.ht(this.Zt),this.Gt}Rt(){let t=this.Zt;if(t.Vt=!1,2===this.Ct.N().mode)return;let i=this.Ct.N().vertLine;if(!i.labelVisible)return;let s=this.ts.At();if(s.Ki())return;t.Qi=s.Qi();let e=this.ji();if(null===e)return;t.Bi=e.Bi;let h=s.ss(this.Ct.Bt());t.ri=s.ns(b(h)),t.Vt=!0;let l=this.ts.Xi().X(i.labelBackgroundColor);t.Z=l.Z,t.R=l.G,t.pi=s.N().ticksVisible}}class tt{constructor(){this.es=null,this.rs=0}hs(){return this.rs}ls(t){this.rs=t}Wt(){return this.es}_s(t){this.es=t}us(t){return[]}cs(){return[]}Vt(){return!0}}!function(t){t[t.Normal=0]="Normal",t[t.Magnet=1]="Magnet",t[t.Hidden=2]="Hidden",t[t.MagnetOHLC=3]="MagnetOHLC"}(l||(l={}));class ti extends tt{constructor(t,i){let s,e,h,l;super(),this.yt=null,this.ds=NaN,this.fs=0,this.ps=!1,this.vs=new Map,this.ws=!1,this.gs=new WeakMap,this.Ms=new WeakMap,this.bs=NaN,this.xs=NaN,this.Ss=NaN,this.Cs=NaN,this.ts=t,this.ys=i,this.Ps=(s=()=>this.ds,e=()=>this.xs,t=>{let i=e(),h=s();if(t===b(this.yt).ks())return{gt:h,Bi:i};{let s=b(t.zt());return{gt:t.Ts(i,s),Bi:i}}});let n=(h=()=>this.fs,l=()=>this.si(),()=>{let t=this.ts.At().Rs(h()),i=l();return t&&Number.isFinite(i)?{wt:t,Bi:i}:null});this.Ds=new q(this,t,n)}N(){return this.ys}Vs(t,i){this.Ss=t,this.Cs=i}Is(){this.Ss=NaN,this.Cs=NaN}Bs(){return this.Ss}As(){return this.Cs}Es(t,i,s){this.ws||(this.ws=!0),this.ps=!0,this.zs(t,i,s)}Bt(){return this.fs}si(){return this.bs}ni(){return this.xs}Vt(){return this.ps}Ls(){this.ps=!1,this.Os(),this.ds=NaN,this.bs=NaN,this.xs=NaN,this.yt=null,this.Is(),this.Ns()}Ws(t){let i=this.gs.get(t);i||(i=new I(this,t),this.gs.set(t,i));let s=this.Ms.get(t);return s||(s=new D(this.ts,this,t),this.Ms.set(t,s)),[i,s]}ti(t){return t===this.yt&&this.ys.horzLine.visible}ii(){return this.ys.vertLine.visible}Fs(t,i){this.ps&&this.yt===t||this.vs.clear();let s=[];return this.yt===t&&s.push(this.Hs(this.vs,i,this.Ps)),s}cs(){return this.ps?[this.Ds]:[]}Us(){return this.yt}Ns(){this.ts.$s().forEach(t=>{this.gs.get(t)?.Pt(),this.Ms.get(t)?.Pt()}),this.vs.forEach(t=>t.Pt()),this.Ds.Pt()}qs(t){return t&&!t.ks().Ki()?t.ks():null}zs(t,i,s){this.Ys(t,i,s)&&this.Ns()}Ys(t,i,s){let e=this.bs,h=this.xs,l=this.ds,n=this.fs,r=this.yt,o=this.qs(s);this.fs=t,this.bs=isNaN(t)?NaN:this.ts.At().qt(t),this.yt=s;let a=null!==o?o.zt():null;return null!==o&&null!==a?(this.ds=i,this.xs=o.Nt(i,a)):(this.ds=NaN,this.xs=NaN),e!==this.bs||h!==this.xs||n!==this.fs||l!==this.ds||r!==this.yt}Os(){let t=this.ts.js().map(t=>t.Xs().Ks()).filter(R),i=0===t.length?null:Math.max(...t);this.fs=null!==i?i:NaN}Hs(t,i,s){let e=t.get(i);return void 0===e&&(e=new K(this,i,s),t.set(i,e)),e}}function ts(t){return"left"===t||"right"===t}class te{constructor(t){this.Zs=new Map,this.Gs=[],this.Js=t}Qs(t,i){var s;let e=void 0===(s=this.Zs.get(t))?i:{tn:Math.max(s.tn,i.tn),sn:s.sn||i.sn};this.Zs.set(t,e)}nn(){return this.Js}en(t){let i=this.Zs.get(t);return void 0===i?{tn:this.Js}:{tn:Math.max(this.Js,i.tn),sn:i.sn}}rn(){this.hn(),this.Gs=[{an:0}]}ln(t){this.hn(),this.Gs=[{an:1,Ft:t}]}_n(t){this.un(),this.Gs.push({an:5,Ft:t})}hn(){this.un(),this.Gs.push({an:6})}cn(){this.hn(),this.Gs=[{an:4}]}dn(t){this.hn(),this.Gs.push({an:2,Ft:t})}fn(t){this.hn(),this.Gs.push({an:3,Ft:t})}pn(){return this.Gs}vn(t){for(let i of t.Gs)this.mn(i);this.Js=Math.max(this.Js,t.Js),t.Zs.forEach((t,i)=>{this.Qs(i,t)})}static wn(){return new te(2)}static gn(){return new te(3)}mn(t){switch(t.an){case 0:this.rn();break;case 1:this.ln(t.Ft);break;case 2:this.dn(t.Ft);break;case 3:this.fn(t.Ft);break;case 4:this.cn();break;case 5:this._n(t.Ft);break;case 6:this.un()}}un(){let t=this.Gs.findIndex(t=>5===t.an);-1!==t&&this.Gs.splice(t,1)}}function th(t,i){if(!x(t))return"n/a";if(!_(i)||i<0||i>16)throw TypeError("invalid length");return 0===i?t.toString():("0000000000000000"+t.toString()).slice(-i)}class tl{constructor(t,i){if(i||(i=1),x(t)&&_(t)||(t=100),t<0)throw TypeError("invalid base");this.Yi=t,this.Mn=i,this.bn()}format(t){let i=t<0?"−":"";return t=Math.abs(t),i+this.xn(t)}bn(){if(this.Sn=0,this.Yi>0&&this.Mn>0){let t=this.Yi;for(;t>1;)t/=10,this.Sn++}}xn(t){let i=this.Yi/this.Mn,s=Math.floor(t),e="",h=void 0!==this.Sn?this.Sn:NaN;if(i>1){let l=+(Math.round(t*i)-s*i).toFixed(this.Sn);l>=i&&(l-=i,s+=1),e="."+th(+l.toFixed(this.Sn)*this.Mn,h)}else s=Math.round(s*i)/i,h>0&&(e="."+th(0,h));return s.toFixed(0)+e}}class tn extends tl{constructor(t=100){super(t)}format(t){return`${super.format(t)}%`}}class tr{constructor(t){this.Cn=t}format(t){let i="";return t<0&&(i="-",t=-t),t<995?i+this.yn(t):t<999995?i+this.yn(t/1e3)+"K":t<0x3b9ac9fb?(t=1e3*Math.round(t/1e3),i+this.yn(t/1e6)+"M"):(t=1e6*Math.round(t/1e6),i+this.yn(t/1e9)+"B")}yn(t){let i=Math.pow(10,this.Cn);return((t=Math.round(t*i)/i)>=1e-15&&t<1?t.toFixed(this.Cn).replace(/\.?0+$/,""):String(t)).replace(/(\.[1-9]*)0+$/,(t,i)=>i)}}let to=/[2-9]/g;class ta{constructor(t=50){this.Pn=0,this.kn=1,this.Tn=1,this.Rn={},this.Dn=new Map,this.Vn=t}In(){this.Pn=0,this.Dn.clear(),this.kn=1,this.Tn=1,this.Rn={}}Vi(t,i,s){return this.Bn(t,i,s).width}Di(t,i,s){let e=this.Bn(t,i,s);return((e.actualBoundingBoxAscent||0)-(e.actualBoundingBoxDescent||0))/2}Bn(t,i,s){let e=String(i).replace(s||to,"0");if(this.Dn.has(e))return w(this.Dn.get(e)).An;if(this.Pn===this.Vn){let t=this.Rn[this.Tn];delete this.Rn[this.Tn],this.Dn.delete(t),this.Tn++,this.Pn--}t.save(),t.textBaseline="middle";let h=t.measureText(e);
1return t.restore(),0===h.width&&i.length||(this.Dn.set(e,{An:h,En:this.kn}),this.Rn[this.kn]=e,this.Pn++,this.kn++),h}}class tu{constructor(t){this.zn=null,this.M=null,this.Ln="right",this.On=t}Nn(t,i,s){this.zn=t,this.M=i,this.Ln=s}nt(t){null!==this.M&&null!==this.zn&&this.zn.nt(t,this.M,this.On,this.Ln)}}class tc{constructor(t,i,s){this.Wn=t,this.On=new ta(50),this.Fn=i,this.O=s,this.W=-1,this.Gt=new tu(this.On)}Tt(){let t=this.O.Hn(this.Fn);if(null===t)return null;let i=t.Un(this.Fn)?t.$n():this.Fn.Wt();if(null===i)return null;let s=t.qn(i);if("overlay"===s)return null;let e=this.O.Yn();return e.P!==this.W&&(this.W=e.P,this.On.In()),this.Gt.Nn(this.Wn.$i(),e,s),this.Gt}}class td extends W{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}jn(t,i){if(!this.Yt?.Vt)return null;let{ut:s,ct:e,Kn:h}=this.Yt;return i>=s-e-7&&i<=s+e+7?{Xn:this.Yt,Kn:h}:null}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:e}){if(null===this.Yt||!1===this.Yt.Vt)return;let h=Math.round(this.Yt.ut*e);h<0||h>i.height||(t.lineCap="butt",t.strokeStyle=this.Yt.R,t.lineWidth=Math.floor(this.Yt.ct*s),m(t,this.Yt.Xt),g(t,h,0,i.width))}}class tf{constructor(t){this.Zn={ut:0,R:"rgba(0, 0, 0, 0)",ct:1,Xt:0,Vt:!1},this.Gn=new td,this.St=!0,this.Jn=t,this.Qn=t.Qt(),this.Gn.ht(this.Zn)}Pt(){this.St=!0}Tt(){return this.Jn.Vt()?(this.St&&(this.te(),this.St=!1),this.Gn):null}}class tp extends tf{constructor(t){super(t)}te(){this.Zn.Vt=!1;let t=this.Jn.Wt(),i=t.ie().ie;if(2!==i&&3!==i)return;let s=this.Jn.N();if(!s.baseLineVisible||!this.Jn.Vt())return;let e=this.Jn.zt();null!==e&&(this.Zn.Vt=!0,this.Zn.ut=t.Nt(e.Ft,e.Ft),this.Zn.R=s.baseLineColor,this.Zn.ct=s.baseLineWidth,this.Zn.Xt=s.baseLineStyle)}}class tm extends W{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}se(){return this.Yt}et({context:t,horizontalPixelRatio:i,verticalPixelRatio:s}){let e=this.Yt;if(null===e)return;let h=Math.max(1,Math.floor(i)),l=h%2/2,n=Math.round(e.ne.x*i)+l,r=e.ne.y*s;t.fillStyle=e.ee,t.beginPath();let o=Math.max(2,1.5*e.re)*i;t.arc(n,r,o,0,2*Math.PI,!1),t.fill(),t.fillStyle=e.he,t.beginPath(),t.arc(n,r,e.ft*i,0,2*Math.PI,!1),t.fill(),t.lineWidth=h,t.strokeStyle=e.ae,t.beginPath(),t.arc(n,r,e.ft*i+h/2,0,2*Math.PI,!1),t.stroke()}}let tg=[{le:0,oe:.25,_e:4,ue:10,ce:.25,de:0,fe:.4,pe:.8},{le:.25,oe:.525,_e:10,ue:14,ce:0,de:0,fe:.8,pe:0},{le:.525,oe:1,_e:14,ue:14,ce:0,de:0,fe:0,pe:0}];class tv{constructor(t){this.Gt=new tm,this.St=!0,this.ve=!0,this.me=performance.now(),this.we=this.me-1,this.ge=t}Me(){this.we=this.me-1,this.Pt()}be(){if(this.Pt(),2===this.ge.N().lastPriceAnimation){let t=performance.now(),i=this.we-t;if(i>0)return void(i<650&&(this.we+=2600));this.me=t,this.we=t+2600}}Pt(){this.St=!0}xe(){this.ve=!0}Vt(){return 0!==this.ge.N().lastPriceAnimation}Se(){switch(this.ge.N().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.we}}Tt(){return this.St?(this.Rt(),this.St=!1,this.ve=!1):this.ve&&(this.Ce(),this.ve=!1),this.Gt}Rt(){this.Gt.ht(null);let t=this.ge.Qt().At(),i=t.ye(),s=this.ge.zt();if(null===i||null===s)return;let e=this.ge.Pe(!0);if(e.ke||!i.Te(e.Re))return;let h={x:t.qt(e.Re),y:this.ge.Wt().Nt(e.gt,s.Ft)},l=e.R,n=this.ge.N().lineWidth,r=this.De(this.Ve(),l);this.Gt.ht({ee:l,re:n,he:r.he,ae:r.ae,ft:r.ft,ne:h})}Ce(){let t=this.Gt.se();if(null!==t){let i=this.De(this.Ve(),t.ee);t.he=i.he,t.ae=i.ae,t.ft=i.ft}}Ve(){return this.Se()?performance.now()-this.me:2599}Ie(t,i,s,e){return this.ge.Qt().Xi().j(t,s+(e-s)*i)}De(t,i){var s;let e;let h=t%2600/2600;for(let t of tg)if(h>=t.le&&h<=t.oe){e=t;break}v(void 0!==e,"Last price animation internal logic error");let l=(h-e.le)/(e.oe-e.le);return{he:this.Ie(i,l,e.ce,e.de),ae:this.Ie(i,l,e.fe,e.pe),ft:(s=e._e)+(e.ue-s)*l}}}class tw extends tf{constructor(t){super(t)}te(){let t=this.Zn;t.Vt=!1;let i=this.Jn.N();if(!i.priceLineVisible||!this.Jn.Vt())return;let s=this.Jn.Pe(0===i.priceLineSource);s.ke||(t.Vt=!0,t.ut=s.Bi,t.R=this.Jn.Be(s.R),t.ct=i.priceLineWidth,t.Xt=i.priceLineStyle)}}class tb extends H{constructor(t){super(),this.Jt=t}qi(t,i,s){t.Vt=!1,i.Vt=!1;let e=this.Jt;if(!e.Vt())return;let h=e.N(),l=h.lastValueVisible,n=""!==e.Ae(),r=0===h.seriesLastValueMode,o=e.Pe(!1);if(o.ke)return;
1l&&(t.ri=this.Ee(o,l,r),t.Vt=0!==t.ri.length),(n||r)&&(i.ri=this.ze(o,l,n,r),i.Vt=i.ri.length>0);let a=e.Be(o.R),u=this.Jt.Qt().Xi().X(a);s.Z=u.Z,s.Bi=o.Bi,i.Ht=e.Qt().Ut(o.Bi/e.Wt().$t()),t.Ht=a,t.R=u.G,i.R=u.G}ze(t,i,s,e){let h="",l=this.Jt.Ae();return s&&0!==l.length&&(h+=`${l} `),i&&e&&(h+=this.Jt.Wt().Le()?t.Oe:t.Ne),h.trim()}Ee(t,i,s){return i?s?this.Jt.Wt().Le()?t.Ne:t.Oe:t.ri:""}}function ty(t,i,s,e){let h=Number.isFinite(i),l=Number.isFinite(s);return h&&l?t(i,s):h||l?h?i:s:e}class tM{constructor(t,i){this.We=t,this.Fe=i}He(t){return null!==t&&this.We===t.We&&this.Fe===t.Fe}Ue(){return new tM(this.We,this.Fe)}$e(){return this.We}qe(){return this.Fe}Ye(){return this.Fe-this.We}Ki(){return this.Fe===this.We||Number.isNaN(this.Fe)||Number.isNaN(this.We)}vn(t){return null===t?this:new tM(ty(Math.min,this.$e(),t.$e(),-1/0),ty(Math.max,this.qe(),t.qe(),1/0))}je(t){if(!x(t)||0==this.Fe-this.We)return;let i=.5*(this.Fe+this.We),s=this.Fe-i,e=this.We-i;s*=t,e*=t,this.Fe=i+s,this.We=i+e}Ke(t){x(t)&&(this.Fe+=t,this.We+=t)}Xe(){return{minValue:this.We,maxValue:this.Fe}}static Ze(t){return null===t?null:new tM(t.minValue,t.maxValue)}}class tS{constructor(t,i){this.Ge=t,this.Je=i||null}Qe(){return this.Ge}tr(){return this.Je}Xe(){return{priceRange:null===this.Ge?null:this.Ge.Xe(),margins:this.Je||void 0}}static Ze(t){return null===t?null:new tS(tM.Ze(t.priceRange),t.margins)}}class tx extends tf{constructor(t,i){super(t),this.ir=i}te(){let t=this.Zn;t.Vt=!1;let i=this.ir.N();if(!this.Jn.Vt()||!i.lineVisible)return;let s=this.ir.sr();null!==s&&(t.Vt=!0,t.ut=s,t.R=i.color,t.ct=i.lineWidth,t.Xt=i.lineStyle,t.Kn=this.ir.N().id)}}class t_ extends H{constructor(t,i){super(),this.ge=t,this.ir=i}qi(t,i,s){t.Vt=!1,i.Vt=!1;let e=this.ir.N(),h=e.axisLabelVisible,l=""!==e.title,n=this.ge;if(!h||!n.Vt())return;let r=this.ir.sr();if(null===r)return;l&&(i.ri=e.title,i.Vt=!0),i.Ht=n.Qt().Ut(r/n.Wt().$t()),t.ri=this.nr(e.price),t.Vt=!0;let o=this.ge.Qt().Xi().X(e.axisLabelColor||e.color);s.Z=o.Z;let a=e.axisLabelTextColor||o.G;t.R=a,i.R=a,s.Bi=r}nr(t){let i=this.ge.zt();return null===i?"":this.ge.Wt().Zi(t,i.Ft)}}class tC{constructor(t,i){this.ge=t,this.ys=i,this.er=new tx(t,this),this.Wn=new t_(t,this),this.rr=new tc(this.Wn,t,t.Qt())}hr(t){S(this.ys,t),this.Pt(),this.ge.Qt().ar()}N(){return this.ys}lr(){return this.er}_r(){return this.rr}ur(){return this.Wn}Pt(){this.er.Pt(),this.Wn.Pt()}sr(){let t=this.ge,i=t.Wt();if(t.Qt().At().Ki()||i.Ki())return null;let s=t.zt();return null===s?null:i.Nt(this.ys.price,s.Ft)}}class tT extends tt{constructor(t){super(),this.ts=t}Qt(){return this.ts}}let tk={Bar:(t,i,s,e)=>{let h=i.upColor,l=i.downColor,n=b(t(s,e)),r=y(n.Ft[0])<=y(n.Ft[3]);return{cr:n.R??(r?h:l)}},Candlestick:(t,i,s,e)=>{let h=i.upColor,l=i.downColor,n=i.borderUpColor,r=i.borderDownColor,o=i.wickUpColor,a=i.wickDownColor,u=b(t(s,e)),c=y(u.Ft[0])<=y(u.Ft[3]);return{cr:u.R??(c?h:l),dr:u.Ht??(c?n:r),pr:u.vr??(c?o:a)}},Custom:(t,i,s,e)=>({cr:b(t(s,e)).R??i.color}),Area:(t,i,s,e)=>{let h=b(t(s,e));return{cr:h.vt??i.lineColor,vt:h.vt??i.lineColor,mr:h.mr??i.topColor,wr:h.wr??i.bottomColor}},Baseline:(t,i,s,e)=>{let h=b(t(s,e));return{cr:h.Ft[3]>=i.baseValue.price?i.topLineColor:i.bottomLineColor,gr:h.gr??i.topLineColor,Mr:h.Mr??i.bottomLineColor,br:h.br??i.topFillColor1,Sr:h.Sr??i.topFillColor2,Cr:h.Cr??i.bottomFillColor1,yr:h.yr??i.bottomFillColor2}},Line:(t,i,s,e)=>{let h=b(t(s,e));return{cr:h.R??i.color,vt:h.R??i.color}},Histogram:(t,i,s,e)=>({cr:b(t(s,e)).R??i.color})};class tR{constructor(t){this.Pr=(t,i)=>void 0!==i?i.Ft:this.ge.Xs().kr(t),this.ge=t,this.Tr=tk[t.Rr()]}Dr(t,i){return this.Tr(this.Pr,this.ge.N(),t,i)}}function tE(t,i,s,e,h=0,l=i.length){let n=l-h;for(;0<n;){let l=n>>1,r=h+l;e(i[r],s)===t?(h=r+1,n-=l+1):n=l}return h}let tN=tE.bind(null,!0),tP=tE.bind(null,!1);!function(t){t[t.NearestLeft=-1]="NearestLeft",t[t.None=0]="None",t[t.NearestRight=1]="NearestRight"}(n||(n={}));class tz{constructor(){this.Vr=[],this.Ir=new Map,this.Br=new Map,this.Ar=[]}Er(){return this.zr()>0?this.Vr[this.Vr.length-1]:null}Lr(){return this.zr()>0?this.Or(0):null}Ks(){return this.zr()>0?this.Or(this.Vr.length-1):null}zr(){return this.Vr.length}Ki(){return 0===this.zr()}Te(t){return null!==this.Nr(t,0)}kr(t){return this.Wr(t)}Wr(t,i=0){let s=this.Nr(t,i);return null===s?null:{...this.Fr(s),Re:this.Or(s)}}Hr(){return this.Vr}Ur(t,i,s){if(this.Ki())return null;let e=null;for(let h of s)e=tY(e,this.$r(t,i,h));return e}ht(t){this.Br.clear(),this.Ir.clear(),this.Vr=t,this.Ar=t.map(t=>t.Re)}qr(){return this.Ar}Or(t){return this.Vr[t].Re}Fr(t){return this.Vr[t]}Nr(t,i){let s=this.Yr(t);if(null===s&&0!==i)switch(i){case -1:return this.jr(t);case 1:return this.Kr(t);default:throw TypeError("Unknown search mode")}return s}jr(t){let i=this.Xr(t);return i>0&&(i-=1),i!==this.Vr.length&&this.Or(i)<t?i:null}Kr(t){let i=this.Zr(t);return i!==this.Vr.length&&t<this.Or(i)?i:null}Yr(t){let i=this.Xr(t);return i===this.Vr.length||t<this.Vr[i].Re?null:i}Xr(t){return tN(this.Vr,t,(t,i)=>t.Re<i)}Zr(t){return tP(this.Vr,t,(t,i)=>t.Re>i)}Gr(t,i,s){let e=null;for(let h=t;h<i;h++){let t=this.Vr[h].Ft[s];Number.isNaN(t)||(null===e?e={Jr:t,Qr:t}:(t<e.Jr&&(e.Jr=t),t>e.Qr&&(e.Qr=t)))}return e}$r(t,i,s){if(this.Ki())return null;let e=null,h=b(this.Lr()),l=b(this.Ks()),n=Math.max(t,h),r=Math.min(i,l),o=30*Math.ceil(n/30),a=Math.max(o,30*Math.floor(r/30));{let t=this.Xr(n),h=this.Zr(Math.min(r,o,i));e=tY(e,this.Gr(t,h,s))}let u=this.Ir.get(s);void 0===u&&(u=new Map,this.Ir.set(s,u));for(let t=Math.max(o+1,n);t<a;t+=30){let i=Math.floor(t/30),h=u.get(i);if(void 0===h){let t=this.Xr(30*i),e=this.Zr((i+1)*30-1);h=this.Gr(t,e,s),u.set(i,h)}e=tY(e,h)}{let t=this.Xr(a),i=this.Zr(r);e=tY(e,this.Gr(t,i,s))}return e}}function tY(t,i){return null===t?i:null===i?t:{Jr:Math.min(t.Jr,i.Jr),Qr:Math.max(t.Qr,i.Qr)}}class tV{constructor(t){this.th=t}nt(t,i,s){this.th.draw(t)}
1ih(t,i,s){this.th.drawBackground?.(t)}}class tF{constructor(t){this.Dn=null,this.sh=t}Tt(){let t=this.sh.renderer();if(null===t)return null;if(this.Dn?.nh===t)return this.Dn.eh;let i=new tV(t);return this.Dn={nh:t,eh:i},i}rh(){return this.sh.zOrder?.()??"normal"}}class tB{constructor(t){this.hh=null,this.ah=t}oh(){return this.ah}Ns(){this.ah.updateAllViews?.()}Ws(){let t=this.ah.paneViews?.()??[];if(this.hh?.nh===t)return this.hh.eh;let i=t.map(t=>new tF(t));return this.hh={nh:t,eh:i},i}jn(t,i){return this.ah.hitTest?.(t,i)??null}}let tW=class extends tB{us(){return[]}};class tL{constructor(t){this.th=t}nt(t,i,s){this.th.draw(t)}ih(t,i,s){this.th.drawBackground?.(t)}}class tO{constructor(t){this.Dn=null,this.sh=t}Tt(){let t=this.sh.renderer();if(null===t)return null;if(this.Dn?.nh===t)return this.Dn.eh;let i=new tL(t);return this.Dn={nh:t,eh:i},i}rh(){return this.sh.zOrder?.()??"normal"}}function tA(t){return{ri:t.text(),Bi:t.coordinate(),Ii:t.fixedCoordinate?.(),R:t.textColor(),Z:t.backColor(),Vt:t.visible?.()??!0,pi:t.tickVisible?.()??!0}}class tD{constructor(t,i){this.Gt=new G,this._h=t,this.uh=i}Tt(){return this.Gt.ht({Qi:this.uh.Qi(),...tA(this._h)}),this.Gt}}class t$ extends H{constructor(t,i){super(),this._h=t,this.Yi=i}qi(t,i,s){let e=tA(this._h);s.Z=e.Z,t.R=e.R;let h=2/12*this.Yi.P();s.Ti=h,s.Ri=h,s.Bi=e.Bi,s.Ii=e.Ii,t.ri=e.ri,t.Vt=e.Vt,t.pi=e.pi}}class tI extends tB{constructor(t,i){super(t),this.dh=null,this.fh=null,this.ph=null,this.mh=null,this.ge=i}cs(){let t=this.ah.timeAxisViews?.()??[];if(this.dh?.nh===t)return this.dh.eh;let i=this.ge.Qt().At(),s=t.map(t=>new tD(t,i));return this.dh={nh:t,eh:s},s}Fs(){let t=this.ah.priceAxisViews?.()??[];if(this.fh?.nh===t)return this.fh.eh;let i=this.ge.Wt(),s=t.map(t=>new t$(t,i));return this.fh={nh:t,eh:s},s}wh(){let t=this.ah.priceAxisPaneViews?.()??[];if(this.ph?.nh===t)return this.ph.eh;let i=t.map(t=>new tO(t));return this.ph={nh:t,eh:i},i}gh(){let t=this.ah.timeAxisPaneViews?.()??[];if(this.mh?.nh===t)return this.mh.eh;let i=t.map(t=>new tO(t));return this.mh={nh:t,eh:i},i}Mh(t,i){return this.ah.autoscaleInfo?.(t,i)??null}}function tQ(t,i,s,e){t.forEach(t=>{i(t).forEach(t=>{t.rh()===s&&e.push(t)})})}function tX(t){return t.Ws()}function tZ(t){return t.wh()}function tJ(t){return t.gh()}let tj=["Area","Line","Baseline"];class tH extends tT{constructor(t,i,s,e,h){super(t),this.Yt=new tz,this.er=new tw(this),this.bh=[],this.xh=new tp(this),this.Sh=null,this.Ch=null,this.yh=null,this.Ph=[],this.ys=s,this.kh=i;let l=new tb(this);this.vs=[l],this.rr=new tc(l,this,t),tj.includes(this.kh)&&(this.Sh=new tv(this)),this.Th(),this.sh=e(this,this.Qt(),h)}m(){null!==this.yh&&clearTimeout(this.yh)}Be(t){return this.ys.priceLineColor||t}Pe(t){let i,s;let e={ke:!0},h=this.Wt();if(this.Qt().At().Ki()||h.Ki()||this.Yt.Ki())return e;let l=this.Qt().At().ye(),n=this.zt();if(null===l||null===n)return e;if(t){let t=this.Yt.Er();if(null===t)return e;i=t,s=t.Re}else{let t=this.Yt.Wr(l.bi(),-1);if(null===t||null===(i=this.Yt.kr(t.Re)))return e;s=t.Re}let r=i.Ft[3],o=this.Rh().Dr(s,{Ft:i}),a=h.Nt(r,n.Ft);return{ke:!1,gt:r,ri:h.Zi(r,n.Ft),Oe:h.Dh(r),Ne:h.Vh(r,n.Ft),R:o.cr,Bi:a,Re:s}}Rh(){return null!==this.Ch||(this.Ch=new tR(this)),this.Ch}N(){return this.ys}hr(t){let i=t.priceScaleId;void 0!==i&&i!==this.ys.priceScaleId&&this.Qt().Ih(this,i),S(this.ys,t),void 0!==t.priceFormat&&(this.Th(),this.Qt().Bh()),this.Qt().Ah(this),this.Qt().Eh(),this.sh.Pt("options")}ht(t,i){this.Yt.ht(t),this.sh.Pt("data"),null!==this.Sh&&(i&&i.zh?this.Sh.be():0===t.length&&this.Sh.Me());let s=this.Qt().Hn(this);this.Qt().Lh(s),this.Qt().Ah(this),this.Qt().Eh(),this.Qt().ar()}Oh(t){let i=new tC(this,t);return this.bh.push(i),this.Qt().Ah(this),i}Nh(t){let i=this.bh.indexOf(t);-1!==i&&this.bh.splice(i,1),this.Qt().Ah(this)}Wh(){return this.bh}Rr(){return this.kh}zt(){let t=this.Fh();return null===t?null:{Ft:t.Ft[3],Hh:t.wt}}Fh(){let t=this.Qt().At().ye();if(null===t)return null;let i=t.Uh();return this.Yt.Wr(i,1)}Xs(){return this.Yt}$h(t){let i=this.Yt.kr(t);return null===i?null:"Bar"===this.kh||"Candlestick"===this.kh||"Custom"===this.kh?{qh:i.Ft[0],Yh:i.Ft[1],jh:i.Ft[2],Kh:i.Ft[3]}:i.Ft[3]}
1Xh(t){let i=[];tQ(this.Ph,tX,"top",i);let s=this.Sh;return null!==s&&s.Vt()&&(null===this.yh&&s.Se()&&(this.yh=setTimeout(()=>{this.yh=null,this.Qt().Zh()},0)),s.xe(),i.unshift(s)),i}Ws(){let t=[];this.Gh()||t.push(this.xh),t.push(this.sh,this.er);let i=this.bh.map(t=>t.lr());return t.push(...i),tQ(this.Ph,tX,"normal",t),t}Jh(){return this.Qh(tX,"bottom")}ta(t){return this.Qh(tZ,t)}ia(t){return this.Qh(tJ,t)}sa(t,i){return this.Ph.map(s=>s.jn(t,i)).filter(t=>null!==t)}us(){return[this.rr,...this.bh.map(t=>t._r())]}Fs(t,i){if(i!==this.es&&!this.Gh())return[];let s=[...this.vs];for(let t of this.bh)s.push(t.ur());return this.Ph.forEach(t=>{s.push(...t.Fs())}),s}cs(){let t=[];return this.Ph.forEach(i=>{t.push(...i.cs())}),t}Mh(t,i){if(void 0!==this.ys.autoscaleInfoProvider){let s=this.ys.autoscaleInfoProvider(()=>{let s=this.na(t,i);return null===s?null:s.Xe()});return tS.Ze(s)}return this.na(t,i)}ea(){return this.ys.priceFormat.minMove}ra(){return this.ha}Ns(){for(let t of(this.sh.Pt(),this.vs))t.Pt();for(let t of this.bh)t.Pt();this.er.Pt(),this.xh.Pt(),this.Sh?.Pt(),this.Ph.forEach(t=>t.Ns())}Wt(){return b(super.Wt())}Et(t){if(!(("Line"===this.kh||"Area"===this.kh||"Baseline"===this.kh)&&this.ys.crosshairMarkerVisible))return null;let i=this.Yt.kr(t);return null===i?null:{gt:i.Ft[3],ft:this.aa(),Ht:this.la(),Ot:this.oa(),Lt:this._a(t)}}Ae(){return this.ys.title}Vt(){return this.ys.visible}ua(t){this.Ph.push(new tI(t,this))}ca(t){this.Ph=this.Ph.filter(i=>i.oh()!==t)}da(){if("Custom"===this.kh)return t=>this.sh.fa(t)}pa(){if("Custom"===this.kh)return t=>this.sh.va(t)}ma(){return this.Yt.qr()}Gh(){return!ts(this.Wt().wa())}na(t,i){if(!_(t)||!_(i)||this.Yt.Ki())return null;let s="Line"===this.kh||"Area"===this.kh||"Baseline"===this.kh||"Histogram"===this.kh?[3]:[2,1],e=this.Yt.Ur(t,i,s),h=null!==e?new tM(e.Jr,e.Qr):null,l=null;if("Histogram"===this.Rr()){let t=this.ys.base,i=new tM(t,t);h=null!==h?h.vn(i):i}return this.Ph.forEach(s=>{let e=s.Mh(t,i);if(e?.priceRange){let t=new tM(e.priceRange.minValue,e.priceRange.maxValue);h=null!==h?h.vn(t):t}e?.margins&&(l=e.margins)}),new tS(h,l)}aa(){switch(this.kh){case"Line":case"Area":case"Baseline":return this.ys.crosshairMarkerRadius}return 0}la(){switch(this.kh){case"Line":case"Area":case"Baseline":{let t=this.ys.crosshairMarkerBorderColor;if(0!==t.length)return t}}return null}oa(){switch(this.kh){case"Line":case"Area":case"Baseline":return this.ys.crosshairMarkerBorderWidth}return 0}_a(t){switch(this.kh){case"Line":case"Area":case"Baseline":{let t=this.ys.crosshairMarkerBackgroundColor;if(0!==t.length)return t}}return this.Rh().Dr(t).cr}Th(){switch(this.ys.priceFormat.type){case"custom":this.ha={format:this.ys.priceFormat.formatter};break;case"volume":this.ha=new tr(this.ys.priceFormat.precision);break;case"percent":this.ha=new tn(this.ys.priceFormat.precision);break;default:{let t=Math.pow(10,this.ys.priceFormat.precision);this.ha=new tl(t,this.ys.priceFormat.minMove*t)}}null!==this.es&&this.es.ga()}Qh(t,i){let s=[];return tQ(this.Ph,t,i,s),s}}let tK=[3],tU=[0,1,2,3];class tG{constructor(t){this.ys=t}Ma(t,i,s){if(0===this.ys.mode)return t;let e=s.ks(),h=e.zt();if(null===h)return t;let l=e.Nt(t,h),n=s.ba().filter(t=>t instanceof tH).reduce((t,e)=>{if(s.Un(e)||!e.Vt())return t;let h=e.Wt(),l=e.Xs();if(h.Ki()||!l.Te(i))return t;let n=l.kr(i);if(null===n)return t;let r=y(e.zt()),o=3===this.ys.mode?tU:tK;return t.concat(o.map(t=>h.Nt(n.Ft[t],r.Ft)))},[]);if(0===n.length)return t;n.sort((t,i)=>Math.abs(t-l)-Math.abs(i-l));let r=n[0];return e.Ts(r,h)}}function tq(t,i,s){return Math.min(Math.max(t,i),s)}function t0(t){let i=Math.ceil(t);return i%2==0?i-1:i}class t1 extends W{constructor(){super(...arguments),this.Yt=null}ht(t){this.Yt=t}et({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:e}){var h;if(null===this.Yt)return;let l=Math.max(1,Math.floor(s));t.lineWidth=l,h=()=>{let h=b(this.Yt);if(h.xa){for(let e of(t.strokeStyle=h.Sa,m(t,h.Ca),t.beginPath(),h.ya)){let h=Math.round(e.Pa*s);t.moveTo(h,-l),t.lineTo(h,i.height+l)}t.stroke()}if(h.ka){for(let s of(t.strokeStyle=h.Ta,m(t,h.Ra),t.beginPath(),h.Da)){let h=Math.round(s.Pa*e);t.moveTo(-l,h),t.lineTo(i.width+l,h)}t.stroke()}}
1,t.save(),t.lineWidth%2&&t.translate(.5,.5),h(),t.restore()}}class t2{constructor(t){this.Gt=new t1,this.St=!0,this.yt=t}Pt(){this.St=!0}Tt(){if(this.St){let t=this.yt.Qt().N().grid,i={ka:t.horzLines.visible,xa:t.vertLines.visible,Ta:t.horzLines.color,Sa:t.vertLines.color,Ra:t.horzLines.style,Ca:t.vertLines.style,Da:this.yt.ks().Va(),ya:(this.yt.Qt().At().Va()||[]).map(t=>({Pa:t.coord}))};this.Gt.ht(i),this.St=!1}return this.Gt}}class t3{constructor(t){this.sh=new t2(t)}lr(){return this.sh}}let t5={Ia:4,Ba:1e-4};function t4(t,i){let s=100*(t-i)/i;return i<0?-s:s}function t6(t,i){let s=100*(t-i)/i+100;return i<0?-s:s}function t9(t,i){let s=Math.abs(t);if(s<1e-15)return 0;let e=Math.log10(s+i.Ba)+i.Ia;return t<0?-e:e}function t7(t,i){let s=Math.abs(t);if(s<1e-15)return 0;let e=Math.pow(10,s-i.Ia)-i.Ba;return t<0?-e:e}function t8(t,i){return null===t?null:new tM(t9(t.$e(),i),t9(t.qe(),i))}function it(t,i){return null===t?null:new tM(t7(t.$e(),i),t7(t.qe(),i))}function ii(t){if(null===t)return t5;let i=Math.abs(t.qe()-t.$e());if(i>=1||i<1e-15)return t5;let s=Math.ceil(Math.abs(Math.log10(i))),e=t5.Ia+s;return{Ia:e,Ba:1/Math.pow(10,e)}}class is{constructor(t,i){if(this.Aa=t,this.Ea=i,function(t){if(t<0)return!1;for(let i=t;i>1;i/=10)if(i%10!=0)return!1;return!0}(this.Aa))this.za=[2,2.5,2];else{this.za=[];for(let t=this.Aa;1!==t;){if(t%2==0)this.za.push(2),t/=2;else{if(t%5!=0)throw Error("unexpected base");this.za.push(2,2.5),t/=5}if(this.za.length>100)throw Error("something wrong with base")}}}La(t,i,s){let e=0===this.Aa?0:1/this.Aa,h=Math.pow(10,Math.max(0,Math.ceil(Math.log10(t-i)))),l=0,n=this.Ea[0];for(;;){let t=e-h<=1e-14&&h>e+1e-14,i=s*n-h<=1e-14,r=1-h<=1e-14;if(!(t&&i&&r))break;h/=n,n=this.Ea[++l%this.Ea.length]}if(h<=e+1e-14&&(h=e),h=Math.max(1,h),this.za.length>0&&1e-14>Math.abs(h-1))for(l=0,n=this.za[0];s*n-h<=1e-14&&h>e+1e-14;)h/=n,n=this.za[++l%this.za.length];return h}}class ie{constructor(t,i,s,e){this.Oa=[],this.Yi=t,this.Aa=i,this.Na=s,this.Wa=e}La(t,i){if(t<i)throw Error("high < low");let s=this.Yi.$t(),e=(t-i)*this.Fa()/s,h=new is(this.Aa,[2,2.5,2]),l=new is(this.Aa,[2,2,2.5]),n=new is(this.Aa,[2.5,2,2]),r=[];return r.push(h.La(t,i,e),l.La(t,i,e),n.La(t,i,e)),function(t){if(t.length<1)throw Error("array is empty");let i=t[0];for(let s=1;s<t.length;++s)t[s]<i&&(i=t[s]);return i}(r)}Ha(){let t=this.Yi,i=t.zt();if(null===i)return void(this.Oa=[]);let s=t.$t(),e=this.Na(s-1,i),h=this.Na(0,i),l=this.Yi.N().entireTextOnly?this.Ua()/2:0,n=s-1-l,r=Math.max(e,h),o=Math.min(e,h);if(r===o)return void(this.Oa=[]);let a=this.La(r,o),u=r%a;u+=u<0?a:0;let c=r>=o?1:-1,d=null,f=0;for(let s=r-u;s>o;s-=a){let e=this.Wa(s,i,!0);null!==d&&Math.abs(e-d)<this.Fa()||e<l||e>n||(f<this.Oa.length?(this.Oa[f].Pa=e,this.Oa[f].$a=t.qa(s)):this.Oa.push({Pa:e,$a:t.qa(s)}),f++,d=e,t.Ya()&&(a=this.La(s*c,o)))}this.Oa.length=f}Va(){return this.Oa}Ua(){return this.Yi.P()}Fa(){return Math.ceil(2.5*this.Ua())}}function ih(t){return t.slice().sort((t,i)=>b(t.hs())-b(i.hs()))}!function(t){t[t.Normal=0]="Normal",t[t.Logarithmic=1]="Logarithmic",t[t.Percentage=2]="Percentage",t[t.IndexedTo100=3]="IndexedTo100"}(r||(r={}));let il=new tn,ir=new tl(100,1);class io{constructor(t,i,s,e,h){this.ja=0,this.Ka=null,this.Ge=null,this.Xa=null,this.Za={Ga:!1,Ja:null},this.Qa=0,this.tl=0,this.il=new M,this.sl=new M,this.nl=[],this.el=null,this.rl=null,this.hl=null,this.al=null,this.ll=null,this.ha=ir,this.ol=ii(null),this._l=t,this.ys=i,this.ul=s,this.cl=e,this.dl=h,this.fl=new ie(this,100,this.pl.bind(this),this.vl.bind(this))}wa(){return this._l}N(){return this.ys}hr(t){if(S(this.ys,t),this.ga(),void 0!==t.mode&&this.ml({ie:t.mode}),void 0!==t.scaleMargins){let i=w(t.scaleMargins.top),s=w(t.scaleMargins.bottom);if(i<0||i>1)throw Error(`Invalid top margin - expect value between 0 and 1, given=${i}`);if(s<0||s>1)throw Error(`Invalid bottom margin - expect value between 0 and 1, given=${s}`);if(i+s>1)throw Error(`Invalid margins - sum of margins must be less than 1, given=${i+s}`);this.wl(),this.hl=null}}gl(){return this.ys.autoScale}Ya(){return 1===this.ys.mode}Le(){return 2===this.ys.mode}Ml(){return 3===this.ys.mode}ie(){return{sn:this.ys.autoScale,bl:this.ys.invertScale,ie:this.ys.mode}}ml(t){let i=this.ie(),s=null;void 0!==t.sn&&(this.ys.autoScale=t.sn),void 0!==t.ie&&(this.ys.mode=t.ie,2!==t.ie&&3!==t.ie||(this.ys.autoScale=!0),this.Za.Ga=!1),1===i.ie&&t.ie!==i.ie&&(function(t,i){if(null===t)return!1;let s=t7(t.$e(),i),e=t7(t.qe(),i);return isFinite(s)&&isFinite(e)}(this.Ge,this.ol)?null!==(s=it(this.Ge,this.ol))&&this.xl(s):this.ys.autoScale=!0),1===t.ie&&t.ie!==i.ie&&null!==(s=t8(this.Ge,this.ol))&&this.xl(s);let e=i.ie!==this.ys.mode;e&&(2===i.ie||this.Le())&&this.ga(),e&&(3===i.ie||this.Ml())&&this.ga(),void 0!==t.bl&&i.bl!==t.bl&&(this.ys.invertScale=t.bl,this.Sl()),this.sl.p(i,this.ie())}Cl(){return this.sl}P(){return this.ul.fontSize}$t(){return this.ja}yl(t){this.ja!==t&&(this.ja=t,this.wl(),this.hl=null)}Pl(){if(this.Ka)return this.Ka;let t=this.$t()-this.kl()-this.Tl();return this.Ka=t,t}Qe(){return this.Rl(),this.Ge}xl(t,i){let s=this.Ge;(i||null===s&&null!==t||null!==s&&!s.He(t))&&(this.hl=null,this.Ge=t)}Ki(){return this.Rl(),0===this.ja||!this.Ge||this.Ge.Ki()}Dl(t){return this.bl()?t:this.$t()-1-t}Nt(t,i){return this.Le()?t=t4(t,i):this.Ml()&&(t=t6(t,i)),this.vl(t,i)}Vl(t,i,s){this.Rl();
1let e=this.Tl(),h=b(this.Qe()),l=h.$e(),n=h.qe(),r=this.Pl()-1,o=this.bl(),a=r/(n-l),u=void 0===s?0:s.from,c=void 0===s?t.length:s.to,d=this.Il();for(let s=u;s<c;s++){let h=t[s],n=h.gt;if(isNaN(n))continue;let r=n;null!==d&&(r=d(h.gt,i));let u=e+a*(r-l),c=o?u:this.ja-1-u;h.ut=c}}Bl(t,i,s){this.Rl();let e=this.Tl(),h=b(this.Qe()),l=h.$e(),n=h.qe(),r=this.Pl()-1,o=this.bl(),a=r/(n-l),u=void 0===s?0:s.from,c=void 0===s?t.length:s.to,d=this.Il();for(let s=u;s<c;s++){let h=t[s],n=h.qh,r=h.Yh,u=h.jh,c=h.Kh;null!==d&&(n=d(h.qh,i),r=d(h.Yh,i),u=d(h.jh,i),c=d(h.Kh,i));let f=e+a*(n-l),p=o?f:this.ja-1-f;h.Al=p,f=e+a*(r-l),p=o?f:this.ja-1-f,h.El=p,f=e+a*(u-l),p=o?f:this.ja-1-f,h.zl=p,f=e+a*(c-l),p=o?f:this.ja-1-f,h.Ll=p}}Ts(t,i){let s=this.pl(t,i);return this.Ol(s,i)}Ol(t,i){var s,e;let h=t;return this.Le()?(s=h,i<0&&(s=-s),h=s/100*i+i):this.Ml()&&(e=h-100,i<0&&(e=-e),h=e/100*i+i),h}ba(){return this.nl}Dt(){return this.rl||(this.rl=ih(this.nl)),this.rl}Nl(t){-1===this.nl.indexOf(t)&&(this.nl.push(t),this.ga(),this.Wl())}Fl(t){let i=this.nl.indexOf(t);if(-1===i)throw Error("source is not attached to scale");this.nl.splice(i,1),0===this.nl.length&&(this.ml({sn:!0}),this.xl(null)),this.ga(),this.Wl()}zt(){let t=null;for(let i of this.nl){let s=i.zt();null!==s&&(null===t||s.Hh<t.Hh)&&(t=s)}return null===t?null:t.Ft}bl(){return this.ys.invertScale}Va(){let t=null===this.zt();if(null!==this.hl&&(t||this.hl.Hl===t))return this.hl.Va;this.fl.Ha();let i=this.fl.Va();return this.hl={Va:i,Hl:t},this.il.p(),i}Ul(){return this.il}$l(t){this.Le()||this.Ml()||null===this.al&&null===this.Xa&&(this.Ki()||(this.al=this.ja-t,this.Xa=b(this.Qe()).Ue()))}ql(t){if(this.Le()||this.Ml()||null===this.al)return;this.ml({sn:!1}),(t=this.ja-t)<0&&(t=0);let i=(this.al+.2*(this.ja-1))/(t+.2*(this.ja-1)),s=b(this.Xa).Ue();i=Math.max(i,.1),s.je(i),this.xl(s)}Yl(){this.Le()||this.Ml()||(this.al=null,this.Xa=null)}jl(t){this.gl()||null===this.ll&&null===this.Xa&&(this.Ki()||(this.ll=t,this.Xa=b(this.Qe()).Ue()))}Kl(t){if(this.gl()||null===this.ll)return;let i=b(this.Qe()).Ye()/(this.Pl()-1),s=t-this.ll;this.bl()&&(s*=-1);let e=s*i,h=b(this.Xa).Ue();h.Ke(e),this.xl(h,!0),this.hl=null}Xl(){this.gl()||null!==this.ll&&(this.ll=null,this.Xa=null)}ra(){return this.ha||this.ga(),this.ha}Zi(t,i){switch(this.ys.mode){case 2:return this.Zl(t4(t,i));case 3:return this.ra().format(t6(t,i));default:return this.nr(t)}}qa(t){switch(this.ys.mode){case 2:return this.Zl(t);case 3:return this.ra().format(t);default:return this.nr(t)}}Dh(t){return this.nr(t,b(this.el).ra())}Vh(t,i){return t=t4(t,i),this.Zl(t,il)}Gl(){return this.nl}Jl(t){this.Za={Ja:t,Ga:!1}}Ns(){this.nl.forEach(t=>t.Ns())}ga(){this.hl=null;let t=1/0;for(let i of(this.el=null,this.nl))i.hs()<t&&(t=i.hs(),this.el=i);let i=100;null!==this.el&&(i=Math.round(1/this.el.ea())),this.ha=ir,this.Le()?(this.ha=il,i=100):this.Ml()?(this.ha=new tl(100,1),i=100):null!==this.el&&(this.ha=this.el.ra()),this.fl=new ie(this,i,this.pl.bind(this),this.vl.bind(this)),this.fl.Ha()}Wl(){this.rl=null}Xi(){return this.dl}kl(){return this.bl()?this.ys.scaleMargins.bottom*this.$t()+this.tl:this.ys.scaleMargins.top*this.$t()+this.Qa}Tl(){return this.bl()?this.ys.scaleMargins.top*this.$t()+this.Qa:this.ys.scaleMargins.bottom*this.$t()+this.tl}Rl(){this.Za.Ga||(this.Za.Ga=!0,this.Ql())}wl(){this.Ka=null}vl(t,i){if(this.Rl(),this.Ki())return 0;t=this.Ya()&&t?t9(t,this.ol):t;let s=b(this.Qe()),e=this.Tl()+(this.Pl()-1)*(t-s.$e())/s.Ye();return this.Dl(e)}pl(t,i){if(this.Rl(),this.Ki())return 0;let s=this.Dl(t),e=b(this.Qe()),h=e.$e()+e.Ye()*((s-this.Tl())/(this.Pl()-1));return this.Ya()?t7(h,this.ol):h}Sl(){this.hl=null,this.fl.Ha()}Ql(){var t,i,s,e,h;let l=this.Za.Ja;if(null===l)return;let n=null,r=this.Gl(),o=0,a=0;for(let t of r){if(!t.Vt())continue;let r=t.zt();if(null===r)continue;let u=t.Mh(l.Uh(),l.bi()),c=u&&u.Qe();if(null!==c){switch(this.ys.mode){case 1:c=t8(c,this.ol);break;case 2:i=c,s=r.Ft,c=new tM(t4(i.$e(),s),t4(i.qe(),s));break;case 3:e=c,h=r.Ft,c=new tM(t6(e.$e(),h),t6(e.qe(),h))}if(n=null===n?c:n.vn(b(c)),null!==u){let t=u.tr();null!==t&&(o=Math.max(o,t.above),a=Math.max(a,t.below))}}}if(o===this.Qa&&a===this.tl||(this.Qa=o,this.tl=a,this.hl=null,this.wl()),null!==n){if(n.$e()===n.qe()){let t=this.el,i=5*(null===t||this.Le()||this.Ml()?1:t.ea());this.Ya()&&(n=it(n,this.ol)),n=new tM(n.$e()-i,n.qe()+i),this.Ya()&&(n=t8(n,this.ol))}if(this.Ya()){let i=it(n,this.ol),s=ii(i);if(t=this.ol,s.Ia!==t.Ia||s.Ba!==t.Ba){let t=null!==this.Xa?it(this.Xa,this.ol):null;this.ol=s,n=t8(i,s),null!==t&&(this.Xa=t8(t,s))}}this.xl(n)}else null===this.Ge&&(this.xl(new tM(-.5,.5)),this.ol=ii(null));this.Za.Ga=!0}Il(){return this.Le()?t4:this.Ml()?t6:this.Ya()?t=>t9(t,this.ol):null}io(t,i,s){return void 0===i?(void 0===s&&(s=this.ra()),s.format(t)):i(t)}nr(t,i){return this.io(t,this.cl.priceFormatter,i)}Zl(t,i){return this.io(t,this.cl.percentageFormatter,i)}}function ia(t){return t instanceof tH}class iu{constructor(t,i){this.nl=[],this.so=new Map,this.ja=0,this.no=0,this.eo=1e3,this.rl=null,this.ro=new M,this.Ph=[],this.uh=t,this.ts=i,this.ho=new t3(this);let s=i.N();this.ao=this.lo("left",s.leftPriceScale),this.oo=this.lo("right",s.rightPriceScale),this.ao.Cl().i(this._o.bind(this,this.ao),this),this.oo.Cl().i(this._o.bind(this,this.oo),this),this.uo(s)}uo(t){if(t.leftPriceScale&&this.ao.hr(t.leftPriceScale),t.rightPriceScale&&this.oo.hr(t.rightPriceScale),t.localization&&(this.ao.ga(),this.oo.ga()),t.overlayPriceScales)for(let i of Array.from(this.so.values())
1){let s=b(i[0].Wt());s.hr(t.overlayPriceScales),t.localization&&s.ga()}}co(t){switch(t){case"left":return this.ao;case"right":return this.oo}return this.so.has(t)?w(this.so.get(t))[0].Wt():null}m(){this.Qt().do().u(this),this.ao.Cl().u(this),this.oo.Cl().u(this),this.nl.forEach(t=>{t.m&&t.m()}),this.Ph=this.Ph.filter(t=>{let i=t.oh();return i.detached&&i.detached(),!1}),this.ro.p()}fo(){return this.eo}po(t){this.eo=t}Qt(){return this.ts}Qi(){return this.no}$t(){return this.ja}vo(t){this.no=t,this.mo()}yl(t){this.ja=t,this.ao.yl(t),this.oo.yl(t),this.nl.forEach(i=>{if(this.Un(i)){let s=i.Wt();null!==s&&s.yl(t)}}),this.mo()}wo(){return this.nl.filter(ia)}ba(){return this.nl}Un(t){let i=t.Wt();return null===i||this.ao!==i&&this.oo!==i}Nl(t,i,s){this.Mo(t,i,s?t.hs():this.nl.length)}Fl(t,i){let s=this.nl.indexOf(t);v(-1!==s,"removeDataSource: invalid data source"),this.nl.splice(s,1),i||this.nl.forEach((t,i)=>t.ls(i));let e=b(t.Wt()).wa();if(this.so.has(e)){let i=w(this.so.get(e)),s=i.indexOf(t);-1!==s&&(i.splice(s,1),0===i.length&&this.so.delete(e))}let h=t.Wt();h&&h.ba().indexOf(t)>=0&&(h.Fl(t),this.bo(h)),this.rl=null}qn(t){return t===this.ao?"left":t===this.oo?"right":"overlay"}xo(){return this.ao}So(){return this.oo}Co(t,i){t.$l(i)}yo(t,i){t.ql(i),this.mo()}Po(t){t.Yl()}ko(t,i){t.jl(i)}To(t,i){t.Kl(i),this.mo()}Ro(t){t.Xl()}mo(){this.nl.forEach(t=>{t.Ns()})}ks(){let t=null;return this.ts.N().rightPriceScale.visible&&0!==this.oo.ba().length?t=this.oo:this.ts.N().leftPriceScale.visible&&0!==this.ao.ba().length?t=this.ao:0!==this.nl.length&&(t=this.nl[0].Wt()),null===t&&(t=this.oo),t}$n(){let t=null;return this.ts.N().rightPriceScale.visible?t=this.oo:this.ts.N().leftPriceScale.visible&&(t=this.ao),t}bo(t){null!==t&&t.gl()&&this.Do(t)}Vo(t){let i=this.uh.ye();t.ml({sn:!0}),null!==i&&t.Jl(i),this.mo()}Io(){this.Do(this.ao),this.Do(this.oo)}Bo(){this.bo(this.ao),this.bo(this.oo),this.nl.forEach(t=>{this.Un(t)&&this.bo(t.Wt())}),this.mo(),this.ts.ar()}Dt(){return null===this.rl&&(this.rl=ih(this.nl)),this.rl}Ao(t,i){i=tq(i,0,this.nl.length-1);let s=this.nl.indexOf(t);for(let e of(v(-1!==s,"setSeriesOrder: invalid data source"),this.nl.splice(s,1),this.nl.splice(i,0,t),this.nl.forEach((t,i)=>t.ls(i)),this.rl=null,[this.ao,this.oo]))e.Wl(),e.ga();this.ts.ar()}It(){return this.Dt().filter(ia)}Eo(){return this.ro}zo(){return this.ho}ua(t){this.Ph.push(new tW(t))}ca(t){this.Ph=this.Ph.filter(i=>i.oh()!==t),t.detached&&t.detached(),this.ts.ar()}Lo(){return this.Ph}sa(t,i){return this.Ph.map(s=>s.jn(t,i)).filter(t=>null!==t)}Do(t){let i=t.Gl();if(i&&i.length>0&&!this.uh.Ki()){let i=this.uh.ye();null!==i&&t.Jl(i)}t.Ns()}Mo(t,i,s){let e=this.co(i);if(null===e&&(e=this.lo(i,this.ts.N().overlayPriceScales)),this.nl.splice(s,0,t),!ts(i)){let s=this.so.get(i)||[];s.push(t),this.so.set(i,s)}t.ls(s),e.Nl(t),t._s(e),this.bo(e),this.rl=null}_o(t,i,s){i.ie!==s.ie&&this.Do(t)}lo(t,i){let s=new io(t,{visible:!0,autoScale:!0,...k(i)},this.ts.N().layout,this.ts.N().localization,this.ts.Xi());return s.yl(this.$t()),s}}function ic(t){return{Oo:t.Oo,No:{Kn:t.Wo.externalId},Fo:t.Wo.cursorStyle}}function id(t,i,s){let e=[t,...t.Dt()],h=function(t,i,s){var e,h;let l,n;for(let r of t)for(let t of r.sa?.(i,s)??[])e=t.zOrder,(h=l?.zOrder)&&("top"!==e||"top"===h)&&("normal"!==e||"bottom"!==h)||(l=t,n=r);return l&&n?{Wo:l,Oo:n}:null}(e,i,s);if("top"===h?.Wo.zOrder)return ic(h);for(let l of e){if(h&&h.Oo===l&&"bottom"!==h.Wo.zOrder&&!h.Wo.isBackground)return ic(h);if(void 0!==l.Ws){let e=function(t,i,s,e){for(let h of t){let t=h.Tt(e);if(null!==t&&t.jn){let e=t.jn(i,s);if(null!==e)return{Ho:h,No:e}}}return null}(l.Ws(t),i,s,t);if(null!==e)return{Oo:l,Ho:e.Ho,No:e.No}}if(h&&h.Oo===l&&"bottom"!==h.Wo.zOrder&&h.Wo.isBackground)return ic(h)}return h?.Wo?ic(h):null}class ip{constructor(t,i,s=50){this.Pn=0,this.kn=1,this.Tn=1,this.Dn=new Map,this.Rn=new Map,this.Uo=t,this.$o=i,this.Vn=s}qo(t){let i=t.time,s=this.$o.cacheKey(i),e=this.Dn.get(s);if(void 0!==e)return e.Yo;if(this.Pn===this.Vn){let t=this.Rn.get(this.Tn);this.Rn.delete(this.Tn),this.Dn.delete(w(t)),this.Tn++,this.Pn--}let h=this.Uo(t);return this.Dn.set(s,{Yo:h,En:this.kn}),this.Rn.set(this.kn,s),this.Pn++,this.kn++,h}}class im{constructor(t,i){v(t<=i,"right should be >= left"),this.jo=t,this.Ko=i}Uh(){return this.jo}bi(){return this.Ko}Xo(){return this.Ko-this.jo+1}Te(t){return this.jo<=t&&t<=this.Ko}He(t){return this.jo===t.Uh()&&this.Ko===t.bi()}}function ig(t,i){return null===t||null===i?t===i:t.He(i)}class iv{constructor(){this.Zo=new Map,this.Dn=null,this.Go=!1}Jo(t){this.Go=t,this.Dn=null}Qo(t,i){this.t_(i),this.Dn=null;for(let s=i;s<t.length;++s){let i=t[s],e=this.Zo.get(i.timeWeight);void 0===e&&(e=[],this.Zo.set(i.timeWeight,e)),e.push({index:s,time:i.time,weight:i.timeWeight,originalTime:i.originalTime})}}i_(t,i,s,e,h){let l=Math.ceil(i/t);return null!==this.Dn&&this.Dn.s_===l&&h===this.Dn.n_&&s===this.Dn.e_||(this.Dn={n_:h,e_:s,Va:this.r_(l,s,e),s_:l}),this.Dn.Va}t_(t){if(0===t)return void this.Zo.clear();let i=[];
1for(let s of(this.Zo.forEach((s,e)=>{t<=s[0].index?i.push(e):s.splice(tN(s,t,i=>i.index<t),1/0)}),i))this.Zo.delete(s)}r_(t,i,s){let e=[],h=t=>!i||s.has(t.index);for(let i of Array.from(this.Zo.keys()).sort((t,i)=>i-t)){if(!this.Zo.get(i))continue;let s=e;e=[];let l=s.length,n=0,r=w(this.Zo.get(i)),o=r.length,a=1/0,u=-1/0;for(let i=0;i<o;i++){let o=r[i],c=o.index;for(;n<l;){let t=s[n],i=t.index;if(!(i<c&&h(t))){a=i;break}n++,e.push(t),u=i,a=1/0}if(a-c>=t&&c-u>=t&&h(o))e.push(o),u=c;else if(this.Go)return s}for(;n<l;n++)h(s[n])&&e.push(s[n])}return e}}class iw{constructor(t){this.h_=t}a_(){return null===this.h_?null:new im(Math.floor(this.h_.Uh()),Math.ceil(this.h_.bi()))}l_(){return this.h_}static o_(){return new iw(null)}}function ib(t,i){return t.weight>i.weight?t:i}class iy{constructor(t,i,s,e){this.no=0,this.__=null,this.u_=[],this.ll=null,this.al=null,this.c_=new iv,this.d_=new Map,this.f_=iw.o_(),this.p_=!0,this.v_=new M,this.m_=new M,this.w_=new M,this.g_=null,this.M_=null,this.b_=new Map,this.x_=-1,this.S_=[],this.ys=i,this.cl=s,this.C_=i.rightOffset,this.y_=i.barSpacing,this.ts=t,this.$o=e,this.P_(),this.c_.Jo(i.uniformDistribution),this.k_()}N(){return this.ys}T_(t){S(this.cl,t),this.R_(),this.P_()}hr(t,i){S(this.ys,t),this.ys.fixLeftEdge&&this.D_(),this.ys.fixRightEdge&&this.V_(),void 0!==t.barSpacing&&this.ts.dn(t.barSpacing),void 0!==t.rightOffset&&this.ts.fn(t.rightOffset),void 0===t.minBarSpacing&&void 0===t.maxBarSpacing||this.ts.dn(t.barSpacing??this.y_),void 0!==t.ignoreWhitespaceIndices&&t.ignoreWhitespaceIndices!==this.ys.ignoreWhitespaceIndices&&this.k_(),this.R_(),this.P_(),this.w_.p()}Rs(t){return this.u_[t]?.time??null}ss(t){return this.u_[t]??null}I_(t,i){if(this.u_.length<1)return null;if(this.$o.key(t)>this.$o.key(this.u_[this.u_.length-1].time))return i?this.u_.length-1:null;let s=tN(this.u_,this.$o.key(t),(t,i)=>this.$o.key(t.time)<i);return this.$o.key(t)<this.$o.key(this.u_[s].time)?i?s:null:s}Ki(){return 0===this.no||0===this.u_.length||null===this.__}B_(){return this.u_.length>0}ye(){return this.A_(),this.f_.a_()}E_(){return this.A_(),this.f_.l_()}z_(){let t=this.ye();if(null===t)return null;let i={from:t.Uh(),to:t.bi()};return this.L_(i)}L_(t){let i=Math.round(t.from),s=Math.round(t.to),e=b(this.O_()),h=b(this.N_());return{from:b(this.ss(Math.max(e,i))),to:b(this.ss(Math.min(h,s)))}}W_(t){return{from:b(this.I_(t.from,!0)),to:b(this.I_(t.to,!0))}}Qi(){return this.no}vo(t){if(!isFinite(t)||t<=0||this.no===t)return;let i=this.E_(),s=this.no;if(this.no=t,this.p_=!0,this.ys.lockVisibleTimeRangeOnResize&&0!==s){let i=this.y_*t/s;this.y_=i}this.ys.fixLeftEdge&&null!==i&&0>=i.Uh()&&(this.C_-=Math.round((s-t)/this.y_)+1,this.p_=!0),this.F_(),this.H_()}qt(t){if(this.Ki()||!_(t))return 0;let i=this.U_()+this.C_-t;return this.no-(i+.5)*this.y_-1}q_(t,i){let s=this.U_(),e=void 0===i?0:i.from,h=void 0===i?t.length:i.to;for(let i=e;i<h;i++){let e=t[i].wt,h=s+this.C_-e,l=this.no-(h+.5)*this.y_-1;t[i]._t=l}}Y_(t,i){let s=Math.ceil(this.j_(t));return i&&this.ys.ignoreWhitespaceIndices&&!this.K_(s)?this.X_(s):s}fn(t){this.p_=!0,this.C_=t,this.H_(),this.ts.Z_(),this.ts.ar()}G_(){return this.y_}dn(t){this.J_(t),this.H_(),this.ts.Z_(),this.ts.ar()}Q_(){return this.C_}Va(){if(this.Ki())return null;if(null!==this.M_)return this.M_;let t=this.y_,i=5*(this.ts.N().layout.fontSize+4)/8*(this.ys.tickMarkMaxCharacterLength||8),s=Math.round(i/t),e=b(this.ye()),h=Math.max(e.Uh(),e.Uh()-s),l=Math.max(e.bi(),e.bi()-s),n=this.c_.i_(t,i,this.ys.ignoreWhitespaceIndices,this.b_,this.x_),r=this.O_()+s,o=this.N_()-s,a=this.tu(),u=this.ys.fixLeftEdge||a,c=this.ys.fixRightEdge||a,d=0;for(let t of n){let s;h<=t.index&&t.index<=l&&(d<this.S_.length?((s=this.S_[d]).coord=this.qt(t.index),s.label=this.iu(t),s.weight=t.weight):(s={needAlignCoordinate:!1,coord:this.qt(t.index),label:this.iu(t),weight:t.weight},this.S_.push(s)),this.y_>i/2&&!a?s.needAlignCoordinate=!1:s.needAlignCoordinate=u&&t.index<=r||c&&t.index>=o,d++)}return this.S_.length=d,this.M_=this.S_,this.S_}su(){this.p_=!0,this.dn(this.ys.barSpacing),this.fn(this.ys.rightOffset)}nu(t){this.p_=!0,this.__=t,this.H_(),this.D_()}eu(t,i){let s=this.j_(t),e=this.G_();this.dn(e+e/10*i),this.ys.rightBarStaysOnScroll||this.fn(this.Q_()+(s-this.j_(t)))}$l(t){this.ll&&this.Xl(),null===this.al&&null===this.g_&&(this.Ki()||(this.al=t,this.ru()))}ql(t){if(null===this.g_)return;let i=tq(this.no-t,0,this.no),s=tq(this.no-b(this.al),0,this.no);0!==i&&0!==s&&this.dn(this.g_.G_*i/s)}Yl(){null!==this.al&&(this.al=null,this.hu())}jl(t){null===this.ll&&null===this.g_&&(this.Ki()||(this.ll=t,this.ru()))}Kl(t){if(null===this.ll)return;let i=(this.ll-t)/this.G_();this.C_=b(this.g_).Q_+i,this.p_=!0,this.H_()}Xl(){null!==this.ll&&(this.ll=null,this.hu())}au(){this.lu(this.ys.rightOffset)}lu(t,i=400){if(!isFinite(t))throw RangeError("offset is required and must be finite number");if(!isFinite(i)||i<=0)throw RangeError("animationDuration (optional) must be finite positive number");let s=this.C_,e=performance.now();this.ts._n({ou:t=>(t-e)/i>=1,_u:h=>{let l=(h-e)/i;return l>=1?t:s+(t-s)*l}})}Pt(t,i){this.p_=!0,this.u_=t,this.c_.Qo(t,i),this.H_()}uu(){return this.v_}cu(){return this.m_}du(){return this.w_}U_(){return this.__||0}fu(t){let i=t.Xo();this.J_(this.no/i),this.C_=t.bi()-this.U_(),this.H_(),this.p_=!0,this.ts.Z_(),this.ts.ar()}pu(){let t=this.O_(),i=this.N_();null!==t&&null!==i&&this.fu(new im(t,i+this.ys.rightOffset))}vu(t){let i=new im(t.from,t.to);this.fu(i)}ns(t){return void 0!==this.cl.timeFormatter?this.cl.timeFormatter(t.originalTime):this.$o.formatHorzItem(t.time)}k_(){if(this.ys.ignoreWhitespaceIndices){for(let t of(this.b_.clear(),this.ts.js()))for(let i of t.ma())this.b_.set(i,!0);this.x_++}}tu(){let t=this.ts.N().handleScroll,i=this.ts.N().handleScale;return!(t.horzTouchDrag||t.mouseWheel||t.pressedMouseMove||t.vertTouchDrag||i.axisDoubleClickReset.time||i.axisPressedMouseMove.time||i.mouseWheel||i.pinch)}O_(){return 0===this.u_.length?null:0}N_(){return 0===this.u_.length?null:this.u_.length-1}mu(t){return(this.no-1-t)/this.y_}j_(t){let i=this.mu(t);return Math.round(1e6*(this.U_()+this.C_-i))/1e6}J_(t){let i=this.y_;this.y_=t,this.F_(),i!==this.y_&&(this.p_=!0,this.wu())}A_(){if(!this.p_)return;if(this.p_=!1,this.Ki())return void this.gu(iw.o_());
1let t=this.U_(),i=this.no/this.y_,s=this.C_+t,e=new im(s-i+1,s);this.gu(new iw(e))}F_(){let t=tq(this.y_,this.Mu(),this.bu());this.y_!==t&&(this.y_=t,this.p_=!0)}bu(){return this.ys.maxBarSpacing>0?this.ys.maxBarSpacing:.5*this.no}Mu(){return this.ys.fixLeftEdge&&this.ys.fixRightEdge&&0!==this.u_.length?this.no/this.u_.length:this.ys.minBarSpacing}H_(){let t=this.xu();null!==t&&this.C_<t&&(this.C_=t,this.p_=!0);let i=this.Su();this.C_>i&&(this.C_=i,this.p_=!0)}xu(){let t=this.O_(),i=this.__;return null===t||null===i?null:t-i-1+(this.ys.fixLeftEdge?this.no/this.y_:Math.min(2,this.u_.length))}Su(){return this.ys.fixRightEdge?0:this.no/this.y_-Math.min(2,this.u_.length)}ru(){this.g_={G_:this.G_(),Q_:this.Q_()}}hu(){this.g_=null}iu(t){let i=this.d_.get(t.weight);return void 0===i&&(i=new ip(t=>this.Cu(t),this.$o),this.d_.set(t.weight,i)),i.qo(t)}Cu(t){return this.$o.formatTickmark(t,this.cl)}gu(t){let i=this.f_;this.f_=t,ig(i.a_(),this.f_.a_())||this.v_.p(),ig(i.l_(),this.f_.l_())||this.m_.p(),this.wu()}wu(){this.M_=null}R_(){this.wu(),this.d_.clear()}P_(){this.$o.updateFormatter(this.cl)}D_(){if(!this.ys.fixLeftEdge)return;let t=this.O_();if(null===t)return;let i=this.ye();if(null===i)return;let s=i.Uh()-t;if(s<0){let t=this.C_-s-1;this.fn(t)}this.F_()}V_(){this.H_(),this.F_()}K_(t){return!this.ys.ignoreWhitespaceIndices||this.b_.get(t)||!1}X_(t){let i=function*(t){let i=Math.round(t),s=i<t,e=1;for(;;)s?(yield i+e,yield i-e):(yield i-e,yield i+e),e++}(t),s=this.N_();for(;s;){let t=i.next().value;if(this.b_.get(t))return t;if(t<0||t>s)break}return t}}!function(t){t[t.OnTouchEnd=0]="OnTouchEnd",t[t.OnNextTap=1]="OnNextTap"}(o||(o={}));class iM{constructor(t,i,s){this.yu=[],this.Pu=[],this.no=0,this.ku=null,this.Tu=new M,this.Ru=new M,this.Du=null,this.Vu=t,this.ys=i,this.$o=s,this.dl=new F(this.ys.layout.colorParsers),this.Iu=new z(this),this.uh=new iy(this,i.timeScale,this.ys.localization,s),this.Ct=new ti(this,i.crosshair),this.Bu=new tG(i.crosshair),this.Au(0),this.yu[0].po(2e3),this.Eu=this.zu(0),this.Lu=this.zu(1)}Bh(){this.Ou(te.gn())}ar(){this.Ou(te.wn())}Zh(){this.Ou(new te(1))}Ah(t){let i=this.Nu(t);this.Ou(i)}Wu(){return this.ku}Fu(t){if(this.ku?.Oo===t?.Oo&&this.ku?.No?.Kn===t?.No?.Kn)return;let i=this.ku;this.ku=t,null!==i&&this.Ah(i.Oo),null!==t&&t.Oo!==i?.Oo&&this.Ah(t.Oo)}N(){return this.ys}hr(t){S(this.ys,t),this.yu.forEach(i=>i.uo(t)),void 0!==t.timeScale&&this.uh.hr(t.timeScale),void 0!==t.localization&&this.uh.T_(t.localization),(t.leftPriceScale||t.rightPriceScale)&&this.Tu.p(),this.Eu=this.zu(0),this.Lu=this.zu(1),this.Bh()}Hu(t,i,s=0){let e=this.yu[s];if(void 0===e)return;if("left"===t)return S(this.ys,{leftPriceScale:i}),e.uo({leftPriceScale:i}),this.Tu.p(),void this.Bh();if("right"===t)return S(this.ys,{rightPriceScale:i}),e.uo({rightPriceScale:i}),this.Tu.p(),void this.Bh();let h=this.Uu(t,s);null!==h&&(h.Wt.hr(i),this.Tu.p())}Uu(t,i){let s=this.yu[i];if(void 0===s)return null;let e=s.co(t);return null!==e?{Us:s,Wt:e}:null}At(){return this.uh}$s(){return this.yu}$u(){return this.Ct}qu(){return this.Ru}Yu(t,i){t.yl(i),this.Z_()}vo(t){this.no=t,this.uh.vo(this.no),this.yu.forEach(i=>i.vo(t)),this.Z_()}ju(t){1!==this.yu.length&&(v(t>=0&&t<this.yu.length,"Invalid pane index"),this.yu.splice(t,1),this.Bh())}Ku(t,i){if(this.yu.length<2)return;v(t>=0&&t<this.yu.length,"Invalid pane index");let s=this.yu[t],e=this.yu.reduce((t,i)=>t+i.fo(),0),h=this.yu.reduce((t,i)=>t+i.$t(),0),l=h-30*(this.yu.length-1);i=Math.min(l,Math.max(30,i));let n=e/h,r=s.$t();s.po(i*n);let o=i-r,a=this.yu.length-1;for(let t of this.yu)if(t!==s){let i=Math.min(l,Math.max(30,t.$t()-o/a));o-=t.$t()-i,a-=1;let s=i*n;t.po(s)}this.Bh()}Xu(t,i){v(t>=0&&t<this.yu.length&&i>=0&&i<this.yu.length,"Invalid pane index");let s=this.yu[t],e=this.yu[i];this.yu[t]=e,this.yu[i]=s,this.Bh()}Co(t,i,s){t.Co(i,s)}yo(t,i,s){t.yo(i,s),this.Eh(),this.Ou(this.Zu(t,2))}Po(t,i){t.Po(i),this.Ou(this.Zu(t,2))}ko(t,i,s){i.gl()||t.ko(i,s)}To(t,i,s){i.gl()||(t.To(i,s),this.Eh(),this.Ou(this.Zu(t,2)))}Ro(t,i){i.gl()||(t.Ro(i),this.Ou(this.Zu(t,2)))}Vo(t,i){t.Vo(i),this.Ou(this.Zu(t,2))}Gu(t){this.uh.$l(t)}Ju(t,i){let s=this.At();if(s.Ki()||0===i)return;let e=s.Qi();t=Math.max(1,Math.min(t,e)),s.eu(t,i),this.Z_()}Qu(t){this.tc(0),this.sc(t),this.nc()}ec(t){this.uh.ql(t),this.Z_()}rc(){this.uh.Yl(),this.ar()}tc(t){this.uh.jl(t)}sc(t){this.uh.Kl(t),this.Z_()}nc(){this.uh.Xl(),this.ar()}js(){return this.Pu}hc(t,i,s,e,h){this.Ct.Vs(t,i);let l=NaN,n=this.uh.Y_(t,!0),r=this.uh.ye();null!==r&&(n=Math.min(Math.max(r.Uh(),n),r.bi()));let o=e.ks(),a=o.zt();if(null!==a&&(l=o.Ts(i,a)),l=this.Bu.Ma(l,n,e),this.Ct.Es(n,l,e),this.Zh(),!h){let h=id(e,t,i);this.Fu(h&&{Oo:h.Oo,No:h.No,Fo:h.Fo||null}),this.Ru.p(this.Ct.Bt(),{x:t,y:i},s)}}
1ac(t,i,s){let e=s.ks(),h=e.zt(),l=e.Nt(t,b(h)),n=this.uh.I_(i,!0),r=this.uh.qt(b(n));this.hc(r,l,null,s,!0)}lc(t){this.$u().Ls(),this.Zh(),t||this.Ru.p(null,null,null)}Eh(){let t=this.Ct.Us();if(null!==t){let i=this.Ct.Bs(),s=this.Ct.As();this.hc(i,s,null,t)}this.Ct.Ns()}oc(t,i,s){let e=this.uh.Rs(0);void 0!==i&&void 0!==s&&this.uh.Pt(i,s);let h=this.uh.Rs(0),l=this.uh.U_(),n=this.uh.ye();if(null!==n&&null!==e&&null!==h){let i=n.Te(l),r=this.$o.key(e)>this.$o.key(h),o=null!==t&&t>l&&!r,a=this.uh.N().allowShiftVisibleRangeOnWhitespaceReplacement,u=i&&(void 0!==s||a)&&this.uh.N().shiftVisibleRangeOnNewBar;if(o&&!u){let i=t-l;this.uh.fn(this.uh.Q_()-i)}}this.uh.nu(t)}Lh(t){null!==t&&t.Bo()}Hn(t){if(t instanceof iu)return t;let i=this.yu.find(i=>i.Dt().includes(t));return void 0===i?null:i}Z_(){this.yu.forEach(t=>t.Bo()),this.Eh()}m(){this.yu.forEach(t=>t.m()),this.yu.length=0,this.ys.localization.priceFormatter=void 0,this.ys.localization.percentageFormatter=void 0,this.ys.localization.timeFormatter=void 0}_c(){return this.Iu}Yn(){return this.Iu.N()}do(){return this.Tu}uc(t,i){let s=this.Au(i);this.cc(t,s),this.Pu.push(t),1===this.Pu.length?this.Bh():this.ar()}dc(t){let i=this.Hn(t),s=this.Pu.indexOf(t);v(-1!==s,"Series not found");let e=b(i);this.Pu.splice(s,1),e.Fl(t),t.m&&t.m(),this.uh.k_(),this.fc(e)}Ih(t,i){let s=b(this.Hn(t));s.Fl(t,!0),s.Nl(t,i,!0)}pu(){let t=te.wn();t.rn(),this.Ou(t)}vc(t){let i=te.wn();i.ln(t),this.Ou(i)}cn(){let t=te.wn();t.cn(),this.Ou(t)}dn(t){let i=te.wn();i.dn(t),this.Ou(i)}fn(t){let i=te.wn();i.fn(t),this.Ou(i)}_n(t){let i=te.wn();i._n(t),this.Ou(i)}hn(){let t=te.wn();t.hn(),this.Ou(t)}mc(){return this.ys.rightPriceScale.visible?"right":"left"}wc(t,i){if(v(i>=0,"Index should be greater or equal to 0"),i===this.gc(t))return;let s=b(this.Hn(t));s.Fl(t);let e=this.Au(i);this.cc(t,e),0===s.ba().length&&this.fc(s)}Mc(){return this.Lu}$(){return this.Eu}Ut(t){let i=this.Lu,s=this.Eu;if(i===s)return i;if(t=Math.max(0,Math.min(100,Math.round(100*t))),null===this.Du||this.Du.mr!==s||this.Du.wr!==i)this.Du={mr:s,wr:i,bc:new Map};else{let i=this.Du.bc.get(t);if(void 0!==i)return i}let e=this.dl.tt(s,i,t/100);return this.Du.bc.set(t,e),e}xc(t){return this.yu.indexOf(t)}Xi(){return this.dl}Au(t){if(v(t>=0,"Index should be greater or equal to 0"),(t=Math.min(this.yu.length,t))<this.yu.length)return this.yu[t];let i=new iu(this.uh,this);this.yu.push(i);let s=te.gn();return s.Qs(t,{tn:0,sn:!0}),this.Ou(s),i}gc(t){return this.yu.findIndex(i=>i.wo().includes(t))}Zu(t,i){let s=new te(i);if(null!==t){let e=this.yu.indexOf(t);s.Qs(e,{tn:i})}return s}Nu(t,i){return void 0===i&&(i=2),this.Zu(this.Hn(t),i)}Ou(t){this.Vu&&this.Vu(t),this.yu.forEach(t=>t.zo().lr().Pt())}cc(t,i){let s=t.N().priceScaleId,e=void 0!==s?s:this.mc();i.Nl(t,e),ts(e)||t.hr(t.N())}zu(t){let i=this.ys.layout;return"gradient"===i.background.type?0===t?i.background.topColor:i.background.bottomColor:i.background.color}fc(t){0===t.ba().length&&this.yu.length>1&&(this.yu.splice(this.xc(t),1),this.Bh())}}function iS(t){return!x(t)&&!C(t)}!function(t){t[t.Disabled=0]="Disabled",t[t.Continuous=1]="Continuous",t[t.OnDataUpdate=2]="OnDataUpdate"}(a||(a={})),function(t){t[t.LastBar=0]="LastBar",t[t.LastVisible=1]="LastVisible"}(u||(u={})),function(t){t.Solid="solid",t.VerticalGradient="gradient"}(c||(c={})),function(t){t[t.Year=0]="Year",t[t.Month=1]="Month",t[t.DayOfMonth=2]="DayOfMonth",t[t.Time=3]="Time",t[t.TimeWithSeconds=4]="TimeWithSeconds"}(d||(d={}));let ix=t=>t.getUTCFullYear();class i_{constructor(t="yyyy-MM-dd",i="default"){this.Sc=t,this.Cc=i}qo(t){var i,s,e;return i=t,s=this.Sc,e=this.Cc,s.replace(/yyyy/g,th(ix(i),4)).replace(/yy/g,th(ix(i)%100,2)).replace(/MMMM/g,new Date(i.getUTCFullYear(),i.getUTCMonth(),1).toLocaleString(e,{month:"long"})).replace(/MMM/g,new Date(i.getUTCFullYear(),i.getUTCMonth(),1).toLocaleString(e,{month:"short"})).replace(/MM/g,th(i.getUTCMonth()+1,2)).replace(/dd/g,th(i.getUTCDate(),2))}}class iC{constructor(t){this.yc=t||"%h:%m:%s"}qo(t){return this.yc.replace("%h",th(t.getUTCHours(),2)).replace("%m",th(t.getUTCMinutes(),2)).replace("%s",th(t.getUTCSeconds(),2))}}let iT={Pc:"yyyy-MM-dd",kc:"%h:%m:%s",Tc:" ",Rc:"default"};class ik{constructor(t={}){let i={...iT,...t};this.Dc=new i_(i.Pc,i.Rc),this.Vc=new iC(i.kc),this.Ic=i.Tc}qo(t){return`${this.Dc.qo(t)}${this.Ic}${this.Vc.qo(t)}`}}function iR(t){return 60*t*6e4}function iE(t){return 60*t*1e3}let iN=[{Bc:1e3,Ac:10},{Bc:iE(1),Ac:20},{Bc:iE(5),Ac:21},{Bc:iE(30),Ac:22},{Bc:iR(1),Ac:30},{Bc:iR(3),Ac:31},{Bc:iR(6),Ac:32},{Bc:iR(12),Ac:33}];function iP(t,i){if(t.getUTCFullYear()!==i.getUTCFullYear())return 70;if(t.getUTCMonth()!==i.getUTCMonth())return 60;if(t.getUTCDate()!==i.getUTCDate())return 50;for(let s=iN.length-1;s>=0;--s)if(Math.floor(i.getTime()/iN[s].Bc)!==Math.floor(t.getTime()/iN[s].Bc))return iN[s].Ac;return 0}function iz(t){let i=t;if(C(t)&&(i=iV(t)),!iS(i))throw Error("time must be of type BusinessDay");return{Ec:Math.round(new Date(Date.UTC(i.year,i.month-1,i.day,0,0,0,0)).getTime()/1e3),zc:i}}function iY(t){if(!x(t))throw Error("time must be of type isUTCTimestamp");return{Ec:t}}function iV(t){let i=new Date(t);if(isNaN(i.getTime()))throw Error(`Invalid date string=${t}, expected format=yyyy-mm-dd`);return{day:i.getUTCDate(),month:i.getUTCMonth()+1,year:i.getUTCFullYear()}}function iF(t){C(t.time)&&(t.time=iV(t.time))}class iB{options(){return this.ys}setOptions(t){this.ys=t,this.updateFormatter(t.localization)}preprocessData(t){Array.isArray(t)?function(t){t.forEach(iF)}(t):iF(t)}createConverterToInternalObj(t){return b(0===t.length?null:iS(t[0].time)||C(t[0].time)?iz:iY)}key(t){return"object"==typeof t&&"Ec"in t?t.Ec:this.key(this.convertHorzItemToInternal(t))}cacheKey(t){return void 0===t.zc?new Date(1e3*t.Ec).getTime():new Date(Date.UTC(t.zc.year,t.zc.month-1,t.zc.day)).getTime()}convertHorzItemToInternal(t){return x(t)?iY(t):iS(t)?iz(t):iz(iV(t))}updateFormatter(t){if(!this.ys)return;let i=t.dateFormat;this.ys.timeScale.timeVisible?this.Lc=new ik({Pc:i,kc:this.ys.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",Tc:"   ",Rc:t.locale}):this.Lc=new i_(i,t.locale)}formatHorzItem(t){return this.Lc.qo(new Date(1e3*t.Ec))}formatTickmark(t,i){let s=function(t,i,s){switch(t){case 0:case 10:return i?s?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return i?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(t.weight,this.ys.timeScale.timeVisible,this.ys.timeScale.secondsVisible),e=this.ys.timeScale;if(void 0!==e.tickMarkFormatter){let h=e.tickMarkFormatter(t.originalTime,s,i.locale);if(null!==h)return h}return function(t,i,s){let e={};switch(i){case 0:e.year="numeric";break;case 1:e.month="short";break;case 2:e.day="numeric";break;case 3:e.hour12=!1,e.hour="2-digit",e.minute="2-digit";break;case 4:e.hour12=!1,e.hour="2-digit",e.minute="2-digit",e.second="2-digit"}let h=new Date(void 0===t.zc?1e3*t.Ec:Date.UTC(t.zc.year,t.zc.month-1,t.zc.day));return new Date(h.getUTCFullYear(),h.getUTCMonth(),h.getUTCDate(),h.getUTCHours(),h.getUTCMinutes(),h.getUTCSeconds(),h.getUTCMilliseconds()).toLocaleStr
1ing(s,e)}(t.time,s,i.locale)}maxTickMarkWeight(t){let i=t.reduce(ib,t[0]).weight;return i>30&&i<50&&(i=30),i}fillWeightsForPoints(t,i){!function(t,i=0){if(0===t.length)return;let s=0===i?null:t[i-1].time.Ec,e=null!==s?new Date(1e3*s):null,h=0;for(let l=i;l<t.length;++l){let i=t[l],n=new Date(1e3*i.time.Ec);null!==e&&(i.timeWeight=iP(n,e)),h+=i.time.Ec-(s||i.time.Ec),s=i.time.Ec,e=n}if(0===i&&t.length>1){let i=Math.ceil(h/(t.length-1)),s=new Date(1e3*(t[0].time.Ec-i));t[0].timeWeight=iP(new Date(1e3*t[0].time.Ec),s)}}(t,i)}static Oc(t){return S({localization:{dateFormat:"dd MMM 'yy"}},t??{})}}let iW="undefined"!=typeof window;function iL(){return!!iW&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function iO(){return!!iW&&/iPhone|iPad|iPod/.test(window.navigator.platform)}class iA{constructor(t,i,s){this.Nc=0,this.Wc=null,this.Fc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.Hc=0,this.Uc=null,this.$c={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY},this.qc=null,this.Yc=!1,this.jc=null,this.Kc=null,this.Xc=!1,this.Zc=!1,this.Gc=!1,this.Jc=null,this.Qc=null,this.td=null,this.sd=null,this.nd=null,this.ed=null,this.rd=null,this.hd=0,this.ad=!1,this.ld=!1,this.od=!1,this._d=0,this.ud=null,this.dd=!iO(),this.fd=t=>{this.pd(t)},this.vd=t=>{if(this.md(t)){let i=this.wd(t);if(++this.Hc,this.Uc&&this.Hc>1){let{gd:s}=this.Md(iI(t),this.$c);s<30&&!this.Gc&&this.bd(i,this.Sd.xd),this.Cd()}}else{let i=this.wd(t);if(++this.Nc,this.Wc&&this.Nc>1){let{gd:s}=this.Md(iI(t),this.Fc);s<5&&!this.Zc&&this.yd(i,this.Sd.Pd),this.kd()}}},this.Td=t,this.Sd=i,this.ys=s,this.Rd()}m(){null!==this.Jc&&(this.Jc(),this.Jc=null),null!==this.Qc&&(this.Qc(),this.Qc=null),null!==this.sd&&(this.sd(),this.sd=null),null!==this.nd&&(this.nd(),this.nd=null),null!==this.ed&&(this.ed(),this.ed=null),null!==this.td&&(this.td(),this.td=null),this.Dd(),this.kd()}Vd(t){this.sd&&this.sd();let i=this.Id.bind(this);if(this.sd=()=>{this.Td.removeEventListener("mousemove",i)},this.Td.addEventListener("mousemove",i),this.md(t))return;let s=this.wd(t);this.yd(s,this.Sd.Bd),this.dd=!0}kd(){null!==this.Wc&&clearTimeout(this.Wc),this.Nc=0,this.Wc=null,this.Fc={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Cd(){null!==this.Uc&&clearTimeout(this.Uc),this.Hc=0,this.Uc=null,this.$c={_t:Number.NEGATIVE_INFINITY,ut:Number.POSITIVE_INFINITY}}Id(t){if(this.od||null!==this.Kc||this.md(t))return;let i=this.wd(t);this.yd(i,this.Sd.Ad),this.dd=!0}Ed(t){let i=iX(t.changedTouches,b(this.ud));if(null===i||(this._d=iQ(t),null!==this.rd)||this.ld)return;this.ad=!0;let{zd:s,Ld:e,gd:h}=this.Md(iI(i),b(this.Kc));if(this.Xc||!(h<5)){if(!this.Xc){let t=.5*s,i=e>=t&&!this.ys.Od(),h=t>e&&!this.ys.Nd();i||h||(this.ld=!0),this.Xc=!0,this.Gc=!0,this.Dd(),this.Cd()}if(!this.ld){let s=this.wd(t,i);this.bd(s,this.Sd.Wd),i$(t)}}}Fd(t){if(0!==t.button)return;let{gd:i}=this.Md(iI(t),b(this.jc));if(i>=5&&(this.Zc=!0,this.kd()),this.Zc){let i=this.wd(t);this.yd(i,this.Sd.Hd)}}Md(t,i){let s=Math.abs(i._t-t._t),e=Math.abs(i.ut-t.ut);return{zd:s,Ld:e,gd:s+e}}Ud(t){let i=iX(t.changedTouches,b(this.ud));if(null===i&&0===t.touches.length&&(i=t.changedTouches[0]),null===i)return;this.ud=null,this._d=iQ(t),this.Dd(),this.Kc=null,this.ed&&(this.ed(),this.ed=null);let s=this.wd(t,i);if(this.bd(s,this.Sd.$d),++this.Hc,this.Uc&&this.Hc>1){let{gd:t}=this.Md(iI(i),this.$c);t<30&&!this.Gc&&this.bd(s,this.Sd.xd),this.Cd()}else this.Gc||(this.bd(s,this.Sd.qd),this.Sd.qd&&i$(t));0===this.Hc&&i$(t),0===t.touches.length&&this.Yc&&(this.Yc=!1,i$(t))}pd(t){if(0!==t.button)return;let i=this.wd(t);if(this.jc=null,this.od=!1,this.nd&&(this.nd(),this.nd=null),iL()&&this.Td.ownerDocument.documentElement.removeEventListener("mouseleave",this.fd),!this.md(t)){if(this.yd(i,this.Sd.Yd),++this.Nc,this.Wc&&this.Nc>1){let{gd:s}=this.Md(iI(t),this.Fc);s<5&&!this.Zc&&this.yd(i,this.Sd.Pd),this.kd()}else this.Zc||this.yd(i,this.Sd.jd)}}Dd(){null!==this.qc&&(clearTimeout(this.qc),this.qc=null)}Kd(t){if(null!==this.ud)return;let i=t.changedTouches[0];this.ud=i.identifier,this._d=iQ(t);let s=this.Td.ownerDocument.documentElement;this.Gc=!1,this.Xc=!1,this.ld=!1,this.Kc=iI(i),this.ed&&(this.ed(),this.ed=null);{let i=this.Ed.bind(this),e=this.Ud.bind(this);this.ed=()=>{s.removeEventListener("touchmove",i),s.removeEventListener("touchend",e)},s.addEventListener("touchmove",i,{passive:!1}),s.addEventListener("touchend",e,{passive:!1}),this.Dd(),this.qc=setTimeout(this.Xd.bind(this,t),240)}let e=this.wd(t,i);this.bd(e,this.Sd.Zd),this.Uc||(this.Hc=0,this.Uc=setTimeout(this.Cd.bind(this),500),this.$c=iI(i))}Gd(t){if(0!==t.button)return;let i=this.Td.ownerDocument.documentElement;iL()&&i.addEventListener("mouseleave",this.fd),this.Zc=!1,this.jc=iI(t),this.nd&&(this.nd(),this.nd=null);{let t=this.Fd.bind(this),s=this.pd.bind(this);this.nd=()=>{i.removeEventListener("mousemove",t),i.removeEventListener("mouseup",s)},i.addEventListener("mousemove",t),i.addEventListener("mouseup",s)}if(this.od=!0,this.md(t))return;let s=this.wd(t);this.yd(s,this.Sd.Jd),this.Wc||(this.Nc=0,this.Wc=setTimeout(this.kd.bind(this),500),this.Fc=iI(t))}Rd(){var t;this.Td.addEventListener("mouseenter",this.Vd.bind(this)),this.Td.addEventListener("touchcancel",this.Dd.bind(this));{let t=this.Td.ownerDocument,i=t=>{this.Sd.Qd&&(t.composed&&this.Td.contains(t.composedPath()[0])||t.target&&this.Td.contains(t.target)||this.Sd.Qd())};this.Qc=()=>{t.removeEventListener("touchstart",i)},this.Jc=()=>{t.removeEventListener("mousedown",i)},t.addEventListener("mousedown",i),t.addEventListener("touchstart",i,{passive:!0})}iO()&&(this.td=()=>{this.Td.removeEventListener("dblclick",this.vd)},this.Td.addEventListener("dblclick",this.vd)),this.Td.addEventListener("mouseleave",this.tf.bind(this)),this.Td.addEventListener("touchstart",this.Kd.bind(this),{passive:!0}),t=this.Td,iW&&void 0!==window.chrome&&t.addEventListener("mousedown",t=>{if(1===t.button)return t.preventDefault(),!1}),this.Td.addEventListener("mousedown",this.Gd.bind(this)),this.if(),this.Td.addEventListener("touchmove",()=>{},{passive:!1})}if(){void 0===this.Sd.sf&&void 0===this.Sd.nf&&void 0===this.Sd.ef||(this.Td.addEventListener("touchstart",t=>this.rf(t.touches),{passive:!0}),this.Td.addEventListener("touchmove",t=>{if(2===t.touches.length&&null!==this.rd&&void 0!==this.Sd.nf){let i=iD(t.touches[0],t.touches[1])/this.hd;this.Sd.nf(this.rd,i),i$(t)}},{passive:!1}),this.Td.addEventListener("touchend",t=>{this.rf(t.touches)}))}rf(t){1===t.length&&(this.ad=!1),2!==t.length||this.ad||this.Yc?this.hf():this.af(t)}
1af(t){let i=this.Td.getBoundingClientRect()||{left:0,top:0};this.rd={_t:(t[0].clientX-i.left+(t[1].clientX-i.left))/2,ut:(t[0].clientY-i.top+(t[1].clientY-i.top))/2},this.hd=iD(t[0],t[1]),void 0!==this.Sd.sf&&this.Sd.sf(),this.Dd()}hf(){null!==this.rd&&(this.rd=null,void 0!==this.Sd.ef&&this.Sd.ef())}tf(t){if(this.sd&&this.sd(),this.md(t)||!this.dd)return;let i=this.wd(t);this.yd(i,this.Sd.lf),this.dd=!iO()}Xd(t){let i=iX(t.touches,b(this.ud));if(null===i)return;let s=this.wd(t,i);this.bd(s,this.Sd._f),this.Gc=!0,this.Yc=!0}md(t){return t.sourceCapabilities&&void 0!==t.sourceCapabilities.firesTouchEvents?t.sourceCapabilities.firesTouchEvents:iQ(t)<this._d+500}bd(t,i){i&&i.call(this.Sd,t)}yd(t,i){i&&i.call(this.Sd,t)}wd(t,i){let s=i||t,e=this.Td.getBoundingClientRect()||{left:0,top:0};return{clientX:s.clientX,clientY:s.clientY,pageX:s.pageX,pageY:s.pageY,screenX:s.screenX,screenY:s.screenY,localX:s.clientX-e.left,localY:s.clientY-e.top,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey,uf:!t.type.startsWith("mouse")&&"contextmenu"!==t.type&&"click"!==t.type,cf:t.type,df:s.target,Ho:t.view,ff:()=>{"touchstart"!==t.type&&i$(t)}}}}function iD(t,i){let s=t.clientX-i.clientX,e=t.clientY-i.clientY;return Math.sqrt(s*s+e*e)}function i$(t){t.cancelable&&t.preventDefault()}function iI(t){return{_t:t.pageX,ut:t.pageY}}function iQ(t){return t.timeStamp||performance.now()}function iX(t,i){for(let s=0;s<t.length;++s)if(t[s].identifier===i)return t[s];return null}class iZ{constructor(t,i,s){this.pf=null,this.vf=null,this.mf=!0,this.wf=null,this.gf=t,this.Mf=t.bf()[i],this.xf=t.bf()[s],this.Sf=document.createElement("tr"),this.Sf.style.height="1px",this.Cf=document.createElement("td"),this.Cf.style.position="relative",this.Cf.style.padding="0",this.Cf.style.margin="0",this.Cf.setAttribute("colspan","3"),this.yf(),this.Sf.appendChild(this.Cf),this.mf=this.gf.N().layout.panes.enableResize,this.mf?this.Pf():(this.pf=null,this.vf=null)}m(){null!==this.vf&&this.vf.m()}kf(){return this.Sf}Tf(){return(0,f.Ej)({width:this.Mf.Tf().width,height:1})}Rf(){return(0,f.Ej)({width:this.Mf.Rf().width,height:1*window.devicePixelRatio})}Df(t,i,s){let e=this.Rf();t.fillStyle=this.gf.N().layout.panes.separatorColor,t.fillRect(i,s,e.width,e.height)}Pt(){this.yf(),this.gf.N().layout.panes.enableResize!==this.mf&&(this.mf=this.gf.N().layout.panes.enableResize,this.mf?this.Pf():(null!==this.pf&&(this.Cf.removeChild(this.pf.Vf),this.Cf.removeChild(this.pf.If),this.pf=null),null!==this.vf&&(this.vf.m(),this.vf=null)))}Pf(){let t=document.createElement("div"),i=t.style;i.position="fixed",i.display="none",i.zIndex="49",i.top="0",i.left="0",i.width="100%",i.height="100%",i.cursor="row-resize",this.Cf.appendChild(t);let s=document.createElement("div"),e=s.style;e.position="absolute",e.zIndex="50",e.top="-4px",e.height="9px",e.width="100%",e.backgroundColor="",e.cursor="row-resize",this.Cf.appendChild(s);let h={Bd:this.Bf.bind(this),lf:this.Af.bind(this),Jd:this.Ef.bind(this),Zd:this.Ef.bind(this),Hd:this.zf.bind(this),Wd:this.zf.bind(this),Yd:this.Lf.bind(this),$d:this.Lf.bind(this)};this.vf=new iA(s,h,{Od:()=>!1,Nd:()=>!0}),this.pf={If:s,Vf:t}}yf(){this.Cf.style.background=this.gf.N().layout.panes.separatorColor}Bf(t){null!==this.pf&&(this.pf.If.style.backgroundColor=this.gf.N().layout.panes.separatorHoverColor)}Af(t){null!==this.pf&&null===this.wf&&(this.pf.If.style.backgroundColor="")}Ef(t){if(null===this.pf)return;let i=this.Mf.Of().fo()+this.xf.Of().fo(),s=i/(this.Mf.Tf().height+this.xf.Tf().height),e=30*s;i<=2*e||(this.wf={Nf:t.pageY,Wf:this.Mf.Of().fo(),Ff:i-e,Hf:i,Uf:s,$f:e},this.pf.Vf.style.display="block")}zf(t){let i=this.wf;if(null===i)return;let s=(t.pageY-i.Nf)*i.Uf,e=tq(i.Wf+s,i.$f,i.Ff);this.Mf.Of().po(e),this.xf.Of().po(i.Hf-e),this.gf.Qt().Bh()}Lf(t){null!==this.wf&&null!==this.pf&&(this.wf=null,this.pf.Vf.style.display="none")}}function iJ(t,i,s){let e=(t.qf-i.qf)/(t.wt-i.wt);return Math.sign(e)*Math.min(Math.abs(e),s)}class ij{constructor(t,i,s,e){this.Yf=null,this.jf=null,this.Kf=null,this.Xf=null,this.Zf=null,this.Gf=0,this.Jf=0,this.Qf=t,this.tp=i,this.ip=s,this.Mn=e}sp(t,i){if(null!==this.Yf){if(this.Yf.wt===i)return void(this.Yf.qf=t);if(Math.abs(this.Yf.qf-t)<this.Mn)return}this.Xf=this.Kf,this.Kf=this.jf,this.jf=this.Yf,this.Yf={wt:i,qf:t}}le(t,i){var s,e,h,l,n,r;if(null===this.Yf||null===this.jf||i-this.Yf.wt>50)return;let o=0,a=iJ(this.Yf,this.jf,this.tp),u=(s=this.Yf,e=this.jf,s.qf-e.qf),c=[a],d=[u];if(o+=u,null!==this.Kf){let t=iJ(this.jf,this.Kf,this.tp);if(Math.sign(t)===Math.sign(a)){let i=(h=this.jf,l=this.Kf,h.qf-l.qf);if(c.push(t),d.push(i),o+=i,null!==this.Xf){let t=iJ(this.Kf,this.Xf,this.tp);if(Math.sign(t)===Math.sign(a)){let i=(n=this.Kf,r=this.Xf,n.qf-r.qf);c.push(t),d.push(i),o+=i}}}}let f=0;for(let t=0;t<c.length;++t)f+=d[t]/o*c[t];Math.abs(f)<this.Qf||(this.Zf={qf:t,wt:i},this.Jf=f,this.Gf=function(t,i){let s=Math.log(i);return Math.log(-(1*s/t))/s}(Math.abs(f),this.ip))}_u(t){let i=b(this.Zf),s=t-i.wt;return i.qf+this.Jf*(Math.pow(this.ip,s)-1)/Math.log(this.ip)}ou(t){return null===this.Zf||this.np(t)===this.Gf}np(t){return Math.min(t-b(this.Zf).wt,this.Gf)}}class iH{constructor(t,i){this.ep=void 0,this.rp=void 0,this.hp=void 0,this.ps=!1,this.ap=t,this.lp=i,this.op()}Pt(){this.op()}_p(){this.ep&&this.ap.removeChild(this.ep),this.rp&&this.ap.removeChild(this.rp),this.ep=void 0,this.rp=void 0}up(){return this.ps!==this.cp()||this.hp!==this.dp()}dp(){return this.lp.Qt().Xi().J(this.lp.N().layout.textColor)>160?"dark":"light"}cp(){return this.lp.N().layout.attributionLogo}fp(){let t=new URL(location.href);return t.hostname?"&utm_source="+t.hostname+t.pathname:""}op(){this.up()&&(this._p(),this.ps=this.cp(),this.ps&&(this.hp=this.dp(),this.rp=document.createElement("style"),this.rp.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;
1left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.ep=document.createElement("a"),this.ep.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.fp()}`,this.ep.title="Charting by TradingView",this.ep.id="tv-attr-logo",this.ep.target="_blank",this.ep.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.ep.toggleAttribute("data-dark","dark"===this.hp),this.ap.appendChild(this.rp),this.ap.appendChild(this.ep)))}}function iK(t,i){let s=b(t.ownerDocument).createElement("canvas");t.appendChild(s);let e=(0,f.Dv)(s,{type:"device-pixel-content-box",options:{allowResizeObserver:!0},transform:(t,i)=>({width:Math.max(t.width,i.width),height:Math.max(t.height,i.height)})});return e.resizeCanvasElement(i),e}function iU(t){t.width=1,t.height=1,t.getContext("2d")?.clearRect(0,0,1,1)}function iG(t,i,s,e){t.ih&&t.ih(i,s,e)}function iq(t,i,s,e){t.nt(i,s,e)}function i0(t,i,s,e){for(let h of t(s,e)){let t=h.Tt(e);null!==t&&i(t)}}function i1(t,i){return s=>void 0!==s.Wt?(s.Wt()?.wa()??"")!==i?[]:s.ta?.(t)??[]:[]}function i2(t,i,s,e){if(!t.length)return;let h=0,l=t[0].$t(e,!0),n=1===i?s/2-(t[0].Wi()-l/2):t[0].Wi()-l/2-s/2;n=Math.max(0,n);for(let l=1;l<t.length;l++){let r=t[l],o=t[l-1],a=o.$t(e,!1),u=r.Wi(),c=o.Wi();if(1===i?u>c-a:u<c+a){let e=c-a*i;r.Fi(e);let l=e-i*a/2;if((1===i?l<0:l>s)&&n>0){let e=Math.min(1===i?-1-l:l-s,n);for(let s=h;s<t.length;s++)t[s].Fi(t[s].Wi()+i*e);n-=e}}else h=l,n=1===i?c-a-u:u-(c+a)}}class i3{constructor(t,i,s,e){this.Yi=null,this.pp=null,this.vp=!1,this.mp=new ta(200),this.wp=null,this.gp=0,this.Mp=!1,this.bp=()=>{this.Mp||this.yt.xp().Qt().ar()},this.Sp=()=>{this.Mp||this.yt.xp().Qt().ar()},this.yt=t,this.ys=i,this.ul=i.layout,this.Iu=s,this.Cp="left"===e,this.yp=i1("normal",e),this.Pp=i1("top",e),this.kp=i1("bottom",e),this.Cf=document.createElement("div"),this.Cf.style.height="100%",this.Cf.style.overflow="hidden",this.Cf.style.width="25px",this.Cf.style.left="0",this.Cf.style.position="relative",this.Tp=iK(this.Cf,(0,f.Ej)({width:16,height:16})),this.Tp.subscribeSuggestedBitmapSizeChanged(this.bp);let h=this.Tp.canvasElement;h.style.position="absolute",h.style.zIndex="1",h.style.left="0",h.style.top="0",this.Rp=iK(this.Cf,(0,f.Ej)({width:16,height:16})),this.Rp.subscribeSuggestedBitmapSizeChanged(this.Sp);let l=this.Rp.canvasElement;l.style.position="absolute",l.style.zIndex="2",l.style.left="0",l.style.top="0";let n={Jd:this.Ef.bind(this),Zd:this.Ef.bind(this),Hd:this.zf.bind(this),Wd:this.zf.bind(this),Qd:this.Dp.bind(this),Yd:this.Lf.bind(this),$d:this.Lf.bind(this),Pd:this.Vp.bind(this),xd:this.Vp.bind(this),Bd:this.Ip.bind(this),lf:this.Af.bind(this)};this.vf=new iA(this.Rp.canvasElement,n,{Od:()=>!this.ys.handleScroll.vertTouchDrag,Nd:()=>!0})}m(){this.vf.m(),this.Rp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),iU(this.Rp.canvasElement),this.Rp.dispose(),this.Tp.unsubscribeSuggestedBitmapSizeChanged(this.bp),iU(this.Tp.canvasElement),this.Tp.dispose(),null!==this.Yi&&this.Yi.Ul().u(this),this.Yi=null}kf(){return this.Cf}P(){return this.ul.fontSize}Bp(){let t=this.Iu.N();return this.wp!==t.k&&(this.mp.In(),this.wp=t.k),t}Ap(){var t,i;if(null===this.Yi)return 0;let s=0,e=this.Bp(),h=b(this.Tp.canvasElement.getContext("2d",{colorSpace:this.yt.xp().N().layout.colorSpace}));h.save();let l=this.Yi.Va();h.font=this.Ep(),l.length>0&&(s=Math.max(this.mp.Vi(h,l[0].$a),this.mp.Vi(h,l[l.length-1].$a)));let n=this.zp();for(let t=n.length;t--;){let i=this.mp.Vi(h,n[t].ri());i>s&&(s=i)}let r=this.Yi.zt();if(null!==r&&null!==this.pp&&2!==(t=this.ys.crosshair).mode&&t.horzLine.visible&&t.horzLine.labelVisible){let t=this.Yi.Ts(1,r),i=this.Yi.Ts(this.pp.height-2,r);s=Math.max(s,this.mp.Vi(h,this.Yi.Zi(Math.floor(Math.min(t,i))+.11111111111111,r)),this.mp.Vi(h,this.Yi.Zi(Math.ceil(Math.max(t,i))-.11111111111111,r)))}
1h.restore();let o=s||34;return(i=Math.ceil(e.S+e.C+e.I+e.B+5+o))+i%2}Lp(t){null!==this.pp&&(0,f.zE)(this.pp,t)||(this.pp=t,this.Mp=!0,this.Tp.resizeCanvasElement(t),this.Rp.resizeCanvasElement(t),this.Mp=!1,this.Cf.style.width=`${t.width}px`,this.Cf.style.height=`${t.height}px`)}Op(){return b(this.pp).width}_s(t){this.Yi!==t&&(null!==this.Yi&&this.Yi.Ul().u(this),this.Yi=t,t.Ul().i(this.il.bind(this),this))}Wt(){return this.Yi}In(){let t=this.yt.Of();this.yt.xp().Qt().Vo(t,b(this.Wt()))}Np(t){if(null===this.pp)return;let i={colorSpace:this.yt.xp().N().layout.colorSpace};if(1!==t){this.Wp(),this.Tp.applySuggestedBitmapSize();let t=(0,f.vb)(this.Tp,i);null!==t&&(t.useBitmapCoordinateSpace(t=>{this.Fp(t),this.Hp(t)}),this.yt.Up(t,this.kp),this.$p(t),this.yt.Up(t,this.yp),this.qp(t))}this.Rp.applySuggestedBitmapSize();let s=(0,f.vb)(this.Rp,i);null!==s&&(s.useBitmapCoordinateSpace(({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)}),this.Yp(s),this.yt.Up(s,this.Pp))}Rf(){return this.Tp.bitmapSize}Df(t,i,s){let e=this.Rf();e.width>0&&e.height>0&&t.drawImage(this.Tp.canvasElement,i,s)}Pt(){this.Yi?.Va()}Ef(t){if(null===this.Yi||this.Yi.Ki()||!this.ys.handleScale.axisPressedMouseMove.price)return;let i=this.yt.xp().Qt(),s=this.yt.Of();this.vp=!0,i.Co(s,this.Yi,t.localY)}zf(t){if(null===this.Yi||!this.ys.handleScale.axisPressedMouseMove.price)return;let i=this.yt.xp().Qt(),s=this.yt.Of(),e=this.Yi;i.yo(s,e,t.localY)}Dp(){if(null===this.Yi||!this.ys.handleScale.axisPressedMouseMove.price)return;let t=this.yt.xp().Qt(),i=this.yt.Of(),s=this.Yi;this.vp&&(this.vp=!1,t.Po(i,s))}Lf(t){if(null===this.Yi||!this.ys.handleScale.axisPressedMouseMove.price)return;let i=this.yt.xp().Qt(),s=this.yt.Of();this.vp=!1,i.Po(s,this.Yi)}Vp(t){this.ys.handleScale.axisDoubleClickReset.price&&this.In()}Ip(t){null!==this.Yi&&(!this.yt.xp().Qt().N().handleScale.axisPressedMouseMove.price||this.Yi.Le()||this.Yi.Ml()||this.jp(1))}Af(t){this.jp(0)}zp(){let t=[],i=null===this.Yi?void 0:this.Yi;return(s=>{for(let e=0;e<s.length;++e){let h=s[e].Fs(this.yt.Of(),i);for(let i=0;i<h.length;i++)t.push(h[i])}})(this.yt.Of().Dt()),t}Fp({context:t,bitmapSize:i}){let{width:s,height:e}=i,h=this.yt.Of().Qt(),l=h.$(),n=h.Mc();l===n?Q(t,0,0,s,e,l):J(t,0,0,s,e,l,n)}Hp({context:t,bitmapSize:i,horizontalPixelRatio:s}){let e;if(null===this.pp||null===this.Yi||!this.Yi.N().borderVisible)return;t.fillStyle=this.Yi.N().borderColor;let h=Math.max(1,Math.floor(this.Bp().S*s));e=this.Cp?i.width-h:0,t.fillRect(e,0,h,i.height)}$p(t){if(null===this.pp||null===this.Yi)return;let i=this.Yi.Va(),s=this.Yi.N(),e=this.Bp(),h=this.Cp?this.pp.width-e.C:0;s.borderVisible&&s.ticksVisible&&t.useBitmapCoordinateSpace(({context:t,horizontalPixelRatio:l,verticalPixelRatio:n})=>{t.fillStyle=s.borderColor;let r=Math.max(1,Math.floor(n)),o=Math.floor(.5*n),a=Math.round(e.C*l);for(let s of(t.beginPath(),i))t.rect(Math.floor(h*l),Math.round(s.Pa*n)-o,a,r);t.fill()}),t.useMediaCoordinateSpace(({context:t})=>{t.font=this.Ep(),t.fillStyle=s.textColor??this.ul.textColor,t.textAlign=this.Cp?"right":"left",t.textBaseline="middle";let l=this.Cp?Math.round(h-e.I):Math.round(h+e.C+e.I),n=i.map(i=>this.mp.Di(t,i.$a));for(let s=i.length;s--;){let e=i[s];t.fillText(e.$a,l,e.Pa+n[s])}})}Wp(){if(null===this.pp||null===this.Yi)return;let t=this.pp.height/2,i=[],s=this.Yi.Dt().slice(),e=this.yt.Of(),h=this.Bp();this.Yi===e.$n()&&this.yt.Of().Dt().forEach(t=>{e.Un(t)&&s.push(t)});let l=this.Yi.ba()[0],n=this.Yi;s.forEach(s=>{let h=s.Fs(e,n);h.forEach(t=>{t.Fi(null),t.Hi()&&i.push(t)}),l===s&&h.length>0&&(t=h[0].Bi())}
1),i.forEach(t=>t.Fi(t.Bi())),this.Yi.N().alignLabels&&this.Kp(i,h,t)}Kp(t,i,s){if(null===this.pp)return;let e=t.filter(t=>t.Bi()<=s),h=t.filter(t=>t.Bi()>s);for(let s of(e.sort((t,i)=>i.Bi()-t.Bi()),e.length&&h.length&&h.push(e[0]),h.sort((t,i)=>t.Bi()-i.Bi()),t)){let t=Math.floor(s.$t(i)/2),e=s.Bi();e>-t&&e<t&&s.Fi(t),e>this.pp.height-t&&e<this.pp.height+t&&s.Fi(this.pp.height-t)}i2(e,1,this.pp.height,i),i2(h,-1,this.pp.height,i)}qp(t){if(null===this.pp)return;let i=this.zp(),s=this.Bp(),e=this.Cp?"right":"left";i.forEach(i=>{i.Ui()&&i.Tt(b(this.Yi)).nt(t,s,this.mp,e)})}Yp(t){if(null===this.pp||null===this.Yi)return;let i=this.yt.xp().Qt(),s=[],e=this.yt.Of(),h=i.$u().Fs(e,this.Yi);h.length&&s.push(h);let l=this.Bp(),n=this.Cp?"right":"left";s.forEach(i=>{i.forEach(i=>{i.Tt(b(this.Yi)).nt(t,l,this.mp,n)})})}jp(t){this.Cf.style.cursor=1===t?"ns-resize":"default"}il(){let t=this.Ap();this.gp<t&&this.yt.xp().Qt().Bh(),this.gp=t}Ep(){return P(this.ul.fontSize,this.ul.fontFamily)}}function i5(t,i){return t.Jh?.(i)??[]}function i4(t,i){return t.Ws?.(i)??[]}function i6(t,i){return t.us?.(i)??[]}
1function i9(t,i){return t.Xh?.(i)??[]}class i7{constructor(t,i){this.pp=(0,f.Ej)({width:0,height:0}),this.Xp=null,this.Zp=null,this.Gp=null,this.Jp=null,this.Qp=!1,this.tv=new M,this.iv=new M,this.sv=0,this.nv=!1,this.ev=null,this.rv=!1,this.hv=null,this.av=null,this.Mp=!1,this.bp=()=>{this.Mp||null===this.lv||this.ts().ar()},this.Sp=()=>{this.Mp||null===this.lv||this.ts().ar()},this.lp=t,this.lv=i,this.lv.Eo().i(this.ov.bind(this),this,!0),this._v=document.createElement("td"),this._v.style.padding="0",this._v.style.position="relative";let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",s.style.overflow="hidden",this.uv=document.createElement("td"),this.uv.style.padding="0",this.cv=document.createElement("td"),this.cv.style.padding="0",this._v.appendChild(s),this.Tp=iK(s,(0,f.Ej)({width:16,height:16})),this.Tp.subscribeSuggestedBitmapSizeChanged(this.bp);let e=this.Tp.canvasElement;e.style.position="absolute",e.style.zIndex="1",e.style.left="0",e.style.top="0",this.Rp=iK(s,(0,f.Ej)({width:16,height:16})),this.Rp.subscribeSuggestedBitmapSizeChanged(this.Sp);let h=this.Rp.canvasElement;h.style.position="absolute",h.style.zIndex="2",h.style.left="0",h.style.top="0",this.Sf=document.createElement("tr"),this.Sf.appendChild(this.uv),this.Sf.appendChild(this._v),this.Sf.appendChild(this.cv),this.dv(),this.vf=new iA(this.Rp.canvasElement,this,{Od:()=>null===this.ev&&!this.lp.N().handleScroll.vertTouchDrag,Nd:()=>null===this.ev&&!this.lp.N().handleScroll.horzTouchDrag})}m(){null!==this.Xp&&this.Xp.m(),null!==this.Zp&&this.Zp.m(),this.Gp=null,this.Rp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),iU(this.Rp.canvasElement),this.Rp.dispose(),this.Tp.unsubscribeSuggestedBitmapSizeChanged(this.bp),iU(this.Tp.canvasElement),this.Tp.dispose(),null!==this.lv&&(this.lv.Eo().u(this),this.lv.m()),this.vf.m()}Of(){return b(this.lv)}fv(t){null!==this.lv&&this.lv.Eo().u(this),this.lv=t,null!==this.lv&&this.lv.Eo().i(i7.prototype.ov.bind(this),this,!0),this.dv(),this.lp.bf().indexOf(this)===this.lp.bf().length-1?(this.Gp=this.Gp??new iH(this._v,this.lp),this.Gp.Pt()):(this.Gp?._p(),this.Gp=null)}xp(){return this.lp}kf(){return this.Sf}dv(){if(null!==this.lv&&(this.pv(),0!==this.ts().js().length)){if(null!==this.Xp){let t=this.lv.xo();this.Xp._s(b(t))}if(null!==this.Zp){let t=this.lv.So();this.Zp._s(b(t))}}}vv(){null!==this.Xp&&this.Xp.Pt(),null!==this.Zp&&this.Zp.Pt()}fo(){return null!==this.lv?this.lv.fo():0}po(t){this.lv&&this.lv.po(t)}Bd(t){if(!this.lv)return;this.mv();let i=t.localX,s=t.localY;this.wv(i,s,t)}Jd(t){this.mv(),this.gv(),this.wv(t.localX,t.localY,t)}Ad(t){if(!this.lv)return;this.mv();let i=t.localX,s=t.localY;this.wv(i,s,t)}jd(t){null!==this.lv&&(this.mv(),this.Mv(t))}Pd(t){null!==this.lv&&this.bv(this.iv,t)}xd(t){this.Pd(t)}Hd(t){this.mv(),this.xv(t),this.wv(t.localX,t.localY,t)}Yd(t){null!==this.lv&&(this.mv(),this.nv=!1,this.Sv(t))}qd(t){null!==this.lv&&this.Mv(t)}_f(t){if(this.nv=!0,null===this.ev){let i={x:t.localX,y:t.localY};this.Cv(i,i,t)}}lf(t){null!==this.lv&&(this.mv(),this.lv.Qt().Fu(null),this.yv())}Pv(){return this.tv}kv(){return this.iv}sf(){this.sv=1,this.ts().hn()}nf(t,i){if(!this.lp.N().handleScale.pinch)return;let s=5*(i-this.sv);this.sv=i,this.ts().Ju(t._t,s)}Zd(t){this.nv=!1,this.rv=null!==this.ev,this.gv();let i=this.ts().$u();null!==this.ev&&i.Vt()&&(this.hv={x:i.si(),y:i.ni()},this.ev={x:t.localX,y:t.localY})}Wd(t){if(null===this.lv)return;let i=t.localX,s=t.localY;if(null===this.ev)this.xv(t);else{this.rv=!1;let e=b(this.hv),h=e.x+(i-this.ev.x),l=e.y+(s-this.ev.y);this.wv(h,l,t)}}$d(t){0===this.xp().N().trackingMode.exitMode&&(this.rv=!0),this.Tv(),this.Sv(t)}jn(t,i){let s=this.lv;return null===s?null:id(s,t,i)}
1Rv(t,i){b("left"===i?this.Xp:this.Zp).Lp((0,f.Ej)({width:t,height:this.pp.height}))}Tf(){return this.pp}Lp(t){(0,f.zE)(this.pp,t)||(this.pp=t,this.Mp=!0,this.Tp.resizeCanvasElement(t),this.Rp.resizeCanvasElement(t),this.Mp=!1,this._v.style.width=t.width+"px",this._v.style.height=t.height+"px")}Dv(){let t=b(this.lv);for(let i of(t.bo(t.xo()),t.bo(t.So()),t.ba()))if(t.Un(i)){let s=i.Wt();null!==s&&t.bo(s),i.Ns()}for(let i of t.Lo())i.Ns()}Rf(){return this.Tp.bitmapSize}Df(t,i,s){let e=this.Rf();e.width>0&&e.height>0&&t.drawImage(this.Tp.canvasElement,i,s)}Np(t){if(0===t||null===this.lv)return;t>1&&this.Dv(),null!==this.Xp&&this.Xp.Np(t),null!==this.Zp&&this.Zp.Np(t);let i={colorSpace:this.lp.N().layout.colorSpace};if(1!==t){this.Tp.applySuggestedBitmapSize();let t=(0,f.vb)(this.Tp,i);null!==t&&(t.useBitmapCoordinateSpace(t=>{this.Fp(t)}),this.lv&&(this.Vv(t,i5),this.Iv(t),this.Vv(t,i4),this.Vv(t,i6)))}this.Rp.applySuggestedBitmapSize();let s=(0,f.vb)(this.Rp,i);null!==s&&(s.useBitmapCoordinateSpace(({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)}),this.Bv(s),this.Vv(s,i9),this.Vv(s,i6))}Av(){return this.Xp}Ev(){return this.Zp}Up(t,i){this.Vv(t,i)}ov(){null!==this.lv&&this.lv.Eo().u(this),this.lv=null}Mv(t){this.bv(this.tv,t)}bv(t,i){let s=i.localX,e=i.localY;t.v()&&t.p(this.ts().At().Y_(s),{x:s,y:e},i)}Fp({context:t,bitmapSize:i}){let{width:s,height:e}=i,h=this.ts(),l=h.$(),n=h.Mc();l===n?Q(t,0,0,s,e,n):J(t,0,0,s,e,l,n)}Iv(t){let i=b(this.lv),s=i.zo().lr().Tt(i);null!==s&&s.nt(t,!1)}Bv(t){this.zv(t,i4,iq,this.ts().$u())}Vv(t,i){let s=b(this.lv),e=s.Dt(),h=s.Lo();for(let s of h)this.zv(t,i,iG,s);for(let s of e)this.zv(t,i,iG,s);for(let s of h)this.zv(t,i,iq,s);for(let s of e)this.zv(t,i,iq,s)}zv(t,i,s,e){let h=b(this.lv),l=h.Qt().Wu(),n=null!==l&&l.Oo===e,r=null!==l&&n&&void 0!==l.No?l.No.Xn:void 0;i0(i,i=>s(i,t,n,r),e,h)}pv(){if(null===this.lv)return;let t=this.lp,i=this.lv.xo().N().visible,s=this.lv.So().N().visible;i||null===this.Xp||(this.uv.removeChild(this.Xp.kf()),this.Xp.m(),this.Xp=null),s||null===this.Zp||(this.cv.removeChild(this.Zp.kf()),this.Zp.m(),this.Zp=null);let e=t.Qt()._c();i&&null===this.Xp&&(this.Xp=new i3(this,t.N(),e,"left"),this.uv.appendChild(this.Xp.kf())),s&&null===this.Zp&&(this.Zp=new i3(this,t.N(),e,"right"),this.cv.appendChild(this.Zp.kf()))}Lv(t){return t.uf&&this.nv||null!==this.ev}Ov(t){return Math.max(0,Math.min(t,this.pp.width-1))}Nv(t){return Math.max(0,Math.min(t,this.pp.height-1))}wv(t,i,s){this.ts().hc(this.Ov(t),this.Nv(i),s,b(this.lv))}yv(){this.ts().lc()}Tv(){this.rv&&(this.ev=null,this.yv())}Cv(t,i,s){this.ev=t,this.rv=!1,this.wv(i.x,i.y,s);let e=this.ts().$u();this.hv={x:e.si(),y:e.ni()}}ts(){return this.lp.Qt()}Sv(t){if(!this.Qp)return;let i=this.ts(),s=this.Of();if(i.Ro(s,s.ks()),this.Jp=null,this.Qp=!1,i.nc(),null!==this.av){let t=performance.now(),s=i.At();this.av.le(s.Q_(),t),this.av.ou(t)||i._n(this.av)}}mv(){this.ev=null}gv(){if(this.lv){if(this.ts().hn(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)b(document.activeElement).blur();else{let t=document.getSelection();null!==t&&t.removeAllRanges()}this.lv.ks().Ki()||this.ts().At().Ki()}}xv(t){if(null===this.lv)return;let i=this.ts(),s=i.At();if(s.Ki())return;let e=this.lp.N(),h=e.handleScroll,l=e.kineticScroll;if((!h.pressedMouseMove||t.uf)&&(!h.horzTouchDrag&&!h.vertTouchDrag||!t.uf))return;let n=this.lv.ks(),r=performance.now();if(null!==this.Jp||this.Lv(t)||(this.Jp={x:t.clientX,y:t.clientY,Ec:r,Wv:t.localX,Fv:t.localY}),null!==this.Jp&&!this.Qp&&(this.Jp.x!==t.clientX||this.Jp.y!==t.clientY)){if(t.uf&&l.touch||!t.uf&&l.mouse){let t=s.G_();this.av=new ij(.2/t,7/t,.997,15/t),this.av.sp(s.Q_(),this.Jp.Ec)}else this.av=null;n.Ki()||i.ko(this.lv,n,t.localY),i.tc(t.localX),this.Qp=!0}this.Qp&&(n.Ki()||i.To(this.lv,n,t.localY),i.sc(t.localX),null!==this.av&&this.av.sp(s.Q_(),r))}}class i8{constructor(t,i,s,e,h){this.St=!0,this.pp=(0,f.Ej)({width:0,height:0}),this.bp=()=>this.Np(3),this.Cp="left"===t,this.Iu=s._c,this.ys=i,this.Hv=e,this.Uv=h,this.Cf=document.createElement("div"),this.Cf.style.width="25px",this.Cf.style.height="100%",this.Cf.style.overflow="hidden",this.Tp=iK(this.Cf,(0,f.Ej)({width:16,height:16})),this.Tp.subscribeSuggestedBitmapSizeChanged(this.bp)}m(){this.Tp.unsubscribeSuggestedBitmapSizeChanged(this.bp),iU(this.Tp.canvasElement),this.Tp.dispose()}kf(){return this.Cf}Tf(){return this.pp}Lp(t){(0,f.zE)(this.pp,t)||(this.pp=t,this.Tp.resizeCanvasElement(t),this.Cf.style.width=`${t.width}px`,this.Cf.style.height=`${t.height}px`,this.St=!0)}Np(t){if(t<3&&!this.St||0===this.pp.width||0===this.pp.height)return;this.St=!1,this.Tp.applySuggestedBitmapSize();let i=(0,f.vb)(this.Tp,{colorSpace:this.ys.layout.colorSpace});null!==i&&i.useBitmapCoordinateSpace(t=>{this.Fp(t),this.Hp(t)})}Rf(){return this.Tp.bitmapSize}Df(t,i,s){let e=this.Rf();e.width>0&&e.height>0&&t.drawImage(this.Tp.canvasElement,i,s)}Hp({context:t,bitmapSize:i,horizontalPixelRatio:s,verticalPixelRatio:e}){if(!this.Hv())return;t.fillStyle=this.ys.timeScale.borderColor;let h=Math.floor(this.Iu.N().S*s),l=Math.floor(this.Iu.N().S*e),n=this.Cp?i.width-h:0;t.fillRect(n,0,h,l)}Fp({context:t,bitmapSize:i}){Q(t,0,0,i.width,i.height,this.Uv())}}function st(t){return i=>i.ia?.(t)??[]}let si=st("normal"),ss=st("top"),se=st("bottom");class sh{constructor(t,i){this.$v=null,this.qv=null,this.M=null,this.Yv=!1,this.pp=(0,f.Ej)({width:0,height:0}),this.jv=new M,this.mp=new ta(5),this.Mp=!1,this.bp=()=>{this.Mp||this.lp.Qt().ar()},this.Sp=()=>{this.Mp||this.lp.Qt().ar()},this.lp=t,this.$o=i,this.ys=t.N().layout,this.ep=document.createElement("tr"),this.Kv=document.createElement("td"),this.Kv.style.padding="0",this.Xv=document.createElement("td"),this.Xv.style.padding="0",this.Cf=document.createElement("td"),this.Cf.style.height="25px",this.Cf.style.padding="0",this.Zv=document.createElement("div"),this.Zv.style.width="100%",this.Zv.style.height="100%",this.Zv.style.position="relative",this.Zv.style.overflow="hidden",this.Cf.appendChild(this.Zv),this.Tp=iK(this.Zv,(0,f.Ej)({width:16,height:16})),this.Tp.subscribeSuggestedBitmapSizeChanged(this.bp);let s=this.Tp.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.Rp=iK(this.Zv,(0,f.Ej)({width:16,height:16})),this.Rp.subscribeSuggestedBitmapSizeChanged(this.Sp);let e=this.Rp.canvasElement;e.style.position="absolute",e.style.zIndex="2",e.style.left="0",e.style.top="0",this.ep.appendChild(this.Kv),this.ep.appendChild(this.Cf),this.ep.appendChild(this.Xv),this.Gv(),this.lp.Qt().do().i(this.Gv.bind(this),this),this.vf=new iA(this.Rp.canvasElement,this,{Od:()=>!0,Nd:()=>!this.lp.N().handleScroll.horzTouchDrag})}m(){this.vf.m(),null!==this.$v&&this.$v.m(),null!==this.qv&&this.qv.m(),this.Rp.unsubscribeSuggestedBitmapSizeChanged(this.Sp),iU(this.Rp.canvasElement),this.Rp.dispose(),this.Tp.unsubscribeSuggestedBitmapSizeChanged(this.bp),iU(this.Tp.canvasElement),this.Tp.dispose()}kf(){return this.ep}Jv(){return this.$v}Qv(){return this.qv}Jd(t){if(this.Yv)return;this.Yv=!0;let i=this.lp.Qt();!i.At().Ki()&&this.lp.N().handleScale.axisPressedMouseMove.time&&i.Gu(t.localX)}Zd(t){this.Jd(t)}Qd(){let t=this.lp.Qt();!t.At().Ki()&&this.Yv&&(this.Yv=!1,this.lp.N().handleScale.axisPressedMouseMove.time&&t.rc())}Hd(t){let i=this.lp.Qt();!i.At().Ki()&&this.lp.N().handleScale.axisPressedMouseMove.time&&i.ec(t.localX)}Wd(t){this.Hd(t)}Yd(){this.Yv=!1;let t=this.lp.Qt();t.At().Ki()&&!this.lp.N().handleScale.axisPressedMouseMove.time||t.rc()}$d(){this.Yd()}Pd(){this.lp.N().handleScale.axisDoubleClickReset.time&&this.lp.Qt().cn()}xd(){this.Pd()}Bd(){this.lp.Qt().N().handleScale.axisPressedMouseMove.time&&this.jp(1)}lf(){this.jp(0)}Tf(){return this.pp}tm(){return this.jv}
1im(t,i,s){(0,f.zE)(this.pp,t)||(this.pp=t,this.Mp=!0,this.Tp.resizeCanvasElement(t),this.Rp.resizeCanvasElement(t),this.Mp=!1,this.Cf.style.width=`${t.width}px`,this.Cf.style.height=`${t.height}px`,this.jv.p(t)),null!==this.$v&&this.$v.Lp((0,f.Ej)({width:i,height:t.height})),null!==this.qv&&this.qv.Lp((0,f.Ej)({width:s,height:t.height}))}sm(){let t=this.nm();return Math.ceil(t.S+t.C+t.P+t.A+t.V+t.rm)}Pt(){this.lp.Qt().At().Va()}Rf(){return this.Tp.bitmapSize}Df(t,i,s){let e=this.Rf();e.width>0&&e.height>0&&t.drawImage(this.Tp.canvasElement,i,s)}Np(t){if(0===t)return;let i={colorSpace:this.ys.colorSpace};if(1!==t){this.Tp.applySuggestedBitmapSize();let s=(0,f.vb)(this.Tp,i);null!==s&&(s.useBitmapCoordinateSpace(t=>{this.Fp(t),this.Hp(t),this.hm(s,se)}),this.$p(s),this.hm(s,si)),null!==this.$v&&this.$v.Np(t),null!==this.qv&&this.qv.Np(t)}this.Rp.applySuggestedBitmapSize();let s=(0,f.vb)(this.Rp,i);null!==s&&(s.useBitmapCoordinateSpace(({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)}),this.am([...this.lp.Qt().js(),this.lp.Qt().$u()],s),this.hm(s,ss))}hm(t,i){let s=this.lp.Qt().js();for(let e of s)i0(i,i=>iG(i,t,!1,void 0),e,void 0);for(let e of s)i0(i,i=>iq(i,t,!1,void 0),e,void 0)}Fp({context:t,bitmapSize:i}){Q(t,0,0,i.width,i.height,this.lp.Qt().Mc())}Hp({context:t,bitmapSize:i,verticalPixelRatio:s}){if(this.lp.N().timeScale.borderVisible){t.fillStyle=this.lm();let e=Math.max(1,Math.floor(this.nm().S*s));t.fillRect(0,0,i.width,e)}}$p(t){let i=this.lp.Qt().At(),s=i.Va();if(!s||0===s.length)return;let e=this.$o.maxTickMarkWeight(s),h=this.nm(),l=i.N();l.borderVisible&&l.ticksVisible&&t.useBitmapCoordinateSpace(({context:t,horizontalPixelRatio:i,verticalPixelRatio:e})=>{t.strokeStyle=this.lm(),t.fillStyle=this.lm();let l=Math.max(1,Math.floor(i)),n=Math.floor(.5*i);t.beginPath();let r=Math.round(h.C*e);for(let e=s.length;e--;){let h=Math.round(s[e].coord*i);t.rect(h-n,0,l,r)}t.fill()}),t.useMediaCoordinateSpace(({context:t})=>{let i=h.S+h.C+h.A+h.P/2;for(let h of(t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.H(),t.font=this.Ep(),s))if(h.weight<e){let s=h.needAlignCoordinate?this.om(t,h.coord,h.label):h.coord;t.fillText(h.label,s,i)}for(let h of(this.lp.N().timeScale.allowBoldLabels&&(t.font=this._m()),s))if(h.weight>=e){let s=h.needAlignCoordinate?this.om(t,h.coord,h.label):h.coord;t.fillText(h.label,s,i)}})}om(t,i,s){let e=this.mp.Vi(t,s),h=Math.floor(i-e/2)+.5;return h<0?i+=Math.abs(0-h):h+e>this.pp.width&&(i-=Math.abs(this.pp.width-(h+e))),i}am(t,i){let s=this.nm();for(let e of t)for(let t of e.cs())t.Tt().nt(i,s)}lm(){return this.lp.N().timeScale.borderColor}H(){return this.ys.textColor}W(){return this.ys.fontSize}Ep(){return P(this.W(),this.ys.fontFamily)}_m(){return P(this.W(),this.ys.fontFamily,"bold")}nm(){null===this.M&&(this.M={S:1,L:NaN,A:NaN,V:NaN,Ji:NaN,C:5,P:NaN,k:"",Gi:new ta,rm:0});let t=this.M,i=this.Ep();if(t.k!==i){let s=this.W();t.P=s,t.k=i,t.A=3*s/12,t.V=3*s/12,t.Ji=9*s/12,t.L=0,t.rm=4*s/12,t.Gi.In()}return this.M}jp(t){this.Cf.style.cursor=1===t?"ew-resize":"default"}Gv(){let t=this.lp.Qt(),i=t.N();i.leftPriceScale.visible||null===this.$v||(this.Kv.removeChild(this.$v.kf()),this.$v.m(),this.$v=null),i.rightPriceScale.visible||null===this.qv||(this.Xv.removeChild(this.qv.kf()),this.qv.m(),this.qv=null);let s={_c:this.lp.Qt()._c()},e=()=>i.leftPriceScale.borderVisible&&t.At().N().borderVisible,h=()=>t.Mc();i.leftPriceScale.visible&&null===this.$v&&(this.$v=new i8("left",i,s,e,h),this.Kv.appendChild(this.$v.kf())),i.rightPriceScale.visible&&null===this.qv&&(this.qv=new i8("right",i,s,e,h),this.Xv.appendChild(this.qv.kf()))}}let sl=!!iW&&!!navigator.userAgentData&&navigator.userAgentData.brands.some(t=>t.brand.includes("Chromium"))&&!!iW&&(navigator?.userAgentData?.platform?"Windows"===navigator.userAgentData.platform:navigator.userAgent.toLowerCase().indexOf("win")>=0);class sn{constructor(t,i,s){var e;this.um=[],this.dm=[],this.fm=0,this.ja=0,this.no=0,this.pm=0,this.vm=0,this.wm=null,this.gm=!1,this.tv=new M,this.iv=new M,this.Ru=new M,this.Mm=null,this.bm=null,this.ap=t,this.ys=i,this.$o=s,this.ep=document.createElement("div"),this.ep.classList.add("tv-lightweight-charts"),this.ep.style.overflow="hidden",this.ep.style.direction="ltr",this.ep.style.width="100%",this.ep.style.height="100%",(e=this.ep).style.userSelect="none",e.style.webkitUserSelect="none",e.style.msUserSelect="none",e.style.MozUserSelect="none",e.style.webkitTapHighlightColor="transparent",this.xm=document.createElement("table"),this.xm.setAttribute("cellspacing","0"),this.ep.appendChild(this.xm),this.Sm=this.Cm.bind(this),sr(this.ys)&&this.ym(!0),this.ts=new iM(this.Vu.bind(this),this.ys,s),this.Qt().qu().i(this.Pm.bind(this),this),this.km=new sh(this,this.$o),this.xm.appendChild(this.km.kf());let h=i.autoSize&&this.Tm(),l=this.ys.width,n=this.ys.height;if(h||0===l||0===n){let i=t.getBoundingClientRect();l=l||i.width,n=n||i.height}this.Rm(l,n),this.Dm(),t.appendChild(this.ep),this.Vm(),this.ts.At().du().i(this.ts.Bh.bind(this.ts),this),this.ts.do().i(this.ts.Bh.bind(this.ts),this)}Qt(){return this.ts}N(){return this.ys}bf(){return this.um}Im(){return this.km}m(){for(let t of(this.ym(!1),0!==this.fm&&window.cancelAnimationFrame(this.fm),this.ts.qu().u(this),this.ts.At().du().u(this),this.ts.do().u(this),this.ts.m(),this.um))this.xm.removeChild(t.kf()),t.Pv().u(this),t.kv().u(this),t.m();for(let t of(this.um=[],this.dm))this.Bm(t);this.dm=[],b(this.km).m(),null!==this.ep.parentElement&&this.ep.parentElement.removeChild(this.ep),this.Ru.m(),this.tv.m(),this.iv.m(),this.Am()}Rm(t,i,s=!1){if(this.ja===i&&this.no===t)return;let e=function(t){let i=Math.floor(t.width),s=Math.floor(t.height);return(0,f.Ej)({width:i-i%2,height:s-s%2})}((0,f.Ej)({width:t,height:i}));this.ja=e.height,this.no=e.width;let h=this.ja+"px",l=this.no+"px";b(this.ep).style.height=h,b(this.ep).style.width=l,this.xm.style.height=h,this.xm.style.width=l,s?this.Em(te.gn(),performance.now()):this.ts.Bh()}Np(t){void 0===t&&(t=te.gn());for(let i=0;i<this.um.length;i++)this.um[i].Np(t.en(i).tn);this.ys.timeScale.visible&&this.km.Np(t.nn())}hr(t){let i=sr(this.ys);this.ts.hr(t);let s=sr(this.ys);
1s!==i&&this.ym(s),t.layout?.panes&&this.zm(),this.Vm(),this.Lm(t)}Pv(){return this.tv}kv(){return this.iv}qu(){return this.Ru}Om(){null!==this.wm&&(this.Em(this.wm,performance.now()),this.wm=null);let t=this.Nm(null),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let s=b(i.getContext("2d"));return this.Nm(s),i}Wm(t){return("left"!==t||this.Fm())&&("right"!==t||this.Hm())&&0!==this.um.length?b("left"===t?this.um[0].Av():this.um[0].Ev()).Op():0}Um(){return this.ys.autoSize&&null!==this.Mm}If(){return this.ep}$m(t){this.bm=t,this.bm?this.If().style.setProperty("cursor",t):this.If().style.removeProperty("cursor")}qm(){return this.bm}Ym(t){return w(this.um[t]).Tf()}zm(){this.dm.forEach(t=>{t.Pt()})}Lm(t){(void 0!==t.autoSize||!this.Mm||void 0===t.width&&void 0===t.height)&&(t.autoSize&&!this.Mm&&this.Tm(),!1===t.autoSize&&null!==this.Mm&&this.Am(),t.autoSize||void 0===t.width&&void 0===t.height||this.Rm(t.width||this.no,t.height||this.ja))}Nm(t){let i=0,s=0,e=this.um[0],h=(i,s)=>{let e=0;for(let h=0;h<this.um.length;h++){let l=this.um[h],n=b("left"===i?l.Av():l.Ev()),r=n.Rf();if(null!==t&&n.Df(t,s,e),e+=r.height,h<this.um.length-1){let i=this.dm[h],l=i.Rf();null!==t&&i.Df(t,s,e),e+=l.height}}};this.Fm()&&(h("left",0),i+=b(e.Av()).Rf().width);for(let e=0;e<this.um.length;e++){let h=this.um[e],l=h.Rf();if(null!==t&&h.Df(t,i,s),s+=l.height,e<this.um.length-1){let h=this.dm[e],l=h.Rf();null!==t&&h.Df(t,i,s),s+=l.height}}i+=e.Rf().width,this.Hm()&&(h("right",i),i+=b(e.Ev()).Rf().width);let l=(i,s,e)=>
1{b("left"===i?this.km.Jv():this.km.Qv()).Df(b(t),s,e)};if(this.ys.timeScale.visible){let i=this.km.Rf();if(null!==t){let h=0;this.Fm()&&(l("left",h,s),h=b(e.Av()).Rf().width),this.km.Df(t,h,s),h+=i.width,this.Hm()&&l("right",h,s)}s+=i.height}return(0,f.Ej)({width:i,height:s})}jm(){var t,i,s;let e=0,h=0,l=0;for(let t of this.um)this.Fm()&&(h=Math.max(h,b(t.Av()).Ap(),this.ys.leftPriceScale.minimumWidth)),this.Hm()&&(l=Math.max(l,b(t.Ev()).Ap(),this.ys.rightPriceScale.minimumWidth)),e+=t.fo();h=(i=h)+i%2,l=(s=l)+s%2;let n=this.no,r=this.ja,o=Math.max(n-h-l,0),a=1*this.dm.length,u=this.ys.timeScale.visible,c=u?Math.max(this.km.sm(),this.ys.timeScale.minimumHeight):0,d=a+(c=(t=c)+t%2),p=r<d?0:r-d,m=p/e,g=0,v=window.devicePixelRatio||1;for(let t=0;t<this.um.length;++t){let i=this.um[t];i.fv(this.ts.$s()[t]);let s=0;s=Math.max(t===this.um.length-1?Math.ceil((p-g)*v)/v:Math.round(i.fo()*m*v)/v,2),g+=s,i.Lp((0,f.Ej)({width:o,height:s})),this.Fm()&&i.Rv(h,"left"),this.Hm()&&i.Rv(l,"right"),i.Of()&&this.ts.Yu(i.Of(),s)}this.km.im((0,f.Ej)({width:u?o:0,height:c}),u?h:0,u?l:0),this.ts.vo(o),this.pm!==h&&(this.pm=h),this.vm!==l&&(this.vm=l)}ym(t){t?this.ep.addEventListener("wheel",this.Sm,{passive:!1}):this.ep.removeEventListener("wheel",this.Sm)}Km(t){switch(t.deltaMode){case t.DOM_DELTA_PAGE:return 120;case t.DOM_DELTA_LINE:return 32}return sl?1/window.devicePixelRatio:1}Cm(t){if(!(0!==t.deltaX&&this.ys.handleScroll.mouseWheel||0!==t.deltaY&&this.ys.handleScale.mouseWheel))return;let i=this.Km(t),s=i*t.deltaX/100,e=-i*t.deltaY/100;if(t.cancelable&&t.preventDefault(),0!==e&&this.ys.handleScale.mouseWheel){let i=Math.sign(e)*Math.min(1,Math.abs(e)),s=t.clientX-this.ep.getBoundingClientRect().left;this.Qt().Ju(s,i)}0!==s&&this.ys.handleScroll.mouseWheel&&this.Qt().Qu(-80*s)}Em(t,i){let s=t.nn();3===s&&this.Xm(),3!==s&&2!==s||(this.Zm(t),this.Gm(t,i),this.km.Pt(),this.um.forEach(t=>{t.vv()}),3===this.wm?.nn()&&(this.wm.vn(t),this.Xm(),this.Zm(this.wm),this.Gm(this.wm,i),t=this.wm,this.wm=null)),this.Np(t)}Gm(t,i){for(let s of t.pn())this.mn(s,i)}Zm(t){let i=this.ts.$s();for(let s=0;s<i.length;s++)t.en(s).sn&&i[s].Io()}mn(t,i){let s=this.ts.At();switch(t.an){case 0:s.pu();break;case 1:s.vu(t.Ft);break;case 2:s.dn(t.Ft);break;case 3:s.fn(t.Ft);break;case 4:s.su();break;case 5:t.Ft.ou(i)||s.fn(t.Ft._u(i))}}Vu(t){null!==this.wm?this.wm.vn(t):this.wm=t,this.gm||(this.gm=!0,this.fm=window.requestAnimationFrame(t=>{if(this.gm=!1,this.fm=0,null!==this.wm){let i=this.wm;for(let s of(this.wm=null,this.Em(i,t),i.pn()))if(5===s.an&&!s.Ft.ou(t)){this.Qt()._n(s.Ft);break}}}))}Xm(){this.Dm()}Bm(t){this.xm.removeChild(t.kf()),t.m()}Dm(){let t=this.ts.$s(),i=t.length,s=this.um.length;for(let t=i;t<s;t++){let t=w(this.um.pop());this.xm.removeChild(t.kf()),t.Pv().u(this),t.kv().u(this),t.m();let i=this.dm.pop();void 0!==i&&this.Bm(i)}for(let e=s;e<i;e++){let i=new i7(this,t[e]);if(i.Pv().i(this.Jm.bind(this,i),this),i.kv().i(this.Qm.bind(this,i),this),this.um.push(i),e>0){let t=new iZ(this,e-1,e);this.dm.push(t),this.xm.insertBefore(t.kf(),this.km.kf())}this.xm.insertBefore(i.kf(),this.km.kf())}for(let s=0;s<i;s++){let i=t[s],e=this.um[s];e.Of()!==i?e.fv(i):e.dv()}this.Vm(),this.jm()}tw(t,i,s,e){let h;let l=new Map;if(null!==t&&this.ts.js().forEach(i=>{let s=i.Xs().Wr(t);null!==s&&l.set(i,s)}),null!==t){let i=this.ts.At().ss(t)?.originalTime;void 0!==i&&(h=i)}let n=this.Qt().Wu(),r=null!==n&&n.Oo instanceof tH?n.Oo:void 0,o=null!==n&&void 0!==n.No?n.No.Kn:void 0,a=this.iw(e);return{sw:h,Re:t??void 0,nw:i??void 0,ew:-1!==a?a:void 0,rw:r,hw:l,aw:o,lw:s??void 0}}iw(t){let i=-1;if(t)i=this.um.indexOf(t);else{let t=this.Qt().$u().Us();null!==t&&(i=this.Qt().$s().indexOf(t))}return i}Jm(t,i,s,e){this.tv.p(()=>this.tw(i,s,e,t))}Qm(t,i,s,e){this.iv.p(()=>this.tw(i,s,e,t))}Pm(t,i,s){this.$m(this.Qt().Wu()?.Fo??null),this.Ru.p(()=>this.tw(t,i,s))}Vm(){let t=this.ys.timeScale.visible?"":"none";this.km.kf().style.display=t}Fm(){return this.um[0].Of().xo().N().visible}Hm(){return this.um[0].Of().So().N().visible}Tm(){return"ResizeObserver"in window&&(this.Mm=new ResizeObserver(t=>{let i=t[t.length-1];i&&this.Rm(i.contentRect.width,i.contentRect.height)}),this.Mm.observe(this.ap,{box:"border-box"}),!0)}Am(){null!==this.Mm&&this.Mm.disconnect(),this.Mm=null}}function sr(t){return!!(t.handleScroll.mouseWheel||t.handleScale.mouseWheel)}function so(t,i,s,e){let h=s.value,l={Re:i,wt:t,Ft:[h,h,h,h],sw:e};return void 0!==s.color&&(l.R=s.color),l}function sa(t,i,s,e){let h=s.value,l={Re:i,wt:t,Ft:[h,h,h,h],sw:e};return void 0!==s.lineColor&&(l.vt=s.lineColor),void 0!==s.topColor&&(l.mr=s.topColor),void 0!==s.bottomColor&&(l.wr=s.bottomColor),l}function su(t,i,s,e){let h=s.value,l={Re:i,wt:t,Ft:[h,h,h,h],sw:e};return void 0!==s.topLineColor&&(l.gr=s.topLineColor),void 0!==s.bottomLineColor&&(l.Mr=s.bottomLineColor),void 0!==s.topFillColor1&&
1(l.br=s.topFillColor1),void 0!==s.topFillColor2&&(l.Sr=s.topFillColor2),void 0!==s.bottomFillColor1&&(l.Cr=s.bottomFillColor1),void 0!==s.bottomFillColor2&&(l.yr=s.bottomFillColor2),l}function sc(t,i,s,e){let h={Re:i,wt:t,Ft:[s.open,s.high,s.low,s.close],sw:e};return void 0!==s.color&&(h.R=s.color),h}function sd(t,i,s,e){let h={Re:i,wt:t,Ft:[s.open,s.high,s.low,s.close],sw:e};return void 0!==s.color&&(h.R=s.color),void 0!==s.borderColor&&(h.Ht=s.borderColor),void 0!==s.wickColor&&(h.vr=s.wickColor),h}function sf(t,i,s,e,h){let l=w(h)(s),n=Math.max(...l),r=Math.min(...l),o=l[l.length-1],{time:a,color:u,...c}=s;return{Re:i,wt:t,Ft:[o,n,r,o],sw:e,se:c,R:u}}function sp(t){return void 0!==t.Ft}function sm(t,i){return void 0!==i.customValues&&(t.ow=i.customValues),t}function sg(t){return(i,s,e,h,l,n)=>{var r;return(n?n(e):void 0===(r=e).open&&void 0===r.value)?sm({wt:i,Re:s,sw:h},e):sm(t(i,s,e,h,l),e)}}function sv(t){return({Candlestick:sg(sd),Bar:sg(sc),Area:sg(sa),Baseline:sg(su),Histogram:sg(so),Line:sg(so),Custom:sg(sf)})[t]}function sw(t){return{Re:0,_w:new Map,Hh:t}}function sb(t,i){if(void 0!==t&&0!==t.length)return{uw:i.key(t[0].wt),cw:i.key(t[t.length-1].wt)}}function sy(t){let i;return t.forEach(t=>{void 0===i&&(i=t.sw)}),w(i)}class sM{constructor(t){this.dw=new Map,this.fw=new Map,this.pw=new Map,this.mw=[],this.$o=t}m(){this.dw.clear(),this.fw.clear(),this.pw.clear(),this.mw=[]}ww(t,i){let s=0!==this.dw.size,e=!1,h=this.fw.get(t);if(void 0!==h){if(1===this.fw.size)s=!1,e=!0,this.dw.clear();else for(let i of this.mw)i.pointData._w.delete(t)&&(e=!0)}let l=[];if(0!==i.length){let s=i.map(t=>t.time),h=this.$o.createConverterToInternalObj(i),n=sv(t.Rr()),r=t.da(),o=t.pa();l=i.map((i,l)=>{let a=h(i.time),u=this.$o.key(a),c=this.dw.get(u);void 0===c&&(c=sw(a),this.dw.set(u,c),e=!0);let d=n(a,c.Re,i,s[l],r,o);return c._w.set(t,d),d})}s&&this.gw(),this.Mw(t,l);let n=-1;if(e){let t=[];this.dw.forEach(i=>{t.push({timeWeight:0,time:i.Hh,pointData:i,originalTime:sy(i._w)})}),t.sort((t,i)=>this.$o.key(t.time)-this.$o.key(i.time)),n=this.bw(t)}return this.xw(t,n,function(t,i,s){let e=sb(t,s),h=sb(i,s);if(void 0!==e&&void 0!==h)return{Sw:!1,zh:e.cw>=h.cw&&e.uw>=h.uw}}(this.fw.get(t),h,this.$o))}dc(t){return this.ww(t,[])}Cw(t,i,s){void 0===i.sw&&(i.sw=i.time),this.$o.preprocessData(i);let e=this.$o.createConverterToInternalObj([i])(i.time),h=this.pw.get(t);if(!s&&void 0!==h&&this.$o.key(e)<this.$o.key(h))throw Error(`Cannot update oldest data, last time=${h}, new time=${e}`);let l=this.dw.get(this.$o.key(e));if(s&&void 0===l)throw Error("Cannot update non-existing data point when historicalUpdate is true");let n=void 0===l;void 0===l&&(l=sw(e),this.dw.set(this.$o.key(e),l));let r=sv(t.Rr()),o=t.da(),a=t.pa(),u=r(e,l.Re,i,i.sw,o,a);l._w.set(t,u),s?this.yw(t,u,l.Re):this.Pw(t,u);let c={zh:sp(u),Sw:s};if(!n)return this.xw(t,-1,c);let d={timeWeight:0,time:l.Hh,pointData:l,originalTime:sy(l._w)},f=tN(this.mw,this.$o.key(d.time),(t,i)=>this.$o.key(t.time)<i);this.mw.splice(f,0,d);for(let t=f;t<this.mw.length;++t)sS(this.mw[t].pointData,t);return this.$o.fillWeightsForPoints(this.mw,f),this.xw(t,f,c)}Pw(t,i){let s=this.fw.get(t);void 0===s&&(s=[],this.fw.set(t,s));let e=0!==s.length?s[s.length-1]:null;null===e||this.$o.key(i.wt)>this.$o.key(e.wt)?sp(i)&&s.push(i):sp(i)?s[s.length-1]=i:s.splice(-1,1),this.pw.set(t,i.wt)}yw(t,i,s){let e=this.fw.get(t);if(void 0===e)return;let h=tN(e,s,(t,i)=>t.Re<i);sp(i)?e[h]=i:e.splice(h,1)}Mw(t,i){0!==i.length?(this.fw.set(t,i.filter(sp)),this.pw.set(t,i[i.length-1].wt)):(this.fw.delete(t),this.pw.delete(t))}gw(){for(let t of this.mw)0===t.pointData._w.size&&this.dw.delete(this.$o.key(t.time))}bw(t){let i=-1;for(let s=0;s<this.mw.length&&s<t.length;++s){let e=this.mw[s],h=t[s];if(this.$o.key(e.time)!==this.$o.key(h.time)){i=s;break}h.timeWeight=e.timeWeight,sS(h.pointData,s)}if(-1===i&&this.mw.length!==t.length&&(i=Math.min(this.mw.length,t.length)),-1===i)return -1;for(let s=i;s<t.length;++s)sS(t[s].pointData,s);return this.$o.fillWeightsForPoints(t,i),this.mw=t,i}kw(){if(0===this.fw.size)return null;let t=0;
1return this.fw.forEach(i=>{0!==i.length&&(t=Math.max(t,i[i.length-1].Re))}),t}xw(t,i,s){let e={wo:new Map,At:{U_:this.kw()}};if(-1!==i)this.fw.forEach((i,h)=>{e.wo.set(h,{se:i,Tw:h===t?s:void 0})}),this.fw.has(t)||e.wo.set(t,{se:[],Tw:s}),e.At.Rw=this.mw,e.At.Dw=i;else{let i=this.fw.get(t);e.wo.set(t,{se:i||[],Tw:s})}return e}}function sS(t,i){t.Re=i,t._w.forEach(t=>{t.Re=i})}function sx(t,i){return t.wt<i}function s_(t,i){return i<t.wt}function sC(t,i,s){let e=i.Uh(),h=i.bi(),l=tN(t,e,sx),n=tP(t,h,s_);if(!s)return{from:l,to:n};let r=l,o=n;return l>0&&l<t.length&&t[l].wt>=e&&(r=l-1),n>0&&n<t.length&&t[n-1].wt<=h&&(o=n+1),{from:r,to:o}}class sT{constructor(t,i,s){this.Vw=!0,this.Iw=!0,this.Bw=!0,this.Aw=[],this.Ew=null,this.Jn=t,this.Qn=i,this.zw=s}Pt(t){this.Vw=!0,"data"===t&&(this.Iw=!0),"options"===t&&(this.Bw=!0)}Tt(){return this.Jn.Vt()?(this.Lw(),null===this.Ew?null:this.Ow):null}Nw(){this.Aw=this.Aw.map(t=>({...t,...this.Jn.Rh().Dr(t.wt)}))}Ww(){this.Ew=null}Lw(){this.Iw&&(this.Fw(),this.Iw=!1),this.Bw&&(this.Nw(),this.Bw=!1),this.Vw&&(this.Hw(),this.Vw=!1)}Hw(){let t=this.Jn.Wt(),i=this.Qn.At();if(this.Ww(),i.Ki()||t.Ki())return;let s=i.ye();if(null===s||0===this.Jn.Xs().zr())return;let e=this.Jn.zt();null!==e&&(this.Ew=sC(this.Aw,s,this.zw),this.Uw(t,i,e.Ft),this.$w())}}class sk{constructor(t,i){this.qw=t,this.Yi=i}nt(t,i,s){this.qw.draw(t,this.Yi,i,s)}}class sR extends sT{constructor(t,i,s){super(t,i,!1),this.sh=s,this.Ow=new sk(this.sh.renderer(),i=>{let s=t.zt();return null===s?null:t.Wt().Nt(i,s.Ft)})}fa(t){return this.sh.priceValueBuilder(t)}va(t){return this.sh.isWhitespace(t)}Fw(){let t=this.Jn.Rh();this.Aw=this.Jn.Xs().Hr().map(i=>({wt:i.Re,_t:NaN,...t.Dr(i.Re),Yw:i.se}))}Uw(t,i){i.q_(this.Aw,E(this.Ew))}$w(){this.sh.update({bars:this.Aw.map(sE),barSpacing:this.Qn.At().G_(),visibleRange:this.Ew},this.Jn.N())}}function sE(t){return{x:t._t,time:t.wt,originalData:t.Yw,barColor:t.cr}}let sN={color:"#2196f3"},sP=(t,i,s)=>new sR(t,i,y(s));function sz(t){let i={value:t.Ft[3],time:t.sw};return void 0!==t.ow&&(i.customValues=t.ow),i}function sY(t){let i=sz(t);return void 0!==t.R&&(i.color=t.R),i}function sV(t){let i=sz(t);return void 0!==t.vt&&(i.lineColor=t.vt),void 0!==t.mr&&(i.topColor=t.mr),void 0!==t.wr&&(i.bottomColor=t.wr),i}function sF(t){let i=sz(t);return void 0!==t.gr&&(i.topLineColor=t.gr),void 0!==t.Mr&&(i.bottomLineColor=t.Mr),void 0!==t.br&&(i.topFillColor1=t.br),void 0!==t.Sr&&(i.topFillColor2=t.Sr),void 0!==t.Cr&&(i.bottomFillColor1=t.Cr),void 0!==t.yr&&(i.bottomFillColor2=t.yr),i}function sB(t){let i={open:t.Ft[0],high:t.Ft[1],low:t.Ft[2],close:t.Ft[3],time:t.sw};return void 0!==t.ow&&(i.customValues=t.ow),i}function sW(t){let i=sB(t);return void 0!==t.R&&(i.color=t.R),i}function sL(t){let i=sB(t),{R:s,Ht:e,vr:h}=t;return void 0!==s&&(i.color=s),void 0!==e&&(i.borderColor=e),void 0!==h&&(i.wickColor=h),i}function sO(t){return({Area:sV,Line:sY,Baseline:sF,Histogram:sY,Bar:sW,Candlestick:sL,Custom:sA})[t]}function sA(t){let i=t.sw;return{...t.se,time:i}}let sD={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},s$={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},sI={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:N,panes:{enableResize:!0,separatorColor:"#E0E3EB",separatorHoverColor:"rgba(178, 181, 189, 0.2)"},attributionLogo:!0,colorSpace:"srgb",colorParsers:[]},sQ={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0},sX={rightOffset:0,barSpacing:6,minBarSpacing:.5,maxBarSpacing:0,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0,ignoreWhitespaceIndices:!1};function sZ(){return{width:0,height:0,autoSize:!1,layout:sI,crosshair:sD,grid:s$,overlayPriceScales:{...sQ},leftPriceScale:{...sQ,visible:!1},rightPriceScale:{...sQ,visible:!0},timeScale:sX,localization:{locale:iW?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class sJ{constructor(t,i,s){this.gf=t,this.jw=i,this.Kw=s??0}applyOptions(t){this.gf.Qt().Hu(this.jw,t,this.Kw)}options(){return this.Yi().N()}width(){return ts(this.jw)?this.gf.Wm(this.jw):0}
1Yi(){return b(this.gf.Qt().Uu(this.jw,this.Kw)).Wt}}class sj{constructor(t,i,s,e){this.gf=t,this.yt=s,this.Xw=i,this.Zw=e}getHeight(){return this.yt.$t()}setHeight(t){let i=this.gf.Qt(),s=i.xc(this.yt);i.Ku(s,t)}paneIndex(){return this.gf.Qt().xc(this.yt)}moveTo(t){let i=this.paneIndex();i!==t&&(v(t>=0&&t<this.gf.bf().length,"Invalid pane index"),this.gf.Qt().Xu(i,t))}getSeries(){return this.yt.wo().map(t=>this.Xw(t))??[]}getHTMLElement(){return this.gf.bf()[this.paneIndex()].kf()}attachPrimitive(t){this.yt.ua(t),t.attached&&t.attached({chart:this.Zw,requestUpdate:()=>this.yt.Qt().Bh()})}detachPrimitive(t){this.yt.ca(t)}priceScale(t){if(null===this.yt.co(t))throw Error(`Cannot find price scale with id: ${t}`);return new sJ(this.gf,t,this.paneIndex())}}let sH={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class sK{constructor(t){this.ir=t}applyOptions(t){this.ir.hr(t)}options(){return this.ir.N()}Gw(){return this.ir}}class sU{constructor(t,i,s,e,h,l){this.Jw=new M,this.Jn=t,this.Qw=i,this.tg=s,this.$o=h,this.Zw=e,this.ig=l}m(){this.Jw.m()}priceFormatter(){return this.Jn.ra()}priceToCoordinate(t){let i=this.Jn.zt();return null===i?null:this.Jn.Wt().Nt(t,i.Ft)}coordinateToPrice(t){let i=this.Jn.zt();return null===i?null:this.Jn.Wt().Ts(t,i.Ft)}barsInLogicalRange(t){if(null===t)return null;let i=new iw(new im(t.from,t.to)).a_(),s=this.Jn.Xs();if(s.Ki())return null;let e=s.Wr(i.Uh(),1),h=s.Wr(i.bi(),-1),l=b(s.Lr()),n=b(s.Ks());if(null!==e&&null!==h&&e.Re>h.Re)return{barsBefore:t.from-l,barsAfter:n-t.to};let r={barsBefore:null===e||e.Re===l?t.from-l:e.Re-l,barsAfter:null===h||h.Re===n?n-t.to:n-h.Re};return null!==e&&null!==h&&(r.from=e.sw,r.to=h.sw),r}setData(t){this.$o,this.Jn.Rr(),this.Qw.sg(this.Jn,t),this.ng("full")}update(t,i=!1){this.Jn.Rr(),this.Qw.eg(this.Jn,t,i),this.ng("update")}dataByIndex(t,i){let s=this.Jn.Xs().Wr(t,i);return null===s?null:sO(this.seriesType())(s)}data(){let t=sO(this.seriesType());return this.Jn.Xs().Hr().map(i=>t(i))}subscribeDataChanged(t){this.Jw.i(t)}unsubscribeDataChanged(t){this.Jw._(t)}applyOptions(t){this.Jn.hr(t)}options(){return k(this.Jn.N())}priceScale(){return this.tg.priceScale(this.Jn.Wt().wa(),this.getPane().paneIndex())}createPriceLine(t){let i=S(k(sH),t);return new sK(this.Jn.Oh(i))}removePriceLine(t){this.Jn.Nh(t.Gw())}priceLines(){return this.Jn.Wh().map(t=>new sK(t))}seriesType(){return this.Jn.Rr()}attachPrimitive(t){this.Jn.ua(t),t.attached&&t.attached({chart:this.Zw,series:this,requestUpdate:()=>this.Jn.Qt().Bh(),horzScaleBehavior:this.$o})}detachPrimitive(t){this.Jn.ca(t),t.detached&&t.detached(),this.Jn.Qt().Bh()}getPane(){let t=this.Jn,i=b(this.Jn.Qt().Hn(t));return this.ig(i)}moveToPane(t){this.Jn.Qt().wc(this.Jn,t)}seriesOrder(){let t=this.Jn.Qt().Hn(this.Jn);return null===t?-1:t.wo().indexOf(this.Jn)}setSeriesOrder(t){let i=this.Jn.Qt().Hn(this.Jn);null!==i&&i.Ao(this.Jn,t)}ng(t){this.Jw.v()&&this.Jw.p(t)}}class sG{constructor(t,i,s){this.rg=new M,this.m_=new M,this.jv=new M,this.ts=t,this.uh=t.At(),this.km=i,this.uh.uu().i(this.hg.bind(this)),this.uh.cu().i(this.ag.bind(this)),this.km.tm().i(this.lg.bind(this)),this.$o=s}m(){this.uh.uu().u(this),this.uh.cu().u(this),this.km.tm().u(this),this.rg.m(),this.m_.m(),this.jv.m()}scrollPosition(){return this.uh.Q_()}scrollToPosition(t,i){i?this.uh.lu(t,1e3):this.ts.fn(t)}scrollToRealTime(){this.uh.au()}getVisibleRange(){let t=this.uh.z_();return null===t?null:{from:t.from.originalTime,to:t.to.originalTime}}
1setVisibleRange(t){let i={from:this.$o.convertHorzItemToInternal(t.from),to:this.$o.convertHorzItemToInternal(t.to)},s=this.uh.W_(i);this.ts.vc(s)}getVisibleLogicalRange(){let t=this.uh.E_();return null===t?null:{from:t.Uh(),to:t.bi()}}setVisibleLogicalRange(t){v(t.from<=t.to,"The from index cannot be after the to index."),this.ts.vc(t)}resetTimeScale(){this.ts.cn()}fitContent(){this.ts.pu()}logicalToCoordinate(t){let i=this.ts.At();return i.Ki()?null:i.qt(t)}coordinateToLogical(t){return this.uh.Ki()?null:this.uh.Y_(t)}timeToIndex(t,i){let s=this.$o.convertHorzItemToInternal(t);return this.uh.I_(s,i)}timeToCoordinate(t){let i=this.timeToIndex(t,!1);return null===i?null:this.uh.qt(i)}coordinateToTime(t){let i=this.ts.At(),s=i.Y_(t),e=i.ss(s);return null===e?null:e.originalTime}width(){return this.km.Tf().width}height(){return this.km.Tf().height}subscribeVisibleTimeRangeChange(t){this.rg.i(t)}unsubscribeVisibleTimeRangeChange(t){this.rg._(t)}subscribeVisibleLogicalRangeChange(t){this.m_.i(t)}unsubscribeVisibleLogicalRangeChange(t){this.m_._(t)}subscribeSizeChange(t){this.jv.i(t)}unsubscribeSizeChange(t){this.jv._(t)}applyOptions(t){this.uh.hr(t)}options(){return{...k(this.uh.N()),barSpacing:this.uh.G_()}}hg(){this.rg.v()&&this.rg.p(this.getVisibleRange())}ag(){this.m_.v()&&this.m_.p(this.getVisibleLogicalRange())}lg(t){this.jv.p(t.width,t.height)}}function sq(t){return function(t){if(T(t.handleScale)){let i=t.handleScale;t.handleScale={axisDoubleClickReset:{time:i,price:i},axisPressedMouseMove:{time:i,price:i},mouseWheel:i,pinch:i}}else if(void 0!==t.handleScale){let{axisPressedMouseMove:i,axisDoubleClickReset:s}=t.handleScale;T(i)&&(t.handleScale.axisPressedMouseMove={time:i,price:i}),T(s)&&(t.handleScale.axisDoubleClickReset={time:s,price:s})}let i=t.handleScroll;T(i)&&(t.handleScroll={horzTouchDrag:i,vertTouchDrag:i,mouseWheel:i,pressedMouseMove:i})}(t),t}class s0{constructor(t,i,s){this.og=new Map,this._g=new Map,this.ug=new M,this.cg=new M,this.dg=new M,this.yu=new WeakMap,this.fg=new sM(i);let e=void 0===s?k(sZ()):S(k(sZ()),sq(s));this.pg=i,this.gf=new sn(t,e,i),this.gf.Pv().i(t=>{this.ug.v()&&this.ug.p(this.vg(t()))},this),this.gf.kv().i(t=>{this.cg.v()&&this.cg.p(this.vg(t()))},this),this.gf.qu().i(t=>{this.dg.v()&&this.dg.p(this.vg(t()))},this);let h=this.gf.Qt();this.mg=new sG(h,this.gf.Im(),this.pg)}remove(){this.gf.Pv().u(this),this.gf.kv().u(this),this.gf.qu().u(this),this.mg.m(),this.gf.m(),this.og.clear(),this._g.clear(),this.ug.m(),this.cg.m(),this.dg.m(),this.fg.m()}resize(t,i,s){this.autoSizeActive()||this.gf.Rm(t,i,s)}addCustomSeries(t,i={},s=0){let e;let h=(e=y(t),{type:"Custom",isBuiltIn:!1,defaultOptions:{...sN,...e.defaultOptions()},wg:sP,gg:e});return this.Mg(h,i,s)}addSeries(t,i={},s=0){return this.Mg(t,i,s)}removeSeries(t){let i=w(this.og.get(t)),s=this.fg.dc(i);this.gf.Qt().dc(i),this.bg(s),this.og.delete(t),this._g.delete(i)}sg(t,i){this.bg(this.fg.ww(t,i))}eg(t,i,s){this.bg(this.fg.Cw(t,i,s))}subscribeClick(t){this.ug.i(t)}unsubscribeClick(t){this.ug._(t)}subscribeCrosshairMove(t){this.dg.i(t)}unsubscribeCrosshairMove(t){this.dg._(t)}subscribeDblClick(t){this.cg.i(t)}unsubscribeDblClick(t){this.cg._(t)}priceScale(t,i=0){return new sJ(this.gf,t,i)}timeScale(){return this.mg}applyOptions(t){this.gf.hr(sq(t))}options(){return this.gf.N()}takeScreenshot(){return this.gf.Om()}removePane(t){this.gf.Qt().ju(t)}swapPanes(t,i){this.gf.Qt().Xu(t,i)}autoSizeActive(){return this.gf.Um()}chartElement(){return this.gf.If()}panes(){return this.gf.Qt().$s().map(t=>this.xg(t))}paneSize(t=0){let i=this.gf.Ym(t);return{height:i.height,width:i.width}}setCrosshairPosition(t,i,s){let e=this.og.get(s);if(void 0===e)return;let h=this.gf.Qt().Hn(e);null!==h&&this.gf.Qt().ac(t,i,h)}clearCrosshairPosition(){this.gf.Qt().lc(!0)}horzBehaviour(){return this.pg}Mg(t,i={},s=0){var e;v(void 0!==t.wg),void 0!==(e=i.priceFormat)&&"custom"!==e.type&&void 0!==e.minMove&&void 0===e.precision&&(e.precision=function(t){if(t>=1)return 0;let i=0;for(;i<8&&!(1e-8>Math.abs(Math.round(t)-t));i++)t*=10;return i}(e.minMove)),"Candlestick"===t.type&&(void 0!==i.borderColor&&(i.borderUpColor=i.borderColor,i.borderDownColor=i.borderColor),void 0!==i.wickColor&&(i.wickUpColor=i.wickColor,i.wickDownColor=i.wickColor));let h=S(k(p),k(t.defaultOptions),i),l=t.wg,n=new tH(this.gf.Qt(),t.type,h,l,t.gg);this.gf.Qt().uc(n,s);let r=new sU(n,this,this,this,this.pg,t=>this.xg(t));return this.og.set(r,n),this._g.set(n,r),r}bg(t){let i=this.gf.Qt();
1i.oc(t.At.U_,t.At.Rw,t.At.Dw),t.wo.forEach((t,i)=>i.ht(t.se,t.Tw)),i.At().k_(),i.Z_()}Sg(t){return w(this._g.get(t))}vg(t){let i=new Map;t.hw.forEach((t,s)=>{let e=s.Rr(),h=sO(e)(t);if("Custom"!==e){var l;v(void 0!==(l=h).open||void 0!==l.value)}else{let t=s.pa();v(!t||!1===t(h))}i.set(this.Sg(s),h)});let s=void 0!==t.rw&&this._g.has(t.rw)?this.Sg(t.rw):void 0;return{time:t.sw,logical:t.Re,point:t.nw,paneIndex:t.ew,hoveredSeries:s,hoveredObjectId:t.aw,seriesData:i,sourceEvent:t.lw}}xg(t){let i=this.yu.get(t);return i||(i=new sj(this.gf,t=>this.Sg(t),t,this),this.yu.set(t,i)),i}}function s1(t,i){return function(t,i,s){let e=new s0(function(t){if(C(t)){let i=document.getElementById(t);return v(null!==i,`Cannot find element in DOM with id=${t}`),i}return t}(t),i,s);return i.setOptions(e.options()),e}(t,new iB,iB.Oc(i))}class s2 extends sT{constructor(t,i){super(t,i,!0)}Uw(t,i,s){i.q_(this.Aw,E(this.Ew)),t.Vl(this.Aw,s,E(this.Ew))}Cg(t,i){return{wt:t,gt:i,_t:NaN,ut:NaN}}Fw(){let t=this.Jn.Rh();this.Aw=this.Jn.Xs().Hr().map(i=>{let s=i.Ft[3];return this.yg(i.Re,s,t)})}}function s3(t,i,s,e,h,l,n){if(0===i.length||e.from>=i.length||e.to<=0)return;let{context:r,horizontalPixelRatio:o,verticalPixelRatio:a}=t,u=i[e.from],c=l(t,u),d=u;if(e.to-e.from<2){let i=h/2;r.beginPath();let s={_t:u._t-i,ut:u.ut},e={_t:u._t+i,ut:u.ut};r.moveTo(s._t*o,s.ut*a),r.lineTo(e._t*o,e.ut*a),n(t,c,s,e)}else{let h=(i,s)=>{n(t,c,d,s),r.beginPath(),c=i,d=s},f=d;r.beginPath(),r.moveTo(u._t*o,u.ut*a);for(let n=e.from+1;n<e.to;++n){let e=l(t,f=i[n]);switch(s){case 0:r.lineTo(f._t*o,f.ut*a);break;case 1:r.lineTo(f._t*o,i[n-1].ut*a),e!==c&&(h(e,f),r.lineTo(f._t*o,i[n-1].ut*a)),r.lineTo(f._t*o,f.ut*a);break;case 2:{let[t,s]=function(t,i,s){var e,h;let l=Math.max(0,i-1),n=Math.min(t.length-1,s+1);return[(e=t[i],h=s4(s5(t[s],t[l]),6),{_t:e._t+h._t,ut:e.ut+h.ut}),s5(t[s],s4(s5(t[n],t[i]),6))]}(i,n-1,n);r.bezierCurveTo(t._t*o,t.ut*a,s._t*o,s.ut*a,f._t*o,f.ut*a)}}1!==s&&e!==c&&(h(e,f),r.moveTo(f._t*o,f.ut*a))}(d!==f||d===f&&1===s)&&n(t,c,d,f)}}function s5(t,i){return{_t:t._t-i._t,ut:t.ut-i.ut}}function s4(t,i){return{_t:t._t/i,ut:t.ut/i}}function s6(t,i){let s=t.context;s.strokeStyle=i,s.stroke()}class s9 extends W{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et(t){if(null===this.rt)return;let{ot:i,lt:s,Pg:e,kg:h,ct:l,Xt:n,Tg:r}=this.rt;if(null===s)return;let o=t.context;o.lineCap="butt",o.lineWidth=l*t.verticalPixelRatio,m(o,n),o.lineJoin="round";let a=this.Rg.bind(this);void 0!==h&&s3(t,i,h,s,e,a,s6),r&&function(t,i,s,e,h){if(e.to-e.from<=0)return;let{horizontalPixelRatio:l,verticalPixelRatio:n,context:r}=t,o=null,a=Math.max(1,Math.floor(l))%2/2,u=s*n+a;for(let s=e.to-1;s>=e.from;--s){let e=i[s];if(e){let i=h(t,e);i!==o&&(r.beginPath(),null!==o&&r.fill(),r.fillStyle=i,o=i);let s=Math.round(e._t*l)+a,c=e.ut*n;r.moveTo(s,c),r.arc(s,c,u,0,2*Math.PI)}}r.fill()}(t,i,r,s,a)}}class s7 extends s9{Rg(t,i){return i.vt}}class s8 extends s2{constructor(){super(...arguments),this.Ow=new s7}yg(t,i,s){return{...this.Cg(t,i),...s.Dr(t)}}$w(){let t=this.Jn.N(),i={ot:this.Aw,Xt:t.lineStyle,kg:t.lineVisible?t.lineType:void 0,ct:t.lineWidth,Tg:t.pointMarkersVisible?t.pointMarkersRadius||t.lineWidth/2+2:void 0,lt:this.Ew,Pg:this.Qn.At().G_()};this.Ow.ht(i)}}function et(t,i){return t.weight>i.weight?t:i}function ei(t,i,s,e,h){let{context:l,horizontalPixelRatio:n,verticalPixelRatio:r}=i;l.lineTo(h._t*n,t*r),l.lineTo(e._t*n,t*r),l.closePath(),l.fillStyle=s,l.fill()}class es extends W{constructor(){super(...arguments),this.rt=null}ht(t){this.rt=t}et(t){if(null===this.rt)return;let{ot:i,lt:s,Pg:e,ct:h,Xt:l,kg:n}=this.rt,r=this.rt.zg??(this.rt.Lg?0:t.mediaSize.height);if(null===s)return;let o=t.context;o.lineCap="butt",o.lineJoin="round",o.lineWidth=h,m(o,l),o.lineWidth=1,s3(t,i,n,s,e,this.Og.bind(this),ei.bind(null,r))}}class ee{Ng(t,i){let s=this.Wg,{Fg:e,Hg:h,Ug:l,$g:n,zg:r,qg:o,Yg:a}=i;if(void 0===this.jg||void 0===s||s.Fg!==e||s.Hg!==h||s.Ug!==l||s.$g!==n||s.zg!==r||s.qg!==o||s.Yg!==a){let{verticalPixelRatio:s}=t,u=r||o>0?s:1,c=o*u,d=a===t.bitmapSize.height?a:a*u,f=t.context.createLinearGradient(0,c,0,d);if(f.addColorStop(0,e),null!=r){let t=tq(((r??0)*u-c)/(d-c),0,1);f.addColorStop(t,h),f.addColorStop(t,l)}f.addColorStop(1,n),this.jg=f,this.Wg=i}return this.jg}}class eh extends es{constructor(){super(...arguments),this.Kg=new ee}
1Og(t,i){return this.Kg.Ng(t,{Fg:i.mr,Hg:"",Ug:"",$g:i.wr,qg:this.rt?.qg??0,Yg:t.bitmapSize.height})}}class el extends s2{constructor(t,i){super(t,i),this.Ow=new B,this.Jg=new eh,this.Qg=new s7,this.Ow.st([this.Jg,this.Qg])}yg(t,i,s){return{...this.Cg(t,i),...s.Dr(t)}}$w(){let t;let i=this.Jn.N();if(null!==this.Ew&&0!==this.Aw.length){if(i.relativeGradient){t=this.Aw[this.Ew.from].ut;for(let i=this.Ew.from;i<this.Ew.to;i++){let s=this.Aw[i];s.ut<t&&(t=s.ut)}}this.Jg.ht({kg:i.lineType,ot:this.Aw,Xt:i.lineStyle,ct:i.lineWidth,zg:null,qg:t,Lg:i.invertFilledArea,lt:this.Ew,Pg:this.Qn.At().G_()}),this.Qg.ht({kg:i.lineVisible?i.lineType:void 0,ot:this.Aw,Xt:i.lineStyle,ct:i.lineWidth,lt:this.Ew,Pg:this.Qn.At().G_(),Tg:i.pointMarkersVisible?i.pointMarkersRadius||i.lineWidth/2+2:void 0})}}}let en={type:"Area",isBuiltIn:!0,defaultOptions:{topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,relativeGradient:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},wg:(t,i)=>new el(t,i)},er={visible:!0,horzAlign:"center",vertAlign:"center",lines:[]},eo={color:"rgba(0, 0, 0, 0.5)",fontSize:48,fontFamily:N,fontStyle:"",text:""};class ea{constructor(t){this.vM=new Map,this.Yt=t}draw(t){t.useMediaCoordinateSpace(t=>{if(!this.Yt.visible)return;let{context:i,mediaSize:s}=t,e=0;for(let t of this.Yt.lines){if(0===t.text.length)continue;i.font=t.k;let h=this.mM(i,t.text);h>s.width?t.eu=s.width/h:t.eu=1,e+=t.lineHeight*t.eu}let h=0;switch(this.Yt.vertAlign){case"top":h=0;break;case"center":h=Math.max((s.height-e)/2,0);break;case"bottom":h=Math.max(s.height-e,0)}for(let t of this.Yt.lines){i.save(),i.fillStyle=t.color;let e=0;switch(this.Yt.horzAlign){case"left":i.textAlign="left",e=t.lineHeight/2;break;case"center":i.textAlign="center",e=s.width/2;break;case"right":i.textAlign="right",e=s.width-1-t.lineHeight/2}i.translate(e,h),i.textBaseline="top",i.font=t.k,i.scale(t.eu,t.eu),i.fillText(t.text,0,t.wM),i.restore(),h+=t.lineHeight*t.eu}})}mM(t,i){let s=this.gM(t.font),e=s.get(i);return void 0===e&&(e=t.measureText(i).width,s.set(i,e)),e}gM(t){let i=this.vM.get(t);return void 0===i&&(i=new Map,this.vM.set(t,i)),i}}function eu(t){return{...t,k:P(t.fontSize,t.fontFamily,t.fontStyle),lineHeight:t.lineHeight||1.2*t.fontSize,wM:0,eu:0}}function ec(t){return{...t,lines:t.lines.map(eu)}}function ed(t){return{...eo,...t}}class ef{constructor(t){this.Yt=t}draw(t){t.useMediaCoordinateSpace(t=>{let i=t.context,s=this.xM(this.Yt,t.mediaSize);s&&this.Yt.SM&&(i.globalAlpha=this.Yt.alpha??1,i.drawImage(this.Yt.SM,s._t,s.ut,s.Qi,s.$t))})}xM(t,i){let{maxHeight:s,maxWidth:e,CM:h,yM:l,padding:n}=t,r=Math.round(i.width/2),o=Math.round(i.height/2),a=n??0,u=i.width-2*a,c=i.height-2*a;s&&(c=Math.min(c,s)),e&&(u=Math.min(u,e));let d=Math.min(u/l,c/h),f=l*d,p=h*d;return{_t:r-.5*f,ut:o-.5*p,$t:p,Qi:f}}}function ep(t,i,s,e){return{...t,SM:i,yM:s,CM:e}}function em(t,i){return t0(Math.min(Math.max(t,12),30)*i)}function eg(t,i){switch(t){case"arrowDown":case"arrowUp":return em(i,1);case"circle":return em(i,.8);case"square":return em(i,.7)}}function ev(t,i,s,e){let h=(eg("arrowUp",e)-1)/2*s.OM,l=(t0(e/2)-1)/2*s.OM;i.beginPath(),t?(i.moveTo(s._t-h,s.ut),i.lineTo(s._t,s.ut-h),i.lineTo(s._t+h,s.ut),i.lineTo(s._t+l,s.ut),i.lineTo(s._t+l,s.ut+h),i.lineTo(s._t-l,s.ut+h)):(i.moveTo(s._t-h,s.ut),i.lineTo(s._t,s.ut+h),i.lineTo(s._t+h,s.ut),i.lineTo(s._t+l,s.ut),i.lineTo(s._t+l,s.ut-h),i.lineTo(s._t-l,s.ut-h)),i.lineTo(s._t-l,s.ut),i.fill()}function ew(t,i,s,e,h,l){let n=(eg("arrowUp",e)-1)/2,r=(t0(e/2)-1)/2;return h>=i-r-2&&h<=i+r+2&&l>=(t?s:s-n)-2&&l<=(t?s+n:s)+2||!(h<i-n-3)&&!(h>i+n+3)&&!(l<(t?s-n-3:s))&&!(l>(t?s:s+n+3))&&Math.abs(l-s)+3>=Math.abs(h-i)/2}class eb{constructor(){this.Yt=null,this.On=new ta,this.W=-1,this.F="",this.wp=""}ht(t){this.Yt=t}Nn(t,i){this.W===t&&this.F===i||(this.W=t,this.F=i,this.wp=P(t,i),this.On.In())}jn(t,i){if(null===this.Yt||null===this.Yt.lt)return null;for(let s=this.Yt.lt.from;s<this.Yt.lt.to;
1s++){let e=this.Yt.ot[s];if(e&&(!(void 0===e.ri||!function(t,i,s,e,h,l){let n=e/2;return h>=t&&h<=t+s&&l>=i-n&&l<=i+n}(e.ri._t,e.ri.ut,e.ri.Qi,e.ri.$t,t,i))||function(t,i,s){if(0===t.zr)return!1;switch(t.WM){case"arrowDown":return ew(!0,t._t,t.ut,t.zr,i,s);case"arrowUp":return ew(!1,t._t,t.ut,t.zr,i,s);case"circle":return function(t,i,s,e,h){let l=2+eg("circle",s)/2,n=t-e,r=i-h;return Math.sqrt(n*n+r*r)<=l}(t._t,t.ut,t.zr,i,s);case"square":return function(t,i,s,e,h){let l=eg("square",s),n=(l-1)/2,r=t-n,o=i-n;return e>=r&&e<=r+l&&h>=o&&h<=o+l}(t._t,t.ut,t.zr,i,s)}}(e,t,i)))return{zOrder:"normal",externalId:e.Kn??""}}return null}draw(t){t.useBitmapCoordinateSpace(t=>{this.et(t)})}et({context:t,horizontalPixelRatio:i,verticalPixelRatio:s}){if(null!==this.Yt&&null!==this.Yt.lt){t.textBaseline="middle",t.font=this.wp;for(let e=this.Yt.lt.from;e<this.Yt.lt.to;e++){let h=this.Yt.ot[e];void 0!==h.ri&&(h.ri.Qi=this.On.Vi(t,h.ri.NM),h.ri.$t=this.W,h.ri._t=h._t-h.ri.Qi/2),function(t,i,s,e){var h,l,n;i.fillStyle=t.R,void 0!==t.ri&&(h=t.ri.NM,l=t.ri._t,n=t.ri.ut,i.save(),i.scale(s,e),i.fillText(h,l,n),i.restore()),function(t,i,s){if(0!==t.zr){switch(t.WM){case"arrowDown":return void ev(!1,i,s,t.zr);case"arrowUp":return void ev(!0,i,s,t.zr);case"circle":return void function(t,i,s){let e=(eg("circle",s)-1)/2;t.beginPath(),t.arc(i._t,i.ut,e*i.OM,0,2*Math.PI,!1),t.fill()}(i,s,t.zr);case"square":return void function(t,i,s){let e=eg("square",s),h=(e-1)*i.OM/2,l=i._t-h,n=i.ut-h;t.fillRect(l,n,e*i.OM,e*i.OM)}(i,s,t.zr)}t.WM}}(t,i,function(t,i,s){let e=Math.max(1,Math.floor(i))%2/2;return{_t:Math.round(t._t*i)+e,ut:t.ut*s,OM:i}}(t,s,e))}(h,t,i,s)}}}}function ey(t){return"atPriceTop"===t||"atPriceBottom"===t||"atPriceMiddle"===t}class eM{constructor(t,i,s,e){this.Yt=t,this.mb=i,this.wb=s,this.gb=e}draw(t){t.useBitmapCoordinateSpace(t=>{let i=t.context,s=Math.max(1,Math.floor(t.horizontalPixelRatio))%2/2,e=4*t.verticalPixelRatio+s;this.Yt.forEach(h=>{let l=Math.round(h._t*t.horizontalPixelRatio)+s;i.beginPath();let n=this.Mb(h.bb);i.fillStyle=n,i.arc(l,h.ut*t.verticalPixelRatio,e,0,2*Math.PI,!1),i.fill(),h.bb&&(i.strokeStyle=n,i.lineWidth=Math.floor(2*t.horizontalPixelRatio),i.beginPath(),i.moveTo((h._t-4.7)*t.horizontalPixelRatio+s,(h.ut-7*h.bb)*t.verticalPixelRatio),i.lineTo(h._t*t.horizontalPixelRatio+s,(h.ut-7*h.bb-7*h.bb*.5)*t.verticalPixelRatio),i.lineTo((h._t+4.7)*t.horizontalPixelRatio+s,(h.ut-7*h.bb)*t.verticalPixelRatio),i.stroke())})})}Mb(t){return 0===t?this.mb:t>0?this.gb:this.wb}}({...p})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.