sslmextop.com Open in urlscan Pro
38.165.42.43  Public Scan

Submitted URL: http://sslmextop.com/js/chunk-ee0b71fe.f3209d098a87cf8dbdea.js?v=1719210544379
Effective URL: https://sslmextop.com/js/chunk-ee0b71fe.f3209d098a87cf8dbdea.js?v=1719210544379
Submission: On October 23 via api from US — Scanned from US

Form analysis 0 forms found in the DOM

Text Content

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-ee0b71fe"],{"3e8f":function(t,e){},"5a0c":function(t,e,i){t.exports=function(){"use strict";var t=1e3,e=6e4,i=36e5,n="millisecond",r="second",a="minute",o="hour",s="day",c="week",h="month",l="quarter",u="year",f="date",d="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},y=function(t,e,i){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(i)+t},m={s:y,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),n=Math.floor(i/60),r=i%60;return(e<=0?"+":"-")+y(n,2,"0")+":"+y(r,2,"0")},m:function t(e,i){if(e.date()<i.date())return-t(i,e);var n=12*(i.year()-e.year())+(i.month()-e.month()),r=e.clone().add(n,h),a=i-r<0,o=e.clone().add(n+(a?-1:1),h);return+(-(n+(i-r)/(a?r-o:o-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:h,y:u,w:c,d:s,D:f,h:o,m:a,s:r,ms:n,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",x={},S=(x[g]=_,function(t){return t instanceof E}),k=function t(e,i,n){var r;if(!e)return g;if("string"==typeof e){var a=e.toLowerCase();x[a]&&(r=a),i&&(x[a]=i,r=a);var o=e.split("-");if(!r&&o.length>1)return t(o[0])}else{var s=e.name;x[s]=e,r=s}return!n&&r&&(g=r),r||!n&&g},b=function(t,e){if(S(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new E(i)},w=m,E=(w.l=k,w.i=S,w.w=function(t,e){return b(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})},function(){function _(t){this.$L=k(t.locale,null,!0),this.parse(t)}var y=_.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(w.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(v);if(n){var r=n[2]-1||0,a=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,a)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return w},y.isValid=function(){return!(this.$d.toString()===d)},y.isSame=function(t,e){var i=b(t);return this.startOf(e)<=i&&i<=this.endOf(e)},y.isAfter=function(t,e){return b(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<b(t)},y.$g=function(t,e,i){return w.u(t)?this[e]:this.set(i,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var i=this,n=!!w.u(e)||e,l=w.p(t),d=function(t,e){var r=w.w(i.$u?Date.UTC(i.$y,e,t):new Date(i.$y,e,t),i);return n?r:r.endOf(s)},v=function(t,e){return w.w(i.toDate()[t].apply(i.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),i)},p=this.$W,_=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(l){case u:return n?d(1,0):d(31,11);case h:return n?d(1,_):d(0,_+1);case c:var g=this.$locale().weekStart||0,x=(p<g?p+7:p)-g;return d(n?y-x:y+(6-x),_);case s:case f:return v(m+"Hours",0);case o:return v(m+"Minutes",1);case a:return v(m+"Seconds",2);case r:return v(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var i,c=w.p(t),l="set"+(this.$u?"UTC":""),d=(i={},i[s]=l+"Date",i[f]=l+"Date",i[h]=l+"Month",i[u]=l+"FullYear",i[o]=l+"Hours",i[a]=l+"Minutes",i[r]=l+"Seconds",i[n]=l+"Milliseconds",i)[c],v=c===s?this.$D+(e-this.$W):e;if(c===h||c===u){var p=this.clone().set(f,1);p.$d[d](v),p.init(),this.$d=p.set(f,Math.min(this.$D,p.daysInMonth())).$d}else d&&this.$d[d](v);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[w.p(t)]()},y.add=function(n,l){var f,d=this;n=Number(n);var v=w.p(l),p=function(t){var e=b(d);return w.w(e.date(e.date()+Math.round(t*n)),d)};if(v===h)return this.set(h,this.$M+n);if(v===u)return this.set(u,this.$y+n);if(v===s)return p(1);if(v===c)return p(7);var _=(f={},f[a]=e,f[o]=i,f[r]=t,f)[v]||1,y=this.$d.getTime()+n*_;return w.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,i=this.$locale();if(!this.isValid())return i.invalidDate||d;var n=t||"YYYY-MM-DDTHH:mm:ssZ",r=w.z(this),a=this.$H,o=this.$m,s=this.$M,c=i.weekdays,h=i.months,l=function(t,i,r,a){return t&&(t[i]||t(e,n))||r[i].slice(0,a)},u=function(t){return w.s(a%12||12,t,"0")},f=i.meridiem||function(t,e,i){var n=t<12?"AM":"PM";return i?n.toLowerCase():n},v={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:w.s(s+1,2,"0"),MMM:l(i.monthsShort,s,h,3),MMMM:l(h,s),D:this.$D,DD:w.s(this.$D,2,"0"),d:String(this.$W),dd:l(i.weekdaysMin,this.$W,c,2),ddd:l(i.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(a),HH:w.s(a,2,"0"),h:u(1),hh:u(2),a:f(a,o,!0),A:f(a,o,!1),m:String(o),mm:w.s(o,2,"0"),s:String(this.$s),ss:w.s(this.$s,2,"0"),SSS:w.s(this.$ms,3,"0"),Z:r};return n.replace(p,(function(t,e){return e||v[t]||r.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,f,d){var v,p=w.p(f),_=b(n),y=(_.utcOffset()-this.utcOffset())*e,m=this-_,g=w.m(this,_);return g=(v={},v[u]=g/12,v[h]=g,v[l]=g/3,v[c]=(m-y)/6048e5,v[s]=(m-y)/864e5,v[o]=m/i,v[a]=m/e,v[r]=m/t,v)[p]||m,d?g:w.a(g)},y.daysInMonth=function(){return this.endOf(h).$D},y.$locale=function(){return x[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var i=this.clone(),n=k(t,e,!0);return n&&(i.$L=n),i},y.clone=function(){return w.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},_}()),P=E.prototype;return b.prototype=P,[["$ms",n],["$s",r],["$m",a],["$H",o],["$W",s],["$M",h],["$y",u],["$D",f]].forEach((function(t){P[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),b.extend=function(t,e){return t.$i||(t(e,E,b),t.$i=!0),b},b.locale=k,b.isDayjs=S,b.unix=function(t){return b(1e3*t)},b.en=x[g],b.Ls=x,b.p={},b}()},"68f9":function(t,e,i){
/**
 * @license
 * KLineChart v8.6.3
 * Copyright (c) 2019 lihu.
 * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
 */
t.exports=function(){"use strict";var t={name:"BBI",shortName:"BBI",series:"price",precision:2,calcParams:[3,6,12,24],shouldCheckParamCount:!0,shouldOhlc:!0,plots:[{key:"bbi",title:"BBI: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=Math.max.apply(null,i),r=[],a=[];return t.map((function(e,o){var s={},c=e.close;if(i.forEach((function(e,i){r[i]=(r[i]||0)+c,e-1>o||(a[i]=r[i]/e,r[i]-=t[o-(e-1)].close)})),o>=n-1){var h=0;a.forEach((function(t){h+=t})),s.bbi=h/4}return s}))}},e={name:"DMA",shortName:"DMA",calcParams:[10,50,10],plots:[{key:"dma",title:"DMA: ",type:"line"},{key:"ama",title:"AMA: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=Math.max(i[0],i[1]),r=0,a=0,o=0,s=[];return t.forEach((function(e,c){var h,l,u={},f=e.close;if(r+=f,a+=f,i[0]-1>c||(h=r/i[0],r-=t[c-(i[0]-1)].close),i[1]-1>c||(l=a/i[1],a-=t[c-(i[1]-1)].close),c>=n-1){var d=h-l;u.dma=d,o+=d,n+i[2]-2>c||(u.ama=o/i[2],o-=s[c-(i[2]-1)].dma)}s.push(u)})),s}},i={name:"DMI",shortName:"DMI",calcParams:[14,6],plots:[{key:"pdi",title:"PDI: ",type:"line"},{key:"mdi",title:"MDI: ",type:"line"},{key:"adx",title:"ADX: ",type:"line"},{key:"adxr",title:"ADXR: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=0,r=0,a=0,o=0,s=0,c=0,h=0,l=0,u=[];return t.forEach((function(e,f){var d={},v=t[f-1]||e,p=v.close,_=e.high,y=e.low,m=_-y,g=Math.abs(_-p),x=Math.abs(p-y),S=_-v.high,k=v.low-y,b=Math.max(Math.max(m,g),x),w=S>0&&S>k?S:0,E=k>0&&k>S?k:0;if(n+=b,r+=w,a+=E,f>=i[0]-1){f>i[0]-1?(o=o-o/i[0]+b,s=s-s/i[0]+w,c=c-c/i[0]+E):(o=n,s=r,c=a);var P=0,A=0;0!==o&&(P=100*s/o,A=100*c/o),d.pdi=P,d.mdi=A;var C=0;A+P!==0&&(C=Math.abs(A-P)/(A+P)*100),h+=C,2*i[0]-2>f||(d.adx=l=f>2*i[0]-2?(l*(i[0]-1)+C)/i[0]:h/i[0],2*i[0]+i[1]-3>f||(d.adxr=(u[f-(i[1]-1)].adx+l)/2))}u.push(d)})),u}},n={name:"MACD",shortName:"MACD",calcParams:[12,26,9],plots:[{key:"dif",title:"DIF: ",type:"line"},{key:"dea",title:"DEA: ",type:"line"},{key:"macd",title:"MACD: ",type:"bar",baseValue:0,color:function(t,e){var i=(t.current.technicalIndicatorData||{}).macd;return i>0?e.bar.upColor:0>i?e.bar.downColor:e.bar.noChangeColor},isStroke:function(t){return(t.current.technicalIndicatorData||{}).macd>(t.prev.technicalIndicatorData||{}).macd}}],calcTechnicalIndicator:function(t,e){var i,n,r=e.params,a=0,o=0,s=0,c=0,h=Math.max(r[0],r[1]);return t.map((function(t,e){var l={},u=t.close;return a+=u,r[0]-1>e||(i=e>r[0]-1?(2*u+(r[0]-1)*i)/(r[0]+1):a/r[0]),r[1]-1>e||(n=e>r[1]-1?(2*u+(r[1]-1)*n)/(r[1]+1):a/r[1]),h-1>e||(l.dif=o=i-n,s+=o,h+r[2]-2>e||(l.macd=2*(o-(c=e>h+r[2]-2?(2*o+c*(r[2]-1))/(r[2]+1):s/r[2])),l.dea=c)),l}))}},r={name:"CR",shortName:"CR",calcParams:[26,10,20,40,60],plots:[{key:"cr",title:"CR: ",type:"line"},{key:"ma1",title:"MA1: ",type:"line"},{key:"ma2",title:"MA2: ",type:"line"},{key:"ma3",title:"MA3: ",type:"line"},{key:"ma4",title:"MA4: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=Math.ceil(i[1]/2.5+1),r=Math.ceil(i[2]/2.5+1),a=Math.ceil(i[3]/2.5+1),o=Math.ceil(i[4]/2.5+1),s=0,c=[],h=0,l=[],u=0,f=[],d=0,v=[],p=[];return t.forEach((function(e,_){var y={},m=t[_-1]||e,g=(m.high+m.close+m.low+m.open)/4,x=Math.max(0,e.high-g),S=Math.max(0,g-e.low);i[0]-1>_||(y.cr=0!==S?x/S*100:0,s+=y.cr,h+=y.cr,u+=y.cr,d+=y.cr,i[0]+i[1]-2>_||(c.push(s/i[1]),i[0]+i[1]+n-3>_||(y.ma1=c[c.length-1-n]),s-=p[_-(i[1]-1)].cr),i[0]+i[2]-2>_||(l.push(h/i[2]),i[0]+i[2]+r-3>_||(y.ma2=l[l.length-1-r]),h-=p[_-(i[2]-1)].cr),i[0]+i[3]-2>_||(f.push(u/i[3]),i[0]+i[3]+a-3>_||(y.ma3=f[f.length-1-a]),u-=p[_-(i[3]-1)].cr),i[0]+i[4]-2>_||(v.push(d/i[4]),i[0]+i[4]+o-3>_||(y.ma4=v[v.length-1-o]),d-=p[_-(i[4]-1)].cr)),p.push(y)})),p}},a={name:"AO",shortName:"AO",calcParams:[5,34],shouldCheckParamCount:!0,plots:[{key:"ao",title:"AO: ",type:"bar",baseValue:0,color:function(t,e){return(t.current.technicalIndicatorData||{}).ao>(t.prev.technicalIndicatorData||{}).ao?e.bar.upColor:e.bar.downColor},isStroke:function(t){return(t.current.technicalIndicatorData||{}).ao>(t.prev.technicalIndicatorData||{}).ao}}],calcTechnicalIndicator:function(t,e){var i=e.params,n=Math.max(i[0],i[1]),r=0,a=0,o=0,s=0;return t.map((function(e,c){var h={},l=(e.low+e.high)/2;if(r+=l,a+=l,c>=i[0]-1){o=r/i[0];var u=t[c-(i[0]-1)];r-=(u.low+u.high)/2}if(c>=i[1]-1){s=a/i[1];var f=t[c-(i[1]-1)];a-=(f.low+f.high)/2}return n-1>c||(h.ao=o-s),h}))}},o={name:"CCI",shortName:"CCI",calcParams:[20],plots:[{key:"cci",title:"CCI: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=i[0]-1,r=0,a=[];return t.map((function(e,o){var s={},c=(e.high+e.low+e.close)/3;if(r+=c,a.push(c),o>=n){var h=r/i[0],l=a.slice(o-n,o+1),u=0;l.forEach((function(t){u+=Math.abs(t-h)}));var f=u/i[0];s.cci=0!==f?(c-h)/f/.015:0,r-=(t[o-n].high+t[o-n].low+t[o-n].close)/3}return s}))}},s={name:"RSI",shortName:"RSI",calcParams:[6,12,24],shouldCheckParamCount:!1,plots:[{key:"rsi1",title:"RSI1: ",type:"line"},{key:"rsi2",title:"RSI2: ",type:"line"},{key:"rsi3",title:"RSI3: ",type:"line"}],regeneratePlots:function(t){return t.map((function(t,e){var i=e+1;return{key:"rsi".concat(i),title:"RSI".concat(i,": "),type:"line"}}))},calcTechnicalIndicator:function(t,e){var i=e.params,n=e.plots,r=[],a=[];return t.map((function(e,o){var s={},c=e.close-(t[o-1]||e).close;return i.forEach((function(e,i){if(c>0?r[i]=(r[i]||0)+c:a[i]=(a[i]||0)+Math.abs(c),o>=e-1){s[n[i].key]=0!==a[i]?100-100/(1+r[i]/a[i]):0;var h=t[o-(e-1)],l=h.close-(t[o-e]||h).close;l>0?r[i]-=l:a[i]-=Math.abs(l)}})),s}))}};function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=Number.MIN_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER;return t.forEach((function(t){e=Math.max(t.high,e),i=Math.min(t.low,i)})),{hn:e,ln:i}}var h={name:"KDJ",shortName:"KDJ",calcParams:[9,3,3],plots:[{key:"k",title:"K: ",type:"line"},{key:"d",title:"D: ",type:"line"},{key:"j",title:"J: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=[];return t.forEach((function(e,r){var a={},o=e.close;if(r>=i[0]-1){var s=c(t.slice(r-(i[0]-1),r+1)),h=s.ln,l=s.hn-h;a.k=((i[1]-1)*(n[r-1].k||50)+(o-h)/(0===l?1:l)*100)/i[1],a.d=((i[2]-1)*(n[r-1].d||50)+a.k)/i[2],a.j=3*a.k-2*a.d}n.push(a)})),n}},l={name:"WR",shortName:"WR",calcParams:[6,10,14],shouldCheckParamCount:!1,plots:[{key:"wr1",title:"WR1: ",type:"line"},{key:"wr2",title:"WR2: ",type:"line"},{key:"wr3",title:"WR3: ",type:"line"}],regeneratePlots:function(t){return t.map((function(t,e){return{key:"wr".concat(e+1),title:"WR".concat(e+1,": "),type:"line"}}))},calcTechnicalIndicator:function(t,e){var i=e.params,n=e.plots;return t.map((function(e,r){var a={},o=e.close;return i.forEach((function(e,i){var s=e-1;if(r>=s){var h=c(t.slice(r-s,r+1)),l=h.hn,u=l-h.ln;a[n[i].key]=0===u?0:(o-l)/u*100}})),a}))}},u={name:"BOLL",shortName:"BOLL",series:"price",calcParams:[20,{value:2,allowDecimal:!0}],precision:2,shouldOhlc:!0,plots:[{key:"up",title:"UP: ",type:"line"},{key:"mid",title:"MID: ",type:"line"},{key:"dn",title:"DN: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=i[0]-1,r=0;return t.map((function(e,a){var o={};if(r+=e.close,a>=n){o.mid=r/i[0];var s=function(t,e){var i=t.length,n=0;t.forEach((function(t){var i=t.close-e;n+=i*i}));var r=n>0,a=Math.sqrt((n=Math.abs(n))/i);return r?a:-1*a}(t.slice(a-n,a+1),o.mid);o.up=o.mid+i[1]*s,o.dn=o.mid-i[1]*s,r-=t[a-n].close}return o}))}},f={name:"SAR",shortName:"SAR",series:"price",calcParams:[2,2,20],precision:2,shouldOhlc:!0,plots:[{key:"sar",title:"SAR: ",type:"circle",color:function(t,e){var i=t.current,n=i.kLineData||{};return(n.high+n.low)/2>(i.technicalIndicatorData||{}).sar?e.circle.upColor:e.circle.downColor}}],calcTechnicalIndicator:function(t,e){var i=e.params,n=i[0]/100,r=i[1]/100,a=i[2]/100,o=n,s=-100,c=!1,h=0;return t.map((function(e,i){var l=h,u=e.high,f=e.low;if(c){(-100===s||u>s)&&(s=u,o=Math.min(o+r,a)),h=l+o*(s-l);var d=Math.min(t[Math.max(1,i)-1].low,f);h>e.low?(h=s,o=n,s=-100,c=!c):h>d&&(h=d)}else{(-100===s||s>f)&&(s=f,o=Math.min(o+r,a)),h=l+o*(s-l);var v=Math.max(t[Math.max(1,i)-1].high,u);e.high>h?(h=s,o=0,s=-100,c=!c):v>h&&(h=v)}return{sar:h}}))}},d={technicalIndicatorExtensions:{},shapeExtensions:{},addTechnicalIndicatorTemplate:function(t){var e=this;t&&[].concat(t).forEach((function(t){t.name&&(e.technicalIndicatorExtensions[t.name]=t)}))},addShapeTemplate:function(t){var e=this;t&&[].concat(t).forEach((function(t){t.name&&(e.shapeExtensions[t.name]=t)}))}};function v(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var i=0;e.length>i;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _(t,e,i){return e&&p(t.prototype,e),i&&p(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function m(t,e){if(k(t)&&k(e))for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&i in t){var n=t[i],r=e[i];k(r)&&k(n)&&!x(r)&&!x(n)?m(n,r):w(e[i])&&(t[i]=e[i])}}function g(t){if(!k(t))return t;var e;for(var i in e=x(t)?[]:{},t)if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];e[i]=k(n)?g(n):n}return e}function x(t){return"[object Array]"===Object.prototype.toString.call(t)}function S(t){return t&&"function"==typeof t}function k(t){return!!t&&"object"===y(t)}function b(t){return"number"==typeof t&&!isNaN(t)}function w(t){return null!=t}function E(t){return"boolean"==typeof t}function P(t){return"string"==typeof t}var A="stroke",C="fill",M="dash",I="solid",O="left",T="right",D="normal",R="percentage",L="log",F="candle_solid",B="candle_stroke",z="candle_up_stroke",V="candle_down_stroke",H="ohlc",j="area",N="always",Y="follow_cross",W="rect",$="standard",X="circle",G="rect",U="triangle",Z="diamond",K="custom",q="point",J="top",Q="bottom",tt={grid:{show:!0,horizontal:{show:!0,size:1,color:"#EDEDED",style:M,dashValue:[2,2]},vertical:{show:!0,size:1,color:"#EDEDED",style:M,dashValue:[2,2]}},candle:{margin:{top:.2,bottom:.1},type:F,bar:{upColor:"#26A69A",downColor:"#EF5350",noChangeColor:"#999999"},area:{lineSize:2,lineColor:"#2196F3",value:"close",backgroundColor:[{offset:0,color:"rgba(33, 150, 243, 0.01)"},{offset:1,color:"rgba(33, 150, 243, 0.2)"}]},priceMark:{show:!0,high:{show:!0,color:"#76808F",textMargin:5,textSize:10,textFamily:"Helvetica Neue",textWeight:"normal"},low:{show:!0,color:"#76808F",textMargin:5,textSize:10,textFamily:"Helvetica Neue",textWeight:"normal"},last:{show:!0,upColor:"#26A69A",downColor:"#EF5350",noChangeColor:"#888888",line:{show:!0,style:M,dashValue:[4,4],size:1},text:{show:!0,size:12,paddingLeft:2,paddingTop:2,paddingRight:2,paddingBottom:2,color:"#FFFFFF",family:"Helvetica Neue",weight:"normal",borderRadius:2}}},tooltip:{showRule:N,showType:$,labels:["时间: ","开: ","收: ","高: ","低: ","成交量: "],values:null,defaultValue:"n/a",rect:{paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:6,offsetLeft:8,offsetTop:8,offsetRight:8,borderRadius:4,borderSize:1,borderColor:"#F2F3F5",backgroundColor:"#FEFEFE"},text:{size:12,family:"Helvetica Neue",weight:"normal",color:"#76808F",marginLeft:8,marginTop:6,marginRight:8,marginBottom:0}}},technicalIndicator:{margin:{top:.2,bottom:.1},bar:{upColor:"rgba(38, 166, 154, .65)",downColor:"rgba(239, 83, 80, .65)",noChangeColor:"#888888"},line:{size:1,dashValue:[2,2],colors:["#FF9600","#9D65C9","#2196F3","#E11D74","#01C5C4"]},circle:{upColor:"rgba(38, 166, 154, .65)",downColor:"rgba(239, 83, 80, .65)",noChangeColor:"#888888"},lastValueMark:{show:!1,text:{show:!1,color:"#FFFFFF",size:12,family:"Helvetica Neue",weight:"normal",paddingLeft:3,paddingTop:2,paddingRight:3,paddingBottom:2,borderRadius:2}},tooltip:{showRule:N,showType:$,showName:!0,showParams:!0,defaultValue:"n/a",text:{size:12,family:"Helvetica Neue",weight:"normal",color:"#76808F",marginTop:6,marginRight:8,marginBottom:0,marginLeft:8}}},xAxis:{show:!0,height:null,axisLine:{show:!0,color:"#DDDDDD",size:1},tickText:{show:!0,color:"#76808F",size:12,family:"Helvetica Neue",weight:"normal",paddingTop:3,paddingBottom:6},tickLine:{show:!0,size:1,length:3,color:"#DDDDDD"}},yAxis:{show:!0,width:null,type:D,position:T,inside:!1,reverse:!1,axisLine:{show:!0,color:"#DDDDDD",size:1},tickText:{show:!0,color:"#76808F",size:12,family:"Helvetica Neue",weight:"normal",paddingLeft:3,paddingRight:6},tickLine:{show:!0,size:1,length:3,color:"#DDDDDD"}},separator:{size:1,color:"#DDDDDD",fill:!0,activeBackgroundColor:"rgba(33, 150, 243, 0.08)"},crosshair:{show:!0,horizontal:{show:!0,line:{show:!0,style:M,dashValue:[4,2],size:1,color:"#76808F"},text:{show:!0,color:"#FFFFFF",size:12,family:"Helvetica Neue",weight:"normal",paddingLeft:2,paddingRight:2,paddingTop:2,paddingBottom:2,borderSize:1,borderColor:"#686D76",borderRadius:2,backgroundColor:"#686D76"}},vertical:{show:!0,line:{show:!0,style:M,dashValue:[4,2],size:1,color:"#76808F"},text:{show:!0,color:"#FFFFFF",size:12,family:"Helvetica Neue",weight:"normal",paddingLeft:2,paddingRight:2,paddingTop:2,paddingBottom:2,borderSize:1,borderRadius:2,borderColor:"#686D76",backgroundColor:"#686D76"}}},shape:{point:{backgroundColor:"#2196F3",borderColor:"rgba(33, 150, 243, 0.35)",borderSize:1,radius:5,activeBackgroundColor:"#2196F3",activeBorderColor:"rgba(33, 150, 243, 0.35)",activeBorderSize:3,activeRadius:5},line:{style:I,color:"#2196F3",size:1,dashValue:[2,2]},polygon:{style:A,stroke:{style:I,size:1,color:"#2196F3",dashValue:[2,2]},fill:{color:"#2196F3"}},arc:{style:A,stroke:{style:I,size:1,color:"#2196F3",dashValue:[2,2]},fill:{color:"#2196F3"}},text:{style:C,color:"#2196F3",size:12,family:"Helvetica Neue",weight:"normal",offset:[0,0]}},annotation:{position:J,offset:[20,0],symbol:{type:Z,size:8,color:"#2196F3",activeSize:10,activeColor:"#FF9600"}},tag:{position:q,offset:0,line:{show:!0,style:M,dashValue:[4,2],size:1,color:"#2196F3"},text:{color:"#FFFFFF",backgroundColor:"#2196F3",size:12,family:"Helvetica Neue",weight:"normal",paddingLeft:2,paddingRight:2,paddingTop:2,paddingBottom:2,borderRadius:2,borderSize:1,borderColor:"#2196F3"},mark:{offset:0,color:"#FFFFFF",backgroundColor:"#2196F3",size:12,family:"Helvetica Neue",weight:"normal",paddingLeft:2,paddingRight:2,paddingTop:2,paddingBottom:2,borderRadius:2,borderSize:1,borderColor:"#2196F3"}}};function et(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"--";if(k(t)){var n=t[e];if(w(n))return n}return i}function it(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MM-DD hh:mm";if(b(e)){var n=t.format(new Date(e)),r=n.split(", "),a=r[0].split("/"),o={YYYY:a[2],MM:a[0],DD:a[1],"hh:mm":"24"===r[1].match(/^[\d]{2}/)[0]?r[1].replace(/^[\d]{2}/,"00"):r[1]};return i.replace(/YYYY|MM|DD|(hh:mm)/g,(function(t){return o[t]}))}return"--"}function nt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=+t;return(i||0===i)&&b(i)?i.toFixed(e):"".concat(i)}function rt(t){return b(+t)?t>1e9?"".concat(+(t/1e9).toFixed(3),"B"):t>1e6?"".concat(+(t/1e6).toFixed(3),"M"):t>1e3?"".concat(+(t/1e3).toFixed(3),"K"):t:"--"}function at(t,e,i){var n=0,r=0;for(r=t.length-1;n!==r;){var a=Math.floor((r+n)/2),o=r-n,s=t[a][e];if(i===t[n][e])return n;if(i===t[r][e])return r;if(i===s)return a;if(i>s?n=a:r=a,2>=o)break}return n}function ot(t,e){return null==e&&(e=10),+(t=(+t).toFixed(e=Math.min(Math.max(0,e),20)))}function st(t){return Math.log(t)/Math.log(10)}function ct(t){return Math.pow(10,t)}var ht={ZOOM:"zoom",SCROLL:"scroll",CROSSHAIR:"crosshair",TOOLTIP:"tooltip",PANE_DRAG:"pane_drag"};function lt(t){return Object.values(ht).indexOf(t)>-1}var ut=function(){function t(e){v(this,t),this._chartStore=e,this._dateTimeFormat=new Intl.DateTimeFormat("en",{hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),this._zoomEnabled=!0,this._scrollEnabled=!0,this._loading=!0,this._loadMoreCallback=null,this._more=!0,this._totalDataSpace=0,this._dataSpace=6,this._barSpace=this._calcBarSpace(),this._offsetRightSpace=50,this._offsetRightBarCount=this._offsetRightSpace/this._dataSpace,this._leftMinVisibleBarCount=2,this._rightMinVisibleBarCount=2,this._from=0,this._to=0,this._preOffsetRightBarCount=0}return _(t,[{key:"_calcBarSpace",value:function(){return Math.max(1,Math.min(Math.floor(.82*this._dataSpace),Math.floor(this._dataSpace)-1))}},{key:"adjustFromTo",value:function(){var t=this._chartStore.dataList().length,e=this._totalDataSpace/this._dataSpace,i=e-Math.min(this._leftMinVisibleBarCount,t);this._offsetRightBarCount>i&&(this._offsetRightBarCount=i);var n=-t+Math.min(this._rightMinVisibleBarCount,t);n>this._offsetRightBarCount&&(this._offsetRightBarCount=n),this._to=Math.round(this._offsetRightBarCount+t+.5),this._from=Math.round(this._to-e)-1,this._to>t&&(this._to=t),0>this._from&&(this._from=0),this._chartStore.adjustVisibleDataList(),0===this._from&&this._more&&!this._loading&&S(this._loadMoreCallback)&&(this._loading=!0,this._loadMoreCallback(et(this._chartStore.dataList()[0],"timestamp")))}},{key:"setMore",value:function(t){this._more=t}},{key:"setLoading",value:function(t){this._loading=t}},{key:"dateTimeFormat",value:function(){return this._dateTimeFormat}},{key:"setTimezone",value:function(t){var e;try{e=new Intl.DateTimeFormat("en",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch(t){}e&&(this._dateTimeFormat=e)}},{key:"timezone",value:function(){return this._dateTimeFormat.resolvedOptions().timeZone}},{key:"dataSpace",value:function(){return this._dataSpace}},{key:"barSpace",value:function(){return this._barSpace}},{key:"halfBarSpace",value:function(){return this._barSpace/2}},{key:"setDataSpace",value:function(t,e){1>t||t>50||this._dataSpace===t||(this._dataSpace=t,this._barSpace=this._calcBarSpace(),e&&e(),this.adjustFromTo(),this._chartStore.crosshairStore().recalculate(!0),this._chartStore.invalidate())}},{key:"setTotalDataSpace",value:function(t){this._totalDataSpace!==t&&(this._totalDataSpace=t,this.adjustFromTo(),this._chartStore.crosshairStore().recalculate(!0))}},{key:"setOffsetRightSpace",value:function(t,e){this._offsetRightSpace=t,this._offsetRightBarCount=t/this._dataSpace,e&&(this.adjustFromTo(),this._chartStore.crosshairStore().recalculate(!0),this._chartStore.invalidate())}},{key:"resetOffsetRightSpace",value:function(){this.setOffsetRightSpace(this._offsetRightSpace)}},{key:"offsetRightSpace",value:function(){return this._offsetRightSpace}},{key:"offsetRightBarCount",value:function(){return this._offsetRightBarCount}},{key:"setOffsetRightBarCount",value:function(t){this._offsetRightBarCount=t}},{key:"setLeftMinVisibleBarCount",value:function(t){this._leftMinVisibleBarCount=t}},{key:"setRightMinVisibleBarCount",value:function(t){this._rightMinVisibleBarCount=t}},{key:"from",value:function(){return this._from}},{key:"to",value:function(){return this._to}},{key:"startScroll",value:function(){this._preOffsetRightBarCount=this._offsetRightBarCount}},{key:"scroll",value:function(t,e){if(this._scrollEnabled){var i=t/this._dataSpace;this._chartStore.actionStore().execute(ht.SCROLL,{barCount:i,distance:t}),this._offsetRightBarCount=this._preOffsetRightBarCount-i,this.adjustFromTo();var n=e||this._chartStore.crosshairStore().get();this._chartStore.crosshairStore().set(n,!0),this._chartStore.invalidate()}}},{key:"getDataByDataIndex",value:function(t){return this._chartStore.dataList()[t]}},{key:"coordinateToFloatIndex",value:function(t){var e=this._chartStore.dataList().length;return Math.round(1e6*(e+this._offsetRightBarCount-(this._totalDataSpace-t)/this._dataSpace))/1e6}},{key:"dataIndexToTimestamp",value:function(t){var e=this.getDataByDataIndex(t);if(e)return e.timestamp}},{key:"timestampToDataIndex",value:function(t){return 0===this._chartStore.dataList().length?0:at(this._chartStore.dataList(),"timestamp",t)}},{key:"dataIndexToCoordinate",value:function(t){var e=this._chartStore.dataList().length;return this._totalDataSpace-(e+this._offsetRightBarCount-t-.5)*this._dataSpace}},{key:"coordinateToDataIndex",value:function(t){return Math.ceil(this.coordinateToFloatIndex(t))-1}},{key:"zoom",value:function(t,e){var i=this;if(this._zoomEnabled){if(!e||!w(e.x)){var n=this._chartStore.crosshairStore().get();e={x:w(n.x)?n.x:this._totalDataSpace/2}}this._chartStore.actionStore().execute(ht.ZOOM,{coordinate:e,scale:t});var r=this.coordinateToFloatIndex(e.x);this.setDataSpace(this._dataSpace+t*(this._dataSpace/10),(function(){i._offsetRightBarCount+=r-i.coordinateToFloatIndex(e.x)}))}}},{key:"setZoomEnabled",value:function(t){this._zoomEnabled=t}},{key:"zoomEnabled",value:function(){return this._zoomEnabled}},{key:"setScrollEnabled",value:function(t){this._scrollEnabled=t}},{key:"scrollEnabled",value:function(){return this._scrollEnabled}},{key:"setLoadMoreCallback",value:function(t){this._loadMoreCallback=t}},{key:"clear",value:function(){this._more=!0,this._loading=!0,this._from=0,this._to=0}}]),t}();function ft(t,e){return ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ft(t,e)}function dt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ft(t,e)}function vt(t,e){if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function pt(t){return pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pt(t)}function _t(t,e,i,n,r,a,o){try{var s=t[a](o),c=s.value}catch(t){return void i(t)}s.done?e(c):Promise.resolve(c).then(n,r)}var yt={exports:{}},mt={exports:{}},gt=mt;function xt(t){return gt.exports=xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt.exports.__esModule=!0,gt.exports.default=gt.exports,xt(t)}gt.exports=xt,gt.exports.__esModule=!0,gt.exports.default=gt.exports;var St=yt,kt=mt.exports.default;function bt(){St.exports=bt=function(){return t},St.exports.__esModule=!0,St.exports.default=St.exports;var t={},e=Object.prototype,i=e.hasOwnProperty,n=Object.defineProperty||function(t,e,i){t[e]=i.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,i){return t[e]=i}}function h(t,e,i,r){var a=Object.create((e&&e.prototype instanceof f?e:f).prototype),o=new E(r||[]);return n(a,"_invoke",{value:S(t,i,o)}),a}function l(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var u={};function f(){}function d(){}function v(){}var p={};c(p,a,(function(){return this}));var _=Object.getPrototypeOf,y=_&&_(_(P([])));y&&y!==e&&i.call(y,a)&&(p=y);var m=v.prototype=f.prototype=Object.create(p);function g(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(n,a,o,s){var c=l(t[n],t,a);if("throw"!==c.type){var h=c.arg,u=h.value;return u&&"object"==kt(u)&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,o,s)}),(function(t){r("throw",t,o,s)})):e.resolve(u).then((function(t){h.value=t,o(h)}),(function(t){return r("throw",t,o,s)}))}s(c.arg)}var a;n(this,"_invoke",{value:function(t,i){function n(){return new e((function(e,n){r(t,i,e,n)}))}return a=a?a.then(n,n):n()}})}function S(t,e,i){var n="suspendedStart";return function(r,a){if("executing"===n)throw Error("Generator is already running");if("completed"===n){if("throw"===r)throw a;return A()}for(i.method=r,i.arg=a;;){var o=i.delegate;if(o){var s=k(o,i);if(s){if(s===u)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var c=l(t,e,i);if("normal"===c.type){if(n=i.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(n="completed",i.method="throw",i.arg=c.arg)}}}function k(t,e){var i=t.iterator[e.method];if(void 0===i){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,k(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var n=l(i,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,u;var r=n.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(i.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:A}}function A(){return{value:void 0,done:!0}}return d.prototype=v,n(m,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:d,configurable:!0}),d.displayName=c(v,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(x.prototype),c(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,i,n,r,a){void 0===a&&(a=Promise);var o=new x(h(e,i,n,r),a);return t.isGeneratorFunction(i)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},g(m),c(m,s,"Generator"),c(m,a,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=P,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(i,n){return o.type="throw",o.arg=t,e.next=i,n&&(e.method="next",e.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],o=a.completion;if("root"===a.tryLoc)return n("end");if(this.prev>=a.tryLoc){var s=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(s&&c){if(a.catchLoc>this.prev)return n(a.catchLoc,!0);if(a.finallyLoc>this.prev)return n(a.finallyLoc)}else if(s){if(a.catchLoc>this.prev)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(a.finallyLoc>this.prev)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&i.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var a=r;break}}a&&("break"===t||"continue"===t)&&e>=a.tryLoc&&a.finallyLoc>=e&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,u):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),w(i),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;w(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,e,i){return this.delegate={iterator:P(t),resultName:e,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},t}St.exports=bt,St.exports.__esModule=!0,St.exports.default=St.exports;var wt=yt.exports(),Et=wt;try{regeneratorRuntime=wt}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=wt:Function("r","regeneratorRuntime = r")(wt)}var Pt="line",At="bar",Ct="circle",Mt={PRICE:"price",VOLUME:"volume",NORMAL:"normal"};function It(t,e,i,n,r,a){var o=a.color,s=a.isStroke,c=a.isDashed,h={prev:{kLineData:t[i-1],technicalIndicatorData:e[i-1]},current:{kLineData:t[i],technicalIndicatorData:e[i]},next:{kLineData:t[i+1],technicalIndicatorData:e[i+1]}};return w(n.color)&&(o=S(n.color)?n.color(h,r)||a.color:n.color||a.color),w(n.isStroke)&&(s=S(n.isStroke)?n.isStroke(h):n.isStroke),w(n.isDashed)&&(c=S(n.isDashed)?n.isDashed(h):n.isDashed),{color:o,isStroke:s,isDashed:c}}var Ot=function(){function t(e){var i=e.name,n=e.shortName,r=e.series,a=e.calcParams,o=e.plots,s=e.precision,c=e.shouldCheckParamCount,h=e.shouldOhlc,l=e.shouldFormatBigNumber,u=e.minValue,f=e.maxValue,d=e.styles,p=e.extendData;v(this,t),this.name=i||"",this.shortName=w(n)?n:i,this.series=-1!==Object.values(Mt).indexOf(r)?r:Mt.NORMAL,this.precision=b(s)&&s>=0?s:4,this._precisionFlag=!1,this.calcParams=x(a)?a:[],this.plots=x(o)?o:[],this.shouldCheckParamCount=!E(c)||c,this.shouldOhlc=!!E(h)&&h,this.shouldFormatBigNumber=!!E(l)&&l,this.minValue=u,this.maxValue=f,this.styles=d,this.extendData=p,this.result=[]}var e,i;return _(t,[{key:"_createParams",value:function(t){return t.map((function(t){return k(t)?t.value:t}))}},{key:"setShortName",value:function(t){return!(!w(t)||this.shortName===t)&&(this.shortName=t,!0)}},{key:"setPrecision",value:function(t,e){return!(!b(t)||0>t||e&&(!e||this._precisionFlag))&&(this.precision=parseInt(t,10),e||(this._precisionFlag=!0),!0)}},{key:"setCalcParams",value:function(t){if(!x(t))return!1;if(this.shouldCheckParamCount&&t.length!==this.calcParams.length)return!1;for(var e=[],i=0;t.length>i;i++){var n=t[i],r=void 0,a=void 0;k(n)?(r=n.value,a=n.allowDecimal):(r=n,a=!1);var o=this.calcParams[i];if(k(o)&&E(o.allowDecimal)&&(a=o.allowDecimal),!b(r)||!a&&parseInt(r,10)!==r)return!1;e.push({allowDecimal:a,value:r})}this.calcParams=e;var s=this.regeneratePlots(this._createParams(e));return s&&x(s)&&(this.plots=s),!0}},{key:"setShouldOhlc",value:function(t){return!(!E(t)||this.shouldOhlc===t)&&(this.shouldOhlc=t,!0)}},{key:"setShouldFormatBigNumber",value:function(t){return!(!E(t)||this.shouldFormatBigNumber===t)&&(this.shouldFormatBigNumber=t,!0)}},{key:"setStyles",value:function(t,e){return!!k(t)&&(this.styles||(this.styles={margin:g(e.margin),bar:g(e.bar),line:g(e.line),circle:g(e.circle)}),m(this.styles,t),!0)}},{key:"setExtendData",value:function(t){return void 0!==t&&this.extendData!==t&&(this.extendData=t,!0)}},{key:"calc",value:(e=Et.mark((function t(e){return Et.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.calcTechnicalIndicator(e,{params:this._createParams(this.calcParams),plots:this.plots,extendData:this.extendData});case 2:if(t.t0=t.sent,t.t0){t.next=5;break}t.t0=[];case 5:this.result=t.t0;case 6:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,i=arguments;return new Promise((function(n,r){var a=e.apply(t,i);function o(t){_t(a,n,r,o,s,"next",t)}function s(t){_t(a,n,r,o,s,"throw",t)}o(void 0)}))},function(t){return i.apply(this,arguments)})},{key:"calcTechnicalIndicator",value:function(t,e){}},{key:"regeneratePlots",value:function(t){}}]),t}();function Tt(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Dt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Dt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return t.length>n?{done:!1,value:t[n++]}:{done:!0}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);e>i;i++)n[i]=t[i];return n}function Rt(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Lt=function(){function t(e){v(this,t),this._chartStore=e,this._templates=this._createTemplates(),this._instances=new Map}return _(t,[{key:"_createTechInfo",value:function(t){return{name:t.name,shortName:t.shortName,series:t.series,calcParams:t.calcParams,shouldCheckParamCount:t.shouldCheckParamCount,shouldOhlc:t.shouldOhlc,shouldFormatBigNumber:t.shouldFormatBigNumber,precision:t.precision,styles:t.styles,plots:t.plots,result:t.result||[]}}},{key:"_createTemplates",value:function(){var t={},e=d.technicalIndicatorExtensions;for(var i in e){var n=this._createTemplateInstance(e[i]);n&&(t[i]=n)}return t}},{key:"_createTemplateInstance",value:function(t){var e,i=t.name,n=t.shortName,r=t.series,a=t.calcParams,o=t.plots,s=t.precision,c=t.shouldCheckParamCount,h=t.shouldOhlc,l=t.shouldFormatBigNumber,u=t.minValue,f=t.maxValue,d=t.styles,p=t.extendData,y=t.calcTechnicalIndicator,x=t.regeneratePlots,b=t.createToolTipDataSource,w=t.render;if(!i||!S(y))return null;if(k(d)){var E=this._chartStore.styleOptions().technicalIndicator;m(e={margin:g(E.margin),bar:g(E.bar),line:g(E.line),circle:g(E.circle)},d)}var P=function(t){dt(y,t);var d=Rt(y);function y(){return v(this,y),d.call(this,{name:i,shortName:n,series:r,calcParams:a,plots:o,precision:s,shouldCheckParamCount:c,shouldOhlc:h,shouldFormatBigNumber:l,minValue:u,maxValue:f,defaultStyles:e,extendData:p})}return _(y)}(Ot);return P.prototype.calcTechnicalIndicator=y,S(x)&&(P.prototype.regeneratePlots=x),S(b)&&(P.prototype.createToolTipDataSource=b),S(w)&&(P.prototype.render=w),new P}},{key:"addTemplate",value:function(t){var e=this;t.forEach((function(t){var i=e._createTemplateInstance(t||{});i&&(e._templates[i.name]=i)}))}},{key:"hasTemplate",value:function(t){return!!this._templates[t]}},{key:"getTemplateInfo",value:function(t){if(!w(t)){var e={};for(var i in this._templates)e[i]=this._createTechInfo(this._templates[i]);return e}var n=this._templates[t];return n?this._createTechInfo(n):{}}},{key:"addInstance",value:function(t,e,i){var n=e.name,r=e.calcParams,a=e.precision,o=e.shouldOhlc,s=e.shouldFormatBigNumber,c=e.styles,h=e.extendData,l=this._instances.get(t);if(!l||!l.has(n)){l||(l=new Map,this._instances.set(t,l));var u=this._templates[n],f=Object.create(Object.getPrototypeOf(u));for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(f[d]=u[d]);return f.setCalcParams(r),f.setPrecision(a),f.setShouldOhlc(o),f.setShouldFormatBigNumber(s),f.setStyles(c,this._chartStore.styleOptions().technicalIndicator),f.setExtendData(h),i||l.clear(),l.set(n,f),f.calc(this._chartStore.dataList())}}},{key:"instances",value:function(t){return this._instances.get(t)||new Map}},{key:"removeInstance",value:function(t,e){var i=!1;if(this._instances.has(t)){var n=this._instances.get(t);w(e)?n.has(e)&&(n.delete(e),i=!0):(n.clear(),i=!0),0===n.size&&this._instances.delete(t)}return i}},{key:"hasInstance",value:function(t){return this._instances.has(t)}},{key:"calcInstance",value:function(t,e){var i=this,n=[];if(w(t))if(w(e)){var r=this._instances.get(e);r&&r.has(t)&&n.push(r.get(t).calc(this._chartStore.dataList()))}else this._instances.forEach((function(e){e.has(t)&&n.push(e.get(t).calc(i._chartStore.dataList()))}));else this._instances.forEach((function(t){t.forEach((function(t){n.push(t.calc(i._chartStore.dataList()))}))}));return Promise.all(n)}},{key:"getInstanceInfo",value:function(t,e){var i=this,n=function(t){var n,r=[],a=Tt(t);try{for(a.s();!(n=a.n()).done;){var o=n.value[1];if(o){var s=i._createTechInfo(o);if(o.name===e)return s;r.push(s)}}}catch(t){a.e(t)}finally{a.f()}return r};if(!w(t)){var r={};return this._instances.forEach((function(t,e){r[e]=n(t)})),r}return this._instances.has(t)?n(this._instances.get(t)):{}}},{key:"setSeriesPrecision",value:function(t,e){var i=function(i){i.series===Mt.PRICE&&i.setPrecision(t,!0),i.series===Mt.VOLUME&&i.setPrecision(e,!0)};for(var n in this._templates)i(this._templates[n]);this._instances.forEach((function(t){t.forEach((function(t){i(t)}))}))}},{key:"override",value:function(t,e){var i=this,n=t.name,r=t.shortName,a=t.calcParams,o=t.precision,s=t.shouldOhlc,c=t.shouldFormatBigNumber,h=t.styles,l=t.extendData,u=this._chartStore.styleOptions().technicalIndicator,f=new Map;if(w(e))this._instances.has(e)&&f.set(e,this._instances.get(e));else{f=this._instances;var d=this._templates[n];d&&(d.setCalcParams(a),d.setShortName(r),d.setPrecision(o),d.setShouldOhlc(s),d.setShouldFormatBigNumber(c),d.setStyles(h,u),d.setExtendData(l))}var v=!1,p=[];if(f.forEach((function(t){if(t.has(n)){var e=t.get(n),f=e.setShortName(r),d=e.setCalcParams(a),_=e.setPrecision(o),y=e.setShouldOhlc(s),m=e.setShouldFormatBigNumber(c),g=e.setStyles(h,u),x=e.setExtendData(l);(f||d||_||y||m||g||x)&&(v=!0),d&&p.push(e.calc(i._chartStore.dataList()))}})),v)return Promise.all(p)}}]),t}();function Ft(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Bt(t,e){e.forEach((function(e){var i=e.key,n=e.fn;S(n)&&(t[i]=n)}))}var zt=function(){function t(e){var i=e.id,n=e.chartStore,r=e.points,a=e.xAxis,o=e.yAxis;v(this,t),this._id=i,this._chartStore=n,this._points=r,this._xAxis=a,this._yAxis=o,this._styles=null}return _(t,[{key:"draw",value:function(t){}},{key:"setStyles",value:function(t,e){return!!k(t)&&(this._styles||(this._styles=g(e)),m(this._styles,t),!0)}},{key:"id",value:function(){return this._id}},{key:"styles",value:function(){return this._styles}},{key:"points",value:function(){return this._points}},{key:"setYAxis",value:function(t){t&&(this._yAxis=t)}},{key:"checkEventCoordinateOn",value:function(t){}},{key:"onClick",value:function(t){}},{key:"onRightClick",value:function(t){}},{key:"onMouseEnter",value:function(t){}},{key:"onMouseLeave",value:function(t){}}]),t}();function Vt(t,e,i,n){t.fillStyle=e,t.beginPath(),t.arc(i.x,i.y,n,0,2*Math.PI),t.closePath(),t.fill()}function Ht(t,e,i){var n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y),a=Math.abs(i.x-t.x);return Math.abs(n*Math.abs(i.y-t.y)-a*r)/2}function jt(t,e){var i=t.x-e.x;if(0!==i){var n=(t.y-e.y)/i;return{k:n,b:t.y-n*t.x}}}function Nt(t,e,i){return Yt(jt(t,e),i)}function Yt(t,e){return t?e.x*t.k+t.b:e.y}function Wt(t,e,i){if(!i||!t||!e)return!1;if(t.x===e.x)return 2>Math.abs(i.x-t.x);var n=jt(t,e),r=Yt(n,i),a=Math.abs(r-i.y);return 4>a*a/(n.k*n.k+1)}function $t(t,e,i){return!!Wt(t,e,i)&&(t.x===e.x?e.y>t.y?2>t.y-i.y:2>i.y-t.y:e.x>t.x?2>t.x-i.x:2>i.x-t.x)}function Xt(t,e,i){return!!Wt(t,e,i)&&(t.x===e.x?4>Math.abs(t.y-i.y)+Math.abs(e.y-i.y)-Math.abs(t.y-e.y):4>Math.abs(t.x-i.x)+Math.abs(e.x-i.x)-Math.abs(t.x-e.x))}function Gt(t,e,i){if(!i)return!1;var n=i.x-t.x,r=i.y-t.y;return!(n*n+r*r>e*e)}function Ut(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=[];if(t.length>1)if(t[0].x===t[1].x){var r=0,a=e.y;if(n.push([{x:t[0].x,y:r},{x:t[0].x,y:a}]),t.length>2){n.push([{x:t[2].x,y:r},{x:t[2].x,y:a}]);for(var o=t[0].x-t[2].x,s=0;i>s;s++){var c=o*(s+1);n.push([{x:t[0].x+c,y:r},{x:t[0].x+c,y:a}])}}}else{var h=0,l=e.x,u=jt(t[0],t[1]),f=u.k,d=u.b;if(n.push([{x:h,y:h*f+d},{x:l,y:l*f+d}]),t.length>2){var v=t[2].y-f*t[2].x;n.push([{x:h,y:h*f+v},{x:l,y:l*f+v}]);for(var p=d-v,_=0;i>_;_++){var y=d+p*(_+1);n.push([{x:h,y:h*f+y},{x:l,y:l*f+y}])}}}return n}function Zt(t,e,i){t.save(),t.lineWidth%2&&t.translate(.5,.5),t.beginPath();var n=!0;e.forEach((function(e){e&&(n?(t.moveTo(e.x,e.y),n=!1):t.lineTo(e.x,e.y))})),i(),t.restore()}function Kt(t,e){Zt(t,e,(function(){t.closePath(),t.stroke()}))}function qt(t,e){Zt(t,e,(function(){t.closePath(),t.fill()}))}function Jt(t,e,i,n){t.beginPath();var r=t.lineWidth%2?.5:0;t.moveTo(i,e+r),t.lineTo(n,e+r),t.stroke(),t.closePath()}function Qt(t,e,i,n){t.beginPath();var r=t.lineWidth%2?.5:0;t.moveTo(e+r,i),t.lineTo(e+r,n),t.stroke(),t.closePath()}function te(t,e){Zt(t,e,(function(){t.stroke(),t.closePath()}))}function ee(t){return t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.devicePixelRatio||2}function ie(t,e){return Math.round(t.measureText(e).width)}function ne(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Helvetica Neue";return"".concat(e," ").concat(t,"px ").concat(i)}function re(t,e,i){t.font=ne(i.size,i.weight,i.family);var n=ie(t,e);return i.paddingLeft+i.paddingRight+n+2*(i.borderSize||0)}function ae(t){return t.paddingTop+t.paddingBottom+t.size+2*(t.borderSize||0)}function oe(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return se(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?se(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return t.length>n?{done:!1,value:t[n++]}:{done:!0}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function se(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);e>i;i++)n[i]=t[i];return n}function ce(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var he="other",le="point",ue="none",fe="line",de="text",ve="continuous_line",pe="polygon",_e="arc",ye=0,me=1,ge=2,xe={NORMAL:"normal",WEAK_MAGNET:"weak_magnet",STRONG_MAGNET:"strong_magnet"},Se=function(t){dt(i,t);var e=ce(i);function i(t){var n,r=t.id,a=t.name,o=t.totalStep,s=t.chartStore,c=t.xAxis,h=t.yAxis,l=t.points,u=void 0===l?[]:l,f=t.styles,d=t.lock,p=t.mode,_=t.data;return v(this,i),(n=e.call(this,{id:r,chartStore:s,points:u,xAxis:c,yAxis:h}))._name=a,n._totalStep=o,n._lock=d,n._mode=xe.NORMAL,n.setMode(p),n._data=_,n._drawStep=1,n.setPoints(u),n.setStyles(f,s.styleOptions().shape),n._prevPressPoint=null,n._prevPoints=null,n._coordinates=[],n}return _(i,[{key:"setPoints",value:function(t){if(x(t)&&t.length>0){var e;this._totalStep-1>t.length?(this._drawStep=t.length+1,this._points=g(t),e=t.length):(this._drawStep=-1,this._points=t.slice(0,this._totalStep-1),e=this._totalStep-1);for(var i=0;e>i;i++)this.performEventMoveForDrawing({step:i+2,mode:this._mode,points:this._points,movePoint:this._points[i],xAxis:this._xAxis,yAxis:this._yAxis});return-1===this._drawStep&&this.performEventPressedMove({mode:this._mode,points:this._points,pressPointIndex:this._points.length-1,pressPoint:this._points[this._points.length-1],xAxis:this._xAxis,yAxis:this._yAxis}),!0}}},{key:"_timestampOrDataIndexToCoordinateX",value:function(t){var e=t.timestamp,i=t.dataIndex;return e&&(i=this._chartStore.timeScaleStore().timestampToDataIndex(e)),this._xAxis.convertToPixel(i)}},{key:"_drawLines",value:function(t,e,i,n){t.save(),t.strokeStyle=i.color||n.color,t.lineWidth=i.size||n.size,i.style===M&&t.setLineDash(i.dashValue||n.dashValue),e.forEach((function(e){var i,n;if(e.length>1)switch((i=e[0]).x===(n=e[1]).x?ge:i.y===n.y?me:ye){case ye:te(t,e);break;case me:Jt(t,e[0].y,e[0].x,e[1].x);break;case ge:Qt(t,e[0].x,e[0].y,e[1].y)}})),t.restore()}},{key:"_drawContinuousLines",value:function(t,e,i,n){t.save(),t.strokeStyle=i.color||n.color,t.lineWidth=i.size||n.size,i.style===M&&t.setLineDash(i.dashValue||n.dashValue),e.forEach((function(e){e.length>0&&te(t,e)})),t.restore()}},{key:"_drawPolygons",value:function(t,e,i,n){var r;if(t.save(),i.style===C)t.fillStyle=(i.fill||n.fill).color,r=qt;else{var a=i.stroke||n.stroke;a.style===M&&t.setLineDash(a.dashValue),t.lineWidth=a.size,t.strokeStyle=a.color,r=Kt}e.forEach((function(e){e.length>0&&r(t,e)})),t.restore()}},{key:"_drawArcs",value:function(t,e,i,n){if(t.save(),i.style===C)t.fillStyle=(i.fill||n.fill).color;else{var r=i.stroke||n.stroke;r.style===M&&t.setLineDash(r.dashValue),t.lineWidth=r.size,t.strokeStyle=r.color}e.forEach((function(e){var n=e.x,r=e.y,a=e.radius,o=e.startAngle,s=e.endAngle;t.beginPath(),t.arc(n,r,a,o,s),i.style===C?(t.closePath(),t.fill()):(t.stroke(),t.closePath())})),t.restore()}},{key:"_drawText",value:function(t,e,i,n){var r;t.save(),i.style===A?(t.strokeStyle=i.color||n.color,r=t.strokeText):(t.fillStyle=i.color||n.color,r=t.fillText),t.font=ne(i.size||n.size,i.weight||n.weight,i.family||n.family);var a=i.offset||n.offset||[0,0];e.forEach((function(e){r.call(t,e.text,e.x+a[1],e.y+a[0])})),t.restore()}},{key:"draw",value:function(t){var e=this;this._coordinates=this._points.map((function(t){var i=t.value;return{x:e._timestampOrDataIndexToCoordinateX({timestamp:t.timestamp,dataIndex:t.dataIndex}),y:e._yAxis.convertToPixel(i)}}));var i=this._styles||this._chartStore.styleOptions().shape;if(1!==this._drawStep&&this._coordinates.length>0){var n={width:this._xAxis.width(),height:this._yAxis.height()},r={price:this._chartStore.pricePrecision(),volume:this._chartStore.volumePrecision()};this._shapeDataSources=this.createShapeDataSource({step:this._drawStep,mode:this._mode,points:this._points,coordinates:this._coordinates,viewport:{width:this._xAxis.width(),height:this._yAxis.height()},precision:{price:this._chartStore.pricePrecision(),volume:this._chartStore.volumePrecision()},styles:i,xAxis:this._xAxis,yAxis:this._yAxis,data:this._data})||[],this._shapeDataSources.forEach((function(n){var r=n.styles,a=n.dataSource,o=void 0===a?[]:a;if(n.isDraw)switch(n.type){case fe:e._drawLines(t,o,r||i.line,i.line);break;case ve:e._drawContinuousLines(t,o,r||i.line,i.line);break;case pe:e._drawPolygons(t,o,r||i.polygon,i.polygon);break;case _e:e._drawArcs(t,o,r||i.arc,i.arc);break;case de:e._drawText(t,o,r||i.text,i.text)}})),this.drawExtend&&(t.save(),this.drawExtend({ctx:t,dataSource:this._shapeDataSources,styles:i,viewport:n,precision:r,mode:this._mode,xAxis:this._xAxis,yAxis:this._yAxis,data:this._data}),t.restore())}var a=this._chartStore.shapeStore().eventOperate();(a.hover.id===this._id&&a.hover.element!==ue||a.click.id===this._id&&a.click.element!==ue||this.isDrawing())&&this._coordinates.forEach((function(n,r){var o=n.x,s=n.y,c=i.point.radius,h=i.point.backgroundColor,l=i.point.borderColor,u=i.point.borderSize;a.hover.id===e._id&&a.hover.element===le&&r===a.hover.elementIndex&&(c=i.point.activeRadius,h=i.point.activeBackgroundColor,l=i.point.activeBorderColor,u=i.point.activeBorderSize),Vt(t,l,{x:o,y:s},c+u),Vt(t,h,{x:o,y:s},c)}))}},{key:"setLock",value:function(t){this._lock=t}},{key:"name",value:function(){return this._name}},{key:"lock",value:function(){return this._lock}},{key:"totalStep",value:function(){return this._totalStep}},{key:"mode",value:function(){return this._mode}},{key:"setMode",value:function(t){Object.values(xe).indexOf(t)>-1&&(this._mode=t)}},{key:"setData",value:function(t){return void 0!==t&&t!==this._data&&(this._data=t,!0)}},{key:"data",value:function(){return this._data}},{key:"isDrawing",value:function(){return-1!==this._drawStep}},{key:"isStart",value:function(){return 1===this._drawStep}},{key:"checkEventCoordinateOn",value:function(t){for(var e=this._styles||this._chartStore.styleOptions().shape,i=this._coordinates.length-1;i>-1;i--)if(Gt(this._coordinates[i],e.point.radius,t))return{id:this._id,element:le,elementIndex:i,instance:this};if(this._shapeDataSources){var n,r=oe(this._shapeDataSources);try{for(r.s();!(n=r.n()).done;){var a=n.value,o=a.key,s=a.type,c=a.dataSource,h=void 0===c?[]:c;if(a.isCheck)for(var l=0;h.length>l;l++)if(this.checkEventCoordinateOnShape({key:o,type:s,dataSource:h[l],eventCoordinate:t}))return{id:this._id,element:he,elementIndex:l,instance:this}}}catch(t){r.e(t)}finally{r.f()}}}},{key:"_performValue",value:function(t,e,i){var n=this._yAxis.convertFromPixel(t);if(this._mode===xe.NORMAL||"candle_pane"!==i)return n;var r=this._chartStore.timeScaleStore().getDataByDataIndex(e);if(!r)return n;if(n>r.high){if(this._mode===xe.WEAK_MAGNET){var a=this._yAxis.convertToPixel(r.high);return this._yAxis.convertFromPixel(a-8)>n?r.high:n}return r.high}if(r.low>n){if(this._mode===xe.WEAK_MAGNET){var o=this._yAxis.convertToPixel(r.low);return n>this._yAxis.convertFromPixel(o-8)?r.low:n}return r.low}var s=Math.max(r.open,r.close);if(n>s)return r.high-n>n-s?s:r.high;var c=Math.min(r.open,r.close);return c>n?c-n>n-r.low?r.low:c:n-c>s-n?s:c}},{key:"mouseMoveForDrawing",value:function(t,e){var i=this._xAxis.convertFromPixel(t.x),n=this._chartStore.timeScaleStore().dataIndexToTimestamp(i),r=this._performValue(t.y,i,e.paneId);this._points[this._drawStep-1]={timestamp:n,value:r,dataIndex:i},this.performEventMoveForDrawing({step:this._drawStep,mode:this._mode,points:this._points,movePoint:{timestamp:n,value:r,dataIndex:i},xAxis:this._xAxis,yAxis:this._yAxis}),this.onDrawing({id:this._id,step:this._drawStep,points:this._points})}},{key:"mouseLeftButtonDownForDrawing",value:function(){this._drawStep===this._totalStep-1?(this._drawStep=-1,this._chartStore.shapeStore().progressInstanceComplete(),this.onDrawEnd({id:this._id,points:this._points})):this._drawStep++}},{key:"mousePressedPointMove",value:function(t,e){var i=this._chartStore.shapeStore().eventOperate(),n=i.click.elementIndex;if(!this._lock&&i.click.id===this._id&&i.click.element===le&&-1!==n){var r=this._xAxis.convertFromPixel(t.x),a=this._chartStore.timeScaleStore().dataIndexToTimestamp(r),o=this._performValue(t.y,r,e.paneId);this._points[n].timestamp=a,this._points[n].dataIndex=r,this._points[n].value=o,this.performEventPressedMove({points:this._points,mode:this._mode,pressPointIndex:n,pressPoint:{dataIndex:r,timestamp:a,value:o},xAxis:this._xAxis,yAxis:this._yAxis}),this.onPressedMove({id:this._id,element:le,points:this._points,event:e})}}},{key:"startPressedOtherMove",value:function(t){var e=this._xAxis.convertFromPixel(t.x),i=this._yAxis.convertFromPixel(t.y);this._prevPressPoint={dataIndex:e,value:i},this._prevPoints=g(this._points)}},{key:"mousePressedOtherMove",value:function(t,e){var i=this;if(!this._lock&&this._prevPressPoint){var n=this._xAxis.convertFromPixel(t.x),r=this._yAxis.convertFromPixel(t.y),a=n-this._prevPressPoint.dataIndex,o=r-this._prevPressPoint.value;this._points=this._prevPoints.map((function(t){w(t.dataIndex)||(t.dataIndex=i._chartStore.timeScaleStore().timestampToDataIndex(t.timestamp));var e=t.dataIndex+a;return{dataIndex:e,value:t.value+o,timestamp:i._chartStore.timeScaleStore().dataIndexToTimestamp(e)}})),this.onPressedMove({id:this._id,element:he,points:this._points,event:e})}}},{key:"onDrawStart",value:function(t){}},{key:"onDrawing",value:function(t){}},{key:"onDrawEnd",value:function(t){}},{key:"onPressedMove",value:function(t){}},{key:"onRemove",value:function(t){}},{key:"checkEventCoordinateOnShape",value:function(t){}},{key:"createShapeDataSource",value:function(t){}},{key:"performEventMoveForDrawing",value:function(t){}},{key:"performEventPressedMove",value:function(t){}}]),i}(zt),ke=1,be=2,we=3;function Ee(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Pe(t){for(var e=1;arguments.length>e;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ee(Object(i),!0).forEach((function(e){Ft(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ee(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Ae(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Ce(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ce(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return t.length>n?{done:!1,value:t[n++]}:{done:!0}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);e>i;i++)n[i]=t[i];return n}function Me(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Ie=function(){function t(e){v(this,t),this._chartStore=e,this._templates=this._createTemplates(),this._eventOperate={click:{id:"",element:ue,elementIndex:-1},hover:{id:"",element:ue,elementIndex:-1}},this._progressInstance=null,this._pressedInstance=null,this._instances=new Map}return _(t,[{key:"_createTemplates",value:function(){var t={},e=d.shapeExtensions;for(var i in e){var n=this._createTemplateClass(e[i]);n&&(t[i]=n)}return t}},{key:"_createTemplateClass",value:function(t){var e=t.name,i=t.totalStep,n=t.checkEventCoordinateOnShape,r=t.createShapeDataSource,a=t.performEventPressedMove,o=t.performEventMoveForDrawing,s=t.drawExtend;if(!(e&&b(i)&&S(n)&&S(r)))return null;var c=function(t){dt(r,t);var n=Me(r);function r(t){var a=t.id,o=t.chartStore,s=t.xAxis,c=t.yAxis,h=t.points,l=t.styles,u=t.lock,f=t.mode,d=t.data;return v(this,r),n.call(this,{id:a,name:e,totalStep:i,chartStore:o,xAxis:s,yAxis:c,points:h,styles:l,lock:u,mode:f,data:d})}return _(r)}(Se);return c.prototype.checkEventCoordinateOnShape=n,c.prototype.createShapeDataSource=r,S(a)&&(c.prototype.performEventPressedMove=a),S(o)&&(c.prototype.performEventMoveForDrawing=o),S(s)&&(c.prototype.drawExtend=s),c}},{key:"addTemplate",value:function(t){var e=this;t.forEach((function(t){var i=e._createTemplateClass(t);i&&(e._templates[t.name]=i)}))}},{key:"getTemplate",value:function(t){return this._templates[t]}},{key:"getInstance",value:function(t){var e,i=Ae(this._instances);try{for(i.s();!(e=i.n()).done;){var n=(e.value[1]||[]).find((function(e){return e.id()===t}));if(n)return n}}catch(t){i.e(t)}finally{i.f()}return null}},{key:"hasInstance",value:function(t){return!!this.getInstance(t)}},{key:"addInstance",value:function(t,e){t.isDrawing()?this._progressInstance={paneId:e,instance:t,fixed:w(e)}:(this._instances.has(e)||this._instances.set(e,[]),this._instances.get(e).push(t)),this._chartStore.invalidate(ke)}},{key:"progressInstance",value:function(){return this._progressInstance||{}}},{key:"progressInstanceComplete",value:function(){var t=this.progressInstance(),e=t.instance,i=t.paneId;e&&!e.isDrawing()&&(this._instances.has(i)||this._instances.set(i,[]),this._instances.get(i).push(e),this._progressInstance=null)}},{key:"updateProgressInstance",value:function(t,e){var i=this.progressInstance(),n=i.instance;n&&!i.fixed&&(n.setYAxis(t),this._progressInstance.paneId=e)}},{key:"pressedInstance",value:function(){return this._pressedInstance||{}}},{key:"updatePressedInstance",value:function(t,e,i){this._pressedInstance=t?{instance:t,paneId:e,element:i}:null}},{key:"instances",value:function(t){return this._instances.get(t)||[]}},{key:"setInstanceOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.id,i=t.styles,n=t.lock,r=t.mode,a=t.data,o=t.points,s=this._chartStore.styleOptions().shape,c=!1,h=function(t){t.setLock(n),t.setMode(r),(t.setStyles(i,s)||t.setData(a)||t.setPoints(o))&&(c=!0)};if(w(e)){var l=this.getInstance(e);l&&h(l)}else this._instances.forEach((function(t){return t.forEach(h)}));c&&this._chartStore.invalidate(ke)}},{key:"getInstanceInfo",value:function(t){var e=function(t){return{name:t.name(),id:t.id(),totalStep:t.totalStep(),lock:t.lock(),mode:t.mode(),points:t.points(),styles:t.styles(),data:t.data()}},i=this.progressInstance();if(!w(t)){var n={};return this._instances.forEach((function(t,r){n[r]=t.map((function(t){return e(t)})),i.paneId===r&&i.instance&&n[r].push(e(i.instance))})),n}if(i.instance&&i.instance.id()===t)return e(i.instance);var r=this.getInstance(t);return r?e(r):null}},{key:"removeInstance",value:function(t){var e=!1,i=this.progressInstance().instance;if(!i||w(t)&&i.id()!==t||(i.onRemove({id:i.id()}),this._progressInstance=null,e=!0),w(t)){var n,r=Ae(this._instances);try{for(r.s();!(n=r.n()).done;){var a=n.value,o=a[1]||[],s=o.findIndex((function(e){return e.id()===t}));if(s>-1){o[s].onRemove({id:o[s].id()}),o.splice(s,1),0===o.length&&this._instances.delete(a[0]),e=!0;break}}}catch(t){r.e(t)}finally{r.f()}}else this._instances.forEach((function(t){t.length>0&&t.forEach((function(t){t.onRemove({id:t.id()})}))})),this._instances.clear(),e=!0;e&&this._chartStore.invalidate(ke)}},{key:"eventOperate",value:function(){return this._eventOperate}},{key:"setEventOperate",value:function(t){var e,i,n=this._eventOperate,r=n.hover,a=n.click;return!t.hover||r.id===t.hover.id&&r.element===t.hover.element&&r.elementIndex===t.hover.elementIndex||(this._eventOperate.hover=Pe({},t.hover),e=!0),!t.click||a.id===t.click.id&&a.element===t.click.element&&a.elementIndex===t.click.elementIndex||(this._eventOperate.click=Pe({},t.click),i=!0),e||i}},{key:"isEmpty",value:function(){return 0===this._instances.size&&!this.progressInstance().instance}},{key:"isDrawing",value:function(){var t=this.progressInstance().instance;return t&&t.isDrawing()}},{key:"isPressed",value:function(){return!!this.pressedInstance().instance}}]),t}();function Oe(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Te(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Te(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return t.length>n?{done:!1,value:t[n++]}:{done:!0}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Te(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);e>i;i++)n[i]=t[i];return n}function De(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Re=function(){function t(e){v(this,t),this._chartStore=e,this._annotations=new Map,this._visibleAnnotations=new Map,this._eventOperate={id:""}}return _(t,[{key:"eventOperate",value:function(){return this._eventOperate}},{key:"setEventOperate",value:function(t){t&&this._eventOperate.id!==t.id&&(this._eventOperate=function(t){for(var e=1;arguments.length>e;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?De(Object(i),!0).forEach((function(e){Ft(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):De(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},t))}},{key:"createVisibleAnnotations",value:function(){var t=this;this._visibleAnnotations.clear(),this._annotations.size>0&&this._chartStore.visibleDataList().forEach((function(e){var i=e.data,n=e.x;t._annotations.forEach((function(e,r){if(e.size>0){var a=e.get(i.timestamp)||[];if(a.length>0){var o,s=Oe(a);try{for(s.s();!(o=s.n()).done;){var c=o.value;c.createSymbolCoordinate(n),t._visibleAnnotations.has(r)?t._visibleAnnotations.get(r).push(c):t._visibleAnnotations.set(r,[c])}}catch(e){s.e(e)}finally{s.f()}}}}))}))}},{key:"add",value:function(t,e){var i=this;this._annotations.has(e)||this._annotations.set(e,new Map),t.forEach((function(t){var n=i._annotations.get(e),r=t.points().timestamp;n.has(r)?n.get(r).push(t):n.set(r,[t])})),this.createVisibleAnnotations(),this._chartStore.invalidate(ke)}},{key:"get",value:function(t){return this._visibleAnnotations.get(t)}},{key:"remove",value:function(t,e){var i=!1;if(w(t)){if(this._annotations.has(t))if(w(e)){var n=this._annotations.get(t);[].concat(e).forEach((function(t){var e=t.timestamp;n.has(e)&&(i=!0,n.delete(e))})),0===n.size&&this._annotations.delete(t),i&&this.createVisibleAnnotations()}else i=!0,this._annotations.delete(t),this._visibleAnnotations.delete(t)}else i=!0,this._annotations.clear(),this._visibleAnnotations.clear();i&&this._chartStore.invalidate(ke)}},{key:"isEmpty",value:function(){return 0===this._visibleAnnotations.size}}]),t}(),Le=function(){function t(e){v(this,t),this._chartStore=e,this._tags=new Map}return _(t,[{key:"_getById",value:function(t,e){var i=this.get(e);return i?i.get(t):null}},{key:"has",value:function(t,e){return!!this._getById(t,e)}},{key:"update",value:function(t,e,i){var n=this._getById(t,e);return!!n&&n.update(i)}},{key:"get",value:function(t){return this._tags.get(t)}},{key:"add",value:function(t,e){this._tags.has(e)||this._tags.set(e,new Map);var i=this._tags.get(e);t.forEach((function(t){i.set(t.id(),t)})),this._chartStore.invalidate(ke)}},{key:"remove",value:function(t,e){var i=!1;if(w(t)){if(this._tags.has(t))if(w(e)){var n=this._tags.get(t);[].concat(e).forEach((function(t){n.has(t)&&(i=!0,n.delete(t))})),0===n.size&&this._tags.delete(t)}else i=!0,this._tags.delete(t)}else i=!0,this._tags.clear();i&&this._chartStore.invalidate(ke)}}]),t}();function Fe(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Be(t){for(var e=1;arguments.length>e;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Fe(Object(i),!0).forEach((function(e){Ft(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Fe(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var ze=function(){function t(e){v(this,t),this._chartStore=e,this._crosshair={}}return _(t,[{key:"set",value:function(t,e){var i,n,r=this._chartStore.dataList(),a=t||{},o=r[n=w(a.x)?0>(i=this._chartStore.timeScaleStore().coordinateToDataIndex(a.x))?0:i>r.length-1?r.length-1:i:i=r.length-1],s=this._chartStore.timeScaleStore().dataIndexToCoordinate(i),c=this._crosshair.x,h=this._crosshair.y,l=this._crosshair.paneId;this._crosshair=Be(Be({},a),{},{realX:s,kLineData:o,realDataIndex:i,dataIndex:n}),o&&this._chartStore.crosshairChange(this._crosshair),c===a.x&&h===a.y&&l===a.paneId||e||this._chartStore.invalidate(ke)}},{key:"recalculate",value:function(t){this.set(this._crosshair,t)}},{key:"get",value:function(){return this._crosshair}}]),t}(),Ve=function(){function t(){v(this,t),this._observers=[]}return _(t,[{key:"subscribe",value:function(t){0>this._observers.indexOf(t)&&this._observers.push(t)}},{key:"unsubscribe",value:function(t){var e=this._observers.indexOf(t);e>-1?this._observers.splice(e,1):this._observers=[]}},{key:"execute",value:function(t){this._observers.forEach((function(e){e(t)}))}},{key:"hasObservers",value:function(){return this._observers.length>0}}]),t}(),He=function(){function t(){v(this,t),this._delegates=new Map}return _(t,[{key:"execute",value:function(t,e){this.has(t)&&this._delegates.get(t).execute(e)}},{key:"has",value:function(t){return this._delegates.has(t)&&this._delegates.get(t).hasObservers()}},{key:"subscribe",value:function(t,e){this._delegates.has(t)||this._delegates.set(t,new Ve),this._delegates.get(t).subscribe(e)}},{key:"unsubscribe",value:function(t,e){if(lt(t)){var i=this._delegates.get(t);i&&(i.unsubscribe(e),i.hasObservers()||this._delegates.delete(t))}}}]),t}(),je=function(){function t(e,i){v(this,t),this._handler=i,this._styleOptions=g(tt),m(this._styleOptions,e),this._pricePrecision=2,this._volumePrecision=0,this._dataList=[],this._visibleDataList=[],this._dragPaneFlag=!1,this._timeScaleStore=new ut(this),this._technicalIndicatorStore=new Lt(this),this._shapeStore=new Ie(this),this._annotationStore=new Re(this),this._tagStore=new Le(this),this._crosshairStore=new ze(this),this._actionStore=new He}return _(t,[{key:"adjustVisibleDataList",value:function(){this._visibleDataList=[];for(var t=this._timeScaleStore.from(),e=this._timeScaleStore.to(),i=t;e>i;i++){var n=this._dataList[i],r=this._timeScaleStore.dataIndexToCoordinate(i);this._visibleDataList.push({index:i,x:r,data:n})}this._annotationStore.createVisibleAnnotations()}},{key:"styleOptions",value:function(){return this._styleOptions}},{key:"applyStyleOptions",value:function(t){m(this._styleOptions,t)}},{key:"pricePrecision",value:function(){return this._pricePrecision}},{key:"volumePrecision",value:function(){return this._volumePrecision}},{key:"setPriceVolumePrecision",value:function(t,e){this._pricePrecision=t,this._volumePrecision=e,this._technicalIndicatorStore.setSeriesPrecision(t,e)}},{key:"dataList",value:function(){return this._dataList}},{key:"visibleDataList",value:function(){return this._visibleDataList}},{key:"addData",value:function(t,e,i){if(k(t)){if(x(t)){this._timeScaleStore.setLoading(!1),this._timeScaleStore.setMore(!E(i)||i);var n=0===this._dataList.length;this._dataList=t.concat(this._dataList),n&&this._timeScaleStore.resetOffsetRightSpace(),this._timeScaleStore.adjustFromTo()}else if(e<this._dataList.length)this._dataList[e]=t,this.adjustVisibleDataList();else{this._dataList.push(t);var r=this._timeScaleStore.offsetRightBarCount();0>r&&this._timeScaleStore.setOffsetRightBarCount(--r),this._timeScaleStore.adjustFromTo()}this._crosshairStore.recalculate(!0)}}},{key:"clearDataList",value:function(){this._dataList=[],this._visibleDataList=[],this._timeScaleStore.clear()}},{key:"timeScaleStore",value:function(){return this._timeScaleStore}},{key:"technicalIndicatorStore",value:function(){return this._technicalIndicatorStore}},{key:"shapeStore",value:function(){return this._shapeStore}},{key:"annotationStore",value:function(){return this._annotationStore}},{key:"tagStore",value:function(){return this._tagStore}},{key:"crosshairStore",value:function(){return this._crosshairStore}},{key:"actionStore",value:function(){return this._actionStore}},{key:"invalidate",value:function(t){this._handler.invalidate(t)}},{key:"crosshairChange",value:function(t){this._handler.crosshair(t)}},{key:"dragPaneFlag",value:function(){return this._dragPaneFlag}},{key:"setDragPaneFlag",value:function(t){this._dragPaneFlag=t}}]),t}();function Ne(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=pt(t)););return t}function Ye(){return Ye="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=Ne(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(3>arguments.length?t:i):r.value}},Ye.apply(this,arguments)}function We(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=document.createElement(t);for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i.style[n]=e[n]);return i}var $e="content",Xe="yAxis",Ge=function(){function t(e){v(this,t),this._height=-1,this._container=e.container,this._chartStore=e.chartStore,this._initBefore(e),this._initElement(),this._mainWidget=this._createMainWidget(this._element,e),this._yAxisWidget=this._createYAxisWidget(this._element,e)}return _(t,[{key:"_initBefore",value:function(t){}},{key:"_initElement",value:function(){this._element=We("div",{width:"100%",margin:"0",padding:"0",position:"relative",overflow:"hidden",boxSizing:"border-box"});var t=this._container.lastChild;t?this._container.insertBefore(this._element,t):this._container.appendChild(this._element)}},{key:"_createMainWidget",value:function(t,e){}},{key:"_createYAxisWidget",value:function(t,e){}},{key:"container",value:function(t){switch(t){case $e:return this._mainWidget.container();case Xe:return this._yAxisWidget.container();default:return this._element}}},{key:"width",value:function(){return this._element.offsetWidth}},{key:"setWidth",value:function(t,e){this._mainWidget.setWidth(t),this._yAxisWidget&&this._yAxisWidget.setWidth(e)}},{key:"height",value:function(){return this._height}},{key:"setHeight",value:function(t){this._height=t,this._mainWidget.setHeight(t),this._yAxisWidget&&this._yAxisWidget.setHeight(t)}},{key:"setOffsetLeft",value:function(t,e){this._mainWidget.setOffsetLeft(t),this._yAxisWidget&&this._yAxisWidget.setOffsetLeft(e)}},{key:"layout",value:function(){this._element.offsetHeight!==this._height&&(this._element.style.height="".concat(this._height,"px")),this._mainWidget.layout(),this._yAxisWidget&&this._yAxisWidget.layout()}},{key:"invalidate",value:function(t){this._yAxisWidget&&this._yAxisWidget.invalidate(t),this._mainWidget.invalidate(t)}},{key:"createHtml",value:function(t){var e=t.id,i=t.content,n=t.style;return t.position===Xe?this._yAxisWidget&&this._yAxisWidget.createHtml({id:e,content:i,style:n}):this._mainWidget.createHtml({id:e,content:i,style:n})}},{key:"removeHtml",value:function(t){this._yAxisWidget&&this._yAxisWidget.removeHtml(t),this._mainWidget.removeHtml(t)}},{key:"getImage",value:function(t){var e=this._element.offsetWidth,i=this._element.offsetHeight,n=We("canvas",{width:"".concat(e,"px"),height:"".concat(i,"px"),boxSizing:"border-box"}),r=n.getContext("2d"),a=ee(n);n.width=e*a,n.height=i*a,r.scale(a,a);var o=this._mainWidget.getElement(),s=o.offsetWidth,c=o.offsetHeight,h=parseInt(o.style.left,10);if(r.drawImage(this._mainWidget.getImage(t),h,0,s,c),this._yAxisWidget){var l=this._yAxisWidget.getElement(),u=l.offsetWidth,f=l.offsetHeight,d=parseInt(l.style.left,10);r.drawImage(this._yAxisWidget.getImage(t),d,0,u,f)}return n}},{key:"destroy",value:function(){this._container.removeChild(this._element)}}]),t}();function Ue(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Ze=function(){function t(e){v(this,t),this._width=0,this._height=0,this._initElement(e.container),this._mainView=this._createMainView(this._element,e),this._overlayView=this._createOverlayView(this._element,e),this._htmlBaseId=0,this._htmls=new Map}return _(t,[{key:"_initElement",value:function(t){this._element=We("div",{margin:"0",padding:"0",position:"absolute",top:"0",overflow:"hidden",boxSizing:"border-box"}),t.appendChild(this._element)}},{key:"_createMainView",value:function(t,e){}},{key:"_createOverlayView",value:function(t,e){}},{key:"container",value:function(){return this._element}},{key:"createHtml",value:function(t){var e=t.id,i=t.content,n=t.style,r=We("div",function(t){for(var e=1;arguments.length>e;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ue(Object(i),!0).forEach((function(e){Ft(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ue(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({boxSizing:"border-box",position:"absolute",zIndex:12},void 0===n?{}:n));if(P(i)){var a=i.replace(/(^\s*)|(\s*$)/g,"");r.innerHTML=a}else r.appendChild(i);var o=e||"html_".concat(++this._htmlBaseId);return this._htmls.has(o)?this._element.replaceChild(r,this._htmls.get(o)):this._element.appendChild(r),this._htmls.set(o,r),o}},{key:"removeHtml",value:function(t){var e=this;t?[].concat(t).forEach((function(t){var i=e._htmls.get(t);i&&(e._element.removeChild(i),e._htmls.delete(t))})):(this._htmls.forEach((function(t){e._element.removeChild(t)})),this._htmls.clear())}},{key:"getElement",value:function(){return this._element}},{key:"setWidth",value:function(t){this._width=t,this._mainView.setWidth(t),this._overlayView.setWidth(t)}},{key:"setHeight",value:function(t){this._height=t,this._mainView.setHeight(t),this._overlayView.setHeight(t)}},{key:"setOffsetLeft",value:function(t){this._element.style.left="".concat(t,"px")}},{key:"layout",value:function(){this._element.offsetWidth!==this._width&&(this._element.style.width="".concat(this._width,"px")),this._element.offsetHeight!==this._height&&(this._element.style.height="".concat(this._height,"px")),this._mainView.layout(),this._overlayView.layout()}},{key:"invalidate",value:function(t){switch(t){case ke:this._overlayView.flush();break;case be:case we:this._mainView.flush(),this._overlayView.flush()}}},{key:"getImage",value:function(t){var e=We("canvas",{width:"".concat(this._width,"px"),height:"".concat(this._height,"px"),boxSizing:"border-box"}),i=e.getContext("2d"),n=ee(e);return e.width=this._width*n,e.height=this._height*n,i.scale(n,n),i.drawImage(this._mainView.getImage(),0,0,this._width,this._height),t&&this._overlayView&&i.drawImage(this._overlayView.getImage(),0,0,this._width,this._height),e}}]),t}();function Ke(t){return window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t,20)}function qe(t){window.cancelAnimationFrame||clearTimeout(t),window.cancelAnimationFrame(t)}var Je=function(){function t(e,i){v(this,t),this._chartStore=i,this._initCanvas(e)}return _(t,[{key:"_initCanvas",value:function(t){this._canvas=We("canvas",{position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"}),this._ctx=this._canvas.getContext("2d"),t.appendChild(this._canvas)}},{key:"_redraw",value:function(t){this._ctx.clearRect(0,0,this._canvas.offsetWidth,this._canvas.offsetHeight),t&&t(),this._draw()}},{key:"_draw",value:function(){}},{key:"setWidth",value:function(t){this._width=t}},{key:"setHeight",value:function(t){this._height=t}},{key:"layout",value:function(){var t=this;this._height!==this._canvas.offsetHeight||this._width!==this._canvas.offsetWidth?this._redraw((function(){var e=ee(t._canvas);t._canvas.style.width="".concat(t._width,"px"),t._canvas.style.height="".concat(t._height,"px"),t._canvas.width=Math.floor(t._width*e),t._canvas.height=Math.floor(t._height*e),t._ctx.scale(e,e)})):this.flush()}},{key:"flush",value:function(){var t=this;this.requestAnimationId&&(qe(this.requestAnimationId),this.requestAnimationId=null),this.requestAnimationId=Ke((function(){t._redraw()}))}},{key:"getImage",value:function(){return this._canvas}}]),t}();function Qe(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var ti=function(t){dt(i,t);var e=Qe(i);function i(t,n,r,a,o){var s;return v(this,i),(s=e.call(this,t,n))._xAxis=r,s._yAxis=a,s._paneId=o,s}return _(i,[{key:"_draw",value:function(){this._ctx.globalCompositeOperation="destination-over",this._drawContent()}},{key:"_drawContent",value:function(){this._drawTechs(),this._drawGrid()}},{key:"_drawGrid",value:function(){var t=this,e=this._chartStore.styleOptions().grid;if(e.show){var i=e.horizontal;this._ctx.save(),i.show&&(this._ctx.strokeStyle=i.color,this._ctx.lineWidth=i.size,this._ctx.setLineDash(i.style===M?i.dashValue:[]),this._yAxis.ticks().forEach((function(e){Jt(t._ctx,e.y,0,t._width)})));var n=e.vertical;n.show&&(this._ctx.strokeStyle=n.color,this._ctx.lineWidth=n.size,this._ctx.setLineDash(n.style===M?n.dashValue:[]),this._xAxis.ticks().forEach((function(e){Qt(t._ctx,e.x,0,t._height)}))),this._ctx.restore()}}},{key:"_drawTechs",value:function(){var t=this;this._ctx.globalCompositeOperation="source-over";var e=this._chartStore.timeScaleStore().to(),i=this._chartStore.styleOptions().technicalIndicator;this._chartStore.technicalIndicatorStore().instances(this._paneId).forEach((function(n){var r=n.plots,a=[],o=t._chartStore.dataList(),s=n.result,c=n.styles||i;n.render&&(t._ctx.save(),n.render({ctx:t._ctx,dataSource:{from:t._chartStore.timeScaleStore().from(),to:e,kLineDataList:t._chartStore.dataList(),technicalIndicatorDataList:s},viewport:{width:t._width,height:t._height,dataSpace:t._chartStore.timeScaleStore().dataSpace(),barSpace:t._chartStore.timeScaleStore().barSpace()},styles:c,xAxis:t._xAxis,yAxis:t._yAxis}),t._ctx.restore());var h=c.line.colors||[],l=h.length,u=[],f=[],d=t._yAxis.isCandleYAxis();t._ctx.lineWidth=1,t._drawGraphics((function(i,v,p,_,y){var m=s[v]||{},g=0;n.shouldOhlc&&!d&&t._drawCandleBar(i,_,y,p,c.bar,H),r.forEach((function(n){var r=m[n.key],d=t._yAxis.convertToPixel(r);switch(n.type){case Ct:if(w(r)){var p=It(o,s,v,n,c,{color:c.circle.noChangeColor,isStroke:!0});t._drawCircle({x:i,y:d,radius:_,color:p.color,isStroke:p.isStroke})}break;case At:if(w(r)){var y;y=w(n.baseValue)?n.baseValue:t._yAxis.min();var x=t._yAxis.convertToPixel(y),S=Math.abs(x-d),k={x:i-_,width:2*_,height:Math.max(1,S)};k.y=d>x?x:1>S?x-1:d;var b=It(o,s,v,n,c,{color:c.bar.noChangeColor});k.color=b.color,k.isStroke=b.isStroke,t._drawBar(k)}break;case Pt:var E=null;if(w(r)){E=It(o,s,v,n,c,{color:h[g%l]});var P={x:i,y:d},A=u[g];f[g]||(f[g]=[]),f[g].push(P),A&&(A.color!==E.color||A.isDashed!==E.isDashed)&&(a.push({color:A.color,isDashed:A.isDashed,coordinates:f[g]}),f[g]=[P]),v===e-1&&a.push({color:E.color,isDashed:E.isDashed,coordinates:f[g]})}u[g]=E,g++}}))}),(function(){t._drawLines(a,c)}))})),this._ctx.globalCompositeOperation="destination-over"}},{key:"_drawGraphics",value:function(t,e){var i=this._chartStore.visibleDataList(),n=this._chartStore.timeScaleStore().barSpace(),r=this._chartStore.timeScaleStore().halfBarSpace();i.forEach((function(e,i){t(e.x,e.index,e.data,r,n,i)})),e&&e()}},{key:"_drawLines",value:function(t,e){var i=this;this._ctx.lineWidth=e.line.size,t.forEach((function(t){i._ctx.strokeStyle=t.color,i._ctx.setLineDash(t.isDashed?e.line.dashValue:[]),te(i._ctx,t.coordinates)}))}},{key:"_drawBar",value:function(t){t.isStroke?(this._ctx.strokeStyle=t.color,this._ctx.strokeRect(t.x+.5,t.y,t.width-1,t.height)):(this._ctx.fillStyle=t.color,this._ctx.fillRect(t.x,t.y,t.width,t.height))}},{key:"_drawCircle",value:function(t){this._ctx.strokeStyle=t.color,this._ctx.fillStyle=t.color,this._ctx.beginPath(),this._ctx.arc(t.x,t.y,t.radius,2*Math.PI,0,!0),t.isStroke?this._ctx.stroke():this._ctx.fill(),this._ctx.closePath()}},{key:"_drawCandleBar",value:function(t,e,i,n,r,a){var o=n.open,s=n.close,c=n.high,h=n.low;s>o?(this._ctx.strokeStyle=r.upColor,this._ctx.fillStyle=r.upColor):o>s?(this._ctx.strokeStyle=r.downColor,this._ctx.fillStyle=r.downColor):(this._ctx.strokeStyle=r.noChangeColor,this._ctx.fillStyle=r.noChangeColor);var l=this._yAxis.convertToPixel(o),u=this._yAxis.convertToPixel(s),f=[l,u,this._yAxis.convertToPixel(c),this._yAxis.convertToPixel(h)];f.sort((function(t,e){return t-e})),this._ctx.fillRect(t-.5,f[0],1,f[1]-f[0]),this._ctx.fillRect(t-.5,f[2],1,f[3]-f[2]);var d=Math.max(1,f[2]-f[1]);switch(a){case F:this._ctx.fillRect(t-e,f[1],i,d);break;case B:this._ctx.strokeRect(t-e+.5,f[1],i-1,d);break;case z:s>o?this._ctx.strokeRect(t-e+.5,f[1],i-1,d):this._ctx.fillRect(t-e,f[1],i,d);break;case V:s>o?this._ctx.fillRect(t-e,f[1],i,d):this._ctx.strokeRect(t-e+.5,f[1],i-1,d);break;default:this._ctx.fillRect(t-.5,f[0],1,f[3]-f[0]),this._ctx.fillRect(t-e,l,e,1),this._ctx.fillRect(t,u,e,1)}}}]),i}(Je);function ei(t,e,i,n,r){t.fillStyle=e,t.fillText(r,i,n)}function ii(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var ni=function(t){dt(i,t);var e=ii(i);function i(t,n,r,a,o){var s;return v(this,i),(s=e.call(this,t,n))._xAxis=r,s._yAxis=a,s._paneId=o,s}return _(i,[{key:"_draw",value:function(){this._ctx.textBaseline="alphabetic",this._drawTag(),this._drawShape(),this._drawAnnotation();var t=this._chartStore.crosshairStore().get();if(t.kLineData){var e=this._chartStore.styleOptions().crosshair;t.paneId===this._paneId&&this._drawCrosshairLine(e,"horizontal",t.y,0,this._width,Jt),t.paneId&&this._drawCrosshairLine(e,"vertical",t.realX,0,this._height,Qt),this._drawTooltip(t,this._chartStore.technicalIndicatorStore().instances(this._paneId))}}},{key:"_drawAnnotation",value:function(){var t=this,e=this._chartStore.annotationStore().get(this._paneId);e&&e.forEach((function(e){e.draw(t._ctx)}))}},{key:"_drawTag",value:function(){var t=this,e=this._chartStore.tagStore().get(this._paneId);e&&e.forEach((function(e){e.drawMarkLine(t._ctx)}))}},{key:"_drawShape",value:function(){var t=this;this._chartStore.shapeStore().instances(this._paneId).forEach((function(e){e.draw(t._ctx)}));var e=this._chartStore.shapeStore().progressInstance();e.paneId===this._paneId&&e.instance.draw(this._ctx)}},{key:"_drawTooltip",value:function(t,e){var i=this._chartStore.styleOptions().technicalIndicator;this._drawBatchTechToolTip(t,e,i,0,this._shouldDrawTooltip(t,i.tooltip))}},{key:"_drawCrosshairLine",value:function(t,e,i,n,r,a){var o=t[e],s=o.line;t.show&&o.show&&s.show&&(this._ctx.save(),this._ctx.lineWidth=s.size,this._ctx.strokeStyle=s.color,s.style===M&&this._ctx.setLineDash(s.dashValue),a(this._ctx,i,n,r),this._ctx.restore())}},{key:"_drawBatchTechToolTip",value:function(t,e,i){var n=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0;if(!a)return 0;var o=i.tooltip,s=r,c=s;return e.forEach((function(e){s+=o.text.marginTop+n._drawTechTooltip(t,e,i,s)+o.text.marginBottom})),s-c}},{key:"_drawTechTooltip",value:function(t,e,i){var n=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=i.tooltip,o=a.text,s=o.marginLeft,c=o.marginRight,h=o.size,l=o.color,u=0,f=o.marginTop+r,d=h,v=this._getTechTooltipData(t,e,i);if(this._ctx.textBaseline="top",this._ctx.font=ne(h,o.weight,o.family),a.showName){var p=v.name,_=ie(this._ctx,p);ei(this._ctx,l,u+=s,f,p),u+=_,a.showParams||(u+=c)}if(a.showParams){var y=v.calcParamText,m=ie(this._ctx,y);a.showName||(u+=s),ei(this._ctx,l,u,f,y),u+=m+c}return v.values.forEach((function(t){u+=s;var e="".concat(t.title).concat(t.value),i=ie(n._ctx,e);u+i>n._width&&(u=s,d+=h+1,f+=h+1),ei(n._ctx,t.color||o.color,u,f,e),u+=i+c})),d}},{key:"_shouldDrawTooltip",value:function(t,e){var i=e.showRule;return i===N||i===Y&&!!t.paneId}},{key:"_getTechTooltipData",value:function(t,e,i){var n=this._chartStore.dataList(),r=e.result,a="",o=e.calcParams;if(o.length>0){var s=o.map((function(t){return k(t)?t.value:t}));a="(".concat(s.join(","),")")}var c=[];if(S(e.createToolTipDataSource))c=e.createToolTipDataSource({dataSource:{from:this._chartStore.timeScaleStore().from(),to:this._chartStore.timeScaleStore().to(),kLineDataList:this._chartStore.dataList(),technicalIndicatorDataList:r},viewport:{width:this._width,height:this._height,dataSpace:this._chartStore.timeScaleStore().dataSpace(),barSpace:this._chartStore.timeScaleStore().barSpace()},crosshair:t,technicalIndicator:e,xAxis:this._xAxis,yAxis:this._yAxis,defaultStyles:i})||[];else{var h=e.styles||i,l=r[t.dataIndex],u=e.precision,f=e.shouldFormatBigNumber,d=h.line.colors||[],v=d.length,p=0;e.plots.forEach((function(e){var a={};switch(e.type){case Ct:a={color:h.circle.noChangeColor};break;case At:a={color:h.bar.noChangeColor};break;case Pt:a={color:d[p%v]||i.tooltip.text.color},p++}var o=It(n,r,t.dataIndex,e,h,a),s={};if(w(e.title)){var _=(l||{})[e.key];w(_)&&(_=nt(_,u),f&&(_=rt(_))),s.title=e.title,s.value=_||i.tooltip.defaultValue,s.color=o.color,c.push(s)}}))}return{values:c,name:e.shortName,calcParamText:a}}}]),i}(Je);function ri(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var ai=function(t){dt(i,t);var e=ri(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_createMainView",value:function(t,e){return new ti(t,e.chartStore,e.xAxis,e.yAxis,e.paneId)}},{key:"_createOverlayView",value:function(t,e){return new ni(t,e.chartStore,e.xAxis,e.yAxis,e.paneId)}}]),i}(Ze);function oi(t,e,i,n,r,a,o,s,c){ci(t,e,r,a,o,s,c),si(t,i,n,r,a,o,s,c)}function si(t,e,i,n,r,a,o,s){t.lineWidth=i,t.strokeStyle=e,hi(t,n,r,a,o,s),t.stroke()}function ci(t,e,i,n,r,a,o){t.fillStyle=e,hi(t,i,n,r,a,o),t.fill()}function hi(t,e,i,n,r,a){t.beginPath(),t.moveTo(e+a,i),t.arcTo(e+n,i,e+n,i+r,a),t.arcTo(e+n,i+r,e,i+r,a),t.arcTo(e,i+r,e,i,a),t.arcTo(e,i,e+n,i,a),t.closePath()}function li(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function ui(t){for(var e=1;arguments.length>e;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?li(Object(i),!0).forEach((function(e){Ft(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):li(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function fi(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var di=function(t){dt(i,t);var e=fi(i);function i(t,n,r,a){var o;return v(this,i),(o=e.call(this,t,n))._yAxis=r,o._paneId=a,o}return _(i,[{key:"_draw",value:function(){var t=this._chartStore.styleOptions().yAxis;t.show&&(this._drawAxisLine(t),this._drawTickLines(t),this._drawTickLabels(t),this._drawTechLastValue(),this._drawLastPriceLabel())}},{key:"_drawAxisLine",value:function(t){var e,i=t.axisLine;i.show&&(this._ctx.strokeStyle=i.color,this._ctx.lineWidth=i.size,e=this._yAxis.isFromYAxisZero()?0:this._width-1,Qt(this._ctx,e,0,this._height))}},{key:"_drawTickLines",value:function(t){var e=this,i=t.tickLine;if(i.show){this._ctx.lineWidth=i.size,this._ctx.strokeStyle=i.color;var n,r,a=i.length;this._yAxis.isFromYAxisZero()?(n=0,t.axisLine.show&&(n+=t.axisLine.size),r=n+a):(n=this._width,t.axisLine.show&&(n-=t.axisLine.size),r=n-a),this._yAxis.ticks().forEach((function(t){Jt(e._ctx,t.y,n,r)}))}}},{key:"_drawTickLabels",value:function(t){var e=this,i=t.tickText;if(i.show){var n,r=t.tickLine,a=r.show,o=r.length;this._yAxis.isFromYAxisZero()?(n=i.paddingLeft,t.axisLine.show&&(n+=t.axisLine.size),a&&(n+=o),this._ctx.textAlign="left"):(n=this._width-i.paddingRight,t.axisLine.show&&(n-=t.axisLine.size),a&&(n-=o),this._ctx.textAlign="right"),this._ctx.textBaseline="middle",this._ctx.font=ne(i.size,i.weight,i.family),this._ctx.fillStyle=i.color,this._yAxis.ticks().forEach((function(t){e._ctx.fillText(t.v,n,t.y)})),this._ctx.textAlign="left"}}},{key:"_drawTechLastValue",value:function(){var t=this,e=this._chartStore.styleOptions().technicalIndicator,i=e.lastValueMark;if(i.show&&i.text.show){var n=this._chartStore.technicalIndicatorStore().instances(this._paneId),r=this._chartStore.dataList();n.forEach((function(n){var a=n.result||[],o=a.length,s=a[o-1]||{},c={prev:{kLineData:r[o-2],technicalIndicatorData:a[o-2]},current:{kLineData:r[o-1],technicalIndicatorData:s},next:{kLineData:null,technicalIndicatorData:null}},h=n.precision,l=n.styles||e,u=l.line.colors||[],f=u.length,d=0;n.plots.forEach((function(e){var r,a=s[e.key];switch(e.type){case Ct:r=e.color&&e.color(c,l)||l.circle.noChangeColor;break;case At:r=e.color&&e.color(c,l)||l.bar.noChangeColor;break;case Pt:r=u[d%f],d++}w(a)&&t._drawMarkLabel(a,h,n.shouldFormatBigNumber,ui(ui({},i.text),{},{backgroundColor:r}))}))}))}}},{key:"_drawLastPriceLabel",value:function(){if(this._yAxis.isCandleYAxis()){var t=this._chartStore.styleOptions().candle.priceMark,e=t.last;if(t.show&&e.show&&e.text.show){var i=this._chartStore.dataList(),n=i[i.length-1];if(n){var r,a=n.close,o=n.open;r=a>o?e.upColor:o>a?e.downColor:e.noChangeColor,this._drawMarkLabel(a,this._chartStore.pricePrecision(),!1,ui(ui({},e.text),{},{backgroundColor:r}))}}}}},{key:"_drawMarkLabel",value:function(t,e,i,n){var r,a=n.size,o=n.weight,s=n.family,c=n.color,h=n.backgroundColor,l=n.borderRadius,u=n.paddingLeft,f=n.paddingTop,d=n.paddingRight,v=n.paddingBottom,p=this._yAxis.convertToNicePixel(t);if(this._yAxis.yAxisType()===R){var _=((this._chartStore.visibleDataList()[0]||{}).data||{}).close;r="".concat(((t-_)/_*100).toFixed(2),"%")}else r=nt(t,e),i&&(r=rt(r));this._ctx.font=ne(a,o,s);var y,m=ie(this._ctx,r)+u+d,g=f+a+v;y=this._yAxis.isFromYAxisZero()?0:this._width-m,ci(this._ctx,h,y,p-f-a/2,m,g,l),this._ctx.textBaseline="middle",ei(this._ctx,c,y+u,p,r)}}]),i}(Je);function vi(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var pi=function(t){dt(i,t);var e=vi(i);function i(t,n,r,a){var o;return v(this,i),(o=e.call(this,t,n))._yAxis=r,o._paneId=a,o}return _(i,[{key:"_draw",value:function(){this._ctx.textBaseline="middle",this._drawTag(),this._drawCrossHairLabel()}},{key:"_drawTag",value:function(){var t=this,e=this._chartStore.tagStore().get(this._paneId);e&&e.forEach((function(e){e.drawText(t._ctx)}))}},{key:"_drawCrossHairLabel",value:function(){var t=this._chartStore.crosshairStore().get();if(t.paneId===this._paneId&&0!==this._chartStore.dataList().length){var e=this._chartStore.styleOptions().crosshair,i=e.horizontal,n=i.text;if(e.show&&i.show&&n.show){var r,a,o=this._yAxis.convertFromPixel(t.y);if(this._yAxis.yAxisType()===R){var s=(this._chartStore.visibleDataList()[0]||{}).data||{};r="".concat(((o-s.close)/s.close*100).toFixed(2),"%")}else{var c=this._chartStore.technicalIndicatorStore().instances(this._paneId),h=0,l=!1;this._yAxis.isCandleYAxis()?h=this._chartStore.pricePrecision():c.forEach((function(t){h=Math.max(t.precision,h),l||(l=t.shouldFormatBigNumber)})),r=nt(o,h),l&&(r=rt(r))}var u=n.borderSize,f=re(this._ctx,r,n),d=ae(n);a=this._yAxis.isFromYAxisZero()?0:this._width-f,oi(this._ctx,n.backgroundColor,n.borderColor,u,a,t.y-u-n.paddingTop-n.size/2,f,d,n.borderRadius),ei(this._ctx,n.color,a+u+n.paddingLeft,t.y,r)}}}}]),i}(Je);function _i(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var yi=function(t){dt(i,t);var e=_i(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_createMainView",value:function(t,e){return new di(t,e.chartStore,e.yAxis,e.paneId)}},{key:"_createOverlayView",value:function(t,e){return new pi(t,e.chartStore,e.yAxis,e.paneId)}}]),i}(Ze),mi=function(){function t(e){v(this,t),this._chartStore=e,this._width=0,this._height=0,this._cacheMinValue=0,this._cacheMaxValue=0,this._minValue=0,this._maxValue=0,this._range=0,this._realMinValue=0,this._realMaxValue=0,this._realRange=0,this._ticks=[],this._initMeasureCanvas()}return _(t,[{key:"_initMeasureCanvas",value:function(){var t=We("canvas"),e=ee(t);this._measureCtx=t.getContext("2d"),this._measureCtx.scale(e,e)}},{key:"min",value:function(){return this._minValue}},{key:"max",value:function(){return this._maxValue}},{key:"width",value:function(){return this._width}},{key:"height",value:function(){return this._height}},{key:"setWidth",value:function(t){this._width=t}},{key:"setHeight",value:function(t){this._height=t}},{key:"ticks",value:function(){return this._ticks}},{key:"computeAxis",value:function(t){var e=this._optimalMinMax(this._computeMinMax());return this._minValue=e.min,this._maxValue=e.max,this._range=e.range,this._realMinValue=e.realMin,this._realMaxValue=e.realMax,this._realRange=e.realRange,!(this._cacheMinValue===e.min&&this._cacheMaxValue===e.max&&!t)&&(this._cacheMinValue=e.min,this._cacheMaxValue=e.max,this._ticks=this._optimalTicks(this._computeTicks()),!0)}},{key:"_computeMinMax",value:function(){}},{key:"_optimalMinMax",value:function(t){}},{key:"_computeTicks",value:function(){var t=[];if(this._range>=0){var e=this._computeInterval(this._realRange),i=e.interval,n=e.precision,r=ot(Math.ceil(this._realMinValue/i)*i,n),a=ot(Math.floor(this._realMaxValue/i)*i,n),o=0,s=r;if(0!==i)for(;a>=s;)t[o]={v:s.toFixed(n)},++o,s+=i}return t}},{key:"_optimalTicks",value:function(t){}},{key:"_computeInterval",value:function(t){var e,i,n,r,a=(i=Math.floor(st(e=t/8)),n=ct(i),e=(1.5>(r=e/n)?1:2.5>r?2:3.5>r?3:4.5>r?4:5.5>r?5:6.5>r?6:8)*n,-20>i?e:+e.toFixed(0>i?-i:0)),o=function(t){var e=""+t,i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return 0>n?-n:0}var r=e.indexOf(".");return 0>r?0:e.length-1-r}(a);return{interval:a,precision:o}}}]),t}();function gi(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var xi=function(t){dt(i,t);var e=gi(i);function i(t,n,r){var a;return v(this,i),(a=e.call(this,t))._isCandleYAxis=n,a._paneId=r,a}return _(i,[{key:"_computeMinMax",value:function(){var t,e=this,i=[Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER],n=[],r=!1,a=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=Number.MAX_SAFE_INTEGER;this._chartStore.technicalIndicatorStore().instances(this._paneId).forEach((function(i){if(r||(r=i.shouldOhlc),s=Math.min(s,i.precision),b(i.minValue)&&(a=Math.min(a,i.minValue)),b(i.maxValue)&&(o=Math.max(o,i.maxValue)),i.styles){t||(t={top:0,bottom:0});var c=i.styles.margin;b(c.top)&&(t.top=Math.max(1>c.top?c.top:c.top/e._height,t.top)),b(c.bottom)&&(t.bottom=Math.max(1>c.bottom?c.bottom:c.bottom/e._height,t.bottom))}n.push({plots:i.plots,result:i.result})}));var c=4;if(this._isCandleYAxis){var h=this._chartStore.pricePrecision();c=s!==Number.MAX_SAFE_INTEGER?Math.min(s,h):h}else s!==Number.MAX_SAFE_INTEGER&&(c=s);var l=this._chartStore.visibleDataList(),u=this._chartStore.styleOptions().candle,f=u.type===j,d=u.area.value,v=this._isCandleYAxis&&!f||!this._isCandleYAxis&&r;return l.forEach((function(t){var r=t.index,a=t.data;v&&(i[0]=Math.min(i[0],a.low),i[1]=Math.max(i[1],a.high)),e._isCandleYAxis&&f&&(i[0]=Math.min(i[0],a[d]),i[1]=Math.max(i[1],a[d])),n.forEach((function(t){var e=t.result[r]||{};t.plots.forEach((function(t){var n=e[t.key];w(n)&&(i[0]=Math.min(i[0],n),i[1]=Math.max(i[1],n))}))}))})),i[0]!==Number.MAX_SAFE_INTEGER&&i[1]!==Number.MIN_SAFE_INTEGER?(i[0]=Math.min(a,i[0]),i[1]=Math.max(o,i[1])):(i[0]=0,i[1]=10),{min:i[0],max:i[1],precision:c,specifyMin:a,specifyMax:o,techGap:t}}},{key:"_optimalMinMax",value:function(t){var e,i,n=t.precision,r=t.specifyMin,a=t.specifyMax,o=t.techGap,s=t.min,c=t.max,h=this.yAxisType();switch(h){case R:var l=(this._chartStore.visibleDataList()[0]||{}).data||{};b(l.close)&&(s=(s-l.close)/l.close*100,c=(c-l.close)/l.close*100),e=.01;break;case L:s=st(s),c=st(c),e=.05*ct(-n);break;default:e=ct(-n)}if(s===c||e>Math.abs(s-c)){var u=r===s,f=a===c;s=u?s:f?s-8*e:s-4*e,c=f?c:u?c+8*e:c+4*e}var d,v=.2;b((i=this._isCandleYAxis?this._chartStore.styleOptions().candle.margin:o?{top:0,bottom:0}:this._chartStore.styleOptions().technicalIndicator.margin).top)&&(d=1>i.top?i.top:i.top/this._height,v=o?Math.max(o.top,d):d);var p,_=.1;b(i.bottom)&&(p=1>i.bottom?i.bottom:i.bottom/this._height,_=o?Math.max(o.bottom,p):p);var y,m,g,x=Math.abs(c-s);return x=Math.abs((c+=x*v)-(s-=x*_)),h===L?(y=ct(s),m=ct(c),g=Math.abs(m-y)):(y=s,m=c,g=x),{min:s,max:c,range:x,realMin:y,realMax:m,realRange:g}}},{key:"_optimalTicks",value:function(t){var e=this,i=[],n=this.yAxisType(),r=this._chartStore.technicalIndicatorStore().instances(this._paneId),a=0,o=!1;this._isCandleYAxis?a=this._chartStore.pricePrecision():r.forEach((function(t){a=Math.max(a,t.precision),o||(o=t.shouldFormatBigNumber)}));var s,c=this._chartStore.styleOptions().xAxis.tickText.size;return t.forEach((function(t){var r,h=t.v,l=e._innerConvertToPixel(+h);switch(n){case R:r="".concat(nt(h,2),"%");break;case L:l=e._innerConvertToPixel(st(h)),r=nt(h,a);break;default:r=nt(h,a),o&&(r=rt(r))}l>c&&e._height-c>l&&(s&&Math.abs(s-l)>2*c||!s)&&(i.push({v:r,y:l}),s=l)})),i}},{key:"_innerConvertToPixel",value:function(t){var e=(t-this._minValue)/this._range;return this.isReverse()?Math.round(e*this._height):Math.round((1-e)*this._height)}},{key:"isCandleYAxis",value:function(){return this._isCandleYAxis}},{key:"yAxisType",value:function(){return this._isCandleYAxis?this._chartStore.styleOptions().yAxis.type:D}},{key:"isReverse",value:function(){return this._isCandleYAxis&&this._chartStore.styleOptions().yAxis.reverse}},{key:"isFromYAxisZero",value:function(){var t=this._chartStore.styleOptions().yAxis;return t.position===O&&t.inside||t.position===T&&!t.inside}},{key:"getSelfWidth",value:function(){var t=this,e=this._chartStore.styleOptions(),i=e.yAxis,n=i.width;if(b(n))return n;var r=0;if(i.show&&(i.axisLine.show&&(r+=i.axisLine.size),i.tickLine.show&&(r+=i.tickLine.length),i.tickText.show)){var a=0;this._measureCtx.font=ne(i.tickText.size,i.tickText.weight,i.tickText.family),this._ticks.forEach((function(e){a=Math.max(a,ie(t._measureCtx,e.v))})),r+=i.tickText.paddingLeft+i.tickText.paddingRight+a}var o=e.crosshair,s=0;if(o.show&&o.horizontal.show&&o.horizontal.text.show){var c=this._chartStore.technicalIndicatorStore().instances(this._paneId),h=0,l=!1;c.forEach((function(t){h=Math.max(t.precision,h),l||(l=t.shouldFormatBigNumber)})),this._measureCtx.font=ne(o.horizontal.text.size,o.horizontal.text.weight,o.horizontal.text.family);var u=2;if(this.yAxisType()!==R)if(this._isCandleYAxis){var f=this._chartStore.pricePrecision(),d=e.technicalIndicator.lastValueMark;u=d.show&&d.text.show?Math.max(h,f):f}else u=h;var v=nt(this._maxValue,u);l&&(v=rt(v)),s+=o.horizontal.text.paddingLeft+o.horizontal.text.paddingRight+2*o.horizontal.text.borderSize+ie(this._measureCtx,v)}return Math.max(r,s)}},{key:"convertFromPixel",value:function(t){var e=(this.isReverse()?t/this._height:1-t/this._height)*this._range+this._minValue;switch(this.yAxisType()){case R:var i=(this._chartStore.visibleDataList()[0]||{}).data||{};if(b(i.close))return i.close*e/100+i.close;break;case L:return ct(e);default:return e}}},{key:"convertToPixel",value:function(t){var e;switch(this.yAxisType()){case R:var i=(this._chartStore.visibleDataList()[0]||{}).data||{};b(i.close)&&(e=(t-i.close)/i.close*100);break;case L:e=st(t);break;default:e=t}return this._innerConvertToPixel(e)}},{key:"convertToNicePixel",value:function(t){var e=this.convertToPixel(t);return Math.round(Math.max(.05*this._height,Math.min(e,.98*this._height)))}}]),i}(mi);function Si(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var ki=function(t){dt(i,t);var e=Si(i);function i(t){var n;return v(this,i),(n=e.call(this,t))._minHeight=30,n._initHeight(t),n}return _(i,[{key:"_initBefore",value:function(t){this._id=t.id,this._yAxis=this._createYAxis(t)}},{key:"_initHeight",value:function(t){var e=t.height,i=t.minHeight;if(w(i)&&this.setMinHeight(i),w(e)){var n=this.minHeight();this.setHeight(n>e?n:e)}}},{key:"_createYAxis",value:function(t){return new xi(t.chartStore,!1,t.id)}},{key:"_createMainWidget",value:function(t,e){return new ai({container:t,chartStore:e.chartStore,xAxis:e.xAxis,yAxis:this._yAxis,paneId:e.id})}},{key:"_createYAxisWidget",value:function(t,e){return new yi({container:t,chartStore:e.chartStore,yAxis:this._yAxis,paneId:e.id})}},{key:"minHeight",value:function(){return this._minHeight}},{key:"setMinHeight",value:function(t){this._minHeight=t}},{key:"setHeight",value:function(t){Ye(pt(i.prototype),"setHeight",this).call(this,t),this._yAxis.setHeight(t)}},{key:"setWidth",value:function(t,e){Ye(pt(i.prototype),"setWidth",this).call(this,t,e),this._yAxis.setWidth(e)}},{key:"id",value:function(){return this._id}},{key:"yAxis",value:function(){return this._yAxis}}]),i}(Ge);function bi(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var wi=function(t){dt(i,t);var e=bi(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_drawContent",value:function(){var t=this._chartStore.styleOptions().candle;this._drawLastPriceLine(t.priceMark),t.type===j?this._drawArea(t):(this._drawHighLowPrice(t.priceMark),this._drawCandle(t)),this._drawTechs(),this._drawGrid()}},{key:"_drawArea",value:function(t){var e=this,i=[],n=[],r=Number.MAX_SAFE_INTEGER,a=t.area;this._drawGraphics((function(t,o,s,c,h,l){var u=s[a.value];if(b(u)){var f=e._yAxis.convertToPixel(u);if(0===l){var d=t-c;n.push({x:d,y:e._height}),n.push({x:d,y:f}),i.push({x:d,y:f})}i.push({x:t,y:f}),n.push({x:t,y:f}),r=Math.min(r,f)}}),(function(){var t=n.length;if(t>0){var o=n[t-1],s=e._chartStore.timeScaleStore().halfBarSpace(),c=o.x+s;i.push({x:c,y:o.y}),n.push({x:c,y:o.y}),n.push({x:c,y:e._height})}if(i.length>0&&(e._ctx.lineWidth=a.lineSize,e._ctx.strokeStyle=a.lineColor,te(e._ctx,i)),n.length>0){var h=a.backgroundColor;if(x(h)){var l=e._ctx.createLinearGradient(0,e._height,0,r);try{h.forEach((function(t){l.addColorStop(t.offset,t.color)}))}catch(t){}e._ctx.fillStyle=l}else e._ctx.fillStyle=h;qt(e._ctx,n)}}))}},{key:"_drawCandle",value:function(t){var e=this;this._drawGraphics((function(i,n,r,a,o){e._drawCandleBar(i,a,o,r,t.bar,t.type)}))}},{key:"_drawHighLowPrice",value:function(t){if(t.show&&(t.high.show||t.low.show)){var e={price:Number.MIN_SAFE_INTEGER,pos:-1},i={price:Number.MAX_SAFE_INTEGER,pos:-1};this._chartStore.visibleDataList().forEach((function(t){var n=t.index,r=t.data,a=et(r,"high",Number.MIN_SAFE_INTEGER);a>e.price&&(e.price=a,e.pos=n);var o=et(r,"low",Number.MAX_SAFE_INTEGER);i.price>o&&(i.price=o,i.pos=n)}));var n=this._yAxis.convertToPixel(e.price);e.y=n;var r=this._yAxis.convertToPixel(i.price);i.y=r;var a=[],o=[];r>n?(a=[-2,-5],o=[2,5]):(a=[2,5],o=[-2,-5]);var s=this._chartStore.pricePrecision();this._ctx.textAlign="left",this._ctx.lineWidth=1,this._ctx.textBaseline="middle",this._drawRealHighLowPrice(t.high,a,s,e),this._drawRealHighLowPrice(t.low,o,s,i)}}},{key:"_drawRealHighLowPrice",value:function(t,e,i,n){if(t.show){var r,a,o=n.price,s=n.y,c=this._xAxis.convertToPixel(n.pos),h=s+e[0];this._ctx.strokeStyle=t.color,this._ctx.fillStyle=t.color,te(this._ctx,[{x:c-2,y:h+e[0]},{x:c,y:h},{x:c+2,y:h+e[0]}]),c>this._width/2?(a=(r=c-5)-t.textMargin,this._ctx.textAlign="right"):(r=c+5,this._ctx.textAlign="left",a=r+t.textMargin);var l=h+e[1];te(this._ctx,[{x:c,y:h},{x:c,y:l},{x:r,y:l}]),this._ctx.font=ne(t.textSize,t.textWeight,t.textFamily);var u=nt(o,i);this._ctx.fillText(u,a,l)}}},{key:"_drawLastPriceLine",value:function(t){var e=t.last;if(t.show&&e.show&&e.line.show){var i=this._chartStore.dataList(),n=i[i.length-1];if(n){var r,a=n.close,o=n.open,s=this._yAxis.convertToNicePixel(a);r=a>o?e.upColor:o>a?e.downColor:e.noChangeColor,this._ctx.save(),this._ctx.strokeStyle=r,this._ctx.lineWidth=e.line.size,e.line.style===M&&this._ctx.setLineDash(e.line.dashValue),Jt(this._ctx,s,0,this._width),this._ctx.restore()}}}}]),i}(ti);function Ei(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Pi=function(t){dt(i,t);var e=Ei(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_drawTooltip",value:function(t,e){var i=this._chartStore.styleOptions(),n=i.candle,r=n.tooltip,a=i.technicalIndicator,o=a.tooltip,s=this._shouldDrawTooltip(t,r),c=this._shouldDrawTooltip(t,o);if(r.showType===W&&o.showType===W)this._drawCandleTooltipWithRect(t,e,n,s,a,0,c);else if(r.showType===$){var h=this._drawCandleTooltipWithStandard(t.kLineData,n,s);o.showType===$?this._drawBatchTechToolTip(t,e,a,s?h+r.text.marginTop:0,c):this._drawCandleTooltipWithRect(t,e,n,!1,a,h,c)}else{var l=this._drawBatchTechToolTip(t,e,a,0,c);this._drawCandleTooltipWithRect(t,e,n,s,a,l,!1)}}},{key:"_drawCandleTooltipWithStandard",value:function(t,e,i){var n=this;if(!i)return 0;var r=this._getCandleTooltipData(t,e),a=e.tooltip,o=a.text.marginLeft,s=a.text.marginRight,c=a.text.size,h=a.text.color,l=a.labels;this._ctx.textBaseline="top",this._ctx.font=ne(c,a.text.weight,a.text.family);var u=o,f=a.text.marginTop,d=c;return l.forEach((function(t,e){var i,l,v=ie(n._ctx,t),p=r[e]||a.defaultValue;k(p)?(i=p.value||a.defaultValue,l=p.color||h):(l=h,i=p);var _=ie(n._ctx,i);u+v+_>n._width&&(u=o,d+=c+1,f+=c+1),ei(n._ctx,h,u,f,t),ei(n._ctx,l,u+v,f,i),u+=v+_+o+s})),d}},{key:"_drawCandleTooltipWithRect",value:function(t,e,i,n,r,a,o){var s=this;if(n||o){var c=i.tooltip,h=c.labels,l=this._getCandleTooltipData(t.kLineData,i),u=c.text.marginLeft,f=c.text.marginRight,d=c.text.marginTop,v=c.text.marginBottom,p=c.text.size,_=c.text.color,y=c.rect,m=y.borderSize,g=y.paddingLeft,x=y.paddingRight,S=y.paddingTop,b=y.paddingBottom,E=y.offsetLeft,P=y.offsetRight,A=0,C=0,M=0;this._ctx.save(),this._ctx.textBaseline="top",n&&(this._ctx.font=ne(p,c.text.weight,c.text.family),h.forEach((function(t,e){var i,n=l[e];i=k(n)?n.value||c.defaultValue:n;var r="".concat(t).concat(i),a=ie(s._ctx,r)+u+f;A=Math.max(A,a)})),M+=(v+d+p)*h.length);var I=r.tooltip,D=I.text.marginLeft,R=I.text.marginRight,L=I.text.marginTop,F=I.text.marginBottom,B=I.text.size,z=[];if(e.forEach((function(e){z.push(s._getTechTooltipData(t,e,r))})),o&&(this._ctx.font=ne(B,I.text.weight,I.text.family),z.forEach((function(t){t.values.forEach((function(t){var e=t.title,i=t.value;if(w(e)){var n="".concat(e).concat(i),r=ie(s._ctx,n)+D+R;A=Math.max(A,r),M+=L+F+B}}))}))),0!==(C+=A)&&0!==M){C+=2*m+g+x,M+=2*m+S+b;var V,H=this._chartStore.styleOptions();this._width/2>t.realX?(V=this._width-P-C,H.yAxis.inside&&H.yAxis.position===T&&(V-=this._yAxis.width())):(V=E,H.yAxis.inside&&H.yAxis.position===O&&(V+=this._yAxis.width()));var j=a+y.offsetTop,N=y.borderRadius;ci(this._ctx,y.backgroundColor,V,j,C,M,N),si(this._ctx,y.borderColor,m,V,j,C,M,N);var Y=V+m+g+u,W=j+m+S;if(n&&(this._ctx.font=ne(p,c.text.weight,c.text.family),h.forEach((function(t,e){W+=d,s._ctx.textAlign="left",ei(s._ctx,_,Y,W,t);var i,n,r=l[e];k(r)?(n=r.color||_,i=r.value||c.defaultValue):(n=_,i=r||c.defaultValue),s._ctx.textAlign="right",ei(s._ctx,n,V+C-m-f-x,W,i),W+=p+v}))),o){var $=V+m+g+D;this._ctx.font=ne(B,I.text.weight,I.text.family),z.forEach((function(t){t.values.forEach((function(t){W+=L,s._ctx.textAlign="left",s._ctx.fillStyle=t.color||I.text.color,s._ctx.fillText(t.title,$,W),s._ctx.textAlign="right",s._ctx.fillText(t.value,V+C-m-R-x,W),W+=B+F}))}))}this._ctx.restore()}}}},{key:"_getCandleTooltipData",value:function(t,e){var i=this,n=e.tooltip.values,r=[];if(n)S(n)?r=n(t,e)||[]:x(n)&&(r=n);else{var a=this._chartStore.pricePrecision(),o=this._chartStore.volumePrecision();(r=[et(t,"timestamp"),et(t,"open"),et(t,"close"),et(t,"high"),et(t,"low"),et(t,"volume")]).forEach((function(t,e){switch(e){case 0:r[e]=it(i._chartStore.timeScaleStore().dateTimeFormat(),t,"YYYY-MM-DD hh:mm");break;case r.length-1:r[e]=rt(nt(t,o));break;default:r[e]=nt(t,a)}}))}return r}}]),i}(ni);function Ai(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Ci=function(t){dt(i,t);var e=Ai(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_createMainView",value:function(t,e){return new wi(t,e.chartStore,e.xAxis,e.yAxis,e.paneId)}},{key:"_createOverlayView",value:function(t,e){return new Pi(t,e.chartStore,e.xAxis,e.yAxis,e.paneId)}}]),i}(ai);function Mi(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Ii=function(t){dt(i,t);var e=Mi(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_createYAxis",value:function(t){return new xi(t.chartStore,!0,t.id)}},{key:"_createMainWidget",value:function(t,e){return new Ci({container:t,chartStore:e.chartStore,xAxis:e.xAxis,yAxis:this._yAxis,paneId:e.id})}}]),i}(ki);function Oi(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Ti=function(t){dt(i,t);var e=Oi(i);function i(t,n,r){var a;return v(this,i),(a=e.call(this,t,n))._xAxis=r,a}return _(i,[{key:"_draw",value:function(){var t=this._chartStore.styleOptions().xAxis;t.show&&(this._drawAxisLine(t),this._drawTickLines(t),this._drawTickLabels(t))}},{key:"_drawAxisLine",value:function(t){var e=t.axisLine;e.show&&(this._ctx.strokeStyle=e.color,this._ctx.lineWidth=e.size,Jt(this._ctx,0,0,this._width))}},{key:"_drawTickLines",value:function(t){var e=this,i=t.tickLine;if(i.show){this._ctx.lineWidth=i.size,this._ctx.strokeStyle=i.color;var n=t.axisLine.show?t.axisLine.size:0,r=n+i.length;this._xAxis.ticks().forEach((function(t){Qt(e._ctx,t.x,n,r)}))}}},{key:"_drawTickLabels",value:function(t){var e=t.tickText;if(e.show){var i=t.tickLine;this._ctx.textBaseline="top",this._ctx.font=ne(e.size,e.weight,e.family),this._ctx.textAlign="center",this._ctx.fillStyle=e.color;var n=e.paddingTop;t.axisLine.show&&(n+=t.axisLine.size),i.show&&(n+=i.length);for(var r=this._xAxis.ticks(),a=r.length,o=0;a>o;o++)this._ctx.fillText(r[o].v,r[o].x,n)}}}]),i}(Je);function Di(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Ri=function(t){dt(i,t);var e=Di(i);function i(t,n,r){var a;return v(this,i),(a=e.call(this,t,n))._xAxis=r,a}return _(i,[{key:"_draw",value:function(){this._drawCrosshairLabel()}},{key:"_drawCrosshairLabel",value:function(){var t=this._chartStore.crosshairStore().get();if(t.paneId){var e=this._chartStore.styleOptions().crosshair,i=e.vertical,n=i.text;if(e.show&&i.show&&n.show&&t.dataIndex===t.realDataIndex){var r=t.kLineData.timestamp,a=it(this._chartStore.timeScaleStore().dateTimeFormat(),r,"YYYY-MM-DD hh:mm"),o=n.paddingLeft,s=n.paddingRight,c=n.paddingTop,h=n.borderSize,l=re(this._ctx,a,n),u=ae(n),f=l-2*h-o-s,d=t.realX-f/2;o+h>d?d=o+h:d>this._width-f-h-s&&(d=this._width-f-h-s),oi(this._ctx,n.backgroundColor,n.borderColor,h,d-h-o,0,l,u,n.borderRadius),this._ctx.textBaseline="top",ei(this._ctx,n.color,d,h+c,a)}}}}]),i}(Je);function Li(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Fi=function(t){dt(i,t);var e=Li(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_createMainView",value:function(t,e){return new Ti(t,e.chartStore,e.xAxis)}},{key:"_createOverlayView",value:function(t,e){return new Ri(t,e.chartStore,e.xAxis)}}]),i}(Ze);function Bi(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var zi=function(t){dt(i,t);var e=Bi(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_computeMinMax",value:function(){return{min:this._chartStore.timeScaleStore().from(),max:this._chartStore.timeScaleStore().to()-1}}},{key:"_optimalMinMax",value:function(t){var e=t.min,i=t.max,n=i-e+1;return{min:e,max:i,range:n,realMin:e,realMax:i,realRange:n}}},{key:"_optimalTicks",value:function(t){var e=[],i=t.length,n=this._chartStore.dataList();if(i>0){var r=this._chartStore.timeScaleStore().dateTimeFormat(),a=this._chartStore.styleOptions().xAxis.tickText;this._measureCtx.font=ne(a.size,a.weight,a.family);var o=ie(this._measureCtx,"00-00 00:00"),s=this.convertToPixel(parseInt(t[0].v,10)),c=1;if(i>1){var h=this.convertToPixel(parseInt(t[1].v,10)),l=Math.abs(h-s);o>l&&(c=Math.ceil(o/l))}for(var u=0;i>u;u+=c){var f=parseInt(t[u].v,10),d=n[f].timestamp,v=it(r,d,"hh:mm");0!==u&&(v=this._optimalTickLabel(r,d,n[parseInt(t[u-c].v,10)].timestamp)||v);var p=this.convertToPixel(f);e.push({v:v,x:p,oV:d})}if(1===e.length)e[0].v=it(r,e[0].oV,"YYYY-MM-DD hh:mm");else{var _=e[0].oV,y=e[1].oV;if(e[2]){var m=e[2].v;/^[0-9]{2}-[0-9]{2}$/.test(m)?e[0].v=it(r,_,"MM-DD"):/^[0-9]{4}-[0-9]{2}$/.test(m)?e[0].v=it(r,_,"YYYY-MM"):/^[0-9]{4}$/.test(m)&&(e[0].v=it(r,_,"YYYY"))}else e[0].v=this._optimalTickLabel(r,_,y)||e[0].v}}return e}},{key:"_optimalTickLabel",value:function(t,e,i){var n=it(t,e,"YYYY"),r=it(t,e,"YYYY-MM"),a=it(t,e,"MM-DD");return n!==it(t,i,"YYYY")?n:r!==it(t,i,"YYYY-MM")?r:a!==it(t,i,"MM-DD")?a:null}},{key:"getSelfHeight",value:function(){var t=this._chartStore.styleOptions(),e=t.xAxis,i=e.height;if(b(i))return i;var n=t.crosshair,r=0;e.show&&(e.axisLine.show&&(r+=e.axisLine.size),e.tickLine.show&&(r+=e.tickLine.length),e.tickText.show&&(r+=e.tickText.paddingTop+e.tickText.paddingBottom+e.tickText.size));var a=0;return n.show&&n.vertical.show&&n.vertical.text.show&&(a+=n.vertical.text.paddingTop+n.vertical.text.paddingBottom+2*n.vertical.text.borderSize+n.vertical.text.size),Math.max(r,a)}},{key:"convertFromPixel",value:function(t){return this._chartStore.timeScaleStore().coordinateToDataIndex(t)}},{key:"convertToPixel",value:function(t){return this._chartStore.timeScaleStore().dataIndexToCoordinate(t)}}]),i}(mi);function Vi(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var Hi=function(t){dt(i,t);var e=Vi(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"_initBefore",value:function(){this._xAxis=new zi(this._chartStore)}},{key:"_createMainWidget",value:function(t,e){return new Fi({container:t,chartStore:e.chartStore,xAxis:this._xAxis})}},{key:"xAxis",value:function(){return this._xAxis}},{key:"setWidth",value:function(t,e){Ye(pt(i.prototype),"setWidth",this).call(this,t,e),this._xAxis.setWidth(t)}},{key:"setHeight",value:function(t){Ye(pt(i.prototype),"setHeight",this).call(this,t),this._xAxis.setHeight(t)}}]),i}(Ge),ji=new(function(){function t(){v(this,t),this._baseId=1}return _(t,[{key:"next",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=(new Date).getTime();return e===this._prevIdTimestamp?++this._baseId:this._baseId=1,this._prevIdTimestamp=e,"".concat(t).concat(e,"_").concat(this._baseId)}}]),t}());function Ni(t){return ji.next(t)}var Yi="mouse",Wi="touch";function $i(t){return t.type===Wi}function Xi(t){return t.type===Yi}function Gi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Ui(t){for(var e=1;arguments.length>e;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gi(Object(i),!0).forEach((function(e){Ft(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Gi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var Zi=0,Ki=2;function qi(t){return t.getBoundingClientRect()||{left:0,top:0}}function Ji(t){return!!t.touches}function Qi(t){t.cancelable&&t.preventDefault()}function tn(t,e){var i=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.sqrt(i*i+n*n)}var en=function(){function t(e,i,n){v(this,t),this._target=e,this._handler=i,this._options=n,this._clickCount=0,this._clickTimeoutId=null,this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartPosition=null,this._moveExceededManhattanDistance=!1,this._cancelClick=!1,this._unsubscribeOutsideEvents=null,this._unsubscribeMousemove=null,this._unsubscribeRoot=null,this._startPinchMiddleCoordinate=null,this._startPinchDistance=0,this._pinchPrevented=!1,this._preventDragProcess=!1,this._mousePressed=!1,this._init()}return _(t,[{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._options=Ui(Ui({},this.options),t)}},{key:"destroy",value:function(){null!==this._unsubscribeOutsideEvents&&(this._unsubscribeOutsideEvents(),this._unsubscribeOutsideEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),this._clearLongTapTimeout(),this._resetClickTimeout()}},{key:"_mouseEnterHandler",value:function(t){var e=this;this._unsubscribeMousemove&&this._unsubscribeMousemove();var i=this._mouseMoveHandler.bind(this),n=this._mouseWheelHandler.bind(this);this._unsubscribeMousemove=function(){e._target.removeEventListener("mousemove",i),e._target.removeEventListener("wheel",n)},this._target.addEventListener("mousemove",i),this._target.addEventListener("wheel",n,{passive:!1}),Ji(t)&&this._mouseMoveHandler(t);var r=this._makeCompatEvent(t);this._processEvent(r,this._handler.mouseEnterEvent)}},{key:"_resetClickTimeout",value:function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null}},{key:"_mouseMoveHandler",value:function(t){if(!this._mousePressed||Ji(t)){var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.mouseMoveEvent)}}},{key:"_mouseWheelHandler",value:function(t){var e=this._makeCompatEvent(t);t.localX=e.localX,t.localY=e.localY,this._processEvent(t,this._handler.mouseWheelEvent)}},{key:"_mouseMoveWithDownHandler",value:function(t){if((!("button"in t)||t.button===Zi)&&null===this._startPinchMiddleCoordinate){var e=Ji(t);if(!this._preventDragProcess||!e){this._pinchPrevented=!0;var i=this._makeCompatEvent(t),n=this._mouseMoveStartPosition,r=Math.abs(n.x-i.pageX),a=Math.abs(n.y-i.pageY),o=r+a>5;if(o||!e){if(o&&!this._moveExceededManhattanDistance&&e){var s=.5*r;a>=s&&!this._options.treatVertTouchDragAsPageScroll||s>a&&!this._options.treatHorzTouchDragAsPageScroll||(this._preventDragProcess=!0)}o&&(this._moveExceededManhattanDistance=!0,this._cancelClick=!0,e&&this._clearLongTapTimeout()),this._preventDragProcess||(this._processEvent(i,this._handler.pressedMouseMoveEvent),e&&Qi(t))}}}}},{key:"_mouseUpHandler",value:function(t){if(!("button"in t)||t.button===Zi){var e=this._makeCompatEvent(t);this._clearLongTapTimeout(),this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),Ji(t)&&this._mouseLeaveHandler(t),this._processEvent(e,this._handler.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1?(this._processEvent(e,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(e,this._handler.mouseClickEvent),Ji(t)&&(Qi(t),this._mouseLeaveHandler(t),0===t.touches.length&&(this._longTapActive=!1))}}},{key:"_clearLongTapTimeout",value:function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)}},{key:"_mouseDownHandler",value:function(t){if(!("button"in t)||t.button===Zi||t.button===Ki){var e=this._makeCompatEvent(t);if("button"in t&&t.button===Ki)this._processEvent(e,this._handler.mouseRightDownEvent);else{this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._preventDragProcess=!1,Ji(t)&&this._mouseEnterHandler(t),this._mouseMoveStartPosition={x:e.pageX,y:e.pageY},this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null);var i=this._mouseMoveWithDownHandler.bind(this),n=this._mouseUpHandler.bind(this),r=this._target.ownerDocument.documentElement;this._unsubscribeRoot=function(){r.removeEventListener("touchmove",i),r.removeEventListener("touchend",n),r.removeEventListener("mousemove",i),r.removeEventListener("mouseup",n)},r.addEventListener("touchmove",i,{passive:!1}),r.addEventListener("touchend",n,{passive:!1}),this._clearLongTapTimeout(),Ji(t)&&1===t.touches.length?this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,t),600):(r.addEventListener("mousemove",i),r.addEventListener("mouseup",n)),this._mousePressed=!0,this._processEvent(e,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500))}}}},{key:"_init",value:function(){var t=this;this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this));var e,i=this._target.ownerDocument,n=function(e){t._handler.mouseDownOutsideEvent&&(e.target&&t._target.contains(e.target)||t._handler.mouseDownOutsideEvent())};this._unsubscribeOutsideEvents=function(){i.removeEventListener("mousedown",n),i.removeEventListener("touchstart",n)},i.addEventListener("mousedown",n),i.addEventListener("touchstart",n,{passive:!0}),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("touchstart",this._mouseDownHandler.bind(this),{passive:!0}),e="ontouchstart"in window||!!(window.DocumentTouch&&document instanceof window.DocumentTouch),"onorientationchange"in window&&(navigator.maxTouchPoints||navigator.msMaxTouchPoints||e)||this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",(function(){}),{passive:!1})}},{key:"_initPinch",value:function(){var t=this;void 0===this._handler.pinchStartEvent&&void 0===this._handler.pinchEvent&&void 0===this._handler.pinchEndEvent||(this._target.addEventListener("touchstart",(function(e){return t._checkPinchState(e.touches)}),{passive:!0}),this._target.addEventListener("touchmove",(function(e){if(2===e.touches.length&&null!==t._startPinchMiddleCoordinate&&void 0!==t._handler.pinchEvent){var i=tn(e.touches[0],e.touches[1]);t._handler.pinchEvent(t._startPinchMiddleCoordinate,i/t._startPinchDistance),Qi(e)}}),{passive:!1}),this._target.addEventListener("touchend",(function(e){t._checkPinchState(e.touches)})))}},{key:"_checkPinchState",value:function(t){1===t.length&&(this._pinchPrevented=!1),2!==t.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(t)}},{key:"_startPinch",value:function(t){var e=qi(this._target);this._startPinchMiddleCoordinate={x:(t[0].clientX-e.left+(t[1].clientX-e.left))/2,y:(t[0].clientY-e.top+(t[1].clientY-e.top))/2},this._startPinchDistance=tn(t[0],t[1]),void 0!==this._handler.pinchStartEvent&&this._handler.pinchStartEvent(),this._clearLongTapTimeout()}},{key:"_stopPinch",value:function(){null!==this._startPinchMiddleCoordinate&&(this._startPinchMiddleCoordinate=null,void 0!==this._handler.pinchEndEvent&&this._handler.pinchEndEvent())}},{key:"_mouseLeaveHandler",value:function(t){this._unsubscribeMousemove&&this._unsubscribeMousemove();var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.mouseLeaveEvent)}},{key:"_longTapHandler",value:function(t){var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.longTapEvent),this._cancelClick=!0,this._longTapActive=!0}},{key:"_processEvent",value:function(t,e){e&&e.call(this._handler,t)}},{key:"_makeCompatEvent",value:function(t){var e;e="touches"in t&&t.touches.length?t.touches[0]:"changedTouches"in t&&t.changedTouches.length?t.changedTouches[0]:t;var i=qi(this._target);return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY,localX:e.clientX-i.left,localY:e.clientY-i.top,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey,type:t.type.startsWith("mouse")?Yi:Wi,target:e.target,view:t.view}}}]),t}(),nn=function(){function t(e,i,n,r,a,o){v(this,t),this._chartStore=i,this._topPaneId=n,this._bottomPaneId=r,this._dragEnabled=a,this._width=0,this._offsetLeft=0,this._dragEventHandler=o,this._dragFlag=!1,this._initElement(e),this._initEvent(a)}return _(t,[{key:"_initElement",value:function(t){this._container=t,this._wrapper=We("div",{margin:"0",padding:"0",position:"relative",boxSizing:"border-box"}),this._element=We("div",{width:"100%",height:"7px",margin:"0",padding:"0",position:"absolute",top:"-3px",zIndex:"20",boxSizing:"border-box"}),this._wrapper.appendChild(this._element);var e=t.lastChild;e?t.insertBefore(this._wrapper,e):t.appendChild(this._wrapper)}},{key:"_initEvent",value:function(t){t&&(this._element.style.cursor="ns-resize",this._dragEvent=new en(this._element,{mouseDownEvent:this._mouseDownEvent.bind(this),mouseUpEvent:this._mouseUpEvent.bind(this),pressedMouseMoveEvent:this._pressedMouseMoveEvent.bind(this),mouseEnterEvent:this._mouseEnterEvent.bind(this),mouseLeaveEvent:this._mouseLeaveEvent.bind(this)},{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!0}))}},{key:"_mouseDownEvent",value:function(t){this._dragFlag=!0,this._startY=t.pageY,this._dragEventHandler.startDrag(this._topPaneId,this._bottomPaneId)}},{key:"_mouseUpEvent",value:function(){this._dragFlag=!1,this._chartStore.setDragPaneFlag(!1)}},{key:"_pressedMouseMoveEvent",value:function(t){this._dragEventHandler.drag(t.pageY-this._startY,this._topPaneId,this._bottomPaneId),this._chartStore.setDragPaneFlag(!0),this._chartStore.crosshairStore().set()}},{key:"_mouseEnterEvent",value:function(){var t=this._chartStore.styleOptions().separator;this._element.style.background=t.activeBackgroundColor,this._chartStore.crosshairStore().set()}},{key:"_mouseLeaveEvent",value:function(){this._dragFlag||(this._element.style.background=null,this._chartStore.setDragPaneFlag(!1))}},{key:"height",value:function(){return this._wrapper.offsetHeight}},{key:"setSize",value:function(t,e){this._offsetLeft=t,this._width=e,this.invalidate()}},{key:"setDragEnabled",value:function(t){t!==this._dragEnabled&&(this._dragEnabled=t,t?!this._dragEvent&&this._initEvent(t):(this._element.style.cursor="default",this._dragEvent&&this._dragEvent.destroy(),this._dragEvent=null))}},{key:"topPaneId",value:function(){return this._topPaneId}},{key:"bottomPaneId",value:function(){return this._bottomPaneId}},{key:"updatePaneId",value:function(t,e){w(t)&&(this._topPaneId=t),w(e)&&(this._bottomPaneId=e)}},{key:"invalidate",value:function(){var t=this._chartStore.styleOptions().separator;this._element.style.top="".concat(-Math.floor((7-t.size)/2),"px"),this._wrapper.style.backgroundColor=t.color,this._wrapper.style.height="".concat(t.size,"px"),this._wrapper.style.marginLeft="".concat(t.fill?0:this._offsetLeft,"px"),this._wrapper.style.width=t.fill?"100%":"".concat(this._width,"px")}},{key:"getImage",value:function(){var t=this._chartStore.styleOptions().separator,e=this._wrapper.offsetWidth,i=t.size,n=We("canvas",{width:"".concat(e,"px"),height:"".concat(i,"px"),boxSizing:"border-box"}),r=n.getContext("2d"),a=ee(n);return n.width=e*a,n.height=i*a,r.scale(a,a),r.fillStyle=t.color,r.fillRect(this._offsetLeft,0,e,i),n}},{key:"destroy",value:function(){this._dragEvent&&this._dragEvent.destroy(),this._container.removeChild(this._wrapper)}}]),t}(),rn=_((function t(e){v(this,t),this._chartStore=e}));function an(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var on=function(t){dt(i,t);var e=an(i);function i(t){var n;return v(this,i),(n=e.call(this,t))._flingStartTime=null,n._flingScrollTimerId=null,n._startScrollCoordinate=null,n._touchCoordinate=null,n._touchCancelCrosshair=!1,n._touchZoomed=!1,n._pinchScale=1,n}return _(i,[{key:"pinchStartEvent",value:function(){this._pinchScale=1,this._touchZoomed=!0}},{key:"pinchEvent",value:function(t,e){var i=5*(e-this._pinchScale);this._pinchScale=e,this._chartStore.timeScaleStore().zoom(i,t)}},{key:"mouseUpEvent",value:function(){this._startScrollCoordinate=null}},{key:"mouseLeaveEvent",value:function(t){var e=this;if($i(t)){if(this._startScrollCoordinate){var i=(new Date).getTime()-this._flingStartTime,n=(t.localX-this._startScrollCoordinate.x)/(i>0?i:1)*20;200>i&&Math.abs(n)>0&&function t(){e._flingScrollTimerId=Ke((function(){e._chartStore.timeScaleStore().startScroll(),e._chartStore.timeScaleStore().scroll(n),1>Math.abs(n*=.975)?e._flingScrollTimerId&&(qe(e._flingScrollTimerId),e._flingScrollTimerId=null):t()}))}()}}else this._startScrollCoordinate=null,Xi(t)&&this._chartStore.crosshairStore().set()}},{key:"mouseMoveEvent",value:function(t){Xi(t)&&this._chartStore.crosshairStore().set({x:t.localX,y:t.paneY,paneId:t.paneId})}},{key:"mouseWheelEvent",value:function(t){if(Math.abs(t.deltaX)>Math.abs(t.deltaY)){if(t.cancelable&&t.preventDefault(),0===Math.abs(t.deltaX))return;this._chartStore.timeScaleStore().startScroll(),this._chartStore.timeScaleStore().scroll(-t.deltaX)}else{var e=-t.deltaY/100;if(0===e)return;switch(t.cancelable&&t.preventDefault(),t.deltaMode){case t.DOM_DELTA_PAGE:e*=120;break;case t.DOM_DELTA_LINE:e*=32}if(0!==e){var i=Math.sign(e)*Math.min(1,Math.abs(e));this._chartStore.timeScaleStore().zoom(i,{x:t.localX,y:t.localY})}}}},{key:"mouseClickEvent",value:function(t){$i(t)&&(this._touchCoordinate||this._touchCancelCrosshair||this._touchZoomed||(this._touchCoordinate={x:t.localX,y:t.localY},this._chartStore.crosshairStore().set({x:t.localX,y:t.paneY,paneId:t.paneId})))}},{key:"mouseDownEvent",value:function(t){if(this._flingScrollTimerId&&(qe(this._flingScrollTimerId),this._flingScrollTimerId=null),this._flingStartTime=(new Date).getTime(),this._startScrollCoordinate={x:t.localX,y:t.localY},this._chartStore.timeScaleStore().startScroll(),$i(t))if(this._touchZoomed=!1,this._touchCoordinate){var e=t.localX-this._touchCoordinate.x,i=t.localY-this._touchCoordinate.y;10>Math.sqrt(e*e+i*i)?(this._touchCoordinate={x:t.localX,y:t.localY},this._chartStore.crosshairStore().set({x:t.localX,y:t.paneY,paneId:t.paneId})):(this._touchCancelCrosshair=!0,this._touchCoordinate=null,this._chartStore.crosshairStore().set())}else this._touchCancelCrosshair=!1}},{key:"pressedMouseMoveEvent",value:function(t){var e={x:t.localX,y:t.paneY,paneId:t.paneId};if($i(t)){if(this._touchCoordinate)return this._touchCoordinate={x:t.localX,y:t.localY},void this._chartStore.crosshairStore().set(e);e=null}if(this._startScrollCoordinate){var i=t.localX-this._startScrollCoordinate.x;this._chartStore.timeScaleStore().scroll(i,e)}}},{key:"longTapEvent",value:function(t){$i(t)&&(this._touchCoordinate={x:t.localX,y:t.localY},this._chartStore.crosshairStore().set({x:t.localX,y:t.paneY,paneId:t.paneId}))}}]),i}(rn);function sn(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function cn(t){for(var e=1;arguments.length>e;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?sn(Object(i),!0).forEach((function(e){Ft(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):sn(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function hn(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return ln(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ln(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return t.length>n?{done:!1,value:t[n++]}:{done:!0}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function ln(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);e>i;i++)n[i]=t[i];return n}function un(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var fn=function(t){dt(i,t);var e=un(i);function i(t,n){var r;return v(this,i),(r=e.call(this,t))._yAxis=n,r}return _(i,[{key:"_performOverlayMouseHover",value:function(t,e,i,n){var r;if(t){var a,o=hn(t);try{for(o.s();!(a=o.n()).done;)if(r=a.value.checkEventCoordinateOn(i))break}catch(t){o.e(t)}finally{o.f()}r&&e.id===r.id||(e.id&&e.instance&&Xi(n)&&e.instance.onMouseLeave({id:e.id,points:e.instance.points(),event:n}),r&&r.id!==e.id&&r.instance&&Xi(n)&&r.instance.onMouseEnter({id:r.id,points:r.instance.points(),event:n}))}return r}},{key:"mouseUpEvent",value:function(){this._chartStore.shapeStore().updatePressedInstance()}},{key:"mouseMoveEvent",value:function(t){if(Xi(t)){if(this._waitingForMouseMove)return!1;this._waitingForMouseMove=!0;var e,i,n,r={x:t.localX,y:t.paneY},a=this._chartStore.shapeStore().progressInstance(),o=a.instance,s=a.paneId;if(o&&o.isDrawing())t.paneId&&(o.isStart()&&this._chartStore.shapeStore().updateProgressInstance(this._yAxis(t.paneId),t.paneId),s===t.paneId&&o.mouseMoveForDrawing(r,t),e={id:o.id(),element:le,elementIndex:o.points().length-1}),i={id:"",element:ue,elementIndex:-1};else{var c=this._chartStore.annotationStore().get(t.paneId),h=this._chartStore.shapeStore().instances(t.paneId),l=this._chartStore.shapeStore().eventOperate().hover,u=this._chartStore.annotationStore().eventOperate();e=this._performOverlayMouseHover(h,l,r,t),n=this._performOverlayMouseHover(c,u,r,t)}this._chartStore.shapeStore().setEventOperate({hover:e||{id:"",element:ue,elementIndex:-1},click:i}),this._chartStore.annotationStore().setEventOperate(n||{id:""}),this._waitingForMouseMove=!1}}},{key:"mouseDownEvent",value:function(t){var e,i={x:t.localX,y:t.paneY},n=this._chartStore.shapeStore().progressInstance(),r=n.instance,a={id:"",element:ue,elementIndex:-1},o=n.paneId;if(r&&r.isDrawing())$i(t)&&(r.isStart()&&(this._chartStore.shapeStore().updateProgressInstance(this._yAxis(t.paneId),t.paneId),o=t.paneId),o===t.paneId&&r.mouseMoveForDrawing(i,t)),o===t.paneId&&(r.mouseLeftButtonDownForDrawing(),e={id:r.id(),element:le,elementIndex:r.points().length-1},a={id:r.id(),element:le,elementIndex:r.points().length-1});else{var s,c=hn(this._chartStore.shapeStore().instances(t.paneId));try{for(c.s();!(s=c.n()).done;){var h=s.value;if(e=h.checkEventCoordinateOn(i)){this._chartStore.shapeStore().updatePressedInstance(h,t.paneId,e.element),e.element===le?a=cn({},e):h.startPressedOtherMove(i),h.onClick({id:e.id,points:h.points(),event:t});break}}}catch(t){c.e(t)}finally{c.f()}var l=this._chartStore.annotationStore().get(t.paneId);if(l){var u,f=hn(l);try{for(f.s();!(u=f.n()).done;){var d=u.value,v=d.checkEventCoordinateOn(i);if(v){d.onClick({id:v.id,points:d.points(),event:t});break}}}catch(t){f.e(t)}finally{f.f()}}}this._chartStore.shapeStore().setEventOperate({hover:a,click:e||{id:"",element:ue,elementIndex:-1}})&&this._chartStore.invalidate(ke)}},{key:"mouseRightDownEvent",value:function(t){var e,i=this._chartStore.shapeStore().progressInstance().instance;e=i||this._chartStore.shapeStore().instances(t.paneId).find((function(e){return e.checkEventCoordinateOn({x:t.localX,y:t.paneY})})),e&&!e.onRightClick({id:e.id(),points:e.points(),event:t})&&this._chartStore.shapeStore().removeInstance(e.id());var n=this._chartStore.annotationStore().get(t.paneId);if(n){var r=n.find((function(e){return e.checkEventCoordinateOn({x:t.localX,y:t.paneY})}));r&&r.onRightClick({id:r.id(),points:r.points(),event:t})}}},{key:"pressedMouseMoveEvent",value:function(t){var e=this._chartStore.shapeStore().pressedInstance(),i=e.instance;if(i&&e.paneId===t.paneId){var n={x:t.localX,y:t.paneY};e.element===le?i.mousePressedPointMove(n,t):i.mousePressedOtherMove(n,t),this._chartStore.crosshairStore().set({x:t.localX,y:t.paneY,paneId:t.paneId})}}}]),i}(rn);function dn(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var vn="Equal",pn="Minus",_n="ArrowLeft",yn="ArrowRight",mn=function(t){dt(i,t);var e=dn(i);function i(){return v(this,i),e.apply(this,arguments)}return _(i,[{key:"keyBoardDownEvent",value:function(t){if(t.shiftKey)switch(t.code){case vn:this._chartStore.timeScaleStore().zoom(.5);break;case pn:this._chartStore.timeScaleStore().zoom(-.5);break;case _n:this._chartStore.timeScaleStore().startScroll(),this._chartStore.timeScaleStore().scroll(-3*this._chartStore.timeScaleStore().dataSpace());break;case yn:this._chartStore.timeScaleStore().startScroll(),this._chartStore.timeScaleStore().scroll(3*this._chartStore.timeScaleStore().dataSpace())}}}]),i}(rn),gn=function(){function t(e,i,n){v(this,t),this._target=e,this._chartStore=i,this._chartContentLeftRight={},this._chartContentTopBottom={},this._paneContentSize={},this._event=new en(this._target,{pinchStartEvent:this._pinchStartEvent.bind(this),pinchEvent:this._pinchEvent.bind(this),mouseUpEvent:this._mouseUpEvent.bind(this),mouseClickEvent:this._mouseClickEvent.bind(this),mouseDownEvent:this._mouseDownEvent.bind(this),mouseRightDownEvent:this._mouseRightDownEvent.bind(this),mouseLeaveEvent:this._mouseLeaveEvent.bind(this),mouseMoveEvent:this._mouseMoveEvent.bind(this),mouseWheelEvent:this._mouseWheelEvent.bind(this),pressedMouseMoveEvent:this._pressedMouseMoveEvent.bind(this),longTapEvent:this._longTapEvent.bind(this)},{treatVertTouchDragAsPageScroll:!0,treatHorzTouchDragAsPageScroll:!1}),this._boundKeyBoardDownEvent=this._keyBoardDownEvent.bind(this),this._target.addEventListener("keydown",this._boundKeyBoardDownEvent),this._boundContextMenuEvent=function(t){t.preventDefault()},this._target.addEventListener("contextmenu",this._boundContextMenuEvent,!1),this._zoomScrollEventHandler=new on(i),this._overlayEventHandler=new fn(i,n),this._keyBoardEventHandler=new mn(i)}return _(t,[{key:"_keyBoardDownEvent",value:function(t){this._keyBoardEventHandler.keyBoardDownEvent(t)}},{key:"_pinchStartEvent",value:function(){this._zoomScrollEventHandler.pinchStartEvent()}},{key:"_pinchEvent",value:function(t,e){this._zoomScrollEventHandler.pinchEvent(t,e)}},{key:"_mouseUpEvent",value:function(t){this._checkEventInChartContent(t)&&(this._target.style.cursor="crosshair"),this._zoomScrollEventHandler.mouseUpEvent(t),this._shouldPerformOverlayEvent()&&this._overlayEventHandler.mouseUpEvent(t)}},{key:"_mouseLeaveEvent",value:function(t){this._zoomScrollEventHandler.mouseLeaveEvent(t)}},{key:"_mouseMoveEvent",value:function(t){if(t.target instanceof HTMLCanvasElement)if(this._checkEventInChartContent(t)){this._target.style.cursor="crosshair";var e=this._compatChartEvent(t,!0);this._shouldPerformOverlayEvent()&&this._overlayEventHandler.mouseMoveEvent(e),this._chartStore.dragPaneFlag()||this._zoomScrollEventHandler.mouseMoveEvent(e)}else this._target.style.cursor="default",this._zoomScrollEventHandler.mouseLeaveEvent(t);else this._target.style.cursor="default",this._chartStore.crosshairStore().set()}},{key:"_mouseWheelEvent",value:function(t){this._checkZoomScroll()&&this._checkEventInChartContent(t)&&this._zoomScrollEventHandler.mouseWheelEvent(this._compatChartEvent(t))}},{key:"_mouseClickEvent",value:function(t){this._checkZoomScroll()&&this._checkEventInChartContent(t)&&(this._zoomScrollEventHandler.mouseClickEvent(this._compatChartEvent(t,!0)),this._modifyEventOptions(t))}},{key:"_mouseDownEvent",value:function(t){if(this._checkEventInChartContent(t)){this._target.style.cursor="pointer";var e=this._compatChartEvent(t,!0);this._shouldPerformOverlayEvent()&&this._overlayEventHandler.mouseDownEvent(e),this._checkZoomScroll()&&(this._zoomScrollEventHandler.mouseDownEvent(e),this._modifyEventOptions(t))}}},{key:"_mouseRightDownEvent",value:function(t){this._shouldPerformOverlayEvent()&&this._checkEventInChartContent(t)&&this._overlayEventHandler.mouseRightDownEvent(this._compatChartEvent(t,!0))}},{key:"_pressedMouseMoveEvent",value:function(t){if(this._checkEventInChartContent(t)){var e=this._compatChartEvent(t,!0);this._checkZoomScroll()?(this._zoomScrollEventHandler.pressedMouseMoveEvent(e),this._modifyEventOptions(t)):this._overlayEventHandler.pressedMouseMoveEvent(e)}}},{key:"_longTapEvent",value:function(t){this._checkZoomScroll()&&this._checkEventInChartContent(t)&&(this._zoomScrollEventHandler.longTapEvent(this._compatChartEvent(t,!0)),this._modifyEventOptions(t))}},{key:"_checkZoomScroll",value:function(){return!this._chartStore.dragPaneFlag()&&!this._chartStore.shapeStore().isPressed()&&!this._chartStore.shapeStore().isDrawing()}},{key:"_shouldPerformOverlayEvent",value:function(){return!this._chartStore.shapeStore().isEmpty()||!this._chartStore.annotationStore().isEmpty()}},{key:"_modifyEventOptions",value:function(t){$i(t)&&this._chartStore.crosshairStore().get().paneId?this._event.setOptions({treatVertTouchDragAsPageScroll:!1}):this._event.setOptions({treatVertTouchDragAsPageScroll:!0})}},{key:"_compatChartEvent",value:function(t,e){if(e)for(var i in this._paneContentSize)if(Object.prototype.hasOwnProperty.call(this._paneContentSize,i)){var n=this._paneContentSize[i];if(t.localY>n.contentTop&&n.contentBottom>t.localY){t.paneY=t.localY-n.contentTop,t.paneId=i;break}}return t.localX-=this._chartContentLeftRight.contentLeft,t}},{key:"_checkEventInChartContent",value:function(t){return t.localX>this._chartContentLeftRight.contentLeft&&this._chartContentLeftRight.contentRight>t.localX&&t.localY>this._chartContentTopBottom.contentTop&&this._chartContentTopBottom.contentBottom>t.localY}},{key:"setChartContentLeftRight",value:function(t){this._chartContentLeftRight=t}},{key:"setChartContentTopBottom",value:function(t){this._chartContentTopBottom=t}},{key:"setPaneContentSize",value:function(t){this._paneContentSize=t}},{key:"destroy",value:function(){this._event.destroy(),this._target.removeEventListener("keydown",this._boundKeyBoardDownEvent),this._target.removeEventListener("contextmenu",this._boundContextMenuEvent)}}]),t}();function xn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,i=0;return function(){var n=Date.now(),r=this,a=arguments;n-i>e&&(t.apply(r,a),i=n)}}function Sn(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var kn=function(t){dt(i,t);var e=Sn(i);function i(t){var n,r=t.id,a=t.point,o=void 0===a?{}:a,s=t.chartStore,c=t.xAxis,h=t.yAxis,l=t.styles;return v(this,i),(n=e.call(this,{id:r,chartStore:s,points:o,xAxis:c,yAxis:h}))._symbolCoordinate={},n.setStyles(l,s.styleOptions().annotation),n}return _(i,[{key:"_drawSymbol",value:function(t,e,i){var n=this._chartStore.timeScaleStore().barSpace(),r=i.symbol,a=r.size,o=r.activeSize,s=e?b(o)?o:n:b(a)?a:n,c=e?r.activeColor:r.color;switch(r.type){case X:Vt(t,c,this._symbolCoordinate,s/2);break;case G:!function(t,e,i,n,r,a){t.fillStyle=e,t.fillRect(i,n,r,a)}(t,c,this._symbolCoordinate.x-s/2,this._symbolCoordinate.y-s/2,s,s);break;case Z:!function(t,e,i,n,r){t.fillStyle=e,t.beginPath(),t.moveTo(i.x-n/2,i.y),t.lineTo(i.x,i.y-r/2),t.lineTo(i.x+n/2,i.y),t.lineTo(i.x,i.y+r/2),t.closePath(),t.fill()}(t,c,this._symbolCoordinate,s,s);break;case U:!function(t,e,i,n,r){t.fillStyle=e,t.beginPath(),t.moveTo(i.x-n/2,i.y+r/2),t.lineTo(i.x,i.y-r/2),t.lineTo(i.x+n/2,i.y+r/2),t.closePath(),t.fill()}(t,c,this._symbolCoordinate,s,s);break;case K:t.save(),this.drawCustomSymbol({ctx:t,point:this._points,coordinate:this._symbolCoordinate,viewport:{width:this._xAxis.width(),height:this._yAxis.height(),barSpace:n},styles:r,isActive:e}),t.restore()}}},{key:"draw",value:function(t){var e=this._styles||this._chartStore.styleOptions().annotation,i=e.offset||[0,0],n=0;switch(e.position){case q:n=this._yAxis.convertToPixel(this._points.value);break;case J:n=0;break;case Q:n=this._yAxis.height()}this._symbolCoordinate.y=n+i[0];var r=this._id===this._chartStore.annotationStore().eventOperate().id;this._drawSymbol(t,r,e),this.drawExtend&&(t.save(),this.drawExtend({ctx:t,point:this._points,coordinate:this._symbolCoordinate,viewport:{width:this._xAxis.width(),height:this._yAxis.height()},styles:e,isActive:r}),t.restore())}},{key:"checkEventCoordinateOn",value:function(t){var e,i,n,r,a,o=this._chartStore.timeScaleStore().barSpace(),s=(this._styles||this._chartStore.styleOptions().annotation).symbol,c=b(s.size)?s.size:o;switch(s.type){case X:e=Gt(this._symbolCoordinate,c/2,t);break;case G:e=function(t,e,i){return!(t.x>i.x||i.x>e.x||t.y>i.y||i.y>e.y)}({x:this._symbolCoordinate.x-c/2,y:this._symbolCoordinate.y-c/2},{x:this._symbolCoordinate.x+c/2,y:this._symbolCoordinate.y+c/2},t);break;case Z:e=(n=c)*(r=c)/2+2>Math.abs((i=this._symbolCoordinate).x-(a=t).x)*r+Math.abs(i.y-a.y)*n;break;case U:e=function(t,e){var i=Ht(t[0],t[1],t[2]),n=Ht(t[0],t[1],e)+Ht(t[0],t[2],e)+Ht(t[1],t[2],e);return 2>Math.abs(i-n)}([{x:this._symbolCoordinate.x-c/2,y:this._symbolCoordinate.y+c/2},{x:this._symbolCoordinate.x,y:this._symbolCoordinate.y-c/2},{x:this._symbolCoordinate.x+c/2,y:this._symbolCoordinate.y+c/2}],t);break;case K:e=this.checkEventCoordinateOnCustomSymbol({eventCoordinate:t,coordinate:this._symbolCoordinate,size:c})}if(e)return{id:this._id,instance:this}}},{key:"createSymbolCoordinate",value:function(t){var e=this._styles||this._chartStore.styleOptions().annotation;this._symbolCoordinate={x:t+(e.offset||[0,0])[1]}}},{key:"checkEventCoordinateOnCustomSymbol",value:function(t){}},{key:"drawCustomSymbol",value:function(t){}}]),i}(zt);function bn(e){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var t,n=pt(e);if(i){var r=pt(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return vt(this,t)}}var wn=function(t){dt(i,t);var e=bn(i);function i(t){var n,r=t.id,a=t.point,o=void 0===a?{}:a,s=t.text,c=t.mark,h=t.chartStore,l=t.xAxis,u=t.yAxis,f=t.styles;return v(this,i),(n=e.call(this,{id:r,chartStore:h,points:o,xAxis:l,yAxis:u}))._text=s,n._mark=c,n.setStyles(f,h.styleOptions().tag),n}return _(i,[{key:"update",value:function(t){var e=t.point,i=t.text,n=t.mark,r=t.styles,a=!1;return k(e)&&(this._points=e,a=!0),w(i)&&(this._text=i,a=!0),w(n)&&(this._mark=n,a=!0),this.setStyles(r,this._chartStore.styleOptions().tag)&&(a=!0),a}},{key:"drawMarkLine",value:function(t){var e=this._chartStore.styleOptions(),i=e.yAxis,n=this._styles||e.tag,r=this._getY(n);t.save(),this._drawLine(t,r,n,i),this._drawMark(t,r,n,i),t.restore()}},{key:"drawText",value:function(t){if(w(this._text)){var e=this._chartStore.styleOptions(),i=this._styles||e.tag,n=i.text;t.save();var r,a=re(t,this._text,n),o=ae(n);r=this._yAxis.isFromYAxisZero()?0:this._yAxis.width()-a;var s=this._getY(i);oi(t,n.backgroundColor,n.borderColor,n.borderSize,r,s-o/2,a,o,n.borderRadius),ei(t,n.color,r+n.paddingLeft,s,this._text),t.restore()}}},{key:"_drawLine",value:function(t,e,i,n){var r=i.line;if(r.show){t.save();var a=re(t,this._text,i.text),o=re(t,this._mark,i.mark);t.strokeStyle=r.color,t.lineWidth=r.size,r.style===M&&t.setLineDash(r.dashValue);var s=i.mark.offset,c=[],h=w(this._text),l=w(this._mark);n.inside?n.position===O?h&&l?s>0?(c.push([a,a+s]),c.push([a+s+o,this._xAxis.width()])):c.push(Math.min(a,o)>Math.abs(s)?[a+s+o,this._xAxis.width()]:[Math.max(a,o),this._xAxis.width()]):h?c.push([a,this._xAxis.width()]):l?s>0?(c.push([0,s]),c.push([s+o,this._xAxis.width()])):c.push(o>Math.abs(s)?[s+o,this._xAxis.width()]:[0,this._xAxis.width()]):c.push([0,this._xAxis.width()]):h&&l?0>s?(c.push([0,this._xAxis.width()-a+s-o]),c.push([this._xAxis.width()-a+s,this._xAxis.width()-a])):c.push(Math.min(a,o)>s?[0,this._xAxis.width()-a-o+s]:[0,this._xAxis.width()-Math.max(a,o)]):h?c.push([0,this._xAxis.width()-a]):l?0>s?(c.push([0,this._xAxis.width()+s-o]),c.push([this._xAxis.width()+s,this._xAxis.width()])):c.push(o>s?[0,this._xAxis.width()-o+s]:[0,this._xAxis.width()]):c.push([0,this._xAxis.width()]):n.position===O?l?s>0?(c.push([0,s]),c.push([s+o,this._xAxis.width()])):c.push(o>Math.abs(s)?[o+s,this._xAxis.width()]:[0,this._xAxis.width()]):c.push([0,this._xAxis.width()]):l?0>s?(c.push([0,this._xAxis.width()-o+s]),c.push([this._xAxis.width()+s,this._xAxis.width()])):c.push(o>s?[0,this._xAxis.width()-o+s]:[0,this._xAxis.width()]):c.push([0,this._xAxis.width()]),c.forEach((function(i){Jt(t,e,i[0],i[1])})),t.restore()}}},{key:"_drawMark",value:function(t,e,i,n){if(w(this._mark)){var r,a=i.mark,o=re(t,this._mark,a),s=ae(a);if(n.inside){var c=0;w(this._text)&&(c=re(t,this._text,i.text)),r=n.position===O?c:this._xAxis.width()-c-o}else r=n.position===O?0:this._xAxis.width()-o;oi(t,a.backgroundColor,a.borderColor,a.borderSize,r+=a.offset,e-s/2,o,s,a.borderRadius),t.textBaseline="middle",t.font=ne(a.size,a.weight,a.family),ei(t,a.color,r+a.paddingLeft,e,this._mark)}}},{key:"_getY",value:function(t){var e=t.offset;switch(t.position){case J:return e;case Q:return this._yAxis.height()+e;default:return this._yAxis.convertToNicePixel(this._points.value)+e}}}]),i}(zt);function En(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return Pn(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Pn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return t.length>n?{done:!1,value:t[n++]}:{done:!0}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function Pn(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);e>i;i++)n[i]=t[i];return n}var An="tech_pane_",Cn="candle_pane",Mn=function(){function t(e,i){var n=this;v(this,t),this._initChartContainer(e),this._separatorDragStartTopPaneHeight=0,this._separatorDragStartBottomPaneHeight=0,this._chartStore=new je(i,{invalidate:this._invalidatePane.bind(this),crosshair:this._crosshairObserver.bind(this)}),this._xAxisPane=new Hi({id:"x_axis_pane",container:this._chartContainer,chartStore:this._chartStore}),this._panes=new Map([[Cn,new Ii({container:this._chartContainer,chartStore:this._chartStore,xAxis:this._xAxisPane.xAxis(),id:Cn})]]),this._separators=new Map,this._chartWidth={},this._chartHeight={},this._chartEvent=new gn(this._chartContainer,this._chartStore,(function(t){return n._panes.get(t).yAxis()})),this.adjustPaneViewport(!0,!0,!0)}return _(t,[{key:"_initChartContainer",value:function(t){this._container=t,this._chartContainer=We("div",{userSelect:"none",webkitUserSelect:"none",msUserSelect:"none",MozUserSelect:"none",webkitTapHighlightColor:"transparent",position:"relative",outline:"none",borderStyle:"none",width:"100%",cursor:"crosshair",boxSizing:"border-box"}),this._chartContainer.tabIndex=1,t.appendChild(this._chartContainer)}},{key:"_crosshairObserver",value:function(t){var e=this,i=t.paneId,n=t.dataIndex,r=t.kLineData,a=t.x,o=t.y;if(this._chartStore.actionStore().has(ht.CROSSHAIR)||this._chartStore.actionStore().has(ht.TOOLTIP)){var s={};this._panes.forEach((function(t,i){var a={},o=[];e.chartStore().technicalIndicatorStore().instances(i).forEach((function(t){var e=t.result[n];a[t.name]=e,o.push({name:t.name,data:e})})),s[i]=a,e._chartStore.actionStore().execute(ht.TOOLTIP,{paneId:i,dataIndex:n,kLineData:r,technicalIndicatorData:o})})),i&&this._chartStore.actionStore().execute(ht.CROSSHAIR,{paneId:i,coordinate:{x:a,y:o},dataIndex:n,kLineData:r,technicalIndicatorData:s})}}},{key:"_separatorStartDrag",value:function(t,e){this._separatorDragStartTopPaneHeight=this._panes.get(t).height(),this._separatorDragStartBottomPaneHeight=this._panes.get(e).height()}},{key:"_separatorDrag",value:function(t,e,i){var n=this._panes.get(e),r=this._panes.get(i),a=n.minHeight(),o=r.minHeight(),s=this._separatorDragStartTopPaneHeight+t,c=this._separatorDragStartBottomPaneHeight-t;s>this._separatorDragStartTopPaneHeight+this._separatorDragStartBottomPaneHeight&&(s=this._separatorDragStartTopPaneHeight+this._separatorDragStartBottomPaneHeight,c=0),0>s&&(s=0,c=this._separatorDragStartTopPaneHeight+this._separatorDragStartBottomPaneHeight),a>s&&(c-=o-s,s=a),o>c&&(s-=a-c,c=o),n.setHeight(s),r.setHeight(c),this._chartStore.actionStore().execute(ht.PANE_DRAG,{topPaneId:e,bottomPaneId:i,topPaneHeight:s,bottomPaneHeight:c}),this.adjustPaneViewport(!0,!0,!0,!0,!0)}},{key:"_invalidatePane",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:we;if(t===ke)this._xAxisPane.invalidate(t),this._panes.forEach((function(e){e.invalidate(t)}));else{var e=!1;this._panes.forEach((function(t){var i=t.yAxis().computeAxis();i&&(e=i)})),this.adjustPaneViewport(!1,e,!0)}}},{key:"_measurePaneHeight",value:function(){var t=this,e=this._chartStore.styleOptions(),i=this._container.offsetHeight,n=e.separator.size,r=n*this._separators.size,a=this._xAxisPane.xAxis().getSelfHeight(),o=i-a-r;0>o&&(o=0);var s=0;this._panes.forEach((function(t){if(t.id()!==Cn){var e=t.height(),i=t.minHeight();i>e&&(e=i),s+e>o?0>(e=o-(s=o))&&(e=0):s+=e,t.setHeight(e)}}));var c=o-s,h={};h.candle_pane={contentTop:0,contentBottom:c};var l=c,u=c;this._panes.get(Cn).setHeight(c),this._chartHeight.candle_pane=c,this._panes.forEach((function(e){if(e.id()!==Cn){var i=e.height();u+=i+n,h[e.id()]={contentTop:l,contentBottom:u},t._chartHeight[e.id()]=i,l=u}})),this._xAxisPane.setHeight(a),this._chartHeight.xAxis=a,this._chartHeight.total=i,this._chartEvent.setPaneContentSize(h),this._chartEvent.setChartContentTopBottom({contentTop:0,contentBottom:u})}},{key:"_measurePaneWidth",value:function(){var t,e,i,n=this,r=this._chartStore.styleOptions().yAxis,a=r.position===O,o=!r.inside,s=this._container.offsetWidth,c=Number.MIN_SAFE_INTEGER;this._panes.forEach((function(t){c=Math.max(c,t.yAxis().getSelfWidth())})),c>s&&(c=s),o?(t=s-c,a?(e=0,i=c):(e=s-c,i=0)):(t=s,i=0,e=a?0:s-c);var h=t;h<this._chartStore.timeScaleStore().dataSpace()&&(h=this._chartStore.timeScaleStore().dataSpace()),this._chartStore.timeScaleStore().setTotalDataSpace(h),this._panes.forEach((function(r,a){r.setWidth(t,c),r.setOffsetLeft(i,e);var o=n._separators.get(a);o&&o.setSize(i,t)})),this._chartWidth={content:t,yAxis:c,total:s},this._xAxisPane.setWidth(t,c),this._xAxisPane.setOffsetLeft(i,e),this._chartEvent.setChartContentLeftRight({contentLeft:i,contentRight:i+t})}},{key:"getContainer",value:function(){return this._container}},{key:"adjustPaneViewport",value:function(t,e,i,n,r){t&&this._measurePaneHeight();var a=!1;n&&this._panes.forEach((function(t){var e=t.yAxis().computeAxis(r);a||(a=e)})),(!n&&e||n&&a)&&this._measurePaneWidth(),i&&(this._xAxisPane.xAxis().computeAxis(!0),this._xAxisPane.layout(),this._panes.forEach((function(t){t.layout()})))}},{key:"hasPane",value:function(t){return this._panes.has(t)}},{key:"getPane",value:function(t){return this._panes.get(t)}},{key:"chartStore",value:function(){return this._chartStore}},{key:"removeTechnicalIndicator",value:function(t,e){var i=this;if(this._chartStore.technicalIndicatorStore().removeInstance(t,e)){var n=!1;if(t!==Cn&&!this._chartStore.technicalIndicatorStore().hasInstance(t)){n=!0,this._panes.get(t).destroy();var r=this._separators.get(t).topPaneId();this._separators.get(t).destroy(),this._panes.delete(t),this._separators.delete(t),this._separators.forEach((function(t){var e=t.topPaneId();i._separators.has(e)||t.updatePaneId(r)}))}this.adjustPaneViewport(n,!0,!0,!0,!0)}}},{key:"createTechnicalIndicator",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._panes.has(n.id)){var r=this._chartStore.technicalIndicatorStore().addInstance(n.id,t,e);return r&&r.finally((function(t){i.setPaneOptions(n,i._panes.get(n.id).yAxis().computeAxis(!0))})),n.id}var a=n.id||Ni(An),o=!E(n.dragEnabled)||n.dragEnabled;this._separators.set(a,new nn(this._chartContainer,this._chartStore,Array.from(this._panes.keys()).pop(),a,o,{startDrag:this._separatorStartDrag.bind(this),drag:xn(this._separatorDrag.bind(this),50)}));var s=new ki({container:this._chartContainer,chartStore:this._chartStore,xAxis:this._xAxisPane.xAxis(),id:a,height:n.height||100,minHeight:n.minHeight});this._panes.set(a,s);var c=this._chartStore.technicalIndicatorStore().addInstance(a,t,e);return c&&c.finally((function(t){i.adjustPaneViewport(!0,!0,!0,!0,!0)})),a}},{key:"createShape",value:function(t,e,i){var n=e.points,r=e.styles,a=e.lock,o=e.mode,s=e.data,c=e.onDrawStart,h=e.onDrawing,l=e.onDrawEnd,u=e.onClick,f=e.onRightClick,d=e.onPressedMove,v=e.onMouseEnter,p=e.onMouseLeave,_=e.onRemove,y=e.id||Ni("shape_");if(!this._chartStore.shapeStore().hasInstance(y)){var m=null;this.hasPane(i)?m=this._panes.get(i).yAxis():n&&n.length>0&&(i=Cn,m=this._panes.get(Cn).yAxis());var g=new t({id:y,chartStore:this._chartStore,xAxis:this._xAxisPane.xAxis(),yAxis:m,points:n,styles:r,lock:a,mode:o,data:s});return S(c)&&c({id:y}),Bt(g,[{key:"onDrawing",fn:h},{key:"onDrawEnd",fn:l},{key:"onClick",fn:u},{key:"onRightClick",fn:f},{key:"onPressedMove",fn:d},{key:"onMouseEnter",fn:v},{key:"onMouseLeave",fn:p},{key:"onRemove",fn:_}]),this._chartStore.shapeStore().addInstance(g,i),y}return null}},{key:"createAnnotation",value:function(t,e){var i=this,n=[];t.forEach((function(t){var r=t.point,a=t.styles,o=t.checkEventCoordinateOnCustomSymbol,s=t.drawCustomSymbol,c=t.drawExtend,h=t.onClick,l=t.onRightClick,u=t.onMouseEnter,f=t.onMouseLeave;if(r&&r.timestamp){var d=new kn({id:Ni("an_"),chartStore:i._chartStore,point:r,xAxis:i._xAxisPane.xAxis(),yAxis:i._panes.get(e).yAxis(),styles:a});Bt(d,[{key:"drawExtend",fn:c},{key:"drawCustomSymbol",fn:s},{key:"checkEventCoordinateOnCustomSymbol",fn:o},{key:"onClick",fn:h},{key:"onRightClick",fn:l},{key:"onMouseEnter",fn:u},{key:"onMouseLeave",fn:f}]),n.push(d)}})),n.length>0&&this._chartStore.annotationStore().add(n,e)}},{key:"createTag",value:function(t,e){var i=this,n=[],r=!1,a=!1;t.forEach((function(t){var o=t.id,s=t.point,c=t.text,h=t.mark,l=t.styles;if(w(o))if(i._chartStore.tagStore().has(o,e)){var u=i._chartStore.tagStore().update(o,e,{point:s,text:c,mark:h,styles:l});r||(r=u)}else a=!0,n.push(new wn({id:o,point:s,text:c,mark:h,styles:l,chartStore:i._chartStore,xAxis:i._xAxisPane.xAxis(),yAxis:i._panes.get(e).yAxis()}))})),a?this._chartStore.tagStore().add(n,e):r&&this._invalidatePane(ke)}},{key:"removeAllHtml",value:function(){this._panes.forEach((function(t){t.removeHtml()})),this._xAxisPane.removeHtml()}},{key:"setPaneOptions",value:function(t,e){var i=e,n=!1;if(t.id!==Cn){var r=this._panes.get(t.id);if(r){if(b(t.minHeight)&&t.minHeight>0&&r.setMinHeight(t.minHeight),b(t.height)&&t.height>0){var a=r.minHeight(),o=r.minHeight>t.height?a:t.height;r.height()!==o&&(i=!0,r.setHeight(t.height),n=!0)}E(t.dragEnabled)&&this._separators.get(t.id).setDragEnabled(t.dragEnabled)}}i&&this.adjustPaneViewport(n,!0,!0,!0,!0)}},{key:"setTimezone",value:function(t){this._chartStore.timeScaleStore().setTimezone(t),this._xAxisPane.xAxis().computeAxis(!0),this._xAxisPane.invalidate(we)}},{key:"convertToPixel",value:function(t,e){var i,n=this,r=e.paneId,a=void 0===r?Cn:r,o=e.absoluteYAxis,s=[].concat(t),c=[],h=this._chartStore.styleOptions().separator.size,l=0,u=En(this._panes.values());try{var f=function(){var t=i.value;if(t.id()===a)return c=s.map((function(e){var i=e.timestamp,r=e.value,a={},s=e.dataIndex;if(w(i)&&(s=n._chartStore.timeScaleStore().timestampToDataIndex(i)),w(s)&&(a.x=n._xAxisPane.xAxis().convertToPixel(s)),w(r)){var c=t.yAxis().convertToPixel(r);a.y=o?l+c:c}return a})),"break";l+=t.height()+h};for(u.s();!(i=u.n()).done;)if("break"===f())break}catch(t){u.e(t)}finally{u.f()}return x(t)?c:c[0]||{}}},{key:"convertFromPixel",value:function(t,e){var i,n=this,r=e.paneId,a=void 0===r?Cn:r,o=e.absoluteYAxis,s=[].concat(t),c=[],h=this._chartStore.styleOptions().separator.size,l=0,u=En(this._panes.values());try{var f=function(){var t=i.value;if(t.id()===a)return c=s.map((function(e){var i=e.x,r=e.y,a={};if(w(i)&&(a.dataIndex=n._xAxisPane.xAxis().convertFromPixel(i),a.timestamp=n._chartStore.timeScaleStore().dataIndexToTimestamp(a.dataIndex)),w(r)){var s=o?r-l:r;a.value=t.yAxis().convertFromPixel(s)}return a})),"break";l+=t.height()+h};for(u.s();!(i=u.n()).done;)if("break"===f())break}catch(t){u.e(t)}finally{u.f()}return x(t)?c:c[0]||{}}},{key:"chartWidth",value:function(){return this._chartWidth}},{key:"chartHeight",value:function(){return this._chartHeight}},{key:"getConvertPictureUrl",value:function(t,e,i){var n=this,r=this._chartContainer.offsetWidth,a=this._chartContainer.offsetHeight,o=We("canvas",{width:"".concat(r,"px"),height:"".concat(a,"px"),boxSizing:"border-box"}),s=o.getContext("2d"),c=ee(o);o.width=r*c,o.height=a*c,s.scale(c,c),s.fillStyle=i,s.fillRect(0,0,r,a);var h=0;return this._panes.forEach((function(e,i){if(i!==Cn){var a=n._separators.get(i);s.drawImage(a.getImage(),0,h,r,a.height()),h+=a.height()}s.drawImage(e.getImage(t),0,h,r,e.height()),h+=e.height()})),s.drawImage(this._xAxisPane.getImage(t),0,h,r,this._xAxisPane.height()),o.toDataURL("image/".concat(e))}},{key:"destroy",value:function(){this._panes.forEach((function(t){t.destroy()})),this._separators.forEach((function(t){t.destroy()})),this._panes.clear(),this._separators.clear(),this._xAxisPane.destroy(),this._container.removeChild(this._chartContainer),this._chartEvent.destroy()}}]),t}(),In=function(){function t(e,i){v(this,t),this._chartPane=new Mn(e,i)}return _(t,[{key:"getDom",value:function(t){if(t){if(!k(t))return null;var e=t.position,i=this._chartPane.getPane(t.paneId);return i&&i.container(e)||null}return this._chartPane.getContainer()}},{key:"getWidth",value:function(){return this._chartPane.chartWidth()}},{key:"getHeight",value:function(){return this._chartPane.chartHeight()}},{key:"setStyleOptions",value:function(t){k(t)&&(this._chartPane.chartStore().applyStyleOptions(t),this._chartPane.adjustPaneViewport(!0,!0,!0,!0,!0))}},{key:"getStyleOptions",value:function(){return g(this._chartPane.chartStore().styleOptions())}},{key:"setPriceVolumePrecision",value:function(t,e){b(t)&&t>=0&&b(e)&&e>=0&&this._chartPane.chartStore().setPriceVolumePrecision(t,e)}},{key:"setTimezone",value:function(t){this._chartPane.setTimezone(t)}},{key:"getTimezone",value:function(){return this._chartPane.chartStore().timeScaleStore().timezone()}},{key:"resize",value:function(){this._chartPane.adjustPaneViewport(!0,!0,!0,!0,!0)}},{key:"setOffsetRightSpace",value:function(t){b(t)&&this._chartPane.chartStore().timeScaleStore().setOffsetRightSpace(t,!0)}},{key:"setLeftMinVisibleBarCount",value:function(t){b(t)&&t>0&&this._chartPane.chartStore().timeScaleStore().setLeftMinVisibleBarCount(Math.ceil(t))}},{key:"setRightMinVisibleBarCount",value:function(t){b(t)&&t>0&&this._chartPane.chartStore().timeScaleStore().setRightMinVisibleBarCount(Math.ceil(t))}},{key:"setDataSpace",value:function(t){b(t)&&this._chartPane.chartStore().timeScaleStore().setDataSpace(t)}},{key:"getDataSpace",value:function(){return this._chartPane.chartStore().timeScaleStore().dataSpace()}},{key:"getBarSpace",value:function(){return this._chartPane.chartStore().timeScaleStore().barSpace()}},{key:"clearData",value:function(){this._chartPane.chartStore().clearDataList()}},{key:"getDataList",value:function(){return this._chartPane.chartStore().dataList()}},{key:"applyNewData",value:function(t,e){var i=this;if(x(t)){var n=this._chartPane.chartStore();n.clearDataList(),n.addData(t,0,e),n.technicalIndicatorStore().calcInstance().finally((function(t){i._chartPane.adjustPaneViewport(!1,!0,!0,!0)}))}}},{key:"applyMoreData",value:function(t,e){var i=this;if(x(t)){var n=this._chartPane.chartStore();n.addData(t,0,e),n.technicalIndicatorStore().calcInstance().finally((function(t){i._chartPane.adjustPaneViewport(!1,!0,!0,!0)}))}}},{key:"updateData",value:function(t){var e=this;if(k(t)&&!x(t)){var i=this._chartPane.chartStore(),n=i.dataList(),r=n.length,a=et(t,"timestamp",0),o=et(n[r-1],"timestamp",0);if(a>=o){var s=r;a===o&&(s=r-1),i.addData(t,s),i.technicalIndicatorStore().calcInstance().finally((function(t){e._chartPane.adjustPaneViewport(!1,!0,!0,!0)}))}}}},{key:"loadMore",value:function(t){S(t)&&this._chartPane.chartStore().timeScaleStore().setLoadMoreCallback(t)}},{key:"createTechnicalIndicator",value:function(t,e,i){if(!w(t))return null;var n=k(t)&&!x(t)?t:{name:t};return this._chartPane.chartStore().technicalIndicatorStore().hasTemplate(n.name)?this._chartPane.createTechnicalIndicator(n,e,i):null}},{key:"addTechnicalIndicatorTemplate",value:function(t){if(k(t)){var e=[].concat(t);this._chartPane.chartStore().technicalIndicatorStore().addTemplate(e)}}},{key:"overrideTechnicalIndicator",value:function(t,e){var i=this;if(k(t)&&!x(t)){var n=this._chartPane.chartStore().technicalIndicatorStore().override(t,e);n&&n.then((function(t){i._chartPane.adjustPaneViewport(!1,!0,!0,!0)}))}}},{key:"getTechnicalIndicatorTemplate",value:function(t){return this._chartPane.chartStore().technicalIndicatorStore().getTemplateInfo(t)}},{key:"getTechnicalIndicatorByPaneId",value:function(t,e){return this._chartPane.chartStore().technicalIndicatorStore().getInstanceInfo(t,e)}},{key:"removeTechnicalIndicator",value:function(t,e){this._chartPane.removeTechnicalIndicator(t,e)}},{key:"addShapeTemplate",value:function(t){if(k(t)){var e=[].concat(t);this._chartPane.chartStore().shapeStore().addTemplate(e)}}},{key:"createShape",value:function(t,e){if(!w(t))return null;var i=k(t)&&!x(t)?t:{name:t},n=this._chartPane.chartStore().shapeStore().getTemplate(i.name);return n?this._chartPane.createShape(n,i,e):null}},{key:"getShape",value:function(t){return this._chartPane.chartStore().shapeStore().getInstanceInfo(t)}},{key:"setShapeOptions",value:function(t){k(t)&&!x(t)&&this._chartPane.chartStore().shapeStore().setInstanceOptions(t)}},{key:"removeShape",value:function(t){this._chartPane.chartStore().shapeStore().removeInstance(t)}},{key:"createAnnotation",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cn;if(k(t)&&this._chartPane.hasPane(e)){var i=[].concat(t);this._chartPane.createAnnotation(i,e)}}},{key:"removeAnnotation",value:function(t,e){this._chartPane.chartStore().annotationStore().remove(t,e)}},{key:"createTag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cn;if(k(t)&&this._chartPane.hasPane(e)){var i=[].concat(t);this._chartPane.createTag(i,e)}}},{key:"removeTag",value:function(t,e){this._chartPane.chartStore().tagStore().remove(t,e)}},{key:"createHtml",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cn;if(!k(t))return null;if(!(P(t.content)||t.content instanceof HTMLElement))return null;var i=this._chartPane.getPane(e);return i?i.createHtml(t):null}},{key:"removeHtml",value:function(t,e){if(t){var i=this._chartPane.getPane(t);i&&i.removeHtml(e)}else this._chartPane.removeAllHtml()}},{key:"setPaneOptions",value:function(t){k(t)&&this._chartPane.setPaneOptions(t,!1)}},{key:"setZoomEnabled",value:function(t){this._chartPane.chartStore().timeScaleStore().setZoomEnabled(t)}},{key:"isZoomEnabled",value:function(){return this._chartPane.chartStore().timeScaleStore().zoomEnabled()}},{key:"setScrollEnabled",value:function(t){this._chartPane.chartStore().timeScaleStore().setScrollEnabled(t)}},{key:"isScrollEnabled",value:function(){return this._chartPane.chartStore().timeScaleStore().scrollEnabled()}},{key:"scrollByDistance",value:function(t,e){var i=this;if(b(t))if(b(e)&&e>0){this._chartPane.chartStore().timeScaleStore().startScroll();var n=(new Date).getTime();!function r(){var a=((new Date).getTime()-n)/e,o=a>=1,s=o?t:t*a;i._chartPane.chartStore().timeScaleStore().scroll(s),o||Ke(r)}()}else this._chartPane.chartStore().timeScaleStore().startScroll(),this._chartPane.chartStore().timeScaleStore().scroll(t)}},{key:"scrollToRealTime",value:function(t){var e=this._chartPane.chartStore().timeScaleStore().dataSpace(),i=this._chartPane.chartStore().timeScaleStore().offsetRightBarCount()-this._chartPane.chartStore().timeScaleStore().offsetRightSpace()/e;this.scrollByDistance(i*e,t)}},{key:"scrollToDataIndex",value:function(t,e){if(b(t)){var i=(this._chartPane.chartStore().timeScaleStore().offsetRightBarCount()+(this.getDataList().length-1-t))*this._chartPane.chartStore().timeScaleStore().dataSpace();this.scrollByDistance(i,e)}}},{key:"scrollToTimestamp",value:function(t,e){if(b(t)){var i=at(this.getDataList(),"timestamp",t);this.scrollToDataIndex(i,e)}}},{key:"zoomAtCoordinate",value:function(t,e,i){var n=this;if(b(t))if(b(i)&&i>0){var r=this._chartPane.chartStore().timeScaleStore().dataSpace(),a=r*t-r,o=(new Date).getTime();!function t(){var s=((new Date).getTime()-o)/i,c=s>=1,h=c?a:a*s;n._chartPane.chartStore().timeScaleStore().zoom(h/r,e),c||Ke(t)}()}else this._chartPane.chartStore().timeScaleStore().zoom(t,e)}},{key:"zoomAtDataIndex",value:function(t,e,i){if(b(t)&&b(e)){var n=this._chartPane.chartStore().timeScaleStore().dataIndexToCoordinate(e);this.zoomAtCoordinate(t,{x:n},i)}}},{key:"zoomAtTimestamp",value:function(t,e,i){if(b(t)&&b(e)){var n=at(this.getDataList(),"timestamp",e);this.zoomAtDataIndex(t,n,i)}}},{key:"convertToPixel",value:function(t,e){return this._chartPane.convertToPixel(t,e)}},{key:"convertFromPixel",value:function(t,e){return this._chartPane.convertFromPixel(t,e)}},{key:"subscribeAction",value:function(t,e){lt(t)&&S(e)&&this._chartPane.chartStore().actionStore().subscribe(t,e)}},{key:"unsubscribeAction",value:function(t,e){lt(t)&&this._chartPane.chartStore().actionStore().unsubscribe(t,e)}},{key:"getConvertPictureUrl",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"jpeg",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#FFFFFF";if("png"===e||"jpeg"===e||"bmp"===e)return this._chartPane.getConvertPictureUrl(t,e,i)}},{key:"destroy",value:function(){this._chartPane.destroy()}}]),t}(),On={},Tn=1,Dn="k_line_chart_",Rn={version:function(){return"8.6.3"},init:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return null;if(!(e=P(t)?document.getElementById(t):t))return null;var n=On[e.chartId||""];if(n)return n;var r="".concat(Dn).concat(Tn++);return(n=new In(e,i)).id=r,e.chartId=r,On[r]=n,n},dispose:function(t){if(t){var e;if(P(t)){var i=document.getElementById(t);e=i&&i.chartId}else e=t instanceof In?t.id:t&&t.chartId;e&&(On[e].destroy(),delete On[e])}},utils:{clone:g,merge:m,isString:P,isNumber:b,isValid:w,isObject:k,isArray:x,isFunction:S,isBoolean:E,formatValue:et,formatPrecision:nt,formatBigNumber:rt},extension:d};return Rn.extension.addTechnicalIndicatorTemplate([{name:"AVP",shortName:"AVP",series:"price",precision:2,plots:[{key:"avp",title:"AVP: ",type:"line"}],calcTechnicalIndicator:function(t){var e=0,i=0;return t.map((function(t){var n={};return e+=t.turnover||0,0!==(i+=t.volume||0)&&(n.avp=e/i),n}))}},t,e,i,{name:"EMV",shortName:"EMV",calcParams:[14,9],plots:[{key:"emv",title:"EMV: ",type:"line"},{key:"maEmv",title:"MAEMV: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=0,r=0,a=[],o=[];return t.forEach((function(e,s){var c={},h=t[s-1]||e,l=e.high,u=e.low,f=e.turnover||0,d=0;0!==f&&(d=((l+u)/2-(h.high+h.low)/2)*(l-u)/f),a.push(d),n+=d,i[0]-1>s||(c.emv=n,n-=a[s-(i[0]-1)],r+=c.emv,i[0]+i[1]-2>s||(c.maEmv=r/i[1],r-=o[s-(i[1]-1)].emv)),o.push(c)})),o}},{name:"EMA",shortName:"EMA",series:"price",calcParams:[6,12,20],precision:2,shouldCheckParamCount:!1,shouldOhlc:!0,plots:[{key:"ema6",title:"EMA6: ",type:"line"},{key:"ema12",title:"EMA12: ",type:"line"},{key:"ema20",title:"EMA20: ",type:"line"}],regeneratePlots:function(t){return t.map((function(t){return{key:"ema".concat(t),title:"EMA".concat(t,": "),type:"line"}}))},calcTechnicalIndicator:function(t,e){var i=e.params,n=e.plots,r=0,a=[];return t.map((function(t,e){var o={},s=t.close;return r+=s,i.forEach((function(t,i){t-1>e||(a[i]=e>t-1?(2*s+(t-1)*a[i])/(t+1):r/t,o[n[i].key]=a[i])})),o}))}},{name:"MA",shortName:"MA",series:"price",calcParams:[5,10,30,60],precision:2,shouldCheckParamCount:!1,shouldOhlc:!0,plots:[{key:"ma5",title:"MA5: ",type:"line"},{key:"ma10",title:"MA10: ",type:"line"},{key:"ma30",title:"MA30: ",type:"line"},{key:"ma60",title:"MA60: ",type:"line"}],regeneratePlots:function(t){return t.map((function(t){return{key:"ma".concat(t),title:"MA".concat(t,": "),type:"line"}}))},calcTechnicalIndicator:function(t,e){var i=e.params,n=e.plots,r=[];return t.map((function(e,a){var o={},s=e.close;return i.forEach((function(e,i){r[i]=(r[i]||0)+s,e-1>a||(o[n[i].key]=r[i]/e,r[i]-=t[a-(e-1)].close)})),o}))}},n,{name:"SMA",shortName:"SMA",series:"price",calcParams:[12,2],precision:2,plots:[{key:"sma",title:"SMA: ",type:"line"}],shouldCheckParamCount:!0,shouldOhlc:!0,calcTechnicalIndicator:function(t,e){var i=e.params,n=0,r=0;return t.map((function(t,e){var a={},o=t.close;return n+=o,i[0]-1>e||(a.sma=r=e>i[0]-1?(o*i[1]+r*(i[0]-i[1]+1))/(i[0]+1):n/i[0]),a}))}},{name:"TRIX",shortName:"TRIX",calcParams:[12,9],plots:[{key:"trix",title:"TRIX: ",type:"line"},{key:"maTrix",title:"MATRIX: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i,n,r,a=e.params,o=0,s=0,c=0,h=0,l=[];return t.forEach((function(t,e){var u={},f=t.close;if(o+=f,e>=a[0]-1&&(s+=i=e>a[0]-1?(2*f+(a[0]-1)*i)/(a[0]+1):o/a[0],e>=2*a[0]-2&&(c+=n=e>2*a[0]-2?(2*i+(a[0]-1)*n)/(a[0]+1):s/a[0],e>=3*a[0]-3))){var d,v=0;e>3*a[0]-3?v=((d=(2*n+(a[0]-1)*r)/(a[0]+1))-r)/r*100:d=c/a[0],r=d,u.trix=v,h+=v,3*a[0]+a[1]-4>e||(u.maTrix=h/a[1],h-=l[e-(a[1]-1)].trix)}l.push(u)})),l}},{name:"BRAR",shortName:"BRAR",calcParams:[26],plots:[{key:"br",title:"BR: ",type:"line"},{key:"ar",title:"AR: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=0,r=0,a=0,o=0;return t.map((function(e,s){var c={},h=e.high,l=e.low,u=e.open,f=(t[s-1]||e).close;if(a+=h-u,o+=u-l,n+=h-f,r+=f-l,s>=i[0]-1){c.ar=0!==o?a/o*100:0,c.br=0!==r?n/r*100:0;var d=t[s-(i[0]-1)],v=d.high,p=d.low,_=d.open,y=(t[s-i[0]]||t[s-(i[0]-1)]).close;n-=v-y,r-=y-p,a-=v-_,o-=_-p}return c}))}},r,{name:"MTM",shortName:"MTM",calcParams:[12,6],plots:[{key:"mtm",title:"MTM: ",type:"line"},{key:"maMtm",title:"MAMTM: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=0,r=[];return t.forEach((function(e,a){var o={};a<i[0]||(o.mtm=e.close-t[a-i[0]].close,n+=o.mtm,i[0]+i[1]-1>a||(o.maMtm=n/i[1],n-=r[a-(i[1]-1)].mtm)),r.push(o)})),r}},{name:"PSY",shortName:"PSY",calcParams:[12,6],plots:[{key:"psy",title:"PSY: ",type:"line"},{key:"maPsy",title:"MAPSY: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=0,r=0,a=[],o=[];return t.forEach((function(e,s){var c={},h=e.close-(t[s-1]||e).close>0?1:0;a.push(h),n+=h,i[0]-1>s||(c.psy=n/i[0]*100,r+=c.psy,i[0]+i[1]-2>s||(c.maPsy=r/i[1],r-=o[s-(i[1]-1)].psy),n-=a[s-(i[0]-1)]),o.push(c)})),o}},{name:"ROC",shortName:"ROC",calcParams:[12,6],shouldCheckParamCount:!0,plots:[{key:"roc",title:"ROC: ",type:"line"},{key:"maRoc",title:"MAROC: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=[],r=0;return t.forEach((function(e,a){var o={};if(a>=i[0]-1){var s=(t[a-i[0]]||t[a-(i[0]-1)]).close;o.roc=0!==s?(e.close-s)/s*100:0,r+=o.roc,i[0]-1+i[1]-1>a||(o.maRoc=r/i[1],r-=n[a-(i[1]-1)].roc)}n.push(o)})),n}},{name:"VR",shortName:"VR",calcParams:[26,6],plots:[{key:"vr",title:"VR: ",type:"line"},{key:"maVr",title:"MAVR: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=0,r=0,a=0,o=0,s=[];return t.forEach((function(e,c){var h={},l=e.close,u=(t[c-1]||e).close,f=e.volume;if(l>u?n+=f:u>l?r+=f:a+=f,c>=i[0]-1){var d=a/2;h.vr=r+d===0?0:(n+d)/(r+d)*100,o+=h.vr,i[0]+i[1]-2>c||(h.maVr=o/i[1],o-=s[c-(i[1]-1)].vr);var v=t[c-(i[0]-1)],p=t[c-i[0]]||v,_=v.close,y=v.volume;_>p.close?n-=y:p.close>_?r-=y:a-=y}s.push(h)})),s}},a,{name:"BIAS",shortName:"BIAS",calcParams:[6,12,24],shouldCheckParamCount:!1,plots:[{key:"bias6",title:"BIAS6: ",type:"line"},{key:"bias12",title:"BIAS12: ",type:"line"},{key:"bias24",title:"BIAS24: ",type:"line"}],regeneratePlots:function(t){return t.map((function(t){return{key:"bias".concat(t),title:"BIAS".concat(t,": "),type:"line"}}))},calcTechnicalIndicator:function(t,e){var i=e.params,n=e.plots,r=[];return t.map((function(e,a){var o={},s=e.close;return i.forEach((function(e,c){if(r[c]=(r[c]||0)+s,a>=e-1){var h=r[c]/i[c];o[n[c].key]=(s-h)/h*100,r[c]-=t[a-(e-1)].close}})),o}))}},o,s,h,l,u,f,{name:"OBV",shortName:"OBV",calcParams:[30],plots:[{key:"obv",title:"OBV: ",type:"line"},{key:"maObv",title:"MAOBV: ",type:"line"}],calcTechnicalIndicator:function(t,e){var i=e.params,n=0,r=0,a=[];return t.forEach((function(e,o){var s=t[o-1]||e;s.close>e.close?r-=e.volume:e.close>s.close&&(r+=e.volume);var c={obv:r};n+=r,i[0]-1>o||(c.maObv=n/i[0],n-=a[o-(i[0]-1)].obv),a.push(c)})),a}},{name:"PVT",shortName:"PVT",plots:[{key:"pvt",title:"PVT: ",type:"line"}],calcTechnicalIndicator:function(t){var e=0;return t.map((function(i,n){var r={},a=(t[n-1]||i).close,o=0;return 0!==a&&(o=(i.close-a)/a*i.volume),r.pvt=e+=o,r}))}},{name:"VOL",shortName:"VOL",series:"volume",calcParams:[5,10,20],shouldCheckParamCount:!1,shouldFormatBigNumber:!0,precision:0,minValue:0,plots:[{key:"ma5",title:"MA5: ",type:"line"},{key:"ma10",title:"MA10: ",type:"line"},{key:"ma20",title:"MA20: ",type:"line"},{key:"volume",title:"VOLUME: ",type:"bar",baseValue:0,color:function(t,e){var i=t.current.kLineData||{};return i.close>i.open?e.bar.upColor:i.open>i.close?e.bar.downColor:e.bar.noChangeColor}}],regeneratePlots:function(t){var e=t.map((function(t){return{key:"ma".concat(t),title:"MA".concat(t,": "),type:"line"}}));return e.push({key:"volume",title:"VOLUME: ",type:"bar",baseValue:0,color:function(t,e){var i=t.current.kLineData||{};return i.close>i.open?e.bar.upColor:i.open>i.close?e.bar.downColor:e.bar.noChangeColor}}),e},calcTechnicalIndicator:function(t,e){var i=e.params,n=e.plots,r=[];return t.map((function(e,a){var o=e.volume||0,s={volume:o};return i.forEach((function(e,i){r[i]=(r[i]||0)+o,e-1>a||(s[n[i].key]=r[i]/e,r[i]-=t[a-(e-1)].volume)})),s}))}}]),Rn.extension.addShapeTemplate([{name:"horizontalRayLine",totalStep:3,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return $t(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates,i={x:0,y:e[0].y};return e[1]&&e[1].x>e[0].x&&(i.x=t.viewport.width),[{type:"line",isDraw:!0,isCheck:!0,dataSource:[[e[0],i]]}]},performEventPressedMove:function(t){var e=t.points,i=t.pressPoint;e[0].value=i.value,e[1].value=i.value},performEventMoveForDrawing:function(t){2===t.step&&(t.points[0].value=t.movePoint.value)}},{name:"horizontalSegment",totalStep:3,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Xt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates,i=[];return 2===e.length&&(i=[e]),[{type:"line",isDraw:!0,isCheck:!0,dataSource:i}]},performEventPressedMove:function(t){var e=t.points,i=t.pressPoint;e[0].value=i.value,e[1].value=i.value},performEventMoveForDrawing:function(t){2===t.step&&(t.points[0].value=t.movePoint.value)}},{name:"horizontalStraightLine",totalStep:2,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Wt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates;return[{type:"line",isDraw:!0,isCheck:!0,dataSource:[[{x:0,y:e[0].y},{x:t.viewport.width,y:e[0].y}]]}]}},{name:"verticalRayLine",totalStep:3,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return $t(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates,i={x:e[0].x,y:0};return e[1]&&e[1].y>e[0].y&&(i.y=t.viewport.height),[{type:"line",isDraw:!0,isCheck:!0,dataSource:[[e[0],i]]}]},performEventPressedMove:function(t){var e=t.points,i=t.pressPoint;e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex,e[1].timestamp=i.timestamp,e[1].dataIndex=i.dataIndex},performEventMoveForDrawing:function(t){var e=t.points,i=t.movePoint;2===t.step&&(e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex)}},{name:"verticalSegment",totalStep:3,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Xt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates,i=[];return 2===e.length&&(i=[e]),[{type:"line",isDraw:!0,isCheck:!0,dataSource:i}]},performEventPressedMove:function(t){var e=t.points,i=t.pressPoint;e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex,e[1].timestamp=i.timestamp,e[1].dataIndex=i.dataIndex},performEventMoveForDrawing:function(t){var e=t.points,i=t.movePoint;2===t.step&&(e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex)}},{name:"verticalStraightLine",totalStep:2,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Wt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates;return[{type:"line",isDraw:!0,isCheck:!0,dataSource:[[{x:e[0].x,y:0},{x:e[0].x,y:t.viewport.height}]]}]}},{name:"rayLine",totalStep:3,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return $t(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e,i,n,r=t.coordinates,a=t.viewport;return[{type:"line",isDraw:!0,isCheck:!0,dataSource:[(e=r[0],i=r[1],n={x:a.width,y:a.height},e&&i?[e,e.x===i.x&&e.y!==i.y?i.y>e.y?{x:e.x,y:n.y}:{x:e.x,y:0}:e.x>i.x?{x:0,y:Nt(e,i,{x:0,y:e.y})}:{x:n.x,y:Nt(e,i,{x:n.x,y:e.y})}]:[])]}]}},{name:"segment",totalStep:3,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Xt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates,i=[];return 2===e.length&&(i=[e]),[{type:"line",isDraw:!0,isCheck:!0,dataSource:i}]}},{name:"straightLine",totalStep:3,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Wt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates,i=t.viewport;return 2>e.length||e[0].x===e[1].x?[{type:"line",isDraw:!0,isCheck:!0,dataSource:[[{x:e[0].x,y:0},{x:e[0].x,y:i.height}]]}]:[{type:"line",isDraw:!0,isCheck:!0,dataSource:[[{x:0,y:Nt(e[0],e[1],{x:0,y:e[0].y})},{x:i.width,y:Nt(e[0],e[1],{x:i.width,y:e[0].y})}]]}]}},{name:"parallelStraightLine",totalStep:4,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Wt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.viewport;return[{type:"line",isDraw:!0,isCheck:!0,dataSource:Ut(t.coordinates,{x:e.width,y:e.height})}]}},{name:"priceChannelLine",totalStep:4,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Wt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.viewport;return[{type:"line",isDraw:!0,isCheck:!0,dataSource:Ut(t.coordinates,{x:e.width,y:e.height},1)}]}},{name:"priceLine",totalStep:2,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return $t(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.coordinates;return[{type:"line",isDraw:!0,isCheck:!0,dataSource:[[e[0],{x:t.viewport.width,y:e[0].y}]]},{type:"text",isDraw:!0,isCheck:!1,dataSource:[{x:e[0].x,y:e[0].y,text:t.points[0].value.toFixed(t.precision.price)}]}]}},{name:"fibonacciLine",totalStep:3,checkEventCoordinateOnShape:function(t){var e=t.dataSource;return Wt(e[0],e[1],t.eventCoordinate)},createShapeDataSource:function(t){var e=t.points,i=t.coordinates,n=t.precision;if(i.length>0){var r=[],a=[],o=t.viewport.width;if(i.length>1){var s=i[0].y-i[1].y,c=e[0].value-e[1].value;[1,.786,.618,.5,.382,.236,0].forEach((function(t){var h=i[1].y+s*t,l=(e[1].value+c*t).toFixed(n.price);r.push([{x:0,y:h},{x:o,y:h}]),a.push({x:0,y:h,text:"".concat(l," (").concat((100*t).toFixed(1),"%)")})}))}return[{type:"line",isDraw:!0,isCheck:!0,dataSource:r},{type:"text",isDraw:!0,isCheck:!1,dataSource:a}]}return[]}}]),Rn}()},"692d":function(t,e,i){(function(e){var i;i=function(){"use strict";var t={165:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.abs=void 0,e.abs=function(t){return"-"==(t="number"!=typeof t&&"bigint"!=typeof t?t:t.toString())[0]?t.substring(1):t}},217:function(t,e){function i(t){if(o(t))return t;for(var e="",i=t.length,n=t.split(".")[1],r=(n=n?n.length:0,0);r<i;r++)"0"<=t[r]&&t[r]<="9"?e+=9-parseInt(t[r]):e+=t[r];return a(e,0<n?"0."+new Array(n).join("0")+"1":"1")}function n(t){var e=t.split(".");for(e[0]||(e[0]="0");"0"==e[0][0]&&1<e[0].length;)e[0]=e[0].substring(1);return e[0]+(e[1]?"."+e[1]:"")}function r(t,e){var i=t.split("."),n=e.split("."),r=i[0].length,a=n[0].length;return a<r?n[0]=new Array(Math.abs(r-a)+1).join("0")+(n[0]||""):i[0]=new Array(Math.abs(r-a)+1).join("0")+(i[0]||""),r=i[1]?i[1].length:0,a=n[1]?n[1].length:0,(r||a)&&(a<r?n[1]=(n[1]||"")+new Array(Math.abs(r-a)+1).join("0"):i[1]=(i[1]||"")+new Array(Math.abs(r-a)+1).join("0")),[t=i[0]+(i[1]?"."+i[1]:""),e=n[0]+(n[1]?"."+n[1]:"")]}function a(t,e){var i=r(t,e);t=i[0],e=i[1];for(var n,a="",o=0,s=t.length-1;0<=s;s--)"."===t[s]?a="."+a:(a=(n=parseInt(t[s])+parseInt(e[s])+o)%10+a,o=Math.floor(n/10));return o?o.toString()+a:a}function o(t){return/^0[0]*[.]{0,1}[0]*$/.test(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.pad=e.trim=e.add=void 0,e.add=function(t,e){void 0===e&&(e="0");var s=0,c=-1,h=("-"!=t[0]||o(t=t.substring(1))||(s++,c=1,t.length),"-"!=e[0]||o(e=e.substring(1))||(s++,c=2,e.length),t=n(t),e=n(e),t=(h=r(n(t),n(e)))[0],e=h[1],1==s&&(1===c?t=i(t):2===c&&(e=i(e))),a(t,e));return s?2==s?"-"+n(h):t.length<h.length?n(h.substring(1)):"-"+n(i(h)):n(h)},e.trim=n,e.pad=r},423:function(t,e,i){var n=i(217),r=i(165),a=i(350),o=i(182),s=i(415),c=i(213),h=i(664),l=i(26),u=i(916);function f(t){this.value=f.validate(t=void 0===t?"0":t)}f.validate=function(t){if(t){if(t=t.toString(),isNaN(t))throw Error("Parameter is not a number: "+t);"+"==t[0]&&(t=t.substring(1))}else t="0";var e,i,r;return t.startsWith(".")?t="0"+t:t.startsWith("-.")&&(t="-0"+t.substr(1)),/e/i.test(t)&&(i=(e=t.split(/[eE]/))[0],e=e[1],"-"==(i=(r="",n.trim)(i))[0]&&(r="-",i=i.substring(1)),0<=i.indexOf(".")?(e=parseInt(e)+i.indexOf("."),i=i.replace(".","")):e=parseInt(e)+i.length,t=i.length<e?r+i+new Array(e-i.length+1).join("0"):i.length>=e&&0<e?r+(0,n.trim)(i.substring(0,e))+(i.length>e?"."+i.substring(e):""):r+"0."+new Array(1-e).join("0")+i),t},f.prototype.getValue=function(){return this.value},f.prototype.setValue=function(t){this.value=f.validate(t)},f.getPrettyValue=function(t,e,i){if(e||i){if(!e||!i)throw Error("Illegal Arguments. Should pass both digits and separator or pass none")}else e=3,i=",";for(var n="-"==(t=f.validate(t)).charAt(0),r=(t=n?t.substring(1):t).indexOf("."),a="",o=r=0<r?r:t.length;0<o;)o<e?(e=o,o=0):o-=e,a=t.substring(o,o+e)+(o<r-e&&0<=o?i:"")+a;return(n?"-":"")+a+t.substring(r)},f.prototype.getPrettyValue=function(t,e){return f.getPrettyValue(this.value,t,e)},f.round=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=u.RoundingModes.HALF_EVEN),t=f.validate(t),isNaN(e))throw Error("Precision is not a number: "+e);return(0,a.roundOff)(t,e,i)},f.prototype.round=function(t,e){if(void 0===t&&(t=0),void 0===e&&(e=u.RoundingModes.HALF_EVEN),isNaN(t))throw Error("Precision is not a number: "+t);return new f((0,a.roundOff)(this.value,t,e))},f.abs=function(t){return t=f.validate(t),(0,r.abs)(t)},f.prototype.abs=function(){return new f((0,r.abs)(this.value))},f.floor=function(t){return-1===(t=f.validate(t)).indexOf(".")?t:f.round(t,0,u.RoundingModes.FLOOR)},f.prototype.floor=function(){return-1===this.value.indexOf(".")?new f(this.value):new f(this.value).round(0,u.RoundingModes.FLOOR)},f.ceil=function(t){return-1===(t=f.validate(t)).indexOf(".")?t:f.round(t,0,u.RoundingModes.CEILING)},f.prototype.ceil=function(){return-1===this.value.indexOf(".")?new f(this.value):new f(this.value).round(0,u.RoundingModes.CEILING)},f.add=function(t,e){return t=f.validate(t),e=f.validate(e),(0,n.add)(t,e)},f.prototype.add=function(t){return new f((0,n.add)(this.value,t.getValue()))},f.subtract=function(t,e){return t=f.validate(t),e=f.validate(e),(0,l.subtract)(t,e)},f.prototype.subtract=function(t){return new f((0,l.subtract)(this.value,t.getValue()))},f.multiply=function(t,e){return t=f.validate(t),e=f.validate(e),(0,o.multiply)(t,e)},f.prototype.multiply=function(t){return new f((0,o.multiply)(this.value,t.getValue()))},f.divide=function(t,e,i){return t=f.validate(t),e=f.validate(e),(0,s.divide)(t,e,i)},f.prototype.divide=function(t,e){return new f((0,s.divide)(this.value,t.getValue(),e))},f.modulus=function(t,e){return t=f.validate(t),e=f.validate(e),(0,c.modulus)(t,e)},f.prototype.modulus=function(t){return new f((0,c.modulus)(this.value,t.getValue()))},f.compareTo=function(t,e){return t=f.validate(t),e=f.validate(e),(0,h.compareTo)(t,e)},f.prototype.compareTo=function(t){return(0,h.compareTo)(this.value,t.getValue())},f.negate=function(t){return t=f.validate(t),(0,l.negate)(t)},f.prototype.negate=function(){return new f((0,l.negate)(this.value))},f.RoundingModes=u.RoundingModes,t.exports=f},664:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.compareTo=void 0;var n=i(217);e.compareTo=function(t,e){var i,r=!1;if("-"==t[0]&&"-"!=e[0])return-1;if("-"!=t[0]&&"-"==e[0])return 1;if("-"==t[0]&&"-"==e[0]&&(t=t.substr(1),e=e.substr(1),r=!0),t=(i=(0,n.pad)(t,e))[0],e=i[1],0!=t.localeCompare(e))for(var a=0;a<t.length;a++)if(t[a]!=e[a])return t[a]>e[a]?r?-1:1:r?1:-1;return 0}},415:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.divide=void 0;var n=i(217),r=i(350);e.divide=function(t,e,i){if(void 0===i&&(i=8),0==e)throw new Error("Cannot divide by 0");if(t=t.toString(),e=e.toString(),t=t.replace(/(\.\d*?[1-9])0+$/g,"$1").replace(/\.0+$/,""),e=e.replace(/(\.\d*?[1-9])0+$/g,"$1").replace(/\.0+$/,""),0==t)return"0";var a,o=0,s=("-"==e[0]&&(e=e.substring(1),o++),"-"==t[0]&&(t=t.substring(1),o++),0<e.indexOf(".")?e.length-e.indexOf(".")-1:-1),c=(e=(0,n.trim)(e.replace(".","")),0<=s&&(-1==(a=0<t.indexOf(".")?t.length-t.indexOf(".")-1:-1)?t=(0,n.trim)(t+new Array(1+s).join("0")):a<s?(t=t.replace(".",""),t=(0,n.trim)(t+new Array(s-a+1).join("0"))):s<a?(h=(t=t.replace(".","")).length-a+s,t=(0,n.trim)(t.substring(0,h)+"."+t.substring(h))):s==a&&(t=(0,n.trim)(t.replace(".","")))),0),h=e.length,l="",u=-1<t.indexOf(".")&&t.indexOf(".")<h?t.substring(0,h+1):t.substring(0,h);for(t=-1<t.indexOf(".")&&t.indexOf(".")<h?t.substring(h+1):t.substring(h),-1<u.indexOf(".")&&(s=u.length-u.indexOf(".")-1,h>(u=u.replace(".","")).length&&(s+=h-u.length,u+=new Array(h-u.length+1).join("0")),c=s,l="0."+new Array(s).join("0")),i+=2;c<=i;){for(var f=0;parseInt(u)>=parseInt(e);)u=(0,n.add)(u,"-"+e),f++;l+=f,t?("."==t[0]&&(l+=".",c++,t=t.substring(1)),u+=t.substring(0,1),t=t.substring(1)):(c||(l+="."),c++,u+="0")}return(1==o?"-":"")+(0,n.trim)((0,r.roundOff)(l,i-2))}},213:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.modulus=void 0;var n=i(415),r=i(350),a=i(182),o=i(26),s=i(916);function c(t){if(-1!=t.indexOf("."))throw new Error("Modulus of non-integers not supported")}e.modulus=function(t,e){if(0==e)throw new Error("Cannot divide by 0");t=t.toString(),e=e.toString(),c(t),c(e);var i="";"-"==t[0]&&(i="-",t=t.substr(1)),"-"==e[0]&&(e=e.substr(1)),t=(0,o.subtract)(t,(0,a.multiply)(e,(0,r.roundOff)((0,n.divide)(t,e),0,s.RoundingModes.FLOOR)));return i+t}},182:function(t,e){function i(t){for(;"0"==t[0];)t=t.substr(1);if(-1!=t.indexOf("."))for(;"0"==t[t.length-1];)t=t.substr(0,t.length-1);return""==t||"."==t?t="0":"."==t[t.length-1]&&(t=t.substr(0,t.length-1)),"."==t[0]?"0"+t:t}Object.defineProperty(e,"__esModule",{value:!0}),e.multiply=void 0,e.multiply=function(t,e){t=t.toString(),e=e.toString();var n=0,r=("-"==t[0]&&(n++,t=t.substr(1)),"-"==e[0]&&(n++,e=e.substr(1)),t=i(t),e=i(e),0),a=0;r=(r=-1!=t.indexOf(".")?t.length-t.indexOf(".")-1:r)+(a=-1!=e.indexOf(".")?e.length-e.indexOf(".")-1:a);if(t=i(t.replace(".","")),e=i(e.replace(".","")),t.length<e.length&&(a=t,t=e,e=a),"0"==e)return"0";for(var o=e.length,s=0,c=[],h=o-1,l="",u=0;u<o;u++)c[u]=t.length-1;for(u=0;u<2*t.length;u++){for(var f=0,d=e.length-1;h<=d&&0<=d;d--)-1<c[d]&&c[d]<t.length&&(f+=parseInt(t[c[d]--])*parseInt(e[d]));f+=s,s=Math.floor(f/10),l=f%10+l,h--}return l=i((a=l,0==(r=r)?a:(a=r>=a.length?new Array(r-a.length+1).join("0")+a:a).substr(0,a.length-r)+"."+a.substr(a.length-r,r))),1==n?"-"+l:l}},350:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.roundOff=void 0;var n=i(916);function r(t,e,i,r){if(!t||t===new Array(t.length+1).join("0"))return!1;if(r===n.RoundingModes.DOWN||!i&&r===n.RoundingModes.FLOOR||i&&r===n.RoundingModes.CEILING)return!1;if(r===n.RoundingModes.UP||i&&r===n.RoundingModes.FLOOR||!i&&r===n.RoundingModes.CEILING)return!0;if(i="5"+new Array(t.length).join("0"),i<t)return!0;if(t<i)return!1;switch(r){case n.RoundingModes.HALF_DOWN:return!1;case n.RoundingModes.HALF_UP:return!0;default:return n.RoundingModes.HALF_EVEN,parseInt(e[e.length-1])%2==1}}function a(t,e){e=(e=void 0===e?0:e)||1,"number"==typeof t&&t.toString();for(var i="",n=t.length-1;0<=n;n--){var r=parseInt(t[n])+e;10==r?(e=1,r=0):e=0,i+=r}return e&&(i+=e),i.split("").reverse().join("")}e.roundOff=function t(e,i,o){if(void 0===i&&(i=0),(o=void 0===o?n.RoundingModes.HALF_EVEN:o)===n.RoundingModes.UNNECESSARY)throw new Error("UNNECESSARY Rounding Mode has not yet been implemented");var s=!1,c=("-"===(e="number"!=typeof e&&"bigint"!=typeof e?e:e.toString())[0]&&(s=!0,e=e.substring(1)),e.split(".")),h=c[0],l=c[1];return i<0?h.length<=(i=-i)?"0":(s?"-":"")+t(e=h.substr(0,h.length-i)+"."+h.substr(h.length-i)+l,0,o)+new Array(i+1).join("0"):0==i?(h.length,r(c[1],h,s,o)&&(h=a(h)),(s&&parseInt(h)?"-":"")+h):c[1]?c[1].length<i?(s?"-":"")+h+"."+c[1]+new Array(i-c[1].length+1).join("0"):(l=c[1].substring(0,i),(e=c[1].substring(i))&&r(e,l,s,o)&&(l=a(l)).length>i?(s?"-":"")+a(h,parseInt(l[0]))+"."+l.substring(1):(s&&(parseInt(h)||parseInt(l))?"-":"")+h+"."+l):(s?"-":"")+h+"."+new Array(i+1).join("0")}},916:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.RoundingModes=void 0,(e=e.RoundingModes||(e.RoundingModes={}))[e.CEILING=0]="CEILING",e[e.DOWN=1]="DOWN",e[e.FLOOR=2]="FLOOR",e[e.HALF_DOWN=3]="HALF_DOWN",e[e.HALF_EVEN=4]="HALF_EVEN",e[e.HALF_UP=5]="HALF_UP",e[e.UNNECESSARY=6]="UNNECESSARY",e[e.UP=7]="UP"},26:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.negate=e.subtract=void 0;var n=i(217);function r(t){return"-"==t[0]?t.substr(1):"-"+t}e.subtract=function(t,e){return t=t.toString(),e=r(e=e.toString()),(0,n.add)(t,e)},e.negate=r}},e={};return function i(n){var r=e[n];return void 0===r&&(r=e[n]={exports:{}},t[n](r,r.exports,i)),r.exports}(423)},t.exports=i()}).call(this,i("c8ba"))},c9fd:function(t,e,i){"use strict";t.exports=i("68f9")}}]);