@nabeeltahirdeveloper/chart-sdk 2.1.2 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
- (function(DA,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],h):(DA=typeof globalThis<"u"?globalThis:DA||self,h(DA.ChartSDK={},DA.jsxRuntime,DA.React))})(this,(function(DA,h,O){"use strict";var Ns=typeof document<"u"?document.currentScript:null;function $A(r){var A=r.width,e=r.height;if(A<0)throw new Error("Negative width is not allowed for Size");if(e<0)throw new Error("Negative height is not allowed for Size");return{width:A,height:e}}function Tt(r,A){return r.width===A.width&&r.height===A.height}var ju=(function(){function r(A){var e=this;this._resolutionListener=function(){return e._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=A,this._installResolutionListener()}return r.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(r.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),r.prototype.subscribe=function(A){var e=this,t={next:A};return this._observers.push(t),{unsubscribe:function(){e._observers=e._observers.filter(function(i){return i!==t})}}},r.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var A=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(A,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},r.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},r.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},r.prototype._onResolutionChanged=function(){var A=this;this._observers.forEach(function(e){return e.next(A._window.devicePixelRatio)}),this._reinstallResolutionListener()},r})();function Ad(r){return new ju(r)}var ed=(function(){function r(A,e,t){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=A,this._canvasElementClientSize=$A({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=e??(function(s){return s}),this._allowResizeObserver=(i=t?.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return r.prototype.dispose=function(){var A,e;if(this._canvasElement===null)throw new Error("Object is disposed");(A=this._canvasElementResizeObserver)===null||A===void 0||A.disconnect(),this._canvasElementResizeObserver=null,(e=this._devicePixelRatioObservable)===null||e===void 0||e.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(r.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bitmapSize",{get:function(){return $A({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),r.prototype.resizeCanvasElement=function(A){this._canvasElementClientSize=$A(A),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},r.prototype.subscribeBitmapSizeChanged=function(A){this._bitmapSizeChangedListeners.push(A)},r.prototype.unsubscribeBitmapSizeChanged=function(A){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(e){return e!==A})},Object.defineProperty(r.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),r.prototype.subscribeSuggestedBitmapSizeChanged=function(A){this._suggestedBitmapSizeChangedListeners.push(A)},r.prototype.unsubscribeSuggestedBitmapSizeChanged=function(A){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(e){return e!==A})},r.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var A=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(A),this._emitSuggestedBitmapSizeChanged(A,this._suggestedBitmapSize)}},r.prototype._resizeBitmap=function(A){var e=this.bitmapSize;Tt(e,A)||(this.canvasElement.width=A.width,this.canvasElement.height=A.height,this._emitBitmapSizeChanged(e,A))},r.prototype._emitBitmapSizeChanged=function(A,e){var t=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(t,A,e)})},r.prototype._suggestNewBitmapSize=function(A){var e=this._suggestedBitmapSize,t=$A(this._transformBitmapSize(A,this._canvasElementClientSize)),i=Tt(this.bitmapSize,t)?null:t;e===null&&i===null||e!==null&&i!==null&&Tt(e,i)||(this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(e,i))},r.prototype._emitSuggestedBitmapSizeChanged=function(A,e){var t=this;this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(t,A,e)})},r.prototype._chooseAndInitObserver=function(){var A=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}rd().then(function(e){return e?A._initResizeObserver():A._initDevicePixelRatioObservable()})},r.prototype._initDevicePixelRatioObservable=function(){var A=this;if(this._canvasElement!==null){var e=Aa(this._canvasElement);if(e===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=Ad(e),this._devicePixelRatioObservable.subscribe(function(){return A._invalidateBitmapSize()}),this._invalidateBitmapSize()}},r.prototype._invalidateBitmapSize=function(){var A,e;if(this._canvasElement!==null){var t=Aa(this._canvasElement);if(t!==null){var i=(e=(A=this._devicePixelRatioObservable)===null||A===void 0?void 0:A.value)!==null&&e!==void 0?e:t.devicePixelRatio,s=this._canvasElement.getClientRects(),n=s[0]!==void 0?id(s[0],i):$A({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(n)}}},r.prototype._initResizeObserver=function(){var A=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(e){var t=e.find(function(n){return n.target===A._canvasElement});if(!(!t||!t.devicePixelContentBoxSize||!t.devicePixelContentBoxSize[0])){var i=t.devicePixelContentBoxSize[0],s=$A({width:i.inlineSize,height:i.blockSize});A._suggestNewBitmapSize(s)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},r})();function td(r,A){return new ed(r,A.transform,A.options)}function Aa(r){return r.ownerDocument.defaultView}function rd(){return new Promise(function(r){var A=new ResizeObserver(function(e){r(e.every(function(t){return"devicePixelContentBoxSize"in t})),A.disconnect()});A.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function id(r,A){return $A({width:Math.round(r.left*A+r.width*A)-Math.round(r.left*A),height:Math.round(r.top*A+r.height*A)-Math.round(r.top*A)})}var sd=(function(){function r(A,e,t){if(e.width===0||e.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=e,t.width===0||t.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=t,this._context=A}return r.prototype.useMediaCoordinateSpace=function(A){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),A({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},r.prototype.useBitmapCoordinateSpace=function(A){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),A({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(r.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),r})();function St(r,A){var e=r.canvasElementClientSize;if(e.width===0||e.height===0)return null;var t=r.bitmapSize;if(t.width===0||t.height===0)return null;var i=r.canvasElement.getContext("2d",A);return i===null?null:new sd(i,e,t)}const nd={upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},od={upColor:"#26a69a",downColor:"#ef5350",openVisible:!0,thinBars:!0},ad={color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},ld={topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},cd={baseValue:{type:"price",price:0},topFillColor1:"rgba(38, 166, 154, 0.28)",topFillColor2:"rgba(38, 166, 154, 0.05)",topLineColor:"rgba(38, 166, 154, 1)",bottomFillColor1:"rgba(239, 83, 80, 0.05)",bottomFillColor2:"rgba(239, 83, 80, 0.28)",bottomLineColor:"rgba(239, 83, 80, 1)",lineWidth:3,lineStyle:0,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},hd={color:"#26a69a",base:0},ea={color:"#2196f3"},ta={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};var ra,ia;function Ht(r,A){const e={0:[],1:[r.lineWidth,r.lineWidth],2:[2*r.lineWidth,2*r.lineWidth],3:[6*r.lineWidth,6*r.lineWidth],4:[r.lineWidth,4*r.lineWidth]}[A];r.setLineDash(e)}function sa(r,A,e,t){r.beginPath();const i=r.lineWidth%2?.5:0;r.moveTo(e,A+i),r.lineTo(t,A+i),r.stroke()}function gt(r,A){if(!r)throw new Error("Assertion failed"+(A?": "+A:""))}function be(r){if(r===void 0)throw new Error("Value is undefined");return r}function AA(r){if(r===null)throw new Error("Value is null");return r}function Rt(r){return AA(be(r))}(function(r){r[r.Simple=0]="Simple",r[r.WithSteps=1]="WithSteps",r[r.Curved=2]="Curved"})(ra||(ra={})),(function(r){r[r.Solid=0]="Solid",r[r.Dotted=1]="Dotted",r[r.Dashed=2]="Dashed",r[r.LargeDashed=3]="LargeDashed",r[r.SparseDotted=4]="SparseDotted"})(ia||(ia={}));const na={khaki:"#f0e68c",azure:"#f0ffff",aliceblue:"#f0f8ff",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",gray:"#808080",green:"#008000",honeydew:"#f0fff0",floralwhite:"#fffaf0",lightblue:"#add8e6",lightcoral:"#f08080",lemonchiffon:"#fffacd",hotpink:"#ff69b4",lightyellow:"#ffffe0",greenyellow:"#adff2f",lightgoldenrodyellow:"#fafad2",limegreen:"#32cd32",linen:"#faf0e6",lightcyan:"#e0ffff",magenta:"#f0f",maroon:"#800000",olive:"#808000",orange:"#ffa500",oldlace:"#fdf5e6",mediumblue:"#0000cd",transparent:"#0000",lime:"#0f0",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",midnightblue:"#191970",orchid:"#da70d6",mediumorchid:"#ba55d3",mediumturquoise:"#48d1cc",orangered:"#ff4500",royalblue:"#4169e1",powderblue:"#b0e0e6",red:"#f00",coral:"#ff7f50",turquoise:"#40e0d0",white:"#fff",whitesmoke:"#f5f5f5",wheat:"#f5deb3",teal:"#008080",steelblue:"#4682b4",bisque:"#ffe4c4",aquamarine:"#7fffd4",aqua:"#0ff",sienna:"#a0522d",silver:"#c0c0c0",springgreen:"#00ff7f",antiquewhite:"#faebd7",burlywood:"#deb887",brown:"#a52a2a",beige:"#f5f5dc",chocolate:"#d2691e",chartreuse:"#7fff00",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cadetblue:"#5f9ea0",tomato:"#ff6347",fuchsia:"#f0f",blue:"#00f",salmon:"#fa8072",blanchedalmond:"#ffebcd",slateblue:"#6a5acd",slategray:"#708090",thistle:"#d8bfd8",tan:"#d2b48c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",blueviolet:"#8a2be2",black:"#000",darkmagenta:"#8b008b",darkslateblue:"#483d8b",darkkhaki:"#bdb76b",darkorchid:"#9932cc",darkorange:"#ff8c00",darkgreen:"#006400",darkred:"#8b0000",dodgerblue:"#1e90ff",darkslategray:"#2f4f4f",dimgray:"#696969",deepskyblue:"#00bfff",firebrick:"#b22222",forestgreen:"#228b22",indigo:"#4b0082",ivory:"#fffff0",lavenderblush:"#fff0f5",feldspar:"#d19275",indianred:"#cd5c5c",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightskyblue:"#87cefa",lightslategray:"#789",lightslateblue:"#8470ff",snow:"#fffafa",lightseagreen:"#20b2aa",lightsalmon:"#ffa07a",darksalmon:"#e9967a",darkviolet:"#9400d3",mediumpurple:"#9370d8",mediumaquamarine:"#66cdaa",skyblue:"#87ceeb",lavender:"#e6e6fa",lightsteelblue:"#b0c4de",mediumvioletred:"#c71585",mintcream:"#f5fffa",navajowhite:"#ffdead",navy:"#000080",olivedrab:"#6b8e23",palevioletred:"#d87093",violetred:"#d02090",yellow:"#ff0",yellowgreen:"#9acd32",lawngreen:"#7cfc00",pink:"#ffc0cb",paleturquoise:"#afeeee",palegoldenrod:"#eee8aa",darkolivegreen:"#556b2f",darkseagreen:"#8fbc8f",darkturquoise:"#00ced1",peachpuff:"#ffdab9",deeppink:"#ff1493",violet:"#ee82ee",palegreen:"#98fb98",mediumseagreen:"#3cb371",peru:"#cd853f",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",purple:"#800080",seagreen:"#2e8b57",seashell:"#fff5ee",papayawhip:"#ffefd5",mediumslateblue:"#7b68ee",plum:"#dda0dd",mediumspringgreen:"#00fa9a"};function _e(r){return r<0?0:r>255?255:Math.round(r)||0}function oa(r){return r<=0||r>1?Math.min(Math.max(r,0),1):Math.round(1e4*r)/1e4}const ud=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,dd=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,fd=/^rgb\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*\)$/,pd=/^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d*\.?\d+)\s*\)$/;function dr(r){(r=r.toLowerCase())in na&&(r=na[r]);{const A=pd.exec(r)||fd.exec(r);if(A)return[_e(parseInt(A[1],10)),_e(parseInt(A[2],10)),_e(parseInt(A[3],10)),oa(A.length<5?1:parseFloat(A[4]))]}{const A=dd.exec(r);if(A)return[_e(parseInt(A[1],16)),_e(parseInt(A[2],16)),_e(parseInt(A[3],16)),1]}{const A=ud.exec(r);if(A)return[_e(17*parseInt(A[1],16)),_e(17*parseInt(A[2],16)),_e(17*parseInt(A[3],16)),1]}throw new Error(`Cannot parse color: ${r}`)}function aa(r){return .199*r[0]+.687*r[1]+.114*r[2]}function si(r){const A=dr(r);return{t:`rgb(${A[0]}, ${A[1]}, ${A[2]})`,i:aa(A)>160?"black":"white"}}class ee{constructor(){this.h=[]}l(A,e,t){const i={o:A,_:e,u:t===!0};this.h.push(i)}v(A){const e=this.h.findIndex((t=>A===t.o));e>-1&&this.h.splice(e,1)}p(A){this.h=this.h.filter((e=>e._!==A))}m(A,e,t){const i=[...this.h];this.h=this.h.filter((s=>!s.u)),i.forEach((s=>s.o(A,e,t)))}M(){return this.h.length>0}S(){this.h=[]}}function Ge(r,...A){for(const e of A)for(const t in e)e[t]!==void 0&&Object.prototype.hasOwnProperty.call(e,t)&&!["__proto__","constructor","prototype"].includes(t)&&(typeof e[t]!="object"||r[t]===void 0||Array.isArray(e[t])?r[t]=e[t]:Ge(r[t],e[t]));return r}function Ze(r){return typeof r=="number"&&isFinite(r)}function fr(r){return typeof r=="number"&&r%1==0}function pr(r){return typeof r=="string"}function ni(r){return typeof r=="boolean"}function ot(r){const A=r;if(!A||typeof A!="object")return A;let e,t,i;for(t in e=Array.isArray(A)?[]:{},A)A.hasOwnProperty(t)&&(i=A[t],e[t]=i&&typeof i=="object"?ot(i):i);return e}function Bd(r){return r!==null}function Br(r){return r===null?void 0:r}const Ks="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function Wt(r,A,e){return A===void 0&&(A=Ks),`${e=e!==void 0?`${e} `:""}${r}px ${A}`}class gd{constructor(A){this.k={C:1,T:5,P:NaN,R:"",D:"",V:"",O:"",B:0,A:0,I:0,L:0,N:0},this.F=A}W(){const A=this.k,e=this.j(),t=this.H();return A.P===e&&A.D===t||(A.P=e,A.D=t,A.R=Wt(e,t),A.L=2.5/12*e,A.B=A.L,A.A=e/12*A.T,A.I=e/12*A.T,A.N=0),A.V=this.$(),A.O=this.U(),this.k}$(){return this.F.W().layout.textColor}U(){return this.F.q()}j(){return this.F.W().layout.fontSize}H(){return this.F.W().layout.fontFamily}}class Vs{constructor(){this.Y=[]}Z(A){this.Y=A}X(A,e,t){this.Y.forEach((i=>{i.X(A,e,t)}))}}class Re{X(A,e,t){A.useBitmapCoordinateSpace((i=>this.K(i,e,t)))}}class wd extends Re{constructor(){super(...arguments),this.G=null}J(A){this.G=A}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t}){if(this.G===null||this.G.tt===null)return;const i=this.G.tt,s=this.G,n=Math.max(1,Math.floor(e))%2/2,o=a=>{A.beginPath();for(let l=i.to-1;l>=i.from;--l){const c=s.it[l],u=Math.round(c.nt*e)+n,d=c.st*t,B=a*t+n;A.moveTo(u,d),A.arc(u,d,B,0,2*Math.PI)}A.fill()};s.et>0&&(A.fillStyle=s.rt,o(s.ht+s.et)),A.fillStyle=s.lt,o(s.ht)}}function md(){return{it:[{nt:0,st:0,ot:0,_t:0}],lt:"",rt:"",ht:0,et:0,tt:null}}const Cd={from:0,to:1};class vd{constructor(A,e){this.ut=new Vs,this.ct=[],this.dt=[],this.ft=!0,this.F=A,this.vt=e,this.ut.Z(this.ct)}bt(A){const e=this.F.wt();e.length!==this.ct.length&&(this.dt=e.map(md),this.ct=this.dt.map((t=>{const i=new wd;return i.J(t),i})),this.ut.Z(this.ct)),this.ft=!0}gt(){return this.ft&&(this.Mt(),this.ft=!1),this.ut}Mt(){const A=this.vt.W().mode===2,e=this.F.wt(),t=this.vt.xt(),i=this.F.St();e.forEach(((s,n)=>{var o;const a=this.dt[n],l=s.kt(t);if(A||l===null||!s.yt())return void(a.tt=null);const c=AA(s.Ct());a.lt=l.Tt,a.ht=l.ht,a.et=l.Pt,a.it[0]._t=l._t,a.it[0].st=s.Dt().Rt(l._t,c.Vt),a.rt=(o=l.Ot)!==null&&o!==void 0?o:this.F.Bt(a.it[0].st/s.Dt().At()),a.it[0].ot=t,a.it[0].nt=i.It(t),a.tt=Cd}))}}let bd=class extends Re{constructor(A){super(),this.zt=A}K({context:A,bitmapSize:e,horizontalPixelRatio:t,verticalPixelRatio:i}){if(this.zt===null)return;const s=this.zt.Lt.yt,n=this.zt.Et.yt;if(!s&&!n)return;const o=Math.round(this.zt.nt*t),a=Math.round(this.zt.st*i);A.lineCap="butt",s&&o>=0&&(A.lineWidth=Math.floor(this.zt.Lt.et*t),A.strokeStyle=this.zt.Lt.V,A.fillStyle=this.zt.Lt.V,Ht(A,this.zt.Lt.Nt),(function(l,c,u,d){l.beginPath();const B=l.lineWidth%2?.5:0;l.moveTo(c+B,u),l.lineTo(c+B,d),l.stroke()})(A,o,0,e.height)),n&&a>=0&&(A.lineWidth=Math.floor(this.zt.Et.et*i),A.strokeStyle=this.zt.Et.V,A.fillStyle=this.zt.Et.V,Ht(A,this.zt.Et.Nt),sa(A,a,0,e.width))}};class yd{constructor(A){this.ft=!0,this.Ft={Lt:{et:1,Nt:0,V:"",yt:!1},Et:{et:1,Nt:0,V:"",yt:!1},nt:0,st:0},this.Wt=new bd(this.Ft),this.jt=A}bt(){this.ft=!0}gt(){return this.ft&&(this.Mt(),this.ft=!1),this.Wt}Mt(){const A=this.jt.yt(),e=AA(this.jt.Ht()),t=e.$t().W().crosshair,i=this.Ft;if(t.mode===2)return i.Et.yt=!1,void(i.Lt.yt=!1);i.Et.yt=A&&this.jt.Ut(e),i.Lt.yt=A&&this.jt.qt(),i.Et.et=t.horzLine.width,i.Et.Nt=t.horzLine.style,i.Et.V=t.horzLine.color,i.Lt.et=t.vertLine.width,i.Lt.Nt=t.vertLine.style,i.Lt.V=t.vertLine.color,i.nt=this.jt.Yt(),i.st=this.jt.Zt()}}function Qd(r,A,e,t,i,s){r.fillRect(A+s,e,t-2*s,s),r.fillRect(A+s,e+i-s,t-2*s,s),r.fillRect(A,e,s,i),r.fillRect(A+t-s,e,s,i)}function oi(r,A,e,t,i,s){r.save(),r.globalCompositeOperation="copy",r.fillStyle=s,r.fillRect(A,e,t,i),r.restore()}function la(r,A,e,t,i,s){r.beginPath(),r.roundRect?r.roundRect(A,e,t,i,s):(r.lineTo(A+t-s[1],e),s[1]!==0&&r.arcTo(A+t,e,A+t,e+s[1],s[1]),r.lineTo(A+t,e+i-s[2]),s[2]!==0&&r.arcTo(A+t,e+i,A+t-s[2],e+i,s[2]),r.lineTo(A+s[3],e+i),s[3]!==0&&r.arcTo(A,e+i,A,e+i-s[3],s[3]),r.lineTo(A,e+s[0]),s[0]!==0&&r.arcTo(A,e,A+s[0],e,s[0]))}function ca(r,A,e,t,i,s,n=0,o=[0,0,0,0],a=""){if(r.save(),!n||!a||a===s)return la(r,A,e,t,i,o),r.fillStyle=s,r.fill(),void r.restore();const l=n/2;var c;la(r,A+l,e+l,t-n,i-n,(c=-l,o.map((u=>u===0?u:u+c)))),s!=="transparent"&&(r.fillStyle=s,r.fill()),a!=="transparent"&&(r.lineWidth=n,r.strokeStyle=a,r.closePath(),r.stroke()),r.restore()}function ha(r,A,e,t,i,s,n){r.save(),r.globalCompositeOperation="copy";const o=r.createLinearGradient(0,0,0,i);o.addColorStop(0,s),o.addColorStop(1,n),r.fillStyle=o,r.fillRect(A,e,t,i),r.restore()}class ua{constructor(A,e){this.J(A,e)}J(A,e){this.zt=A,this.Xt=e}At(A,e){return this.zt.yt?A.P+A.L+A.B:0}X(A,e,t,i){if(!this.zt.yt||this.zt.Kt.length===0)return;const s=this.zt.V,n=this.Xt.t,o=A.useBitmapCoordinateSpace((a=>{const l=a.context;l.font=e.R;const c=this.Gt(a,e,t,i),u=c.Jt;return c.Qt?ca(l,u.ti,u.ii,u.ni,u.si,n,u.ei,[u.ht,0,0,u.ht],n):ca(l,u.ri,u.ii,u.ni,u.si,n,u.ei,[0,u.ht,u.ht,0],n),this.zt.hi&&(l.fillStyle=s,l.fillRect(u.ri,u.li,u.ai-u.ri,u.oi)),this.zt._i&&(l.fillStyle=e.O,l.fillRect(c.Qt?u.ui-u.ei:0,u.ii,u.ei,u.ci-u.ii)),c}));A.useMediaCoordinateSpace((({context:a})=>{const l=o.di;a.font=e.R,a.textAlign=o.Qt?"right":"left",a.textBaseline="middle",a.fillStyle=s,a.fillText(this.zt.Kt,l.fi,(l.ii+l.ci)/2+l.pi)}))}Gt(A,e,t,i){var s;const{context:n,bitmapSize:o,mediaSize:a,horizontalPixelRatio:l,verticalPixelRatio:c}=A,u=this.zt.hi||!this.zt.mi?e.T:0,d=this.zt.bi?e.C:0,B=e.L+this.Xt.wi,p=e.B+this.Xt.gi,f=e.A,g=e.I,Q=this.zt.Kt,m=e.P,E=t.Mi(n,Q),F=Math.ceil(t.xi(n,Q)),S=m+B+p,P=e.C+f+g+F+u,z=Math.max(1,Math.floor(c));let eA=Math.round(S*c);eA%2!=z%2&&(eA+=1);const V=d>0?Math.max(1,Math.floor(d*l)):0,Y=Math.round(P*l),X=Math.round(u*l),fA=(s=this.Xt.Si)!==null&&s!==void 0?s:this.Xt.ki,oA=Math.round(fA*c)-Math.floor(.5*c),pA=Math.floor(oA+z/2-eA/2),IA=pA+eA,vA=i==="right",MA=vA?a.width-d:d,SA=vA?o.width-V:V;let UA,bA,CA;return vA?(UA=SA-Y,bA=SA-X,CA=MA-u-f-d):(UA=SA+Y,bA=SA+X,CA=MA+u+f),{Qt:vA,Jt:{ii:pA,li:oA,ci:IA,ni:Y,si:eA,ht:2*l,ei:V,ti:UA,ri:SA,ai:bA,oi:z,ui:o.width},di:{ii:pA/c,ci:IA/c,fi:CA,pi:E}}}}class ai{constructor(A){this.yi={ki:0,t:"#000",gi:0,wi:0},this.Ci={Kt:"",yt:!1,hi:!0,mi:!1,Ot:"",V:"#FFF",_i:!1,bi:!1},this.Ti={Kt:"",yt:!1,hi:!1,mi:!0,Ot:"",V:"#FFF",_i:!0,bi:!0},this.ft=!0,this.Pi=new(A||ua)(this.Ci,this.yi),this.Ri=new(A||ua)(this.Ti,this.yi)}Kt(){return this.Di(),this.Ci.Kt}ki(){return this.Di(),this.yi.ki}bt(){this.ft=!0}At(A,e=!1){return Math.max(this.Pi.At(A,e),this.Ri.At(A,e))}Vi(){return this.yi.Si||0}Oi(A){this.yi.Si=A}Bi(){return this.Di(),this.Ci.yt||this.Ti.yt}Ai(){return this.Di(),this.Ci.yt}gt(A){return this.Di(),this.Ci.hi=this.Ci.hi&&A.W().ticksVisible,this.Ti.hi=this.Ti.hi&&A.W().ticksVisible,this.Pi.J(this.Ci,this.yi),this.Ri.J(this.Ti,this.yi),this.Pi}Ii(){return this.Di(),this.Pi.J(this.Ci,this.yi),this.Ri.J(this.Ti,this.yi),this.Ri}Di(){this.ft&&(this.Ci.hi=!0,this.Ti.hi=!1,this.zi(this.Ci,this.Ti,this.yi))}}class Fd extends ai{constructor(A,e,t){super(),this.jt=A,this.Li=e,this.Ei=t}zi(A,e,t){if(A.yt=!1,this.jt.W().mode===2)return;const i=this.jt.W().horzLine;if(!i.labelVisible)return;const s=this.Li.Ct();if(!this.jt.yt()||this.Li.Ni()||s===null)return;const n=si(i.labelBackgroundColor);t.t=n.t,A.V=n.i;const o=2/12*this.Li.P();t.wi=o,t.gi=o;const a=this.Ei(this.Li);t.ki=a.ki,A.Kt=this.Li.Fi(a._t,s),A.yt=!0}}const Ud=/[1-9]/g;class da{constructor(){this.zt=null}J(A){this.zt=A}X(A,e){if(this.zt===null||this.zt.yt===!1||this.zt.Kt.length===0)return;const t=A.useMediaCoordinateSpace((({context:d})=>(d.font=e.R,Math.round(e.Wi.xi(d,AA(this.zt).Kt,Ud)))));if(t<=0)return;const i=e.ji,s=t+2*i,n=s/2,o=this.zt.Hi;let a=this.zt.ki,l=Math.floor(a-n)+.5;l<0?(a+=Math.abs(0-l),l=Math.floor(a-n)+.5):l+s>o&&(a-=Math.abs(o-(l+s)),l=Math.floor(a-n)+.5);const c=l+s,u=Math.ceil(0+e.C+e.T+e.L+e.P+e.B);A.useBitmapCoordinateSpace((({context:d,horizontalPixelRatio:B,verticalPixelRatio:p})=>{const f=AA(this.zt);d.fillStyle=f.t;const g=Math.round(l*B),Q=Math.round(0*p),m=Math.round(c*B),E=Math.round(u*p),F=Math.round(2*B);if(d.beginPath(),d.moveTo(g,Q),d.lineTo(g,E-F),d.arcTo(g,E,g+F,E,F),d.lineTo(m-F,E),d.arcTo(m,E,m,E-F,F),d.lineTo(m,Q),d.fill(),f.hi){const S=Math.round(f.ki*B),P=Q,z=Math.round((P+e.T)*p);d.fillStyle=f.V;const eA=Math.max(1,Math.floor(B)),V=Math.floor(.5*B);d.fillRect(S-V,P,eA,z-P)}})),A.useMediaCoordinateSpace((({context:d})=>{const B=AA(this.zt),p=0+e.C+e.T+e.L+e.P/2;d.font=e.R,d.textAlign="left",d.textBaseline="middle",d.fillStyle=B.V;const f=e.Wi.Mi(d,"Apr0");d.translate(l+i,p+f),d.fillText(B.Kt,0,0)}))}}class Ed{constructor(A,e,t){this.ft=!0,this.Wt=new da,this.Ft={yt:!1,t:"#4c525e",V:"white",Kt:"",Hi:0,ki:NaN,hi:!0},this.vt=A,this.$i=e,this.Ei=t}bt(){this.ft=!0}gt(){return this.ft&&(this.Mt(),this.ft=!1),this.Wt.J(this.Ft),this.Wt}Mt(){const A=this.Ft;if(A.yt=!1,this.vt.W().mode===2)return;const e=this.vt.W().vertLine;if(!e.labelVisible)return;const t=this.$i.St();if(t.Ni())return;A.Hi=t.Hi();const i=this.Ei();if(i===null)return;A.ki=i.ki;const s=t.Ui(this.vt.xt());A.Kt=t.qi(AA(s)),A.yt=!0;const n=si(e.labelBackgroundColor);A.t=n.t,A.V=n.i,A.hi=t.W().ticksVisible}}class Ps{constructor(){this.Yi=null,this.Zi=0}Xi(){return this.Zi}Ki(A){this.Zi=A}Dt(){return this.Yi}Gi(A){this.Yi=A}Ji(A){return[]}Qi(){return[]}yt(){return!0}}var fa;(function(r){r[r.Normal=0]="Normal",r[r.Magnet=1]="Magnet",r[r.Hidden=2]="Hidden"})(fa||(fa={}));class xd extends Ps{constructor(A,e){super(),this.tn=null,this.nn=NaN,this.sn=0,this.en=!0,this.rn=new Map,this.hn=!1,this.ln=NaN,this.an=NaN,this._n=NaN,this.un=NaN,this.$i=A,this.cn=e,this.dn=new vd(A,this),this.fn=((i,s)=>n=>{const o=s(),a=i();if(n===AA(this.tn).vn())return{_t:a,ki:o};{const l=AA(n.Ct());return{_t:n.pn(o,l),ki:o}}})((()=>this.nn),(()=>this.an));const t=((i,s)=>()=>{const n=this.$i.St().mn(i()),o=s();return n&&Number.isFinite(o)?{ot:n,ki:o}:null})((()=>this.sn),(()=>this.Yt()));this.bn=new Ed(this,A,t),this.wn=new yd(this)}W(){return this.cn}gn(A,e){this._n=A,this.un=e}Mn(){this._n=NaN,this.un=NaN}xn(){return this._n}Sn(){return this.un}kn(A,e,t){this.hn||(this.hn=!0),this.en=!0,this.yn(A,e,t)}xt(){return this.sn}Yt(){return this.ln}Zt(){return this.an}yt(){return this.en}Cn(){this.en=!1,this.Tn(),this.nn=NaN,this.ln=NaN,this.an=NaN,this.tn=null,this.Mn()}Pn(A){return this.tn!==null?[this.wn,this.dn]:[]}Ut(A){return A===this.tn&&this.cn.horzLine.visible}qt(){return this.cn.vertLine.visible}Rn(A,e){this.en&&this.tn===A||this.rn.clear();const t=[];return this.tn===A&&t.push(this.Dn(this.rn,e,this.fn)),t}Qi(){return this.en?[this.bn]:[]}Ht(){return this.tn}Vn(){this.wn.bt(),this.rn.forEach((A=>A.bt())),this.bn.bt(),this.dn.bt()}On(A){return A&&!A.vn().Ni()?A.vn():null}yn(A,e,t){this.Bn(A,e,t)&&this.Vn()}Bn(A,e,t){const i=this.ln,s=this.an,n=this.nn,o=this.sn,a=this.tn,l=this.On(t);this.sn=A,this.ln=isNaN(A)?NaN:this.$i.St().It(A),this.tn=t;const c=l!==null?l.Ct():null;return l!==null&&c!==null?(this.nn=e,this.an=l.Rt(e,c)):(this.nn=NaN,this.an=NaN),i!==this.ln||s!==this.an||o!==this.sn||n!==this.nn||a!==this.tn}Tn(){const A=this.$i.wt().map((t=>t.In().An())).filter(Bd),e=A.length===0?null:Math.max(...A);this.sn=e!==null?e:NaN}Dn(A,e,t){let i=A.get(e);return i===void 0&&(i=new Fd(this,e,t),A.set(e,i)),i}}function li(r){return r==="left"||r==="right"}class ue{constructor(A){this.zn=new Map,this.Ln=[],this.En=A}Nn(A,e){const t=(function(i,s){return i===void 0?s:{Fn:Math.max(i.Fn,s.Fn),Wn:i.Wn||s.Wn}})(this.zn.get(A),e);this.zn.set(A,t)}jn(){return this.En}Hn(A){const e=this.zn.get(A);return e===void 0?{Fn:this.En}:{Fn:Math.max(this.En,e.Fn),Wn:e.Wn}}$n(){this.Un(),this.Ln=[{qn:0}]}Yn(A){this.Un(),this.Ln=[{qn:1,Vt:A}]}Zn(A){this.Xn(),this.Ln.push({qn:5,Vt:A})}Un(){this.Xn(),this.Ln.push({qn:6})}Kn(){this.Un(),this.Ln=[{qn:4}]}Gn(A){this.Un(),this.Ln.push({qn:2,Vt:A})}Jn(A){this.Un(),this.Ln.push({qn:3,Vt:A})}Qn(){return this.Ln}ts(A){for(const e of A.Ln)this.ns(e);this.En=Math.max(this.En,A.En),A.zn.forEach(((e,t)=>{this.Nn(t,e)}))}static ss(){return new ue(2)}static es(){return new ue(3)}ns(A){switch(A.qn){case 0:this.$n();break;case 1:this.Yn(A.Vt);break;case 2:this.Gn(A.Vt);break;case 3:this.Jn(A.Vt);break;case 4:this.Kn();break;case 5:this.Zn(A.Vt);break;case 6:this.Xn()}}Xn(){const A=this.Ln.findIndex((e=>e.qn===5));A!==-1&&this.Ln.splice(A,1)}}const pa=".";function at(r,A){if(!Ze(r))return"n/a";if(!fr(A))throw new TypeError("invalid length");if(A<0||A>16)throw new TypeError("invalid length");return A===0?r.toString():("0000000000000000"+r.toString()).slice(-A)}class ci{constructor(A,e){if(e||(e=1),Ze(A)&&fr(A)||(A=100),A<0)throw new TypeError("invalid base");this.Li=A,this.rs=e,this.hs()}format(A){const e=A<0?"−":"";return A=Math.abs(A),e+this.ls(A)}hs(){if(this._s=0,this.Li>0&&this.rs>0){let A=this.Li;for(;A>1;)A/=10,this._s++}}ls(A){const e=this.Li/this.rs;let t=Math.floor(A),i="";const s=this._s!==void 0?this._s:NaN;if(e>1){let n=+(Math.round(A*e)-t*e).toFixed(this._s);n>=e&&(n-=e,t+=1),i=pa+at(+n.toFixed(this._s)*this.rs,s)}else t=Math.round(t*e)/e,s>0&&(i=pa+at(0,s));return t.toFixed(0)+i}}class Ba extends ci{constructor(A=100){super(A)}format(A){return`${super.format(A)}%`}}class Td{constructor(A){this.us=A}format(A){let e="";return A<0&&(e="-",A=-A),A<995?e+this.cs(A):A<999995?e+this.cs(A/1e3)+"K":A<999999995?(A=1e3*Math.round(A/1e3),e+this.cs(A/1e6)+"M"):(A=1e6*Math.round(A/1e6),e+this.cs(A/1e9)+"B")}cs(A){let e;const t=Math.pow(10,this.us);return e=(A=Math.round(A*t)/t)>=1e-15&&A<1?A.toFixed(this.us).replace(/\.?0+$/,""):String(A),e.replace(/(\.[1-9]*)0+$/,((i,s)=>s))}}function ga(r,A,e,t,i,s,n){if(A.length===0||t.from>=A.length||t.to<=0)return;const{context:o,horizontalPixelRatio:a,verticalPixelRatio:l}=r,c=A[t.from];let u=s(r,c),d=c;if(t.to-t.from<2){const B=i/2;o.beginPath();const p={nt:c.nt-B,st:c.st},f={nt:c.nt+B,st:c.st};o.moveTo(p.nt*a,p.st*l),o.lineTo(f.nt*a,f.st*l),n(r,u,p,f)}else{const B=(f,g)=>{n(r,u,d,g),o.beginPath(),u=f,d=g};let p=d;o.beginPath(),o.moveTo(c.nt*a,c.st*l);for(let f=t.from+1;f<t.to;++f){p=A[f];const g=s(r,p);switch(e){case 0:o.lineTo(p.nt*a,p.st*l);break;case 1:o.lineTo(p.nt*a,A[f-1].st*l),g!==u&&(B(g,p),o.lineTo(p.nt*a,A[f-1].st*l)),o.lineTo(p.nt*a,p.st*l);break;case 2:{const[Q,m]=Sd(A,f-1,f);o.bezierCurveTo(Q.nt*a,Q.st*l,m.nt*a,m.st*l,p.nt*a,p.st*l);break}}e!==1&&g!==u&&(B(g,p),o.moveTo(p.nt*a,p.st*l))}(d!==p||d===p&&e===1)&&n(r,u,d,p)}}const wa=6;function zs(r,A){return{nt:r.nt-A.nt,st:r.st-A.st}}function ma(r,A){return{nt:r.nt/A,st:r.st/A}}function Sd(r,A,e){const t=Math.max(0,A-1),i=Math.min(r.length-1,e+1);var s,n;return[(s=r[A],n=ma(zs(r[e],r[t]),wa),{nt:s.nt+n.nt,st:s.st+n.st}),zs(r[e],ma(zs(r[i],r[A]),wa))]}function Hd(r,A,e,t,i){const{context:s,horizontalPixelRatio:n,verticalPixelRatio:o}=A;s.lineTo(i.nt*n,r*o),s.lineTo(t.nt*n,r*o),s.closePath(),s.fillStyle=e,s.fill()}class Ca extends Re{constructor(){super(...arguments),this.G=null}J(A){this.G=A}K(A){var e;if(this.G===null)return;const{it:t,tt:i,ds:s,et:n,Nt:o,fs:a}=this.G,l=(e=this.G.vs)!==null&&e!==void 0?e:this.G.ps?0:A.mediaSize.height;if(i===null)return;const c=A.context;c.lineCap="butt",c.lineJoin="round",c.lineWidth=n,Ht(c,o),c.lineWidth=1,ga(A,t,a,i,s,this.bs.bind(this),Hd.bind(null,l))}}function Gs(r,A,e){return Math.min(Math.max(r,A),e)}function hi(r,A,e){return A-r<=e}function va(r){const A=Math.ceil(r);return A%2==0?A-1:A}class Rs{ws(A,e){const t=this.gs,{Ms:i,xs:s,Ss:n,ks:o,ys:a,vs:l}=e;if(this.Cs===void 0||t===void 0||t.Ms!==i||t.xs!==s||t.Ss!==n||t.ks!==o||t.vs!==l||t.ys!==a){const c=A.context.createLinearGradient(0,0,0,a);if(c.addColorStop(0,i),l!=null){const u=Gs(l*A.verticalPixelRatio/a,0,1);c.addColorStop(u,s),c.addColorStop(u,n)}c.addColorStop(1,o),this.Cs=c,this.gs=e}return this.Cs}}class Ld extends Ca{constructor(){super(...arguments),this.Ts=new Rs}bs(A,e){return this.Ts.ws(A,{Ms:e.Ps,xs:"",Ss:"",ks:e.Rs,ys:A.bitmapSize.height})}}function Id(r,A){const e=r.context;e.strokeStyle=A,e.stroke()}class ba extends Re{constructor(){super(...arguments),this.G=null}J(A){this.G=A}K(A){if(this.G===null)return;const{it:e,tt:t,ds:i,fs:s,et:n,Nt:o,Ds:a}=this.G;if(t===null)return;const l=A.context;l.lineCap="butt",l.lineWidth=n*A.verticalPixelRatio,Ht(l,o),l.lineJoin="round";const c=this.Vs.bind(this);s!==void 0&&ga(A,e,s,t,i,c,Id),a&&(function(u,d,B,p,f){const{horizontalPixelRatio:g,verticalPixelRatio:Q,context:m}=u;let E=null;const F=Math.max(1,Math.floor(g))%2/2,S=B*Q+F;for(let P=p.to-1;P>=p.from;--P){const z=d[P];if(z){const eA=f(u,z);eA!==E&&(m.beginPath(),E!==null&&m.fill(),m.fillStyle=eA,E=eA);const V=Math.round(z.nt*g)+F,Y=z.st*Q;m.moveTo(V,Y),m.arc(V,Y,S,0,2*Math.PI)}}m.fill()})(A,e,a,t,c)}}class ya extends ba{Vs(A,e){return e.lt}}function Qa(r,A,e,t,i=0,s=A.length){let n=s-i;for(;0<n;){const o=n>>1,a=i+o;t(A[a],e)===r?(i=a+1,n-=o+1):n=o}return i}const gr=Qa.bind(null,!0),Fa=Qa.bind(null,!1);function Md(r,A){return r.ot<A}function Dd(r,A){return A<r.ot}function Ua(r,A,e){const t=A.Os(),i=A.ui(),s=gr(r,t,Md),n=Fa(r,i,Dd);if(!e)return{from:s,to:n};let o=s,a=n;return s>0&&s<r.length&&r[s].ot>=t&&(o=s-1),n>0&&n<r.length&&r[n-1].ot<=i&&(a=n+1),{from:o,to:a}}class Ws{constructor(A,e,t){this.Bs=!0,this.As=!0,this.Is=!0,this.zs=[],this.Ls=null,this.Es=A,this.Ns=e,this.Fs=t}bt(A){this.Bs=!0,A==="data"&&(this.As=!0),A==="options"&&(this.Is=!0)}gt(){return this.Es.yt()?(this.Ws(),this.Ls===null?null:this.js):null}Hs(){this.zs=this.zs.map((A=>Object.assign(Object.assign({},A),this.Es.Us().$s(A.ot))))}qs(){this.Ls=null}Ws(){this.As&&(this.Ys(),this.As=!1),this.Is&&(this.Hs(),this.Is=!1),this.Bs&&(this.Zs(),this.Bs=!1)}Zs(){const A=this.Es.Dt(),e=this.Ns.St();if(this.qs(),e.Ni()||A.Ni())return;const t=e.Xs();if(t===null||this.Es.In().Ks()===0)return;const i=this.Es.Ct();i!==null&&(this.Ls=Ua(this.zs,t,this.Fs),this.Gs(A,e,i.Vt),this.Js())}}class ui extends Ws{constructor(A,e){super(A,e,!0)}Gs(A,e,t){e.Qs(this.zs,Br(this.Ls)),A.te(this.zs,t,Br(this.Ls))}ie(A,e){return{ot:A,_t:e,nt:NaN,st:NaN}}Ys(){const A=this.Es.Us();this.zs=this.Es.In().ne().map((e=>{const t=e.Vt[3];return this.se(e.ee,t,A)}))}}class _d extends ui{constructor(A,e){super(A,e),this.js=new Vs,this.re=new Ld,this.he=new ya,this.js.Z([this.re,this.he])}se(A,e,t){return Object.assign(Object.assign({},this.ie(A,e)),t.$s(A))}Js(){const A=this.Es.W();this.re.J({fs:A.lineType,it:this.zs,Nt:A.lineStyle,et:A.lineWidth,vs:null,ps:A.invertFilledArea,tt:this.Ls,ds:this.Ns.St().le()}),this.he.J({fs:A.lineVisible?A.lineType:void 0,it:this.zs,Nt:A.lineStyle,et:A.lineWidth,tt:this.Ls,ds:this.Ns.St().le(),Ds:A.pointMarkersVisible?A.pointMarkersRadius||A.lineWidth/2+2:void 0})}}class kd extends Re{constructor(){super(...arguments),this.zt=null,this.ae=0,this.oe=0}J(A){this.zt=A}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t}){if(this.zt===null||this.zt.In.length===0||this.zt.tt===null)return;this.ae=this._e(e),this.ae>=2&&Math.max(1,Math.floor(e))%2!=this.ae%2&&this.ae--,this.oe=this.zt.ue?Math.min(this.ae,Math.floor(e)):this.ae;let i=null;const s=this.oe<=this.ae&&this.zt.le>=Math.floor(1.5*e);for(let n=this.zt.tt.from;n<this.zt.tt.to;++n){const o=this.zt.In[n];i!==o.ce&&(A.fillStyle=o.ce,i=o.ce);const a=Math.floor(.5*this.oe),l=Math.round(o.nt*e),c=l-a,u=this.oe,d=c+u-1,B=Math.min(o.de,o.fe),p=Math.max(o.de,o.fe),f=Math.round(B*t)-a,g=Math.round(p*t)+a,Q=Math.max(g-f,this.oe);A.fillRect(c,f,u,Q);const m=Math.ceil(1.5*this.ae);if(s){if(this.zt.ve){const P=l-m;let z=Math.max(f,Math.round(o.pe*t)-a),eA=z+u-1;eA>f+Q-1&&(eA=f+Q-1,z=eA-u+1),A.fillRect(P,z,c-P,eA-z+1)}const E=l+m;let F=Math.max(f,Math.round(o.me*t)-a),S=F+u-1;S>f+Q-1&&(S=f+Q-1,F=S-u+1),A.fillRect(d+1,F,E-d,S-F+1)}}}_e(A){const e=Math.floor(A);return Math.max(e,Math.floor((function(t,i){return Math.floor(.3*t*i)})(AA(this.zt).le,A)))}}class Ea extends Ws{constructor(A,e){super(A,e,!1)}Gs(A,e,t){e.Qs(this.zs,Br(this.Ls)),A.be(this.zs,t,Br(this.Ls))}we(A,e,t){return{ot:A,ge:e.Vt[0],Me:e.Vt[1],xe:e.Vt[2],Se:e.Vt[3],nt:NaN,pe:NaN,de:NaN,fe:NaN,me:NaN}}Ys(){const A=this.Es.Us();this.zs=this.Es.In().ne().map((e=>this.se(e.ee,e,A)))}}class Od extends Ea{constructor(){super(...arguments),this.js=new kd}se(A,e,t){return Object.assign(Object.assign({},this.we(A,e,t)),t.$s(A))}Js(){const A=this.Es.W();this.js.J({In:this.zs,le:this.Ns.St().le(),ve:A.openVisible,ue:A.thinBars,tt:this.Ls})}}class Nd extends Ca{constructor(){super(...arguments),this.Ts=new Rs}bs(A,e){const t=this.G;return this.Ts.ws(A,{Ms:e.ke,xs:e.ye,Ss:e.Ce,ks:e.Te,ys:A.bitmapSize.height,vs:t.vs})}}class Kd extends ba{constructor(){super(...arguments),this.Pe=new Rs}Vs(A,e){const t=this.G;return this.Pe.ws(A,{Ms:e.Re,xs:e.Re,Ss:e.De,ks:e.De,ys:A.bitmapSize.height,vs:t.vs})}}class Vd extends ui{constructor(A,e){super(A,e),this.js=new Vs,this.Ve=new Nd,this.Oe=new Kd,this.js.Z([this.Ve,this.Oe])}se(A,e,t){return Object.assign(Object.assign({},this.ie(A,e)),t.$s(A))}Js(){const A=this.Es.Ct();if(A===null)return;const e=this.Es.W(),t=this.Es.Dt().Rt(e.baseValue.price,A.Vt),i=this.Ns.St().le();this.Ve.J({it:this.zs,et:e.lineWidth,Nt:e.lineStyle,fs:e.lineType,vs:t,ps:!1,tt:this.Ls,ds:i}),this.Oe.J({it:this.zs,et:e.lineWidth,Nt:e.lineStyle,fs:e.lineVisible?e.lineType:void 0,Ds:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0,vs:t,tt:this.Ls,ds:i})}}class Pd extends Re{constructor(){super(...arguments),this.zt=null,this.ae=0}J(A){this.zt=A}K(A){if(this.zt===null||this.zt.In.length===0||this.zt.tt===null)return;const{horizontalPixelRatio:e}=A;this.ae=(function(s,n){if(s>=2.5&&s<=4)return Math.floor(3*n);const o=1-.2*Math.atan(Math.max(4,s)-4)/(.5*Math.PI),a=Math.floor(s*o*n),l=Math.floor(s*n),c=Math.min(a,l);return Math.max(Math.floor(n),c)})(this.zt.le,e),this.ae>=2&&Math.floor(e)%2!=this.ae%2&&this.ae--;const t=this.zt.In;this.zt.Be&&this.Ae(A,t,this.zt.tt),this.zt._i&&this.Ie(A,t,this.zt.tt);const i=this.ze(e);(!this.zt._i||this.ae>2*i)&&this.Le(A,t,this.zt.tt)}Ae(A,e,t){if(this.zt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:n}=A;let o="",a=Math.min(Math.floor(s),Math.floor(this.zt.le*s));a=Math.max(Math.floor(s),Math.min(a,this.ae));const l=Math.floor(.5*a);let c=null;for(let u=t.from;u<t.to;u++){const d=e[u];d.Ee!==o&&(i.fillStyle=d.Ee,o=d.Ee);const B=Math.round(Math.min(d.pe,d.me)*n),p=Math.round(Math.max(d.pe,d.me)*n),f=Math.round(d.de*n),g=Math.round(d.fe*n);let Q=Math.round(s*d.nt)-l;const m=Q+a-1;c!==null&&(Q=Math.max(c+1,Q),Q=Math.min(Q,m));const E=m-Q+1;i.fillRect(Q,f,E,B-f),i.fillRect(Q,p+1,E,g-p),c=m}}ze(A){let e=Math.floor(1*A);this.ae<=2*e&&(e=Math.floor(.5*(this.ae-1)));const t=Math.max(Math.floor(A),e);return this.ae<=2*t?Math.max(Math.floor(A),Math.floor(1*A)):t}Ie(A,e,t){if(this.zt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:n}=A;let o="";const a=this.ze(s);let l=null;for(let c=t.from;c<t.to;c++){const u=e[c];u.Ne!==o&&(i.fillStyle=u.Ne,o=u.Ne);let d=Math.round(u.nt*s)-Math.floor(.5*this.ae);const B=d+this.ae-1,p=Math.round(Math.min(u.pe,u.me)*n),f=Math.round(Math.max(u.pe,u.me)*n);if(l!==null&&(d=Math.max(l+1,d),d=Math.min(d,B)),this.zt.le*s>2*a)Qd(i,d,p,B-d+1,f-p+1,a);else{const g=B-d+1;i.fillRect(d,p,g,f-p+1)}l=B}}Le(A,e,t){if(this.zt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:n}=A;let o="";const a=this.ze(s);for(let l=t.from;l<t.to;l++){const c=e[l];let u=Math.round(Math.min(c.pe,c.me)*n),d=Math.round(Math.max(c.pe,c.me)*n),B=Math.round(c.nt*s)-Math.floor(.5*this.ae),p=B+this.ae-1;if(c.ce!==o){const f=c.ce;i.fillStyle=f,o=f}this.zt._i&&(B+=a,u+=a,p-=a,d-=a),u>d||i.fillRect(B,u,p-B+1,d-u+1)}}}class zd extends Ea{constructor(){super(...arguments),this.js=new Pd}se(A,e,t){return Object.assign(Object.assign({},this.we(A,e,t)),t.$s(A))}Js(){const A=this.Es.W();this.js.J({In:this.zs,le:this.Ns.St().le(),Be:A.wickVisible,_i:A.borderVisible,tt:this.Ls})}}class Gd{constructor(A,e){this.Fe=A,this.Li=e}X(A,e,t){this.Fe.draw(A,this.Li,e,t)}}class $s extends Ws{constructor(A,e,t){super(A,e,!1),this.wn=t,this.js=new Gd(this.wn.renderer(),(i=>{const s=A.Ct();return s===null?null:A.Dt().Rt(i,s.Vt)}))}We(A){return this.wn.priceValueBuilder(A)}je(A){return this.wn.isWhitespace(A)}Ys(){const A=this.Es.Us();this.zs=this.Es.In().ne().map((e=>Object.assign(Object.assign({ot:e.ee,nt:NaN},A.$s(e.ee)),{He:e.$e})))}Gs(A,e){e.Qs(this.zs,Br(this.Ls))}Js(){this.wn.update({bars:this.zs.map(Rd),barSpacing:this.Ns.St().le(),visibleRange:this.Ls},this.Es.W())}}function Rd(r){return{x:r.nt,time:r.ot,originalData:r.He,barColor:r.ce}}class Wd extends Re{constructor(){super(...arguments),this.zt=null,this.Ue=[]}J(A){this.zt=A,this.Ue=[]}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t}){if(this.zt===null||this.zt.it.length===0||this.zt.tt===null)return;this.Ue.length||this.qe(e);const i=Math.max(1,Math.floor(t)),s=Math.round(this.zt.Ye*t)-Math.floor(i/2),n=s+i;for(let o=this.zt.tt.from;o<this.zt.tt.to;o++){const a=this.zt.it[o],l=this.Ue[o-this.zt.tt.from],c=Math.round(a.st*t);let u,d;A.fillStyle=a.ce,c<=s?(u=c,d=n):(u=s,d=c-Math.floor(i/2)+i),A.fillRect(l.Os,u,l.ui-l.Os+1,d-u)}}qe(A){if(this.zt===null||this.zt.it.length===0||this.zt.tt===null)return void(this.Ue=[]);const e=Math.ceil(this.zt.le*A)<=1?0:Math.max(1,Math.floor(A)),t=Math.round(this.zt.le*A)-e;this.Ue=new Array(this.zt.tt.to-this.zt.tt.from);for(let s=this.zt.tt.from;s<this.zt.tt.to;s++){const n=this.zt.it[s],o=Math.round(n.nt*A);let a,l;if(t%2){const c=(t-1)/2;a=o-c,l=o+c}else{const c=t/2;a=o-c,l=o+c-1}this.Ue[s-this.zt.tt.from]={Os:a,ui:l,Ze:o,Xe:n.nt*A,ot:n.ot}}for(let s=this.zt.tt.from+1;s<this.zt.tt.to;s++){const n=this.Ue[s-this.zt.tt.from],o=this.Ue[s-this.zt.tt.from-1];n.ot===o.ot+1&&n.Os-o.ui!==e+1&&(o.Ze>o.Xe?o.ui=n.Os-e-1:n.Os=o.ui+e+1)}let i=Math.ceil(this.zt.le*A);for(let s=this.zt.tt.from;s<this.zt.tt.to;s++){const n=this.Ue[s-this.zt.tt.from];n.ui<n.Os&&(n.ui=n.Os);const o=n.ui-n.Os+1;i=Math.min(o,i)}if(e>0&&i<4)for(let s=this.zt.tt.from;s<this.zt.tt.to;s++){const n=this.Ue[s-this.zt.tt.from];n.ui-n.Os+1>i&&(n.Ze>n.Xe?n.ui-=1:n.Os+=1)}}}class $d extends ui{constructor(){super(...arguments),this.js=new Wd}se(A,e,t){return Object.assign(Object.assign({},this.ie(A,e)),t.$s(A))}Js(){const A={it:this.zs,le:this.Ns.St().le(),tt:this.Ls,Ye:this.Es.Dt().Rt(this.Es.W().base,AA(this.Es.Ct()).Vt)};this.js.J(A)}}class Xd extends ui{constructor(){super(...arguments),this.js=new ya}se(A,e,t){return Object.assign(Object.assign({},this.ie(A,e)),t.$s(A))}Js(){const A=this.Es.W(),e={it:this.zs,Nt:A.lineStyle,fs:A.lineVisible?A.lineType:void 0,et:A.lineWidth,Ds:A.pointMarkersVisible?A.pointMarkersRadius||A.lineWidth/2+2:void 0,tt:this.Ls,ds:this.Ns.St().le()};this.js.J(e)}}const Jd=/[2-9]/g;class wr{constructor(A=50){this.Ke=0,this.Ge=1,this.Je=1,this.Qe={},this.tr=new Map,this.ir=A}nr(){this.Ke=0,this.tr.clear(),this.Ge=1,this.Je=1,this.Qe={}}xi(A,e,t){return this.sr(A,e,t).width}Mi(A,e,t){const i=this.sr(A,e,t);return((i.actualBoundingBoxAscent||0)-(i.actualBoundingBoxDescent||0))/2}sr(A,e,t){const i=t||Jd,s=String(e).replace(i,"0");if(this.tr.has(s))return be(this.tr.get(s)).er;if(this.Ke===this.ir){const o=this.Qe[this.Je];delete this.Qe[this.Je],this.tr.delete(o),this.Je++,this.Ke--}A.save(),A.textBaseline="middle";const n=A.measureText(s);return A.restore(),n.width===0&&e.length||(this.tr.set(s,{er:n,rr:this.Ge}),this.Qe[this.Ge]=s,this.Ke++,this.Ge++),n}}class Zd{constructor(A){this.hr=null,this.k=null,this.lr="right",this.ar=A}_r(A,e,t){this.hr=A,this.k=e,this.lr=t}X(A){this.k!==null&&this.hr!==null&&this.hr.X(A,this.k,this.ar,this.lr)}}class xa{constructor(A,e,t){this.ur=A,this.ar=new wr(50),this.cr=e,this.F=t,this.j=-1,this.Wt=new Zd(this.ar)}gt(){const A=this.F.dr(this.cr);if(A===null)return null;const e=A.vr(this.cr)?A.pr():this.cr.Dt();if(e===null)return null;const t=A.mr(e);if(t==="overlay")return null;const i=this.F.br();return i.P!==this.j&&(this.j=i.P,this.ar.nr()),this.Wt._r(this.ur.Ii(),i,t),this.Wt}}class Yd extends Re{constructor(){super(...arguments),this.zt=null}J(A){this.zt=A}wr(A,e){var t;if(!(!((t=this.zt)===null||t===void 0)&&t.yt))return null;const{st:i,et:s,gr:n}=this.zt;return e>=i-s-7&&e<=i+s+7?{Mr:this.zt,gr:n}:null}K({context:A,bitmapSize:e,horizontalPixelRatio:t,verticalPixelRatio:i}){if(this.zt===null||this.zt.yt===!1)return;const s=Math.round(this.zt.st*i);s<0||s>e.height||(A.lineCap="butt",A.strokeStyle=this.zt.V,A.lineWidth=Math.floor(this.zt.et*t),Ht(A,this.zt.Nt),sa(A,s,0,e.width))}}class Xs{constructor(A){this.Sr={st:0,V:"rgba(0, 0, 0, 0)",et:1,Nt:0,yt:!1},this.kr=new Yd,this.ft=!0,this.Es=A,this.Ns=A.$t(),this.kr.J(this.Sr)}bt(){this.ft=!0}gt(){return this.Es.yt()?(this.ft&&(this.yr(),this.ft=!1),this.kr):null}}class qd extends Xs{constructor(A){super(A)}yr(){this.Sr.yt=!1;const A=this.Es.Dt(),e=A.Cr().Cr;if(e!==2&&e!==3)return;const t=this.Es.W();if(!t.baseLineVisible||!this.Es.yt())return;const i=this.Es.Ct();i!==null&&(this.Sr.yt=!0,this.Sr.st=A.Rt(i.Vt,i.Vt),this.Sr.V=t.baseLineColor,this.Sr.et=t.baseLineWidth,this.Sr.Nt=t.baseLineStyle)}}class jd extends Re{constructor(){super(...arguments),this.zt=null}J(A){this.zt=A}$e(){return this.zt}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t}){const i=this.zt;if(i===null)return;const s=Math.max(1,Math.floor(e)),n=s%2/2,o=Math.round(i.Xe.x*e)+n,a=i.Xe.y*t;A.fillStyle=i.Tr,A.beginPath();const l=Math.max(2,1.5*i.Pr)*e;A.arc(o,a,l,0,2*Math.PI,!1),A.fill(),A.fillStyle=i.Rr,A.beginPath(),A.arc(o,a,i.ht*e,0,2*Math.PI,!1),A.fill(),A.lineWidth=s,A.strokeStyle=i.Dr,A.beginPath(),A.arc(o,a,i.ht*e+s/2,0,2*Math.PI,!1),A.stroke()}}const Af=[{Vr:0,Or:.25,Br:4,Ar:10,Ir:.25,zr:0,Lr:.4,Er:.8},{Vr:.25,Or:.525,Br:10,Ar:14,Ir:0,zr:0,Lr:.8,Er:0},{Vr:.525,Or:1,Br:14,Ar:14,Ir:0,zr:0,Lr:0,Er:0}];function Ta(r,A,e,t){return(function(i,s){if(i==="transparent")return i;const n=dr(i),o=n[3];return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${s*o})`})(r,e+(t-e)*A)}function Sa(r,A){const e=r%2600/2600;let t;for(const a of Af)if(e>=a.Vr&&e<=a.Or){t=a;break}gt(t!==void 0,"Last price animation internal logic error");const i=(e-t.Vr)/(t.Or-t.Vr);return{Rr:Ta(A,i,t.Ir,t.zr),Dr:Ta(A,i,t.Lr,t.Er),ht:(s=i,n=t.Br,o=t.Ar,n+(o-n)*s)};var s,n,o}class ef{constructor(A){this.Wt=new jd,this.ft=!0,this.Nr=!0,this.Fr=performance.now(),this.Wr=this.Fr-1,this.jr=A}Hr(){this.Wr=this.Fr-1,this.bt()}$r(){if(this.bt(),this.jr.W().lastPriceAnimation===2){const A=performance.now(),e=this.Wr-A;if(e>0)return void(e<650&&(this.Wr+=2600));this.Fr=A,this.Wr=A+2600}}bt(){this.ft=!0}Ur(){this.Nr=!0}yt(){return this.jr.W().lastPriceAnimation!==0}qr(){switch(this.jr.W().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.Wr}}gt(){return this.ft?(this.Mt(),this.ft=!1,this.Nr=!1):this.Nr&&(this.Yr(),this.Nr=!1),this.Wt}Mt(){this.Wt.J(null);const A=this.jr.$t().St(),e=A.Xs(),t=this.jr.Ct();if(e===null||t===null)return;const i=this.jr.Zr(!0);if(i.Xr||!e.Kr(i.ee))return;const s={x:A.It(i.ee),y:this.jr.Dt().Rt(i._t,t.Vt)},n=i.V,o=this.jr.W().lineWidth,a=Sa(this.Gr(),n);this.Wt.J({Tr:n,Pr:o,Rr:a.Rr,Dr:a.Dr,ht:a.ht,Xe:s})}Yr(){const A=this.Wt.$e();if(A!==null){const e=Sa(this.Gr(),A.Tr);A.Rr=e.Rr,A.Dr=e.Dr,A.ht=e.ht}}Gr(){return this.qr()?performance.now()-this.Fr:2599}}function mr(r,A){return va(Math.min(Math.max(r,12),30)*A)}function Cr(r,A){switch(r){case"arrowDown":case"arrowUp":return mr(A,1);case"circle":return mr(A,.8);case"square":return mr(A,.7)}}function Ha(r){return(function(A){const e=Math.ceil(A);return e%2!=0?e-1:e})(mr(r,1))}function La(r){return Math.max(mr(r,.1),3)}function Ia(r,A,e){return A?r:e?Math.ceil(r/2):0}function Ma(r,A,e,t,i){const s=Cr("square",e),n=(s-1)/2,o=r-n,a=A-n;return t>=o&&t<=o+s&&i>=a&&i<=a+s}function Da(r,A,e,t){const i=(Cr("arrowUp",t)-1)/2*e.Jr,s=(va(t/2)-1)/2*e.Jr;A.beginPath(),r?(A.moveTo(e.nt-i,e.st),A.lineTo(e.nt,e.st-i),A.lineTo(e.nt+i,e.st),A.lineTo(e.nt+s,e.st),A.lineTo(e.nt+s,e.st+i),A.lineTo(e.nt-s,e.st+i),A.lineTo(e.nt-s,e.st)):(A.moveTo(e.nt-i,e.st),A.lineTo(e.nt,e.st+i),A.lineTo(e.nt+i,e.st),A.lineTo(e.nt+s,e.st),A.lineTo(e.nt+s,e.st-i),A.lineTo(e.nt-s,e.st-i),A.lineTo(e.nt-s,e.st)),A.fill()}function tf(r,A,e,t,i,s){return Ma(A,e,t,i,s)}class rf extends Re{constructor(){super(...arguments),this.zt=null,this.ar=new wr,this.j=-1,this.H="",this.Qr=""}J(A){this.zt=A}_r(A,e){this.j===A&&this.H===e||(this.j=A,this.H=e,this.Qr=Wt(A,e),this.ar.nr())}wr(A,e){if(this.zt===null||this.zt.tt===null)return null;for(let t=this.zt.tt.from;t<this.zt.tt.to;t++){const i=this.zt.it[t];if(nf(i,A,e))return{Mr:i.th,gr:i.gr}}return null}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t},i,s){if(this.zt!==null&&this.zt.tt!==null){A.textBaseline="middle",A.font=this.Qr;for(let n=this.zt.tt.from;n<this.zt.tt.to;n++){const o=this.zt.it[n];o.Kt!==void 0&&(o.Kt.Hi=this.ar.xi(A,o.Kt.ih),o.Kt.At=this.j,o.Kt.nt=o.nt-o.Kt.Hi/2),sf(o,A,e,t)}}}}function sf(r,A,e,t){A.fillStyle=r.V,r.Kt!==void 0&&(function(i,s,n,o,a,l){i.save(),i.scale(a,l),i.fillText(s,n,o),i.restore()})(A,r.Kt.ih,r.Kt.nt,r.Kt.st,e,t),(function(i,s,n){if(i.Ks!==0){switch(i.nh){case"arrowDown":return void Da(!1,s,n,i.Ks);case"arrowUp":return void Da(!0,s,n,i.Ks);case"circle":return void(function(o,a,l){const c=(Cr("circle",l)-1)/2;o.beginPath(),o.arc(a.nt,a.st,c*a.Jr,0,2*Math.PI,!1),o.fill()})(s,n,i.Ks);case"square":return void(function(o,a,l){const c=Cr("square",l),u=(c-1)*a.Jr/2,d=a.nt-u,B=a.st-u;o.fillRect(d,B,c*a.Jr,c*a.Jr)})(s,n,i.Ks)}i.nh}})(r,A,(function(i,s,n){const o=Math.max(1,Math.floor(s))%2/2;return{nt:Math.round(i.nt*s)+o,st:i.st*n,Jr:s}})(r,e,t))}function nf(r,A,e){return!(r.Kt===void 0||!(function(t,i,s,n,o,a){const l=n/2;return o>=t&&o<=t+s&&a>=i-l&&a<=i+l})(r.Kt.nt,r.Kt.st,r.Kt.Hi,r.Kt.At,A,e))||(function(t,i,s){if(t.Ks===0)return!1;switch(t.nh){case"arrowDown":case"arrowUp":return tf(0,t.nt,t.st,t.Ks,i,s);case"circle":return(function(n,o,a,l,c){const u=2+Cr("circle",a)/2,d=n-l,B=o-c;return Math.sqrt(d*d+B*B)<=u})(t.nt,t.st,t.Ks,i,s);case"square":return Ma(t.nt,t.st,t.Ks,i,s)}})(r,A,e)}function of(r,A,e,t,i,s,n,o,a){const l=Ze(e)?e:e.Se,c=Ze(e)?e:e.Me,u=Ze(e)?e:e.xe,d=Ze(A.size)?Math.max(A.size,0):1,B=Ha(o.le())*d,p=B/2;switch(r.Ks=B,A.position){case"inBar":return r.st=n.Rt(l,a),void(r.Kt!==void 0&&(r.Kt.st=r.st+p+s+.6*i));case"aboveBar":return r.st=n.Rt(c,a)-p-t.sh,r.Kt!==void 0&&(r.Kt.st=r.st-p-.6*i,t.sh+=1.2*i),void(t.sh+=B+s);case"belowBar":return r.st=n.Rt(u,a)+p+t.eh,r.Kt!==void 0&&(r.Kt.st=r.st+p+s+.6*i,t.eh+=1.2*i),void(t.eh+=B+s)}A.position}class af{constructor(A,e){this.ft=!0,this.rh=!0,this.hh=!0,this.ah=null,this.oh=null,this.Wt=new rf,this.jr=A,this.$i=e,this.zt={it:[],tt:null}}bt(A){this.ft=!0,this.hh=!0,A==="data"&&(this.rh=!0,this.oh=null)}gt(A){if(!this.jr.yt())return null;this.ft&&this._h();const e=this.$i.W().layout;return this.Wt._r(e.fontSize,e.fontFamily),this.Wt.J(this.zt),this.Wt}uh(){if(this.hh){if(this.jr.dh().length>0){const A=this.$i.St().le(),e=La(A),t=1.5*Ha(A)+2*e,i=this.fh();this.ah={above:Ia(t,i.aboveBar,i.inBar),below:Ia(t,i.belowBar,i.inBar)}}else this.ah=null;this.hh=!1}return this.ah}fh(){return this.oh===null&&(this.oh=this.jr.dh().reduce(((A,e)=>(A[e.position]||(A[e.position]=!0),A)),{inBar:!1,aboveBar:!1,belowBar:!1})),this.oh}_h(){const A=this.jr.Dt(),e=this.$i.St(),t=this.jr.dh();this.rh&&(this.zt.it=t.map((c=>({ot:c.time,nt:0,st:0,Ks:0,nh:c.shape,V:c.color,th:c.th,gr:c.id,Kt:void 0}))),this.rh=!1);const i=this.$i.W().layout;this.zt.tt=null;const s=e.Xs();if(s===null)return;const n=this.jr.Ct();if(n===null||this.zt.it.length===0)return;let o=NaN;const a=La(e.le()),l={sh:a,eh:a};this.zt.tt=Ua(this.zt.it,s,!0);for(let c=this.zt.tt.from;c<this.zt.tt.to;c++){const u=t[c];u.time!==o&&(l.sh=a,l.eh=a,o=u.time);const d=this.zt.it[c];d.nt=e.It(u.time),u.text!==void 0&&u.text.length>0&&(d.Kt={ih:u.text,nt:0,st:0,Hi:0,At:0});const B=this.jr.ph(u.time);B!==null&&of(d,u,B,l,i.fontSize,a,A,e,n.Vt)}this.ft=!1}}class lf extends Xs{constructor(A){super(A)}yr(){const A=this.Sr;A.yt=!1;const e=this.Es.W();if(!e.priceLineVisible||!this.Es.yt())return;const t=this.Es.Zr(e.priceLineSource===0);t.Xr||(A.yt=!0,A.st=t.ki,A.V=this.Es.mh(t.V),A.et=e.priceLineWidth,A.Nt=e.priceLineStyle)}}class cf extends ai{constructor(A){super(),this.jt=A}zi(A,e,t){A.yt=!1,e.yt=!1;const i=this.jt;if(!i.yt())return;const s=i.W(),n=s.lastValueVisible,o=i.bh()!=="",a=s.seriesLastValueMode===0,l=i.Zr(!1);if(l.Xr)return;n&&(A.Kt=this.wh(l,n,a),A.yt=A.Kt.length!==0),(o||a)&&(e.Kt=this.gh(l,n,o,a),e.yt=e.Kt.length>0);const c=i.mh(l.V),u=si(c);t.t=u.t,t.ki=l.ki,e.Ot=i.$t().Bt(l.ki/i.Dt().At()),A.Ot=c,A.V=u.i,e.V=u.i}gh(A,e,t,i){let s="";const n=this.jt.bh();return t&&n.length!==0&&(s+=`${n} `),e&&i&&(s+=this.jt.Dt().Mh()?A.xh:A.Sh),s.trim()}wh(A,e,t){return e?t?this.jt.Dt().Mh()?A.Sh:A.xh:A.Kt:""}}function _a(r,A,e,t){const i=Number.isFinite(A),s=Number.isFinite(e);return i&&s?r(A,e):i||s?i?A:e:t}class Fe{constructor(A,e){this.kh=A,this.yh=e}Ch(A){return A!==null&&this.kh===A.kh&&this.yh===A.yh}Th(){return new Fe(this.kh,this.yh)}Ph(){return this.kh}Rh(){return this.yh}Dh(){return this.yh-this.kh}Ni(){return this.yh===this.kh||Number.isNaN(this.yh)||Number.isNaN(this.kh)}ts(A){return A===null?this:new Fe(_a(Math.min,this.Ph(),A.Ph(),-1/0),_a(Math.max,this.Rh(),A.Rh(),1/0))}Vh(A){if(!Ze(A)||this.yh-this.kh===0)return;const e=.5*(this.yh+this.kh);let t=this.yh-e,i=this.kh-e;t*=A,i*=A,this.yh=e+t,this.kh=e+i}Oh(A){Ze(A)&&(this.yh+=A,this.kh+=A)}Bh(){return{minValue:this.kh,maxValue:this.yh}}static Ah(A){return A===null?null:new Fe(A.minValue,A.maxValue)}}class di{constructor(A,e){this.Ih=A,this.zh=e||null}Lh(){return this.Ih}Eh(){return this.zh}Bh(){return this.Ih===null?null:{priceRange:this.Ih.Bh(),margins:this.zh||void 0}}static Ah(A){return A===null?null:new di(Fe.Ah(A.priceRange),A.margins)}}class hf extends Xs{constructor(A,e){super(A),this.Nh=e}yr(){const A=this.Sr;A.yt=!1;const e=this.Nh.W();if(!this.Es.yt()||!e.lineVisible)return;const t=this.Nh.Fh();t!==null&&(A.yt=!0,A.st=t,A.V=e.color,A.et=e.lineWidth,A.Nt=e.lineStyle,A.gr=this.Nh.W().id)}}class uf extends ai{constructor(A,e){super(),this.jr=A,this.Nh=e}zi(A,e,t){A.yt=!1,e.yt=!1;const i=this.Nh.W(),s=i.axisLabelVisible,n=i.title!=="",o=this.jr;if(!s||!o.yt())return;const a=this.Nh.Fh();if(a===null)return;n&&(e.Kt=i.title,e.yt=!0),e.Ot=o.$t().Bt(a/o.Dt().At()),A.Kt=this.Wh(i.price),A.yt=!0;const l=si(i.axisLabelColor||i.color);t.t=l.t;const c=i.axisLabelTextColor||l.i;A.V=c,e.V=c,t.ki=a}Wh(A){const e=this.jr.Ct();return e===null?"":this.jr.Dt().Fi(A,e.Vt)}}class df{constructor(A,e){this.jr=A,this.cn=e,this.jh=new hf(A,this),this.ur=new uf(A,this),this.Hh=new xa(this.ur,A,A.$t())}$h(A){Ge(this.cn,A),this.bt(),this.jr.$t().Uh()}W(){return this.cn}qh(){return this.jh}Yh(){return this.Hh}Zh(){return this.ur}bt(){this.jh.bt(),this.ur.bt()}Fh(){const A=this.jr,e=A.Dt();if(A.$t().St().Ni()||e.Ni())return null;const t=A.Ct();return t===null?null:e.Rt(this.cn.price,t.Vt)}}class ff extends Ps{constructor(A){super(),this.$i=A}$t(){return this.$i}}const pf={Bar:(r,A,e,t)=>{var i;const s=A.upColor,n=A.downColor,o=AA(r(e,t)),a=Rt(o.Vt[0])<=Rt(o.Vt[3]);return{ce:(i=o.V)!==null&&i!==void 0?i:a?s:n}},Candlestick:(r,A,e,t)=>{var i,s,n;const o=A.upColor,a=A.downColor,l=A.borderUpColor,c=A.borderDownColor,u=A.wickUpColor,d=A.wickDownColor,B=AA(r(e,t)),p=Rt(B.Vt[0])<=Rt(B.Vt[3]);return{ce:(i=B.V)!==null&&i!==void 0?i:p?o:a,Ne:(s=B.Ot)!==null&&s!==void 0?s:p?l:c,Ee:(n=B.Xh)!==null&&n!==void 0?n:p?u:d}},Custom:(r,A,e,t)=>{var i;return{ce:(i=AA(r(e,t)).V)!==null&&i!==void 0?i:A.color}},Area:(r,A,e,t)=>{var i,s,n,o;const a=AA(r(e,t));return{ce:(i=a.lt)!==null&&i!==void 0?i:A.lineColor,lt:(s=a.lt)!==null&&s!==void 0?s:A.lineColor,Ps:(n=a.Ps)!==null&&n!==void 0?n:A.topColor,Rs:(o=a.Rs)!==null&&o!==void 0?o:A.bottomColor}},Baseline:(r,A,e,t)=>{var i,s,n,o,a,l;const c=AA(r(e,t));return{ce:c.Vt[3]>=A.baseValue.price?A.topLineColor:A.bottomLineColor,Re:(i=c.Re)!==null&&i!==void 0?i:A.topLineColor,De:(s=c.De)!==null&&s!==void 0?s:A.bottomLineColor,ke:(n=c.ke)!==null&&n!==void 0?n:A.topFillColor1,ye:(o=c.ye)!==null&&o!==void 0?o:A.topFillColor2,Ce:(a=c.Ce)!==null&&a!==void 0?a:A.bottomFillColor1,Te:(l=c.Te)!==null&&l!==void 0?l:A.bottomFillColor2}},Line:(r,A,e,t)=>{var i,s;const n=AA(r(e,t));return{ce:(i=n.V)!==null&&i!==void 0?i:A.color,lt:(s=n.V)!==null&&s!==void 0?s:A.color}},Histogram:(r,A,e,t)=>{var i;return{ce:(i=AA(r(e,t)).V)!==null&&i!==void 0?i:A.color}}};class Bf{constructor(A){this.Kh=(e,t)=>t!==void 0?t.Vt:this.jr.In().Gh(e),this.jr=A,this.Jh=pf[A.Qh()]}$s(A,e){return this.Jh(this.Kh,this.jr.W(),A,e)}}var ka;(function(r){r[r.NearestLeft=-1]="NearestLeft",r[r.None=0]="None",r[r.NearestRight=1]="NearestRight"})(ka||(ka={}));const wt=30;class gf{constructor(){this.tl=[],this.il=new Map,this.nl=new Map}sl(){return this.Ks()>0?this.tl[this.tl.length-1]:null}el(){return this.Ks()>0?this.rl(0):null}An(){return this.Ks()>0?this.rl(this.tl.length-1):null}Ks(){return this.tl.length}Ni(){return this.Ks()===0}Kr(A){return this.hl(A,0)!==null}Gh(A){return this.ll(A)}ll(A,e=0){const t=this.hl(A,e);return t===null?null:Object.assign(Object.assign({},this.al(t)),{ee:this.rl(t)})}ne(){return this.tl}ol(A,e,t){if(this.Ni())return null;let i=null;for(const s of t)i=fi(i,this._l(A,e,s));return i}J(A){this.nl.clear(),this.il.clear(),this.tl=A}rl(A){return this.tl[A].ee}al(A){return this.tl[A]}hl(A,e){const t=this.ul(A);if(t===null&&e!==0)switch(e){case-1:return this.cl(A);case 1:return this.dl(A);default:throw new TypeError("Unknown search mode")}return t}cl(A){let e=this.fl(A);return e>0&&(e-=1),e!==this.tl.length&&this.rl(e)<A?e:null}dl(A){const e=this.vl(A);return e!==this.tl.length&&A<this.rl(e)?e:null}ul(A){const e=this.fl(A);return e===this.tl.length||A<this.tl[e].ee?null:e}fl(A){return gr(this.tl,A,((e,t)=>e.ee<t))}vl(A){return Fa(this.tl,A,((e,t)=>e.ee>t))}pl(A,e,t){let i=null;for(let s=A;s<e;s++){const n=this.tl[s].Vt[t];Number.isNaN(n)||(i===null?i={ml:n,bl:n}:(n<i.ml&&(i.ml=n),n>i.bl&&(i.bl=n)))}return i}_l(A,e,t){if(this.Ni())return null;let i=null;const s=AA(this.el()),n=AA(this.An()),o=Math.max(A,s),a=Math.min(e,n),l=Math.ceil(o/wt)*wt,c=Math.max(l,Math.floor(a/wt)*wt);{const d=this.fl(o),B=this.vl(Math.min(a,l,e));i=fi(i,this.pl(d,B,t))}let u=this.il.get(t);u===void 0&&(u=new Map,this.il.set(t,u));for(let d=Math.max(l+1,o);d<c;d+=wt){const B=Math.floor(d/wt);let p=u.get(B);if(p===void 0){const f=this.fl(B*wt),g=this.vl((B+1)*wt-1);p=this.pl(f,g,t),u.set(B,p)}i=fi(i,p)}{const d=this.fl(c),B=this.vl(a);i=fi(i,this.pl(d,B,t))}return i}}function fi(r,A){return r===null?A:A===null?r:{ml:Math.min(r.ml,A.ml),bl:Math.max(r.bl,A.bl)}}class wf{constructor(A){this.wl=A}X(A,e,t){this.wl.draw(A)}gl(A,e,t){var i,s;(s=(i=this.wl).drawBackground)===null||s===void 0||s.call(i,A)}}class Js{constructor(A){this.tr=null,this.wn=A}gt(){var A;const e=this.wn.renderer();if(e===null)return null;if(((A=this.tr)===null||A===void 0?void 0:A.Ml)===e)return this.tr.xl;const t=new wf(e);return this.tr={Ml:e,xl:t},t}Sl(){var A,e,t;return(t=(e=(A=this.wn).zOrder)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:"normal"}}function Oa(r){var A,e,t,i,s;return{Kt:r.text(),ki:r.coordinate(),Si:(A=r.fixedCoordinate)===null||A===void 0?void 0:A.call(r),V:r.textColor(),t:r.backColor(),yt:(t=(e=r.visible)===null||e===void 0?void 0:e.call(r))===null||t===void 0||t,hi:(s=(i=r.tickVisible)===null||i===void 0?void 0:i.call(r))===null||s===void 0||s}}class mf{constructor(A,e){this.Wt=new da,this.kl=A,this.yl=e}gt(){return this.Wt.J(Object.assign({Hi:this.yl.Hi()},Oa(this.kl))),this.Wt}}class Cf extends ai{constructor(A,e){super(),this.kl=A,this.Li=e}zi(A,e,t){const i=Oa(this.kl);t.t=i.t,A.V=i.V;const s=2/12*this.Li.P();t.wi=s,t.gi=s,t.ki=i.ki,t.Si=i.Si,A.Kt=i.Kt,A.yt=i.yt,A.hi=i.hi}}class vf{constructor(A,e){this.Cl=null,this.Tl=null,this.Pl=null,this.Rl=null,this.Dl=null,this.Vl=A,this.jr=e}Ol(){return this.Vl}Vn(){var A,e;(e=(A=this.Vl).updateAllViews)===null||e===void 0||e.call(A)}Pn(){var A,e,t,i;const s=(t=(e=(A=this.Vl).paneViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Cl)===null||i===void 0?void 0:i.Ml)===s)return this.Cl.xl;const n=s.map((o=>new Js(o)));return this.Cl={Ml:s,xl:n},n}Qi(){var A,e,t,i;const s=(t=(e=(A=this.Vl).timeAxisViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Tl)===null||i===void 0?void 0:i.Ml)===s)return this.Tl.xl;const n=this.jr.$t().St(),o=s.map((a=>new mf(a,n)));return this.Tl={Ml:s,xl:o},o}Rn(){var A,e,t,i;const s=(t=(e=(A=this.Vl).priceAxisViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Pl)===null||i===void 0?void 0:i.Ml)===s)return this.Pl.xl;const n=this.jr.Dt(),o=s.map((a=>new Cf(a,n)));return this.Pl={Ml:s,xl:o},o}Bl(){var A,e,t,i;const s=(t=(e=(A=this.Vl).priceAxisPaneViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Rl)===null||i===void 0?void 0:i.Ml)===s)return this.Rl.xl;const n=s.map((o=>new Js(o)));return this.Rl={Ml:s,xl:n},n}Al(){var A,e,t,i;const s=(t=(e=(A=this.Vl).timeAxisPaneViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Dl)===null||i===void 0?void 0:i.Ml)===s)return this.Dl.xl;const n=s.map((o=>new Js(o)));return this.Dl={Ml:s,xl:n},n}Il(A,e){var t,i,s;return(s=(i=(t=this.Vl).autoscaleInfo)===null||i===void 0?void 0:i.call(t,A,e))!==null&&s!==void 0?s:null}wr(A,e){var t,i,s;return(s=(i=(t=this.Vl).hitTest)===null||i===void 0?void 0:i.call(t,A,e))!==null&&s!==void 0?s:null}}function Zs(r,A,e,t){r.forEach((i=>{A(i).forEach((s=>{s.Sl()===e&&t.push(s)}))}))}function Ys(r){return r.Pn()}function bf(r){return r.Bl()}function yf(r){return r.Al()}class qs extends ff{constructor(A,e,t,i,s){super(A),this.zt=new gf,this.jh=new lf(this),this.zl=[],this.Ll=new qd(this),this.El=null,this.Nl=null,this.Fl=[],this.Wl=[],this.jl=null,this.Hl=[],this.cn=e,this.$l=t;const n=new cf(this);this.rn=[n],this.Hh=new xa(n,this,A),t!=="Area"&&t!=="Line"&&t!=="Baseline"||(this.El=new ef(this)),this.Ul(),this.ql(s)}S(){this.jl!==null&&clearTimeout(this.jl)}mh(A){return this.cn.priceLineColor||A}Zr(A){const e={Xr:!0},t=this.Dt();if(this.$t().St().Ni()||t.Ni()||this.zt.Ni())return e;const i=this.$t().St().Xs(),s=this.Ct();if(i===null||s===null)return e;let n,o;if(A){const u=this.zt.sl();if(u===null)return e;n=u,o=u.ee}else{const u=this.zt.ll(i.ui(),-1);if(u===null||(n=this.zt.Gh(u.ee),n===null))return e;o=u.ee}const a=n.Vt[3],l=this.Us().$s(o,{Vt:n}),c=t.Rt(a,s.Vt);return{Xr:!1,_t:a,Kt:t.Fi(a,s.Vt),xh:t.Yl(a),Sh:t.Zl(a,s.Vt),V:l.ce,ki:c,ee:o}}Us(){return this.Nl!==null||(this.Nl=new Bf(this)),this.Nl}W(){return this.cn}$h(A){const e=A.priceScaleId;e!==void 0&&e!==this.cn.priceScaleId&&this.$t().Xl(this,e),Ge(this.cn,A),A.priceFormat!==void 0&&(this.Ul(),this.$t().Kl()),this.$t().Gl(this),this.$t().Jl(),this.wn.bt("options")}J(A,e){this.zt.J(A),this.Ql(),this.wn.bt("data"),this.dn.bt("data"),this.El!==null&&(e&&e.ta?this.El.$r():A.length===0&&this.El.Hr());const t=this.$t().dr(this);this.$t().ia(t),this.$t().Gl(this),this.$t().Jl(),this.$t().Uh()}na(A){this.Fl=A,this.Ql();const e=this.$t().dr(this);this.dn.bt("data"),this.$t().ia(e),this.$t().Gl(this),this.$t().Jl(),this.$t().Uh()}sa(){return this.Fl}dh(){return this.Wl}ea(A){const e=new df(this,A);return this.zl.push(e),this.$t().Gl(this),e}ra(A){const e=this.zl.indexOf(A);e!==-1&&this.zl.splice(e,1),this.$t().Gl(this)}Qh(){return this.$l}Ct(){const A=this.ha();return A===null?null:{Vt:A.Vt[3],la:A.ot}}ha(){const A=this.$t().St().Xs();if(A===null)return null;const e=A.Os();return this.zt.ll(e,1)}In(){return this.zt}ph(A){const e=this.zt.Gh(A);return e===null?null:this.$l==="Bar"||this.$l==="Candlestick"||this.$l==="Custom"?{ge:e.Vt[0],Me:e.Vt[1],xe:e.Vt[2],Se:e.Vt[3]}:e.Vt[3]}aa(A){const e=[];Zs(this.Hl,Ys,"top",e);const t=this.El;return t!==null&&t.yt()&&(this.jl===null&&t.qr()&&(this.jl=setTimeout((()=>{this.jl=null,this.$t().oa()}),0)),t.Ur(),e.unshift(t)),e}Pn(){const A=[];this._a()||A.push(this.Ll),A.push(this.wn,this.jh,this.dn);const e=this.zl.map((t=>t.qh()));return A.push(...e),Zs(this.Hl,Ys,"normal",A),A}ua(){return this.ca(Ys,"bottom")}da(A){return this.ca(bf,A)}fa(A){return this.ca(yf,A)}va(A,e){return this.Hl.map((t=>t.wr(A,e))).filter((t=>t!==null))}Ji(A){return[this.Hh,...this.zl.map((e=>e.Yh()))]}Rn(A,e){if(e!==this.Yi&&!this._a())return[];const t=[...this.rn];for(const i of this.zl)t.push(i.Zh());return this.Hl.forEach((i=>{t.push(...i.Rn())})),t}Qi(){const A=[];return this.Hl.forEach((e=>{A.push(...e.Qi())})),A}Il(A,e){if(this.cn.autoscaleInfoProvider!==void 0){const t=this.cn.autoscaleInfoProvider((()=>{const i=this.pa(A,e);return i===null?null:i.Bh()}));return di.Ah(t)}return this.pa(A,e)}ma(){return this.cn.priceFormat.minMove}ba(){return this.wa}Vn(){var A;this.wn.bt(),this.dn.bt();for(const e of this.rn)e.bt();for(const e of this.zl)e.bt();this.jh.bt(),this.Ll.bt(),(A=this.El)===null||A===void 0||A.bt(),this.Hl.forEach((e=>e.Vn()))}Dt(){return AA(super.Dt())}kt(A){if(!((this.$l==="Line"||this.$l==="Area"||this.$l==="Baseline")&&this.cn.crosshairMarkerVisible))return null;const e=this.zt.Gh(A);return e===null?null:{_t:e.Vt[3],ht:this.ga(),Ot:this.Ma(),Pt:this.xa(),Tt:this.Sa(A)}}bh(){return this.cn.title}yt(){return this.cn.visible}ka(A){this.Hl.push(new vf(A,this))}ya(A){this.Hl=this.Hl.filter((e=>e.Ol()!==A))}Ca(){if(this.wn instanceof $s)return A=>this.wn.We(A)}Ta(){if(this.wn instanceof $s)return A=>this.wn.je(A)}_a(){return!li(this.Dt().Pa())}pa(A,e){if(!fr(A)||!fr(e)||this.zt.Ni())return null;const t=this.$l==="Line"||this.$l==="Area"||this.$l==="Baseline"||this.$l==="Histogram"?[3]:[2,1],i=this.zt.ol(A,e,t);let s=i!==null?new Fe(i.ml,i.bl):null;if(this.Qh()==="Histogram"){const o=this.cn.base,a=new Fe(o,o);s=s!==null?s.ts(a):a}let n=this.dn.uh();return this.Hl.forEach((o=>{const a=o.Il(A,e);if(a?.priceRange){const B=new Fe(a.priceRange.minValue,a.priceRange.maxValue);s=s!==null?s.ts(B):B}var l,c,u,d;a?.margins&&(l=n,c=a.margins,n={above:Math.max((u=l?.above)!==null&&u!==void 0?u:0,c.above),below:Math.max((d=l?.below)!==null&&d!==void 0?d:0,c.below)})})),new di(s,n)}ga(){switch(this.$l){case"Line":case"Area":case"Baseline":return this.cn.crosshairMarkerRadius}return 0}Ma(){switch(this.$l){case"Line":case"Area":case"Baseline":{const A=this.cn.crosshairMarkerBorderColor;if(A.length!==0)return A}}return null}xa(){switch(this.$l){case"Line":case"Area":case"Baseline":return this.cn.crosshairMarkerBorderWidth}return 0}Sa(A){switch(this.$l){case"Line":case"Area":case"Baseline":{const e=this.cn.crosshairMarkerBackgroundColor;if(e.length!==0)return e}}return this.Us().$s(A).ce}Ul(){switch(this.cn.priceFormat.type){case"custom":this.wa={format:this.cn.priceFormat.formatter};break;case"volume":this.wa=new Td(this.cn.priceFormat.precision);break;case"percent":this.wa=new Ba(this.cn.priceFormat.precision);break;default:{const A=Math.pow(10,this.cn.priceFormat.precision);this.wa=new ci(A,this.cn.priceFormat.minMove*A)}}this.Yi!==null&&this.Yi.Ra()}Ql(){const A=this.$t().St();if(!A.Da()||this.zt.Ni())return void(this.Wl=[]);const e=AA(this.zt.el());this.Wl=this.Fl.map(((t,i)=>{const s=AA(A.Va(t.time,!0)),n=s<e?1:-1;return{time:AA(this.zt.ll(s,n)).ee,position:t.position,shape:t.shape,color:t.color,id:t.id,th:i,text:t.text,size:t.size,originalTime:t.originalTime}}))}ql(A){switch(this.dn=new af(this,this.$t()),this.$l){case"Bar":this.wn=new Od(this,this.$t());break;case"Candlestick":this.wn=new zd(this,this.$t());break;case"Line":this.wn=new Xd(this,this.$t());break;case"Custom":this.wn=new $s(this,this.$t(),be(A));break;case"Area":this.wn=new _d(this,this.$t());break;case"Baseline":this.wn=new Vd(this,this.$t());break;case"Histogram":this.wn=new $d(this,this.$t());break;default:throw Error("Unknown chart style assigned: "+this.$l)}}ca(A,e){const t=[];return Zs(this.Hl,A,e,t),t}}class Qf{constructor(A){this.cn=A}Oa(A,e,t){let i=A;if(this.cn.mode===0)return i;const s=t.vn(),n=s.Ct();if(n===null)return i;const o=s.Rt(A,n),a=t.Ba().filter((c=>c instanceof qs)).reduce(((c,u)=>{if(t.vr(u)||!u.yt())return c;const d=u.Dt(),B=u.In();if(d.Ni()||!B.Kr(e))return c;const p=B.Gh(e);if(p===null)return c;const f=Rt(u.Ct());return c.concat([d.Rt(p.Vt[3],f.Vt)])}),[]);if(a.length===0)return i;a.sort(((c,u)=>Math.abs(c-o)-Math.abs(u-o)));const l=a[0];return i=s.pn(l,n),i}}class Ff extends Re{constructor(){super(...arguments),this.zt=null}J(A){this.zt=A}K({context:A,bitmapSize:e,horizontalPixelRatio:t,verticalPixelRatio:i}){if(this.zt===null)return;const s=Math.max(1,Math.floor(t));A.lineWidth=s,(function(n,o){n.save(),n.lineWidth%2&&n.translate(.5,.5),o(),n.restore()})(A,(()=>{const n=AA(this.zt);if(n.Aa){A.strokeStyle=n.Ia,Ht(A,n.za),A.beginPath();for(const o of n.La){const a=Math.round(o.Ea*t);A.moveTo(a,-s),A.lineTo(a,e.height+s)}A.stroke()}if(n.Na){A.strokeStyle=n.Fa,Ht(A,n.Wa),A.beginPath();for(const o of n.ja){const a=Math.round(o.Ea*i);A.moveTo(-s,a),A.lineTo(e.width+s,a)}A.stroke()}}))}}class Uf{constructor(A){this.Wt=new Ff,this.ft=!0,this.tn=A}bt(){this.ft=!0}gt(){if(this.ft){const A=this.tn.$t().W().grid,e={Na:A.horzLines.visible,Aa:A.vertLines.visible,Fa:A.horzLines.color,Ia:A.vertLines.color,Wa:A.horzLines.style,za:A.vertLines.style,ja:this.tn.vn().Ha(),La:(this.tn.$t().St().Ha()||[]).map((t=>({Ea:t.coord})))};this.Wt.J(e),this.ft=!1}return this.Wt}}class Ef{constructor(A){this.wn=new Uf(A)}qh(){return this.wn}}const js={$a:4,Ua:1e-4};function $t(r,A){const e=100*(r-A)/A;return A<0?-e:e}function xf(r,A){const e=$t(r.Ph(),A),t=$t(r.Rh(),A);return new Fe(e,t)}function vr(r,A){const e=100*(r-A)/A+100;return A<0?-e:e}function Tf(r,A){const e=vr(r.Ph(),A),t=vr(r.Rh(),A);return new Fe(e,t)}function pi(r,A){const e=Math.abs(r);if(e<1e-15)return 0;const t=Math.log10(e+A.Ua)+A.$a;return r<0?-t:t}function br(r,A){const e=Math.abs(r);if(e<1e-15)return 0;const t=Math.pow(10,e-A.$a)-A.Ua;return r<0?-t:t}function yr(r,A){if(r===null)return null;const e=pi(r.Ph(),A),t=pi(r.Rh(),A);return new Fe(e,t)}function Bi(r,A){if(r===null)return null;const e=br(r.Ph(),A),t=br(r.Rh(),A);return new Fe(e,t)}function An(r){if(r===null)return js;const A=Math.abs(r.Rh()-r.Ph());if(A>=1||A<1e-15)return js;const e=Math.ceil(Math.abs(Math.log10(A))),t=js.$a+e;return{$a:t,Ua:1/Math.pow(10,t)}}class en{constructor(A,e){if(this.qa=A,this.Ya=e,(function(t){if(t<0)return!1;for(let i=t;i>1;i/=10)if(i%10!=0)return!1;return!0})(this.qa))this.Za=[2,2.5,2];else{this.Za=[];for(let t=this.qa;t!==1;){if(t%2==0)this.Za.push(2),t/=2;else{if(t%5!=0)throw new Error("unexpected base");this.Za.push(2,2.5),t/=5}if(this.Za.length>100)throw new Error("something wrong with base")}}}Xa(A,e,t){const i=this.qa===0?0:1/this.qa;let s=Math.pow(10,Math.max(0,Math.ceil(Math.log10(A-e)))),n=0,o=this.Ya[0];for(;;){const u=hi(s,i,1e-14)&&s>i+1e-14,d=hi(s,t*o,1e-14),B=hi(s,1,1e-14);if(!(u&&d&&B))break;s/=o,o=this.Ya[++n%this.Ya.length]}if(s<=i+1e-14&&(s=i),s=Math.max(1,s),this.Za.length>0&&(a=s,l=1,c=1e-14,Math.abs(a-l)<c))for(n=0,o=this.Za[0];hi(s,t*o,1e-14)&&s>i+1e-14;)s/=o,o=this.Za[++n%this.Za.length];var a,l,c;return s}}class Na{constructor(A,e,t,i){this.Ka=[],this.Li=A,this.qa=e,this.Ga=t,this.Ja=i}Xa(A,e){if(A<e)throw new Error("high < low");const t=this.Li.At(),i=(A-e)*this.Qa()/t,s=new en(this.qa,[2,2.5,2]),n=new en(this.qa,[2,2,2.5]),o=new en(this.qa,[2.5,2,2]),a=[];return a.push(s.Xa(A,e,i),n.Xa(A,e,i),o.Xa(A,e,i)),(function(l){if(l.length<1)throw Error("array is empty");let c=l[0];for(let u=1;u<l.length;++u)l[u]<c&&(c=l[u]);return c})(a)}io(){const A=this.Li,e=A.Ct();if(e===null)return void(this.Ka=[]);const t=A.At(),i=this.Ga(t-1,e),s=this.Ga(0,e),n=this.Li.W().entireTextOnly?this.no()/2:0,o=n,a=t-1-n,l=Math.max(i,s),c=Math.min(i,s);if(l===c)return void(this.Ka=[]);let u=this.Xa(l,c),d=l%u;d+=d<0?u:0;const B=l>=c?1:-1;let p=null,f=0;for(let g=l-d;g>c;g-=u){const Q=this.Ja(g,e,!0);p!==null&&Math.abs(Q-p)<this.Qa()||Q<o||Q>a||(f<this.Ka.length?(this.Ka[f].Ea=Q,this.Ka[f].so=A.eo(g)):this.Ka.push({Ea:Q,so:A.eo(g)}),f++,p=Q,A.ro()&&(u=this.Xa(g*B,c)))}this.Ka.length=f}Ha(){return this.Ka}no(){return this.Li.P()}Qa(){return Math.ceil(2.5*this.no())}}function Ka(r){return r.slice().sort(((A,e)=>AA(A.Xi())-AA(e.Xi())))}var Va;(function(r){r[r.Normal=0]="Normal",r[r.Logarithmic=1]="Logarithmic",r[r.Percentage=2]="Percentage",r[r.IndexedTo100=3]="IndexedTo100"})(Va||(Va={}));const Pa=new Ba,za=new ci(100,1);class Sf{constructor(A,e,t,i){this.ho=0,this.lo=null,this.Ih=null,this.ao=null,this.oo={_o:!1,uo:null},this.co=0,this.do=0,this.fo=new ee,this.vo=new ee,this.po=[],this.mo=null,this.bo=null,this.wo=null,this.Mo=null,this.wa=za,this.xo=An(null),this.So=A,this.cn=e,this.ko=t,this.yo=i,this.Co=new Na(this,100,this.To.bind(this),this.Po.bind(this))}Pa(){return this.So}W(){return this.cn}$h(A){if(Ge(this.cn,A),this.Ra(),A.mode!==void 0&&this.Ro({Cr:A.mode}),A.scaleMargins!==void 0){const e=be(A.scaleMargins.top),t=be(A.scaleMargins.bottom);if(e<0||e>1)throw new Error(`Invalid top margin - expect value between 0 and 1, given=${e}`);if(t<0||t>1)throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${t}`);if(e+t>1)throw new Error(`Invalid margins - sum of margins must be less than 1, given=${e+t}`);this.Do(),this.bo=null}}Vo(){return this.cn.autoScale}ro(){return this.cn.mode===1}Mh(){return this.cn.mode===2}Oo(){return this.cn.mode===3}Cr(){return{Wn:this.cn.autoScale,Bo:this.cn.invertScale,Cr:this.cn.mode}}Ro(A){const e=this.Cr();let t=null;A.Wn!==void 0&&(this.cn.autoScale=A.Wn),A.Cr!==void 0&&(this.cn.mode=A.Cr,A.Cr!==2&&A.Cr!==3||(this.cn.autoScale=!0),this.oo._o=!1),e.Cr===1&&A.Cr!==e.Cr&&((function(s,n){if(s===null)return!1;const o=br(s.Ph(),n),a=br(s.Rh(),n);return isFinite(o)&&isFinite(a)})(this.Ih,this.xo)?(t=Bi(this.Ih,this.xo),t!==null&&this.Ao(t)):this.cn.autoScale=!0),A.Cr===1&&A.Cr!==e.Cr&&(t=yr(this.Ih,this.xo),t!==null&&this.Ao(t));const i=e.Cr!==this.cn.mode;i&&(e.Cr===2||this.Mh())&&this.Ra(),i&&(e.Cr===3||this.Oo())&&this.Ra(),A.Bo!==void 0&&e.Bo!==A.Bo&&(this.cn.invertScale=A.Bo,this.Io()),this.vo.m(e,this.Cr())}zo(){return this.vo}P(){return this.ko.fontSize}At(){return this.ho}Lo(A){this.ho!==A&&(this.ho=A,this.Do(),this.bo=null)}Eo(){if(this.lo)return this.lo;const A=this.At()-this.No()-this.Fo();return this.lo=A,A}Lh(){return this.Wo(),this.Ih}Ao(A,e){const t=this.Ih;(e||t===null&&A!==null||t!==null&&!t.Ch(A))&&(this.bo=null,this.Ih=A)}Ni(){return this.Wo(),this.ho===0||!this.Ih||this.Ih.Ni()}jo(A){return this.Bo()?A:this.At()-1-A}Rt(A,e){return this.Mh()?A=$t(A,e):this.Oo()&&(A=vr(A,e)),this.Po(A,e)}te(A,e,t){this.Wo();const i=this.Fo(),s=AA(this.Lh()),n=s.Ph(),o=s.Rh(),a=this.Eo()-1,l=this.Bo(),c=a/(o-n),u=t===void 0?0:t.from,d=t===void 0?A.length:t.to,B=this.Ho();for(let p=u;p<d;p++){const f=A[p],g=f._t;if(isNaN(g))continue;let Q=g;B!==null&&(Q=B(f._t,e));const m=i+c*(Q-n),E=l?m:this.ho-1-m;f.st=E}}be(A,e,t){this.Wo();const i=this.Fo(),s=AA(this.Lh()),n=s.Ph(),o=s.Rh(),a=this.Eo()-1,l=this.Bo(),c=a/(o-n),u=t===void 0?0:t.from,d=t===void 0?A.length:t.to,B=this.Ho();for(let p=u;p<d;p++){const f=A[p];let g=f.ge,Q=f.Me,m=f.xe,E=f.Se;B!==null&&(g=B(f.ge,e),Q=B(f.Me,e),m=B(f.xe,e),E=B(f.Se,e));let F=i+c*(g-n),S=l?F:this.ho-1-F;f.pe=S,F=i+c*(Q-n),S=l?F:this.ho-1-F,f.de=S,F=i+c*(m-n),S=l?F:this.ho-1-F,f.fe=S,F=i+c*(E-n),S=l?F:this.ho-1-F,f.me=S}}pn(A,e){const t=this.To(A,e);return this.$o(t,e)}$o(A,e){let t=A;return this.Mh()?t=(function(i,s){return s<0&&(i=-i),i/100*s+s})(t,e):this.Oo()&&(t=(function(i,s){return i-=100,s<0&&(i=-i),i/100*s+s})(t,e)),t}Ba(){return this.po}Uo(){if(this.mo)return this.mo;let A=[];for(let e=0;e<this.po.length;e++){const t=this.po[e];t.Xi()===null&&t.Ki(e+1),A.push(t)}return A=Ka(A),this.mo=A,this.mo}qo(A){this.po.indexOf(A)===-1&&(this.po.push(A),this.Ra(),this.Yo())}Zo(A){const e=this.po.indexOf(A);if(e===-1)throw new Error("source is not attached to scale");this.po.splice(e,1),this.po.length===0&&(this.Ro({Wn:!0}),this.Ao(null)),this.Ra(),this.Yo()}Ct(){let A=null;for(const e of this.po){const t=e.Ct();t!==null&&(A===null||t.la<A.la)&&(A=t)}return A===null?null:A.Vt}Bo(){return this.cn.invertScale}Ha(){const A=this.Ct()===null;if(this.bo!==null&&(A||this.bo.Xo===A))return this.bo.Ha;this.Co.io();const e=this.Co.Ha();return this.bo={Ha:e,Xo:A},this.fo.m(),e}Ko(){return this.fo}Go(A){this.Mh()||this.Oo()||this.wo===null&&this.ao===null&&(this.Ni()||(this.wo=this.ho-A,this.ao=AA(this.Lh()).Th()))}Jo(A){if(this.Mh()||this.Oo()||this.wo===null)return;this.Ro({Wn:!1}),(A=this.ho-A)<0&&(A=0);let e=(this.wo+.2*(this.ho-1))/(A+.2*(this.ho-1));const t=AA(this.ao).Th();e=Math.max(e,.1),t.Vh(e),this.Ao(t)}Qo(){this.Mh()||this.Oo()||(this.wo=null,this.ao=null)}t_(A){this.Vo()||this.Mo===null&&this.ao===null&&(this.Ni()||(this.Mo=A,this.ao=AA(this.Lh()).Th()))}i_(A){if(this.Vo()||this.Mo===null)return;const e=AA(this.Lh()).Dh()/(this.Eo()-1);let t=A-this.Mo;this.Bo()&&(t*=-1);const i=t*e,s=AA(this.ao).Th();s.Oh(i),this.Ao(s,!0),this.bo=null}n_(){this.Vo()||this.Mo!==null&&(this.Mo=null,this.ao=null)}ba(){return this.wa||this.Ra(),this.wa}Fi(A,e){switch(this.cn.mode){case 2:return this.s_($t(A,e));case 3:return this.ba().format(vr(A,e));default:return this.Wh(A)}}eo(A){switch(this.cn.mode){case 2:return this.s_(A);case 3:return this.ba().format(A);default:return this.Wh(A)}}Yl(A){return this.Wh(A,AA(this.e_()).ba())}Zl(A,e){return A=$t(A,e),this.s_(A,Pa)}r_(){return this.po}h_(A){this.oo={uo:A,_o:!1}}Vn(){this.po.forEach((A=>A.Vn()))}Ra(){this.bo=null;const A=this.e_();let e=100;A!==null&&(e=Math.round(1/A.ma())),this.wa=za,this.Mh()?(this.wa=Pa,e=100):this.Oo()?(this.wa=new ci(100,1),e=100):A!==null&&(this.wa=A.ba()),this.Co=new Na(this,e,this.To.bind(this),this.Po.bind(this)),this.Co.io()}Yo(){this.mo=null}e_(){return this.po[0]||null}No(){return this.Bo()?this.cn.scaleMargins.bottom*this.At()+this.do:this.cn.scaleMargins.top*this.At()+this.co}Fo(){return this.Bo()?this.cn.scaleMargins.top*this.At()+this.co:this.cn.scaleMargins.bottom*this.At()+this.do}Wo(){this.oo._o||(this.oo._o=!0,this.l_())}Do(){this.lo=null}Po(A,e){if(this.Wo(),this.Ni())return 0;A=this.ro()&&A?pi(A,this.xo):A;const t=AA(this.Lh()),i=this.Fo()+(this.Eo()-1)*(A-t.Ph())/t.Dh();return this.jo(i)}To(A,e){if(this.Wo(),this.Ni())return 0;const t=this.jo(A),i=AA(this.Lh()),s=i.Ph()+i.Dh()*((t-this.Fo())/(this.Eo()-1));return this.ro()?br(s,this.xo):s}Io(){this.bo=null,this.Co.io()}l_(){const A=this.oo.uo;if(A===null)return;let e=null;const t=this.r_();let i=0,s=0;for(const a of t){if(!a.yt())continue;const l=a.Ct();if(l===null)continue;const c=a.Il(A.Os(),A.ui());let u=c&&c.Lh();if(u!==null){switch(this.cn.mode){case 1:u=yr(u,this.xo);break;case 2:u=xf(u,l.Vt);break;case 3:u=Tf(u,l.Vt)}if(e=e===null?u:e.ts(AA(u)),c!==null){const d=c.Eh();d!==null&&(i=Math.max(i,d.above),s=Math.max(s,d.below))}}}if(i===this.co&&s===this.do||(this.co=i,this.do=s,this.bo=null,this.Do()),e!==null){if(e.Ph()===e.Rh()){const a=this.e_(),l=5*(a===null||this.Mh()||this.Oo()?1:a.ma());this.ro()&&(e=Bi(e,this.xo)),e=new Fe(e.Ph()-l,e.Rh()+l),this.ro()&&(e=yr(e,this.xo))}if(this.ro()){const a=Bi(e,this.xo),l=An(a);if(n=l,o=this.xo,n.$a!==o.$a||n.Ua!==o.Ua){const c=this.ao!==null?Bi(this.ao,this.xo):null;this.xo=l,e=yr(a,l),c!==null&&(this.ao=yr(c,l))}}this.Ao(e)}else this.Ih===null&&(this.Ao(new Fe(-.5,.5)),this.xo=An(null));var n,o;this.oo._o=!0}Ho(){return this.Mh()?$t:this.Oo()?vr:this.ro()?A=>pi(A,this.xo):null}a_(A,e,t){return e===void 0?(t===void 0&&(t=this.ba()),t.format(A)):e(A)}Wh(A,e){return this.a_(A,this.yo.priceFormatter,e)}s_(A,e){return this.a_(A,this.yo.percentageFormatter,e)}}class Hf{constructor(A,e){this.po=[],this.o_=new Map,this.ho=0,this.__=0,this.u_=1e3,this.mo=null,this.c_=new ee,this.yl=A,this.$i=e,this.d_=new Ef(this);const t=e.W();this.f_=this.v_("left",t.leftPriceScale),this.p_=this.v_("right",t.rightPriceScale),this.f_.zo().l(this.m_.bind(this,this.f_),this),this.p_.zo().l(this.m_.bind(this,this.p_),this),this.b_(t)}b_(A){if(A.leftPriceScale&&this.f_.$h(A.leftPriceScale),A.rightPriceScale&&this.p_.$h(A.rightPriceScale),A.localization&&(this.f_.Ra(),this.p_.Ra()),A.overlayPriceScales){const e=Array.from(this.o_.values());for(const t of e){const i=AA(t[0].Dt());i.$h(A.overlayPriceScales),A.localization&&i.Ra()}}}w_(A){switch(A){case"left":return this.f_;case"right":return this.p_}return this.o_.has(A)?be(this.o_.get(A))[0].Dt():null}S(){this.$t().g_().p(this),this.f_.zo().p(this),this.p_.zo().p(this),this.po.forEach((A=>{A.S&&A.S()})),this.c_.m()}M_(){return this.u_}x_(A){this.u_=A}$t(){return this.$i}Hi(){return this.__}At(){return this.ho}S_(A){this.__=A,this.k_()}Lo(A){this.ho=A,this.f_.Lo(A),this.p_.Lo(A),this.po.forEach((e=>{if(this.vr(e)){const t=e.Dt();t!==null&&t.Lo(A)}})),this.k_()}Ba(){return this.po}vr(A){const e=A.Dt();return e===null||this.f_!==e&&this.p_!==e}qo(A,e,t){const i=t!==void 0?t:this.C_().y_+1;this.T_(A,e,i)}Zo(A){const e=this.po.indexOf(A);gt(e!==-1,"removeDataSource: invalid data source"),this.po.splice(e,1);const t=AA(A.Dt()).Pa();if(this.o_.has(t)){const s=be(this.o_.get(t)),n=s.indexOf(A);n!==-1&&(s.splice(n,1),s.length===0&&this.o_.delete(t))}const i=A.Dt();i&&i.Ba().indexOf(A)>=0&&i.Zo(A),i!==null&&(i.Yo(),this.P_(i)),this.mo=null}mr(A){return A===this.f_?"left":A===this.p_?"right":"overlay"}R_(){return this.f_}D_(){return this.p_}V_(A,e){A.Go(e)}O_(A,e){A.Jo(e),this.k_()}B_(A){A.Qo()}A_(A,e){A.t_(e)}I_(A,e){A.i_(e),this.k_()}z_(A){A.n_()}k_(){this.po.forEach((A=>{A.Vn()}))}vn(){let A=null;return this.$i.W().rightPriceScale.visible&&this.p_.Ba().length!==0?A=this.p_:this.$i.W().leftPriceScale.visible&&this.f_.Ba().length!==0?A=this.f_:this.po.length!==0&&(A=this.po[0].Dt()),A===null&&(A=this.p_),A}pr(){let A=null;return this.$i.W().rightPriceScale.visible?A=this.p_:this.$i.W().leftPriceScale.visible&&(A=this.f_),A}P_(A){A!==null&&A.Vo()&&this.L_(A)}E_(A){const e=this.yl.Xs();A.Ro({Wn:!0}),e!==null&&A.h_(e),this.k_()}N_(){this.L_(this.f_),this.L_(this.p_)}F_(){this.P_(this.f_),this.P_(this.p_),this.po.forEach((A=>{this.vr(A)&&this.P_(A.Dt())})),this.k_(),this.$i.Uh()}Uo(){return this.mo===null&&(this.mo=Ka(this.po)),this.mo}W_(){return this.c_}j_(){return this.d_}L_(A){const e=A.r_();if(e&&e.length>0&&!this.yl.Ni()){const t=this.yl.Xs();t!==null&&A.h_(t)}A.Vn()}C_(){const A=this.Uo();if(A.length===0)return{H_:0,y_:0};let e=0,t=0;for(let i=0;i<A.length;i++){const s=A[i].Xi();s!==null&&(s<e&&(e=s),s>t&&(t=s))}return{H_:e,y_:t}}T_(A,e,t){let i=this.w_(e);if(i===null&&(i=this.v_(e,this.$i.W().overlayPriceScales)),this.po.push(A),!li(e)){const s=this.o_.get(e)||[];s.push(A),this.o_.set(e,s)}i.qo(A),A.Gi(i),A.Ki(t),this.P_(i),this.mo=null}m_(A,e,t){e.Cr!==t.Cr&&this.L_(A)}v_(A,e){const t=Object.assign({visible:!0,autoScale:!0},ot(e)),i=new Sf(A,t,this.$i.W().layout,this.$i.W().localization);return i.Lo(this.At()),i}}class Lf{constructor(A,e,t=50){this.Ke=0,this.Ge=1,this.Je=1,this.tr=new Map,this.Qe=new Map,this.U_=A,this.q_=e,this.ir=t}Y_(A){const e=A.time,t=this.q_.cacheKey(e),i=this.tr.get(t);if(i!==void 0)return i.Z_;if(this.Ke===this.ir){const n=this.Qe.get(this.Je);this.Qe.delete(this.Je),this.tr.delete(be(n)),this.Je++,this.Ke--}const s=this.U_(A);return this.tr.set(t,{Z_:s,rr:this.Ge}),this.Qe.set(this.Ge,t),this.Ke++,this.Ge++,s}}class Qr{constructor(A,e){gt(A<=e,"right should be >= left"),this.X_=A,this.K_=e}Os(){return this.X_}ui(){return this.K_}G_(){return this.K_-this.X_+1}Kr(A){return this.X_<=A&&A<=this.K_}Ch(A){return this.X_===A.Os()&&this.K_===A.ui()}}function Ga(r,A){return r===null||A===null?r===A:r.Ch(A)}class If{constructor(){this.J_=new Map,this.tr=null,this.Q_=!1}tu(A){this.Q_=A,this.tr=null}iu(A,e){this.nu(e),this.tr=null;for(let t=e;t<A.length;++t){const i=A[t];let s=this.J_.get(i.timeWeight);s===void 0&&(s=[],this.J_.set(i.timeWeight,s)),s.push({index:t,time:i.time,weight:i.timeWeight,originalTime:i.originalTime})}}su(A,e){const t=Math.ceil(e/A);return this.tr!==null&&this.tr.eu===t||(this.tr={Ha:this.ru(t),eu:t}),this.tr.Ha}nu(A){if(A===0)return void this.J_.clear();const e=[];this.J_.forEach(((t,i)=>{A<=t[0].index?e.push(i):t.splice(gr(t,A,(s=>s.index<A)),1/0)}));for(const t of e)this.J_.delete(t)}ru(A){let e=[];for(const t of Array.from(this.J_.keys()).sort(((i,s)=>s-i))){if(!this.J_.get(t))continue;const i=e;e=[];const s=i.length;let n=0;const o=be(this.J_.get(t)),a=o.length;let l=1/0,c=-1/0;for(let u=0;u<a;u++){const d=o[u],B=d.index;for(;n<s;){const p=i[n],f=p.index;if(!(f<B)){l=f;break}n++,e.push(p),c=f,l=1/0}if(l-B>=A&&B-c>=A)e.push(d),c=B;else if(this.Q_)return i}for(;n<s;n++)e.push(i[n])}return e}}class Xt{constructor(A){this.hu=A}lu(){return this.hu===null?null:new Qr(Math.floor(this.hu.Os()),Math.ceil(this.hu.ui()))}au(){return this.hu}static ou(){return new Xt(null)}}function Mf(r,A){return r.weight>A.weight?r:A}class Df{constructor(A,e,t,i){this.__=0,this._u=null,this.uu=[],this.Mo=null,this.wo=null,this.cu=new If,this.du=new Map,this.fu=Xt.ou(),this.vu=!0,this.pu=new ee,this.mu=new ee,this.bu=new ee,this.wu=null,this.gu=null,this.Mu=[],this.cn=e,this.yo=t,this.xu=e.rightOffset,this.Su=e.barSpacing,this.$i=A,this.q_=i,this.ku(),this.cu.tu(e.uniformDistribution)}W(){return this.cn}yu(A){Ge(this.yo,A),this.Cu(),this.ku()}$h(A,e){var t;Ge(this.cn,A),this.cn.fixLeftEdge&&this.Tu(),this.cn.fixRightEdge&&this.Pu(),A.barSpacing!==void 0&&this.$i.Gn(A.barSpacing),A.rightOffset!==void 0&&this.$i.Jn(A.rightOffset),A.minBarSpacing!==void 0&&this.$i.Gn((t=A.barSpacing)!==null&&t!==void 0?t:this.Su),this.Cu(),this.ku(),this.bu.m()}mn(A){var e,t;return(t=(e=this.uu[A])===null||e===void 0?void 0:e.time)!==null&&t!==void 0?t:null}Ui(A){var e;return(e=this.uu[A])!==null&&e!==void 0?e:null}Va(A,e){if(this.uu.length<1)return null;if(this.q_.key(A)>this.q_.key(this.uu[this.uu.length-1].time))return e?this.uu.length-1:null;const t=gr(this.uu,this.q_.key(A),((i,s)=>this.q_.key(i.time)<s));return this.q_.key(A)<this.q_.key(this.uu[t].time)?e?t:null:t}Ni(){return this.__===0||this.uu.length===0||this._u===null}Da(){return this.uu.length>0}Xs(){return this.Ru(),this.fu.lu()}Du(){return this.Ru(),this.fu.au()}Vu(){const A=this.Xs();if(A===null)return null;const e={from:A.Os(),to:A.ui()};return this.Ou(e)}Ou(A){const e=Math.round(A.from),t=Math.round(A.to),i=AA(this.Bu()),s=AA(this.Au());return{from:AA(this.Ui(Math.max(i,e))),to:AA(this.Ui(Math.min(s,t)))}}Iu(A){return{from:AA(this.Va(A.from,!0)),to:AA(this.Va(A.to,!0))}}Hi(){return this.__}S_(A){if(!isFinite(A)||A<=0||this.__===A)return;const e=this.Du(),t=this.__;if(this.__=A,this.vu=!0,this.cn.lockVisibleTimeRangeOnResize&&t!==0){const i=this.Su*A/t;this.Su=i}if(this.cn.fixLeftEdge&&e!==null&&e.Os()<=0){const i=t-A;this.xu-=Math.round(i/this.Su)+1,this.vu=!0}this.zu(),this.Lu()}It(A){if(this.Ni()||!fr(A))return 0;const e=this.Eu()+this.xu-A;return this.__-(e+.5)*this.Su-1}Qs(A,e){const t=this.Eu(),i=e===void 0?0:e.from,s=e===void 0?A.length:e.to;for(let n=i;n<s;n++){const o=A[n].ot,a=t+this.xu-o,l=this.__-(a+.5)*this.Su-1;A[n].nt=l}}Nu(A){return Math.ceil(this.Fu(A))}Jn(A){this.vu=!0,this.xu=A,this.Lu(),this.$i.Wu(),this.$i.Uh()}le(){return this.Su}Gn(A){this.ju(A),this.Lu(),this.$i.Wu(),this.$i.Uh()}Hu(){return this.xu}Ha(){if(this.Ni())return null;if(this.gu!==null)return this.gu;const A=this.Su,e=5*(this.$i.W().layout.fontSize+4)/8*(this.cn.tickMarkMaxCharacterLength||8),t=Math.round(e/A),i=AA(this.Xs()),s=Math.max(i.Os(),i.Os()-t),n=Math.max(i.ui(),i.ui()-t),o=this.cu.su(A,e),a=this.Bu()+t,l=this.Au()-t,c=this.$u(),u=this.cn.fixLeftEdge||c,d=this.cn.fixRightEdge||c;let B=0;for(const p of o){if(!(s<=p.index&&p.index<=n))continue;let f;B<this.Mu.length?(f=this.Mu[B],f.coord=this.It(p.index),f.label=this.Uu(p),f.weight=p.weight):(f={needAlignCoordinate:!1,coord:this.It(p.index),label:this.Uu(p),weight:p.weight},this.Mu.push(f)),this.Su>e/2&&!c?f.needAlignCoordinate=!1:f.needAlignCoordinate=u&&p.index<=a||d&&p.index>=l,B++}return this.Mu.length=B,this.gu=this.Mu,this.Mu}qu(){this.vu=!0,this.Gn(this.cn.barSpacing),this.Jn(this.cn.rightOffset)}Yu(A){this.vu=!0,this._u=A,this.Lu(),this.Tu()}Zu(A,e){const t=this.Fu(A),i=this.le(),s=i+e*(i/10);this.Gn(s),this.cn.rightBarStaysOnScroll||this.Jn(this.Hu()+(t-this.Fu(A)))}Go(A){this.Mo&&this.n_(),this.wo===null&&this.wu===null&&(this.Ni()||(this.wo=A,this.Xu()))}Jo(A){if(this.wu===null)return;const e=Gs(this.__-A,0,this.__),t=Gs(this.__-AA(this.wo),0,this.__);e!==0&&t!==0&&this.Gn(this.wu.le*e/t)}Qo(){this.wo!==null&&(this.wo=null,this.Ku())}t_(A){this.Mo===null&&this.wu===null&&(this.Ni()||(this.Mo=A,this.Xu()))}i_(A){if(this.Mo===null)return;const e=(this.Mo-A)/this.le();this.xu=AA(this.wu).Hu+e,this.vu=!0,this.Lu()}n_(){this.Mo!==null&&(this.Mo=null,this.Ku())}Gu(){this.Ju(this.cn.rightOffset)}Ju(A,e=400){if(!isFinite(A))throw new RangeError("offset is required and must be finite number");if(!isFinite(e)||e<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const t=this.xu,i=performance.now();this.$i.Zn({Qu:s=>(s-i)/e>=1,tc:s=>{const n=(s-i)/e;return n>=1?A:t+(A-t)*n}})}bt(A,e){this.vu=!0,this.uu=A,this.cu.iu(A,e),this.Lu()}nc(){return this.pu}sc(){return this.mu}ec(){return this.bu}Eu(){return this._u||0}rc(A){const e=A.G_();this.ju(this.__/e),this.xu=A.ui()-this.Eu(),this.Lu(),this.vu=!0,this.$i.Wu(),this.$i.Uh()}hc(){const A=this.Bu(),e=this.Au();A!==null&&e!==null&&this.rc(new Qr(A,e+this.cn.rightOffset))}lc(A){const e=new Qr(A.from,A.to);this.rc(e)}qi(A){return this.yo.timeFormatter!==void 0?this.yo.timeFormatter(A.originalTime):this.q_.formatHorzItem(A.time)}$u(){const{handleScroll:A,handleScale:e}=this.$i.W();return!(A.horzTouchDrag||A.mouseWheel||A.pressedMouseMove||A.vertTouchDrag||e.axisDoubleClickReset.time||e.axisPressedMouseMove.time||e.mouseWheel||e.pinch)}Bu(){return this.uu.length===0?null:0}Au(){return this.uu.length===0?null:this.uu.length-1}ac(A){return(this.__-1-A)/this.Su}Fu(A){const e=this.ac(A),t=this.Eu()+this.xu-e;return Math.round(1e6*t)/1e6}ju(A){const e=this.Su;this.Su=A,this.zu(),e!==this.Su&&(this.vu=!0,this.oc())}Ru(){if(!this.vu)return;if(this.vu=!1,this.Ni())return void this._c(Xt.ou());const A=this.Eu(),e=this.__/this.Su,t=this.xu+A,i=new Qr(t-e+1,t);this._c(new Xt(i))}zu(){const A=this.uc();if(this.Su<A&&(this.Su=A,this.vu=!0),this.__!==0){const e=.5*this.__;this.Su>e&&(this.Su=e,this.vu=!0)}}uc(){return this.cn.fixLeftEdge&&this.cn.fixRightEdge&&this.uu.length!==0?this.__/this.uu.length:this.cn.minBarSpacing}Lu(){const A=this.cc();A!==null&&this.xu<A&&(this.xu=A,this.vu=!0);const e=this.dc();this.xu>e&&(this.xu=e,this.vu=!0)}cc(){const A=this.Bu(),e=this._u;return A===null||e===null?null:A-e-1+(this.cn.fixLeftEdge?this.__/this.Su:Math.min(2,this.uu.length))}dc(){return this.cn.fixRightEdge?0:this.__/this.Su-Math.min(2,this.uu.length)}Xu(){this.wu={le:this.le(),Hu:this.Hu()}}Ku(){this.wu=null}Uu(A){let e=this.du.get(A.weight);return e===void 0&&(e=new Lf((t=>this.fc(t)),this.q_),this.du.set(A.weight,e)),e.Y_(A)}fc(A){return this.q_.formatTickmark(A,this.yo)}_c(A){const e=this.fu;this.fu=A,Ga(e.lu(),this.fu.lu())||this.pu.m(),Ga(e.au(),this.fu.au())||this.mu.m(),this.oc()}oc(){this.gu=null}Cu(){this.oc(),this.du.clear()}ku(){this.q_.updateFormatter(this.yo)}Tu(){if(!this.cn.fixLeftEdge)return;const A=this.Bu();if(A===null)return;const e=this.Xs();if(e===null)return;const t=e.Os()-A;if(t<0){const i=this.xu-t-1;this.Jn(i)}this.zu()}Pu(){this.Lu(),this.zu()}}class _f{X(A,e,t){A.useMediaCoordinateSpace((i=>this.K(i,e,t)))}gl(A,e,t){A.useMediaCoordinateSpace((i=>this.vc(i,e,t)))}vc(A,e,t){}}class kf extends _f{constructor(A){super(),this.mc=new Map,this.zt=A}K(A){}vc(A){if(!this.zt.yt)return;const{context:e,mediaSize:t}=A;let i=0;for(const n of this.zt.bc){if(n.Kt.length===0)continue;e.font=n.R;const o=this.wc(e,n.Kt);o>t.width?n.Zu=t.width/o:n.Zu=1,i+=n.gc*n.Zu}let s=0;switch(this.zt.Mc){case"top":s=0;break;case"center":s=Math.max((t.height-i)/2,0);break;case"bottom":s=Math.max(t.height-i,0)}e.fillStyle=this.zt.V;for(const n of this.zt.bc){e.save();let o=0;switch(this.zt.xc){case"left":e.textAlign="left",o=n.gc/2;break;case"center":e.textAlign="center",o=t.width/2;break;case"right":e.textAlign="right",o=t.width-1-n.gc/2}e.translate(o,s),e.textBaseline="top",e.font=n.R,e.scale(n.Zu,n.Zu),e.fillText(n.Kt,0,n.Sc),e.restore(),s+=n.gc*n.Zu}}wc(A,e){const t=this.kc(A.font);let i=t.get(e);return i===void 0&&(i=A.measureText(e).width,t.set(e,i)),i}kc(A){let e=this.mc.get(A);return e===void 0&&(e=new Map,this.mc.set(A,e)),e}}class Of{constructor(A){this.ft=!0,this.Ft={yt:!1,V:"",bc:[],Mc:"center",xc:"center"},this.Wt=new kf(this.Ft),this.jt=A}bt(){this.ft=!0}gt(){return this.ft&&(this.Mt(),this.ft=!1),this.Wt}Mt(){const A=this.jt.W(),e=this.Ft;e.yt=A.visible,e.yt&&(e.V=A.color,e.xc=A.horzAlign,e.Mc=A.vertAlign,e.bc=[{Kt:A.text,R:Wt(A.fontSize,A.fontFamily,A.fontStyle),gc:1.2*A.fontSize,Sc:0,Zu:0}])}}class Nf extends Ps{constructor(A,e){super(),this.cn=e,this.wn=new Of(this)}Rn(){return[]}Pn(){return[this.wn]}W(){return this.cn}Vn(){this.wn.bt()}}var Ra,Wa,$a,Xa,Ja;(function(r){r[r.OnTouchEnd=0]="OnTouchEnd",r[r.OnNextTap=1]="OnNextTap"})(Ra||(Ra={}));class Kf{constructor(A,e,t){this.yc=[],this.Cc=[],this.__=0,this.Tc=null,this.Pc=new ee,this.Rc=new ee,this.Dc=null,this.Vc=A,this.cn=e,this.q_=t,this.Oc=new gd(this),this.yl=new Df(this,e.timeScale,this.cn.localization,t),this.vt=new xd(this,e.crosshair),this.Bc=new Qf(e.crosshair),this.Ac=new Nf(this,e.watermark),this.Ic(),this.yc[0].x_(2e3),this.zc=this.Lc(0),this.Ec=this.Lc(1)}Kl(){this.Nc(ue.es())}Uh(){this.Nc(ue.ss())}oa(){this.Nc(new ue(1))}Gl(A){const e=this.Fc(A);this.Nc(e)}Wc(){return this.Tc}jc(A){const e=this.Tc;this.Tc=A,e!==null&&this.Gl(e.Hc),A!==null&&this.Gl(A.Hc)}W(){return this.cn}$h(A){Ge(this.cn,A),this.yc.forEach((e=>e.b_(A))),A.timeScale!==void 0&&this.yl.$h(A.timeScale),A.localization!==void 0&&this.yl.yu(A.localization),(A.leftPriceScale||A.rightPriceScale)&&this.Pc.m(),this.zc=this.Lc(0),this.Ec=this.Lc(1),this.Kl()}$c(A,e){if(A==="left")return void this.$h({leftPriceScale:e});if(A==="right")return void this.$h({rightPriceScale:e});const t=this.Uc(A);t!==null&&(t.Dt.$h(e),this.Pc.m())}Uc(A){for(const e of this.yc){const t=e.w_(A);if(t!==null)return{Ht:e,Dt:t}}return null}St(){return this.yl}qc(){return this.yc}Yc(){return this.Ac}Zc(){return this.vt}Xc(){return this.Rc}Kc(A,e){A.Lo(e),this.Wu()}S_(A){this.__=A,this.yl.S_(this.__),this.yc.forEach((e=>e.S_(A))),this.Wu()}Ic(A){const e=new Hf(this.yl,this);A!==void 0?this.yc.splice(A,0,e):this.yc.push(e);const t=A===void 0?this.yc.length-1:A,i=ue.es();return i.Nn(t,{Fn:0,Wn:!0}),this.Nc(i),e}V_(A,e,t){A.V_(e,t)}O_(A,e,t){A.O_(e,t),this.Jl(),this.Nc(this.Gc(A,2))}B_(A,e){A.B_(e),this.Nc(this.Gc(A,2))}A_(A,e,t){e.Vo()||A.A_(e,t)}I_(A,e,t){e.Vo()||(A.I_(e,t),this.Jl(),this.Nc(this.Gc(A,2)))}z_(A,e){e.Vo()||(A.z_(e),this.Nc(this.Gc(A,2)))}E_(A,e){A.E_(e),this.Nc(this.Gc(A,2))}Jc(A){this.yl.Go(A)}Qc(A,e){const t=this.St();if(t.Ni()||e===0)return;const i=t.Hi();A=Math.max(1,Math.min(A,i)),t.Zu(A,e),this.Wu()}td(A){this.nd(0),this.sd(A),this.ed()}rd(A){this.yl.Jo(A),this.Wu()}hd(){this.yl.Qo(),this.Uh()}nd(A){this.yl.t_(A)}sd(A){this.yl.i_(A),this.Wu()}ed(){this.yl.n_(),this.Uh()}wt(){return this.Cc}ld(A,e,t,i,s){this.vt.gn(A,e);let n=NaN,o=this.yl.Nu(A);const a=this.yl.Xs();a!==null&&(o=Math.min(Math.max(a.Os(),o),a.ui()));const l=i.vn(),c=l.Ct();c!==null&&(n=l.pn(e,c)),n=this.Bc.Oa(n,o,i),this.vt.kn(o,n,i),this.oa(),s||this.Rc.m(this.vt.xt(),{x:A,y:e},t)}ad(A,e,t){const i=t.vn(),s=i.Ct(),n=i.Rt(A,AA(s)),o=this.yl.Va(e,!0),a=this.yl.It(AA(o));this.ld(a,n,null,t,!0)}od(A){this.Zc().Cn(),this.oa(),A||this.Rc.m(null,null,null)}Jl(){const A=this.vt.Ht();if(A!==null){const e=this.vt.xn(),t=this.vt.Sn();this.ld(e,t,null,A)}this.vt.Vn()}_d(A,e,t){const i=this.yl.mn(0);e!==void 0&&t!==void 0&&this.yl.bt(e,t);const s=this.yl.mn(0),n=this.yl.Eu(),o=this.yl.Xs();if(o!==null&&i!==null&&s!==null){const a=o.Kr(n),l=this.q_.key(i)>this.q_.key(s),c=A!==null&&A>n&&!l,u=this.yl.W().allowShiftVisibleRangeOnWhitespaceReplacement,d=a&&(t!==void 0||u)&&this.yl.W().shiftVisibleRangeOnNewBar;if(c&&!d){const B=A-n;this.yl.Jn(this.yl.Hu()-B)}}this.yl.Yu(A)}ia(A){A!==null&&A.F_()}dr(A){const e=this.yc.find((t=>t.Uo().includes(A)));return e===void 0?null:e}Wu(){this.Ac.Vn(),this.yc.forEach((A=>A.F_())),this.Jl()}S(){this.yc.forEach((A=>A.S())),this.yc.length=0,this.cn.localization.priceFormatter=void 0,this.cn.localization.percentageFormatter=void 0,this.cn.localization.timeFormatter=void 0}ud(){return this.Oc}br(){return this.Oc.W()}g_(){return this.Pc}dd(A,e,t){const i=this.yc[0],s=this.fd(e,A,i,t);return this.Cc.push(s),this.Cc.length===1?this.Kl():this.Uh(),s}vd(A){const e=this.dr(A),t=this.Cc.indexOf(A);gt(t!==-1,"Series not found"),this.Cc.splice(t,1),AA(e).Zo(A),A.S&&A.S()}Xl(A,e){const t=AA(this.dr(A));t.Zo(A);const i=this.Uc(e);if(i===null){const s=A.Xi();t.qo(A,e,s)}else{const s=i.Ht===t?A.Xi():void 0;i.Ht.qo(A,e,s)}}hc(){const A=ue.ss();A.$n(),this.Nc(A)}pd(A){const e=ue.ss();e.Yn(A),this.Nc(e)}Kn(){const A=ue.ss();A.Kn(),this.Nc(A)}Gn(A){const e=ue.ss();e.Gn(A),this.Nc(e)}Jn(A){const e=ue.ss();e.Jn(A),this.Nc(e)}Zn(A){const e=ue.ss();e.Zn(A),this.Nc(e)}Un(){const A=ue.ss();A.Un(),this.Nc(A)}md(){return this.cn.rightPriceScale.visible?"right":"left"}bd(){return this.Ec}q(){return this.zc}Bt(A){const e=this.Ec,t=this.zc;if(e===t)return e;if(A=Math.max(0,Math.min(100,Math.round(100*A))),this.Dc===null||this.Dc.Ps!==t||this.Dc.Rs!==e)this.Dc={Ps:t,Rs:e,wd:new Map};else{const s=this.Dc.wd.get(A);if(s!==void 0)return s}const i=(function(s,n,o){const[a,l,c,u]=dr(s),[d,B,p,f]=dr(n),g=[_e(a+o*(d-a)),_e(l+o*(B-l)),_e(c+o*(p-c)),oa(u+o*(f-u))];return`rgba(${g[0]}, ${g[1]}, ${g[2]}, ${g[3]})`})(t,e,A/100);return this.Dc.wd.set(A,i),i}Gc(A,e){const t=new ue(e);if(A!==null){const i=this.yc.indexOf(A);t.Nn(i,{Fn:e})}return t}Fc(A,e){return e===void 0&&(e=2),this.Gc(this.dr(A),e)}Nc(A){this.Vc&&this.Vc(A),this.yc.forEach((e=>e.j_().qh().bt()))}fd(A,e,t,i){const s=new qs(this,A,e,t,i),n=A.priceScaleId!==void 0?A.priceScaleId:this.md();return t.qo(s,n),li(n)||s.$h(A),s}Lc(A){const e=this.cn.layout;return e.background.type==="gradient"?A===0?e.background.topColor:e.background.bottomColor:e.background.color}}function tn(r){return!Ze(r)&&!pr(r)}function Za(r){return Ze(r)}(function(r){r[r.Disabled=0]="Disabled",r[r.Continuous=1]="Continuous",r[r.OnDataUpdate=2]="OnDataUpdate"})(Wa||(Wa={})),(function(r){r[r.LastBar=0]="LastBar",r[r.LastVisible=1]="LastVisible"})($a||($a={})),(function(r){r.Solid="solid",r.VerticalGradient="gradient"})(Xa||(Xa={})),(function(r){r[r.Year=0]="Year",r[r.Month=1]="Month",r[r.DayOfMonth=2]="DayOfMonth",r[r.Time=3]="Time",r[r.TimeWithSeconds=4]="TimeWithSeconds"})(Ja||(Ja={}));const Ya=r=>r.getUTCFullYear();function Vf(r,A,e){return A.replace(/yyyy/g,(t=>at(Ya(t),4))(r)).replace(/yy/g,(t=>at(Ya(t)%100,2))(r)).replace(/MMMM/g,((t,i)=>new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"long"}))(r,e)).replace(/MMM/g,((t,i)=>new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"short"}))(r,e)).replace(/MM/g,(t=>at((i=>i.getUTCMonth()+1)(t),2))(r)).replace(/dd/g,(t=>at((i=>i.getUTCDate())(t),2))(r))}class qa{constructor(A="yyyy-MM-dd",e="default"){this.gd=A,this.Md=e}Y_(A){return Vf(A,this.gd,this.Md)}}class Pf{constructor(A){this.xd=A||"%h:%m:%s"}Y_(A){return this.xd.replace("%h",at(A.getUTCHours(),2)).replace("%m",at(A.getUTCMinutes(),2)).replace("%s",at(A.getUTCSeconds(),2))}}const zf={Sd:"yyyy-MM-dd",kd:"%h:%m:%s",yd:" ",Cd:"default"};class Gf{constructor(A={}){const e=Object.assign(Object.assign({},zf),A);this.Td=new qa(e.Sd,e.Cd),this.Pd=new Pf(e.kd),this.Rd=e.yd}Y_(A){return`${this.Td.Y_(A)}${this.Rd}${this.Pd.Y_(A)}`}}function gi(r){return 60*r*60*1e3}function rn(r){return 60*r*1e3}const wi=[{Dd:(ja=1,1e3*ja),Vd:10},{Dd:rn(1),Vd:20},{Dd:rn(5),Vd:21},{Dd:rn(30),Vd:22},{Dd:gi(1),Vd:30},{Dd:gi(3),Vd:31},{Dd:gi(6),Vd:32},{Dd:gi(12),Vd:33}];var ja;function Al(r,A){if(r.getUTCFullYear()!==A.getUTCFullYear())return 70;if(r.getUTCMonth()!==A.getUTCMonth())return 60;if(r.getUTCDate()!==A.getUTCDate())return 50;for(let e=wi.length-1;e>=0;--e)if(Math.floor(A.getTime()/wi[e].Dd)!==Math.floor(r.getTime()/wi[e].Dd))return wi[e].Vd;return 0}function sn(r){let A=r;if(pr(r)&&(A=nn(r)),!tn(A))throw new Error("time must be of type BusinessDay");const e=new Date(Date.UTC(A.year,A.month-1,A.day,0,0,0,0));return{Od:Math.round(e.getTime()/1e3),Bd:A}}function el(r){if(!Za(r))throw new Error("time must be of type isUTCTimestamp");return{Od:r}}function nn(r){const A=new Date(r);if(isNaN(A.getTime()))throw new Error(`Invalid date string=${r}, expected format=yyyy-mm-dd`);return{day:A.getUTCDate(),month:A.getUTCMonth()+1,year:A.getUTCFullYear()}}function tl(r){pr(r.time)&&(r.time=nn(r.time))}class rl{options(){return this.cn}setOptions(A){this.cn=A,this.updateFormatter(A.localization)}preprocessData(A){Array.isArray(A)?(function(e){e.forEach(tl)})(A):tl(A)}createConverterToInternalObj(A){return AA((function(e){return e.length===0?null:tn(e[0].time)||pr(e[0].time)?sn:el})(A))}key(A){return typeof A=="object"&&"Od"in A?A.Od:this.key(this.convertHorzItemToInternal(A))}cacheKey(A){const e=A;return e.Bd===void 0?new Date(1e3*e.Od).getTime():new Date(Date.UTC(e.Bd.year,e.Bd.month-1,e.Bd.day)).getTime()}convertHorzItemToInternal(A){return Za(e=A)?el(e):tn(e)?sn(e):sn(nn(e));var e}updateFormatter(A){if(!this.cn)return;const e=A.dateFormat;this.cn.timeScale.timeVisible?this.Ad=new Gf({Sd:e,kd:this.cn.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",yd:" ",Cd:A.locale}):this.Ad=new qa(e,A.locale)}formatHorzItem(A){const e=A;return this.Ad.Y_(new Date(1e3*e.Od))}formatTickmark(A,e){const t=(function(s,n,o){switch(s){case 0:case 10:return n?o?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return n?3:2;case 50:return 2;case 60:return 1;case 70:return 0}})(A.weight,this.cn.timeScale.timeVisible,this.cn.timeScale.secondsVisible),i=this.cn.timeScale;if(i.tickMarkFormatter!==void 0){const s=i.tickMarkFormatter(A.originalTime,t,e.locale);if(s!==null)return s}return(function(s,n,o){const a={};switch(n){case 0:a.year="numeric";break;case 1:a.month="short";break;case 2:a.day="numeric";break;case 3:a.hour12=!1,a.hour="2-digit",a.minute="2-digit";break;case 4:a.hour12=!1,a.hour="2-digit",a.minute="2-digit",a.second="2-digit"}const l=s.Bd===void 0?new Date(1e3*s.Od):new Date(Date.UTC(s.Bd.year,s.Bd.month-1,s.Bd.day));return new Date(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()).toLocaleString(o,a)})(A.time,t,e.locale)}maxTickMarkWeight(A){let e=A.reduce(Mf,A[0]).weight;return e>30&&e<50&&(e=30),e}fillWeightsForPoints(A,e){(function(t,i=0){if(t.length===0)return;let s=i===0?null:t[i-1].time.Od,n=s!==null?new Date(1e3*s):null,o=0;for(let a=i;a<t.length;++a){const l=t[a],c=new Date(1e3*l.time.Od);n!==null&&(l.timeWeight=Al(c,n)),o+=l.time.Od-(s||l.time.Od),s=l.time.Od,n=c}if(i===0&&t.length>1){const a=Math.ceil(o/(t.length-1)),l=new Date(1e3*(t[0].time.Od-a));t[0].timeWeight=Al(new Date(1e3*t[0].time.Od),l)}})(A,e)}static Id(A){return Ge({localization:{dateFormat:"dd MMM 'yy"}},A??{})}}const Jt=typeof window<"u";function il(){return!!Jt&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function on(){return!!Jt&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function an(r){return r+r%2}function ln(r,A){return r.zd-A.zd}function cn(r,A,e){const t=(r.zd-A.zd)/(r.ot-A.ot);return Math.sign(t)*Math.min(Math.abs(t),e)}class Rf{constructor(A,e,t,i){this.Ld=null,this.Ed=null,this.Nd=null,this.Fd=null,this.Wd=null,this.jd=0,this.Hd=0,this.$d=A,this.Ud=e,this.qd=t,this.rs=i}Yd(A,e){if(this.Ld!==null){if(this.Ld.ot===e)return void(this.Ld.zd=A);if(Math.abs(this.Ld.zd-A)<this.rs)return}this.Fd=this.Nd,this.Nd=this.Ed,this.Ed=this.Ld,this.Ld={ot:e,zd:A}}Vr(A,e){if(this.Ld===null||this.Ed===null||e-this.Ld.ot>50)return;let t=0;const i=cn(this.Ld,this.Ed,this.Ud),s=ln(this.Ld,this.Ed),n=[i],o=[s];if(t+=s,this.Nd!==null){const l=cn(this.Ed,this.Nd,this.Ud);if(Math.sign(l)===Math.sign(i)){const c=ln(this.Ed,this.Nd);if(n.push(l),o.push(c),t+=c,this.Fd!==null){const u=cn(this.Nd,this.Fd,this.Ud);if(Math.sign(u)===Math.sign(i)){const d=ln(this.Nd,this.Fd);n.push(u),o.push(d),t+=d}}}}let a=0;for(let l=0;l<n.length;++l)a+=o[l]/t*n[l];Math.abs(a)<this.$d||(this.Wd={zd:A,ot:e},this.Hd=a,this.jd=(function(l,c){const u=Math.log(c);return Math.log(1*u/-l)/u})(Math.abs(a),this.qd))}tc(A){const e=AA(this.Wd),t=A-e.ot;return e.zd+this.Hd*(Math.pow(this.qd,t)-1)/Math.log(this.qd)}Qu(A){return this.Wd===null||this.Zd(A)===this.jd}Zd(A){const e=A-AA(this.Wd).ot;return Math.min(e,this.jd)}}class Wf{constructor(A,e){this.Xd=void 0,this.Kd=void 0,this.Gd=void 0,this.en=!1,this.Jd=A,this.Qd=e,this.tf()}bt(){this.tf()}if(){this.Xd&&this.Jd.removeChild(this.Xd),this.Kd&&this.Jd.removeChild(this.Kd),this.Xd=void 0,this.Kd=void 0}nf(){return this.en!==this.sf()||this.Gd!==this.ef()}ef(){return aa(dr(this.Qd.W().layout.textColor))>160?"dark":"light"}sf(){return this.Qd.W().layout.attributionLogo}rf(){const A=new URL(location.href);return A.hostname?"&utm_source="+A.hostname+A.pathname:""}tf(){this.nf()&&(this.if(),this.en=this.sf(),this.en&&(this.Gd=this.ef(),this.Kd=document.createElement("style"),this.Kd.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.Xd=document.createElement("a"),this.Xd.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.rf()}`,this.Xd.title="Charting by TradingView",this.Xd.id="tv-attr-logo",this.Xd.target="_blank",this.Xd.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35 19" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.Xd.toggleAttribute("data-dark",this.Gd==="dark"),this.Jd.appendChild(this.Kd),this.Jd.appendChild(this.Xd)))}}function Lt(r,A){const e=AA(r.ownerDocument).createElement("canvas");r.appendChild(e);const t=td(e,{options:{allowResizeObserver:!1},transform:(i,s)=>({width:Math.max(i.width,s.width),height:Math.max(i.height,s.height)})});return t.resizeCanvasElement(A),t}function It(r){var A;r.width=1,r.height=1,(A=r.getContext("2d"))===null||A===void 0||A.clearRect(0,0,1,1)}function hn(r,A,e,t){r.gl&&r.gl(A,e,t)}function mi(r,A,e,t){r.X(A,e,t)}function un(r,A,e,t){const i=r(e,t);for(const s of i){const n=s.gt();n!==null&&A(n)}}function $f(r){Jt&&window.chrome!==void 0&&r.addEventListener("mousedown",(A=>{if(A.button===1)return A.preventDefault(),!1}))}class dn{constructor(A,e,t){this.hf=0,this.lf=null,this.af={nt:Number.NEGATIVE_INFINITY,st:Number.POSITIVE_INFINITY},this._f=0,this.uf=null,this.cf={nt:Number.NEGATIVE_INFINITY,st:Number.POSITIVE_INFINITY},this.df=null,this.ff=!1,this.vf=null,this.pf=null,this.mf=!1,this.bf=!1,this.wf=!1,this.gf=null,this.Mf=null,this.xf=null,this.Sf=null,this.kf=null,this.yf=null,this.Cf=null,this.Tf=0,this.Pf=!1,this.Rf=!1,this.Df=!1,this.Vf=0,this.Of=null,this.Bf=!on(),this.Af=i=>{this.If(i)},this.zf=i=>{if(this.Lf(i)){const s=this.Ef(i);if(++this._f,this.uf&&this._f>1){const{Nf:n}=this.Ff(Ye(i),this.cf);n<30&&!this.wf&&this.Wf(s,this.Hf.jf),this.$f()}}else{const s=this.Ef(i);if(++this.hf,this.lf&&this.hf>1){const{Nf:n}=this.Ff(Ye(i),this.af);n<5&&!this.bf&&this.Uf(s,this.Hf.qf),this.Yf()}}},this.Zf=A,this.Hf=e,this.cn=t,this.Xf()}S(){this.gf!==null&&(this.gf(),this.gf=null),this.Mf!==null&&(this.Mf(),this.Mf=null),this.Sf!==null&&(this.Sf(),this.Sf=null),this.kf!==null&&(this.kf(),this.kf=null),this.yf!==null&&(this.yf(),this.yf=null),this.xf!==null&&(this.xf(),this.xf=null),this.Kf(),this.Yf()}Gf(A){this.Sf&&this.Sf();const e=this.Jf.bind(this);if(this.Sf=()=>{this.Zf.removeEventListener("mousemove",e)},this.Zf.addEventListener("mousemove",e),this.Lf(A))return;const t=this.Ef(A);this.Uf(t,this.Hf.Qf),this.Bf=!0}Yf(){this.lf!==null&&clearTimeout(this.lf),this.hf=0,this.lf=null,this.af={nt:Number.NEGATIVE_INFINITY,st:Number.POSITIVE_INFINITY}}$f(){this.uf!==null&&clearTimeout(this.uf),this._f=0,this.uf=null,this.cf={nt:Number.NEGATIVE_INFINITY,st:Number.POSITIVE_INFINITY}}Jf(A){if(this.Df||this.pf!==null||this.Lf(A))return;const e=this.Ef(A);this.Uf(e,this.Hf.tv),this.Bf=!0}iv(A){const e=fn(A.changedTouches,AA(this.Of));if(e===null||(this.Vf=Ci(A),this.Cf!==null)||this.Rf)return;this.Pf=!0;const t=this.Ff(Ye(e),AA(this.pf)),{nv:i,sv:s,Nf:n}=t;if(this.mf||!(n<5)){if(!this.mf){const o=.5*i,a=s>=o&&!this.cn.ev(),l=o>s&&!this.cn.rv();a||l||(this.Rf=!0),this.mf=!0,this.wf=!0,this.Kf(),this.$f()}if(!this.Rf){const o=this.Ef(A,e);this.Wf(o,this.Hf.hv),Zt(A)}}}lv(A){if(A.button!==0)return;const e=this.Ff(Ye(A),AA(this.vf)),{Nf:t}=e;if(t>=5&&(this.bf=!0,this.Yf()),this.bf){const i=this.Ef(A);this.Uf(i,this.Hf.av)}}Ff(A,e){const t=Math.abs(e.nt-A.nt),i=Math.abs(e.st-A.st);return{nv:t,sv:i,Nf:t+i}}ov(A){let e=fn(A.changedTouches,AA(this.Of));if(e===null&&A.touches.length===0&&(e=A.changedTouches[0]),e===null)return;this.Of=null,this.Vf=Ci(A),this.Kf(),this.pf=null,this.yf&&(this.yf(),this.yf=null);const t=this.Ef(A,e);if(this.Wf(t,this.Hf._v),++this._f,this.uf&&this._f>1){const{Nf:i}=this.Ff(Ye(e),this.cf);i<30&&!this.wf&&this.Wf(t,this.Hf.jf),this.$f()}else this.wf||(this.Wf(t,this.Hf.uv),this.Hf.uv&&Zt(A));this._f===0&&Zt(A),A.touches.length===0&&this.ff&&(this.ff=!1,Zt(A))}If(A){if(A.button!==0)return;const e=this.Ef(A);if(this.vf=null,this.Df=!1,this.kf&&(this.kf(),this.kf=null),il()&&this.Zf.ownerDocument.documentElement.removeEventListener("mouseleave",this.Af),!this.Lf(A))if(this.Uf(e,this.Hf.cv),++this.hf,this.lf&&this.hf>1){const{Nf:t}=this.Ff(Ye(A),this.af);t<5&&!this.bf&&this.Uf(e,this.Hf.qf),this.Yf()}else this.bf||this.Uf(e,this.Hf.dv)}Kf(){this.df!==null&&(clearTimeout(this.df),this.df=null)}fv(A){if(this.Of!==null)return;const e=A.changedTouches[0];this.Of=e.identifier,this.Vf=Ci(A);const t=this.Zf.ownerDocument.documentElement;this.wf=!1,this.mf=!1,this.Rf=!1,this.pf=Ye(e),this.yf&&(this.yf(),this.yf=null);{const s=this.iv.bind(this),n=this.ov.bind(this);this.yf=()=>{t.removeEventListener("touchmove",s),t.removeEventListener("touchend",n)},t.addEventListener("touchmove",s,{passive:!1}),t.addEventListener("touchend",n,{passive:!1}),this.Kf(),this.df=setTimeout(this.vv.bind(this,A),240)}const i=this.Ef(A,e);this.Wf(i,this.Hf.pv),this.uf||(this._f=0,this.uf=setTimeout(this.$f.bind(this),500),this.cf=Ye(e))}mv(A){if(A.button!==0)return;const e=this.Zf.ownerDocument.documentElement;il()&&e.addEventListener("mouseleave",this.Af),this.bf=!1,this.vf=Ye(A),this.kf&&(this.kf(),this.kf=null);{const i=this.lv.bind(this),s=this.If.bind(this);this.kf=()=>{e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",s)},e.addEventListener("mousemove",i),e.addEventListener("mouseup",s)}if(this.Df=!0,this.Lf(A))return;const t=this.Ef(A);this.Uf(t,this.Hf.bv),this.lf||(this.hf=0,this.lf=setTimeout(this.Yf.bind(this),500),this.af=Ye(A))}Xf(){this.Zf.addEventListener("mouseenter",this.Gf.bind(this)),this.Zf.addEventListener("touchcancel",this.Kf.bind(this));{const A=this.Zf.ownerDocument,e=t=>{this.Hf.wv&&(t.composed&&this.Zf.contains(t.composedPath()[0])||t.target&&this.Zf.contains(t.target)||this.Hf.wv())};this.Mf=()=>{A.removeEventListener("touchstart",e)},this.gf=()=>{A.removeEventListener("mousedown",e)},A.addEventListener("mousedown",e),A.addEventListener("touchstart",e,{passive:!0})}on()&&(this.xf=()=>{this.Zf.removeEventListener("dblclick",this.zf)},this.Zf.addEventListener("dblclick",this.zf)),this.Zf.addEventListener("mouseleave",this.gv.bind(this)),this.Zf.addEventListener("touchstart",this.fv.bind(this),{passive:!0}),$f(this.Zf),this.Zf.addEventListener("mousedown",this.mv.bind(this)),this.Mv(),this.Zf.addEventListener("touchmove",(()=>{}),{passive:!1})}Mv(){this.Hf.xv===void 0&&this.Hf.Sv===void 0&&this.Hf.kv===void 0||(this.Zf.addEventListener("touchstart",(A=>this.yv(A.touches)),{passive:!0}),this.Zf.addEventListener("touchmove",(A=>{if(A.touches.length===2&&this.Cf!==null&&this.Hf.Sv!==void 0){const e=sl(A.touches[0],A.touches[1])/this.Tf;this.Hf.Sv(this.Cf,e),Zt(A)}}),{passive:!1}),this.Zf.addEventListener("touchend",(A=>{this.yv(A.touches)})))}yv(A){A.length===1&&(this.Pf=!1),A.length!==2||this.Pf||this.ff?this.Cv():this.Tv(A)}Tv(A){const e=this.Zf.getBoundingClientRect()||{left:0,top:0};this.Cf={nt:(A[0].clientX-e.left+(A[1].clientX-e.left))/2,st:(A[0].clientY-e.top+(A[1].clientY-e.top))/2},this.Tf=sl(A[0],A[1]),this.Hf.xv!==void 0&&this.Hf.xv(),this.Kf()}Cv(){this.Cf!==null&&(this.Cf=null,this.Hf.kv!==void 0&&this.Hf.kv())}gv(A){if(this.Sf&&this.Sf(),this.Lf(A)||!this.Bf)return;const e=this.Ef(A);this.Uf(e,this.Hf.Pv),this.Bf=!on()}vv(A){const e=fn(A.touches,AA(this.Of));if(e===null)return;const t=this.Ef(A,e);this.Wf(t,this.Hf.Rv),this.wf=!0,this.ff=!0}Lf(A){return A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents!==void 0?A.sourceCapabilities.firesTouchEvents:Ci(A)<this.Vf+500}Wf(A,e){e&&e.call(this.Hf,A)}Uf(A,e){e&&e.call(this.Hf,A)}Ef(A,e){const t=e||A,i=this.Zf.getBoundingClientRect()||{left:0,top:0};return{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY,localX:t.clientX-i.left,localY:t.clientY-i.top,ctrlKey:A.ctrlKey,altKey:A.altKey,shiftKey:A.shiftKey,metaKey:A.metaKey,Dv:!A.type.startsWith("mouse")&&A.type!=="contextmenu"&&A.type!=="click",Vv:A.type,Ov:t.target,Bv:A.view,Av:()=>{A.type!=="touchstart"&&Zt(A)}}}}function sl(r,A){const e=r.clientX-A.clientX,t=r.clientY-A.clientY;return Math.sqrt(e*e+t*t)}function Zt(r){r.cancelable&&r.preventDefault()}function Ye(r){return{nt:r.pageX,st:r.pageY}}function Ci(r){return r.timeStamp||performance.now()}function fn(r,A){for(let e=0;e<r.length;++e)if(r[e].identifier===A)return r[e];return null}function vi(r){return{Hc:r.Hc,Iv:{gr:r.zv.externalId},Lv:r.zv.cursorStyle}}function Xf(r,A,e){for(const t of r){const i=t.gt();if(i!==null&&i.wr){const s=i.wr(A,e);if(s!==null)return{Bv:t,Iv:s}}}return null}function pn(r,A){return e=>{var t,i,s,n;return((i=(t=e.Dt())===null||t===void 0?void 0:t.Pa())!==null&&i!==void 0?i:"")!==A?[]:(n=(s=e.da)===null||s===void 0?void 0:s.call(e,r))!==null&&n!==void 0?n:[]}}function nl(r,A,e,t){if(!r.length)return;let i=0;const s=e/2,n=r[0].At(t,!0);let o=A===1?s-(r[0].Vi()-n/2):r[0].Vi()-n/2-s;o=Math.max(0,o);for(let a=1;a<r.length;a++){const l=r[a],c=r[a-1],u=c.At(t,!1),d=l.Vi(),B=c.Vi();if(A===1?d>B-u:d<B+u){const p=B-u*A;l.Oi(p);const f=p-A*u/2;if((A===1?f<0:f>e)&&o>0){const g=A===1?-1-f:f-e,Q=Math.min(g,o);for(let m=i;m<r.length;m++)r[m].Oi(r[m].Vi()+A*Q);o-=Q}}else i=a,o=A===1?B-u-d:d-(B+u)}}class ol{constructor(A,e,t,i){this.Li=null,this.Ev=null,this.Nv=!1,this.Fv=new wr(200),this.Qr=null,this.Wv=0,this.jv=!1,this.Hv=()=>{this.jv||this.tn.$v().$t().Uh()},this.Uv=()=>{this.jv||this.tn.$v().$t().Uh()},this.tn=A,this.cn=e,this.ko=e.layout,this.Oc=t,this.qv=i==="left",this.Yv=pn("normal",i),this.Zv=pn("top",i),this.Xv=pn("bottom",i),this.Kv=document.createElement("div"),this.Kv.style.height="100%",this.Kv.style.overflow="hidden",this.Kv.style.width="25px",this.Kv.style.left="0",this.Kv.style.position="relative",this.Gv=Lt(this.Kv,$A({width:16,height:16})),this.Gv.subscribeSuggestedBitmapSizeChanged(this.Hv);const s=this.Gv.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.Jv=Lt(this.Kv,$A({width:16,height:16})),this.Jv.subscribeSuggestedBitmapSizeChanged(this.Uv);const n=this.Jv.canvasElement;n.style.position="absolute",n.style.zIndex="2",n.style.left="0",n.style.top="0";const o={bv:this.Qv.bind(this),pv:this.Qv.bind(this),av:this.tp.bind(this),hv:this.tp.bind(this),wv:this.ip.bind(this),cv:this.np.bind(this),_v:this.np.bind(this),qf:this.sp.bind(this),jf:this.sp.bind(this),Qf:this.ep.bind(this),Pv:this.rp.bind(this)};this.hp=new dn(this.Jv.canvasElement,o,{ev:()=>!this.cn.handleScroll.vertTouchDrag,rv:()=>!0})}S(){this.hp.S(),this.Jv.unsubscribeSuggestedBitmapSizeChanged(this.Uv),It(this.Jv.canvasElement),this.Jv.dispose(),this.Gv.unsubscribeSuggestedBitmapSizeChanged(this.Hv),It(this.Gv.canvasElement),this.Gv.dispose(),this.Li!==null&&this.Li.Ko().p(this),this.Li=null}lp(){return this.Kv}P(){return this.ko.fontSize}ap(){const A=this.Oc.W();return this.Qr!==A.R&&(this.Fv.nr(),this.Qr=A.R),A}op(){if(this.Li===null)return 0;let A=0;const e=this.ap(),t=AA(this.Gv.canvasElement.getContext("2d"));t.save();const i=this.Li.Ha();t.font=this._p(),i.length>0&&(A=Math.max(this.Fv.xi(t,i[0].so),this.Fv.xi(t,i[i.length-1].so)));const s=this.up();for(let l=s.length;l--;){const c=this.Fv.xi(t,s[l].Kt());c>A&&(A=c)}const n=this.Li.Ct();if(n!==null&&this.Ev!==null&&(o=this.cn.crosshair).mode!==2&&o.horzLine.visible&&o.horzLine.labelVisible){const l=this.Li.pn(1,n),c=this.Li.pn(this.Ev.height-2,n);A=Math.max(A,this.Fv.xi(t,this.Li.Fi(Math.floor(Math.min(l,c))+.11111111111111,n)),this.Fv.xi(t,this.Li.Fi(Math.ceil(Math.max(l,c))-.11111111111111,n)))}var o;t.restore();const a=A||34;return an(Math.ceil(e.C+e.T+e.A+e.I+5+a))}cp(A){this.Ev!==null&&Tt(this.Ev,A)||(this.Ev=A,this.jv=!0,this.Gv.resizeCanvasElement(A),this.Jv.resizeCanvasElement(A),this.jv=!1,this.Kv.style.width=`${A.width}px`,this.Kv.style.height=`${A.height}px`)}dp(){return AA(this.Ev).width}Gi(A){this.Li!==A&&(this.Li!==null&&this.Li.Ko().p(this),this.Li=A,A.Ko().l(this.fo.bind(this),this))}Dt(){return this.Li}nr(){const A=this.tn.fp();this.tn.$v().$t().E_(A,AA(this.Dt()))}vp(A){if(this.Ev===null)return;if(A!==1){this.pp(),this.Gv.applySuggestedBitmapSize();const t=St(this.Gv);t!==null&&(t.useBitmapCoordinateSpace((i=>{this.mp(i),this.Ie(i)})),this.tn.bp(t,this.Xv),this.wp(t),this.tn.bp(t,this.Yv),this.gp(t))}this.Jv.applySuggestedBitmapSize();const e=St(this.Jv);e!==null&&(e.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.Mp(e),this.tn.bp(e,this.Zv))}xp(){return this.Gv.bitmapSize}Sp(A,e,t){const i=this.xp();i.width>0&&i.height>0&&A.drawImage(this.Gv.canvasElement,e,t)}bt(){var A;(A=this.Li)===null||A===void 0||A.Ha()}Qv(A){if(this.Li===null||this.Li.Ni()||!this.cn.handleScale.axisPressedMouseMove.price)return;const e=this.tn.$v().$t(),t=this.tn.fp();this.Nv=!0,e.V_(t,this.Li,A.localY)}tp(A){if(this.Li===null||!this.cn.handleScale.axisPressedMouseMove.price)return;const e=this.tn.$v().$t(),t=this.tn.fp(),i=this.Li;e.O_(t,i,A.localY)}ip(){if(this.Li===null||!this.cn.handleScale.axisPressedMouseMove.price)return;const A=this.tn.$v().$t(),e=this.tn.fp(),t=this.Li;this.Nv&&(this.Nv=!1,A.B_(e,t))}np(A){if(this.Li===null||!this.cn.handleScale.axisPressedMouseMove.price)return;const e=this.tn.$v().$t(),t=this.tn.fp();this.Nv=!1,e.B_(t,this.Li)}sp(A){this.cn.handleScale.axisDoubleClickReset.price&&this.nr()}ep(A){this.Li!==null&&(!this.tn.$v().$t().W().handleScale.axisPressedMouseMove.price||this.Li.Mh()||this.Li.Oo()||this.kp(1))}rp(A){this.kp(0)}up(){const A=[],e=this.Li===null?void 0:this.Li;return(t=>{for(let i=0;i<t.length;++i){const s=t[i].Rn(this.tn.fp(),e);for(let n=0;n<s.length;n++)A.push(s[n])}})(this.tn.fp().Uo()),A}mp({context:A,bitmapSize:e}){const{width:t,height:i}=e,s=this.tn.fp().$t(),n=s.q(),o=s.bd();n===o?oi(A,0,0,t,i,n):ha(A,0,0,t,i,n,o)}Ie({context:A,bitmapSize:e,horizontalPixelRatio:t}){if(this.Ev===null||this.Li===null||!this.Li.W().borderVisible)return;A.fillStyle=this.Li.W().borderColor;const i=Math.max(1,Math.floor(this.ap().C*t));let s;s=this.qv?e.width-i:0,A.fillRect(s,0,i,e.height)}wp(A){if(this.Ev===null||this.Li===null)return;const e=this.Li.Ha(),t=this.Li.W(),i=this.ap(),s=this.qv?this.Ev.width-i.T:0;t.borderVisible&&t.ticksVisible&&A.useBitmapCoordinateSpace((({context:n,horizontalPixelRatio:o,verticalPixelRatio:a})=>{n.fillStyle=t.borderColor;const l=Math.max(1,Math.floor(a)),c=Math.floor(.5*a),u=Math.round(i.T*o);n.beginPath();for(const d of e)n.rect(Math.floor(s*o),Math.round(d.Ea*a)-c,u,l);n.fill()})),A.useMediaCoordinateSpace((({context:n})=>{var o;n.font=this._p(),n.fillStyle=(o=t.textColor)!==null&&o!==void 0?o:this.ko.textColor,n.textAlign=this.qv?"right":"left",n.textBaseline="middle";const a=this.qv?Math.round(s-i.A):Math.round(s+i.T+i.A),l=e.map((c=>this.Fv.Mi(n,c.so)));for(let c=e.length;c--;){const u=e[c];n.fillText(u.so,a,u.Ea+l[c])}}))}pp(){if(this.Ev===null||this.Li===null)return;const A=[],e=this.Li.Uo().slice(),t=this.tn.fp(),i=this.ap();this.Li===t.pr()&&this.tn.fp().Uo().forEach((n=>{t.vr(n)&&e.push(n)}));const s=this.Li;e.forEach((n=>{n.Rn(t,s).forEach((o=>{o.Oi(null),o.Bi()&&A.push(o)}))})),A.forEach((n=>n.Oi(n.ki()))),this.Li.W().alignLabels&&this.yp(A,i)}yp(A,e){if(this.Ev===null)return;const t=this.Ev.height/2,i=A.filter((n=>n.ki()<=t)),s=A.filter((n=>n.ki()>t));i.sort(((n,o)=>o.ki()-n.ki())),s.sort(((n,o)=>n.ki()-o.ki()));for(const n of A){const o=Math.floor(n.At(e)/2),a=n.ki();a>-o&&a<o&&n.Oi(o),a>this.Ev.height-o&&a<this.Ev.height+o&&n.Oi(this.Ev.height-o)}nl(i,1,this.Ev.height,e),nl(s,-1,this.Ev.height,e)}gp(A){if(this.Ev===null)return;const e=this.up(),t=this.ap(),i=this.qv?"right":"left";e.forEach((s=>{s.Ai()&&s.gt(AA(this.Li)).X(A,t,this.Fv,i)}))}Mp(A){if(this.Ev===null||this.Li===null)return;const e=this.tn.$v().$t(),t=[],i=this.tn.fp(),s=e.Zc().Rn(i,this.Li);s.length&&t.push(s);const n=this.ap(),o=this.qv?"right":"left";t.forEach((a=>{a.forEach((l=>{l.gt(AA(this.Li)).X(A,n,this.Fv,o)}))}))}kp(A){this.Kv.style.cursor=A===1?"ns-resize":"default"}fo(){const A=this.op();this.Wv<A&&this.tn.$v().$t().Kl(),this.Wv=A}_p(){return Wt(this.ko.fontSize,this.ko.fontFamily)}}function Jf(r,A){var e,t;return(t=(e=r.ua)===null||e===void 0?void 0:e.call(r,A))!==null&&t!==void 0?t:[]}function bi(r,A){var e,t;return(t=(e=r.Pn)===null||e===void 0?void 0:e.call(r,A))!==null&&t!==void 0?t:[]}function Zf(r,A){var e,t;return(t=(e=r.Ji)===null||e===void 0?void 0:e.call(r,A))!==null&&t!==void 0?t:[]}function Yf(r,A){var e,t;return(t=(e=r.aa)===null||e===void 0?void 0:e.call(r,A))!==null&&t!==void 0?t:[]}class Bn{constructor(A,e){this.Ev=$A({width:0,height:0}),this.Cp=null,this.Tp=null,this.Pp=null,this.Rp=null,this.Dp=!1,this.Vp=new ee,this.Op=new ee,this.Bp=0,this.Ap=!1,this.Ip=null,this.zp=!1,this.Lp=null,this.Ep=null,this.jv=!1,this.Hv=()=>{this.jv||this.Np===null||this.$i().Uh()},this.Uv=()=>{this.jv||this.Np===null||this.$i().Uh()},this.Qd=A,this.Np=e,this.Np.W_().l(this.Fp.bind(this),this,!0),this.Wp=document.createElement("td"),this.Wp.style.padding="0",this.Wp.style.position="relative";const t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.position="relative",t.style.overflow="hidden",this.jp=document.createElement("td"),this.jp.style.padding="0",this.Hp=document.createElement("td"),this.Hp.style.padding="0",this.Wp.appendChild(t),this.Gv=Lt(t,$A({width:16,height:16})),this.Gv.subscribeSuggestedBitmapSizeChanged(this.Hv);const i=this.Gv.canvasElement;i.style.position="absolute",i.style.zIndex="1",i.style.left="0",i.style.top="0",this.Jv=Lt(t,$A({width:16,height:16})),this.Jv.subscribeSuggestedBitmapSizeChanged(this.Uv);const s=this.Jv.canvasElement;s.style.position="absolute",s.style.zIndex="2",s.style.left="0",s.style.top="0",this.$p=document.createElement("tr"),this.$p.appendChild(this.jp),this.$p.appendChild(this.Wp),this.$p.appendChild(this.Hp),this.Up(),this.hp=new dn(this.Jv.canvasElement,this,{ev:()=>this.Ip===null&&!this.Qd.W().handleScroll.vertTouchDrag,rv:()=>this.Ip===null&&!this.Qd.W().handleScroll.horzTouchDrag})}S(){this.Cp!==null&&this.Cp.S(),this.Tp!==null&&this.Tp.S(),this.Pp=null,this.Jv.unsubscribeSuggestedBitmapSizeChanged(this.Uv),It(this.Jv.canvasElement),this.Jv.dispose(),this.Gv.unsubscribeSuggestedBitmapSizeChanged(this.Hv),It(this.Gv.canvasElement),this.Gv.dispose(),this.Np!==null&&this.Np.W_().p(this),this.hp.S()}fp(){return AA(this.Np)}qp(A){var e,t;this.Np!==null&&this.Np.W_().p(this),this.Np=A,this.Np!==null&&this.Np.W_().l(Bn.prototype.Fp.bind(this),this,!0),this.Up(),this.Qd.Yp().indexOf(this)===this.Qd.Yp().length-1?(this.Pp=(e=this.Pp)!==null&&e!==void 0?e:new Wf(this.Wp,this.Qd),this.Pp.bt()):((t=this.Pp)===null||t===void 0||t.if(),this.Pp=null)}$v(){return this.Qd}lp(){return this.$p}Up(){if(this.Np!==null&&(this.Zp(),this.$i().wt().length!==0)){if(this.Cp!==null){const A=this.Np.R_();this.Cp.Gi(AA(A))}if(this.Tp!==null){const A=this.Np.D_();this.Tp.Gi(AA(A))}}}Xp(){this.Cp!==null&&this.Cp.bt(),this.Tp!==null&&this.Tp.bt()}M_(){return this.Np!==null?this.Np.M_():0}x_(A){this.Np&&this.Np.x_(A)}Qf(A){if(!this.Np)return;this.Kp();const e=A.localX,t=A.localY;this.Gp(e,t,A)}bv(A){this.Kp(),this.Jp(),this.Gp(A.localX,A.localY,A)}tv(A){var e;if(!this.Np)return;this.Kp();const t=A.localX,i=A.localY;this.Gp(t,i,A);const s=this.wr(t,i);this.Qd.Qp((e=s?.Lv)!==null&&e!==void 0?e:null),this.$i().jc(s&&{Hc:s.Hc,Iv:s.Iv})}dv(A){this.Np!==null&&(this.Kp(),this.tm(A))}qf(A){this.Np!==null&&this.im(this.Op,A)}jf(A){this.qf(A)}av(A){this.Kp(),this.nm(A),this.Gp(A.localX,A.localY,A)}cv(A){this.Np!==null&&(this.Kp(),this.Ap=!1,this.sm(A))}uv(A){this.Np!==null&&this.tm(A)}Rv(A){if(this.Ap=!0,this.Ip===null){const e={x:A.localX,y:A.localY};this.rm(e,e,A)}}Pv(A){this.Np!==null&&(this.Kp(),this.Np.$t().jc(null),this.hm())}lm(){return this.Vp}am(){return this.Op}xv(){this.Bp=1,this.$i().Un()}Sv(A,e){if(!this.Qd.W().handleScale.pinch)return;const t=5*(e-this.Bp);this.Bp=e,this.$i().Qc(A.nt,t)}pv(A){this.Ap=!1,this.zp=this.Ip!==null,this.Jp();const e=this.$i().Zc();this.Ip!==null&&e.yt()&&(this.Lp={x:e.Yt(),y:e.Zt()},this.Ip={x:A.localX,y:A.localY})}hv(A){if(this.Np===null)return;const e=A.localX,t=A.localY;if(this.Ip===null)this.nm(A);else{this.zp=!1;const i=AA(this.Lp),s=i.x+(e-this.Ip.x),n=i.y+(t-this.Ip.y);this.Gp(s,n,A)}}_v(A){this.$v().W().trackingMode.exitMode===0&&(this.zp=!0),this.om(),this.sm(A)}wr(A,e){const t=this.Np;return t===null?null:(function(i,s,n){const o=i.Uo(),a=(function(l,c,u){var d,B;let p,f;for(const m of l){const E=(B=(d=m.va)===null||d===void 0?void 0:d.call(m,c,u))!==null&&B!==void 0?B:[];for(const F of E)g=F.zOrder,(!(Q=p?.zOrder)||g==="top"&&Q!=="top"||g==="normal"&&Q==="bottom")&&(p=F,f=m)}var g,Q;return p&&f?{zv:p,Hc:f}:null})(o,s,n);if(a?.zv.zOrder==="top")return vi(a);for(const l of o){if(a&&a.Hc===l&&a.zv.zOrder!=="bottom"&&!a.zv.isBackground)return vi(a);const c=Xf(l.Pn(i),s,n);if(c!==null)return{Hc:l,Bv:c.Bv,Iv:c.Iv};if(a&&a.Hc===l&&a.zv.zOrder!=="bottom"&&a.zv.isBackground)return vi(a)}return a?.zv?vi(a):null})(t,A,e)}_m(A,e){AA(e==="left"?this.Cp:this.Tp).cp($A({width:A,height:this.Ev.height}))}um(){return this.Ev}cp(A){Tt(this.Ev,A)||(this.Ev=A,this.jv=!0,this.Gv.resizeCanvasElement(A),this.Jv.resizeCanvasElement(A),this.jv=!1,this.Wp.style.width=A.width+"px",this.Wp.style.height=A.height+"px")}dm(){const A=AA(this.Np);A.P_(A.R_()),A.P_(A.D_());for(const e of A.Ba())if(A.vr(e)){const t=e.Dt();t!==null&&A.P_(t),e.Vn()}}xp(){return this.Gv.bitmapSize}Sp(A,e,t){const i=this.xp();i.width>0&&i.height>0&&A.drawImage(this.Gv.canvasElement,e,t)}vp(A){if(A===0||this.Np===null)return;if(A>1&&this.dm(),this.Cp!==null&&this.Cp.vp(A),this.Tp!==null&&this.Tp.vp(A),A!==1){this.Gv.applySuggestedBitmapSize();const t=St(this.Gv);t!==null&&(t.useBitmapCoordinateSpace((i=>{this.mp(i)})),this.Np&&(this.fm(t,Jf),this.vm(t),this.pm(t),this.fm(t,bi),this.fm(t,Zf)))}this.Jv.applySuggestedBitmapSize();const e=St(this.Jv);e!==null&&(e.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.bm(e),this.fm(e,Yf))}wm(){return this.Cp}gm(){return this.Tp}bp(A,e){this.fm(A,e)}Fp(){this.Np!==null&&this.Np.W_().p(this),this.Np=null}tm(A){this.im(this.Vp,A)}im(A,e){const t=e.localX,i=e.localY;A.M()&&A.m(this.$i().St().Nu(t),{x:t,y:i},e)}mp({context:A,bitmapSize:e}){const{width:t,height:i}=e,s=this.$i(),n=s.q(),o=s.bd();n===o?oi(A,0,0,t,i,o):ha(A,0,0,t,i,n,o)}vm(A){const e=AA(this.Np).j_().qh().gt();e!==null&&e.X(A,!1)}pm(A){const e=this.$i().Yc();this.Mm(A,bi,hn,e),this.Mm(A,bi,mi,e)}bm(A){this.Mm(A,bi,mi,this.$i().Zc())}fm(A,e){const t=AA(this.Np).Uo();for(const i of t)this.Mm(A,e,hn,i);for(const i of t)this.Mm(A,e,mi,i)}Mm(A,e,t,i){const s=AA(this.Np),n=s.$t().Wc(),o=n!==null&&n.Hc===i,a=n!==null&&o&&n.Iv!==void 0?n.Iv.Mr:void 0;un(e,(l=>t(l,A,o,a)),i,s)}Zp(){if(this.Np===null)return;const A=this.Qd,e=this.Np.R_().W().visible,t=this.Np.D_().W().visible;e||this.Cp===null||(this.jp.removeChild(this.Cp.lp()),this.Cp.S(),this.Cp=null),t||this.Tp===null||(this.Hp.removeChild(this.Tp.lp()),this.Tp.S(),this.Tp=null);const i=A.$t().ud();e&&this.Cp===null&&(this.Cp=new ol(this,A.W(),i,"left"),this.jp.appendChild(this.Cp.lp())),t&&this.Tp===null&&(this.Tp=new ol(this,A.W(),i,"right"),this.Hp.appendChild(this.Tp.lp()))}xm(A){return A.Dv&&this.Ap||this.Ip!==null}Sm(A){return Math.max(0,Math.min(A,this.Ev.width-1))}km(A){return Math.max(0,Math.min(A,this.Ev.height-1))}Gp(A,e,t){this.$i().ld(this.Sm(A),this.km(e),t,AA(this.Np))}hm(){this.$i().od()}om(){this.zp&&(this.Ip=null,this.hm())}rm(A,e,t){this.Ip=A,this.zp=!1,this.Gp(e.x,e.y,t);const i=this.$i().Zc();this.Lp={x:i.Yt(),y:i.Zt()}}$i(){return this.Qd.$t()}sm(A){if(!this.Dp)return;const e=this.$i(),t=this.fp();if(e.z_(t,t.vn()),this.Rp=null,this.Dp=!1,e.ed(),this.Ep!==null){const i=performance.now(),s=e.St();this.Ep.Vr(s.Hu(),i),this.Ep.Qu(i)||e.Zn(this.Ep)}}Kp(){this.Ip=null}Jp(){if(this.Np){if(this.$i().Un(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)AA(document.activeElement).blur();else{const A=document.getSelection();A!==null&&A.removeAllRanges()}!this.Np.vn().Ni()&&this.$i().St().Ni()}}nm(A){if(this.Np===null)return;const e=this.$i(),t=e.St();if(t.Ni())return;const i=this.Qd.W(),s=i.handleScroll,n=i.kineticScroll;if((!s.pressedMouseMove||A.Dv)&&(!s.horzTouchDrag&&!s.vertTouchDrag||!A.Dv))return;const o=this.Np.vn(),a=performance.now();if(this.Rp!==null||this.xm(A)||(this.Rp={x:A.clientX,y:A.clientY,Od:a,ym:A.localX,Cm:A.localY}),this.Rp!==null&&!this.Dp&&(this.Rp.x!==A.clientX||this.Rp.y!==A.clientY)){if(A.Dv&&n.touch||!A.Dv&&n.mouse){const l=t.le();this.Ep=new Rf(.2/l,7/l,.997,15/l),this.Ep.Yd(t.Hu(),this.Rp.Od)}else this.Ep=null;o.Ni()||e.A_(this.Np,o,A.localY),e.nd(A.localX),this.Dp=!0}this.Dp&&(o.Ni()||e.I_(this.Np,o,A.localY),e.sd(A.localX),this.Ep!==null&&this.Ep.Yd(t.Hu(),a))}}class al{constructor(A,e,t,i,s){this.ft=!0,this.Ev=$A({width:0,height:0}),this.Hv=()=>this.vp(3),this.qv=A==="left",this.Oc=t.ud,this.cn=e,this.Tm=i,this.Pm=s,this.Kv=document.createElement("div"),this.Kv.style.width="25px",this.Kv.style.height="100%",this.Kv.style.overflow="hidden",this.Gv=Lt(this.Kv,$A({width:16,height:16})),this.Gv.subscribeSuggestedBitmapSizeChanged(this.Hv)}S(){this.Gv.unsubscribeSuggestedBitmapSizeChanged(this.Hv),It(this.Gv.canvasElement),this.Gv.dispose()}lp(){return this.Kv}um(){return this.Ev}cp(A){Tt(this.Ev,A)||(this.Ev=A,this.Gv.resizeCanvasElement(A),this.Kv.style.width=`${A.width}px`,this.Kv.style.height=`${A.height}px`,this.ft=!0)}vp(A){if(A<3&&!this.ft||this.Ev.width===0||this.Ev.height===0)return;this.ft=!1,this.Gv.applySuggestedBitmapSize();const e=St(this.Gv);e!==null&&e.useBitmapCoordinateSpace((t=>{this.mp(t),this.Ie(t)}))}xp(){return this.Gv.bitmapSize}Sp(A,e,t){const i=this.xp();i.width>0&&i.height>0&&A.drawImage(this.Gv.canvasElement,e,t)}Ie({context:A,bitmapSize:e,horizontalPixelRatio:t,verticalPixelRatio:i}){if(!this.Tm())return;A.fillStyle=this.cn.timeScale.borderColor;const s=Math.floor(this.Oc.W().C*t),n=Math.floor(this.Oc.W().C*i),o=this.qv?e.width-s:0;A.fillRect(o,0,s,n)}mp({context:A,bitmapSize:e}){oi(A,0,0,e.width,e.height,this.Pm())}}function gn(r){return A=>{var e,t;return(t=(e=A.fa)===null||e===void 0?void 0:e.call(A,r))!==null&&t!==void 0?t:[]}}const qf=gn("normal"),jf=gn("top"),Ap=gn("bottom");class ep{constructor(A,e){this.Rm=null,this.Dm=null,this.k=null,this.Vm=!1,this.Ev=$A({width:0,height:0}),this.Om=new ee,this.Fv=new wr(5),this.jv=!1,this.Hv=()=>{this.jv||this.Qd.$t().Uh()},this.Uv=()=>{this.jv||this.Qd.$t().Uh()},this.Qd=A,this.q_=e,this.cn=A.W().layout,this.Xd=document.createElement("tr"),this.Bm=document.createElement("td"),this.Bm.style.padding="0",this.Am=document.createElement("td"),this.Am.style.padding="0",this.Kv=document.createElement("td"),this.Kv.style.height="25px",this.Kv.style.padding="0",this.Im=document.createElement("div"),this.Im.style.width="100%",this.Im.style.height="100%",this.Im.style.position="relative",this.Im.style.overflow="hidden",this.Kv.appendChild(this.Im),this.Gv=Lt(this.Im,$A({width:16,height:16})),this.Gv.subscribeSuggestedBitmapSizeChanged(this.Hv);const t=this.Gv.canvasElement;t.style.position="absolute",t.style.zIndex="1",t.style.left="0",t.style.top="0",this.Jv=Lt(this.Im,$A({width:16,height:16})),this.Jv.subscribeSuggestedBitmapSizeChanged(this.Uv);const i=this.Jv.canvasElement;i.style.position="absolute",i.style.zIndex="2",i.style.left="0",i.style.top="0",this.Xd.appendChild(this.Bm),this.Xd.appendChild(this.Kv),this.Xd.appendChild(this.Am),this.zm(),this.Qd.$t().g_().l(this.zm.bind(this),this),this.hp=new dn(this.Jv.canvasElement,this,{ev:()=>!0,rv:()=>!this.Qd.W().handleScroll.horzTouchDrag})}S(){this.hp.S(),this.Rm!==null&&this.Rm.S(),this.Dm!==null&&this.Dm.S(),this.Jv.unsubscribeSuggestedBitmapSizeChanged(this.Uv),It(this.Jv.canvasElement),this.Jv.dispose(),this.Gv.unsubscribeSuggestedBitmapSizeChanged(this.Hv),It(this.Gv.canvasElement),this.Gv.dispose()}lp(){return this.Xd}Lm(){return this.Rm}Em(){return this.Dm}bv(A){if(this.Vm)return;this.Vm=!0;const e=this.Qd.$t();!e.St().Ni()&&this.Qd.W().handleScale.axisPressedMouseMove.time&&e.Jc(A.localX)}pv(A){this.bv(A)}wv(){const A=this.Qd.$t();!A.St().Ni()&&this.Vm&&(this.Vm=!1,this.Qd.W().handleScale.axisPressedMouseMove.time&&A.hd())}av(A){const e=this.Qd.$t();!e.St().Ni()&&this.Qd.W().handleScale.axisPressedMouseMove.time&&e.rd(A.localX)}hv(A){this.av(A)}cv(){this.Vm=!1;const A=this.Qd.$t();A.St().Ni()&&!this.Qd.W().handleScale.axisPressedMouseMove.time||A.hd()}_v(){this.cv()}qf(){this.Qd.W().handleScale.axisDoubleClickReset.time&&this.Qd.$t().Kn()}jf(){this.qf()}Qf(){this.Qd.$t().W().handleScale.axisPressedMouseMove.time&&this.kp(1)}Pv(){this.kp(0)}um(){return this.Ev}Nm(){return this.Om}Fm(A,e,t){Tt(this.Ev,A)||(this.Ev=A,this.jv=!0,this.Gv.resizeCanvasElement(A),this.Jv.resizeCanvasElement(A),this.jv=!1,this.Kv.style.width=`${A.width}px`,this.Kv.style.height=`${A.height}px`,this.Om.m(A)),this.Rm!==null&&this.Rm.cp($A({width:e,height:A.height})),this.Dm!==null&&this.Dm.cp($A({width:t,height:A.height}))}Wm(){const A=this.jm();return Math.ceil(A.C+A.T+A.P+A.L+A.B+A.Hm)}bt(){this.Qd.$t().St().Ha()}xp(){return this.Gv.bitmapSize}Sp(A,e,t){const i=this.xp();i.width>0&&i.height>0&&A.drawImage(this.Gv.canvasElement,e,t)}vp(A){if(A===0)return;if(A!==1){this.Gv.applySuggestedBitmapSize();const t=St(this.Gv);t!==null&&(t.useBitmapCoordinateSpace((i=>{this.mp(i),this.Ie(i),this.$m(t,Ap)})),this.wp(t),this.$m(t,qf)),this.Rm!==null&&this.Rm.vp(A),this.Dm!==null&&this.Dm.vp(A)}this.Jv.applySuggestedBitmapSize();const e=St(this.Jv);e!==null&&(e.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.Um([...this.Qd.$t().wt(),this.Qd.$t().Zc()],e),this.$m(e,jf))}$m(A,e){const t=this.Qd.$t().wt();for(const i of t)un(e,(s=>hn(s,A,!1,void 0)),i,void 0);for(const i of t)un(e,(s=>mi(s,A,!1,void 0)),i,void 0)}mp({context:A,bitmapSize:e}){oi(A,0,0,e.width,e.height,this.Qd.$t().bd())}Ie({context:A,bitmapSize:e,verticalPixelRatio:t}){if(this.Qd.W().timeScale.borderVisible){A.fillStyle=this.qm();const i=Math.max(1,Math.floor(this.jm().C*t));A.fillRect(0,0,e.width,i)}}wp(A){const e=this.Qd.$t().St(),t=e.Ha();if(!t||t.length===0)return;const i=this.q_.maxTickMarkWeight(t),s=this.jm(),n=e.W();n.borderVisible&&n.ticksVisible&&A.useBitmapCoordinateSpace((({context:o,horizontalPixelRatio:a,verticalPixelRatio:l})=>{o.strokeStyle=this.qm(),o.fillStyle=this.qm();const c=Math.max(1,Math.floor(a)),u=Math.floor(.5*a);o.beginPath();const d=Math.round(s.T*l);for(let B=t.length;B--;){const p=Math.round(t[B].coord*a);o.rect(p-u,0,c,d)}o.fill()})),A.useMediaCoordinateSpace((({context:o})=>{const a=s.C+s.T+s.L+s.P/2;o.textAlign="center",o.textBaseline="middle",o.fillStyle=this.$(),o.font=this._p();for(const l of t)if(l.weight<i){const c=l.needAlignCoordinate?this.Ym(o,l.coord,l.label):l.coord;o.fillText(l.label,c,a)}this.Qd.W().timeScale.allowBoldLabels&&(o.font=this.Zm());for(const l of t)if(l.weight>=i){const c=l.needAlignCoordinate?this.Ym(o,l.coord,l.label):l.coord;o.fillText(l.label,c,a)}}))}Ym(A,e,t){const i=this.Fv.xi(A,t),s=i/2,n=Math.floor(e-s)+.5;return n<0?e+=Math.abs(0-n):n+i>this.Ev.width&&(e-=Math.abs(this.Ev.width-(n+i))),e}Um(A,e){const t=this.jm();for(const i of A)for(const s of i.Qi())s.gt().X(e,t)}qm(){return this.Qd.W().timeScale.borderColor}$(){return this.cn.textColor}j(){return this.cn.fontSize}_p(){return Wt(this.j(),this.cn.fontFamily)}Zm(){return Wt(this.j(),this.cn.fontFamily,"bold")}jm(){this.k===null&&(this.k={C:1,N:NaN,L:NaN,B:NaN,ji:NaN,T:5,P:NaN,R:"",Wi:new wr,Hm:0});const A=this.k,e=this._p();if(A.R!==e){const t=this.j();A.P=t,A.R=e,A.L=3*t/12,A.B=3*t/12,A.ji=9*t/12,A.N=0,A.Hm=4*t/12,A.Wi.nr()}return this.k}kp(A){this.Kv.style.cursor=A===1?"ew-resize":"default"}zm(){const A=this.Qd.$t(),e=A.W();e.leftPriceScale.visible||this.Rm===null||(this.Bm.removeChild(this.Rm.lp()),this.Rm.S(),this.Rm=null),e.rightPriceScale.visible||this.Dm===null||(this.Am.removeChild(this.Dm.lp()),this.Dm.S(),this.Dm=null);const t={ud:this.Qd.$t().ud()},i=()=>e.leftPriceScale.borderVisible&&A.St().W().borderVisible,s=()=>A.bd();e.leftPriceScale.visible&&this.Rm===null&&(this.Rm=new al("left",e,t,i,s),this.Bm.appendChild(this.Rm.lp())),e.rightPriceScale.visible&&this.Dm===null&&(this.Dm=new al("right",e,t,i,s),this.Am.appendChild(this.Dm.lp()))}}const tp=!!Jt&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((r=>r.brand.includes("Chromium")))&&!!Jt&&(!((wn=navigator?.userAgentData)===null||wn===void 0)&&wn.platform?navigator.userAgentData.platform==="Windows":navigator.userAgent.toLowerCase().indexOf("win")>=0);var wn;class rp{constructor(A,e,t){var i;this.Xm=[],this.Km=0,this.ho=0,this.__=0,this.Gm=0,this.Jm=0,this.Qm=null,this.tb=!1,this.Vp=new ee,this.Op=new ee,this.Rc=new ee,this.ib=null,this.nb=null,this.Jd=A,this.cn=e,this.q_=t,this.Xd=document.createElement("div"),this.Xd.classList.add("tv-lightweight-charts"),this.Xd.style.overflow="hidden",this.Xd.style.direction="ltr",this.Xd.style.width="100%",this.Xd.style.height="100%",(i=this.Xd).style.userSelect="none",i.style.webkitUserSelect="none",i.style.msUserSelect="none",i.style.MozUserSelect="none",i.style.webkitTapHighlightColor="transparent",this.sb=document.createElement("table"),this.sb.setAttribute("cellspacing","0"),this.Xd.appendChild(this.sb),this.eb=this.rb.bind(this),mn(this.cn)&&this.hb(!0),this.$i=new Kf(this.Vc.bind(this),this.cn,t),this.$t().Xc().l(this.lb.bind(this),this),this.ab=new ep(this,this.q_),this.sb.appendChild(this.ab.lp());const s=e.autoSize&&this.ob();let n=this.cn.width,o=this.cn.height;if(s||n===0||o===0){const a=A.getBoundingClientRect();n=n||a.width,o=o||a.height}this._b(n,o),this.ub(),A.appendChild(this.Xd),this.cb(),this.$i.St().ec().l(this.$i.Kl.bind(this.$i),this),this.$i.g_().l(this.$i.Kl.bind(this.$i),this)}$t(){return this.$i}W(){return this.cn}Yp(){return this.Xm}fb(){return this.ab}S(){this.hb(!1),this.Km!==0&&window.cancelAnimationFrame(this.Km),this.$i.Xc().p(this),this.$i.St().ec().p(this),this.$i.g_().p(this),this.$i.S();for(const A of this.Xm)this.sb.removeChild(A.lp()),A.lm().p(this),A.am().p(this),A.S();this.Xm=[],AA(this.ab).S(),this.Xd.parentElement!==null&&this.Xd.parentElement.removeChild(this.Xd),this.Rc.S(),this.Vp.S(),this.Op.S(),this.pb()}_b(A,e,t=!1){if(this.ho===e&&this.__===A)return;const i=(function(o){const a=Math.floor(o.width),l=Math.floor(o.height);return $A({width:a-a%2,height:l-l%2})})($A({width:A,height:e}));this.ho=i.height,this.__=i.width;const s=this.ho+"px",n=this.__+"px";AA(this.Xd).style.height=s,AA(this.Xd).style.width=n,this.sb.style.height=s,this.sb.style.width=n,t?this.mb(ue.es(),performance.now()):this.$i.Kl()}vp(A){A===void 0&&(A=ue.es());for(let e=0;e<this.Xm.length;e++)this.Xm[e].vp(A.Hn(e).Fn);this.cn.timeScale.visible&&this.ab.vp(A.jn())}$h(A){const e=mn(this.cn);this.$i.$h(A);const t=mn(this.cn);t!==e&&this.hb(t),this.cb(),this.bb(A)}lm(){return this.Vp}am(){return this.Op}Xc(){return this.Rc}wb(){this.Qm!==null&&(this.mb(this.Qm,performance.now()),this.Qm=null);const A=this.gb(null),e=document.createElement("canvas");e.width=A.width,e.height=A.height;const t=AA(e.getContext("2d"));return this.gb(t),e}Mb(A){return A==="left"&&!this.xb()||A==="right"&&!this.Sb()||this.Xm.length===0?0:AA(A==="left"?this.Xm[0].wm():this.Xm[0].gm()).dp()}kb(){return this.cn.autoSize&&this.ib!==null}yb(){return this.Xd}Qp(A){this.nb=A,this.nb?this.yb().style.setProperty("cursor",A):this.yb().style.removeProperty("cursor")}Cb(){return this.nb}Tb(){return be(this.Xm[0]).um()}bb(A){(A.autoSize!==void 0||!this.ib||A.width===void 0&&A.height===void 0)&&(A.autoSize&&!this.ib&&this.ob(),A.autoSize===!1&&this.ib!==null&&this.pb(),A.autoSize||A.width===void 0&&A.height===void 0||this._b(A.width||this.__,A.height||this.ho))}gb(A){let e=0,t=0;const i=this.Xm[0],s=(o,a)=>{let l=0;for(let c=0;c<this.Xm.length;c++){const u=this.Xm[c],d=AA(o==="left"?u.wm():u.gm()),B=d.xp();A!==null&&d.Sp(A,a,l),l+=B.height}};this.xb()&&(s("left",0),e+=AA(i.wm()).xp().width);for(let o=0;o<this.Xm.length;o++){const a=this.Xm[o],l=a.xp();A!==null&&a.Sp(A,e,t),t+=l.height}e+=i.xp().width,this.Sb()&&(s("right",e),e+=AA(i.gm()).xp().width);const n=(o,a,l)=>{AA(o==="left"?this.ab.Lm():this.ab.Em()).Sp(AA(A),a,l)};if(this.cn.timeScale.visible){const o=this.ab.xp();if(A!==null){let a=0;this.xb()&&(n("left",a,t),a=AA(i.wm()).xp().width),this.ab.Sp(A,a,t),a+=o.width,this.Sb()&&n("right",a,t)}t+=o.height}return $A({width:e,height:t})}Pb(){let A=0,e=0,t=0;for(const p of this.Xm)this.xb()&&(e=Math.max(e,AA(p.wm()).op(),this.cn.leftPriceScale.minimumWidth)),this.Sb()&&(t=Math.max(t,AA(p.gm()).op(),this.cn.rightPriceScale.minimumWidth)),A+=p.M_();e=an(e),t=an(t);const i=this.__,s=this.ho,n=Math.max(i-e-t,0),o=this.cn.timeScale.visible;let a=o?Math.max(this.ab.Wm(),this.cn.timeScale.minimumHeight):0;var l;a=(l=a)+l%2;const c=0+a,u=s<c?0:s-c,d=u/A;let B=0;for(let p=0;p<this.Xm.length;++p){const f=this.Xm[p];f.qp(this.$i.qc()[p]);let g=0,Q=0;Q=p===this.Xm.length-1?u-B:Math.round(f.M_()*d),g=Math.max(Q,2),B+=g,f.cp($A({width:n,height:g})),this.xb()&&f._m(e,"left"),this.Sb()&&f._m(t,"right"),f.fp()&&this.$i.Kc(f.fp(),g)}this.ab.Fm($A({width:o?n:0,height:a}),o?e:0,o?t:0),this.$i.S_(n),this.Gm!==e&&(this.Gm=e),this.Jm!==t&&(this.Jm=t)}hb(A){A?this.Xd.addEventListener("wheel",this.eb,{passive:!1}):this.Xd.removeEventListener("wheel",this.eb)}Rb(A){switch(A.deltaMode){case A.DOM_DELTA_PAGE:return 120;case A.DOM_DELTA_LINE:return 32}return tp?1/window.devicePixelRatio:1}rb(A){if(!(A.deltaX!==0&&this.cn.handleScroll.mouseWheel||A.deltaY!==0&&this.cn.handleScale.mouseWheel))return;const e=this.Rb(A),t=e*A.deltaX/100,i=-e*A.deltaY/100;if(A.cancelable&&A.preventDefault(),i!==0&&this.cn.handleScale.mouseWheel){const s=Math.sign(i)*Math.min(1,Math.abs(i)),n=A.clientX-this.Xd.getBoundingClientRect().left;this.$t().Qc(n,s)}t!==0&&this.cn.handleScroll.mouseWheel&&this.$t().td(-80*t)}mb(A,e){var t;const i=A.jn();i===3&&this.Db(),i!==3&&i!==2||(this.Vb(A),this.Ob(A,e),this.ab.bt(),this.Xm.forEach((s=>{s.Xp()})),((t=this.Qm)===null||t===void 0?void 0:t.jn())===3&&(this.Qm.ts(A),this.Db(),this.Vb(this.Qm),this.Ob(this.Qm,e),A=this.Qm,this.Qm=null)),this.vp(A)}Ob(A,e){for(const t of A.Qn())this.ns(t,e)}Vb(A){const e=this.$i.qc();for(let t=0;t<e.length;t++)A.Hn(t).Wn&&e[t].N_()}ns(A,e){const t=this.$i.St();switch(A.qn){case 0:t.hc();break;case 1:t.lc(A.Vt);break;case 2:t.Gn(A.Vt);break;case 3:t.Jn(A.Vt);break;case 4:t.qu();break;case 5:A.Vt.Qu(e)||t.Jn(A.Vt.tc(e))}}Vc(A){this.Qm!==null?this.Qm.ts(A):this.Qm=A,this.tb||(this.tb=!0,this.Km=window.requestAnimationFrame((e=>{if(this.tb=!1,this.Km=0,this.Qm!==null){const t=this.Qm;this.Qm=null,this.mb(t,e);for(const i of t.Qn())if(i.qn===5&&!i.Vt.Qu(e)){this.$t().Zn(i.Vt);break}}})))}Db(){this.ub()}ub(){const A=this.$i.qc(),e=A.length,t=this.Xm.length;for(let i=e;i<t;i++){const s=be(this.Xm.pop());this.sb.removeChild(s.lp()),s.lm().p(this),s.am().p(this),s.S()}for(let i=t;i<e;i++){const s=new Bn(this,A[i]);s.lm().l(this.Bb.bind(this),this),s.am().l(this.Ab.bind(this),this),this.Xm.push(s),this.sb.insertBefore(s.lp(),this.ab.lp())}for(let i=0;i<e;i++){const s=A[i],n=this.Xm[i];n.fp()!==s?n.qp(s):n.Up()}this.cb(),this.Pb()}Ib(A,e,t){var i;const s=new Map;A!==null&&this.$i.wt().forEach((c=>{const u=c.In().ll(A);u!==null&&s.set(c,u)}));let n;if(A!==null){const c=(i=this.$i.St().Ui(A))===null||i===void 0?void 0:i.originalTime;c!==void 0&&(n=c)}const o=this.$t().Wc(),a=o!==null&&o.Hc instanceof qs?o.Hc:void 0,l=o!==null&&o.Iv!==void 0?o.Iv.gr:void 0;return{zb:n,ee:A??void 0,Lb:e??void 0,Eb:a,Nb:s,Fb:l,Wb:t??void 0}}Bb(A,e,t){this.Vp.m((()=>this.Ib(A,e,t)))}Ab(A,e,t){this.Op.m((()=>this.Ib(A,e,t)))}lb(A,e,t){this.Rc.m((()=>this.Ib(A,e,t)))}cb(){const A=this.cn.timeScale.visible?"":"none";this.ab.lp().style.display=A}xb(){return this.Xm[0].fp().R_().W().visible}Sb(){return this.Xm[0].fp().D_().W().visible}ob(){return"ResizeObserver"in window&&(this.ib=new ResizeObserver((A=>{const e=A.find((t=>t.target===this.Jd));e&&this._b(e.contentRect.width,e.contentRect.height)})),this.ib.observe(this.Jd,{box:"border-box"}),!0)}pb(){this.ib!==null&&this.ib.disconnect(),this.ib=null}}function mn(r){return!!(r.handleScroll.mouseWheel||r.handleScale.mouseWheel)}function ip(r){return(function(A){return A.open!==void 0})(r)||(function(A){return A.value!==void 0})(r)}function ll(r,A){var e={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&A.indexOf(t)<0&&(e[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(t=Object.getOwnPropertySymbols(r);i<t.length;i++)A.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(r,t[i])&&(e[t[i]]=r[t[i]])}return e}function cl(r,A,e,t){const i=e.value,s={ee:A,ot:r,Vt:[i,i,i,i],zb:t};return e.color!==void 0&&(s.V=e.color),s}function sp(r,A,e,t){const i=e.value,s={ee:A,ot:r,Vt:[i,i,i,i],zb:t};return e.lineColor!==void 0&&(s.lt=e.lineColor),e.topColor!==void 0&&(s.Ps=e.topColor),e.bottomColor!==void 0&&(s.Rs=e.bottomColor),s}function np(r,A,e,t){const i=e.value,s={ee:A,ot:r,Vt:[i,i,i,i],zb:t};return e.topLineColor!==void 0&&(s.Re=e.topLineColor),e.bottomLineColor!==void 0&&(s.De=e.bottomLineColor),e.topFillColor1!==void 0&&(s.ke=e.topFillColor1),e.topFillColor2!==void 0&&(s.ye=e.topFillColor2),e.bottomFillColor1!==void 0&&(s.Ce=e.bottomFillColor1),e.bottomFillColor2!==void 0&&(s.Te=e.bottomFillColor2),s}function op(r,A,e,t){const i={ee:A,ot:r,Vt:[e.open,e.high,e.low,e.close],zb:t};return e.color!==void 0&&(i.V=e.color),i}function ap(r,A,e,t){const i={ee:A,ot:r,Vt:[e.open,e.high,e.low,e.close],zb:t};return e.color!==void 0&&(i.V=e.color),e.borderColor!==void 0&&(i.Ot=e.borderColor),e.wickColor!==void 0&&(i.Xh=e.wickColor),i}function lp(r,A,e,t,i){const s=be(i)(e),n=Math.max(...s),o=Math.min(...s),a=s[s.length-1],l=[a,n,o,a],c=e,{time:u,color:d}=c;return{ee:A,ot:r,Vt:l,zb:t,$e:ll(c,["time","color"]),V:d}}function yi(r){return r.Vt!==void 0}function hl(r,A){return A.customValues!==void 0&&(r.jb=A.customValues),r}function Mt(r){return(A,e,t,i,s,n)=>(function(o,a){return a?a(o):(l=o).open===void 0&&l.value===void 0;var l})(t,n)?hl({ot:A,ee:e,zb:i},t):hl(r(A,e,t,i,s),t)}function ul(r){return{Candlestick:Mt(ap),Bar:Mt(op),Area:Mt(sp),Baseline:Mt(np),Histogram:Mt(cl),Line:Mt(cl),Custom:Mt(lp)}[r]}function dl(r){return{ee:0,Hb:new Map,la:r}}function fl(r,A){if(r!==void 0&&r.length!==0)return{$b:A.key(r[0].ot),Ub:A.key(r[r.length-1].ot)}}function pl(r){let A;return r.forEach((e=>{A===void 0&&(A=e.zb)})),be(A)}class cp{constructor(A){this.qb=new Map,this.Yb=new Map,this.Zb=new Map,this.Xb=[],this.q_=A}S(){this.qb.clear(),this.Yb.clear(),this.Zb.clear(),this.Xb=[]}Kb(A,e){let t=this.qb.size!==0,i=!1;const s=this.Yb.get(A);if(s!==void 0)if(this.Yb.size===1)t=!1,i=!0,this.qb.clear();else for(const a of this.Xb)a.pointData.Hb.delete(A)&&(i=!0);let n=[];if(e.length!==0){const a=e.map((B=>B.time)),l=this.q_.createConverterToInternalObj(e),c=ul(A.Qh()),u=A.Ca(),d=A.Ta();n=e.map(((B,p)=>{const f=l(B.time),g=this.q_.key(f);let Q=this.qb.get(g);Q===void 0&&(Q=dl(f),this.qb.set(g,Q),i=!0);const m=c(f,Q.ee,B,a[p],u,d);return Q.Hb.set(A,m),m}))}t&&this.Gb(),this.Jb(A,n);let o=-1;if(i){const a=[];this.qb.forEach((l=>{a.push({timeWeight:0,time:l.la,pointData:l,originalTime:pl(l.Hb)})})),a.sort(((l,c)=>this.q_.key(l.time)-this.q_.key(c.time))),o=this.Qb(a)}return this.tw(A,o,(function(a,l,c){const u=fl(a,c),d=fl(l,c);if(u!==void 0&&d!==void 0)return{ta:u.Ub>=d.Ub&&u.$b>=d.$b}})(this.Yb.get(A),s,this.q_))}vd(A){return this.Kb(A,[])}iw(A,e){const t=e;(function(f){f.zb===void 0&&(f.zb=f.time)})(t),this.q_.preprocessData(e);const i=this.q_.createConverterToInternalObj([e])(e.time),s=this.Zb.get(A);if(s!==void 0&&this.q_.key(i)<this.q_.key(s))throw new Error(`Cannot update oldest data, last time=${s}, new time=${i}`);let n=this.qb.get(this.q_.key(i));const o=n===void 0;n===void 0&&(n=dl(i),this.qb.set(this.q_.key(i),n));const a=ul(A.Qh()),l=A.Ca(),c=A.Ta(),u=a(i,n.ee,e,t.zb,l,c);n.Hb.set(A,u),this.nw(A,u);const d={ta:yi(u)};if(!o)return this.tw(A,-1,d);const B={timeWeight:0,time:n.la,pointData:n,originalTime:pl(n.Hb)},p=gr(this.Xb,this.q_.key(B.time),((f,g)=>this.q_.key(f.time)<g));this.Xb.splice(p,0,B);for(let f=p;f<this.Xb.length;++f)Cn(this.Xb[f].pointData,f);return this.q_.fillWeightsForPoints(this.Xb,p),this.tw(A,p,d)}nw(A,e){let t=this.Yb.get(A);t===void 0&&(t=[],this.Yb.set(A,t));const i=t.length!==0?t[t.length-1]:null;i===null||this.q_.key(e.ot)>this.q_.key(i.ot)?yi(e)&&t.push(e):yi(e)?t[t.length-1]=e:t.splice(-1,1),this.Zb.set(A,e.ot)}Jb(A,e){e.length!==0?(this.Yb.set(A,e.filter(yi)),this.Zb.set(A,e[e.length-1].ot)):(this.Yb.delete(A),this.Zb.delete(A))}Gb(){for(const A of this.Xb)A.pointData.Hb.size===0&&this.qb.delete(this.q_.key(A.time))}Qb(A){let e=-1;for(let t=0;t<this.Xb.length&&t<A.length;++t){const i=this.Xb[t],s=A[t];if(this.q_.key(i.time)!==this.q_.key(s.time)){e=t;break}s.timeWeight=i.timeWeight,Cn(s.pointData,t)}if(e===-1&&this.Xb.length!==A.length&&(e=Math.min(this.Xb.length,A.length)),e===-1)return-1;for(let t=e;t<A.length;++t)Cn(A[t].pointData,t);return this.q_.fillWeightsForPoints(A,e),this.Xb=A,e}sw(){if(this.Yb.size===0)return null;let A=0;return this.Yb.forEach((e=>{e.length!==0&&(A=Math.max(A,e[e.length-1].ee))})),A}tw(A,e,t){const i={ew:new Map,St:{Eu:this.sw()}};if(e!==-1)this.Yb.forEach(((s,n)=>{i.ew.set(n,{$e:s,rw:n===A?t:void 0})})),this.Yb.has(A)||i.ew.set(A,{$e:[],rw:t}),i.St.hw=this.Xb,i.St.lw=e;else{const s=this.Yb.get(A);i.ew.set(A,{$e:s||[],rw:t})}return i}}function Cn(r,A){r.ee=A,r.Hb.forEach((e=>{e.ee=A}))}function vn(r){const A={value:r.Vt[3],time:r.zb};return r.jb!==void 0&&(A.customValues=r.jb),A}function Bl(r){const A=vn(r);return r.V!==void 0&&(A.color=r.V),A}function hp(r){const A=vn(r);return r.lt!==void 0&&(A.lineColor=r.lt),r.Ps!==void 0&&(A.topColor=r.Ps),r.Rs!==void 0&&(A.bottomColor=r.Rs),A}function up(r){const A=vn(r);return r.Re!==void 0&&(A.topLineColor=r.Re),r.De!==void 0&&(A.bottomLineColor=r.De),r.ke!==void 0&&(A.topFillColor1=r.ke),r.ye!==void 0&&(A.topFillColor2=r.ye),r.Ce!==void 0&&(A.bottomFillColor1=r.Ce),r.Te!==void 0&&(A.bottomFillColor2=r.Te),A}function gl(r){const A={open:r.Vt[0],high:r.Vt[1],low:r.Vt[2],close:r.Vt[3],time:r.zb};return r.jb!==void 0&&(A.customValues=r.jb),A}function dp(r){const A=gl(r);return r.V!==void 0&&(A.color=r.V),A}function fp(r){const A=gl(r),{V:e,Ot:t,Xh:i}=r;return e!==void 0&&(A.color=e),t!==void 0&&(A.borderColor=t),i!==void 0&&(A.wickColor=i),A}function bn(r){return{Area:hp,Line:Bl,Baseline:up,Histogram:Bl,Bar:dp,Candlestick:fp,Custom:pp}[r]}function pp(r){const A=r.zb;return Object.assign(Object.assign({},r.$e),{time:A})}const Bp={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},gp={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},wp={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:Ks,attributionLogo:!0},yn={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0},mp={rightOffset:0,barSpacing:6,minBarSpacing:.5,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0},Cp={color:"rgba(0, 0, 0, 0)",visible:!1,fontSize:48,fontFamily:Ks,fontStyle:"",text:"",horzAlign:"center",vertAlign:"center"};function wl(){return{width:0,height:0,autoSize:!1,layout:wp,crosshair:Bp,grid:gp,overlayPriceScales:Object.assign({},yn),leftPriceScale:Object.assign(Object.assign({},yn),{visible:!1}),rightPriceScale:Object.assign(Object.assign({},yn),{visible:!0}),timeScale:mp,watermark:Cp,localization:{locale:Jt?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class vp{constructor(A,e){this.aw=A,this.ow=e}applyOptions(A){this.aw.$t().$c(this.ow,A)}options(){return this.Li().W()}width(){return li(this.ow)?this.aw.Mb(this.ow):0}Li(){return AA(this.aw.$t().Uc(this.ow)).Dt}}function ml(r,A,e){const t=ll(r,["time","originalTime"]),i=Object.assign({time:A},t);return e!==void 0&&(i.originalTime=e),i}const bp={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class yp{constructor(A){this.Nh=A}applyOptions(A){this.Nh.$h(A)}options(){return this.Nh.W()}_w(){return this.Nh}}class Qp{constructor(A,e,t,i,s){this.uw=new ee,this.Es=A,this.cw=e,this.dw=t,this.q_=s,this.fw=i}S(){this.uw.S()}priceFormatter(){return this.Es.ba()}priceToCoordinate(A){const e=this.Es.Ct();return e===null?null:this.Es.Dt().Rt(A,e.Vt)}coordinateToPrice(A){const e=this.Es.Ct();return e===null?null:this.Es.Dt().pn(A,e.Vt)}barsInLogicalRange(A){if(A===null)return null;const e=new Xt(new Qr(A.from,A.to)).lu(),t=this.Es.In();if(t.Ni())return null;const i=t.ll(e.Os(),1),s=t.ll(e.ui(),-1),n=AA(t.el()),o=AA(t.An());if(i!==null&&s!==null&&i.ee>s.ee)return{barsBefore:A.from-n,barsAfter:o-A.to};const a={barsBefore:i===null||i.ee===n?A.from-n:i.ee-n,barsAfter:s===null||s.ee===o?o-A.to:o-s.ee};return i!==null&&s!==null&&(a.from=i.zb,a.to=s.zb),a}setData(A){this.q_,this.Es.Qh(),this.cw.pw(this.Es,A),this.mw("full")}update(A){this.Es.Qh(),this.cw.bw(this.Es,A),this.mw("update")}dataByIndex(A,e){const t=this.Es.In().ll(A,e);return t===null?null:bn(this.seriesType())(t)}data(){const A=bn(this.seriesType());return this.Es.In().ne().map((e=>A(e)))}subscribeDataChanged(A){this.uw.l(A)}unsubscribeDataChanged(A){this.uw.v(A)}setMarkers(A){this.q_;const e=A.map((t=>ml(t,this.q_.convertHorzItemToInternal(t.time),t.time)));this.Es.na(e)}markers(){return this.Es.sa().map((A=>ml(A,A.originalTime,void 0)))}applyOptions(A){this.Es.$h(A)}options(){return ot(this.Es.W())}priceScale(){return this.dw.priceScale(this.Es.Dt().Pa())}createPriceLine(A){const e=Ge(ot(bp),A),t=this.Es.ea(e);return new yp(t)}removePriceLine(A){this.Es.ra(A._w())}seriesType(){return this.Es.Qh()}attachPrimitive(A){this.Es.ka(A),A.attached&&A.attached({chart:this.fw,series:this,requestUpdate:()=>this.Es.$t().Kl()})}detachPrimitive(A){this.Es.ya(A),A.detached&&A.detached()}mw(A){this.uw.M()&&this.uw.m(A)}}class Fp{constructor(A,e,t){this.ww=new ee,this.mu=new ee,this.Om=new ee,this.$i=A,this.yl=A.St(),this.ab=e,this.yl.nc().l(this.gw.bind(this)),this.yl.sc().l(this.Mw.bind(this)),this.ab.Nm().l(this.xw.bind(this)),this.q_=t}S(){this.yl.nc().p(this),this.yl.sc().p(this),this.ab.Nm().p(this),this.ww.S(),this.mu.S(),this.Om.S()}scrollPosition(){return this.yl.Hu()}scrollToPosition(A,e){e?this.yl.Ju(A,1e3):this.$i.Jn(A)}scrollToRealTime(){this.yl.Gu()}getVisibleRange(){const A=this.yl.Vu();return A===null?null:{from:A.from.originalTime,to:A.to.originalTime}}setVisibleRange(A){const e={from:this.q_.convertHorzItemToInternal(A.from),to:this.q_.convertHorzItemToInternal(A.to)},t=this.yl.Iu(e);this.$i.pd(t)}getVisibleLogicalRange(){const A=this.yl.Du();return A===null?null:{from:A.Os(),to:A.ui()}}setVisibleLogicalRange(A){gt(A.from<=A.to,"The from index cannot be after the to index."),this.$i.pd(A)}resetTimeScale(){this.$i.Kn()}fitContent(){this.$i.hc()}logicalToCoordinate(A){const e=this.$i.St();return e.Ni()?null:e.It(A)}coordinateToLogical(A){return this.yl.Ni()?null:this.yl.Nu(A)}timeToCoordinate(A){const e=this.q_.convertHorzItemToInternal(A),t=this.yl.Va(e,!1);return t===null?null:this.yl.It(t)}coordinateToTime(A){const e=this.$i.St(),t=e.Nu(A),i=e.Ui(t);return i===null?null:i.originalTime}width(){return this.ab.um().width}height(){return this.ab.um().height}subscribeVisibleTimeRangeChange(A){this.ww.l(A)}unsubscribeVisibleTimeRangeChange(A){this.ww.v(A)}subscribeVisibleLogicalRangeChange(A){this.mu.l(A)}unsubscribeVisibleLogicalRangeChange(A){this.mu.v(A)}subscribeSizeChange(A){this.Om.l(A)}unsubscribeSizeChange(A){this.Om.v(A)}applyOptions(A){this.yl.$h(A)}options(){return Object.assign(Object.assign({},ot(this.yl.W())),{barSpacing:this.yl.le()})}gw(){this.ww.M()&&this.ww.m(this.getVisibleRange())}Mw(){this.mu.M()&&this.mu.m(this.getVisibleLogicalRange())}xw(A){this.Om.m(A.width,A.height)}}function Up(r){if(r===void 0||r.type==="custom")return;const A=r;A.minMove!==void 0&&A.precision===void 0&&(A.precision=(function(e){if(e>=1)return 0;let t=0;for(;t<8;t++){const i=Math.round(e);if(Math.abs(i-e)<1e-8)return t;e*=10}return t})(A.minMove))}function Cl(r){return(function(A){if(ni(A.handleScale)){const t=A.handleScale;A.handleScale={axisDoubleClickReset:{time:t,price:t},axisPressedMouseMove:{time:t,price:t},mouseWheel:t,pinch:t}}else if(A.handleScale!==void 0){const{axisPressedMouseMove:t,axisDoubleClickReset:i}=A.handleScale;ni(t)&&(A.handleScale.axisPressedMouseMove={time:t,price:t}),ni(i)&&(A.handleScale.axisDoubleClickReset={time:i,price:i})}const e=A.handleScroll;ni(e)&&(A.handleScroll={horzTouchDrag:e,vertTouchDrag:e,mouseWheel:e,pressedMouseMove:e})})(r),r}class Ep{constructor(A,e,t){this.Sw=new Map,this.kw=new Map,this.yw=new ee,this.Cw=new ee,this.Tw=new ee,this.Pw=new cp(e);const i=t===void 0?ot(wl()):Ge(ot(wl()),Cl(t));this.q_=e,this.aw=new rp(A,i,e),this.aw.lm().l((n=>{this.yw.M()&&this.yw.m(this.Rw(n()))}),this),this.aw.am().l((n=>{this.Cw.M()&&this.Cw.m(this.Rw(n()))}),this),this.aw.Xc().l((n=>{this.Tw.M()&&this.Tw.m(this.Rw(n()))}),this);const s=this.aw.$t();this.Dw=new Fp(s,this.aw.fb(),this.q_)}remove(){this.aw.lm().p(this),this.aw.am().p(this),this.aw.Xc().p(this),this.Dw.S(),this.aw.S(),this.Sw.clear(),this.kw.clear(),this.yw.S(),this.Cw.S(),this.Tw.S(),this.Pw.S()}resize(A,e,t){this.autoSizeActive()||this.aw._b(A,e,t)}addCustomSeries(A,e){const t=Rt(A),i=Object.assign(Object.assign({},ea),t.defaultOptions());return this.Vw("Custom",i,e,t)}addAreaSeries(A){return this.Vw("Area",ld,A)}addBaselineSeries(A){return this.Vw("Baseline",cd,A)}addBarSeries(A){return this.Vw("Bar",od,A)}addCandlestickSeries(A={}){return(function(e){e.borderColor!==void 0&&(e.borderUpColor=e.borderColor,e.borderDownColor=e.borderColor),e.wickColor!==void 0&&(e.wickUpColor=e.wickColor,e.wickDownColor=e.wickColor)})(A),this.Vw("Candlestick",nd,A)}addHistogramSeries(A){return this.Vw("Histogram",hd,A)}addLineSeries(A){return this.Vw("Line",ad,A)}removeSeries(A){const e=be(this.Sw.get(A)),t=this.Pw.vd(e);this.aw.$t().vd(e),this.Ow(t),this.Sw.delete(A),this.kw.delete(e)}pw(A,e){this.Ow(this.Pw.Kb(A,e))}bw(A,e){this.Ow(this.Pw.iw(A,e))}subscribeClick(A){this.yw.l(A)}unsubscribeClick(A){this.yw.v(A)}subscribeCrosshairMove(A){this.Tw.l(A)}unsubscribeCrosshairMove(A){this.Tw.v(A)}subscribeDblClick(A){this.Cw.l(A)}unsubscribeDblClick(A){this.Cw.v(A)}priceScale(A){return new vp(this.aw,A)}timeScale(){return this.Dw}applyOptions(A){this.aw.$h(Cl(A))}options(){return this.aw.W()}takeScreenshot(){return this.aw.wb()}autoSizeActive(){return this.aw.kb()}chartElement(){return this.aw.yb()}paneSize(){const A=this.aw.Tb();return{height:A.height,width:A.width}}setCrosshairPosition(A,e,t){const i=this.Sw.get(t);if(i===void 0)return;const s=this.aw.$t().dr(i);s!==null&&this.aw.$t().ad(A,e,s)}clearCrosshairPosition(){this.aw.$t().od(!0)}Vw(A,e,t={},i){Up(t.priceFormat);const s=Ge(ot(ta),ot(e),t),n=this.aw.$t().dd(A,s,i),o=new Qp(n,this,this,this,this.q_);return this.Sw.set(o,n),this.kw.set(n,o),o}Ow(A){const e=this.aw.$t();e._d(A.St.Eu,A.St.hw,A.St.lw),A.ew.forEach(((t,i)=>i.J(t.$e,t.rw))),e.Wu()}Bw(A){return be(this.kw.get(A))}Rw(A){const e=new Map;A.Nb.forEach(((i,s)=>{const n=s.Qh(),o=bn(n)(i);if(n!=="Custom")gt(ip(o));else{const a=s.Ta();gt(!a||a(o)===!1)}e.set(this.Bw(s),o)}));const t=A.Eb!==void 0&&this.kw.has(A.Eb)?this.Bw(A.Eb):void 0;return{time:A.zb,logical:A.ee,point:A.Lb,hoveredSeries:t,hoveredObjectId:A.Fb,seriesData:e,sourceEvent:A.Wb}}}function xp(r,A,e){let t;if(pr(r)){const s=document.getElementById(r);gt(s!==null,`Cannot find element in DOM with id=${r}`),t=s}else t=r;const i=new Ep(t,A,e);return A.setOptions(i.options()),i}function Tp(r,A){return xp(r,new rl,rl.Id(A))}Object.assign(Object.assign({},ta),ea);function vl(r,A){return function(){return r.apply(A,arguments)}}const{toString:Sp}=Object.prototype,{getPrototypeOf:Qn}=Object,{iterator:Qi,toStringTag:bl}=Symbol,Fi=(r=>A=>{const e=Sp.call(A);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),We=r=>(r=r.toLowerCase(),A=>Fi(A)===r),Ui=r=>A=>typeof A===r,{isArray:Yt}=Array,qt=Ui("undefined");function Fr(r){return r!==null&&!qt(r)&&r.constructor!==null&&!qt(r.constructor)&&Ue(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const yl=We("ArrayBuffer");function Hp(r){let A;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?A=ArrayBuffer.isView(r):A=r&&r.buffer&&yl(r.buffer),A}const Lp=Ui("string"),Ue=Ui("function"),Ql=Ui("number"),Ur=r=>r!==null&&typeof r=="object",Ip=r=>r===!0||r===!1,Ei=r=>{if(Fi(r)!=="object")return!1;const A=Qn(r);return(A===null||A===Object.prototype||Object.getPrototypeOf(A)===null)&&!(bl in r)&&!(Qi in r)},Mp=r=>{if(!Ur(r)||Fr(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Dp=We("Date"),_p=We("File"),kp=We("Blob"),Op=We("FileList"),Np=r=>Ur(r)&&Ue(r.pipe),Kp=r=>{let A;return r&&(typeof FormData=="function"&&r instanceof FormData||Ue(r.append)&&((A=Fi(r))==="formdata"||A==="object"&&Ue(r.toString)&&r.toString()==="[object FormData]"))},Vp=We("URLSearchParams"),[Pp,zp,Gp,Rp]=["ReadableStream","Request","Response","Headers"].map(We),Wp=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Er(r,A,{allOwnKeys:e=!1}={}){if(r===null||typeof r>"u")return;let t,i;if(typeof r!="object"&&(r=[r]),Yt(r))for(t=0,i=r.length;t<i;t++)A.call(null,r[t],t,r);else{if(Fr(r))return;const s=e?Object.getOwnPropertyNames(r):Object.keys(r),n=s.length;let o;for(t=0;t<n;t++)o=s[t],A.call(null,r[o],o,r)}}function Fl(r,A){if(Fr(r))return null;A=A.toLowerCase();const e=Object.keys(r);let t=e.length,i;for(;t-- >0;)if(i=e[t],A===i.toLowerCase())return i;return null}const Dt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ul=r=>!qt(r)&&r!==Dt;function Fn(){const{caseless:r,skipUndefined:A}=Ul(this)&&this||{},e={},t=(i,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const n=r&&Fl(e,s)||s;Ei(e[n])&&Ei(i)?e[n]=Fn(e[n],i):Ei(i)?e[n]=Fn({},i):Yt(i)?e[n]=i.slice():(!A||!qt(i))&&(e[n]=i)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Er(arguments[i],t);return e}const $p=(r,A,e,{allOwnKeys:t}={})=>(Er(A,(i,s)=>{e&&Ue(i)?Object.defineProperty(r,s,{value:vl(i,e),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,s,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:t}),r),Xp=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Jp=(r,A,e,t)=>{r.prototype=Object.create(A.prototype,t),Object.defineProperty(r.prototype,"constructor",{value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{value:A.prototype}),e&&Object.assign(r.prototype,e)},Zp=(r,A,e,t)=>{let i,s,n;const o={};if(A=A||{},r==null)return A;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)n=i[s],(!t||t(n,r,A))&&!o[n]&&(A[n]=r[n],o[n]=!0);r=e!==!1&&Qn(r)}while(r&&(!e||e(r,A))&&r!==Object.prototype);return A},Yp=(r,A,e)=>{r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=A.length;const t=r.indexOf(A,e);return t!==-1&&t===e},qp=r=>{if(!r)return null;if(Yt(r))return r;let A=r.length;if(!Ql(A))return null;const e=new Array(A);for(;A-- >0;)e[A]=r[A];return e},jp=(r=>A=>r&&A instanceof r)(typeof Uint8Array<"u"&&Qn(Uint8Array)),A0=(r,A)=>{const t=(r&&r[Qi]).call(r);let i;for(;(i=t.next())&&!i.done;){const s=i.value;A.call(r,s[0],s[1])}},e0=(r,A)=>{let e;const t=[];for(;(e=r.exec(A))!==null;)t.push(e);return t},t0=We("HTMLFormElement"),r0=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,i){return t.toUpperCase()+i}),El=(({hasOwnProperty:r})=>(A,e)=>r.call(A,e))(Object.prototype),i0=We("RegExp"),xl=(r,A)=>{const e=Object.getOwnPropertyDescriptors(r),t={};Er(e,(i,s)=>{let n;(n=A(i,s,r))!==!1&&(t[s]=n||i)}),Object.defineProperties(r,t)},s0=r=>{xl(r,(A,e)=>{if(Ue(r)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const t=r[e];if(Ue(t)){if(A.enumerable=!1,"writable"in A){A.writable=!1;return}A.set||(A.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},n0=(r,A)=>{const e={},t=i=>{i.forEach(s=>{e[s]=!0})};return Yt(r)?t(r):t(String(r).split(A)),e},o0=()=>{},a0=(r,A)=>r!=null&&Number.isFinite(r=+r)?r:A;function l0(r){return!!(r&&Ue(r.append)&&r[bl]==="FormData"&&r[Qi])}const c0=r=>{const A=new Array(10),e=(t,i)=>{if(Ur(t)){if(A.indexOf(t)>=0)return;if(Fr(t))return t;if(!("toJSON"in t)){A[i]=t;const s=Yt(t)?[]:{};return Er(t,(n,o)=>{const a=e(n,i+1);!qt(a)&&(s[o]=a)}),A[i]=void 0,s}}return t};return e(r,0)},h0=We("AsyncFunction"),u0=r=>r&&(Ur(r)||Ue(r))&&Ue(r.then)&&Ue(r.catch),Tl=((r,A)=>r?setImmediate:A?((e,t)=>(Dt.addEventListener("message",({source:i,data:s})=>{i===Dt&&s===e&&t.length&&t.shift()()},!1),i=>{t.push(i),Dt.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Ue(Dt.postMessage)),d0=typeof queueMicrotask<"u"?queueMicrotask.bind(Dt):typeof process<"u"&&process.nextTick||Tl,K={isArray:Yt,isArrayBuffer:yl,isBuffer:Fr,isFormData:Kp,isArrayBufferView:Hp,isString:Lp,isNumber:Ql,isBoolean:Ip,isObject:Ur,isPlainObject:Ei,isEmptyObject:Mp,isReadableStream:Pp,isRequest:zp,isResponse:Gp,isHeaders:Rp,isUndefined:qt,isDate:Dp,isFile:_p,isBlob:kp,isRegExp:i0,isFunction:Ue,isStream:Np,isURLSearchParams:Vp,isTypedArray:jp,isFileList:Op,forEach:Er,merge:Fn,extend:$p,trim:Wp,stripBOM:Xp,inherits:Jp,toFlatObject:Zp,kindOf:Fi,kindOfTest:We,endsWith:Yp,toArray:qp,forEachEntry:A0,matchAll:e0,isHTMLForm:t0,hasOwnProperty:El,hasOwnProp:El,reduceDescriptors:xl,freezeMethods:s0,toObjectSet:n0,toCamelCase:r0,noop:o0,toFiniteNumber:a0,findKey:Fl,global:Dt,isContextDefined:Ul,isSpecCompliantForm:l0,toJSONObject:c0,isAsyncFn:h0,isThenable:u0,setImmediate:Tl,asap:d0,isIterable:r=>r!=null&&Ue(r[Qi])};let TA=class Yu extends Error{static from(A,e,t,i,s,n){const o=new Yu(A.message,e||A.code,t,i,s);return o.cause=A,o.name=A.name,n&&Object.assign(o,n),o}constructor(A,e,t,i,s){super(A),this.name="AxiosError",this.isAxiosError=!0,e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:K.toJSONObject(this.config),code:this.code,status:this.status}}};TA.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",TA.ERR_BAD_OPTION="ERR_BAD_OPTION",TA.ECONNABORTED="ECONNABORTED",TA.ETIMEDOUT="ETIMEDOUT",TA.ERR_NETWORK="ERR_NETWORK",TA.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",TA.ERR_DEPRECATED="ERR_DEPRECATED",TA.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",TA.ERR_BAD_REQUEST="ERR_BAD_REQUEST",TA.ERR_CANCELED="ERR_CANCELED",TA.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",TA.ERR_INVALID_URL="ERR_INVALID_URL";const f0=null;function Un(r){return K.isPlainObject(r)||K.isArray(r)}function Sl(r){return K.endsWith(r,"[]")?r.slice(0,-2):r}function Hl(r,A,e){return r?r.concat(A).map(function(i,s){return i=Sl(i),!e&&s?"["+i+"]":i}).join(e?".":""):A}function p0(r){return K.isArray(r)&&!r.some(Un)}const B0=K.toFlatObject(K,{},null,function(A){return/^is[A-Z]/.test(A)});function xi(r,A,e){if(!K.isObject(r))throw new TypeError("target must be an object");A=A||new FormData,e=K.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,g){return!K.isUndefined(g[f])});const t=e.metaTokens,i=e.visitor||c,s=e.dots,n=e.indexes,a=(e.Blob||typeof Blob<"u"&&Blob)&&K.isSpecCompliantForm(A);if(!K.isFunction(i))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(K.isDate(p))return p.toISOString();if(K.isBoolean(p))return p.toString();if(!a&&K.isBlob(p))throw new TA("Blob is not supported. Use a Buffer instead.");return K.isArrayBuffer(p)||K.isTypedArray(p)?a&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,f,g){let Q=p;if(p&&!g&&typeof p=="object"){if(K.endsWith(f,"{}"))f=t?f:f.slice(0,-2),p=JSON.stringify(p);else if(K.isArray(p)&&p0(p)||(K.isFileList(p)||K.endsWith(f,"[]"))&&(Q=K.toArray(p)))return f=Sl(f),Q.forEach(function(E,F){!(K.isUndefined(E)||E===null)&&A.append(n===!0?Hl([f],F,s):n===null?f:f+"[]",l(E))}),!1}return Un(p)?!0:(A.append(Hl(g,f,s),l(p)),!1)}const u=[],d=Object.assign(B0,{defaultVisitor:c,convertValue:l,isVisitable:Un});function B(p,f){if(!K.isUndefined(p)){if(u.indexOf(p)!==-1)throw Error("Circular reference detected in "+f.join("."));u.push(p),K.forEach(p,function(Q,m){(!(K.isUndefined(Q)||Q===null)&&i.call(A,Q,K.isString(m)?m.trim():m,f,d))===!0&&B(Q,f?f.concat(m):[m])}),u.pop()}}if(!K.isObject(r))throw new TypeError("data must be an object");return B(r),A}function Ll(r){const A={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(t){return A[t]})}function En(r,A){this._pairs=[],r&&xi(r,this,A)}const Il=En.prototype;Il.append=function(A,e){this._pairs.push([A,e])},Il.toString=function(A){const e=A?function(t){return A.call(this,t,Ll)}:Ll;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function g0(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ml(r,A,e){if(!A)return r;const t=e&&e.encode||g0,i=K.isFunction(e)?{serialize:e}:e,s=i&&i.serialize;let n;if(s?n=s(A,i):n=K.isURLSearchParams(A)?A.toString():new En(A,i).toString(t),n){const o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+n}return r}class Dl{constructor(){this.handlers=[]}use(A,e,t){return this.handlers.push({fulfilled:A,rejected:e,synchronous:t?t.synchronous:!1,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(A){this.handlers[A]&&(this.handlers[A]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(A){K.forEach(this.handlers,function(t){t!==null&&A(t)})}}const xn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},w0={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:En,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Tn=typeof window<"u"&&typeof document<"u",Sn=typeof navigator=="object"&&navigator||void 0,m0=Tn&&(!Sn||["ReactNative","NativeScript","NS"].indexOf(Sn.product)<0),C0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",v0=Tn&&window.location.href||"http://localhost",pe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Tn,hasStandardBrowserEnv:m0,hasStandardBrowserWebWorkerEnv:C0,navigator:Sn,origin:v0},Symbol.toStringTag,{value:"Module"})),...w0};function b0(r,A){return xi(r,new pe.classes.URLSearchParams,{visitor:function(e,t,i,s){return pe.isNode&&K.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...A})}function y0(r){return K.matchAll(/\w+|\[(\w*)]/g,r).map(A=>A[0]==="[]"?"":A[1]||A[0])}function Q0(r){const A={},e=Object.keys(r);let t;const i=e.length;let s;for(t=0;t<i;t++)s=e[t],A[s]=r[s];return A}function _l(r){function A(e,t,i,s){let n=e[s++];if(n==="__proto__")return!0;const o=Number.isFinite(+n),a=s>=e.length;return n=!n&&K.isArray(i)?i.length:n,a?(K.hasOwnProp(i,n)?i[n]=[i[n],t]:i[n]=t,!o):((!i[n]||!K.isObject(i[n]))&&(i[n]=[]),A(e,t,i[n],s)&&K.isArray(i[n])&&(i[n]=Q0(i[n])),!o)}if(K.isFormData(r)&&K.isFunction(r.entries)){const e={};return K.forEachEntry(r,(t,i)=>{A(y0(t),i,e,0)}),e}return null}function F0(r,A,e){if(K.isString(r))try{return(A||JSON.parse)(r),K.trim(r)}catch(t){if(t.name!=="SyntaxError")throw t}return(e||JSON.stringify)(r)}const xr={transitional:xn,adapter:["xhr","http","fetch"],transformRequest:[function(A,e){const t=e.getContentType()||"",i=t.indexOf("application/json")>-1,s=K.isObject(A);if(s&&K.isHTMLForm(A)&&(A=new FormData(A)),K.isFormData(A))return i?JSON.stringify(_l(A)):A;if(K.isArrayBuffer(A)||K.isBuffer(A)||K.isStream(A)||K.isFile(A)||K.isBlob(A)||K.isReadableStream(A))return A;if(K.isArrayBufferView(A))return A.buffer;if(K.isURLSearchParams(A))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),A.toString();let o;if(s){if(t.indexOf("application/x-www-form-urlencoded")>-1)return b0(A,this.formSerializer).toString();if((o=K.isFileList(A))||t.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return xi(o?{"files[]":A}:A,a&&new a,this.formSerializer)}}return s||i?(e.setContentType("application/json",!1),F0(A)):A}],transformResponse:[function(A){const e=this.transitional||xr.transitional,t=e&&e.forcedJSONParsing,i=this.responseType==="json";if(K.isResponse(A)||K.isReadableStream(A))return A;if(A&&K.isString(A)&&(t&&!this.responseType||i)){const n=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(A,this.parseReviver)}catch(o){if(n)throw o.name==="SyntaxError"?TA.from(o,TA.ERR_BAD_RESPONSE,this,null,this.response):o}}return A}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pe.classes.FormData,Blob:pe.classes.Blob},validateStatus:function(A){return A>=200&&A<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};K.forEach(["delete","get","head","post","put","patch"],r=>{xr.headers[r]={}});const U0=K.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),E0=r=>{const A={};let e,t,i;return r&&r.split(`
2
- `).forEach(function(n){i=n.indexOf(":"),e=n.substring(0,i).trim().toLowerCase(),t=n.substring(i+1).trim(),!(!e||A[e]&&U0[e])&&(e==="set-cookie"?A[e]?A[e].push(t):A[e]=[t]:A[e]=A[e]?A[e]+", "+t:t)}),A},kl=Symbol("internals");function Tr(r){return r&&String(r).trim().toLowerCase()}function Ti(r){return r===!1||r==null?r:K.isArray(r)?r.map(Ti):String(r)}function x0(r){const A=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let t;for(;t=e.exec(r);)A[t[1]]=t[2];return A}const T0=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function Hn(r,A,e,t,i){if(K.isFunction(t))return t.call(this,A,e);if(i&&(A=e),!!K.isString(A)){if(K.isString(t))return A.indexOf(t)!==-1;if(K.isRegExp(t))return t.test(A)}}function S0(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(A,e,t)=>e.toUpperCase()+t)}function H0(r,A){const e=K.toCamelCase(" "+A);["get","set","has"].forEach(t=>{Object.defineProperty(r,t+e,{value:function(i,s,n){return this[t].call(this,A,i,s,n)},configurable:!0})})}let Ee=class{constructor(A){A&&this.set(A)}set(A,e,t){const i=this;function s(o,a,l){const c=Tr(a);if(!c)throw new Error("header name must be a non-empty string");const u=K.findKey(i,c);(!u||i[u]===void 0||l===!0||l===void 0&&i[u]!==!1)&&(i[u||a]=Ti(o))}const n=(o,a)=>K.forEach(o,(l,c)=>s(l,c,a));if(K.isPlainObject(A)||A instanceof this.constructor)n(A,e);else if(K.isString(A)&&(A=A.trim())&&!T0(A))n(E0(A),e);else if(K.isObject(A)&&K.isIterable(A)){let o={},a,l;for(const c of A){if(!K.isArray(c))throw TypeError("Object iterator must return a key-value pair");o[l=c[0]]=(a=o[l])?K.isArray(a)?[...a,c[1]]:[a,c[1]]:c[1]}n(o,e)}else A!=null&&s(e,A,t);return this}get(A,e){if(A=Tr(A),A){const t=K.findKey(this,A);if(t){const i=this[t];if(!e)return i;if(e===!0)return x0(i);if(K.isFunction(e))return e.call(this,i,t);if(K.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(A,e){if(A=Tr(A),A){const t=K.findKey(this,A);return!!(t&&this[t]!==void 0&&(!e||Hn(this,this[t],t,e)))}return!1}delete(A,e){const t=this;let i=!1;function s(n){if(n=Tr(n),n){const o=K.findKey(t,n);o&&(!e||Hn(t,t[o],o,e))&&(delete t[o],i=!0)}}return K.isArray(A)?A.forEach(s):s(A),i}clear(A){const e=Object.keys(this);let t=e.length,i=!1;for(;t--;){const s=e[t];(!A||Hn(this,this[s],s,A,!0))&&(delete this[s],i=!0)}return i}normalize(A){const e=this,t={};return K.forEach(this,(i,s)=>{const n=K.findKey(t,s);if(n){e[n]=Ti(i),delete e[s];return}const o=A?S0(s):String(s).trim();o!==s&&delete e[s],e[o]=Ti(i),t[o]=!0}),this}concat(...A){return this.constructor.concat(this,...A)}toJSON(A){const e=Object.create(null);return K.forEach(this,(t,i)=>{t!=null&&t!==!1&&(e[i]=A&&K.isArray(t)?t.join(", "):t)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([A,e])=>A+": "+e).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(A){return A instanceof this?A:new this(A)}static concat(A,...e){const t=new this(A);return e.forEach(i=>t.set(i)),t}static accessor(A){const t=(this[kl]=this[kl]={accessors:{}}).accessors,i=this.prototype;function s(n){const o=Tr(n);t[o]||(H0(i,n),t[o]=!0)}return K.isArray(A)?A.forEach(s):s(A),this}};Ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),K.reduceDescriptors(Ee.prototype,({value:r},A)=>{let e=A[0].toUpperCase()+A.slice(1);return{get:()=>r,set(t){this[e]=t}}}),K.freezeMethods(Ee);function Ln(r,A){const e=this||xr,t=A||e,i=Ee.from(t.headers);let s=t.data;return K.forEach(r,function(o){s=o.call(e,s,i.normalize(),A?A.status:void 0)}),i.normalize(),s}function Ol(r){return!!(r&&r.__CANCEL__)}let Sr=class extends TA{constructor(A,e,t){super(A??"canceled",TA.ERR_CANCELED,e,t),this.name="CanceledError",this.__CANCEL__=!0}};function Nl(r,A,e){const t=e.config.validateStatus;!e.status||!t||t(e.status)?r(e):A(new TA("Request failed with status code "+e.status,[TA.ERR_BAD_REQUEST,TA.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function L0(r){const A=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return A&&A[1]||""}function I0(r,A){r=r||10;const e=new Array(r),t=new Array(r);let i=0,s=0,n;return A=A!==void 0?A:1e3,function(a){const l=Date.now(),c=t[s];n||(n=l),e[i]=a,t[i]=l;let u=s,d=0;for(;u!==i;)d+=e[u++],u=u%r;if(i=(i+1)%r,i===s&&(s=(s+1)%r),l-n<A)return;const B=c&&l-c;return B?Math.round(d*1e3/B):void 0}}function M0(r,A){let e=0,t=1e3/A,i,s;const n=(l,c=Date.now())=>{e=c,i=null,s&&(clearTimeout(s),s=null),r(...l)};return[(...l)=>{const c=Date.now(),u=c-e;u>=t?n(l,c):(i=l,s||(s=setTimeout(()=>{s=null,n(i)},t-u)))},()=>i&&n(i)]}const Si=(r,A,e=3)=>{let t=0;const i=I0(50,250);return M0(s=>{const n=s.loaded,o=s.lengthComputable?s.total:void 0,a=n-t,l=i(a),c=n<=o;t=n;const u={loaded:n,total:o,progress:o?n/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-n)/l:void 0,event:s,lengthComputable:o!=null,[A?"download":"upload"]:!0};r(u)},e)},Kl=(r,A)=>{const e=r!=null;return[t=>A[0]({lengthComputable:e,total:r,loaded:t}),A[1]]},Vl=r=>(...A)=>K.asap(()=>r(...A)),D0=pe.hasStandardBrowserEnv?((r,A)=>e=>(e=new URL(e,pe.origin),r.protocol===e.protocol&&r.host===e.host&&(A||r.port===e.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,_0=pe.hasStandardBrowserEnv?{write(r,A,e,t,i,s,n){if(typeof document>"u")return;const o=[`${r}=${encodeURIComponent(A)}`];K.isNumber(e)&&o.push(`expires=${new Date(e).toUTCString()}`),K.isString(t)&&o.push(`path=${t}`),K.isString(i)&&o.push(`domain=${i}`),s===!0&&o.push("secure"),K.isString(n)&&o.push(`SameSite=${n}`),document.cookie=o.join("; ")},read(r){if(typeof document>"u")return null;const A=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)"));return A?decodeURIComponent(A[1]):null},remove(r){this.write(r,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function k0(r){return typeof r!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function O0(r,A){return A?r.replace(/\/?\/$/,"")+"/"+A.replace(/^\/+/,""):r}function Pl(r,A,e){let t=!k0(A);return r&&(t||e==!1)?O0(r,A):A}const zl=r=>r instanceof Ee?{...r}:r;function _t(r,A){A=A||{};const e={};function t(l,c,u,d){return K.isPlainObject(l)&&K.isPlainObject(c)?K.merge.call({caseless:d},l,c):K.isPlainObject(c)?K.merge({},c):K.isArray(c)?c.slice():c}function i(l,c,u,d){if(K.isUndefined(c)){if(!K.isUndefined(l))return t(void 0,l,u,d)}else return t(l,c,u,d)}function s(l,c){if(!K.isUndefined(c))return t(void 0,c)}function n(l,c){if(K.isUndefined(c)){if(!K.isUndefined(l))return t(void 0,l)}else return t(void 0,c)}function o(l,c,u){if(u in A)return t(l,c);if(u in r)return t(void 0,l)}const a={url:s,method:s,data:s,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:o,headers:(l,c,u)=>i(zl(l),zl(c),u,!0)};return K.forEach(Object.keys({...r,...A}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const u=K.hasOwnProp(a,c)?a[c]:i,d=u(r[c],A[c],c);K.isUndefined(d)&&u!==o||(e[c]=d)}),e}const Gl=r=>{const A=_t({},r);let{data:e,withXSRFToken:t,xsrfHeaderName:i,xsrfCookieName:s,headers:n,auth:o}=A;if(A.headers=n=Ee.from(n),A.url=Ml(Pl(A.baseURL,A.url,A.allowAbsoluteUrls),r.params,r.paramsSerializer),o&&n.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),K.isFormData(e)){if(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if(K.isFunction(e.getHeaders)){const a=e.getHeaders(),l=["content-type","content-length"];Object.entries(a).forEach(([c,u])=>{l.includes(c.toLowerCase())&&n.set(c,u)})}}if(pe.hasStandardBrowserEnv&&(t&&K.isFunction(t)&&(t=t(A)),t||t!==!1&&D0(A.url))){const a=i&&s&&_0.read(s);a&&n.set(i,a)}return A},N0=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(e,t){const i=Gl(r);let s=i.data;const n=Ee.from(i.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:l}=i,c,u,d,B,p;function f(){B&&B(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let g=new XMLHttpRequest;g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout;function Q(){if(!g)return;const E=Ee.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),S={data:!o||o==="text"||o==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:E,config:r,request:g};Nl(function(z){e(z),f()},function(z){t(z),f()},S),g=null}"onloadend"in g?g.onloadend=Q:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(Q)},g.onabort=function(){g&&(t(new TA("Request aborted",TA.ECONNABORTED,r,g)),g=null)},g.onerror=function(F){const S=F&&F.message?F.message:"Network Error",P=new TA(S,TA.ERR_NETWORK,r,g);P.event=F||null,t(P),g=null},g.ontimeout=function(){let F=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||xn;i.timeoutErrorMessage&&(F=i.timeoutErrorMessage),t(new TA(F,S.clarifyTimeoutError?TA.ETIMEDOUT:TA.ECONNABORTED,r,g)),g=null},s===void 0&&n.setContentType(null),"setRequestHeader"in g&&K.forEach(n.toJSON(),function(F,S){g.setRequestHeader(S,F)}),K.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),o&&o!=="json"&&(g.responseType=i.responseType),l&&([d,p]=Si(l,!0),g.addEventListener("progress",d)),a&&g.upload&&([u,B]=Si(a),g.upload.addEventListener("progress",u),g.upload.addEventListener("loadend",B)),(i.cancelToken||i.signal)&&(c=E=>{g&&(t(!E||E.type?new Sr(null,r,g):E),g.abort(),g=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const m=L0(i.url);if(m&&pe.protocols.indexOf(m)===-1){t(new TA("Unsupported protocol "+m+":",TA.ERR_BAD_REQUEST,r));return}g.send(s||null)})},K0=(r,A)=>{const{length:e}=r=r?r.filter(Boolean):[];if(A||e){let t=new AbortController,i;const s=function(l){if(!i){i=!0,o();const c=l instanceof Error?l:this.reason;t.abort(c instanceof TA?c:new Sr(c instanceof Error?c.message:c))}};let n=A&&setTimeout(()=>{n=null,s(new TA(`timeout of ${A}ms exceeded`,TA.ETIMEDOUT))},A);const o=()=>{r&&(n&&clearTimeout(n),n=null,r.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),r=null)};r.forEach(l=>l.addEventListener("abort",s));const{signal:a}=t;return a.unsubscribe=()=>K.asap(o),a}},V0=function*(r,A){let e=r.byteLength;if(e<A){yield r;return}let t=0,i;for(;t<e;)i=t+A,yield r.slice(t,i),t=i},P0=async function*(r,A){for await(const e of z0(r))yield*V0(e,A)},z0=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const A=r.getReader();try{for(;;){const{done:e,value:t}=await A.read();if(e)break;yield t}}finally{await A.cancel()}},Rl=(r,A,e,t)=>{const i=P0(r,A);let s=0,n,o=a=>{n||(n=!0,t&&t(a))};return new ReadableStream({async pull(a){try{const{done:l,value:c}=await i.next();if(l){o(),a.close();return}let u=c.byteLength;if(e){let d=s+=u;e(d)}a.enqueue(new Uint8Array(c))}catch(l){throw o(l),l}},cancel(a){return o(a),i.return()}},{highWaterMark:2})},Wl=64*1024,{isFunction:Hi}=K,G0=(({Request:r,Response:A})=>({Request:r,Response:A}))(K.global),{ReadableStream:$l,TextEncoder:Xl}=K.global,Jl=(r,...A)=>{try{return!!r(...A)}catch{return!1}},R0=r=>{r=K.merge.call({skipUndefined:!0},G0,r);const{fetch:A,Request:e,Response:t}=r,i=A?Hi(A):typeof fetch=="function",s=Hi(e),n=Hi(t);if(!i)return!1;const o=i&&Hi($l),a=i&&(typeof Xl=="function"?(p=>f=>p.encode(f))(new Xl):async p=>new Uint8Array(await new e(p).arrayBuffer())),l=s&&o&&Jl(()=>{let p=!1;const f=new e(pe.origin,{body:new $l,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!f}),c=n&&o&&Jl(()=>K.isReadableStream(new t("").body)),u={stream:c&&(p=>p.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!u[p]&&(u[p]=(f,g)=>{let Q=f&&f[p];if(Q)return Q.call(f);throw new TA(`Response type '${p}' is not supported`,TA.ERR_NOT_SUPPORT,g)})});const d=async p=>{if(p==null)return 0;if(K.isBlob(p))return p.size;if(K.isSpecCompliantForm(p))return(await new e(pe.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(K.isArrayBufferView(p)||K.isArrayBuffer(p))return p.byteLength;if(K.isURLSearchParams(p)&&(p=p+""),K.isString(p))return(await a(p)).byteLength},B=async(p,f)=>{const g=K.toFiniteNumber(p.getContentLength());return g??d(f)};return async p=>{let{url:f,method:g,data:Q,signal:m,cancelToken:E,timeout:F,onDownloadProgress:S,onUploadProgress:P,responseType:z,headers:eA,withCredentials:V="same-origin",fetchOptions:Y}=Gl(p),X=A||fetch;z=z?(z+"").toLowerCase():"text";let fA=K0([m,E&&E.toAbortSignal()],F),oA=null;const pA=fA&&fA.unsubscribe&&(()=>{fA.unsubscribe()});let IA;try{if(P&&l&&g!=="get"&&g!=="head"&&(IA=await B(eA,Q))!==0){let CA=new e(f,{method:"POST",body:Q,duplex:"half"}),aA;if(K.isFormData(Q)&&(aA=CA.headers.get("content-type"))&&eA.setContentType(aA),CA.body){const[J,q]=Kl(IA,Si(Vl(P)));Q=Rl(CA.body,Wl,J,q)}}K.isString(V)||(V=V?"include":"omit");const vA=s&&"credentials"in e.prototype,MA={...Y,signal:fA,method:g.toUpperCase(),headers:eA.normalize().toJSON(),body:Q,duplex:"half",credentials:vA?V:void 0};oA=s&&new e(f,MA);let SA=await(s?X(oA,Y):X(f,MA));const UA=c&&(z==="stream"||z==="response");if(c&&(S||UA&&pA)){const CA={};["status","statusText","headers"].forEach(yA=>{CA[yA]=SA[yA]});const aA=K.toFiniteNumber(SA.headers.get("content-length")),[J,q]=S&&Kl(aA,Si(Vl(S),!0))||[];SA=new t(Rl(SA.body,Wl,J,()=>{q&&q(),pA&&pA()}),CA)}z=z||"text";let bA=await u[K.findKey(u,z)||"text"](SA,p);return!UA&&pA&&pA(),await new Promise((CA,aA)=>{Nl(CA,aA,{data:bA,headers:Ee.from(SA.headers),status:SA.status,statusText:SA.statusText,config:p,request:oA})})}catch(vA){throw pA&&pA(),vA&&vA.name==="TypeError"&&/Load failed|fetch/i.test(vA.message)?Object.assign(new TA("Network Error",TA.ERR_NETWORK,p,oA,vA&&vA.response),{cause:vA.cause||vA}):TA.from(vA,vA&&vA.code,p,oA,vA&&vA.response)}}},W0=new Map,Zl=r=>{let A=r&&r.env||{};const{fetch:e,Request:t,Response:i}=A,s=[t,i,e];let n=s.length,o=n,a,l,c=W0;for(;o--;)a=s[o],l=c.get(a),l===void 0&&c.set(a,l=o?new Map:R0(A)),c=l;return l};Zl();const In={http:f0,xhr:N0,fetch:{get:Zl}};K.forEach(In,(r,A)=>{if(r){try{Object.defineProperty(r,"name",{value:A})}catch{}Object.defineProperty(r,"adapterName",{value:A})}});const Yl=r=>`- ${r}`,$0=r=>K.isFunction(r)||r===null||r===!1;function X0(r,A){r=K.isArray(r)?r:[r];const{length:e}=r;let t,i;const s={};for(let n=0;n<e;n++){t=r[n];let o;if(i=t,!$0(t)&&(i=In[(o=String(t)).toLowerCase()],i===void 0))throw new TA(`Unknown adapter '${o}'`);if(i&&(K.isFunction(i)||(i=i.get(A))))break;s[o||"#"+n]=i}if(!i){const n=Object.entries(s).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?n.length>1?`since :
1
+ (function(DA,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],h):(DA=typeof globalThis<"u"?globalThis:DA||self,h(DA.ChartSDK={},DA.jsxRuntime,DA.React))})(this,(function(DA,h,K){"use strict";var Ns=typeof document<"u"?document.currentScript:null;function WA(r){var A=r.width,e=r.height;if(A<0)throw new Error("Negative width is not allowed for Size");if(e<0)throw new Error("Negative height is not allowed for Size");return{width:A,height:e}}function Tt(r,A){return r.width===A.width&&r.height===A.height}var Ad=(function(){function r(A){var e=this;this._resolutionListener=function(){return e._onResolutionChanged()},this._resolutionMediaQueryList=null,this._observers=[],this._window=A,this._installResolutionListener()}return r.prototype.dispose=function(){this._uninstallResolutionListener(),this._window=null},Object.defineProperty(r.prototype,"value",{get:function(){return this._window.devicePixelRatio},enumerable:!1,configurable:!0}),r.prototype.subscribe=function(A){var e=this,t={next:A};return this._observers.push(t),{unsubscribe:function(){e._observers=e._observers.filter(function(i){return i!==t})}}},r.prototype._installResolutionListener=function(){if(this._resolutionMediaQueryList!==null)throw new Error("Resolution listener is already installed");var A=this._window.devicePixelRatio;this._resolutionMediaQueryList=this._window.matchMedia("all and (resolution: ".concat(A,"dppx)")),this._resolutionMediaQueryList.addListener(this._resolutionListener)},r.prototype._uninstallResolutionListener=function(){this._resolutionMediaQueryList!==null&&(this._resolutionMediaQueryList.removeListener(this._resolutionListener),this._resolutionMediaQueryList=null)},r.prototype._reinstallResolutionListener=function(){this._uninstallResolutionListener(),this._installResolutionListener()},r.prototype._onResolutionChanged=function(){var A=this;this._observers.forEach(function(e){return e.next(A._window.devicePixelRatio)}),this._reinstallResolutionListener()},r})();function ed(r){return new Ad(r)}var td=(function(){function r(A,e,t){var i;this._canvasElement=null,this._bitmapSizeChangedListeners=[],this._suggestedBitmapSize=null,this._suggestedBitmapSizeChangedListeners=[],this._devicePixelRatioObservable=null,this._canvasElementResizeObserver=null,this._canvasElement=A,this._canvasElementClientSize=WA({width:this._canvasElement.clientWidth,height:this._canvasElement.clientHeight}),this._transformBitmapSize=e??(function(s){return s}),this._allowResizeObserver=(i=t?.allowResizeObserver)!==null&&i!==void 0?i:!0,this._chooseAndInitObserver()}return r.prototype.dispose=function(){var A,e;if(this._canvasElement===null)throw new Error("Object is disposed");(A=this._canvasElementResizeObserver)===null||A===void 0||A.disconnect(),this._canvasElementResizeObserver=null,(e=this._devicePixelRatioObservable)===null||e===void 0||e.dispose(),this._devicePixelRatioObservable=null,this._suggestedBitmapSizeChangedListeners.length=0,this._bitmapSizeChangedListeners.length=0,this._canvasElement=null},Object.defineProperty(r.prototype,"canvasElement",{get:function(){if(this._canvasElement===null)throw new Error("Object is disposed");return this._canvasElement},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canvasElementClientSize",{get:function(){return this._canvasElementClientSize},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bitmapSize",{get:function(){return WA({width:this.canvasElement.width,height:this.canvasElement.height})},enumerable:!1,configurable:!0}),r.prototype.resizeCanvasElement=function(A){this._canvasElementClientSize=WA(A),this.canvasElement.style.width="".concat(this._canvasElementClientSize.width,"px"),this.canvasElement.style.height="".concat(this._canvasElementClientSize.height,"px"),this._invalidateBitmapSize()},r.prototype.subscribeBitmapSizeChanged=function(A){this._bitmapSizeChangedListeners.push(A)},r.prototype.unsubscribeBitmapSizeChanged=function(A){this._bitmapSizeChangedListeners=this._bitmapSizeChangedListeners.filter(function(e){return e!==A})},Object.defineProperty(r.prototype,"suggestedBitmapSize",{get:function(){return this._suggestedBitmapSize},enumerable:!1,configurable:!0}),r.prototype.subscribeSuggestedBitmapSizeChanged=function(A){this._suggestedBitmapSizeChangedListeners.push(A)},r.prototype.unsubscribeSuggestedBitmapSizeChanged=function(A){this._suggestedBitmapSizeChangedListeners=this._suggestedBitmapSizeChangedListeners.filter(function(e){return e!==A})},r.prototype.applySuggestedBitmapSize=function(){if(this._suggestedBitmapSize!==null){var A=this._suggestedBitmapSize;this._suggestedBitmapSize=null,this._resizeBitmap(A),this._emitSuggestedBitmapSizeChanged(A,this._suggestedBitmapSize)}},r.prototype._resizeBitmap=function(A){var e=this.bitmapSize;Tt(e,A)||(this.canvasElement.width=A.width,this.canvasElement.height=A.height,this._emitBitmapSizeChanged(e,A))},r.prototype._emitBitmapSizeChanged=function(A,e){var t=this;this._bitmapSizeChangedListeners.forEach(function(i){return i.call(t,A,e)})},r.prototype._suggestNewBitmapSize=function(A){var e=this._suggestedBitmapSize,t=WA(this._transformBitmapSize(A,this._canvasElementClientSize)),i=Tt(this.bitmapSize,t)?null:t;e===null&&i===null||e!==null&&i!==null&&Tt(e,i)||(this._suggestedBitmapSize=i,this._emitSuggestedBitmapSizeChanged(e,i))},r.prototype._emitSuggestedBitmapSizeChanged=function(A,e){var t=this;this._suggestedBitmapSizeChangedListeners.forEach(function(i){return i.call(t,A,e)})},r.prototype._chooseAndInitObserver=function(){var A=this;if(!this._allowResizeObserver){this._initDevicePixelRatioObservable();return}id().then(function(e){return e?A._initResizeObserver():A._initDevicePixelRatioObservable()})},r.prototype._initDevicePixelRatioObservable=function(){var A=this;if(this._canvasElement!==null){var e=Aa(this._canvasElement);if(e===null)throw new Error("No window is associated with the canvas");this._devicePixelRatioObservable=ed(e),this._devicePixelRatioObservable.subscribe(function(){return A._invalidateBitmapSize()}),this._invalidateBitmapSize()}},r.prototype._invalidateBitmapSize=function(){var A,e;if(this._canvasElement!==null){var t=Aa(this._canvasElement);if(t!==null){var i=(e=(A=this._devicePixelRatioObservable)===null||A===void 0?void 0:A.value)!==null&&e!==void 0?e:t.devicePixelRatio,s=this._canvasElement.getClientRects(),n=s[0]!==void 0?sd(s[0],i):WA({width:this._canvasElementClientSize.width*i,height:this._canvasElementClientSize.height*i});this._suggestNewBitmapSize(n)}}},r.prototype._initResizeObserver=function(){var A=this;this._canvasElement!==null&&(this._canvasElementResizeObserver=new ResizeObserver(function(e){var t=e.find(function(n){return n.target===A._canvasElement});if(!(!t||!t.devicePixelContentBoxSize||!t.devicePixelContentBoxSize[0])){var i=t.devicePixelContentBoxSize[0],s=WA({width:i.inlineSize,height:i.blockSize});A._suggestNewBitmapSize(s)}}),this._canvasElementResizeObserver.observe(this._canvasElement,{box:"device-pixel-content-box"}))},r})();function rd(r,A){return new td(r,A.transform,A.options)}function Aa(r){return r.ownerDocument.defaultView}function id(){return new Promise(function(r){var A=new ResizeObserver(function(e){r(e.every(function(t){return"devicePixelContentBoxSize"in t})),A.disconnect()});A.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})}function sd(r,A){return WA({width:Math.round(r.left*A+r.width*A)-Math.round(r.left*A),height:Math.round(r.top*A+r.height*A)-Math.round(r.top*A)})}var nd=(function(){function r(A,e,t){if(e.width===0||e.height===0)throw new TypeError("Rendering target could only be created on a media with positive width and height");if(this._mediaSize=e,t.width===0||t.height===0)throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");this._bitmapSize=t,this._context=A}return r.prototype.useMediaCoordinateSpace=function(A){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),this._context.scale(this._horizontalPixelRatio,this._verticalPixelRatio),A({context:this._context,mediaSize:this._mediaSize})}finally{this._context.restore()}},r.prototype.useBitmapCoordinateSpace=function(A){try{return this._context.save(),this._context.setTransform(1,0,0,1,0,0),A({context:this._context,mediaSize:this._mediaSize,bitmapSize:this._bitmapSize,horizontalPixelRatio:this._horizontalPixelRatio,verticalPixelRatio:this._verticalPixelRatio})}finally{this._context.restore()}},Object.defineProperty(r.prototype,"_horizontalPixelRatio",{get:function(){return this._bitmapSize.width/this._mediaSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"_verticalPixelRatio",{get:function(){return this._bitmapSize.height/this._mediaSize.height},enumerable:!1,configurable:!0}),r})();function St(r,A){var e=r.canvasElementClientSize;if(e.width===0||e.height===0)return null;var t=r.bitmapSize;if(t.width===0||t.height===0)return null;var i=r.canvasElement.getContext("2d",A);return i===null?null:new nd(i,e,t)}const od={upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},ad={upColor:"#26a69a",downColor:"#ef5350",openVisible:!0,thinBars:!0},ld={color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},cd={topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},hd={baseValue:{type:"price",price:0},topFillColor1:"rgba(38, 166, 154, 0.28)",topFillColor2:"rgba(38, 166, 154, 0.05)",topLineColor:"rgba(38, 166, 154, 1)",bottomFillColor1:"rgba(239, 83, 80, 0.05)",bottomFillColor2:"rgba(239, 83, 80, 0.28)",bottomLineColor:"rgba(239, 83, 80, 1)",lineWidth:3,lineStyle:0,lineType:0,lineVisible:!0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0,pointMarkersVisible:!1},ud={color:"#26a69a",base:0},ea={color:"#2196f3"},ta={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};var ra,ia;function Ht(r,A){const e={0:[],1:[r.lineWidth,r.lineWidth],2:[2*r.lineWidth,2*r.lineWidth],3:[6*r.lineWidth,6*r.lineWidth],4:[r.lineWidth,4*r.lineWidth]}[A];r.setLineDash(e)}function sa(r,A,e,t){r.beginPath();const i=r.lineWidth%2?.5:0;r.moveTo(e,A+i),r.lineTo(t,A+i),r.stroke()}function Bt(r,A){if(!r)throw new Error("Assertion failed"+(A?": "+A:""))}function ve(r){if(r===void 0)throw new Error("Value is undefined");return r}function tA(r){if(r===null)throw new Error("Value is null");return r}function Rt(r){return tA(ve(r))}(function(r){r[r.Simple=0]="Simple",r[r.WithSteps=1]="WithSteps",r[r.Curved=2]="Curved"})(ra||(ra={})),(function(r){r[r.Solid=0]="Solid",r[r.Dotted=1]="Dotted",r[r.Dashed=2]="Dashed",r[r.LargeDashed=3]="LargeDashed",r[r.SparseDotted=4]="SparseDotted"})(ia||(ia={}));const na={khaki:"#f0e68c",azure:"#f0ffff",aliceblue:"#f0f8ff",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",gray:"#808080",green:"#008000",honeydew:"#f0fff0",floralwhite:"#fffaf0",lightblue:"#add8e6",lightcoral:"#f08080",lemonchiffon:"#fffacd",hotpink:"#ff69b4",lightyellow:"#ffffe0",greenyellow:"#adff2f",lightgoldenrodyellow:"#fafad2",limegreen:"#32cd32",linen:"#faf0e6",lightcyan:"#e0ffff",magenta:"#f0f",maroon:"#800000",olive:"#808000",orange:"#ffa500",oldlace:"#fdf5e6",mediumblue:"#0000cd",transparent:"#0000",lime:"#0f0",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",midnightblue:"#191970",orchid:"#da70d6",mediumorchid:"#ba55d3",mediumturquoise:"#48d1cc",orangered:"#ff4500",royalblue:"#4169e1",powderblue:"#b0e0e6",red:"#f00",coral:"#ff7f50",turquoise:"#40e0d0",white:"#fff",whitesmoke:"#f5f5f5",wheat:"#f5deb3",teal:"#008080",steelblue:"#4682b4",bisque:"#ffe4c4",aquamarine:"#7fffd4",aqua:"#0ff",sienna:"#a0522d",silver:"#c0c0c0",springgreen:"#00ff7f",antiquewhite:"#faebd7",burlywood:"#deb887",brown:"#a52a2a",beige:"#f5f5dc",chocolate:"#d2691e",chartreuse:"#7fff00",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cadetblue:"#5f9ea0",tomato:"#ff6347",fuchsia:"#f0f",blue:"#00f",salmon:"#fa8072",blanchedalmond:"#ffebcd",slateblue:"#6a5acd",slategray:"#708090",thistle:"#d8bfd8",tan:"#d2b48c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",blueviolet:"#8a2be2",black:"#000",darkmagenta:"#8b008b",darkslateblue:"#483d8b",darkkhaki:"#bdb76b",darkorchid:"#9932cc",darkorange:"#ff8c00",darkgreen:"#006400",darkred:"#8b0000",dodgerblue:"#1e90ff",darkslategray:"#2f4f4f",dimgray:"#696969",deepskyblue:"#00bfff",firebrick:"#b22222",forestgreen:"#228b22",indigo:"#4b0082",ivory:"#fffff0",lavenderblush:"#fff0f5",feldspar:"#d19275",indianred:"#cd5c5c",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightskyblue:"#87cefa",lightslategray:"#789",lightslateblue:"#8470ff",snow:"#fffafa",lightseagreen:"#20b2aa",lightsalmon:"#ffa07a",darksalmon:"#e9967a",darkviolet:"#9400d3",mediumpurple:"#9370d8",mediumaquamarine:"#66cdaa",skyblue:"#87ceeb",lavender:"#e6e6fa",lightsteelblue:"#b0c4de",mediumvioletred:"#c71585",mintcream:"#f5fffa",navajowhite:"#ffdead",navy:"#000080",olivedrab:"#6b8e23",palevioletred:"#d87093",violetred:"#d02090",yellow:"#ff0",yellowgreen:"#9acd32",lawngreen:"#7cfc00",pink:"#ffc0cb",paleturquoise:"#afeeee",palegoldenrod:"#eee8aa",darkolivegreen:"#556b2f",darkseagreen:"#8fbc8f",darkturquoise:"#00ced1",peachpuff:"#ffdab9",deeppink:"#ff1493",violet:"#ee82ee",palegreen:"#98fb98",mediumseagreen:"#3cb371",peru:"#cd853f",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",purple:"#800080",seagreen:"#2e8b57",seashell:"#fff5ee",papayawhip:"#ffefd5",mediumslateblue:"#7b68ee",plum:"#dda0dd",mediumspringgreen:"#00fa9a"};function ke(r){return r<0?0:r>255?255:Math.round(r)||0}function oa(r){return r<=0||r>1?Math.min(Math.max(r,0),1):Math.round(1e4*r)/1e4}const dd=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,fd=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,pd=/^rgb\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*\)$/,gd=/^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d*\.?\d+)\s*\)$/;function dr(r){(r=r.toLowerCase())in na&&(r=na[r]);{const A=gd.exec(r)||pd.exec(r);if(A)return[ke(parseInt(A[1],10)),ke(parseInt(A[2],10)),ke(parseInt(A[3],10)),oa(A.length<5?1:parseFloat(A[4]))]}{const A=fd.exec(r);if(A)return[ke(parseInt(A[1],16)),ke(parseInt(A[2],16)),ke(parseInt(A[3],16)),1]}{const A=dd.exec(r);if(A)return[ke(17*parseInt(A[1],16)),ke(17*parseInt(A[2],16)),ke(17*parseInt(A[3],16)),1]}throw new Error(`Cannot parse color: ${r}`)}function aa(r){return .199*r[0]+.687*r[1]+.114*r[2]}function si(r){const A=dr(r);return{t:`rgb(${A[0]}, ${A[1]}, ${A[2]})`,i:aa(A)>160?"black":"white"}}class ee{constructor(){this.h=[]}l(A,e,t){const i={o:A,_:e,u:t===!0};this.h.push(i)}v(A){const e=this.h.findIndex((t=>A===t.o));e>-1&&this.h.splice(e,1)}p(A){this.h=this.h.filter((e=>e._!==A))}m(A,e,t){const i=[...this.h];this.h=this.h.filter((s=>!s.u)),i.forEach((s=>s.o(A,e,t)))}M(){return this.h.length>0}S(){this.h=[]}}function Ge(r,...A){for(const e of A)for(const t in e)e[t]!==void 0&&Object.prototype.hasOwnProperty.call(e,t)&&!["__proto__","constructor","prototype"].includes(t)&&(typeof e[t]!="object"||r[t]===void 0||Array.isArray(e[t])?r[t]=e[t]:Ge(r[t],e[t]));return r}function Ze(r){return typeof r=="number"&&isFinite(r)}function fr(r){return typeof r=="number"&&r%1==0}function pr(r){return typeof r=="string"}function ni(r){return typeof r=="boolean"}function ot(r){const A=r;if(!A||typeof A!="object")return A;let e,t,i;for(t in e=Array.isArray(A)?[]:{},A)A.hasOwnProperty(t)&&(i=A[t],e[t]=i&&typeof i=="object"?ot(i):i);return e}function Bd(r){return r!==null}function gr(r){return r===null?void 0:r}const Ks="-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";function Wt(r,A,e){return A===void 0&&(A=Ks),`${e=e!==void 0?`${e} `:""}${r}px ${A}`}class wd{constructor(A){this.k={C:1,T:5,P:NaN,R:"",D:"",V:"",O:"",B:0,A:0,I:0,L:0,N:0},this.F=A}W(){const A=this.k,e=this.j(),t=this.H();return A.P===e&&A.D===t||(A.P=e,A.D=t,A.R=Wt(e,t),A.L=2.5/12*e,A.B=A.L,A.A=e/12*A.T,A.I=e/12*A.T,A.N=0),A.V=this.$(),A.O=this.U(),this.k}$(){return this.F.W().layout.textColor}U(){return this.F.q()}j(){return this.F.W().layout.fontSize}H(){return this.F.W().layout.fontFamily}}class Vs{constructor(){this.Y=[]}Z(A){this.Y=A}X(A,e,t){this.Y.forEach((i=>{i.X(A,e,t)}))}}class Re{X(A,e,t){A.useBitmapCoordinateSpace((i=>this.K(i,e,t)))}}class md extends Re{constructor(){super(...arguments),this.G=null}J(A){this.G=A}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t}){if(this.G===null||this.G.tt===null)return;const i=this.G.tt,s=this.G,n=Math.max(1,Math.floor(e))%2/2,o=a=>{A.beginPath();for(let l=i.to-1;l>=i.from;--l){const c=s.it[l],u=Math.round(c.nt*e)+n,d=c.st*t,B=a*t+n;A.moveTo(u,d),A.arc(u,d,B,0,2*Math.PI)}A.fill()};s.et>0&&(A.fillStyle=s.rt,o(s.ht+s.et)),A.fillStyle=s.lt,o(s.ht)}}function Cd(){return{it:[{nt:0,st:0,ot:0,_t:0}],lt:"",rt:"",ht:0,et:0,tt:null}}const vd={from:0,to:1};class bd{constructor(A,e){this.ut=new Vs,this.ct=[],this.dt=[],this.ft=!0,this.F=A,this.vt=e,this.ut.Z(this.ct)}bt(A){const e=this.F.wt();e.length!==this.ct.length&&(this.dt=e.map(Cd),this.ct=this.dt.map((t=>{const i=new md;return i.J(t),i})),this.ut.Z(this.ct)),this.ft=!0}gt(){return this.ft&&(this.Mt(),this.ft=!1),this.ut}Mt(){const A=this.vt.W().mode===2,e=this.F.wt(),t=this.vt.xt(),i=this.F.St();e.forEach(((s,n)=>{var o;const a=this.dt[n],l=s.kt(t);if(A||l===null||!s.yt())return void(a.tt=null);const c=tA(s.Ct());a.lt=l.Tt,a.ht=l.ht,a.et=l.Pt,a.it[0]._t=l._t,a.it[0].st=s.Dt().Rt(l._t,c.Vt),a.rt=(o=l.Ot)!==null&&o!==void 0?o:this.F.Bt(a.it[0].st/s.Dt().At()),a.it[0].ot=t,a.it[0].nt=i.It(t),a.tt=vd}))}}let yd=class extends Re{constructor(A){super(),this.zt=A}K({context:A,bitmapSize:e,horizontalPixelRatio:t,verticalPixelRatio:i}){if(this.zt===null)return;const s=this.zt.Lt.yt,n=this.zt.Et.yt;if(!s&&!n)return;const o=Math.round(this.zt.nt*t),a=Math.round(this.zt.st*i);A.lineCap="butt",s&&o>=0&&(A.lineWidth=Math.floor(this.zt.Lt.et*t),A.strokeStyle=this.zt.Lt.V,A.fillStyle=this.zt.Lt.V,Ht(A,this.zt.Lt.Nt),(function(l,c,u,d){l.beginPath();const B=l.lineWidth%2?.5:0;l.moveTo(c+B,u),l.lineTo(c+B,d),l.stroke()})(A,o,0,e.height)),n&&a>=0&&(A.lineWidth=Math.floor(this.zt.Et.et*i),A.strokeStyle=this.zt.Et.V,A.fillStyle=this.zt.Et.V,Ht(A,this.zt.Et.Nt),sa(A,a,0,e.width))}};class Qd{constructor(A){this.ft=!0,this.Ft={Lt:{et:1,Nt:0,V:"",yt:!1},Et:{et:1,Nt:0,V:"",yt:!1},nt:0,st:0},this.Wt=new yd(this.Ft),this.jt=A}bt(){this.ft=!0}gt(){return this.ft&&(this.Mt(),this.ft=!1),this.Wt}Mt(){const A=this.jt.yt(),e=tA(this.jt.Ht()),t=e.$t().W().crosshair,i=this.Ft;if(t.mode===2)return i.Et.yt=!1,void(i.Lt.yt=!1);i.Et.yt=A&&this.jt.Ut(e),i.Lt.yt=A&&this.jt.qt(),i.Et.et=t.horzLine.width,i.Et.Nt=t.horzLine.style,i.Et.V=t.horzLine.color,i.Lt.et=t.vertLine.width,i.Lt.Nt=t.vertLine.style,i.Lt.V=t.vertLine.color,i.nt=this.jt.Yt(),i.st=this.jt.Zt()}}function Fd(r,A,e,t,i,s){r.fillRect(A+s,e,t-2*s,s),r.fillRect(A+s,e+i-s,t-2*s,s),r.fillRect(A,e,s,i),r.fillRect(A+t-s,e,s,i)}function oi(r,A,e,t,i,s){r.save(),r.globalCompositeOperation="copy",r.fillStyle=s,r.fillRect(A,e,t,i),r.restore()}function la(r,A,e,t,i,s){r.beginPath(),r.roundRect?r.roundRect(A,e,t,i,s):(r.lineTo(A+t-s[1],e),s[1]!==0&&r.arcTo(A+t,e,A+t,e+s[1],s[1]),r.lineTo(A+t,e+i-s[2]),s[2]!==0&&r.arcTo(A+t,e+i,A+t-s[2],e+i,s[2]),r.lineTo(A+s[3],e+i),s[3]!==0&&r.arcTo(A,e+i,A,e+i-s[3],s[3]),r.lineTo(A,e+s[0]),s[0]!==0&&r.arcTo(A,e,A+s[0],e,s[0]))}function ca(r,A,e,t,i,s,n=0,o=[0,0,0,0],a=""){if(r.save(),!n||!a||a===s)return la(r,A,e,t,i,o),r.fillStyle=s,r.fill(),void r.restore();const l=n/2;var c;la(r,A+l,e+l,t-n,i-n,(c=-l,o.map((u=>u===0?u:u+c)))),s!=="transparent"&&(r.fillStyle=s,r.fill()),a!=="transparent"&&(r.lineWidth=n,r.strokeStyle=a,r.closePath(),r.stroke()),r.restore()}function ha(r,A,e,t,i,s,n){r.save(),r.globalCompositeOperation="copy";const o=r.createLinearGradient(0,0,0,i);o.addColorStop(0,s),o.addColorStop(1,n),r.fillStyle=o,r.fillRect(A,e,t,i),r.restore()}class ua{constructor(A,e){this.J(A,e)}J(A,e){this.zt=A,this.Xt=e}At(A,e){return this.zt.yt?A.P+A.L+A.B:0}X(A,e,t,i){if(!this.zt.yt||this.zt.Kt.length===0)return;const s=this.zt.V,n=this.Xt.t,o=A.useBitmapCoordinateSpace((a=>{const l=a.context;l.font=e.R;const c=this.Gt(a,e,t,i),u=c.Jt;return c.Qt?ca(l,u.ti,u.ii,u.ni,u.si,n,u.ei,[u.ht,0,0,u.ht],n):ca(l,u.ri,u.ii,u.ni,u.si,n,u.ei,[0,u.ht,u.ht,0],n),this.zt.hi&&(l.fillStyle=s,l.fillRect(u.ri,u.li,u.ai-u.ri,u.oi)),this.zt._i&&(l.fillStyle=e.O,l.fillRect(c.Qt?u.ui-u.ei:0,u.ii,u.ei,u.ci-u.ii)),c}));A.useMediaCoordinateSpace((({context:a})=>{const l=o.di;a.font=e.R,a.textAlign=o.Qt?"right":"left",a.textBaseline="middle",a.fillStyle=s,a.fillText(this.zt.Kt,l.fi,(l.ii+l.ci)/2+l.pi)}))}Gt(A,e,t,i){var s;const{context:n,bitmapSize:o,mediaSize:a,horizontalPixelRatio:l,verticalPixelRatio:c}=A,u=this.zt.hi||!this.zt.mi?e.T:0,d=this.zt.bi?e.C:0,B=e.L+this.Xt.wi,p=e.B+this.Xt.gi,f=e.A,w=e.I,F=this.zt.Kt,C=e.P,E=t.Mi(n,F),U=Math.ceil(t.xi(n,F)),S=C+B+p,P=e.C+f+w+U+u,z=Math.max(1,Math.floor(c));let J=Math.round(S*c);J%2!=z%2&&(J+=1);const N=d>0?Math.max(1,Math.floor(d*l)):0,Z=Math.round(P*l),W=Math.round(u*l),aA=(s=this.Xt.Si)!==null&&s!==void 0?s:this.Xt.ki,nA=Math.round(aA*c)-Math.floor(.5*c),cA=Math.floor(nA+z/2-J/2),SA=cA+J,CA=i==="right",MA=CA?a.width-d:d,HA=CA?o.width-N:N;let UA,yA,vA;return CA?(UA=HA-Z,yA=HA-W,vA=MA-u-f-d):(UA=HA+Z,yA=HA+W,vA=MA+u+f),{Qt:CA,Jt:{ii:cA,li:nA,ci:SA,ni:Z,si:J,ht:2*l,ei:N,ti:UA,ri:HA,ai:yA,oi:z,ui:o.width},di:{ii:cA/c,ci:SA/c,fi:vA,pi:E}}}}class ai{constructor(A){this.yi={ki:0,t:"#000",gi:0,wi:0},this.Ci={Kt:"",yt:!1,hi:!0,mi:!1,Ot:"",V:"#FFF",_i:!1,bi:!1},this.Ti={Kt:"",yt:!1,hi:!1,mi:!0,Ot:"",V:"#FFF",_i:!0,bi:!0},this.ft=!0,this.Pi=new(A||ua)(this.Ci,this.yi),this.Ri=new(A||ua)(this.Ti,this.yi)}Kt(){return this.Di(),this.Ci.Kt}ki(){return this.Di(),this.yi.ki}bt(){this.ft=!0}At(A,e=!1){return Math.max(this.Pi.At(A,e),this.Ri.At(A,e))}Vi(){return this.yi.Si||0}Oi(A){this.yi.Si=A}Bi(){return this.Di(),this.Ci.yt||this.Ti.yt}Ai(){return this.Di(),this.Ci.yt}gt(A){return this.Di(),this.Ci.hi=this.Ci.hi&&A.W().ticksVisible,this.Ti.hi=this.Ti.hi&&A.W().ticksVisible,this.Pi.J(this.Ci,this.yi),this.Ri.J(this.Ti,this.yi),this.Pi}Ii(){return this.Di(),this.Pi.J(this.Ci,this.yi),this.Ri.J(this.Ti,this.yi),this.Ri}Di(){this.ft&&(this.Ci.hi=!0,this.Ti.hi=!1,this.zi(this.Ci,this.Ti,this.yi))}}class Ud extends ai{constructor(A,e,t){super(),this.jt=A,this.Li=e,this.Ei=t}zi(A,e,t){if(A.yt=!1,this.jt.W().mode===2)return;const i=this.jt.W().horzLine;if(!i.labelVisible)return;const s=this.Li.Ct();if(!this.jt.yt()||this.Li.Ni()||s===null)return;const n=si(i.labelBackgroundColor);t.t=n.t,A.V=n.i;const o=2/12*this.Li.P();t.wi=o,t.gi=o;const a=this.Ei(this.Li);t.ki=a.ki,A.Kt=this.Li.Fi(a._t,s),A.yt=!0}}const Ed=/[1-9]/g;class da{constructor(){this.zt=null}J(A){this.zt=A}X(A,e){if(this.zt===null||this.zt.yt===!1||this.zt.Kt.length===0)return;const t=A.useMediaCoordinateSpace((({context:d})=>(d.font=e.R,Math.round(e.Wi.xi(d,tA(this.zt).Kt,Ed)))));if(t<=0)return;const i=e.ji,s=t+2*i,n=s/2,o=this.zt.Hi;let a=this.zt.ki,l=Math.floor(a-n)+.5;l<0?(a+=Math.abs(0-l),l=Math.floor(a-n)+.5):l+s>o&&(a-=Math.abs(o-(l+s)),l=Math.floor(a-n)+.5);const c=l+s,u=Math.ceil(0+e.C+e.T+e.L+e.P+e.B);A.useBitmapCoordinateSpace((({context:d,horizontalPixelRatio:B,verticalPixelRatio:p})=>{const f=tA(this.zt);d.fillStyle=f.t;const w=Math.round(l*B),F=Math.round(0*p),C=Math.round(c*B),E=Math.round(u*p),U=Math.round(2*B);if(d.beginPath(),d.moveTo(w,F),d.lineTo(w,E-U),d.arcTo(w,E,w+U,E,U),d.lineTo(C-U,E),d.arcTo(C,E,C,E-U,U),d.lineTo(C,F),d.fill(),f.hi){const S=Math.round(f.ki*B),P=F,z=Math.round((P+e.T)*p);d.fillStyle=f.V;const J=Math.max(1,Math.floor(B)),N=Math.floor(.5*B);d.fillRect(S-N,P,J,z-P)}})),A.useMediaCoordinateSpace((({context:d})=>{const B=tA(this.zt),p=0+e.C+e.T+e.L+e.P/2;d.font=e.R,d.textAlign="left",d.textBaseline="middle",d.fillStyle=B.V;const f=e.Wi.Mi(d,"Apr0");d.translate(l+i,p+f),d.fillText(B.Kt,0,0)}))}}class xd{constructor(A,e,t){this.ft=!0,this.Wt=new da,this.Ft={yt:!1,t:"#4c525e",V:"white",Kt:"",Hi:0,ki:NaN,hi:!0},this.vt=A,this.$i=e,this.Ei=t}bt(){this.ft=!0}gt(){return this.ft&&(this.Mt(),this.ft=!1),this.Wt.J(this.Ft),this.Wt}Mt(){const A=this.Ft;if(A.yt=!1,this.vt.W().mode===2)return;const e=this.vt.W().vertLine;if(!e.labelVisible)return;const t=this.$i.St();if(t.Ni())return;A.Hi=t.Hi();const i=this.Ei();if(i===null)return;A.ki=i.ki;const s=t.Ui(this.vt.xt());A.Kt=t.qi(tA(s)),A.yt=!0;const n=si(e.labelBackgroundColor);A.t=n.t,A.V=n.i,A.hi=t.W().ticksVisible}}class Ps{constructor(){this.Yi=null,this.Zi=0}Xi(){return this.Zi}Ki(A){this.Zi=A}Dt(){return this.Yi}Gi(A){this.Yi=A}Ji(A){return[]}Qi(){return[]}yt(){return!0}}var fa;(function(r){r[r.Normal=0]="Normal",r[r.Magnet=1]="Magnet",r[r.Hidden=2]="Hidden"})(fa||(fa={}));class Td extends Ps{constructor(A,e){super(),this.tn=null,this.nn=NaN,this.sn=0,this.en=!0,this.rn=new Map,this.hn=!1,this.ln=NaN,this.an=NaN,this._n=NaN,this.un=NaN,this.$i=A,this.cn=e,this.dn=new bd(A,this),this.fn=((i,s)=>n=>{const o=s(),a=i();if(n===tA(this.tn).vn())return{_t:a,ki:o};{const l=tA(n.Ct());return{_t:n.pn(o,l),ki:o}}})((()=>this.nn),(()=>this.an));const t=((i,s)=>()=>{const n=this.$i.St().mn(i()),o=s();return n&&Number.isFinite(o)?{ot:n,ki:o}:null})((()=>this.sn),(()=>this.Yt()));this.bn=new xd(this,A,t),this.wn=new Qd(this)}W(){return this.cn}gn(A,e){this._n=A,this.un=e}Mn(){this._n=NaN,this.un=NaN}xn(){return this._n}Sn(){return this.un}kn(A,e,t){this.hn||(this.hn=!0),this.en=!0,this.yn(A,e,t)}xt(){return this.sn}Yt(){return this.ln}Zt(){return this.an}yt(){return this.en}Cn(){this.en=!1,this.Tn(),this.nn=NaN,this.ln=NaN,this.an=NaN,this.tn=null,this.Mn()}Pn(A){return this.tn!==null?[this.wn,this.dn]:[]}Ut(A){return A===this.tn&&this.cn.horzLine.visible}qt(){return this.cn.vertLine.visible}Rn(A,e){this.en&&this.tn===A||this.rn.clear();const t=[];return this.tn===A&&t.push(this.Dn(this.rn,e,this.fn)),t}Qi(){return this.en?[this.bn]:[]}Ht(){return this.tn}Vn(){this.wn.bt(),this.rn.forEach((A=>A.bt())),this.bn.bt(),this.dn.bt()}On(A){return A&&!A.vn().Ni()?A.vn():null}yn(A,e,t){this.Bn(A,e,t)&&this.Vn()}Bn(A,e,t){const i=this.ln,s=this.an,n=this.nn,o=this.sn,a=this.tn,l=this.On(t);this.sn=A,this.ln=isNaN(A)?NaN:this.$i.St().It(A),this.tn=t;const c=l!==null?l.Ct():null;return l!==null&&c!==null?(this.nn=e,this.an=l.Rt(e,c)):(this.nn=NaN,this.an=NaN),i!==this.ln||s!==this.an||o!==this.sn||n!==this.nn||a!==this.tn}Tn(){const A=this.$i.wt().map((t=>t.In().An())).filter(Bd),e=A.length===0?null:Math.max(...A);this.sn=e!==null?e:NaN}Dn(A,e,t){let i=A.get(e);return i===void 0&&(i=new Ud(this,e,t),A.set(e,i)),i}}function li(r){return r==="left"||r==="right"}class ue{constructor(A){this.zn=new Map,this.Ln=[],this.En=A}Nn(A,e){const t=(function(i,s){return i===void 0?s:{Fn:Math.max(i.Fn,s.Fn),Wn:i.Wn||s.Wn}})(this.zn.get(A),e);this.zn.set(A,t)}jn(){return this.En}Hn(A){const e=this.zn.get(A);return e===void 0?{Fn:this.En}:{Fn:Math.max(this.En,e.Fn),Wn:e.Wn}}$n(){this.Un(),this.Ln=[{qn:0}]}Yn(A){this.Un(),this.Ln=[{qn:1,Vt:A}]}Zn(A){this.Xn(),this.Ln.push({qn:5,Vt:A})}Un(){this.Xn(),this.Ln.push({qn:6})}Kn(){this.Un(),this.Ln=[{qn:4}]}Gn(A){this.Un(),this.Ln.push({qn:2,Vt:A})}Jn(A){this.Un(),this.Ln.push({qn:3,Vt:A})}Qn(){return this.Ln}ts(A){for(const e of A.Ln)this.ns(e);this.En=Math.max(this.En,A.En),A.zn.forEach(((e,t)=>{this.Nn(t,e)}))}static ss(){return new ue(2)}static es(){return new ue(3)}ns(A){switch(A.qn){case 0:this.$n();break;case 1:this.Yn(A.Vt);break;case 2:this.Gn(A.Vt);break;case 3:this.Jn(A.Vt);break;case 4:this.Kn();break;case 5:this.Zn(A.Vt);break;case 6:this.Xn()}}Xn(){const A=this.Ln.findIndex((e=>e.qn===5));A!==-1&&this.Ln.splice(A,1)}}const pa=".";function at(r,A){if(!Ze(r))return"n/a";if(!fr(A))throw new TypeError("invalid length");if(A<0||A>16)throw new TypeError("invalid length");return A===0?r.toString():("0000000000000000"+r.toString()).slice(-A)}class ci{constructor(A,e){if(e||(e=1),Ze(A)&&fr(A)||(A=100),A<0)throw new TypeError("invalid base");this.Li=A,this.rs=e,this.hs()}format(A){const e=A<0?"−":"";return A=Math.abs(A),e+this.ls(A)}hs(){if(this._s=0,this.Li>0&&this.rs>0){let A=this.Li;for(;A>1;)A/=10,this._s++}}ls(A){const e=this.Li/this.rs;let t=Math.floor(A),i="";const s=this._s!==void 0?this._s:NaN;if(e>1){let n=+(Math.round(A*e)-t*e).toFixed(this._s);n>=e&&(n-=e,t+=1),i=pa+at(+n.toFixed(this._s)*this.rs,s)}else t=Math.round(t*e)/e,s>0&&(i=pa+at(0,s));return t.toFixed(0)+i}}class ga extends ci{constructor(A=100){super(A)}format(A){return`${super.format(A)}%`}}class Sd{constructor(A){this.us=A}format(A){let e="";return A<0&&(e="-",A=-A),A<995?e+this.cs(A):A<999995?e+this.cs(A/1e3)+"K":A<999999995?(A=1e3*Math.round(A/1e3),e+this.cs(A/1e6)+"M"):(A=1e6*Math.round(A/1e6),e+this.cs(A/1e9)+"B")}cs(A){let e;const t=Math.pow(10,this.us);return e=(A=Math.round(A*t)/t)>=1e-15&&A<1?A.toFixed(this.us).replace(/\.?0+$/,""):String(A),e.replace(/(\.[1-9]*)0+$/,((i,s)=>s))}}function Ba(r,A,e,t,i,s,n){if(A.length===0||t.from>=A.length||t.to<=0)return;const{context:o,horizontalPixelRatio:a,verticalPixelRatio:l}=r,c=A[t.from];let u=s(r,c),d=c;if(t.to-t.from<2){const B=i/2;o.beginPath();const p={nt:c.nt-B,st:c.st},f={nt:c.nt+B,st:c.st};o.moveTo(p.nt*a,p.st*l),o.lineTo(f.nt*a,f.st*l),n(r,u,p,f)}else{const B=(f,w)=>{n(r,u,d,w),o.beginPath(),u=f,d=w};let p=d;o.beginPath(),o.moveTo(c.nt*a,c.st*l);for(let f=t.from+1;f<t.to;++f){p=A[f];const w=s(r,p);switch(e){case 0:o.lineTo(p.nt*a,p.st*l);break;case 1:o.lineTo(p.nt*a,A[f-1].st*l),w!==u&&(B(w,p),o.lineTo(p.nt*a,A[f-1].st*l)),o.lineTo(p.nt*a,p.st*l);break;case 2:{const[F,C]=Hd(A,f-1,f);o.bezierCurveTo(F.nt*a,F.st*l,C.nt*a,C.st*l,p.nt*a,p.st*l);break}}e!==1&&w!==u&&(B(w,p),o.moveTo(p.nt*a,p.st*l))}(d!==p||d===p&&e===1)&&n(r,u,d,p)}}const wa=6;function zs(r,A){return{nt:r.nt-A.nt,st:r.st-A.st}}function ma(r,A){return{nt:r.nt/A,st:r.st/A}}function Hd(r,A,e){const t=Math.max(0,A-1),i=Math.min(r.length-1,e+1);var s,n;return[(s=r[A],n=ma(zs(r[e],r[t]),wa),{nt:s.nt+n.nt,st:s.st+n.st}),zs(r[e],ma(zs(r[i],r[A]),wa))]}function Ld(r,A,e,t,i){const{context:s,horizontalPixelRatio:n,verticalPixelRatio:o}=A;s.lineTo(i.nt*n,r*o),s.lineTo(t.nt*n,r*o),s.closePath(),s.fillStyle=e,s.fill()}class Ca extends Re{constructor(){super(...arguments),this.G=null}J(A){this.G=A}K(A){var e;if(this.G===null)return;const{it:t,tt:i,ds:s,et:n,Nt:o,fs:a}=this.G,l=(e=this.G.vs)!==null&&e!==void 0?e:this.G.ps?0:A.mediaSize.height;if(i===null)return;const c=A.context;c.lineCap="butt",c.lineJoin="round",c.lineWidth=n,Ht(c,o),c.lineWidth=1,Ba(A,t,a,i,s,this.bs.bind(this),Ld.bind(null,l))}}function Gs(r,A,e){return Math.min(Math.max(r,A),e)}function hi(r,A,e){return A-r<=e}function va(r){const A=Math.ceil(r);return A%2==0?A-1:A}class Rs{ws(A,e){const t=this.gs,{Ms:i,xs:s,Ss:n,ks:o,ys:a,vs:l}=e;if(this.Cs===void 0||t===void 0||t.Ms!==i||t.xs!==s||t.Ss!==n||t.ks!==o||t.vs!==l||t.ys!==a){const c=A.context.createLinearGradient(0,0,0,a);if(c.addColorStop(0,i),l!=null){const u=Gs(l*A.verticalPixelRatio/a,0,1);c.addColorStop(u,s),c.addColorStop(u,n)}c.addColorStop(1,o),this.Cs=c,this.gs=e}return this.Cs}}class Id extends Ca{constructor(){super(...arguments),this.Ts=new Rs}bs(A,e){return this.Ts.ws(A,{Ms:e.Ps,xs:"",Ss:"",ks:e.Rs,ys:A.bitmapSize.height})}}function Md(r,A){const e=r.context;e.strokeStyle=A,e.stroke()}class ba extends Re{constructor(){super(...arguments),this.G=null}J(A){this.G=A}K(A){if(this.G===null)return;const{it:e,tt:t,ds:i,fs:s,et:n,Nt:o,Ds:a}=this.G;if(t===null)return;const l=A.context;l.lineCap="butt",l.lineWidth=n*A.verticalPixelRatio,Ht(l,o),l.lineJoin="round";const c=this.Vs.bind(this);s!==void 0&&Ba(A,e,s,t,i,c,Md),a&&(function(u,d,B,p,f){const{horizontalPixelRatio:w,verticalPixelRatio:F,context:C}=u;let E=null;const U=Math.max(1,Math.floor(w))%2/2,S=B*F+U;for(let P=p.to-1;P>=p.from;--P){const z=d[P];if(z){const J=f(u,z);J!==E&&(C.beginPath(),E!==null&&C.fill(),C.fillStyle=J,E=J);const N=Math.round(z.nt*w)+U,Z=z.st*F;C.moveTo(N,Z),C.arc(N,Z,S,0,2*Math.PI)}}C.fill()})(A,e,a,t,c)}}class ya extends ba{Vs(A,e){return e.lt}}function Qa(r,A,e,t,i=0,s=A.length){let n=s-i;for(;0<n;){const o=n>>1,a=i+o;t(A[a],e)===r?(i=a+1,n-=o+1):n=o}return i}const Br=Qa.bind(null,!0),Fa=Qa.bind(null,!1);function Dd(r,A){return r.ot<A}function _d(r,A){return A<r.ot}function Ua(r,A,e){const t=A.Os(),i=A.ui(),s=Br(r,t,Dd),n=Fa(r,i,_d);if(!e)return{from:s,to:n};let o=s,a=n;return s>0&&s<r.length&&r[s].ot>=t&&(o=s-1),n>0&&n<r.length&&r[n-1].ot<=i&&(a=n+1),{from:o,to:a}}class Ws{constructor(A,e,t){this.Bs=!0,this.As=!0,this.Is=!0,this.zs=[],this.Ls=null,this.Es=A,this.Ns=e,this.Fs=t}bt(A){this.Bs=!0,A==="data"&&(this.As=!0),A==="options"&&(this.Is=!0)}gt(){return this.Es.yt()?(this.Ws(),this.Ls===null?null:this.js):null}Hs(){this.zs=this.zs.map((A=>Object.assign(Object.assign({},A),this.Es.Us().$s(A.ot))))}qs(){this.Ls=null}Ws(){this.As&&(this.Ys(),this.As=!1),this.Is&&(this.Hs(),this.Is=!1),this.Bs&&(this.Zs(),this.Bs=!1)}Zs(){const A=this.Es.Dt(),e=this.Ns.St();if(this.qs(),e.Ni()||A.Ni())return;const t=e.Xs();if(t===null||this.Es.In().Ks()===0)return;const i=this.Es.Ct();i!==null&&(this.Ls=Ua(this.zs,t,this.Fs),this.Gs(A,e,i.Vt),this.Js())}}class ui extends Ws{constructor(A,e){super(A,e,!0)}Gs(A,e,t){e.Qs(this.zs,gr(this.Ls)),A.te(this.zs,t,gr(this.Ls))}ie(A,e){return{ot:A,_t:e,nt:NaN,st:NaN}}Ys(){const A=this.Es.Us();this.zs=this.Es.In().ne().map((e=>{const t=e.Vt[3];return this.se(e.ee,t,A)}))}}class kd extends ui{constructor(A,e){super(A,e),this.js=new Vs,this.re=new Id,this.he=new ya,this.js.Z([this.re,this.he])}se(A,e,t){return Object.assign(Object.assign({},this.ie(A,e)),t.$s(A))}Js(){const A=this.Es.W();this.re.J({fs:A.lineType,it:this.zs,Nt:A.lineStyle,et:A.lineWidth,vs:null,ps:A.invertFilledArea,tt:this.Ls,ds:this.Ns.St().le()}),this.he.J({fs:A.lineVisible?A.lineType:void 0,it:this.zs,Nt:A.lineStyle,et:A.lineWidth,tt:this.Ls,ds:this.Ns.St().le(),Ds:A.pointMarkersVisible?A.pointMarkersRadius||A.lineWidth/2+2:void 0})}}class Od extends Re{constructor(){super(...arguments),this.zt=null,this.ae=0,this.oe=0}J(A){this.zt=A}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t}){if(this.zt===null||this.zt.In.length===0||this.zt.tt===null)return;this.ae=this._e(e),this.ae>=2&&Math.max(1,Math.floor(e))%2!=this.ae%2&&this.ae--,this.oe=this.zt.ue?Math.min(this.ae,Math.floor(e)):this.ae;let i=null;const s=this.oe<=this.ae&&this.zt.le>=Math.floor(1.5*e);for(let n=this.zt.tt.from;n<this.zt.tt.to;++n){const o=this.zt.In[n];i!==o.ce&&(A.fillStyle=o.ce,i=o.ce);const a=Math.floor(.5*this.oe),l=Math.round(o.nt*e),c=l-a,u=this.oe,d=c+u-1,B=Math.min(o.de,o.fe),p=Math.max(o.de,o.fe),f=Math.round(B*t)-a,w=Math.round(p*t)+a,F=Math.max(w-f,this.oe);A.fillRect(c,f,u,F);const C=Math.ceil(1.5*this.ae);if(s){if(this.zt.ve){const P=l-C;let z=Math.max(f,Math.round(o.pe*t)-a),J=z+u-1;J>f+F-1&&(J=f+F-1,z=J-u+1),A.fillRect(P,z,c-P,J-z+1)}const E=l+C;let U=Math.max(f,Math.round(o.me*t)-a),S=U+u-1;S>f+F-1&&(S=f+F-1,U=S-u+1),A.fillRect(d+1,U,E-d,S-U+1)}}}_e(A){const e=Math.floor(A);return Math.max(e,Math.floor((function(t,i){return Math.floor(.3*t*i)})(tA(this.zt).le,A)))}}class Ea extends Ws{constructor(A,e){super(A,e,!1)}Gs(A,e,t){e.Qs(this.zs,gr(this.Ls)),A.be(this.zs,t,gr(this.Ls))}we(A,e,t){return{ot:A,ge:e.Vt[0],Me:e.Vt[1],xe:e.Vt[2],Se:e.Vt[3],nt:NaN,pe:NaN,de:NaN,fe:NaN,me:NaN}}Ys(){const A=this.Es.Us();this.zs=this.Es.In().ne().map((e=>this.se(e.ee,e,A)))}}class Nd extends Ea{constructor(){super(...arguments),this.js=new Od}se(A,e,t){return Object.assign(Object.assign({},this.we(A,e,t)),t.$s(A))}Js(){const A=this.Es.W();this.js.J({In:this.zs,le:this.Ns.St().le(),ve:A.openVisible,ue:A.thinBars,tt:this.Ls})}}class Kd extends Ca{constructor(){super(...arguments),this.Ts=new Rs}bs(A,e){const t=this.G;return this.Ts.ws(A,{Ms:e.ke,xs:e.ye,Ss:e.Ce,ks:e.Te,ys:A.bitmapSize.height,vs:t.vs})}}class Vd extends ba{constructor(){super(...arguments),this.Pe=new Rs}Vs(A,e){const t=this.G;return this.Pe.ws(A,{Ms:e.Re,xs:e.Re,Ss:e.De,ks:e.De,ys:A.bitmapSize.height,vs:t.vs})}}class Pd extends ui{constructor(A,e){super(A,e),this.js=new Vs,this.Ve=new Kd,this.Oe=new Vd,this.js.Z([this.Ve,this.Oe])}se(A,e,t){return Object.assign(Object.assign({},this.ie(A,e)),t.$s(A))}Js(){const A=this.Es.Ct();if(A===null)return;const e=this.Es.W(),t=this.Es.Dt().Rt(e.baseValue.price,A.Vt),i=this.Ns.St().le();this.Ve.J({it:this.zs,et:e.lineWidth,Nt:e.lineStyle,fs:e.lineType,vs:t,ps:!1,tt:this.Ls,ds:i}),this.Oe.J({it:this.zs,et:e.lineWidth,Nt:e.lineStyle,fs:e.lineVisible?e.lineType:void 0,Ds:e.pointMarkersVisible?e.pointMarkersRadius||e.lineWidth/2+2:void 0,vs:t,tt:this.Ls,ds:i})}}class zd extends Re{constructor(){super(...arguments),this.zt=null,this.ae=0}J(A){this.zt=A}K(A){if(this.zt===null||this.zt.In.length===0||this.zt.tt===null)return;const{horizontalPixelRatio:e}=A;this.ae=(function(s,n){if(s>=2.5&&s<=4)return Math.floor(3*n);const o=1-.2*Math.atan(Math.max(4,s)-4)/(.5*Math.PI),a=Math.floor(s*o*n),l=Math.floor(s*n),c=Math.min(a,l);return Math.max(Math.floor(n),c)})(this.zt.le,e),this.ae>=2&&Math.floor(e)%2!=this.ae%2&&this.ae--;const t=this.zt.In;this.zt.Be&&this.Ae(A,t,this.zt.tt),this.zt._i&&this.Ie(A,t,this.zt.tt);const i=this.ze(e);(!this.zt._i||this.ae>2*i)&&this.Le(A,t,this.zt.tt)}Ae(A,e,t){if(this.zt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:n}=A;let o="",a=Math.min(Math.floor(s),Math.floor(this.zt.le*s));a=Math.max(Math.floor(s),Math.min(a,this.ae));const l=Math.floor(.5*a);let c=null;for(let u=t.from;u<t.to;u++){const d=e[u];d.Ee!==o&&(i.fillStyle=d.Ee,o=d.Ee);const B=Math.round(Math.min(d.pe,d.me)*n),p=Math.round(Math.max(d.pe,d.me)*n),f=Math.round(d.de*n),w=Math.round(d.fe*n);let F=Math.round(s*d.nt)-l;const C=F+a-1;c!==null&&(F=Math.max(c+1,F),F=Math.min(F,C));const E=C-F+1;i.fillRect(F,f,E,B-f),i.fillRect(F,p+1,E,w-p),c=C}}ze(A){let e=Math.floor(1*A);this.ae<=2*e&&(e=Math.floor(.5*(this.ae-1)));const t=Math.max(Math.floor(A),e);return this.ae<=2*t?Math.max(Math.floor(A),Math.floor(1*A)):t}Ie(A,e,t){if(this.zt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:n}=A;let o="";const a=this.ze(s);let l=null;for(let c=t.from;c<t.to;c++){const u=e[c];u.Ne!==o&&(i.fillStyle=u.Ne,o=u.Ne);let d=Math.round(u.nt*s)-Math.floor(.5*this.ae);const B=d+this.ae-1,p=Math.round(Math.min(u.pe,u.me)*n),f=Math.round(Math.max(u.pe,u.me)*n);if(l!==null&&(d=Math.max(l+1,d),d=Math.min(d,B)),this.zt.le*s>2*a)Fd(i,d,p,B-d+1,f-p+1,a);else{const w=B-d+1;i.fillRect(d,p,w,f-p+1)}l=B}}Le(A,e,t){if(this.zt===null)return;const{context:i,horizontalPixelRatio:s,verticalPixelRatio:n}=A;let o="";const a=this.ze(s);for(let l=t.from;l<t.to;l++){const c=e[l];let u=Math.round(Math.min(c.pe,c.me)*n),d=Math.round(Math.max(c.pe,c.me)*n),B=Math.round(c.nt*s)-Math.floor(.5*this.ae),p=B+this.ae-1;if(c.ce!==o){const f=c.ce;i.fillStyle=f,o=f}this.zt._i&&(B+=a,u+=a,p-=a,d-=a),u>d||i.fillRect(B,u,p-B+1,d-u+1)}}}class Gd extends Ea{constructor(){super(...arguments),this.js=new zd}se(A,e,t){return Object.assign(Object.assign({},this.we(A,e,t)),t.$s(A))}Js(){const A=this.Es.W();this.js.J({In:this.zs,le:this.Ns.St().le(),Be:A.wickVisible,_i:A.borderVisible,tt:this.Ls})}}class Rd{constructor(A,e){this.Fe=A,this.Li=e}X(A,e,t){this.Fe.draw(A,this.Li,e,t)}}class $s extends Ws{constructor(A,e,t){super(A,e,!1),this.wn=t,this.js=new Rd(this.wn.renderer(),(i=>{const s=A.Ct();return s===null?null:A.Dt().Rt(i,s.Vt)}))}We(A){return this.wn.priceValueBuilder(A)}je(A){return this.wn.isWhitespace(A)}Ys(){const A=this.Es.Us();this.zs=this.Es.In().ne().map((e=>Object.assign(Object.assign({ot:e.ee,nt:NaN},A.$s(e.ee)),{He:e.$e})))}Gs(A,e){e.Qs(this.zs,gr(this.Ls))}Js(){this.wn.update({bars:this.zs.map(Wd),barSpacing:this.Ns.St().le(),visibleRange:this.Ls},this.Es.W())}}function Wd(r){return{x:r.nt,time:r.ot,originalData:r.He,barColor:r.ce}}class $d extends Re{constructor(){super(...arguments),this.zt=null,this.Ue=[]}J(A){this.zt=A,this.Ue=[]}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t}){if(this.zt===null||this.zt.it.length===0||this.zt.tt===null)return;this.Ue.length||this.qe(e);const i=Math.max(1,Math.floor(t)),s=Math.round(this.zt.Ye*t)-Math.floor(i/2),n=s+i;for(let o=this.zt.tt.from;o<this.zt.tt.to;o++){const a=this.zt.it[o],l=this.Ue[o-this.zt.tt.from],c=Math.round(a.st*t);let u,d;A.fillStyle=a.ce,c<=s?(u=c,d=n):(u=s,d=c-Math.floor(i/2)+i),A.fillRect(l.Os,u,l.ui-l.Os+1,d-u)}}qe(A){if(this.zt===null||this.zt.it.length===0||this.zt.tt===null)return void(this.Ue=[]);const e=Math.ceil(this.zt.le*A)<=1?0:Math.max(1,Math.floor(A)),t=Math.round(this.zt.le*A)-e;this.Ue=new Array(this.zt.tt.to-this.zt.tt.from);for(let s=this.zt.tt.from;s<this.zt.tt.to;s++){const n=this.zt.it[s],o=Math.round(n.nt*A);let a,l;if(t%2){const c=(t-1)/2;a=o-c,l=o+c}else{const c=t/2;a=o-c,l=o+c-1}this.Ue[s-this.zt.tt.from]={Os:a,ui:l,Ze:o,Xe:n.nt*A,ot:n.ot}}for(let s=this.zt.tt.from+1;s<this.zt.tt.to;s++){const n=this.Ue[s-this.zt.tt.from],o=this.Ue[s-this.zt.tt.from-1];n.ot===o.ot+1&&n.Os-o.ui!==e+1&&(o.Ze>o.Xe?o.ui=n.Os-e-1:n.Os=o.ui+e+1)}let i=Math.ceil(this.zt.le*A);for(let s=this.zt.tt.from;s<this.zt.tt.to;s++){const n=this.Ue[s-this.zt.tt.from];n.ui<n.Os&&(n.ui=n.Os);const o=n.ui-n.Os+1;i=Math.min(o,i)}if(e>0&&i<4)for(let s=this.zt.tt.from;s<this.zt.tt.to;s++){const n=this.Ue[s-this.zt.tt.from];n.ui-n.Os+1>i&&(n.Ze>n.Xe?n.ui-=1:n.Os+=1)}}}class Xd extends ui{constructor(){super(...arguments),this.js=new $d}se(A,e,t){return Object.assign(Object.assign({},this.ie(A,e)),t.$s(A))}Js(){const A={it:this.zs,le:this.Ns.St().le(),tt:this.Ls,Ye:this.Es.Dt().Rt(this.Es.W().base,tA(this.Es.Ct()).Vt)};this.js.J(A)}}class Jd extends ui{constructor(){super(...arguments),this.js=new ya}se(A,e,t){return Object.assign(Object.assign({},this.ie(A,e)),t.$s(A))}Js(){const A=this.Es.W(),e={it:this.zs,Nt:A.lineStyle,fs:A.lineVisible?A.lineType:void 0,et:A.lineWidth,Ds:A.pointMarkersVisible?A.pointMarkersRadius||A.lineWidth/2+2:void 0,tt:this.Ls,ds:this.Ns.St().le()};this.js.J(e)}}const Zd=/[2-9]/g;class wr{constructor(A=50){this.Ke=0,this.Ge=1,this.Je=1,this.Qe={},this.tr=new Map,this.ir=A}nr(){this.Ke=0,this.tr.clear(),this.Ge=1,this.Je=1,this.Qe={}}xi(A,e,t){return this.sr(A,e,t).width}Mi(A,e,t){const i=this.sr(A,e,t);return((i.actualBoundingBoxAscent||0)-(i.actualBoundingBoxDescent||0))/2}sr(A,e,t){const i=t||Zd,s=String(e).replace(i,"0");if(this.tr.has(s))return ve(this.tr.get(s)).er;if(this.Ke===this.ir){const o=this.Qe[this.Je];delete this.Qe[this.Je],this.tr.delete(o),this.Je++,this.Ke--}A.save(),A.textBaseline="middle";const n=A.measureText(s);return A.restore(),n.width===0&&e.length||(this.tr.set(s,{er:n,rr:this.Ge}),this.Qe[this.Ge]=s,this.Ke++,this.Ge++),n}}class Yd{constructor(A){this.hr=null,this.k=null,this.lr="right",this.ar=A}_r(A,e,t){this.hr=A,this.k=e,this.lr=t}X(A){this.k!==null&&this.hr!==null&&this.hr.X(A,this.k,this.ar,this.lr)}}class xa{constructor(A,e,t){this.ur=A,this.ar=new wr(50),this.cr=e,this.F=t,this.j=-1,this.Wt=new Yd(this.ar)}gt(){const A=this.F.dr(this.cr);if(A===null)return null;const e=A.vr(this.cr)?A.pr():this.cr.Dt();if(e===null)return null;const t=A.mr(e);if(t==="overlay")return null;const i=this.F.br();return i.P!==this.j&&(this.j=i.P,this.ar.nr()),this.Wt._r(this.ur.Ii(),i,t),this.Wt}}class jd extends Re{constructor(){super(...arguments),this.zt=null}J(A){this.zt=A}wr(A,e){var t;if(!(!((t=this.zt)===null||t===void 0)&&t.yt))return null;const{st:i,et:s,gr:n}=this.zt;return e>=i-s-7&&e<=i+s+7?{Mr:this.zt,gr:n}:null}K({context:A,bitmapSize:e,horizontalPixelRatio:t,verticalPixelRatio:i}){if(this.zt===null||this.zt.yt===!1)return;const s=Math.round(this.zt.st*i);s<0||s>e.height||(A.lineCap="butt",A.strokeStyle=this.zt.V,A.lineWidth=Math.floor(this.zt.et*t),Ht(A,this.zt.Nt),sa(A,s,0,e.width))}}class Xs{constructor(A){this.Sr={st:0,V:"rgba(0, 0, 0, 0)",et:1,Nt:0,yt:!1},this.kr=new jd,this.ft=!0,this.Es=A,this.Ns=A.$t(),this.kr.J(this.Sr)}bt(){this.ft=!0}gt(){return this.Es.yt()?(this.ft&&(this.yr(),this.ft=!1),this.kr):null}}class qd extends Xs{constructor(A){super(A)}yr(){this.Sr.yt=!1;const A=this.Es.Dt(),e=A.Cr().Cr;if(e!==2&&e!==3)return;const t=this.Es.W();if(!t.baseLineVisible||!this.Es.yt())return;const i=this.Es.Ct();i!==null&&(this.Sr.yt=!0,this.Sr.st=A.Rt(i.Vt,i.Vt),this.Sr.V=t.baseLineColor,this.Sr.et=t.baseLineWidth,this.Sr.Nt=t.baseLineStyle)}}class Af extends Re{constructor(){super(...arguments),this.zt=null}J(A){this.zt=A}$e(){return this.zt}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t}){const i=this.zt;if(i===null)return;const s=Math.max(1,Math.floor(e)),n=s%2/2,o=Math.round(i.Xe.x*e)+n,a=i.Xe.y*t;A.fillStyle=i.Tr,A.beginPath();const l=Math.max(2,1.5*i.Pr)*e;A.arc(o,a,l,0,2*Math.PI,!1),A.fill(),A.fillStyle=i.Rr,A.beginPath(),A.arc(o,a,i.ht*e,0,2*Math.PI,!1),A.fill(),A.lineWidth=s,A.strokeStyle=i.Dr,A.beginPath(),A.arc(o,a,i.ht*e+s/2,0,2*Math.PI,!1),A.stroke()}}const ef=[{Vr:0,Or:.25,Br:4,Ar:10,Ir:.25,zr:0,Lr:.4,Er:.8},{Vr:.25,Or:.525,Br:10,Ar:14,Ir:0,zr:0,Lr:.8,Er:0},{Vr:.525,Or:1,Br:14,Ar:14,Ir:0,zr:0,Lr:0,Er:0}];function Ta(r,A,e,t){return(function(i,s){if(i==="transparent")return i;const n=dr(i),o=n[3];return`rgba(${n[0]}, ${n[1]}, ${n[2]}, ${s*o})`})(r,e+(t-e)*A)}function Sa(r,A){const e=r%2600/2600;let t;for(const a of ef)if(e>=a.Vr&&e<=a.Or){t=a;break}Bt(t!==void 0,"Last price animation internal logic error");const i=(e-t.Vr)/(t.Or-t.Vr);return{Rr:Ta(A,i,t.Ir,t.zr),Dr:Ta(A,i,t.Lr,t.Er),ht:(s=i,n=t.Br,o=t.Ar,n+(o-n)*s)};var s,n,o}class tf{constructor(A){this.Wt=new Af,this.ft=!0,this.Nr=!0,this.Fr=performance.now(),this.Wr=this.Fr-1,this.jr=A}Hr(){this.Wr=this.Fr-1,this.bt()}$r(){if(this.bt(),this.jr.W().lastPriceAnimation===2){const A=performance.now(),e=this.Wr-A;if(e>0)return void(e<650&&(this.Wr+=2600));this.Fr=A,this.Wr=A+2600}}bt(){this.ft=!0}Ur(){this.Nr=!0}yt(){return this.jr.W().lastPriceAnimation!==0}qr(){switch(this.jr.W().lastPriceAnimation){case 0:return!1;case 1:return!0;case 2:return performance.now()<=this.Wr}}gt(){return this.ft?(this.Mt(),this.ft=!1,this.Nr=!1):this.Nr&&(this.Yr(),this.Nr=!1),this.Wt}Mt(){this.Wt.J(null);const A=this.jr.$t().St(),e=A.Xs(),t=this.jr.Ct();if(e===null||t===null)return;const i=this.jr.Zr(!0);if(i.Xr||!e.Kr(i.ee))return;const s={x:A.It(i.ee),y:this.jr.Dt().Rt(i._t,t.Vt)},n=i.V,o=this.jr.W().lineWidth,a=Sa(this.Gr(),n);this.Wt.J({Tr:n,Pr:o,Rr:a.Rr,Dr:a.Dr,ht:a.ht,Xe:s})}Yr(){const A=this.Wt.$e();if(A!==null){const e=Sa(this.Gr(),A.Tr);A.Rr=e.Rr,A.Dr=e.Dr,A.ht=e.ht}}Gr(){return this.qr()?performance.now()-this.Fr:2599}}function mr(r,A){return va(Math.min(Math.max(r,12),30)*A)}function Cr(r,A){switch(r){case"arrowDown":case"arrowUp":return mr(A,1);case"circle":return mr(A,.8);case"square":return mr(A,.7)}}function Ha(r){return(function(A){const e=Math.ceil(A);return e%2!=0?e-1:e})(mr(r,1))}function La(r){return Math.max(mr(r,.1),3)}function Ia(r,A,e){return A?r:e?Math.ceil(r/2):0}function Ma(r,A,e,t,i){const s=Cr("square",e),n=(s-1)/2,o=r-n,a=A-n;return t>=o&&t<=o+s&&i>=a&&i<=a+s}function Da(r,A,e,t){const i=(Cr("arrowUp",t)-1)/2*e.Jr,s=(va(t/2)-1)/2*e.Jr;A.beginPath(),r?(A.moveTo(e.nt-i,e.st),A.lineTo(e.nt,e.st-i),A.lineTo(e.nt+i,e.st),A.lineTo(e.nt+s,e.st),A.lineTo(e.nt+s,e.st+i),A.lineTo(e.nt-s,e.st+i),A.lineTo(e.nt-s,e.st)):(A.moveTo(e.nt-i,e.st),A.lineTo(e.nt,e.st+i),A.lineTo(e.nt+i,e.st),A.lineTo(e.nt+s,e.st),A.lineTo(e.nt+s,e.st-i),A.lineTo(e.nt-s,e.st-i),A.lineTo(e.nt-s,e.st)),A.fill()}function rf(r,A,e,t,i,s){return Ma(A,e,t,i,s)}class sf extends Re{constructor(){super(...arguments),this.zt=null,this.ar=new wr,this.j=-1,this.H="",this.Qr=""}J(A){this.zt=A}_r(A,e){this.j===A&&this.H===e||(this.j=A,this.H=e,this.Qr=Wt(A,e),this.ar.nr())}wr(A,e){if(this.zt===null||this.zt.tt===null)return null;for(let t=this.zt.tt.from;t<this.zt.tt.to;t++){const i=this.zt.it[t];if(of(i,A,e))return{Mr:i.th,gr:i.gr}}return null}K({context:A,horizontalPixelRatio:e,verticalPixelRatio:t},i,s){if(this.zt!==null&&this.zt.tt!==null){A.textBaseline="middle",A.font=this.Qr;for(let n=this.zt.tt.from;n<this.zt.tt.to;n++){const o=this.zt.it[n];o.Kt!==void 0&&(o.Kt.Hi=this.ar.xi(A,o.Kt.ih),o.Kt.At=this.j,o.Kt.nt=o.nt-o.Kt.Hi/2),nf(o,A,e,t)}}}}function nf(r,A,e,t){A.fillStyle=r.V,r.Kt!==void 0&&(function(i,s,n,o,a,l){i.save(),i.scale(a,l),i.fillText(s,n,o),i.restore()})(A,r.Kt.ih,r.Kt.nt,r.Kt.st,e,t),(function(i,s,n){if(i.Ks!==0){switch(i.nh){case"arrowDown":return void Da(!1,s,n,i.Ks);case"arrowUp":return void Da(!0,s,n,i.Ks);case"circle":return void(function(o,a,l){const c=(Cr("circle",l)-1)/2;o.beginPath(),o.arc(a.nt,a.st,c*a.Jr,0,2*Math.PI,!1),o.fill()})(s,n,i.Ks);case"square":return void(function(o,a,l){const c=Cr("square",l),u=(c-1)*a.Jr/2,d=a.nt-u,B=a.st-u;o.fillRect(d,B,c*a.Jr,c*a.Jr)})(s,n,i.Ks)}i.nh}})(r,A,(function(i,s,n){const o=Math.max(1,Math.floor(s))%2/2;return{nt:Math.round(i.nt*s)+o,st:i.st*n,Jr:s}})(r,e,t))}function of(r,A,e){return!(r.Kt===void 0||!(function(t,i,s,n,o,a){const l=n/2;return o>=t&&o<=t+s&&a>=i-l&&a<=i+l})(r.Kt.nt,r.Kt.st,r.Kt.Hi,r.Kt.At,A,e))||(function(t,i,s){if(t.Ks===0)return!1;switch(t.nh){case"arrowDown":case"arrowUp":return rf(0,t.nt,t.st,t.Ks,i,s);case"circle":return(function(n,o,a,l,c){const u=2+Cr("circle",a)/2,d=n-l,B=o-c;return Math.sqrt(d*d+B*B)<=u})(t.nt,t.st,t.Ks,i,s);case"square":return Ma(t.nt,t.st,t.Ks,i,s)}})(r,A,e)}function af(r,A,e,t,i,s,n,o,a){const l=Ze(e)?e:e.Se,c=Ze(e)?e:e.Me,u=Ze(e)?e:e.xe,d=Ze(A.size)?Math.max(A.size,0):1,B=Ha(o.le())*d,p=B/2;switch(r.Ks=B,A.position){case"inBar":return r.st=n.Rt(l,a),void(r.Kt!==void 0&&(r.Kt.st=r.st+p+s+.6*i));case"aboveBar":return r.st=n.Rt(c,a)-p-t.sh,r.Kt!==void 0&&(r.Kt.st=r.st-p-.6*i,t.sh+=1.2*i),void(t.sh+=B+s);case"belowBar":return r.st=n.Rt(u,a)+p+t.eh,r.Kt!==void 0&&(r.Kt.st=r.st+p+s+.6*i,t.eh+=1.2*i),void(t.eh+=B+s)}A.position}class lf{constructor(A,e){this.ft=!0,this.rh=!0,this.hh=!0,this.ah=null,this.oh=null,this.Wt=new sf,this.jr=A,this.$i=e,this.zt={it:[],tt:null}}bt(A){this.ft=!0,this.hh=!0,A==="data"&&(this.rh=!0,this.oh=null)}gt(A){if(!this.jr.yt())return null;this.ft&&this._h();const e=this.$i.W().layout;return this.Wt._r(e.fontSize,e.fontFamily),this.Wt.J(this.zt),this.Wt}uh(){if(this.hh){if(this.jr.dh().length>0){const A=this.$i.St().le(),e=La(A),t=1.5*Ha(A)+2*e,i=this.fh();this.ah={above:Ia(t,i.aboveBar,i.inBar),below:Ia(t,i.belowBar,i.inBar)}}else this.ah=null;this.hh=!1}return this.ah}fh(){return this.oh===null&&(this.oh=this.jr.dh().reduce(((A,e)=>(A[e.position]||(A[e.position]=!0),A)),{inBar:!1,aboveBar:!1,belowBar:!1})),this.oh}_h(){const A=this.jr.Dt(),e=this.$i.St(),t=this.jr.dh();this.rh&&(this.zt.it=t.map((c=>({ot:c.time,nt:0,st:0,Ks:0,nh:c.shape,V:c.color,th:c.th,gr:c.id,Kt:void 0}))),this.rh=!1);const i=this.$i.W().layout;this.zt.tt=null;const s=e.Xs();if(s===null)return;const n=this.jr.Ct();if(n===null||this.zt.it.length===0)return;let o=NaN;const a=La(e.le()),l={sh:a,eh:a};this.zt.tt=Ua(this.zt.it,s,!0);for(let c=this.zt.tt.from;c<this.zt.tt.to;c++){const u=t[c];u.time!==o&&(l.sh=a,l.eh=a,o=u.time);const d=this.zt.it[c];d.nt=e.It(u.time),u.text!==void 0&&u.text.length>0&&(d.Kt={ih:u.text,nt:0,st:0,Hi:0,At:0});const B=this.jr.ph(u.time);B!==null&&af(d,u,B,l,i.fontSize,a,A,e,n.Vt)}this.ft=!1}}class cf extends Xs{constructor(A){super(A)}yr(){const A=this.Sr;A.yt=!1;const e=this.Es.W();if(!e.priceLineVisible||!this.Es.yt())return;const t=this.Es.Zr(e.priceLineSource===0);t.Xr||(A.yt=!0,A.st=t.ki,A.V=this.Es.mh(t.V),A.et=e.priceLineWidth,A.Nt=e.priceLineStyle)}}class hf extends ai{constructor(A){super(),this.jt=A}zi(A,e,t){A.yt=!1,e.yt=!1;const i=this.jt;if(!i.yt())return;const s=i.W(),n=s.lastValueVisible,o=i.bh()!=="",a=s.seriesLastValueMode===0,l=i.Zr(!1);if(l.Xr)return;n&&(A.Kt=this.wh(l,n,a),A.yt=A.Kt.length!==0),(o||a)&&(e.Kt=this.gh(l,n,o,a),e.yt=e.Kt.length>0);const c=i.mh(l.V),u=si(c);t.t=u.t,t.ki=l.ki,e.Ot=i.$t().Bt(l.ki/i.Dt().At()),A.Ot=c,A.V=u.i,e.V=u.i}gh(A,e,t,i){let s="";const n=this.jt.bh();return t&&n.length!==0&&(s+=`${n} `),e&&i&&(s+=this.jt.Dt().Mh()?A.xh:A.Sh),s.trim()}wh(A,e,t){return e?t?this.jt.Dt().Mh()?A.Sh:A.xh:A.Kt:""}}function _a(r,A,e,t){const i=Number.isFinite(A),s=Number.isFinite(e);return i&&s?r(A,e):i||s?i?A:e:t}class Fe{constructor(A,e){this.kh=A,this.yh=e}Ch(A){return A!==null&&this.kh===A.kh&&this.yh===A.yh}Th(){return new Fe(this.kh,this.yh)}Ph(){return this.kh}Rh(){return this.yh}Dh(){return this.yh-this.kh}Ni(){return this.yh===this.kh||Number.isNaN(this.yh)||Number.isNaN(this.kh)}ts(A){return A===null?this:new Fe(_a(Math.min,this.Ph(),A.Ph(),-1/0),_a(Math.max,this.Rh(),A.Rh(),1/0))}Vh(A){if(!Ze(A)||this.yh-this.kh===0)return;const e=.5*(this.yh+this.kh);let t=this.yh-e,i=this.kh-e;t*=A,i*=A,this.yh=e+t,this.kh=e+i}Oh(A){Ze(A)&&(this.yh+=A,this.kh+=A)}Bh(){return{minValue:this.kh,maxValue:this.yh}}static Ah(A){return A===null?null:new Fe(A.minValue,A.maxValue)}}class di{constructor(A,e){this.Ih=A,this.zh=e||null}Lh(){return this.Ih}Eh(){return this.zh}Bh(){return this.Ih===null?null:{priceRange:this.Ih.Bh(),margins:this.zh||void 0}}static Ah(A){return A===null?null:new di(Fe.Ah(A.priceRange),A.margins)}}class uf extends Xs{constructor(A,e){super(A),this.Nh=e}yr(){const A=this.Sr;A.yt=!1;const e=this.Nh.W();if(!this.Es.yt()||!e.lineVisible)return;const t=this.Nh.Fh();t!==null&&(A.yt=!0,A.st=t,A.V=e.color,A.et=e.lineWidth,A.Nt=e.lineStyle,A.gr=this.Nh.W().id)}}class df extends ai{constructor(A,e){super(),this.jr=A,this.Nh=e}zi(A,e,t){A.yt=!1,e.yt=!1;const i=this.Nh.W(),s=i.axisLabelVisible,n=i.title!=="",o=this.jr;if(!s||!o.yt())return;const a=this.Nh.Fh();if(a===null)return;n&&(e.Kt=i.title,e.yt=!0),e.Ot=o.$t().Bt(a/o.Dt().At()),A.Kt=this.Wh(i.price),A.yt=!0;const l=si(i.axisLabelColor||i.color);t.t=l.t;const c=i.axisLabelTextColor||l.i;A.V=c,e.V=c,t.ki=a}Wh(A){const e=this.jr.Ct();return e===null?"":this.jr.Dt().Fi(A,e.Vt)}}class ff{constructor(A,e){this.jr=A,this.cn=e,this.jh=new uf(A,this),this.ur=new df(A,this),this.Hh=new xa(this.ur,A,A.$t())}$h(A){Ge(this.cn,A),this.bt(),this.jr.$t().Uh()}W(){return this.cn}qh(){return this.jh}Yh(){return this.Hh}Zh(){return this.ur}bt(){this.jh.bt(),this.ur.bt()}Fh(){const A=this.jr,e=A.Dt();if(A.$t().St().Ni()||e.Ni())return null;const t=A.Ct();return t===null?null:e.Rt(this.cn.price,t.Vt)}}class pf extends Ps{constructor(A){super(),this.$i=A}$t(){return this.$i}}const gf={Bar:(r,A,e,t)=>{var i;const s=A.upColor,n=A.downColor,o=tA(r(e,t)),a=Rt(o.Vt[0])<=Rt(o.Vt[3]);return{ce:(i=o.V)!==null&&i!==void 0?i:a?s:n}},Candlestick:(r,A,e,t)=>{var i,s,n;const o=A.upColor,a=A.downColor,l=A.borderUpColor,c=A.borderDownColor,u=A.wickUpColor,d=A.wickDownColor,B=tA(r(e,t)),p=Rt(B.Vt[0])<=Rt(B.Vt[3]);return{ce:(i=B.V)!==null&&i!==void 0?i:p?o:a,Ne:(s=B.Ot)!==null&&s!==void 0?s:p?l:c,Ee:(n=B.Xh)!==null&&n!==void 0?n:p?u:d}},Custom:(r,A,e,t)=>{var i;return{ce:(i=tA(r(e,t)).V)!==null&&i!==void 0?i:A.color}},Area:(r,A,e,t)=>{var i,s,n,o;const a=tA(r(e,t));return{ce:(i=a.lt)!==null&&i!==void 0?i:A.lineColor,lt:(s=a.lt)!==null&&s!==void 0?s:A.lineColor,Ps:(n=a.Ps)!==null&&n!==void 0?n:A.topColor,Rs:(o=a.Rs)!==null&&o!==void 0?o:A.bottomColor}},Baseline:(r,A,e,t)=>{var i,s,n,o,a,l;const c=tA(r(e,t));return{ce:c.Vt[3]>=A.baseValue.price?A.topLineColor:A.bottomLineColor,Re:(i=c.Re)!==null&&i!==void 0?i:A.topLineColor,De:(s=c.De)!==null&&s!==void 0?s:A.bottomLineColor,ke:(n=c.ke)!==null&&n!==void 0?n:A.topFillColor1,ye:(o=c.ye)!==null&&o!==void 0?o:A.topFillColor2,Ce:(a=c.Ce)!==null&&a!==void 0?a:A.bottomFillColor1,Te:(l=c.Te)!==null&&l!==void 0?l:A.bottomFillColor2}},Line:(r,A,e,t)=>{var i,s;const n=tA(r(e,t));return{ce:(i=n.V)!==null&&i!==void 0?i:A.color,lt:(s=n.V)!==null&&s!==void 0?s:A.color}},Histogram:(r,A,e,t)=>{var i;return{ce:(i=tA(r(e,t)).V)!==null&&i!==void 0?i:A.color}}};class Bf{constructor(A){this.Kh=(e,t)=>t!==void 0?t.Vt:this.jr.In().Gh(e),this.jr=A,this.Jh=gf[A.Qh()]}$s(A,e){return this.Jh(this.Kh,this.jr.W(),A,e)}}var ka;(function(r){r[r.NearestLeft=-1]="NearestLeft",r[r.None=0]="None",r[r.NearestRight=1]="NearestRight"})(ka||(ka={}));const wt=30;class wf{constructor(){this.tl=[],this.il=new Map,this.nl=new Map}sl(){return this.Ks()>0?this.tl[this.tl.length-1]:null}el(){return this.Ks()>0?this.rl(0):null}An(){return this.Ks()>0?this.rl(this.tl.length-1):null}Ks(){return this.tl.length}Ni(){return this.Ks()===0}Kr(A){return this.hl(A,0)!==null}Gh(A){return this.ll(A)}ll(A,e=0){const t=this.hl(A,e);return t===null?null:Object.assign(Object.assign({},this.al(t)),{ee:this.rl(t)})}ne(){return this.tl}ol(A,e,t){if(this.Ni())return null;let i=null;for(const s of t)i=fi(i,this._l(A,e,s));return i}J(A){this.nl.clear(),this.il.clear(),this.tl=A}rl(A){return this.tl[A].ee}al(A){return this.tl[A]}hl(A,e){const t=this.ul(A);if(t===null&&e!==0)switch(e){case-1:return this.cl(A);case 1:return this.dl(A);default:throw new TypeError("Unknown search mode")}return t}cl(A){let e=this.fl(A);return e>0&&(e-=1),e!==this.tl.length&&this.rl(e)<A?e:null}dl(A){const e=this.vl(A);return e!==this.tl.length&&A<this.rl(e)?e:null}ul(A){const e=this.fl(A);return e===this.tl.length||A<this.tl[e].ee?null:e}fl(A){return Br(this.tl,A,((e,t)=>e.ee<t))}vl(A){return Fa(this.tl,A,((e,t)=>e.ee>t))}pl(A,e,t){let i=null;for(let s=A;s<e;s++){const n=this.tl[s].Vt[t];Number.isNaN(n)||(i===null?i={ml:n,bl:n}:(n<i.ml&&(i.ml=n),n>i.bl&&(i.bl=n)))}return i}_l(A,e,t){if(this.Ni())return null;let i=null;const s=tA(this.el()),n=tA(this.An()),o=Math.max(A,s),a=Math.min(e,n),l=Math.ceil(o/wt)*wt,c=Math.max(l,Math.floor(a/wt)*wt);{const d=this.fl(o),B=this.vl(Math.min(a,l,e));i=fi(i,this.pl(d,B,t))}let u=this.il.get(t);u===void 0&&(u=new Map,this.il.set(t,u));for(let d=Math.max(l+1,o);d<c;d+=wt){const B=Math.floor(d/wt);let p=u.get(B);if(p===void 0){const f=this.fl(B*wt),w=this.vl((B+1)*wt-1);p=this.pl(f,w,t),u.set(B,p)}i=fi(i,p)}{const d=this.fl(c),B=this.vl(a);i=fi(i,this.pl(d,B,t))}return i}}function fi(r,A){return r===null?A:A===null?r:{ml:Math.min(r.ml,A.ml),bl:Math.max(r.bl,A.bl)}}class mf{constructor(A){this.wl=A}X(A,e,t){this.wl.draw(A)}gl(A,e,t){var i,s;(s=(i=this.wl).drawBackground)===null||s===void 0||s.call(i,A)}}class Js{constructor(A){this.tr=null,this.wn=A}gt(){var A;const e=this.wn.renderer();if(e===null)return null;if(((A=this.tr)===null||A===void 0?void 0:A.Ml)===e)return this.tr.xl;const t=new mf(e);return this.tr={Ml:e,xl:t},t}Sl(){var A,e,t;return(t=(e=(A=this.wn).zOrder)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:"normal"}}function Oa(r){var A,e,t,i,s;return{Kt:r.text(),ki:r.coordinate(),Si:(A=r.fixedCoordinate)===null||A===void 0?void 0:A.call(r),V:r.textColor(),t:r.backColor(),yt:(t=(e=r.visible)===null||e===void 0?void 0:e.call(r))===null||t===void 0||t,hi:(s=(i=r.tickVisible)===null||i===void 0?void 0:i.call(r))===null||s===void 0||s}}class Cf{constructor(A,e){this.Wt=new da,this.kl=A,this.yl=e}gt(){return this.Wt.J(Object.assign({Hi:this.yl.Hi()},Oa(this.kl))),this.Wt}}class vf extends ai{constructor(A,e){super(),this.kl=A,this.Li=e}zi(A,e,t){const i=Oa(this.kl);t.t=i.t,A.V=i.V;const s=2/12*this.Li.P();t.wi=s,t.gi=s,t.ki=i.ki,t.Si=i.Si,A.Kt=i.Kt,A.yt=i.yt,A.hi=i.hi}}class bf{constructor(A,e){this.Cl=null,this.Tl=null,this.Pl=null,this.Rl=null,this.Dl=null,this.Vl=A,this.jr=e}Ol(){return this.Vl}Vn(){var A,e;(e=(A=this.Vl).updateAllViews)===null||e===void 0||e.call(A)}Pn(){var A,e,t,i;const s=(t=(e=(A=this.Vl).paneViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Cl)===null||i===void 0?void 0:i.Ml)===s)return this.Cl.xl;const n=s.map((o=>new Js(o)));return this.Cl={Ml:s,xl:n},n}Qi(){var A,e,t,i;const s=(t=(e=(A=this.Vl).timeAxisViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Tl)===null||i===void 0?void 0:i.Ml)===s)return this.Tl.xl;const n=this.jr.$t().St(),o=s.map((a=>new Cf(a,n)));return this.Tl={Ml:s,xl:o},o}Rn(){var A,e,t,i;const s=(t=(e=(A=this.Vl).priceAxisViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Pl)===null||i===void 0?void 0:i.Ml)===s)return this.Pl.xl;const n=this.jr.Dt(),o=s.map((a=>new vf(a,n)));return this.Pl={Ml:s,xl:o},o}Bl(){var A,e,t,i;const s=(t=(e=(A=this.Vl).priceAxisPaneViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Rl)===null||i===void 0?void 0:i.Ml)===s)return this.Rl.xl;const n=s.map((o=>new Js(o)));return this.Rl={Ml:s,xl:n},n}Al(){var A,e,t,i;const s=(t=(e=(A=this.Vl).timeAxisPaneViews)===null||e===void 0?void 0:e.call(A))!==null&&t!==void 0?t:[];if(((i=this.Dl)===null||i===void 0?void 0:i.Ml)===s)return this.Dl.xl;const n=s.map((o=>new Js(o)));return this.Dl={Ml:s,xl:n},n}Il(A,e){var t,i,s;return(s=(i=(t=this.Vl).autoscaleInfo)===null||i===void 0?void 0:i.call(t,A,e))!==null&&s!==void 0?s:null}wr(A,e){var t,i,s;return(s=(i=(t=this.Vl).hitTest)===null||i===void 0?void 0:i.call(t,A,e))!==null&&s!==void 0?s:null}}function Zs(r,A,e,t){r.forEach((i=>{A(i).forEach((s=>{s.Sl()===e&&t.push(s)}))}))}function Ys(r){return r.Pn()}function yf(r){return r.Bl()}function Qf(r){return r.Al()}class js extends pf{constructor(A,e,t,i,s){super(A),this.zt=new wf,this.jh=new cf(this),this.zl=[],this.Ll=new qd(this),this.El=null,this.Nl=null,this.Fl=[],this.Wl=[],this.jl=null,this.Hl=[],this.cn=e,this.$l=t;const n=new hf(this);this.rn=[n],this.Hh=new xa(n,this,A),t!=="Area"&&t!=="Line"&&t!=="Baseline"||(this.El=new tf(this)),this.Ul(),this.ql(s)}S(){this.jl!==null&&clearTimeout(this.jl)}mh(A){return this.cn.priceLineColor||A}Zr(A){const e={Xr:!0},t=this.Dt();if(this.$t().St().Ni()||t.Ni()||this.zt.Ni())return e;const i=this.$t().St().Xs(),s=this.Ct();if(i===null||s===null)return e;let n,o;if(A){const u=this.zt.sl();if(u===null)return e;n=u,o=u.ee}else{const u=this.zt.ll(i.ui(),-1);if(u===null||(n=this.zt.Gh(u.ee),n===null))return e;o=u.ee}const a=n.Vt[3],l=this.Us().$s(o,{Vt:n}),c=t.Rt(a,s.Vt);return{Xr:!1,_t:a,Kt:t.Fi(a,s.Vt),xh:t.Yl(a),Sh:t.Zl(a,s.Vt),V:l.ce,ki:c,ee:o}}Us(){return this.Nl!==null||(this.Nl=new Bf(this)),this.Nl}W(){return this.cn}$h(A){const e=A.priceScaleId;e!==void 0&&e!==this.cn.priceScaleId&&this.$t().Xl(this,e),Ge(this.cn,A),A.priceFormat!==void 0&&(this.Ul(),this.$t().Kl()),this.$t().Gl(this),this.$t().Jl(),this.wn.bt("options")}J(A,e){this.zt.J(A),this.Ql(),this.wn.bt("data"),this.dn.bt("data"),this.El!==null&&(e&&e.ta?this.El.$r():A.length===0&&this.El.Hr());const t=this.$t().dr(this);this.$t().ia(t),this.$t().Gl(this),this.$t().Jl(),this.$t().Uh()}na(A){this.Fl=A,this.Ql();const e=this.$t().dr(this);this.dn.bt("data"),this.$t().ia(e),this.$t().Gl(this),this.$t().Jl(),this.$t().Uh()}sa(){return this.Fl}dh(){return this.Wl}ea(A){const e=new ff(this,A);return this.zl.push(e),this.$t().Gl(this),e}ra(A){const e=this.zl.indexOf(A);e!==-1&&this.zl.splice(e,1),this.$t().Gl(this)}Qh(){return this.$l}Ct(){const A=this.ha();return A===null?null:{Vt:A.Vt[3],la:A.ot}}ha(){const A=this.$t().St().Xs();if(A===null)return null;const e=A.Os();return this.zt.ll(e,1)}In(){return this.zt}ph(A){const e=this.zt.Gh(A);return e===null?null:this.$l==="Bar"||this.$l==="Candlestick"||this.$l==="Custom"?{ge:e.Vt[0],Me:e.Vt[1],xe:e.Vt[2],Se:e.Vt[3]}:e.Vt[3]}aa(A){const e=[];Zs(this.Hl,Ys,"top",e);const t=this.El;return t!==null&&t.yt()&&(this.jl===null&&t.qr()&&(this.jl=setTimeout((()=>{this.jl=null,this.$t().oa()}),0)),t.Ur(),e.unshift(t)),e}Pn(){const A=[];this._a()||A.push(this.Ll),A.push(this.wn,this.jh,this.dn);const e=this.zl.map((t=>t.qh()));return A.push(...e),Zs(this.Hl,Ys,"normal",A),A}ua(){return this.ca(Ys,"bottom")}da(A){return this.ca(yf,A)}fa(A){return this.ca(Qf,A)}va(A,e){return this.Hl.map((t=>t.wr(A,e))).filter((t=>t!==null))}Ji(A){return[this.Hh,...this.zl.map((e=>e.Yh()))]}Rn(A,e){if(e!==this.Yi&&!this._a())return[];const t=[...this.rn];for(const i of this.zl)t.push(i.Zh());return this.Hl.forEach((i=>{t.push(...i.Rn())})),t}Qi(){const A=[];return this.Hl.forEach((e=>{A.push(...e.Qi())})),A}Il(A,e){if(this.cn.autoscaleInfoProvider!==void 0){const t=this.cn.autoscaleInfoProvider((()=>{const i=this.pa(A,e);return i===null?null:i.Bh()}));return di.Ah(t)}return this.pa(A,e)}ma(){return this.cn.priceFormat.minMove}ba(){return this.wa}Vn(){var A;this.wn.bt(),this.dn.bt();for(const e of this.rn)e.bt();for(const e of this.zl)e.bt();this.jh.bt(),this.Ll.bt(),(A=this.El)===null||A===void 0||A.bt(),this.Hl.forEach((e=>e.Vn()))}Dt(){return tA(super.Dt())}kt(A){if(!((this.$l==="Line"||this.$l==="Area"||this.$l==="Baseline")&&this.cn.crosshairMarkerVisible))return null;const e=this.zt.Gh(A);return e===null?null:{_t:e.Vt[3],ht:this.ga(),Ot:this.Ma(),Pt:this.xa(),Tt:this.Sa(A)}}bh(){return this.cn.title}yt(){return this.cn.visible}ka(A){this.Hl.push(new bf(A,this))}ya(A){this.Hl=this.Hl.filter((e=>e.Ol()!==A))}Ca(){if(this.wn instanceof $s)return A=>this.wn.We(A)}Ta(){if(this.wn instanceof $s)return A=>this.wn.je(A)}_a(){return!li(this.Dt().Pa())}pa(A,e){if(!fr(A)||!fr(e)||this.zt.Ni())return null;const t=this.$l==="Line"||this.$l==="Area"||this.$l==="Baseline"||this.$l==="Histogram"?[3]:[2,1],i=this.zt.ol(A,e,t);let s=i!==null?new Fe(i.ml,i.bl):null;if(this.Qh()==="Histogram"){const o=this.cn.base,a=new Fe(o,o);s=s!==null?s.ts(a):a}let n=this.dn.uh();return this.Hl.forEach((o=>{const a=o.Il(A,e);if(a?.priceRange){const B=new Fe(a.priceRange.minValue,a.priceRange.maxValue);s=s!==null?s.ts(B):B}var l,c,u,d;a?.margins&&(l=n,c=a.margins,n={above:Math.max((u=l?.above)!==null&&u!==void 0?u:0,c.above),below:Math.max((d=l?.below)!==null&&d!==void 0?d:0,c.below)})})),new di(s,n)}ga(){switch(this.$l){case"Line":case"Area":case"Baseline":return this.cn.crosshairMarkerRadius}return 0}Ma(){switch(this.$l){case"Line":case"Area":case"Baseline":{const A=this.cn.crosshairMarkerBorderColor;if(A.length!==0)return A}}return null}xa(){switch(this.$l){case"Line":case"Area":case"Baseline":return this.cn.crosshairMarkerBorderWidth}return 0}Sa(A){switch(this.$l){case"Line":case"Area":case"Baseline":{const e=this.cn.crosshairMarkerBackgroundColor;if(e.length!==0)return e}}return this.Us().$s(A).ce}Ul(){switch(this.cn.priceFormat.type){case"custom":this.wa={format:this.cn.priceFormat.formatter};break;case"volume":this.wa=new Sd(this.cn.priceFormat.precision);break;case"percent":this.wa=new ga(this.cn.priceFormat.precision);break;default:{const A=Math.pow(10,this.cn.priceFormat.precision);this.wa=new ci(A,this.cn.priceFormat.minMove*A)}}this.Yi!==null&&this.Yi.Ra()}Ql(){const A=this.$t().St();if(!A.Da()||this.zt.Ni())return void(this.Wl=[]);const e=tA(this.zt.el());this.Wl=this.Fl.map(((t,i)=>{const s=tA(A.Va(t.time,!0)),n=s<e?1:-1;return{time:tA(this.zt.ll(s,n)).ee,position:t.position,shape:t.shape,color:t.color,id:t.id,th:i,text:t.text,size:t.size,originalTime:t.originalTime}}))}ql(A){switch(this.dn=new lf(this,this.$t()),this.$l){case"Bar":this.wn=new Nd(this,this.$t());break;case"Candlestick":this.wn=new Gd(this,this.$t());break;case"Line":this.wn=new Jd(this,this.$t());break;case"Custom":this.wn=new $s(this,this.$t(),ve(A));break;case"Area":this.wn=new kd(this,this.$t());break;case"Baseline":this.wn=new Pd(this,this.$t());break;case"Histogram":this.wn=new Xd(this,this.$t());break;default:throw Error("Unknown chart style assigned: "+this.$l)}}ca(A,e){const t=[];return Zs(this.Hl,A,e,t),t}}class Ff{constructor(A){this.cn=A}Oa(A,e,t){let i=A;if(this.cn.mode===0)return i;const s=t.vn(),n=s.Ct();if(n===null)return i;const o=s.Rt(A,n),a=t.Ba().filter((c=>c instanceof js)).reduce(((c,u)=>{if(t.vr(u)||!u.yt())return c;const d=u.Dt(),B=u.In();if(d.Ni()||!B.Kr(e))return c;const p=B.Gh(e);if(p===null)return c;const f=Rt(u.Ct());return c.concat([d.Rt(p.Vt[3],f.Vt)])}),[]);if(a.length===0)return i;a.sort(((c,u)=>Math.abs(c-o)-Math.abs(u-o)));const l=a[0];return i=s.pn(l,n),i}}class Uf extends Re{constructor(){super(...arguments),this.zt=null}J(A){this.zt=A}K({context:A,bitmapSize:e,horizontalPixelRatio:t,verticalPixelRatio:i}){if(this.zt===null)return;const s=Math.max(1,Math.floor(t));A.lineWidth=s,(function(n,o){n.save(),n.lineWidth%2&&n.translate(.5,.5),o(),n.restore()})(A,(()=>{const n=tA(this.zt);if(n.Aa){A.strokeStyle=n.Ia,Ht(A,n.za),A.beginPath();for(const o of n.La){const a=Math.round(o.Ea*t);A.moveTo(a,-s),A.lineTo(a,e.height+s)}A.stroke()}if(n.Na){A.strokeStyle=n.Fa,Ht(A,n.Wa),A.beginPath();for(const o of n.ja){const a=Math.round(o.Ea*i);A.moveTo(-s,a),A.lineTo(e.width+s,a)}A.stroke()}}))}}class Ef{constructor(A){this.Wt=new Uf,this.ft=!0,this.tn=A}bt(){this.ft=!0}gt(){if(this.ft){const A=this.tn.$t().W().grid,e={Na:A.horzLines.visible,Aa:A.vertLines.visible,Fa:A.horzLines.color,Ia:A.vertLines.color,Wa:A.horzLines.style,za:A.vertLines.style,ja:this.tn.vn().Ha(),La:(this.tn.$t().St().Ha()||[]).map((t=>({Ea:t.coord})))};this.Wt.J(e),this.ft=!1}return this.Wt}}class xf{constructor(A){this.wn=new Ef(A)}qh(){return this.wn}}const qs={$a:4,Ua:1e-4};function $t(r,A){const e=100*(r-A)/A;return A<0?-e:e}function Tf(r,A){const e=$t(r.Ph(),A),t=$t(r.Rh(),A);return new Fe(e,t)}function vr(r,A){const e=100*(r-A)/A+100;return A<0?-e:e}function Sf(r,A){const e=vr(r.Ph(),A),t=vr(r.Rh(),A);return new Fe(e,t)}function pi(r,A){const e=Math.abs(r);if(e<1e-15)return 0;const t=Math.log10(e+A.Ua)+A.$a;return r<0?-t:t}function br(r,A){const e=Math.abs(r);if(e<1e-15)return 0;const t=Math.pow(10,e-A.$a)-A.Ua;return r<0?-t:t}function yr(r,A){if(r===null)return null;const e=pi(r.Ph(),A),t=pi(r.Rh(),A);return new Fe(e,t)}function gi(r,A){if(r===null)return null;const e=br(r.Ph(),A),t=br(r.Rh(),A);return new Fe(e,t)}function An(r){if(r===null)return qs;const A=Math.abs(r.Rh()-r.Ph());if(A>=1||A<1e-15)return qs;const e=Math.ceil(Math.abs(Math.log10(A))),t=qs.$a+e;return{$a:t,Ua:1/Math.pow(10,t)}}class en{constructor(A,e){if(this.qa=A,this.Ya=e,(function(t){if(t<0)return!1;for(let i=t;i>1;i/=10)if(i%10!=0)return!1;return!0})(this.qa))this.Za=[2,2.5,2];else{this.Za=[];for(let t=this.qa;t!==1;){if(t%2==0)this.Za.push(2),t/=2;else{if(t%5!=0)throw new Error("unexpected base");this.Za.push(2,2.5),t/=5}if(this.Za.length>100)throw new Error("something wrong with base")}}}Xa(A,e,t){const i=this.qa===0?0:1/this.qa;let s=Math.pow(10,Math.max(0,Math.ceil(Math.log10(A-e)))),n=0,o=this.Ya[0];for(;;){const u=hi(s,i,1e-14)&&s>i+1e-14,d=hi(s,t*o,1e-14),B=hi(s,1,1e-14);if(!(u&&d&&B))break;s/=o,o=this.Ya[++n%this.Ya.length]}if(s<=i+1e-14&&(s=i),s=Math.max(1,s),this.Za.length>0&&(a=s,l=1,c=1e-14,Math.abs(a-l)<c))for(n=0,o=this.Za[0];hi(s,t*o,1e-14)&&s>i+1e-14;)s/=o,o=this.Za[++n%this.Za.length];var a,l,c;return s}}class Na{constructor(A,e,t,i){this.Ka=[],this.Li=A,this.qa=e,this.Ga=t,this.Ja=i}Xa(A,e){if(A<e)throw new Error("high < low");const t=this.Li.At(),i=(A-e)*this.Qa()/t,s=new en(this.qa,[2,2.5,2]),n=new en(this.qa,[2,2,2.5]),o=new en(this.qa,[2.5,2,2]),a=[];return a.push(s.Xa(A,e,i),n.Xa(A,e,i),o.Xa(A,e,i)),(function(l){if(l.length<1)throw Error("array is empty");let c=l[0];for(let u=1;u<l.length;++u)l[u]<c&&(c=l[u]);return c})(a)}io(){const A=this.Li,e=A.Ct();if(e===null)return void(this.Ka=[]);const t=A.At(),i=this.Ga(t-1,e),s=this.Ga(0,e),n=this.Li.W().entireTextOnly?this.no()/2:0,o=n,a=t-1-n,l=Math.max(i,s),c=Math.min(i,s);if(l===c)return void(this.Ka=[]);let u=this.Xa(l,c),d=l%u;d+=d<0?u:0;const B=l>=c?1:-1;let p=null,f=0;for(let w=l-d;w>c;w-=u){const F=this.Ja(w,e,!0);p!==null&&Math.abs(F-p)<this.Qa()||F<o||F>a||(f<this.Ka.length?(this.Ka[f].Ea=F,this.Ka[f].so=A.eo(w)):this.Ka.push({Ea:F,so:A.eo(w)}),f++,p=F,A.ro()&&(u=this.Xa(w*B,c)))}this.Ka.length=f}Ha(){return this.Ka}no(){return this.Li.P()}Qa(){return Math.ceil(2.5*this.no())}}function Ka(r){return r.slice().sort(((A,e)=>tA(A.Xi())-tA(e.Xi())))}var Va;(function(r){r[r.Normal=0]="Normal",r[r.Logarithmic=1]="Logarithmic",r[r.Percentage=2]="Percentage",r[r.IndexedTo100=3]="IndexedTo100"})(Va||(Va={}));const Pa=new ga,za=new ci(100,1);class Hf{constructor(A,e,t,i){this.ho=0,this.lo=null,this.Ih=null,this.ao=null,this.oo={_o:!1,uo:null},this.co=0,this.do=0,this.fo=new ee,this.vo=new ee,this.po=[],this.mo=null,this.bo=null,this.wo=null,this.Mo=null,this.wa=za,this.xo=An(null),this.So=A,this.cn=e,this.ko=t,this.yo=i,this.Co=new Na(this,100,this.To.bind(this),this.Po.bind(this))}Pa(){return this.So}W(){return this.cn}$h(A){if(Ge(this.cn,A),this.Ra(),A.mode!==void 0&&this.Ro({Cr:A.mode}),A.scaleMargins!==void 0){const e=ve(A.scaleMargins.top),t=ve(A.scaleMargins.bottom);if(e<0||e>1)throw new Error(`Invalid top margin - expect value between 0 and 1, given=${e}`);if(t<0||t>1)throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${t}`);if(e+t>1)throw new Error(`Invalid margins - sum of margins must be less than 1, given=${e+t}`);this.Do(),this.bo=null}}Vo(){return this.cn.autoScale}ro(){return this.cn.mode===1}Mh(){return this.cn.mode===2}Oo(){return this.cn.mode===3}Cr(){return{Wn:this.cn.autoScale,Bo:this.cn.invertScale,Cr:this.cn.mode}}Ro(A){const e=this.Cr();let t=null;A.Wn!==void 0&&(this.cn.autoScale=A.Wn),A.Cr!==void 0&&(this.cn.mode=A.Cr,A.Cr!==2&&A.Cr!==3||(this.cn.autoScale=!0),this.oo._o=!1),e.Cr===1&&A.Cr!==e.Cr&&((function(s,n){if(s===null)return!1;const o=br(s.Ph(),n),a=br(s.Rh(),n);return isFinite(o)&&isFinite(a)})(this.Ih,this.xo)?(t=gi(this.Ih,this.xo),t!==null&&this.Ao(t)):this.cn.autoScale=!0),A.Cr===1&&A.Cr!==e.Cr&&(t=yr(this.Ih,this.xo),t!==null&&this.Ao(t));const i=e.Cr!==this.cn.mode;i&&(e.Cr===2||this.Mh())&&this.Ra(),i&&(e.Cr===3||this.Oo())&&this.Ra(),A.Bo!==void 0&&e.Bo!==A.Bo&&(this.cn.invertScale=A.Bo,this.Io()),this.vo.m(e,this.Cr())}zo(){return this.vo}P(){return this.ko.fontSize}At(){return this.ho}Lo(A){this.ho!==A&&(this.ho=A,this.Do(),this.bo=null)}Eo(){if(this.lo)return this.lo;const A=this.At()-this.No()-this.Fo();return this.lo=A,A}Lh(){return this.Wo(),this.Ih}Ao(A,e){const t=this.Ih;(e||t===null&&A!==null||t!==null&&!t.Ch(A))&&(this.bo=null,this.Ih=A)}Ni(){return this.Wo(),this.ho===0||!this.Ih||this.Ih.Ni()}jo(A){return this.Bo()?A:this.At()-1-A}Rt(A,e){return this.Mh()?A=$t(A,e):this.Oo()&&(A=vr(A,e)),this.Po(A,e)}te(A,e,t){this.Wo();const i=this.Fo(),s=tA(this.Lh()),n=s.Ph(),o=s.Rh(),a=this.Eo()-1,l=this.Bo(),c=a/(o-n),u=t===void 0?0:t.from,d=t===void 0?A.length:t.to,B=this.Ho();for(let p=u;p<d;p++){const f=A[p],w=f._t;if(isNaN(w))continue;let F=w;B!==null&&(F=B(f._t,e));const C=i+c*(F-n),E=l?C:this.ho-1-C;f.st=E}}be(A,e,t){this.Wo();const i=this.Fo(),s=tA(this.Lh()),n=s.Ph(),o=s.Rh(),a=this.Eo()-1,l=this.Bo(),c=a/(o-n),u=t===void 0?0:t.from,d=t===void 0?A.length:t.to,B=this.Ho();for(let p=u;p<d;p++){const f=A[p];let w=f.ge,F=f.Me,C=f.xe,E=f.Se;B!==null&&(w=B(f.ge,e),F=B(f.Me,e),C=B(f.xe,e),E=B(f.Se,e));let U=i+c*(w-n),S=l?U:this.ho-1-U;f.pe=S,U=i+c*(F-n),S=l?U:this.ho-1-U,f.de=S,U=i+c*(C-n),S=l?U:this.ho-1-U,f.fe=S,U=i+c*(E-n),S=l?U:this.ho-1-U,f.me=S}}pn(A,e){const t=this.To(A,e);return this.$o(t,e)}$o(A,e){let t=A;return this.Mh()?t=(function(i,s){return s<0&&(i=-i),i/100*s+s})(t,e):this.Oo()&&(t=(function(i,s){return i-=100,s<0&&(i=-i),i/100*s+s})(t,e)),t}Ba(){return this.po}Uo(){if(this.mo)return this.mo;let A=[];for(let e=0;e<this.po.length;e++){const t=this.po[e];t.Xi()===null&&t.Ki(e+1),A.push(t)}return A=Ka(A),this.mo=A,this.mo}qo(A){this.po.indexOf(A)===-1&&(this.po.push(A),this.Ra(),this.Yo())}Zo(A){const e=this.po.indexOf(A);if(e===-1)throw new Error("source is not attached to scale");this.po.splice(e,1),this.po.length===0&&(this.Ro({Wn:!0}),this.Ao(null)),this.Ra(),this.Yo()}Ct(){let A=null;for(const e of this.po){const t=e.Ct();t!==null&&(A===null||t.la<A.la)&&(A=t)}return A===null?null:A.Vt}Bo(){return this.cn.invertScale}Ha(){const A=this.Ct()===null;if(this.bo!==null&&(A||this.bo.Xo===A))return this.bo.Ha;this.Co.io();const e=this.Co.Ha();return this.bo={Ha:e,Xo:A},this.fo.m(),e}Ko(){return this.fo}Go(A){this.Mh()||this.Oo()||this.wo===null&&this.ao===null&&(this.Ni()||(this.wo=this.ho-A,this.ao=tA(this.Lh()).Th()))}Jo(A){if(this.Mh()||this.Oo()||this.wo===null)return;this.Ro({Wn:!1}),(A=this.ho-A)<0&&(A=0);let e=(this.wo+.2*(this.ho-1))/(A+.2*(this.ho-1));const t=tA(this.ao).Th();e=Math.max(e,.1),t.Vh(e),this.Ao(t)}Qo(){this.Mh()||this.Oo()||(this.wo=null,this.ao=null)}t_(A){this.Vo()||this.Mo===null&&this.ao===null&&(this.Ni()||(this.Mo=A,this.ao=tA(this.Lh()).Th()))}i_(A){if(this.Vo()||this.Mo===null)return;const e=tA(this.Lh()).Dh()/(this.Eo()-1);let t=A-this.Mo;this.Bo()&&(t*=-1);const i=t*e,s=tA(this.ao).Th();s.Oh(i),this.Ao(s,!0),this.bo=null}n_(){this.Vo()||this.Mo!==null&&(this.Mo=null,this.ao=null)}ba(){return this.wa||this.Ra(),this.wa}Fi(A,e){switch(this.cn.mode){case 2:return this.s_($t(A,e));case 3:return this.ba().format(vr(A,e));default:return this.Wh(A)}}eo(A){switch(this.cn.mode){case 2:return this.s_(A);case 3:return this.ba().format(A);default:return this.Wh(A)}}Yl(A){return this.Wh(A,tA(this.e_()).ba())}Zl(A,e){return A=$t(A,e),this.s_(A,Pa)}r_(){return this.po}h_(A){this.oo={uo:A,_o:!1}}Vn(){this.po.forEach((A=>A.Vn()))}Ra(){this.bo=null;const A=this.e_();let e=100;A!==null&&(e=Math.round(1/A.ma())),this.wa=za,this.Mh()?(this.wa=Pa,e=100):this.Oo()?(this.wa=new ci(100,1),e=100):A!==null&&(this.wa=A.ba()),this.Co=new Na(this,e,this.To.bind(this),this.Po.bind(this)),this.Co.io()}Yo(){this.mo=null}e_(){return this.po[0]||null}No(){return this.Bo()?this.cn.scaleMargins.bottom*this.At()+this.do:this.cn.scaleMargins.top*this.At()+this.co}Fo(){return this.Bo()?this.cn.scaleMargins.top*this.At()+this.co:this.cn.scaleMargins.bottom*this.At()+this.do}Wo(){this.oo._o||(this.oo._o=!0,this.l_())}Do(){this.lo=null}Po(A,e){if(this.Wo(),this.Ni())return 0;A=this.ro()&&A?pi(A,this.xo):A;const t=tA(this.Lh()),i=this.Fo()+(this.Eo()-1)*(A-t.Ph())/t.Dh();return this.jo(i)}To(A,e){if(this.Wo(),this.Ni())return 0;const t=this.jo(A),i=tA(this.Lh()),s=i.Ph()+i.Dh()*((t-this.Fo())/(this.Eo()-1));return this.ro()?br(s,this.xo):s}Io(){this.bo=null,this.Co.io()}l_(){const A=this.oo.uo;if(A===null)return;let e=null;const t=this.r_();let i=0,s=0;for(const a of t){if(!a.yt())continue;const l=a.Ct();if(l===null)continue;const c=a.Il(A.Os(),A.ui());let u=c&&c.Lh();if(u!==null){switch(this.cn.mode){case 1:u=yr(u,this.xo);break;case 2:u=Tf(u,l.Vt);break;case 3:u=Sf(u,l.Vt)}if(e=e===null?u:e.ts(tA(u)),c!==null){const d=c.Eh();d!==null&&(i=Math.max(i,d.above),s=Math.max(s,d.below))}}}if(i===this.co&&s===this.do||(this.co=i,this.do=s,this.bo=null,this.Do()),e!==null){if(e.Ph()===e.Rh()){const a=this.e_(),l=5*(a===null||this.Mh()||this.Oo()?1:a.ma());this.ro()&&(e=gi(e,this.xo)),e=new Fe(e.Ph()-l,e.Rh()+l),this.ro()&&(e=yr(e,this.xo))}if(this.ro()){const a=gi(e,this.xo),l=An(a);if(n=l,o=this.xo,n.$a!==o.$a||n.Ua!==o.Ua){const c=this.ao!==null?gi(this.ao,this.xo):null;this.xo=l,e=yr(a,l),c!==null&&(this.ao=yr(c,l))}}this.Ao(e)}else this.Ih===null&&(this.Ao(new Fe(-.5,.5)),this.xo=An(null));var n,o;this.oo._o=!0}Ho(){return this.Mh()?$t:this.Oo()?vr:this.ro()?A=>pi(A,this.xo):null}a_(A,e,t){return e===void 0?(t===void 0&&(t=this.ba()),t.format(A)):e(A)}Wh(A,e){return this.a_(A,this.yo.priceFormatter,e)}s_(A,e){return this.a_(A,this.yo.percentageFormatter,e)}}class Lf{constructor(A,e){this.po=[],this.o_=new Map,this.ho=0,this.__=0,this.u_=1e3,this.mo=null,this.c_=new ee,this.yl=A,this.$i=e,this.d_=new xf(this);const t=e.W();this.f_=this.v_("left",t.leftPriceScale),this.p_=this.v_("right",t.rightPriceScale),this.f_.zo().l(this.m_.bind(this,this.f_),this),this.p_.zo().l(this.m_.bind(this,this.p_),this),this.b_(t)}b_(A){if(A.leftPriceScale&&this.f_.$h(A.leftPriceScale),A.rightPriceScale&&this.p_.$h(A.rightPriceScale),A.localization&&(this.f_.Ra(),this.p_.Ra()),A.overlayPriceScales){const e=Array.from(this.o_.values());for(const t of e){const i=tA(t[0].Dt());i.$h(A.overlayPriceScales),A.localization&&i.Ra()}}}w_(A){switch(A){case"left":return this.f_;case"right":return this.p_}return this.o_.has(A)?ve(this.o_.get(A))[0].Dt():null}S(){this.$t().g_().p(this),this.f_.zo().p(this),this.p_.zo().p(this),this.po.forEach((A=>{A.S&&A.S()})),this.c_.m()}M_(){return this.u_}x_(A){this.u_=A}$t(){return this.$i}Hi(){return this.__}At(){return this.ho}S_(A){this.__=A,this.k_()}Lo(A){this.ho=A,this.f_.Lo(A),this.p_.Lo(A),this.po.forEach((e=>{if(this.vr(e)){const t=e.Dt();t!==null&&t.Lo(A)}})),this.k_()}Ba(){return this.po}vr(A){const e=A.Dt();return e===null||this.f_!==e&&this.p_!==e}qo(A,e,t){const i=t!==void 0?t:this.C_().y_+1;this.T_(A,e,i)}Zo(A){const e=this.po.indexOf(A);Bt(e!==-1,"removeDataSource: invalid data source"),this.po.splice(e,1);const t=tA(A.Dt()).Pa();if(this.o_.has(t)){const s=ve(this.o_.get(t)),n=s.indexOf(A);n!==-1&&(s.splice(n,1),s.length===0&&this.o_.delete(t))}const i=A.Dt();i&&i.Ba().indexOf(A)>=0&&i.Zo(A),i!==null&&(i.Yo(),this.P_(i)),this.mo=null}mr(A){return A===this.f_?"left":A===this.p_?"right":"overlay"}R_(){return this.f_}D_(){return this.p_}V_(A,e){A.Go(e)}O_(A,e){A.Jo(e),this.k_()}B_(A){A.Qo()}A_(A,e){A.t_(e)}I_(A,e){A.i_(e),this.k_()}z_(A){A.n_()}k_(){this.po.forEach((A=>{A.Vn()}))}vn(){let A=null;return this.$i.W().rightPriceScale.visible&&this.p_.Ba().length!==0?A=this.p_:this.$i.W().leftPriceScale.visible&&this.f_.Ba().length!==0?A=this.f_:this.po.length!==0&&(A=this.po[0].Dt()),A===null&&(A=this.p_),A}pr(){let A=null;return this.$i.W().rightPriceScale.visible?A=this.p_:this.$i.W().leftPriceScale.visible&&(A=this.f_),A}P_(A){A!==null&&A.Vo()&&this.L_(A)}E_(A){const e=this.yl.Xs();A.Ro({Wn:!0}),e!==null&&A.h_(e),this.k_()}N_(){this.L_(this.f_),this.L_(this.p_)}F_(){this.P_(this.f_),this.P_(this.p_),this.po.forEach((A=>{this.vr(A)&&this.P_(A.Dt())})),this.k_(),this.$i.Uh()}Uo(){return this.mo===null&&(this.mo=Ka(this.po)),this.mo}W_(){return this.c_}j_(){return this.d_}L_(A){const e=A.r_();if(e&&e.length>0&&!this.yl.Ni()){const t=this.yl.Xs();t!==null&&A.h_(t)}A.Vn()}C_(){const A=this.Uo();if(A.length===0)return{H_:0,y_:0};let e=0,t=0;for(let i=0;i<A.length;i++){const s=A[i].Xi();s!==null&&(s<e&&(e=s),s>t&&(t=s))}return{H_:e,y_:t}}T_(A,e,t){let i=this.w_(e);if(i===null&&(i=this.v_(e,this.$i.W().overlayPriceScales)),this.po.push(A),!li(e)){const s=this.o_.get(e)||[];s.push(A),this.o_.set(e,s)}i.qo(A),A.Gi(i),A.Ki(t),this.P_(i),this.mo=null}m_(A,e,t){e.Cr!==t.Cr&&this.L_(A)}v_(A,e){const t=Object.assign({visible:!0,autoScale:!0},ot(e)),i=new Hf(A,t,this.$i.W().layout,this.$i.W().localization);return i.Lo(this.At()),i}}class If{constructor(A,e,t=50){this.Ke=0,this.Ge=1,this.Je=1,this.tr=new Map,this.Qe=new Map,this.U_=A,this.q_=e,this.ir=t}Y_(A){const e=A.time,t=this.q_.cacheKey(e),i=this.tr.get(t);if(i!==void 0)return i.Z_;if(this.Ke===this.ir){const n=this.Qe.get(this.Je);this.Qe.delete(this.Je),this.tr.delete(ve(n)),this.Je++,this.Ke--}const s=this.U_(A);return this.tr.set(t,{Z_:s,rr:this.Ge}),this.Qe.set(this.Ge,t),this.Ke++,this.Ge++,s}}class Qr{constructor(A,e){Bt(A<=e,"right should be >= left"),this.X_=A,this.K_=e}Os(){return this.X_}ui(){return this.K_}G_(){return this.K_-this.X_+1}Kr(A){return this.X_<=A&&A<=this.K_}Ch(A){return this.X_===A.Os()&&this.K_===A.ui()}}function Ga(r,A){return r===null||A===null?r===A:r.Ch(A)}class Mf{constructor(){this.J_=new Map,this.tr=null,this.Q_=!1}tu(A){this.Q_=A,this.tr=null}iu(A,e){this.nu(e),this.tr=null;for(let t=e;t<A.length;++t){const i=A[t];let s=this.J_.get(i.timeWeight);s===void 0&&(s=[],this.J_.set(i.timeWeight,s)),s.push({index:t,time:i.time,weight:i.timeWeight,originalTime:i.originalTime})}}su(A,e){const t=Math.ceil(e/A);return this.tr!==null&&this.tr.eu===t||(this.tr={Ha:this.ru(t),eu:t}),this.tr.Ha}nu(A){if(A===0)return void this.J_.clear();const e=[];this.J_.forEach(((t,i)=>{A<=t[0].index?e.push(i):t.splice(Br(t,A,(s=>s.index<A)),1/0)}));for(const t of e)this.J_.delete(t)}ru(A){let e=[];for(const t of Array.from(this.J_.keys()).sort(((i,s)=>s-i))){if(!this.J_.get(t))continue;const i=e;e=[];const s=i.length;let n=0;const o=ve(this.J_.get(t)),a=o.length;let l=1/0,c=-1/0;for(let u=0;u<a;u++){const d=o[u],B=d.index;for(;n<s;){const p=i[n],f=p.index;if(!(f<B)){l=f;break}n++,e.push(p),c=f,l=1/0}if(l-B>=A&&B-c>=A)e.push(d),c=B;else if(this.Q_)return i}for(;n<s;n++)e.push(i[n])}return e}}class Xt{constructor(A){this.hu=A}lu(){return this.hu===null?null:new Qr(Math.floor(this.hu.Os()),Math.ceil(this.hu.ui()))}au(){return this.hu}static ou(){return new Xt(null)}}function Df(r,A){return r.weight>A.weight?r:A}class _f{constructor(A,e,t,i){this.__=0,this._u=null,this.uu=[],this.Mo=null,this.wo=null,this.cu=new Mf,this.du=new Map,this.fu=Xt.ou(),this.vu=!0,this.pu=new ee,this.mu=new ee,this.bu=new ee,this.wu=null,this.gu=null,this.Mu=[],this.cn=e,this.yo=t,this.xu=e.rightOffset,this.Su=e.barSpacing,this.$i=A,this.q_=i,this.ku(),this.cu.tu(e.uniformDistribution)}W(){return this.cn}yu(A){Ge(this.yo,A),this.Cu(),this.ku()}$h(A,e){var t;Ge(this.cn,A),this.cn.fixLeftEdge&&this.Tu(),this.cn.fixRightEdge&&this.Pu(),A.barSpacing!==void 0&&this.$i.Gn(A.barSpacing),A.rightOffset!==void 0&&this.$i.Jn(A.rightOffset),A.minBarSpacing!==void 0&&this.$i.Gn((t=A.barSpacing)!==null&&t!==void 0?t:this.Su),this.Cu(),this.ku(),this.bu.m()}mn(A){var e,t;return(t=(e=this.uu[A])===null||e===void 0?void 0:e.time)!==null&&t!==void 0?t:null}Ui(A){var e;return(e=this.uu[A])!==null&&e!==void 0?e:null}Va(A,e){if(this.uu.length<1)return null;if(this.q_.key(A)>this.q_.key(this.uu[this.uu.length-1].time))return e?this.uu.length-1:null;const t=Br(this.uu,this.q_.key(A),((i,s)=>this.q_.key(i.time)<s));return this.q_.key(A)<this.q_.key(this.uu[t].time)?e?t:null:t}Ni(){return this.__===0||this.uu.length===0||this._u===null}Da(){return this.uu.length>0}Xs(){return this.Ru(),this.fu.lu()}Du(){return this.Ru(),this.fu.au()}Vu(){const A=this.Xs();if(A===null)return null;const e={from:A.Os(),to:A.ui()};return this.Ou(e)}Ou(A){const e=Math.round(A.from),t=Math.round(A.to),i=tA(this.Bu()),s=tA(this.Au());return{from:tA(this.Ui(Math.max(i,e))),to:tA(this.Ui(Math.min(s,t)))}}Iu(A){return{from:tA(this.Va(A.from,!0)),to:tA(this.Va(A.to,!0))}}Hi(){return this.__}S_(A){if(!isFinite(A)||A<=0||this.__===A)return;const e=this.Du(),t=this.__;if(this.__=A,this.vu=!0,this.cn.lockVisibleTimeRangeOnResize&&t!==0){const i=this.Su*A/t;this.Su=i}if(this.cn.fixLeftEdge&&e!==null&&e.Os()<=0){const i=t-A;this.xu-=Math.round(i/this.Su)+1,this.vu=!0}this.zu(),this.Lu()}It(A){if(this.Ni()||!fr(A))return 0;const e=this.Eu()+this.xu-A;return this.__-(e+.5)*this.Su-1}Qs(A,e){const t=this.Eu(),i=e===void 0?0:e.from,s=e===void 0?A.length:e.to;for(let n=i;n<s;n++){const o=A[n].ot,a=t+this.xu-o,l=this.__-(a+.5)*this.Su-1;A[n].nt=l}}Nu(A){return Math.ceil(this.Fu(A))}Jn(A){this.vu=!0,this.xu=A,this.Lu(),this.$i.Wu(),this.$i.Uh()}le(){return this.Su}Gn(A){this.ju(A),this.Lu(),this.$i.Wu(),this.$i.Uh()}Hu(){return this.xu}Ha(){if(this.Ni())return null;if(this.gu!==null)return this.gu;const A=this.Su,e=5*(this.$i.W().layout.fontSize+4)/8*(this.cn.tickMarkMaxCharacterLength||8),t=Math.round(e/A),i=tA(this.Xs()),s=Math.max(i.Os(),i.Os()-t),n=Math.max(i.ui(),i.ui()-t),o=this.cu.su(A,e),a=this.Bu()+t,l=this.Au()-t,c=this.$u(),u=this.cn.fixLeftEdge||c,d=this.cn.fixRightEdge||c;let B=0;for(const p of o){if(!(s<=p.index&&p.index<=n))continue;let f;B<this.Mu.length?(f=this.Mu[B],f.coord=this.It(p.index),f.label=this.Uu(p),f.weight=p.weight):(f={needAlignCoordinate:!1,coord:this.It(p.index),label:this.Uu(p),weight:p.weight},this.Mu.push(f)),this.Su>e/2&&!c?f.needAlignCoordinate=!1:f.needAlignCoordinate=u&&p.index<=a||d&&p.index>=l,B++}return this.Mu.length=B,this.gu=this.Mu,this.Mu}qu(){this.vu=!0,this.Gn(this.cn.barSpacing),this.Jn(this.cn.rightOffset)}Yu(A){this.vu=!0,this._u=A,this.Lu(),this.Tu()}Zu(A,e){const t=this.Fu(A),i=this.le(),s=i+e*(i/10);this.Gn(s),this.cn.rightBarStaysOnScroll||this.Jn(this.Hu()+(t-this.Fu(A)))}Go(A){this.Mo&&this.n_(),this.wo===null&&this.wu===null&&(this.Ni()||(this.wo=A,this.Xu()))}Jo(A){if(this.wu===null)return;const e=Gs(this.__-A,0,this.__),t=Gs(this.__-tA(this.wo),0,this.__);e!==0&&t!==0&&this.Gn(this.wu.le*e/t)}Qo(){this.wo!==null&&(this.wo=null,this.Ku())}t_(A){this.Mo===null&&this.wu===null&&(this.Ni()||(this.Mo=A,this.Xu()))}i_(A){if(this.Mo===null)return;const e=(this.Mo-A)/this.le();this.xu=tA(this.wu).Hu+e,this.vu=!0,this.Lu()}n_(){this.Mo!==null&&(this.Mo=null,this.Ku())}Gu(){this.Ju(this.cn.rightOffset)}Ju(A,e=400){if(!isFinite(A))throw new RangeError("offset is required and must be finite number");if(!isFinite(e)||e<=0)throw new RangeError("animationDuration (optional) must be finite positive number");const t=this.xu,i=performance.now();this.$i.Zn({Qu:s=>(s-i)/e>=1,tc:s=>{const n=(s-i)/e;return n>=1?A:t+(A-t)*n}})}bt(A,e){this.vu=!0,this.uu=A,this.cu.iu(A,e),this.Lu()}nc(){return this.pu}sc(){return this.mu}ec(){return this.bu}Eu(){return this._u||0}rc(A){const e=A.G_();this.ju(this.__/e),this.xu=A.ui()-this.Eu(),this.Lu(),this.vu=!0,this.$i.Wu(),this.$i.Uh()}hc(){const A=this.Bu(),e=this.Au();A!==null&&e!==null&&this.rc(new Qr(A,e+this.cn.rightOffset))}lc(A){const e=new Qr(A.from,A.to);this.rc(e)}qi(A){return this.yo.timeFormatter!==void 0?this.yo.timeFormatter(A.originalTime):this.q_.formatHorzItem(A.time)}$u(){const{handleScroll:A,handleScale:e}=this.$i.W();return!(A.horzTouchDrag||A.mouseWheel||A.pressedMouseMove||A.vertTouchDrag||e.axisDoubleClickReset.time||e.axisPressedMouseMove.time||e.mouseWheel||e.pinch)}Bu(){return this.uu.length===0?null:0}Au(){return this.uu.length===0?null:this.uu.length-1}ac(A){return(this.__-1-A)/this.Su}Fu(A){const e=this.ac(A),t=this.Eu()+this.xu-e;return Math.round(1e6*t)/1e6}ju(A){const e=this.Su;this.Su=A,this.zu(),e!==this.Su&&(this.vu=!0,this.oc())}Ru(){if(!this.vu)return;if(this.vu=!1,this.Ni())return void this._c(Xt.ou());const A=this.Eu(),e=this.__/this.Su,t=this.xu+A,i=new Qr(t-e+1,t);this._c(new Xt(i))}zu(){const A=this.uc();if(this.Su<A&&(this.Su=A,this.vu=!0),this.__!==0){const e=.5*this.__;this.Su>e&&(this.Su=e,this.vu=!0)}}uc(){return this.cn.fixLeftEdge&&this.cn.fixRightEdge&&this.uu.length!==0?this.__/this.uu.length:this.cn.minBarSpacing}Lu(){const A=this.cc();A!==null&&this.xu<A&&(this.xu=A,this.vu=!0);const e=this.dc();this.xu>e&&(this.xu=e,this.vu=!0)}cc(){const A=this.Bu(),e=this._u;return A===null||e===null?null:A-e-1+(this.cn.fixLeftEdge?this.__/this.Su:Math.min(2,this.uu.length))}dc(){return this.cn.fixRightEdge?0:this.__/this.Su-Math.min(2,this.uu.length)}Xu(){this.wu={le:this.le(),Hu:this.Hu()}}Ku(){this.wu=null}Uu(A){let e=this.du.get(A.weight);return e===void 0&&(e=new If((t=>this.fc(t)),this.q_),this.du.set(A.weight,e)),e.Y_(A)}fc(A){return this.q_.formatTickmark(A,this.yo)}_c(A){const e=this.fu;this.fu=A,Ga(e.lu(),this.fu.lu())||this.pu.m(),Ga(e.au(),this.fu.au())||this.mu.m(),this.oc()}oc(){this.gu=null}Cu(){this.oc(),this.du.clear()}ku(){this.q_.updateFormatter(this.yo)}Tu(){if(!this.cn.fixLeftEdge)return;const A=this.Bu();if(A===null)return;const e=this.Xs();if(e===null)return;const t=e.Os()-A;if(t<0){const i=this.xu-t-1;this.Jn(i)}this.zu()}Pu(){this.Lu(),this.zu()}}class kf{X(A,e,t){A.useMediaCoordinateSpace((i=>this.K(i,e,t)))}gl(A,e,t){A.useMediaCoordinateSpace((i=>this.vc(i,e,t)))}vc(A,e,t){}}class Of extends kf{constructor(A){super(),this.mc=new Map,this.zt=A}K(A){}vc(A){if(!this.zt.yt)return;const{context:e,mediaSize:t}=A;let i=0;for(const n of this.zt.bc){if(n.Kt.length===0)continue;e.font=n.R;const o=this.wc(e,n.Kt);o>t.width?n.Zu=t.width/o:n.Zu=1,i+=n.gc*n.Zu}let s=0;switch(this.zt.Mc){case"top":s=0;break;case"center":s=Math.max((t.height-i)/2,0);break;case"bottom":s=Math.max(t.height-i,0)}e.fillStyle=this.zt.V;for(const n of this.zt.bc){e.save();let o=0;switch(this.zt.xc){case"left":e.textAlign="left",o=n.gc/2;break;case"center":e.textAlign="center",o=t.width/2;break;case"right":e.textAlign="right",o=t.width-1-n.gc/2}e.translate(o,s),e.textBaseline="top",e.font=n.R,e.scale(n.Zu,n.Zu),e.fillText(n.Kt,0,n.Sc),e.restore(),s+=n.gc*n.Zu}}wc(A,e){const t=this.kc(A.font);let i=t.get(e);return i===void 0&&(i=A.measureText(e).width,t.set(e,i)),i}kc(A){let e=this.mc.get(A);return e===void 0&&(e=new Map,this.mc.set(A,e)),e}}class Nf{constructor(A){this.ft=!0,this.Ft={yt:!1,V:"",bc:[],Mc:"center",xc:"center"},this.Wt=new Of(this.Ft),this.jt=A}bt(){this.ft=!0}gt(){return this.ft&&(this.Mt(),this.ft=!1),this.Wt}Mt(){const A=this.jt.W(),e=this.Ft;e.yt=A.visible,e.yt&&(e.V=A.color,e.xc=A.horzAlign,e.Mc=A.vertAlign,e.bc=[{Kt:A.text,R:Wt(A.fontSize,A.fontFamily,A.fontStyle),gc:1.2*A.fontSize,Sc:0,Zu:0}])}}class Kf extends Ps{constructor(A,e){super(),this.cn=e,this.wn=new Nf(this)}Rn(){return[]}Pn(){return[this.wn]}W(){return this.cn}Vn(){this.wn.bt()}}var Ra,Wa,$a,Xa,Ja;(function(r){r[r.OnTouchEnd=0]="OnTouchEnd",r[r.OnNextTap=1]="OnNextTap"})(Ra||(Ra={}));class Vf{constructor(A,e,t){this.yc=[],this.Cc=[],this.__=0,this.Tc=null,this.Pc=new ee,this.Rc=new ee,this.Dc=null,this.Vc=A,this.cn=e,this.q_=t,this.Oc=new wd(this),this.yl=new _f(this,e.timeScale,this.cn.localization,t),this.vt=new Td(this,e.crosshair),this.Bc=new Ff(e.crosshair),this.Ac=new Kf(this,e.watermark),this.Ic(),this.yc[0].x_(2e3),this.zc=this.Lc(0),this.Ec=this.Lc(1)}Kl(){this.Nc(ue.es())}Uh(){this.Nc(ue.ss())}oa(){this.Nc(new ue(1))}Gl(A){const e=this.Fc(A);this.Nc(e)}Wc(){return this.Tc}jc(A){const e=this.Tc;this.Tc=A,e!==null&&this.Gl(e.Hc),A!==null&&this.Gl(A.Hc)}W(){return this.cn}$h(A){Ge(this.cn,A),this.yc.forEach((e=>e.b_(A))),A.timeScale!==void 0&&this.yl.$h(A.timeScale),A.localization!==void 0&&this.yl.yu(A.localization),(A.leftPriceScale||A.rightPriceScale)&&this.Pc.m(),this.zc=this.Lc(0),this.Ec=this.Lc(1),this.Kl()}$c(A,e){if(A==="left")return void this.$h({leftPriceScale:e});if(A==="right")return void this.$h({rightPriceScale:e});const t=this.Uc(A);t!==null&&(t.Dt.$h(e),this.Pc.m())}Uc(A){for(const e of this.yc){const t=e.w_(A);if(t!==null)return{Ht:e,Dt:t}}return null}St(){return this.yl}qc(){return this.yc}Yc(){return this.Ac}Zc(){return this.vt}Xc(){return this.Rc}Kc(A,e){A.Lo(e),this.Wu()}S_(A){this.__=A,this.yl.S_(this.__),this.yc.forEach((e=>e.S_(A))),this.Wu()}Ic(A){const e=new Lf(this.yl,this);A!==void 0?this.yc.splice(A,0,e):this.yc.push(e);const t=A===void 0?this.yc.length-1:A,i=ue.es();return i.Nn(t,{Fn:0,Wn:!0}),this.Nc(i),e}V_(A,e,t){A.V_(e,t)}O_(A,e,t){A.O_(e,t),this.Jl(),this.Nc(this.Gc(A,2))}B_(A,e){A.B_(e),this.Nc(this.Gc(A,2))}A_(A,e,t){e.Vo()||A.A_(e,t)}I_(A,e,t){e.Vo()||(A.I_(e,t),this.Jl(),this.Nc(this.Gc(A,2)))}z_(A,e){e.Vo()||(A.z_(e),this.Nc(this.Gc(A,2)))}E_(A,e){A.E_(e),this.Nc(this.Gc(A,2))}Jc(A){this.yl.Go(A)}Qc(A,e){const t=this.St();if(t.Ni()||e===0)return;const i=t.Hi();A=Math.max(1,Math.min(A,i)),t.Zu(A,e),this.Wu()}td(A){this.nd(0),this.sd(A),this.ed()}rd(A){this.yl.Jo(A),this.Wu()}hd(){this.yl.Qo(),this.Uh()}nd(A){this.yl.t_(A)}sd(A){this.yl.i_(A),this.Wu()}ed(){this.yl.n_(),this.Uh()}wt(){return this.Cc}ld(A,e,t,i,s){this.vt.gn(A,e);let n=NaN,o=this.yl.Nu(A);const a=this.yl.Xs();a!==null&&(o=Math.min(Math.max(a.Os(),o),a.ui()));const l=i.vn(),c=l.Ct();c!==null&&(n=l.pn(e,c)),n=this.Bc.Oa(n,o,i),this.vt.kn(o,n,i),this.oa(),s||this.Rc.m(this.vt.xt(),{x:A,y:e},t)}ad(A,e,t){const i=t.vn(),s=i.Ct(),n=i.Rt(A,tA(s)),o=this.yl.Va(e,!0),a=this.yl.It(tA(o));this.ld(a,n,null,t,!0)}od(A){this.Zc().Cn(),this.oa(),A||this.Rc.m(null,null,null)}Jl(){const A=this.vt.Ht();if(A!==null){const e=this.vt.xn(),t=this.vt.Sn();this.ld(e,t,null,A)}this.vt.Vn()}_d(A,e,t){const i=this.yl.mn(0);e!==void 0&&t!==void 0&&this.yl.bt(e,t);const s=this.yl.mn(0),n=this.yl.Eu(),o=this.yl.Xs();if(o!==null&&i!==null&&s!==null){const a=o.Kr(n),l=this.q_.key(i)>this.q_.key(s),c=A!==null&&A>n&&!l,u=this.yl.W().allowShiftVisibleRangeOnWhitespaceReplacement,d=a&&(t!==void 0||u)&&this.yl.W().shiftVisibleRangeOnNewBar;if(c&&!d){const B=A-n;this.yl.Jn(this.yl.Hu()-B)}}this.yl.Yu(A)}ia(A){A!==null&&A.F_()}dr(A){const e=this.yc.find((t=>t.Uo().includes(A)));return e===void 0?null:e}Wu(){this.Ac.Vn(),this.yc.forEach((A=>A.F_())),this.Jl()}S(){this.yc.forEach((A=>A.S())),this.yc.length=0,this.cn.localization.priceFormatter=void 0,this.cn.localization.percentageFormatter=void 0,this.cn.localization.timeFormatter=void 0}ud(){return this.Oc}br(){return this.Oc.W()}g_(){return this.Pc}dd(A,e,t){const i=this.yc[0],s=this.fd(e,A,i,t);return this.Cc.push(s),this.Cc.length===1?this.Kl():this.Uh(),s}vd(A){const e=this.dr(A),t=this.Cc.indexOf(A);Bt(t!==-1,"Series not found"),this.Cc.splice(t,1),tA(e).Zo(A),A.S&&A.S()}Xl(A,e){const t=tA(this.dr(A));t.Zo(A);const i=this.Uc(e);if(i===null){const s=A.Xi();t.qo(A,e,s)}else{const s=i.Ht===t?A.Xi():void 0;i.Ht.qo(A,e,s)}}hc(){const A=ue.ss();A.$n(),this.Nc(A)}pd(A){const e=ue.ss();e.Yn(A),this.Nc(e)}Kn(){const A=ue.ss();A.Kn(),this.Nc(A)}Gn(A){const e=ue.ss();e.Gn(A),this.Nc(e)}Jn(A){const e=ue.ss();e.Jn(A),this.Nc(e)}Zn(A){const e=ue.ss();e.Zn(A),this.Nc(e)}Un(){const A=ue.ss();A.Un(),this.Nc(A)}md(){return this.cn.rightPriceScale.visible?"right":"left"}bd(){return this.Ec}q(){return this.zc}Bt(A){const e=this.Ec,t=this.zc;if(e===t)return e;if(A=Math.max(0,Math.min(100,Math.round(100*A))),this.Dc===null||this.Dc.Ps!==t||this.Dc.Rs!==e)this.Dc={Ps:t,Rs:e,wd:new Map};else{const s=this.Dc.wd.get(A);if(s!==void 0)return s}const i=(function(s,n,o){const[a,l,c,u]=dr(s),[d,B,p,f]=dr(n),w=[ke(a+o*(d-a)),ke(l+o*(B-l)),ke(c+o*(p-c)),oa(u+o*(f-u))];return`rgba(${w[0]}, ${w[1]}, ${w[2]}, ${w[3]})`})(t,e,A/100);return this.Dc.wd.set(A,i),i}Gc(A,e){const t=new ue(e);if(A!==null){const i=this.yc.indexOf(A);t.Nn(i,{Fn:e})}return t}Fc(A,e){return e===void 0&&(e=2),this.Gc(this.dr(A),e)}Nc(A){this.Vc&&this.Vc(A),this.yc.forEach((e=>e.j_().qh().bt()))}fd(A,e,t,i){const s=new js(this,A,e,t,i),n=A.priceScaleId!==void 0?A.priceScaleId:this.md();return t.qo(s,n),li(n)||s.$h(A),s}Lc(A){const e=this.cn.layout;return e.background.type==="gradient"?A===0?e.background.topColor:e.background.bottomColor:e.background.color}}function tn(r){return!Ze(r)&&!pr(r)}function Za(r){return Ze(r)}(function(r){r[r.Disabled=0]="Disabled",r[r.Continuous=1]="Continuous",r[r.OnDataUpdate=2]="OnDataUpdate"})(Wa||(Wa={})),(function(r){r[r.LastBar=0]="LastBar",r[r.LastVisible=1]="LastVisible"})($a||($a={})),(function(r){r.Solid="solid",r.VerticalGradient="gradient"})(Xa||(Xa={})),(function(r){r[r.Year=0]="Year",r[r.Month=1]="Month",r[r.DayOfMonth=2]="DayOfMonth",r[r.Time=3]="Time",r[r.TimeWithSeconds=4]="TimeWithSeconds"})(Ja||(Ja={}));const Ya=r=>r.getUTCFullYear();function Pf(r,A,e){return A.replace(/yyyy/g,(t=>at(Ya(t),4))(r)).replace(/yy/g,(t=>at(Ya(t)%100,2))(r)).replace(/MMMM/g,((t,i)=>new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"long"}))(r,e)).replace(/MMM/g,((t,i)=>new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"short"}))(r,e)).replace(/MM/g,(t=>at((i=>i.getUTCMonth()+1)(t),2))(r)).replace(/dd/g,(t=>at((i=>i.getUTCDate())(t),2))(r))}class ja{constructor(A="yyyy-MM-dd",e="default"){this.gd=A,this.Md=e}Y_(A){return Pf(A,this.gd,this.Md)}}class zf{constructor(A){this.xd=A||"%h:%m:%s"}Y_(A){return this.xd.replace("%h",at(A.getUTCHours(),2)).replace("%m",at(A.getUTCMinutes(),2)).replace("%s",at(A.getUTCSeconds(),2))}}const Gf={Sd:"yyyy-MM-dd",kd:"%h:%m:%s",yd:" ",Cd:"default"};class Rf{constructor(A={}){const e=Object.assign(Object.assign({},Gf),A);this.Td=new ja(e.Sd,e.Cd),this.Pd=new zf(e.kd),this.Rd=e.yd}Y_(A){return`${this.Td.Y_(A)}${this.Rd}${this.Pd.Y_(A)}`}}function Bi(r){return 60*r*60*1e3}function rn(r){return 60*r*1e3}const wi=[{Dd:(qa=1,1e3*qa),Vd:10},{Dd:rn(1),Vd:20},{Dd:rn(5),Vd:21},{Dd:rn(30),Vd:22},{Dd:Bi(1),Vd:30},{Dd:Bi(3),Vd:31},{Dd:Bi(6),Vd:32},{Dd:Bi(12),Vd:33}];var qa;function Al(r,A){if(r.getUTCFullYear()!==A.getUTCFullYear())return 70;if(r.getUTCMonth()!==A.getUTCMonth())return 60;if(r.getUTCDate()!==A.getUTCDate())return 50;for(let e=wi.length-1;e>=0;--e)if(Math.floor(A.getTime()/wi[e].Dd)!==Math.floor(r.getTime()/wi[e].Dd))return wi[e].Vd;return 0}function sn(r){let A=r;if(pr(r)&&(A=nn(r)),!tn(A))throw new Error("time must be of type BusinessDay");const e=new Date(Date.UTC(A.year,A.month-1,A.day,0,0,0,0));return{Od:Math.round(e.getTime()/1e3),Bd:A}}function el(r){if(!Za(r))throw new Error("time must be of type isUTCTimestamp");return{Od:r}}function nn(r){const A=new Date(r);if(isNaN(A.getTime()))throw new Error(`Invalid date string=${r}, expected format=yyyy-mm-dd`);return{day:A.getUTCDate(),month:A.getUTCMonth()+1,year:A.getUTCFullYear()}}function tl(r){pr(r.time)&&(r.time=nn(r.time))}class rl{options(){return this.cn}setOptions(A){this.cn=A,this.updateFormatter(A.localization)}preprocessData(A){Array.isArray(A)?(function(e){e.forEach(tl)})(A):tl(A)}createConverterToInternalObj(A){return tA((function(e){return e.length===0?null:tn(e[0].time)||pr(e[0].time)?sn:el})(A))}key(A){return typeof A=="object"&&"Od"in A?A.Od:this.key(this.convertHorzItemToInternal(A))}cacheKey(A){const e=A;return e.Bd===void 0?new Date(1e3*e.Od).getTime():new Date(Date.UTC(e.Bd.year,e.Bd.month-1,e.Bd.day)).getTime()}convertHorzItemToInternal(A){return Za(e=A)?el(e):tn(e)?sn(e):sn(nn(e));var e}updateFormatter(A){if(!this.cn)return;const e=A.dateFormat;this.cn.timeScale.timeVisible?this.Ad=new Rf({Sd:e,kd:this.cn.timeScale.secondsVisible?"%h:%m:%s":"%h:%m",yd:" ",Cd:A.locale}):this.Ad=new ja(e,A.locale)}formatHorzItem(A){const e=A;return this.Ad.Y_(new Date(1e3*e.Od))}formatTickmark(A,e){const t=(function(s,n,o){switch(s){case 0:case 10:return n?o?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return n?3:2;case 50:return 2;case 60:return 1;case 70:return 0}})(A.weight,this.cn.timeScale.timeVisible,this.cn.timeScale.secondsVisible),i=this.cn.timeScale;if(i.tickMarkFormatter!==void 0){const s=i.tickMarkFormatter(A.originalTime,t,e.locale);if(s!==null)return s}return(function(s,n,o){const a={};switch(n){case 0:a.year="numeric";break;case 1:a.month="short";break;case 2:a.day="numeric";break;case 3:a.hour12=!1,a.hour="2-digit",a.minute="2-digit";break;case 4:a.hour12=!1,a.hour="2-digit",a.minute="2-digit",a.second="2-digit"}const l=s.Bd===void 0?new Date(1e3*s.Od):new Date(Date.UTC(s.Bd.year,s.Bd.month-1,s.Bd.day));return new Date(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate(),l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()).toLocaleString(o,a)})(A.time,t,e.locale)}maxTickMarkWeight(A){let e=A.reduce(Df,A[0]).weight;return e>30&&e<50&&(e=30),e}fillWeightsForPoints(A,e){(function(t,i=0){if(t.length===0)return;let s=i===0?null:t[i-1].time.Od,n=s!==null?new Date(1e3*s):null,o=0;for(let a=i;a<t.length;++a){const l=t[a],c=new Date(1e3*l.time.Od);n!==null&&(l.timeWeight=Al(c,n)),o+=l.time.Od-(s||l.time.Od),s=l.time.Od,n=c}if(i===0&&t.length>1){const a=Math.ceil(o/(t.length-1)),l=new Date(1e3*(t[0].time.Od-a));t[0].timeWeight=Al(new Date(1e3*t[0].time.Od),l)}})(A,e)}static Id(A){return Ge({localization:{dateFormat:"dd MMM 'yy"}},A??{})}}const Jt=typeof window<"u";function il(){return!!Jt&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1}function on(){return!!Jt&&/iPhone|iPad|iPod/.test(window.navigator.platform)}function an(r){return r+r%2}function ln(r,A){return r.zd-A.zd}function cn(r,A,e){const t=(r.zd-A.zd)/(r.ot-A.ot);return Math.sign(t)*Math.min(Math.abs(t),e)}class Wf{constructor(A,e,t,i){this.Ld=null,this.Ed=null,this.Nd=null,this.Fd=null,this.Wd=null,this.jd=0,this.Hd=0,this.$d=A,this.Ud=e,this.qd=t,this.rs=i}Yd(A,e){if(this.Ld!==null){if(this.Ld.ot===e)return void(this.Ld.zd=A);if(Math.abs(this.Ld.zd-A)<this.rs)return}this.Fd=this.Nd,this.Nd=this.Ed,this.Ed=this.Ld,this.Ld={ot:e,zd:A}}Vr(A,e){if(this.Ld===null||this.Ed===null||e-this.Ld.ot>50)return;let t=0;const i=cn(this.Ld,this.Ed,this.Ud),s=ln(this.Ld,this.Ed),n=[i],o=[s];if(t+=s,this.Nd!==null){const l=cn(this.Ed,this.Nd,this.Ud);if(Math.sign(l)===Math.sign(i)){const c=ln(this.Ed,this.Nd);if(n.push(l),o.push(c),t+=c,this.Fd!==null){const u=cn(this.Nd,this.Fd,this.Ud);if(Math.sign(u)===Math.sign(i)){const d=ln(this.Nd,this.Fd);n.push(u),o.push(d),t+=d}}}}let a=0;for(let l=0;l<n.length;++l)a+=o[l]/t*n[l];Math.abs(a)<this.$d||(this.Wd={zd:A,ot:e},this.Hd=a,this.jd=(function(l,c){const u=Math.log(c);return Math.log(1*u/-l)/u})(Math.abs(a),this.qd))}tc(A){const e=tA(this.Wd),t=A-e.ot;return e.zd+this.Hd*(Math.pow(this.qd,t)-1)/Math.log(this.qd)}Qu(A){return this.Wd===null||this.Zd(A)===this.jd}Zd(A){const e=A-tA(this.Wd).ot;return Math.min(e,this.jd)}}class $f{constructor(A,e){this.Xd=void 0,this.Kd=void 0,this.Gd=void 0,this.en=!1,this.Jd=A,this.Qd=e,this.tf()}bt(){this.tf()}if(){this.Xd&&this.Jd.removeChild(this.Xd),this.Kd&&this.Jd.removeChild(this.Kd),this.Xd=void 0,this.Kd=void 0}nf(){return this.en!==this.sf()||this.Gd!==this.ef()}ef(){return aa(dr(this.Qd.W().layout.textColor))>160?"dark":"light"}sf(){return this.Qd.W().layout.attributionLogo}rf(){const A=new URL(location.href);return A.hostname?"&utm_source="+A.hostname+A.pathname:""}tf(){this.nf()&&(this.if(),this.en=this.sf(),this.en&&(this.Gd=this.ef(),this.Kd=document.createElement("style"),this.Kd.innerText="a#tv-attr-logo{--fill:#131722;--stroke:#fff;position:absolute;left:10px;bottom:10px;height:19px;width:35px;margin:0;padding:0;border:0;z-index:3;}a#tv-attr-logo[data-dark]{--fill:#D1D4DC;--stroke:#131722;}",this.Xd=document.createElement("a"),this.Xd.href=`https://www.tradingview.com/?utm_medium=lwc-link&utm_campaign=lwc-chart${this.rf()}`,this.Xd.title="Charting by TradingView",this.Xd.id="tv-attr-logo",this.Xd.target="_blank",this.Xd.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 35 19" width="35" height="19" fill="none"><g fill-rule="evenodd" clip-path="url(#a)" clip-rule="evenodd"><path fill="var(--stroke)" d="M2 0H0v10h6v9h21.4l.5-1.3 6-15 1-2.7H23.7l-.5 1.3-.2.6a5 5 0 0 0-7-.9V0H2Zm20 17h4l5.2-13 .8-2h-7l-1 2.5-.2.5-1.5 3.8-.3.7V17Zm-.8-10a3 3 0 0 0 .7-2.7A3 3 0 1 0 16.8 7h4.4ZM14 7V2H2v6h6v9h4V7h2Z"/><path fill="var(--fill)" d="M14 2H2v6h6v9h6V2Zm12 15h-7l6-15h7l-6 15Zm-7-9a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"/></g><defs><clipPath id="a"><path fill="var(--stroke)" d="M0 0h35v19H0z"/></clipPath></defs></svg>',this.Xd.toggleAttribute("data-dark",this.Gd==="dark"),this.Jd.appendChild(this.Kd),this.Jd.appendChild(this.Xd)))}}function Lt(r,A){const e=tA(r.ownerDocument).createElement("canvas");r.appendChild(e);const t=rd(e,{options:{allowResizeObserver:!1},transform:(i,s)=>({width:Math.max(i.width,s.width),height:Math.max(i.height,s.height)})});return t.resizeCanvasElement(A),t}function It(r){var A;r.width=1,r.height=1,(A=r.getContext("2d"))===null||A===void 0||A.clearRect(0,0,1,1)}function hn(r,A,e,t){r.gl&&r.gl(A,e,t)}function mi(r,A,e,t){r.X(A,e,t)}function un(r,A,e,t){const i=r(e,t);for(const s of i){const n=s.gt();n!==null&&A(n)}}function Xf(r){Jt&&window.chrome!==void 0&&r.addEventListener("mousedown",(A=>{if(A.button===1)return A.preventDefault(),!1}))}class dn{constructor(A,e,t){this.hf=0,this.lf=null,this.af={nt:Number.NEGATIVE_INFINITY,st:Number.POSITIVE_INFINITY},this._f=0,this.uf=null,this.cf={nt:Number.NEGATIVE_INFINITY,st:Number.POSITIVE_INFINITY},this.df=null,this.ff=!1,this.vf=null,this.pf=null,this.mf=!1,this.bf=!1,this.wf=!1,this.gf=null,this.Mf=null,this.xf=null,this.Sf=null,this.kf=null,this.yf=null,this.Cf=null,this.Tf=0,this.Pf=!1,this.Rf=!1,this.Df=!1,this.Vf=0,this.Of=null,this.Bf=!on(),this.Af=i=>{this.If(i)},this.zf=i=>{if(this.Lf(i)){const s=this.Ef(i);if(++this._f,this.uf&&this._f>1){const{Nf:n}=this.Ff(Ye(i),this.cf);n<30&&!this.wf&&this.Wf(s,this.Hf.jf),this.$f()}}else{const s=this.Ef(i);if(++this.hf,this.lf&&this.hf>1){const{Nf:n}=this.Ff(Ye(i),this.af);n<5&&!this.bf&&this.Uf(s,this.Hf.qf),this.Yf()}}},this.Zf=A,this.Hf=e,this.cn=t,this.Xf()}S(){this.gf!==null&&(this.gf(),this.gf=null),this.Mf!==null&&(this.Mf(),this.Mf=null),this.Sf!==null&&(this.Sf(),this.Sf=null),this.kf!==null&&(this.kf(),this.kf=null),this.yf!==null&&(this.yf(),this.yf=null),this.xf!==null&&(this.xf(),this.xf=null),this.Kf(),this.Yf()}Gf(A){this.Sf&&this.Sf();const e=this.Jf.bind(this);if(this.Sf=()=>{this.Zf.removeEventListener("mousemove",e)},this.Zf.addEventListener("mousemove",e),this.Lf(A))return;const t=this.Ef(A);this.Uf(t,this.Hf.Qf),this.Bf=!0}Yf(){this.lf!==null&&clearTimeout(this.lf),this.hf=0,this.lf=null,this.af={nt:Number.NEGATIVE_INFINITY,st:Number.POSITIVE_INFINITY}}$f(){this.uf!==null&&clearTimeout(this.uf),this._f=0,this.uf=null,this.cf={nt:Number.NEGATIVE_INFINITY,st:Number.POSITIVE_INFINITY}}Jf(A){if(this.Df||this.pf!==null||this.Lf(A))return;const e=this.Ef(A);this.Uf(e,this.Hf.tv),this.Bf=!0}iv(A){const e=fn(A.changedTouches,tA(this.Of));if(e===null||(this.Vf=Ci(A),this.Cf!==null)||this.Rf)return;this.Pf=!0;const t=this.Ff(Ye(e),tA(this.pf)),{nv:i,sv:s,Nf:n}=t;if(this.mf||!(n<5)){if(!this.mf){const o=.5*i,a=s>=o&&!this.cn.ev(),l=o>s&&!this.cn.rv();a||l||(this.Rf=!0),this.mf=!0,this.wf=!0,this.Kf(),this.$f()}if(!this.Rf){const o=this.Ef(A,e);this.Wf(o,this.Hf.hv),Zt(A)}}}lv(A){if(A.button!==0)return;const e=this.Ff(Ye(A),tA(this.vf)),{Nf:t}=e;if(t>=5&&(this.bf=!0,this.Yf()),this.bf){const i=this.Ef(A);this.Uf(i,this.Hf.av)}}Ff(A,e){const t=Math.abs(e.nt-A.nt),i=Math.abs(e.st-A.st);return{nv:t,sv:i,Nf:t+i}}ov(A){let e=fn(A.changedTouches,tA(this.Of));if(e===null&&A.touches.length===0&&(e=A.changedTouches[0]),e===null)return;this.Of=null,this.Vf=Ci(A),this.Kf(),this.pf=null,this.yf&&(this.yf(),this.yf=null);const t=this.Ef(A,e);if(this.Wf(t,this.Hf._v),++this._f,this.uf&&this._f>1){const{Nf:i}=this.Ff(Ye(e),this.cf);i<30&&!this.wf&&this.Wf(t,this.Hf.jf),this.$f()}else this.wf||(this.Wf(t,this.Hf.uv),this.Hf.uv&&Zt(A));this._f===0&&Zt(A),A.touches.length===0&&this.ff&&(this.ff=!1,Zt(A))}If(A){if(A.button!==0)return;const e=this.Ef(A);if(this.vf=null,this.Df=!1,this.kf&&(this.kf(),this.kf=null),il()&&this.Zf.ownerDocument.documentElement.removeEventListener("mouseleave",this.Af),!this.Lf(A))if(this.Uf(e,this.Hf.cv),++this.hf,this.lf&&this.hf>1){const{Nf:t}=this.Ff(Ye(A),this.af);t<5&&!this.bf&&this.Uf(e,this.Hf.qf),this.Yf()}else this.bf||this.Uf(e,this.Hf.dv)}Kf(){this.df!==null&&(clearTimeout(this.df),this.df=null)}fv(A){if(this.Of!==null)return;const e=A.changedTouches[0];this.Of=e.identifier,this.Vf=Ci(A);const t=this.Zf.ownerDocument.documentElement;this.wf=!1,this.mf=!1,this.Rf=!1,this.pf=Ye(e),this.yf&&(this.yf(),this.yf=null);{const s=this.iv.bind(this),n=this.ov.bind(this);this.yf=()=>{t.removeEventListener("touchmove",s),t.removeEventListener("touchend",n)},t.addEventListener("touchmove",s,{passive:!1}),t.addEventListener("touchend",n,{passive:!1}),this.Kf(),this.df=setTimeout(this.vv.bind(this,A),240)}const i=this.Ef(A,e);this.Wf(i,this.Hf.pv),this.uf||(this._f=0,this.uf=setTimeout(this.$f.bind(this),500),this.cf=Ye(e))}mv(A){if(A.button!==0)return;const e=this.Zf.ownerDocument.documentElement;il()&&e.addEventListener("mouseleave",this.Af),this.bf=!1,this.vf=Ye(A),this.kf&&(this.kf(),this.kf=null);{const i=this.lv.bind(this),s=this.If.bind(this);this.kf=()=>{e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",s)},e.addEventListener("mousemove",i),e.addEventListener("mouseup",s)}if(this.Df=!0,this.Lf(A))return;const t=this.Ef(A);this.Uf(t,this.Hf.bv),this.lf||(this.hf=0,this.lf=setTimeout(this.Yf.bind(this),500),this.af=Ye(A))}Xf(){this.Zf.addEventListener("mouseenter",this.Gf.bind(this)),this.Zf.addEventListener("touchcancel",this.Kf.bind(this));{const A=this.Zf.ownerDocument,e=t=>{this.Hf.wv&&(t.composed&&this.Zf.contains(t.composedPath()[0])||t.target&&this.Zf.contains(t.target)||this.Hf.wv())};this.Mf=()=>{A.removeEventListener("touchstart",e)},this.gf=()=>{A.removeEventListener("mousedown",e)},A.addEventListener("mousedown",e),A.addEventListener("touchstart",e,{passive:!0})}on()&&(this.xf=()=>{this.Zf.removeEventListener("dblclick",this.zf)},this.Zf.addEventListener("dblclick",this.zf)),this.Zf.addEventListener("mouseleave",this.gv.bind(this)),this.Zf.addEventListener("touchstart",this.fv.bind(this),{passive:!0}),Xf(this.Zf),this.Zf.addEventListener("mousedown",this.mv.bind(this)),this.Mv(),this.Zf.addEventListener("touchmove",(()=>{}),{passive:!1})}Mv(){this.Hf.xv===void 0&&this.Hf.Sv===void 0&&this.Hf.kv===void 0||(this.Zf.addEventListener("touchstart",(A=>this.yv(A.touches)),{passive:!0}),this.Zf.addEventListener("touchmove",(A=>{if(A.touches.length===2&&this.Cf!==null&&this.Hf.Sv!==void 0){const e=sl(A.touches[0],A.touches[1])/this.Tf;this.Hf.Sv(this.Cf,e),Zt(A)}}),{passive:!1}),this.Zf.addEventListener("touchend",(A=>{this.yv(A.touches)})))}yv(A){A.length===1&&(this.Pf=!1),A.length!==2||this.Pf||this.ff?this.Cv():this.Tv(A)}Tv(A){const e=this.Zf.getBoundingClientRect()||{left:0,top:0};this.Cf={nt:(A[0].clientX-e.left+(A[1].clientX-e.left))/2,st:(A[0].clientY-e.top+(A[1].clientY-e.top))/2},this.Tf=sl(A[0],A[1]),this.Hf.xv!==void 0&&this.Hf.xv(),this.Kf()}Cv(){this.Cf!==null&&(this.Cf=null,this.Hf.kv!==void 0&&this.Hf.kv())}gv(A){if(this.Sf&&this.Sf(),this.Lf(A)||!this.Bf)return;const e=this.Ef(A);this.Uf(e,this.Hf.Pv),this.Bf=!on()}vv(A){const e=fn(A.touches,tA(this.Of));if(e===null)return;const t=this.Ef(A,e);this.Wf(t,this.Hf.Rv),this.wf=!0,this.ff=!0}Lf(A){return A.sourceCapabilities&&A.sourceCapabilities.firesTouchEvents!==void 0?A.sourceCapabilities.firesTouchEvents:Ci(A)<this.Vf+500}Wf(A,e){e&&e.call(this.Hf,A)}Uf(A,e){e&&e.call(this.Hf,A)}Ef(A,e){const t=e||A,i=this.Zf.getBoundingClientRect()||{left:0,top:0};return{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY,localX:t.clientX-i.left,localY:t.clientY-i.top,ctrlKey:A.ctrlKey,altKey:A.altKey,shiftKey:A.shiftKey,metaKey:A.metaKey,Dv:!A.type.startsWith("mouse")&&A.type!=="contextmenu"&&A.type!=="click",Vv:A.type,Ov:t.target,Bv:A.view,Av:()=>{A.type!=="touchstart"&&Zt(A)}}}}function sl(r,A){const e=r.clientX-A.clientX,t=r.clientY-A.clientY;return Math.sqrt(e*e+t*t)}function Zt(r){r.cancelable&&r.preventDefault()}function Ye(r){return{nt:r.pageX,st:r.pageY}}function Ci(r){return r.timeStamp||performance.now()}function fn(r,A){for(let e=0;e<r.length;++e)if(r[e].identifier===A)return r[e];return null}function vi(r){return{Hc:r.Hc,Iv:{gr:r.zv.externalId},Lv:r.zv.cursorStyle}}function Jf(r,A,e){for(const t of r){const i=t.gt();if(i!==null&&i.wr){const s=i.wr(A,e);if(s!==null)return{Bv:t,Iv:s}}}return null}function pn(r,A){return e=>{var t,i,s,n;return((i=(t=e.Dt())===null||t===void 0?void 0:t.Pa())!==null&&i!==void 0?i:"")!==A?[]:(n=(s=e.da)===null||s===void 0?void 0:s.call(e,r))!==null&&n!==void 0?n:[]}}function nl(r,A,e,t){if(!r.length)return;let i=0;const s=e/2,n=r[0].At(t,!0);let o=A===1?s-(r[0].Vi()-n/2):r[0].Vi()-n/2-s;o=Math.max(0,o);for(let a=1;a<r.length;a++){const l=r[a],c=r[a-1],u=c.At(t,!1),d=l.Vi(),B=c.Vi();if(A===1?d>B-u:d<B+u){const p=B-u*A;l.Oi(p);const f=p-A*u/2;if((A===1?f<0:f>e)&&o>0){const w=A===1?-1-f:f-e,F=Math.min(w,o);for(let C=i;C<r.length;C++)r[C].Oi(r[C].Vi()+A*F);o-=F}}else i=a,o=A===1?B-u-d:d-(B+u)}}class ol{constructor(A,e,t,i){this.Li=null,this.Ev=null,this.Nv=!1,this.Fv=new wr(200),this.Qr=null,this.Wv=0,this.jv=!1,this.Hv=()=>{this.jv||this.tn.$v().$t().Uh()},this.Uv=()=>{this.jv||this.tn.$v().$t().Uh()},this.tn=A,this.cn=e,this.ko=e.layout,this.Oc=t,this.qv=i==="left",this.Yv=pn("normal",i),this.Zv=pn("top",i),this.Xv=pn("bottom",i),this.Kv=document.createElement("div"),this.Kv.style.height="100%",this.Kv.style.overflow="hidden",this.Kv.style.width="25px",this.Kv.style.left="0",this.Kv.style.position="relative",this.Gv=Lt(this.Kv,WA({width:16,height:16})),this.Gv.subscribeSuggestedBitmapSizeChanged(this.Hv);const s=this.Gv.canvasElement;s.style.position="absolute",s.style.zIndex="1",s.style.left="0",s.style.top="0",this.Jv=Lt(this.Kv,WA({width:16,height:16})),this.Jv.subscribeSuggestedBitmapSizeChanged(this.Uv);const n=this.Jv.canvasElement;n.style.position="absolute",n.style.zIndex="2",n.style.left="0",n.style.top="0";const o={bv:this.Qv.bind(this),pv:this.Qv.bind(this),av:this.tp.bind(this),hv:this.tp.bind(this),wv:this.ip.bind(this),cv:this.np.bind(this),_v:this.np.bind(this),qf:this.sp.bind(this),jf:this.sp.bind(this),Qf:this.ep.bind(this),Pv:this.rp.bind(this)};this.hp=new dn(this.Jv.canvasElement,o,{ev:()=>!this.cn.handleScroll.vertTouchDrag,rv:()=>!0})}S(){this.hp.S(),this.Jv.unsubscribeSuggestedBitmapSizeChanged(this.Uv),It(this.Jv.canvasElement),this.Jv.dispose(),this.Gv.unsubscribeSuggestedBitmapSizeChanged(this.Hv),It(this.Gv.canvasElement),this.Gv.dispose(),this.Li!==null&&this.Li.Ko().p(this),this.Li=null}lp(){return this.Kv}P(){return this.ko.fontSize}ap(){const A=this.Oc.W();return this.Qr!==A.R&&(this.Fv.nr(),this.Qr=A.R),A}op(){if(this.Li===null)return 0;let A=0;const e=this.ap(),t=tA(this.Gv.canvasElement.getContext("2d"));t.save();const i=this.Li.Ha();t.font=this._p(),i.length>0&&(A=Math.max(this.Fv.xi(t,i[0].so),this.Fv.xi(t,i[i.length-1].so)));const s=this.up();for(let l=s.length;l--;){const c=this.Fv.xi(t,s[l].Kt());c>A&&(A=c)}const n=this.Li.Ct();if(n!==null&&this.Ev!==null&&(o=this.cn.crosshair).mode!==2&&o.horzLine.visible&&o.horzLine.labelVisible){const l=this.Li.pn(1,n),c=this.Li.pn(this.Ev.height-2,n);A=Math.max(A,this.Fv.xi(t,this.Li.Fi(Math.floor(Math.min(l,c))+.11111111111111,n)),this.Fv.xi(t,this.Li.Fi(Math.ceil(Math.max(l,c))-.11111111111111,n)))}var o;t.restore();const a=A||34;return an(Math.ceil(e.C+e.T+e.A+e.I+5+a))}cp(A){this.Ev!==null&&Tt(this.Ev,A)||(this.Ev=A,this.jv=!0,this.Gv.resizeCanvasElement(A),this.Jv.resizeCanvasElement(A),this.jv=!1,this.Kv.style.width=`${A.width}px`,this.Kv.style.height=`${A.height}px`)}dp(){return tA(this.Ev).width}Gi(A){this.Li!==A&&(this.Li!==null&&this.Li.Ko().p(this),this.Li=A,A.Ko().l(this.fo.bind(this),this))}Dt(){return this.Li}nr(){const A=this.tn.fp();this.tn.$v().$t().E_(A,tA(this.Dt()))}vp(A){if(this.Ev===null)return;if(A!==1){this.pp(),this.Gv.applySuggestedBitmapSize();const t=St(this.Gv);t!==null&&(t.useBitmapCoordinateSpace((i=>{this.mp(i),this.Ie(i)})),this.tn.bp(t,this.Xv),this.wp(t),this.tn.bp(t,this.Yv),this.gp(t))}this.Jv.applySuggestedBitmapSize();const e=St(this.Jv);e!==null&&(e.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.Mp(e),this.tn.bp(e,this.Zv))}xp(){return this.Gv.bitmapSize}Sp(A,e,t){const i=this.xp();i.width>0&&i.height>0&&A.drawImage(this.Gv.canvasElement,e,t)}bt(){var A;(A=this.Li)===null||A===void 0||A.Ha()}Qv(A){if(this.Li===null||this.Li.Ni()||!this.cn.handleScale.axisPressedMouseMove.price)return;const e=this.tn.$v().$t(),t=this.tn.fp();this.Nv=!0,e.V_(t,this.Li,A.localY)}tp(A){if(this.Li===null||!this.cn.handleScale.axisPressedMouseMove.price)return;const e=this.tn.$v().$t(),t=this.tn.fp(),i=this.Li;e.O_(t,i,A.localY)}ip(){if(this.Li===null||!this.cn.handleScale.axisPressedMouseMove.price)return;const A=this.tn.$v().$t(),e=this.tn.fp(),t=this.Li;this.Nv&&(this.Nv=!1,A.B_(e,t))}np(A){if(this.Li===null||!this.cn.handleScale.axisPressedMouseMove.price)return;const e=this.tn.$v().$t(),t=this.tn.fp();this.Nv=!1,e.B_(t,this.Li)}sp(A){this.cn.handleScale.axisDoubleClickReset.price&&this.nr()}ep(A){this.Li!==null&&(!this.tn.$v().$t().W().handleScale.axisPressedMouseMove.price||this.Li.Mh()||this.Li.Oo()||this.kp(1))}rp(A){this.kp(0)}up(){const A=[],e=this.Li===null?void 0:this.Li;return(t=>{for(let i=0;i<t.length;++i){const s=t[i].Rn(this.tn.fp(),e);for(let n=0;n<s.length;n++)A.push(s[n])}})(this.tn.fp().Uo()),A}mp({context:A,bitmapSize:e}){const{width:t,height:i}=e,s=this.tn.fp().$t(),n=s.q(),o=s.bd();n===o?oi(A,0,0,t,i,n):ha(A,0,0,t,i,n,o)}Ie({context:A,bitmapSize:e,horizontalPixelRatio:t}){if(this.Ev===null||this.Li===null||!this.Li.W().borderVisible)return;A.fillStyle=this.Li.W().borderColor;const i=Math.max(1,Math.floor(this.ap().C*t));let s;s=this.qv?e.width-i:0,A.fillRect(s,0,i,e.height)}wp(A){if(this.Ev===null||this.Li===null)return;const e=this.Li.Ha(),t=this.Li.W(),i=this.ap(),s=this.qv?this.Ev.width-i.T:0;t.borderVisible&&t.ticksVisible&&A.useBitmapCoordinateSpace((({context:n,horizontalPixelRatio:o,verticalPixelRatio:a})=>{n.fillStyle=t.borderColor;const l=Math.max(1,Math.floor(a)),c=Math.floor(.5*a),u=Math.round(i.T*o);n.beginPath();for(const d of e)n.rect(Math.floor(s*o),Math.round(d.Ea*a)-c,u,l);n.fill()})),A.useMediaCoordinateSpace((({context:n})=>{var o;n.font=this._p(),n.fillStyle=(o=t.textColor)!==null&&o!==void 0?o:this.ko.textColor,n.textAlign=this.qv?"right":"left",n.textBaseline="middle";const a=this.qv?Math.round(s-i.A):Math.round(s+i.T+i.A),l=e.map((c=>this.Fv.Mi(n,c.so)));for(let c=e.length;c--;){const u=e[c];n.fillText(u.so,a,u.Ea+l[c])}}))}pp(){if(this.Ev===null||this.Li===null)return;const A=[],e=this.Li.Uo().slice(),t=this.tn.fp(),i=this.ap();this.Li===t.pr()&&this.tn.fp().Uo().forEach((n=>{t.vr(n)&&e.push(n)}));const s=this.Li;e.forEach((n=>{n.Rn(t,s).forEach((o=>{o.Oi(null),o.Bi()&&A.push(o)}))})),A.forEach((n=>n.Oi(n.ki()))),this.Li.W().alignLabels&&this.yp(A,i)}yp(A,e){if(this.Ev===null)return;const t=this.Ev.height/2,i=A.filter((n=>n.ki()<=t)),s=A.filter((n=>n.ki()>t));i.sort(((n,o)=>o.ki()-n.ki())),s.sort(((n,o)=>n.ki()-o.ki()));for(const n of A){const o=Math.floor(n.At(e)/2),a=n.ki();a>-o&&a<o&&n.Oi(o),a>this.Ev.height-o&&a<this.Ev.height+o&&n.Oi(this.Ev.height-o)}nl(i,1,this.Ev.height,e),nl(s,-1,this.Ev.height,e)}gp(A){if(this.Ev===null)return;const e=this.up(),t=this.ap(),i=this.qv?"right":"left";e.forEach((s=>{s.Ai()&&s.gt(tA(this.Li)).X(A,t,this.Fv,i)}))}Mp(A){if(this.Ev===null||this.Li===null)return;const e=this.tn.$v().$t(),t=[],i=this.tn.fp(),s=e.Zc().Rn(i,this.Li);s.length&&t.push(s);const n=this.ap(),o=this.qv?"right":"left";t.forEach((a=>{a.forEach((l=>{l.gt(tA(this.Li)).X(A,n,this.Fv,o)}))}))}kp(A){this.Kv.style.cursor=A===1?"ns-resize":"default"}fo(){const A=this.op();this.Wv<A&&this.tn.$v().$t().Kl(),this.Wv=A}_p(){return Wt(this.ko.fontSize,this.ko.fontFamily)}}function Zf(r,A){var e,t;return(t=(e=r.ua)===null||e===void 0?void 0:e.call(r,A))!==null&&t!==void 0?t:[]}function bi(r,A){var e,t;return(t=(e=r.Pn)===null||e===void 0?void 0:e.call(r,A))!==null&&t!==void 0?t:[]}function Yf(r,A){var e,t;return(t=(e=r.Ji)===null||e===void 0?void 0:e.call(r,A))!==null&&t!==void 0?t:[]}function jf(r,A){var e,t;return(t=(e=r.aa)===null||e===void 0?void 0:e.call(r,A))!==null&&t!==void 0?t:[]}class gn{constructor(A,e){this.Ev=WA({width:0,height:0}),this.Cp=null,this.Tp=null,this.Pp=null,this.Rp=null,this.Dp=!1,this.Vp=new ee,this.Op=new ee,this.Bp=0,this.Ap=!1,this.Ip=null,this.zp=!1,this.Lp=null,this.Ep=null,this.jv=!1,this.Hv=()=>{this.jv||this.Np===null||this.$i().Uh()},this.Uv=()=>{this.jv||this.Np===null||this.$i().Uh()},this.Qd=A,this.Np=e,this.Np.W_().l(this.Fp.bind(this),this,!0),this.Wp=document.createElement("td"),this.Wp.style.padding="0",this.Wp.style.position="relative";const t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.style.position="relative",t.style.overflow="hidden",this.jp=document.createElement("td"),this.jp.style.padding="0",this.Hp=document.createElement("td"),this.Hp.style.padding="0",this.Wp.appendChild(t),this.Gv=Lt(t,WA({width:16,height:16})),this.Gv.subscribeSuggestedBitmapSizeChanged(this.Hv);const i=this.Gv.canvasElement;i.style.position="absolute",i.style.zIndex="1",i.style.left="0",i.style.top="0",this.Jv=Lt(t,WA({width:16,height:16})),this.Jv.subscribeSuggestedBitmapSizeChanged(this.Uv);const s=this.Jv.canvasElement;s.style.position="absolute",s.style.zIndex="2",s.style.left="0",s.style.top="0",this.$p=document.createElement("tr"),this.$p.appendChild(this.jp),this.$p.appendChild(this.Wp),this.$p.appendChild(this.Hp),this.Up(),this.hp=new dn(this.Jv.canvasElement,this,{ev:()=>this.Ip===null&&!this.Qd.W().handleScroll.vertTouchDrag,rv:()=>this.Ip===null&&!this.Qd.W().handleScroll.horzTouchDrag})}S(){this.Cp!==null&&this.Cp.S(),this.Tp!==null&&this.Tp.S(),this.Pp=null,this.Jv.unsubscribeSuggestedBitmapSizeChanged(this.Uv),It(this.Jv.canvasElement),this.Jv.dispose(),this.Gv.unsubscribeSuggestedBitmapSizeChanged(this.Hv),It(this.Gv.canvasElement),this.Gv.dispose(),this.Np!==null&&this.Np.W_().p(this),this.hp.S()}fp(){return tA(this.Np)}qp(A){var e,t;this.Np!==null&&this.Np.W_().p(this),this.Np=A,this.Np!==null&&this.Np.W_().l(gn.prototype.Fp.bind(this),this,!0),this.Up(),this.Qd.Yp().indexOf(this)===this.Qd.Yp().length-1?(this.Pp=(e=this.Pp)!==null&&e!==void 0?e:new $f(this.Wp,this.Qd),this.Pp.bt()):((t=this.Pp)===null||t===void 0||t.if(),this.Pp=null)}$v(){return this.Qd}lp(){return this.$p}Up(){if(this.Np!==null&&(this.Zp(),this.$i().wt().length!==0)){if(this.Cp!==null){const A=this.Np.R_();this.Cp.Gi(tA(A))}if(this.Tp!==null){const A=this.Np.D_();this.Tp.Gi(tA(A))}}}Xp(){this.Cp!==null&&this.Cp.bt(),this.Tp!==null&&this.Tp.bt()}M_(){return this.Np!==null?this.Np.M_():0}x_(A){this.Np&&this.Np.x_(A)}Qf(A){if(!this.Np)return;this.Kp();const e=A.localX,t=A.localY;this.Gp(e,t,A)}bv(A){this.Kp(),this.Jp(),this.Gp(A.localX,A.localY,A)}tv(A){var e;if(!this.Np)return;this.Kp();const t=A.localX,i=A.localY;this.Gp(t,i,A);const s=this.wr(t,i);this.Qd.Qp((e=s?.Lv)!==null&&e!==void 0?e:null),this.$i().jc(s&&{Hc:s.Hc,Iv:s.Iv})}dv(A){this.Np!==null&&(this.Kp(),this.tm(A))}qf(A){this.Np!==null&&this.im(this.Op,A)}jf(A){this.qf(A)}av(A){this.Kp(),this.nm(A),this.Gp(A.localX,A.localY,A)}cv(A){this.Np!==null&&(this.Kp(),this.Ap=!1,this.sm(A))}uv(A){this.Np!==null&&this.tm(A)}Rv(A){if(this.Ap=!0,this.Ip===null){const e={x:A.localX,y:A.localY};this.rm(e,e,A)}}Pv(A){this.Np!==null&&(this.Kp(),this.Np.$t().jc(null),this.hm())}lm(){return this.Vp}am(){return this.Op}xv(){this.Bp=1,this.$i().Un()}Sv(A,e){if(!this.Qd.W().handleScale.pinch)return;const t=5*(e-this.Bp);this.Bp=e,this.$i().Qc(A.nt,t)}pv(A){this.Ap=!1,this.zp=this.Ip!==null,this.Jp();const e=this.$i().Zc();this.Ip!==null&&e.yt()&&(this.Lp={x:e.Yt(),y:e.Zt()},this.Ip={x:A.localX,y:A.localY})}hv(A){if(this.Np===null)return;const e=A.localX,t=A.localY;if(this.Ip===null)this.nm(A);else{this.zp=!1;const i=tA(this.Lp),s=i.x+(e-this.Ip.x),n=i.y+(t-this.Ip.y);this.Gp(s,n,A)}}_v(A){this.$v().W().trackingMode.exitMode===0&&(this.zp=!0),this.om(),this.sm(A)}wr(A,e){const t=this.Np;return t===null?null:(function(i,s,n){const o=i.Uo(),a=(function(l,c,u){var d,B;let p,f;for(const C of l){const E=(B=(d=C.va)===null||d===void 0?void 0:d.call(C,c,u))!==null&&B!==void 0?B:[];for(const U of E)w=U.zOrder,(!(F=p?.zOrder)||w==="top"&&F!=="top"||w==="normal"&&F==="bottom")&&(p=U,f=C)}var w,F;return p&&f?{zv:p,Hc:f}:null})(o,s,n);if(a?.zv.zOrder==="top")return vi(a);for(const l of o){if(a&&a.Hc===l&&a.zv.zOrder!=="bottom"&&!a.zv.isBackground)return vi(a);const c=Jf(l.Pn(i),s,n);if(c!==null)return{Hc:l,Bv:c.Bv,Iv:c.Iv};if(a&&a.Hc===l&&a.zv.zOrder!=="bottom"&&a.zv.isBackground)return vi(a)}return a?.zv?vi(a):null})(t,A,e)}_m(A,e){tA(e==="left"?this.Cp:this.Tp).cp(WA({width:A,height:this.Ev.height}))}um(){return this.Ev}cp(A){Tt(this.Ev,A)||(this.Ev=A,this.jv=!0,this.Gv.resizeCanvasElement(A),this.Jv.resizeCanvasElement(A),this.jv=!1,this.Wp.style.width=A.width+"px",this.Wp.style.height=A.height+"px")}dm(){const A=tA(this.Np);A.P_(A.R_()),A.P_(A.D_());for(const e of A.Ba())if(A.vr(e)){const t=e.Dt();t!==null&&A.P_(t),e.Vn()}}xp(){return this.Gv.bitmapSize}Sp(A,e,t){const i=this.xp();i.width>0&&i.height>0&&A.drawImage(this.Gv.canvasElement,e,t)}vp(A){if(A===0||this.Np===null)return;if(A>1&&this.dm(),this.Cp!==null&&this.Cp.vp(A),this.Tp!==null&&this.Tp.vp(A),A!==1){this.Gv.applySuggestedBitmapSize();const t=St(this.Gv);t!==null&&(t.useBitmapCoordinateSpace((i=>{this.mp(i)})),this.Np&&(this.fm(t,Zf),this.vm(t),this.pm(t),this.fm(t,bi),this.fm(t,Yf)))}this.Jv.applySuggestedBitmapSize();const e=St(this.Jv);e!==null&&(e.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.bm(e),this.fm(e,jf))}wm(){return this.Cp}gm(){return this.Tp}bp(A,e){this.fm(A,e)}Fp(){this.Np!==null&&this.Np.W_().p(this),this.Np=null}tm(A){this.im(this.Vp,A)}im(A,e){const t=e.localX,i=e.localY;A.M()&&A.m(this.$i().St().Nu(t),{x:t,y:i},e)}mp({context:A,bitmapSize:e}){const{width:t,height:i}=e,s=this.$i(),n=s.q(),o=s.bd();n===o?oi(A,0,0,t,i,o):ha(A,0,0,t,i,n,o)}vm(A){const e=tA(this.Np).j_().qh().gt();e!==null&&e.X(A,!1)}pm(A){const e=this.$i().Yc();this.Mm(A,bi,hn,e),this.Mm(A,bi,mi,e)}bm(A){this.Mm(A,bi,mi,this.$i().Zc())}fm(A,e){const t=tA(this.Np).Uo();for(const i of t)this.Mm(A,e,hn,i);for(const i of t)this.Mm(A,e,mi,i)}Mm(A,e,t,i){const s=tA(this.Np),n=s.$t().Wc(),o=n!==null&&n.Hc===i,a=n!==null&&o&&n.Iv!==void 0?n.Iv.Mr:void 0;un(e,(l=>t(l,A,o,a)),i,s)}Zp(){if(this.Np===null)return;const A=this.Qd,e=this.Np.R_().W().visible,t=this.Np.D_().W().visible;e||this.Cp===null||(this.jp.removeChild(this.Cp.lp()),this.Cp.S(),this.Cp=null),t||this.Tp===null||(this.Hp.removeChild(this.Tp.lp()),this.Tp.S(),this.Tp=null);const i=A.$t().ud();e&&this.Cp===null&&(this.Cp=new ol(this,A.W(),i,"left"),this.jp.appendChild(this.Cp.lp())),t&&this.Tp===null&&(this.Tp=new ol(this,A.W(),i,"right"),this.Hp.appendChild(this.Tp.lp()))}xm(A){return A.Dv&&this.Ap||this.Ip!==null}Sm(A){return Math.max(0,Math.min(A,this.Ev.width-1))}km(A){return Math.max(0,Math.min(A,this.Ev.height-1))}Gp(A,e,t){this.$i().ld(this.Sm(A),this.km(e),t,tA(this.Np))}hm(){this.$i().od()}om(){this.zp&&(this.Ip=null,this.hm())}rm(A,e,t){this.Ip=A,this.zp=!1,this.Gp(e.x,e.y,t);const i=this.$i().Zc();this.Lp={x:i.Yt(),y:i.Zt()}}$i(){return this.Qd.$t()}sm(A){if(!this.Dp)return;const e=this.$i(),t=this.fp();if(e.z_(t,t.vn()),this.Rp=null,this.Dp=!1,e.ed(),this.Ep!==null){const i=performance.now(),s=e.St();this.Ep.Vr(s.Hu(),i),this.Ep.Qu(i)||e.Zn(this.Ep)}}Kp(){this.Ip=null}Jp(){if(this.Np){if(this.$i().Un(),document.activeElement!==document.body&&document.activeElement!==document.documentElement)tA(document.activeElement).blur();else{const A=document.getSelection();A!==null&&A.removeAllRanges()}!this.Np.vn().Ni()&&this.$i().St().Ni()}}nm(A){if(this.Np===null)return;const e=this.$i(),t=e.St();if(t.Ni())return;const i=this.Qd.W(),s=i.handleScroll,n=i.kineticScroll;if((!s.pressedMouseMove||A.Dv)&&(!s.horzTouchDrag&&!s.vertTouchDrag||!A.Dv))return;const o=this.Np.vn(),a=performance.now();if(this.Rp!==null||this.xm(A)||(this.Rp={x:A.clientX,y:A.clientY,Od:a,ym:A.localX,Cm:A.localY}),this.Rp!==null&&!this.Dp&&(this.Rp.x!==A.clientX||this.Rp.y!==A.clientY)){if(A.Dv&&n.touch||!A.Dv&&n.mouse){const l=t.le();this.Ep=new Wf(.2/l,7/l,.997,15/l),this.Ep.Yd(t.Hu(),this.Rp.Od)}else this.Ep=null;o.Ni()||e.A_(this.Np,o,A.localY),e.nd(A.localX),this.Dp=!0}this.Dp&&(o.Ni()||e.I_(this.Np,o,A.localY),e.sd(A.localX),this.Ep!==null&&this.Ep.Yd(t.Hu(),a))}}class al{constructor(A,e,t,i,s){this.ft=!0,this.Ev=WA({width:0,height:0}),this.Hv=()=>this.vp(3),this.qv=A==="left",this.Oc=t.ud,this.cn=e,this.Tm=i,this.Pm=s,this.Kv=document.createElement("div"),this.Kv.style.width="25px",this.Kv.style.height="100%",this.Kv.style.overflow="hidden",this.Gv=Lt(this.Kv,WA({width:16,height:16})),this.Gv.subscribeSuggestedBitmapSizeChanged(this.Hv)}S(){this.Gv.unsubscribeSuggestedBitmapSizeChanged(this.Hv),It(this.Gv.canvasElement),this.Gv.dispose()}lp(){return this.Kv}um(){return this.Ev}cp(A){Tt(this.Ev,A)||(this.Ev=A,this.Gv.resizeCanvasElement(A),this.Kv.style.width=`${A.width}px`,this.Kv.style.height=`${A.height}px`,this.ft=!0)}vp(A){if(A<3&&!this.ft||this.Ev.width===0||this.Ev.height===0)return;this.ft=!1,this.Gv.applySuggestedBitmapSize();const e=St(this.Gv);e!==null&&e.useBitmapCoordinateSpace((t=>{this.mp(t),this.Ie(t)}))}xp(){return this.Gv.bitmapSize}Sp(A,e,t){const i=this.xp();i.width>0&&i.height>0&&A.drawImage(this.Gv.canvasElement,e,t)}Ie({context:A,bitmapSize:e,horizontalPixelRatio:t,verticalPixelRatio:i}){if(!this.Tm())return;A.fillStyle=this.cn.timeScale.borderColor;const s=Math.floor(this.Oc.W().C*t),n=Math.floor(this.Oc.W().C*i),o=this.qv?e.width-s:0;A.fillRect(o,0,s,n)}mp({context:A,bitmapSize:e}){oi(A,0,0,e.width,e.height,this.Pm())}}function Bn(r){return A=>{var e,t;return(t=(e=A.fa)===null||e===void 0?void 0:e.call(A,r))!==null&&t!==void 0?t:[]}}const qf=Bn("normal"),Ap=Bn("top"),ep=Bn("bottom");class tp{constructor(A,e){this.Rm=null,this.Dm=null,this.k=null,this.Vm=!1,this.Ev=WA({width:0,height:0}),this.Om=new ee,this.Fv=new wr(5),this.jv=!1,this.Hv=()=>{this.jv||this.Qd.$t().Uh()},this.Uv=()=>{this.jv||this.Qd.$t().Uh()},this.Qd=A,this.q_=e,this.cn=A.W().layout,this.Xd=document.createElement("tr"),this.Bm=document.createElement("td"),this.Bm.style.padding="0",this.Am=document.createElement("td"),this.Am.style.padding="0",this.Kv=document.createElement("td"),this.Kv.style.height="25px",this.Kv.style.padding="0",this.Im=document.createElement("div"),this.Im.style.width="100%",this.Im.style.height="100%",this.Im.style.position="relative",this.Im.style.overflow="hidden",this.Kv.appendChild(this.Im),this.Gv=Lt(this.Im,WA({width:16,height:16})),this.Gv.subscribeSuggestedBitmapSizeChanged(this.Hv);const t=this.Gv.canvasElement;t.style.position="absolute",t.style.zIndex="1",t.style.left="0",t.style.top="0",this.Jv=Lt(this.Im,WA({width:16,height:16})),this.Jv.subscribeSuggestedBitmapSizeChanged(this.Uv);const i=this.Jv.canvasElement;i.style.position="absolute",i.style.zIndex="2",i.style.left="0",i.style.top="0",this.Xd.appendChild(this.Bm),this.Xd.appendChild(this.Kv),this.Xd.appendChild(this.Am),this.zm(),this.Qd.$t().g_().l(this.zm.bind(this),this),this.hp=new dn(this.Jv.canvasElement,this,{ev:()=>!0,rv:()=>!this.Qd.W().handleScroll.horzTouchDrag})}S(){this.hp.S(),this.Rm!==null&&this.Rm.S(),this.Dm!==null&&this.Dm.S(),this.Jv.unsubscribeSuggestedBitmapSizeChanged(this.Uv),It(this.Jv.canvasElement),this.Jv.dispose(),this.Gv.unsubscribeSuggestedBitmapSizeChanged(this.Hv),It(this.Gv.canvasElement),this.Gv.dispose()}lp(){return this.Xd}Lm(){return this.Rm}Em(){return this.Dm}bv(A){if(this.Vm)return;this.Vm=!0;const e=this.Qd.$t();!e.St().Ni()&&this.Qd.W().handleScale.axisPressedMouseMove.time&&e.Jc(A.localX)}pv(A){this.bv(A)}wv(){const A=this.Qd.$t();!A.St().Ni()&&this.Vm&&(this.Vm=!1,this.Qd.W().handleScale.axisPressedMouseMove.time&&A.hd())}av(A){const e=this.Qd.$t();!e.St().Ni()&&this.Qd.W().handleScale.axisPressedMouseMove.time&&e.rd(A.localX)}hv(A){this.av(A)}cv(){this.Vm=!1;const A=this.Qd.$t();A.St().Ni()&&!this.Qd.W().handleScale.axisPressedMouseMove.time||A.hd()}_v(){this.cv()}qf(){this.Qd.W().handleScale.axisDoubleClickReset.time&&this.Qd.$t().Kn()}jf(){this.qf()}Qf(){this.Qd.$t().W().handleScale.axisPressedMouseMove.time&&this.kp(1)}Pv(){this.kp(0)}um(){return this.Ev}Nm(){return this.Om}Fm(A,e,t){Tt(this.Ev,A)||(this.Ev=A,this.jv=!0,this.Gv.resizeCanvasElement(A),this.Jv.resizeCanvasElement(A),this.jv=!1,this.Kv.style.width=`${A.width}px`,this.Kv.style.height=`${A.height}px`,this.Om.m(A)),this.Rm!==null&&this.Rm.cp(WA({width:e,height:A.height})),this.Dm!==null&&this.Dm.cp(WA({width:t,height:A.height}))}Wm(){const A=this.jm();return Math.ceil(A.C+A.T+A.P+A.L+A.B+A.Hm)}bt(){this.Qd.$t().St().Ha()}xp(){return this.Gv.bitmapSize}Sp(A,e,t){const i=this.xp();i.width>0&&i.height>0&&A.drawImage(this.Gv.canvasElement,e,t)}vp(A){if(A===0)return;if(A!==1){this.Gv.applySuggestedBitmapSize();const t=St(this.Gv);t!==null&&(t.useBitmapCoordinateSpace((i=>{this.mp(i),this.Ie(i),this.$m(t,ep)})),this.wp(t),this.$m(t,qf)),this.Rm!==null&&this.Rm.vp(A),this.Dm!==null&&this.Dm.vp(A)}this.Jv.applySuggestedBitmapSize();const e=St(this.Jv);e!==null&&(e.useBitmapCoordinateSpace((({context:t,bitmapSize:i})=>{t.clearRect(0,0,i.width,i.height)})),this.Um([...this.Qd.$t().wt(),this.Qd.$t().Zc()],e),this.$m(e,Ap))}$m(A,e){const t=this.Qd.$t().wt();for(const i of t)un(e,(s=>hn(s,A,!1,void 0)),i,void 0);for(const i of t)un(e,(s=>mi(s,A,!1,void 0)),i,void 0)}mp({context:A,bitmapSize:e}){oi(A,0,0,e.width,e.height,this.Qd.$t().bd())}Ie({context:A,bitmapSize:e,verticalPixelRatio:t}){if(this.Qd.W().timeScale.borderVisible){A.fillStyle=this.qm();const i=Math.max(1,Math.floor(this.jm().C*t));A.fillRect(0,0,e.width,i)}}wp(A){const e=this.Qd.$t().St(),t=e.Ha();if(!t||t.length===0)return;const i=this.q_.maxTickMarkWeight(t),s=this.jm(),n=e.W();n.borderVisible&&n.ticksVisible&&A.useBitmapCoordinateSpace((({context:o,horizontalPixelRatio:a,verticalPixelRatio:l})=>{o.strokeStyle=this.qm(),o.fillStyle=this.qm();const c=Math.max(1,Math.floor(a)),u=Math.floor(.5*a);o.beginPath();const d=Math.round(s.T*l);for(let B=t.length;B--;){const p=Math.round(t[B].coord*a);o.rect(p-u,0,c,d)}o.fill()})),A.useMediaCoordinateSpace((({context:o})=>{const a=s.C+s.T+s.L+s.P/2;o.textAlign="center",o.textBaseline="middle",o.fillStyle=this.$(),o.font=this._p();for(const l of t)if(l.weight<i){const c=l.needAlignCoordinate?this.Ym(o,l.coord,l.label):l.coord;o.fillText(l.label,c,a)}this.Qd.W().timeScale.allowBoldLabels&&(o.font=this.Zm());for(const l of t)if(l.weight>=i){const c=l.needAlignCoordinate?this.Ym(o,l.coord,l.label):l.coord;o.fillText(l.label,c,a)}}))}Ym(A,e,t){const i=this.Fv.xi(A,t),s=i/2,n=Math.floor(e-s)+.5;return n<0?e+=Math.abs(0-n):n+i>this.Ev.width&&(e-=Math.abs(this.Ev.width-(n+i))),e}Um(A,e){const t=this.jm();for(const i of A)for(const s of i.Qi())s.gt().X(e,t)}qm(){return this.Qd.W().timeScale.borderColor}$(){return this.cn.textColor}j(){return this.cn.fontSize}_p(){return Wt(this.j(),this.cn.fontFamily)}Zm(){return Wt(this.j(),this.cn.fontFamily,"bold")}jm(){this.k===null&&(this.k={C:1,N:NaN,L:NaN,B:NaN,ji:NaN,T:5,P:NaN,R:"",Wi:new wr,Hm:0});const A=this.k,e=this._p();if(A.R!==e){const t=this.j();A.P=t,A.R=e,A.L=3*t/12,A.B=3*t/12,A.ji=9*t/12,A.N=0,A.Hm=4*t/12,A.Wi.nr()}return this.k}kp(A){this.Kv.style.cursor=A===1?"ew-resize":"default"}zm(){const A=this.Qd.$t(),e=A.W();e.leftPriceScale.visible||this.Rm===null||(this.Bm.removeChild(this.Rm.lp()),this.Rm.S(),this.Rm=null),e.rightPriceScale.visible||this.Dm===null||(this.Am.removeChild(this.Dm.lp()),this.Dm.S(),this.Dm=null);const t={ud:this.Qd.$t().ud()},i=()=>e.leftPriceScale.borderVisible&&A.St().W().borderVisible,s=()=>A.bd();e.leftPriceScale.visible&&this.Rm===null&&(this.Rm=new al("left",e,t,i,s),this.Bm.appendChild(this.Rm.lp())),e.rightPriceScale.visible&&this.Dm===null&&(this.Dm=new al("right",e,t,i,s),this.Am.appendChild(this.Dm.lp()))}}const rp=!!Jt&&!!navigator.userAgentData&&navigator.userAgentData.brands.some((r=>r.brand.includes("Chromium")))&&!!Jt&&(!((wn=navigator?.userAgentData)===null||wn===void 0)&&wn.platform?navigator.userAgentData.platform==="Windows":navigator.userAgent.toLowerCase().indexOf("win")>=0);var wn;class ip{constructor(A,e,t){var i;this.Xm=[],this.Km=0,this.ho=0,this.__=0,this.Gm=0,this.Jm=0,this.Qm=null,this.tb=!1,this.Vp=new ee,this.Op=new ee,this.Rc=new ee,this.ib=null,this.nb=null,this.Jd=A,this.cn=e,this.q_=t,this.Xd=document.createElement("div"),this.Xd.classList.add("tv-lightweight-charts"),this.Xd.style.overflow="hidden",this.Xd.style.direction="ltr",this.Xd.style.width="100%",this.Xd.style.height="100%",(i=this.Xd).style.userSelect="none",i.style.webkitUserSelect="none",i.style.msUserSelect="none",i.style.MozUserSelect="none",i.style.webkitTapHighlightColor="transparent",this.sb=document.createElement("table"),this.sb.setAttribute("cellspacing","0"),this.Xd.appendChild(this.sb),this.eb=this.rb.bind(this),mn(this.cn)&&this.hb(!0),this.$i=new Vf(this.Vc.bind(this),this.cn,t),this.$t().Xc().l(this.lb.bind(this),this),this.ab=new tp(this,this.q_),this.sb.appendChild(this.ab.lp());const s=e.autoSize&&this.ob();let n=this.cn.width,o=this.cn.height;if(s||n===0||o===0){const a=A.getBoundingClientRect();n=n||a.width,o=o||a.height}this._b(n,o),this.ub(),A.appendChild(this.Xd),this.cb(),this.$i.St().ec().l(this.$i.Kl.bind(this.$i),this),this.$i.g_().l(this.$i.Kl.bind(this.$i),this)}$t(){return this.$i}W(){return this.cn}Yp(){return this.Xm}fb(){return this.ab}S(){this.hb(!1),this.Km!==0&&window.cancelAnimationFrame(this.Km),this.$i.Xc().p(this),this.$i.St().ec().p(this),this.$i.g_().p(this),this.$i.S();for(const A of this.Xm)this.sb.removeChild(A.lp()),A.lm().p(this),A.am().p(this),A.S();this.Xm=[],tA(this.ab).S(),this.Xd.parentElement!==null&&this.Xd.parentElement.removeChild(this.Xd),this.Rc.S(),this.Vp.S(),this.Op.S(),this.pb()}_b(A,e,t=!1){if(this.ho===e&&this.__===A)return;const i=(function(o){const a=Math.floor(o.width),l=Math.floor(o.height);return WA({width:a-a%2,height:l-l%2})})(WA({width:A,height:e}));this.ho=i.height,this.__=i.width;const s=this.ho+"px",n=this.__+"px";tA(this.Xd).style.height=s,tA(this.Xd).style.width=n,this.sb.style.height=s,this.sb.style.width=n,t?this.mb(ue.es(),performance.now()):this.$i.Kl()}vp(A){A===void 0&&(A=ue.es());for(let e=0;e<this.Xm.length;e++)this.Xm[e].vp(A.Hn(e).Fn);this.cn.timeScale.visible&&this.ab.vp(A.jn())}$h(A){const e=mn(this.cn);this.$i.$h(A);const t=mn(this.cn);t!==e&&this.hb(t),this.cb(),this.bb(A)}lm(){return this.Vp}am(){return this.Op}Xc(){return this.Rc}wb(){this.Qm!==null&&(this.mb(this.Qm,performance.now()),this.Qm=null);const A=this.gb(null),e=document.createElement("canvas");e.width=A.width,e.height=A.height;const t=tA(e.getContext("2d"));return this.gb(t),e}Mb(A){return A==="left"&&!this.xb()||A==="right"&&!this.Sb()||this.Xm.length===0?0:tA(A==="left"?this.Xm[0].wm():this.Xm[0].gm()).dp()}kb(){return this.cn.autoSize&&this.ib!==null}yb(){return this.Xd}Qp(A){this.nb=A,this.nb?this.yb().style.setProperty("cursor",A):this.yb().style.removeProperty("cursor")}Cb(){return this.nb}Tb(){return ve(this.Xm[0]).um()}bb(A){(A.autoSize!==void 0||!this.ib||A.width===void 0&&A.height===void 0)&&(A.autoSize&&!this.ib&&this.ob(),A.autoSize===!1&&this.ib!==null&&this.pb(),A.autoSize||A.width===void 0&&A.height===void 0||this._b(A.width||this.__,A.height||this.ho))}gb(A){let e=0,t=0;const i=this.Xm[0],s=(o,a)=>{let l=0;for(let c=0;c<this.Xm.length;c++){const u=this.Xm[c],d=tA(o==="left"?u.wm():u.gm()),B=d.xp();A!==null&&d.Sp(A,a,l),l+=B.height}};this.xb()&&(s("left",0),e+=tA(i.wm()).xp().width);for(let o=0;o<this.Xm.length;o++){const a=this.Xm[o],l=a.xp();A!==null&&a.Sp(A,e,t),t+=l.height}e+=i.xp().width,this.Sb()&&(s("right",e),e+=tA(i.gm()).xp().width);const n=(o,a,l)=>{tA(o==="left"?this.ab.Lm():this.ab.Em()).Sp(tA(A),a,l)};if(this.cn.timeScale.visible){const o=this.ab.xp();if(A!==null){let a=0;this.xb()&&(n("left",a,t),a=tA(i.wm()).xp().width),this.ab.Sp(A,a,t),a+=o.width,this.Sb()&&n("right",a,t)}t+=o.height}return WA({width:e,height:t})}Pb(){let A=0,e=0,t=0;for(const p of this.Xm)this.xb()&&(e=Math.max(e,tA(p.wm()).op(),this.cn.leftPriceScale.minimumWidth)),this.Sb()&&(t=Math.max(t,tA(p.gm()).op(),this.cn.rightPriceScale.minimumWidth)),A+=p.M_();e=an(e),t=an(t);const i=this.__,s=this.ho,n=Math.max(i-e-t,0),o=this.cn.timeScale.visible;let a=o?Math.max(this.ab.Wm(),this.cn.timeScale.minimumHeight):0;var l;a=(l=a)+l%2;const c=0+a,u=s<c?0:s-c,d=u/A;let B=0;for(let p=0;p<this.Xm.length;++p){const f=this.Xm[p];f.qp(this.$i.qc()[p]);let w=0,F=0;F=p===this.Xm.length-1?u-B:Math.round(f.M_()*d),w=Math.max(F,2),B+=w,f.cp(WA({width:n,height:w})),this.xb()&&f._m(e,"left"),this.Sb()&&f._m(t,"right"),f.fp()&&this.$i.Kc(f.fp(),w)}this.ab.Fm(WA({width:o?n:0,height:a}),o?e:0,o?t:0),this.$i.S_(n),this.Gm!==e&&(this.Gm=e),this.Jm!==t&&(this.Jm=t)}hb(A){A?this.Xd.addEventListener("wheel",this.eb,{passive:!1}):this.Xd.removeEventListener("wheel",this.eb)}Rb(A){switch(A.deltaMode){case A.DOM_DELTA_PAGE:return 120;case A.DOM_DELTA_LINE:return 32}return rp?1/window.devicePixelRatio:1}rb(A){if(!(A.deltaX!==0&&this.cn.handleScroll.mouseWheel||A.deltaY!==0&&this.cn.handleScale.mouseWheel))return;const e=this.Rb(A),t=e*A.deltaX/100,i=-e*A.deltaY/100;if(A.cancelable&&A.preventDefault(),i!==0&&this.cn.handleScale.mouseWheel){const s=Math.sign(i)*Math.min(1,Math.abs(i)),n=A.clientX-this.Xd.getBoundingClientRect().left;this.$t().Qc(n,s)}t!==0&&this.cn.handleScroll.mouseWheel&&this.$t().td(-80*t)}mb(A,e){var t;const i=A.jn();i===3&&this.Db(),i!==3&&i!==2||(this.Vb(A),this.Ob(A,e),this.ab.bt(),this.Xm.forEach((s=>{s.Xp()})),((t=this.Qm)===null||t===void 0?void 0:t.jn())===3&&(this.Qm.ts(A),this.Db(),this.Vb(this.Qm),this.Ob(this.Qm,e),A=this.Qm,this.Qm=null)),this.vp(A)}Ob(A,e){for(const t of A.Qn())this.ns(t,e)}Vb(A){const e=this.$i.qc();for(let t=0;t<e.length;t++)A.Hn(t).Wn&&e[t].N_()}ns(A,e){const t=this.$i.St();switch(A.qn){case 0:t.hc();break;case 1:t.lc(A.Vt);break;case 2:t.Gn(A.Vt);break;case 3:t.Jn(A.Vt);break;case 4:t.qu();break;case 5:A.Vt.Qu(e)||t.Jn(A.Vt.tc(e))}}Vc(A){this.Qm!==null?this.Qm.ts(A):this.Qm=A,this.tb||(this.tb=!0,this.Km=window.requestAnimationFrame((e=>{if(this.tb=!1,this.Km=0,this.Qm!==null){const t=this.Qm;this.Qm=null,this.mb(t,e);for(const i of t.Qn())if(i.qn===5&&!i.Vt.Qu(e)){this.$t().Zn(i.Vt);break}}})))}Db(){this.ub()}ub(){const A=this.$i.qc(),e=A.length,t=this.Xm.length;for(let i=e;i<t;i++){const s=ve(this.Xm.pop());this.sb.removeChild(s.lp()),s.lm().p(this),s.am().p(this),s.S()}for(let i=t;i<e;i++){const s=new gn(this,A[i]);s.lm().l(this.Bb.bind(this),this),s.am().l(this.Ab.bind(this),this),this.Xm.push(s),this.sb.insertBefore(s.lp(),this.ab.lp())}for(let i=0;i<e;i++){const s=A[i],n=this.Xm[i];n.fp()!==s?n.qp(s):n.Up()}this.cb(),this.Pb()}Ib(A,e,t){var i;const s=new Map;A!==null&&this.$i.wt().forEach((c=>{const u=c.In().ll(A);u!==null&&s.set(c,u)}));let n;if(A!==null){const c=(i=this.$i.St().Ui(A))===null||i===void 0?void 0:i.originalTime;c!==void 0&&(n=c)}const o=this.$t().Wc(),a=o!==null&&o.Hc instanceof js?o.Hc:void 0,l=o!==null&&o.Iv!==void 0?o.Iv.gr:void 0;return{zb:n,ee:A??void 0,Lb:e??void 0,Eb:a,Nb:s,Fb:l,Wb:t??void 0}}Bb(A,e,t){this.Vp.m((()=>this.Ib(A,e,t)))}Ab(A,e,t){this.Op.m((()=>this.Ib(A,e,t)))}lb(A,e,t){this.Rc.m((()=>this.Ib(A,e,t)))}cb(){const A=this.cn.timeScale.visible?"":"none";this.ab.lp().style.display=A}xb(){return this.Xm[0].fp().R_().W().visible}Sb(){return this.Xm[0].fp().D_().W().visible}ob(){return"ResizeObserver"in window&&(this.ib=new ResizeObserver((A=>{const e=A.find((t=>t.target===this.Jd));e&&this._b(e.contentRect.width,e.contentRect.height)})),this.ib.observe(this.Jd,{box:"border-box"}),!0)}pb(){this.ib!==null&&this.ib.disconnect(),this.ib=null}}function mn(r){return!!(r.handleScroll.mouseWheel||r.handleScale.mouseWheel)}function sp(r){return(function(A){return A.open!==void 0})(r)||(function(A){return A.value!==void 0})(r)}function ll(r,A){var e={};for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&A.indexOf(t)<0&&(e[t]=r[t]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var i=0;for(t=Object.getOwnPropertySymbols(r);i<t.length;i++)A.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(r,t[i])&&(e[t[i]]=r[t[i]])}return e}function cl(r,A,e,t){const i=e.value,s={ee:A,ot:r,Vt:[i,i,i,i],zb:t};return e.color!==void 0&&(s.V=e.color),s}function np(r,A,e,t){const i=e.value,s={ee:A,ot:r,Vt:[i,i,i,i],zb:t};return e.lineColor!==void 0&&(s.lt=e.lineColor),e.topColor!==void 0&&(s.Ps=e.topColor),e.bottomColor!==void 0&&(s.Rs=e.bottomColor),s}function op(r,A,e,t){const i=e.value,s={ee:A,ot:r,Vt:[i,i,i,i],zb:t};return e.topLineColor!==void 0&&(s.Re=e.topLineColor),e.bottomLineColor!==void 0&&(s.De=e.bottomLineColor),e.topFillColor1!==void 0&&(s.ke=e.topFillColor1),e.topFillColor2!==void 0&&(s.ye=e.topFillColor2),e.bottomFillColor1!==void 0&&(s.Ce=e.bottomFillColor1),e.bottomFillColor2!==void 0&&(s.Te=e.bottomFillColor2),s}function ap(r,A,e,t){const i={ee:A,ot:r,Vt:[e.open,e.high,e.low,e.close],zb:t};return e.color!==void 0&&(i.V=e.color),i}function lp(r,A,e,t){const i={ee:A,ot:r,Vt:[e.open,e.high,e.low,e.close],zb:t};return e.color!==void 0&&(i.V=e.color),e.borderColor!==void 0&&(i.Ot=e.borderColor),e.wickColor!==void 0&&(i.Xh=e.wickColor),i}function cp(r,A,e,t,i){const s=ve(i)(e),n=Math.max(...s),o=Math.min(...s),a=s[s.length-1],l=[a,n,o,a],c=e,{time:u,color:d}=c;return{ee:A,ot:r,Vt:l,zb:t,$e:ll(c,["time","color"]),V:d}}function yi(r){return r.Vt!==void 0}function hl(r,A){return A.customValues!==void 0&&(r.jb=A.customValues),r}function Mt(r){return(A,e,t,i,s,n)=>(function(o,a){return a?a(o):(l=o).open===void 0&&l.value===void 0;var l})(t,n)?hl({ot:A,ee:e,zb:i},t):hl(r(A,e,t,i,s),t)}function ul(r){return{Candlestick:Mt(lp),Bar:Mt(ap),Area:Mt(np),Baseline:Mt(op),Histogram:Mt(cl),Line:Mt(cl),Custom:Mt(cp)}[r]}function dl(r){return{ee:0,Hb:new Map,la:r}}function fl(r,A){if(r!==void 0&&r.length!==0)return{$b:A.key(r[0].ot),Ub:A.key(r[r.length-1].ot)}}function pl(r){let A;return r.forEach((e=>{A===void 0&&(A=e.zb)})),ve(A)}class hp{constructor(A){this.qb=new Map,this.Yb=new Map,this.Zb=new Map,this.Xb=[],this.q_=A}S(){this.qb.clear(),this.Yb.clear(),this.Zb.clear(),this.Xb=[]}Kb(A,e){let t=this.qb.size!==0,i=!1;const s=this.Yb.get(A);if(s!==void 0)if(this.Yb.size===1)t=!1,i=!0,this.qb.clear();else for(const a of this.Xb)a.pointData.Hb.delete(A)&&(i=!0);let n=[];if(e.length!==0){const a=e.map((B=>B.time)),l=this.q_.createConverterToInternalObj(e),c=ul(A.Qh()),u=A.Ca(),d=A.Ta();n=e.map(((B,p)=>{const f=l(B.time),w=this.q_.key(f);let F=this.qb.get(w);F===void 0&&(F=dl(f),this.qb.set(w,F),i=!0);const C=c(f,F.ee,B,a[p],u,d);return F.Hb.set(A,C),C}))}t&&this.Gb(),this.Jb(A,n);let o=-1;if(i){const a=[];this.qb.forEach((l=>{a.push({timeWeight:0,time:l.la,pointData:l,originalTime:pl(l.Hb)})})),a.sort(((l,c)=>this.q_.key(l.time)-this.q_.key(c.time))),o=this.Qb(a)}return this.tw(A,o,(function(a,l,c){const u=fl(a,c),d=fl(l,c);if(u!==void 0&&d!==void 0)return{ta:u.Ub>=d.Ub&&u.$b>=d.$b}})(this.Yb.get(A),s,this.q_))}vd(A){return this.Kb(A,[])}iw(A,e){const t=e;(function(f){f.zb===void 0&&(f.zb=f.time)})(t),this.q_.preprocessData(e);const i=this.q_.createConverterToInternalObj([e])(e.time),s=this.Zb.get(A);if(s!==void 0&&this.q_.key(i)<this.q_.key(s))throw new Error(`Cannot update oldest data, last time=${s}, new time=${i}`);let n=this.qb.get(this.q_.key(i));const o=n===void 0;n===void 0&&(n=dl(i),this.qb.set(this.q_.key(i),n));const a=ul(A.Qh()),l=A.Ca(),c=A.Ta(),u=a(i,n.ee,e,t.zb,l,c);n.Hb.set(A,u),this.nw(A,u);const d={ta:yi(u)};if(!o)return this.tw(A,-1,d);const B={timeWeight:0,time:n.la,pointData:n,originalTime:pl(n.Hb)},p=Br(this.Xb,this.q_.key(B.time),((f,w)=>this.q_.key(f.time)<w));this.Xb.splice(p,0,B);for(let f=p;f<this.Xb.length;++f)Cn(this.Xb[f].pointData,f);return this.q_.fillWeightsForPoints(this.Xb,p),this.tw(A,p,d)}nw(A,e){let t=this.Yb.get(A);t===void 0&&(t=[],this.Yb.set(A,t));const i=t.length!==0?t[t.length-1]:null;i===null||this.q_.key(e.ot)>this.q_.key(i.ot)?yi(e)&&t.push(e):yi(e)?t[t.length-1]=e:t.splice(-1,1),this.Zb.set(A,e.ot)}Jb(A,e){e.length!==0?(this.Yb.set(A,e.filter(yi)),this.Zb.set(A,e[e.length-1].ot)):(this.Yb.delete(A),this.Zb.delete(A))}Gb(){for(const A of this.Xb)A.pointData.Hb.size===0&&this.qb.delete(this.q_.key(A.time))}Qb(A){let e=-1;for(let t=0;t<this.Xb.length&&t<A.length;++t){const i=this.Xb[t],s=A[t];if(this.q_.key(i.time)!==this.q_.key(s.time)){e=t;break}s.timeWeight=i.timeWeight,Cn(s.pointData,t)}if(e===-1&&this.Xb.length!==A.length&&(e=Math.min(this.Xb.length,A.length)),e===-1)return-1;for(let t=e;t<A.length;++t)Cn(A[t].pointData,t);return this.q_.fillWeightsForPoints(A,e),this.Xb=A,e}sw(){if(this.Yb.size===0)return null;let A=0;return this.Yb.forEach((e=>{e.length!==0&&(A=Math.max(A,e[e.length-1].ee))})),A}tw(A,e,t){const i={ew:new Map,St:{Eu:this.sw()}};if(e!==-1)this.Yb.forEach(((s,n)=>{i.ew.set(n,{$e:s,rw:n===A?t:void 0})})),this.Yb.has(A)||i.ew.set(A,{$e:[],rw:t}),i.St.hw=this.Xb,i.St.lw=e;else{const s=this.Yb.get(A);i.ew.set(A,{$e:s||[],rw:t})}return i}}function Cn(r,A){r.ee=A,r.Hb.forEach((e=>{e.ee=A}))}function vn(r){const A={value:r.Vt[3],time:r.zb};return r.jb!==void 0&&(A.customValues=r.jb),A}function gl(r){const A=vn(r);return r.V!==void 0&&(A.color=r.V),A}function up(r){const A=vn(r);return r.lt!==void 0&&(A.lineColor=r.lt),r.Ps!==void 0&&(A.topColor=r.Ps),r.Rs!==void 0&&(A.bottomColor=r.Rs),A}function dp(r){const A=vn(r);return r.Re!==void 0&&(A.topLineColor=r.Re),r.De!==void 0&&(A.bottomLineColor=r.De),r.ke!==void 0&&(A.topFillColor1=r.ke),r.ye!==void 0&&(A.topFillColor2=r.ye),r.Ce!==void 0&&(A.bottomFillColor1=r.Ce),r.Te!==void 0&&(A.bottomFillColor2=r.Te),A}function Bl(r){const A={open:r.Vt[0],high:r.Vt[1],low:r.Vt[2],close:r.Vt[3],time:r.zb};return r.jb!==void 0&&(A.customValues=r.jb),A}function fp(r){const A=Bl(r);return r.V!==void 0&&(A.color=r.V),A}function pp(r){const A=Bl(r),{V:e,Ot:t,Xh:i}=r;return e!==void 0&&(A.color=e),t!==void 0&&(A.borderColor=t),i!==void 0&&(A.wickColor=i),A}function bn(r){return{Area:up,Line:gl,Baseline:dp,Histogram:gl,Bar:fp,Candlestick:pp,Custom:gp}[r]}function gp(r){const A=r.zb;return Object.assign(Object.assign({},r.$e),{time:A})}const Bp={vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},wp={vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},mp={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:Ks,attributionLogo:!0},yn={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2},minimumWidth:0},Cp={rightOffset:0,barSpacing:6,minBarSpacing:.5,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,allowShiftVisibleRangeOnWhitespaceReplacement:!1,ticksVisible:!1,uniformDistribution:!1,minimumHeight:0,allowBoldLabels:!0},vp={color:"rgba(0, 0, 0, 0)",visible:!1,fontSize:48,fontFamily:Ks,fontStyle:"",text:"",horzAlign:"center",vertAlign:"center"};function wl(){return{width:0,height:0,autoSize:!1,layout:mp,crosshair:Bp,grid:wp,overlayPriceScales:Object.assign({},yn),leftPriceScale:Object.assign(Object.assign({},yn),{visible:!1}),rightPriceScale:Object.assign(Object.assign({},yn),{visible:!0}),timeScale:Cp,watermark:vp,localization:{locale:Jt?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}}}class bp{constructor(A,e){this.aw=A,this.ow=e}applyOptions(A){this.aw.$t().$c(this.ow,A)}options(){return this.Li().W()}width(){return li(this.ow)?this.aw.Mb(this.ow):0}Li(){return tA(this.aw.$t().Uc(this.ow)).Dt}}function ml(r,A,e){const t=ll(r,["time","originalTime"]),i=Object.assign({time:A},t);return e!==void 0&&(i.originalTime=e),i}const yp={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class Qp{constructor(A){this.Nh=A}applyOptions(A){this.Nh.$h(A)}options(){return this.Nh.W()}_w(){return this.Nh}}class Fp{constructor(A,e,t,i,s){this.uw=new ee,this.Es=A,this.cw=e,this.dw=t,this.q_=s,this.fw=i}S(){this.uw.S()}priceFormatter(){return this.Es.ba()}priceToCoordinate(A){const e=this.Es.Ct();return e===null?null:this.Es.Dt().Rt(A,e.Vt)}coordinateToPrice(A){const e=this.Es.Ct();return e===null?null:this.Es.Dt().pn(A,e.Vt)}barsInLogicalRange(A){if(A===null)return null;const e=new Xt(new Qr(A.from,A.to)).lu(),t=this.Es.In();if(t.Ni())return null;const i=t.ll(e.Os(),1),s=t.ll(e.ui(),-1),n=tA(t.el()),o=tA(t.An());if(i!==null&&s!==null&&i.ee>s.ee)return{barsBefore:A.from-n,barsAfter:o-A.to};const a={barsBefore:i===null||i.ee===n?A.from-n:i.ee-n,barsAfter:s===null||s.ee===o?o-A.to:o-s.ee};return i!==null&&s!==null&&(a.from=i.zb,a.to=s.zb),a}setData(A){this.q_,this.Es.Qh(),this.cw.pw(this.Es,A),this.mw("full")}update(A){this.Es.Qh(),this.cw.bw(this.Es,A),this.mw("update")}dataByIndex(A,e){const t=this.Es.In().ll(A,e);return t===null?null:bn(this.seriesType())(t)}data(){const A=bn(this.seriesType());return this.Es.In().ne().map((e=>A(e)))}subscribeDataChanged(A){this.uw.l(A)}unsubscribeDataChanged(A){this.uw.v(A)}setMarkers(A){this.q_;const e=A.map((t=>ml(t,this.q_.convertHorzItemToInternal(t.time),t.time)));this.Es.na(e)}markers(){return this.Es.sa().map((A=>ml(A,A.originalTime,void 0)))}applyOptions(A){this.Es.$h(A)}options(){return ot(this.Es.W())}priceScale(){return this.dw.priceScale(this.Es.Dt().Pa())}createPriceLine(A){const e=Ge(ot(yp),A),t=this.Es.ea(e);return new Qp(t)}removePriceLine(A){this.Es.ra(A._w())}seriesType(){return this.Es.Qh()}attachPrimitive(A){this.Es.ka(A),A.attached&&A.attached({chart:this.fw,series:this,requestUpdate:()=>this.Es.$t().Kl()})}detachPrimitive(A){this.Es.ya(A),A.detached&&A.detached()}mw(A){this.uw.M()&&this.uw.m(A)}}class Up{constructor(A,e,t){this.ww=new ee,this.mu=new ee,this.Om=new ee,this.$i=A,this.yl=A.St(),this.ab=e,this.yl.nc().l(this.gw.bind(this)),this.yl.sc().l(this.Mw.bind(this)),this.ab.Nm().l(this.xw.bind(this)),this.q_=t}S(){this.yl.nc().p(this),this.yl.sc().p(this),this.ab.Nm().p(this),this.ww.S(),this.mu.S(),this.Om.S()}scrollPosition(){return this.yl.Hu()}scrollToPosition(A,e){e?this.yl.Ju(A,1e3):this.$i.Jn(A)}scrollToRealTime(){this.yl.Gu()}getVisibleRange(){const A=this.yl.Vu();return A===null?null:{from:A.from.originalTime,to:A.to.originalTime}}setVisibleRange(A){const e={from:this.q_.convertHorzItemToInternal(A.from),to:this.q_.convertHorzItemToInternal(A.to)},t=this.yl.Iu(e);this.$i.pd(t)}getVisibleLogicalRange(){const A=this.yl.Du();return A===null?null:{from:A.Os(),to:A.ui()}}setVisibleLogicalRange(A){Bt(A.from<=A.to,"The from index cannot be after the to index."),this.$i.pd(A)}resetTimeScale(){this.$i.Kn()}fitContent(){this.$i.hc()}logicalToCoordinate(A){const e=this.$i.St();return e.Ni()?null:e.It(A)}coordinateToLogical(A){return this.yl.Ni()?null:this.yl.Nu(A)}timeToCoordinate(A){const e=this.q_.convertHorzItemToInternal(A),t=this.yl.Va(e,!1);return t===null?null:this.yl.It(t)}coordinateToTime(A){const e=this.$i.St(),t=e.Nu(A),i=e.Ui(t);return i===null?null:i.originalTime}width(){return this.ab.um().width}height(){return this.ab.um().height}subscribeVisibleTimeRangeChange(A){this.ww.l(A)}unsubscribeVisibleTimeRangeChange(A){this.ww.v(A)}subscribeVisibleLogicalRangeChange(A){this.mu.l(A)}unsubscribeVisibleLogicalRangeChange(A){this.mu.v(A)}subscribeSizeChange(A){this.Om.l(A)}unsubscribeSizeChange(A){this.Om.v(A)}applyOptions(A){this.yl.$h(A)}options(){return Object.assign(Object.assign({},ot(this.yl.W())),{barSpacing:this.yl.le()})}gw(){this.ww.M()&&this.ww.m(this.getVisibleRange())}Mw(){this.mu.M()&&this.mu.m(this.getVisibleLogicalRange())}xw(A){this.Om.m(A.width,A.height)}}function Ep(r){if(r===void 0||r.type==="custom")return;const A=r;A.minMove!==void 0&&A.precision===void 0&&(A.precision=(function(e){if(e>=1)return 0;let t=0;for(;t<8;t++){const i=Math.round(e);if(Math.abs(i-e)<1e-8)return t;e*=10}return t})(A.minMove))}function Cl(r){return(function(A){if(ni(A.handleScale)){const t=A.handleScale;A.handleScale={axisDoubleClickReset:{time:t,price:t},axisPressedMouseMove:{time:t,price:t},mouseWheel:t,pinch:t}}else if(A.handleScale!==void 0){const{axisPressedMouseMove:t,axisDoubleClickReset:i}=A.handleScale;ni(t)&&(A.handleScale.axisPressedMouseMove={time:t,price:t}),ni(i)&&(A.handleScale.axisDoubleClickReset={time:i,price:i})}const e=A.handleScroll;ni(e)&&(A.handleScroll={horzTouchDrag:e,vertTouchDrag:e,mouseWheel:e,pressedMouseMove:e})})(r),r}class xp{constructor(A,e,t){this.Sw=new Map,this.kw=new Map,this.yw=new ee,this.Cw=new ee,this.Tw=new ee,this.Pw=new hp(e);const i=t===void 0?ot(wl()):Ge(ot(wl()),Cl(t));this.q_=e,this.aw=new ip(A,i,e),this.aw.lm().l((n=>{this.yw.M()&&this.yw.m(this.Rw(n()))}),this),this.aw.am().l((n=>{this.Cw.M()&&this.Cw.m(this.Rw(n()))}),this),this.aw.Xc().l((n=>{this.Tw.M()&&this.Tw.m(this.Rw(n()))}),this);const s=this.aw.$t();this.Dw=new Up(s,this.aw.fb(),this.q_)}remove(){this.aw.lm().p(this),this.aw.am().p(this),this.aw.Xc().p(this),this.Dw.S(),this.aw.S(),this.Sw.clear(),this.kw.clear(),this.yw.S(),this.Cw.S(),this.Tw.S(),this.Pw.S()}resize(A,e,t){this.autoSizeActive()||this.aw._b(A,e,t)}addCustomSeries(A,e){const t=Rt(A),i=Object.assign(Object.assign({},ea),t.defaultOptions());return this.Vw("Custom",i,e,t)}addAreaSeries(A){return this.Vw("Area",cd,A)}addBaselineSeries(A){return this.Vw("Baseline",hd,A)}addBarSeries(A){return this.Vw("Bar",ad,A)}addCandlestickSeries(A={}){return(function(e){e.borderColor!==void 0&&(e.borderUpColor=e.borderColor,e.borderDownColor=e.borderColor),e.wickColor!==void 0&&(e.wickUpColor=e.wickColor,e.wickDownColor=e.wickColor)})(A),this.Vw("Candlestick",od,A)}addHistogramSeries(A){return this.Vw("Histogram",ud,A)}addLineSeries(A){return this.Vw("Line",ld,A)}removeSeries(A){const e=ve(this.Sw.get(A)),t=this.Pw.vd(e);this.aw.$t().vd(e),this.Ow(t),this.Sw.delete(A),this.kw.delete(e)}pw(A,e){this.Ow(this.Pw.Kb(A,e))}bw(A,e){this.Ow(this.Pw.iw(A,e))}subscribeClick(A){this.yw.l(A)}unsubscribeClick(A){this.yw.v(A)}subscribeCrosshairMove(A){this.Tw.l(A)}unsubscribeCrosshairMove(A){this.Tw.v(A)}subscribeDblClick(A){this.Cw.l(A)}unsubscribeDblClick(A){this.Cw.v(A)}priceScale(A){return new bp(this.aw,A)}timeScale(){return this.Dw}applyOptions(A){this.aw.$h(Cl(A))}options(){return this.aw.W()}takeScreenshot(){return this.aw.wb()}autoSizeActive(){return this.aw.kb()}chartElement(){return this.aw.yb()}paneSize(){const A=this.aw.Tb();return{height:A.height,width:A.width}}setCrosshairPosition(A,e,t){const i=this.Sw.get(t);if(i===void 0)return;const s=this.aw.$t().dr(i);s!==null&&this.aw.$t().ad(A,e,s)}clearCrosshairPosition(){this.aw.$t().od(!0)}Vw(A,e,t={},i){Ep(t.priceFormat);const s=Ge(ot(ta),ot(e),t),n=this.aw.$t().dd(A,s,i),o=new Fp(n,this,this,this,this.q_);return this.Sw.set(o,n),this.kw.set(n,o),o}Ow(A){const e=this.aw.$t();e._d(A.St.Eu,A.St.hw,A.St.lw),A.ew.forEach(((t,i)=>i.J(t.$e,t.rw))),e.Wu()}Bw(A){return ve(this.kw.get(A))}Rw(A){const e=new Map;A.Nb.forEach(((i,s)=>{const n=s.Qh(),o=bn(n)(i);if(n!=="Custom")Bt(sp(o));else{const a=s.Ta();Bt(!a||a(o)===!1)}e.set(this.Bw(s),o)}));const t=A.Eb!==void 0&&this.kw.has(A.Eb)?this.Bw(A.Eb):void 0;return{time:A.zb,logical:A.ee,point:A.Lb,hoveredSeries:t,hoveredObjectId:A.Fb,seriesData:e,sourceEvent:A.Wb}}}function Tp(r,A,e){let t;if(pr(r)){const s=document.getElementById(r);Bt(s!==null,`Cannot find element in DOM with id=${r}`),t=s}else t=r;const i=new xp(t,A,e);return A.setOptions(i.options()),i}function Sp(r,A){return Tp(r,new rl,rl.Id(A))}Object.assign(Object.assign({},ta),ea);function vl(r,A){return function(){return r.apply(A,arguments)}}const{toString:Hp}=Object.prototype,{getPrototypeOf:Qn}=Object,{iterator:Qi,toStringTag:bl}=Symbol,Fi=(r=>A=>{const e=Hp.call(A);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),We=r=>(r=r.toLowerCase(),A=>Fi(A)===r),Ui=r=>A=>typeof A===r,{isArray:Yt}=Array,jt=Ui("undefined");function Fr(r){return r!==null&&!jt(r)&&r.constructor!==null&&!jt(r.constructor)&&Ue(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const yl=We("ArrayBuffer");function Lp(r){let A;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?A=ArrayBuffer.isView(r):A=r&&r.buffer&&yl(r.buffer),A}const Ip=Ui("string"),Ue=Ui("function"),Ql=Ui("number"),Ur=r=>r!==null&&typeof r=="object",Mp=r=>r===!0||r===!1,Ei=r=>{if(Fi(r)!=="object")return!1;const A=Qn(r);return(A===null||A===Object.prototype||Object.getPrototypeOf(A)===null)&&!(bl in r)&&!(Qi in r)},Dp=r=>{if(!Ur(r)||Fr(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},_p=We("Date"),kp=We("File"),Op=We("Blob"),Np=We("FileList"),Kp=r=>Ur(r)&&Ue(r.pipe),Vp=r=>{let A;return r&&(typeof FormData=="function"&&r instanceof FormData||Ue(r.append)&&((A=Fi(r))==="formdata"||A==="object"&&Ue(r.toString)&&r.toString()==="[object FormData]"))},Pp=We("URLSearchParams"),[zp,Gp,Rp,Wp]=["ReadableStream","Request","Response","Headers"].map(We),$p=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Er(r,A,{allOwnKeys:e=!1}={}){if(r===null||typeof r>"u")return;let t,i;if(typeof r!="object"&&(r=[r]),Yt(r))for(t=0,i=r.length;t<i;t++)A.call(null,r[t],t,r);else{if(Fr(r))return;const s=e?Object.getOwnPropertyNames(r):Object.keys(r),n=s.length;let o;for(t=0;t<n;t++)o=s[t],A.call(null,r[o],o,r)}}function Fl(r,A){if(Fr(r))return null;A=A.toLowerCase();const e=Object.keys(r);let t=e.length,i;for(;t-- >0;)if(i=e[t],A===i.toLowerCase())return i;return null}const Dt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ul=r=>!jt(r)&&r!==Dt;function Fn(){const{caseless:r,skipUndefined:A}=Ul(this)&&this||{},e={},t=(i,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;const n=r&&Fl(e,s)||s;Ei(e[n])&&Ei(i)?e[n]=Fn(e[n],i):Ei(i)?e[n]=Fn({},i):Yt(i)?e[n]=i.slice():(!A||!jt(i))&&(e[n]=i)};for(let i=0,s=arguments.length;i<s;i++)arguments[i]&&Er(arguments[i],t);return e}const Xp=(r,A,e,{allOwnKeys:t}={})=>(Er(A,(i,s)=>{e&&Ue(i)?Object.defineProperty(r,s,{value:vl(i,e),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,s,{value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:t}),r),Jp=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Zp=(r,A,e,t)=>{r.prototype=Object.create(A.prototype,t),Object.defineProperty(r.prototype,"constructor",{value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{value:A.prototype}),e&&Object.assign(r.prototype,e)},Yp=(r,A,e,t)=>{let i,s,n;const o={};if(A=A||{},r==null)return A;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)n=i[s],(!t||t(n,r,A))&&!o[n]&&(A[n]=r[n],o[n]=!0);r=e!==!1&&Qn(r)}while(r&&(!e||e(r,A))&&r!==Object.prototype);return A},jp=(r,A,e)=>{r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=A.length;const t=r.indexOf(A,e);return t!==-1&&t===e},qp=r=>{if(!r)return null;if(Yt(r))return r;let A=r.length;if(!Ql(A))return null;const e=new Array(A);for(;A-- >0;)e[A]=r[A];return e},A0=(r=>A=>r&&A instanceof r)(typeof Uint8Array<"u"&&Qn(Uint8Array)),e0=(r,A)=>{const t=(r&&r[Qi]).call(r);let i;for(;(i=t.next())&&!i.done;){const s=i.value;A.call(r,s[0],s[1])}},t0=(r,A)=>{let e;const t=[];for(;(e=r.exec(A))!==null;)t.push(e);return t},r0=We("HTMLFormElement"),i0=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,i){return t.toUpperCase()+i}),El=(({hasOwnProperty:r})=>(A,e)=>r.call(A,e))(Object.prototype),s0=We("RegExp"),xl=(r,A)=>{const e=Object.getOwnPropertyDescriptors(r),t={};Er(e,(i,s)=>{let n;(n=A(i,s,r))!==!1&&(t[s]=n||i)}),Object.defineProperties(r,t)},n0=r=>{xl(r,(A,e)=>{if(Ue(r)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const t=r[e];if(Ue(t)){if(A.enumerable=!1,"writable"in A){A.writable=!1;return}A.set||(A.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},o0=(r,A)=>{const e={},t=i=>{i.forEach(s=>{e[s]=!0})};return Yt(r)?t(r):t(String(r).split(A)),e},a0=()=>{},l0=(r,A)=>r!=null&&Number.isFinite(r=+r)?r:A;function c0(r){return!!(r&&Ue(r.append)&&r[bl]==="FormData"&&r[Qi])}const h0=r=>{const A=new Array(10),e=(t,i)=>{if(Ur(t)){if(A.indexOf(t)>=0)return;if(Fr(t))return t;if(!("toJSON"in t)){A[i]=t;const s=Yt(t)?[]:{};return Er(t,(n,o)=>{const a=e(n,i+1);!jt(a)&&(s[o]=a)}),A[i]=void 0,s}}return t};return e(r,0)},u0=We("AsyncFunction"),d0=r=>r&&(Ur(r)||Ue(r))&&Ue(r.then)&&Ue(r.catch),Tl=((r,A)=>r?setImmediate:A?((e,t)=>(Dt.addEventListener("message",({source:i,data:s})=>{i===Dt&&s===e&&t.length&&t.shift()()},!1),i=>{t.push(i),Dt.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Ue(Dt.postMessage)),f0=typeof queueMicrotask<"u"?queueMicrotask.bind(Dt):typeof process<"u"&&process.nextTick||Tl,V={isArray:Yt,isArrayBuffer:yl,isBuffer:Fr,isFormData:Vp,isArrayBufferView:Lp,isString:Ip,isNumber:Ql,isBoolean:Mp,isObject:Ur,isPlainObject:Ei,isEmptyObject:Dp,isReadableStream:zp,isRequest:Gp,isResponse:Rp,isHeaders:Wp,isUndefined:jt,isDate:_p,isFile:kp,isBlob:Op,isRegExp:s0,isFunction:Ue,isStream:Kp,isURLSearchParams:Pp,isTypedArray:A0,isFileList:Np,forEach:Er,merge:Fn,extend:Xp,trim:$p,stripBOM:Jp,inherits:Zp,toFlatObject:Yp,kindOf:Fi,kindOfTest:We,endsWith:jp,toArray:qp,forEachEntry:e0,matchAll:t0,isHTMLForm:r0,hasOwnProperty:El,hasOwnProp:El,reduceDescriptors:xl,freezeMethods:n0,toObjectSet:o0,toCamelCase:i0,noop:a0,toFiniteNumber:l0,findKey:Fl,global:Dt,isContextDefined:Ul,isSpecCompliantForm:c0,toJSONObject:h0,isAsyncFn:u0,isThenable:d0,setImmediate:Tl,asap:f0,isIterable:r=>r!=null&&Ue(r[Qi])};let TA=class ju extends Error{static from(A,e,t,i,s,n){const o=new ju(A.message,e||A.code,t,i,s);return o.cause=A,o.name=A.name,n&&Object.assign(o,n),o}constructor(A,e,t,i,s){super(A),this.name="AxiosError",this.isAxiosError=!0,e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),s&&(this.response=s,this.status=s.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}};TA.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",TA.ERR_BAD_OPTION="ERR_BAD_OPTION",TA.ECONNABORTED="ECONNABORTED",TA.ETIMEDOUT="ETIMEDOUT",TA.ERR_NETWORK="ERR_NETWORK",TA.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",TA.ERR_DEPRECATED="ERR_DEPRECATED",TA.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",TA.ERR_BAD_REQUEST="ERR_BAD_REQUEST",TA.ERR_CANCELED="ERR_CANCELED",TA.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",TA.ERR_INVALID_URL="ERR_INVALID_URL";const p0=null;function Un(r){return V.isPlainObject(r)||V.isArray(r)}function Sl(r){return V.endsWith(r,"[]")?r.slice(0,-2):r}function Hl(r,A,e){return r?r.concat(A).map(function(i,s){return i=Sl(i),!e&&s?"["+i+"]":i}).join(e?".":""):A}function g0(r){return V.isArray(r)&&!r.some(Un)}const B0=V.toFlatObject(V,{},null,function(A){return/^is[A-Z]/.test(A)});function xi(r,A,e){if(!V.isObject(r))throw new TypeError("target must be an object");A=A||new FormData,e=V.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,w){return!V.isUndefined(w[f])});const t=e.metaTokens,i=e.visitor||c,s=e.dots,n=e.indexes,a=(e.Blob||typeof Blob<"u"&&Blob)&&V.isSpecCompliantForm(A);if(!V.isFunction(i))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(V.isDate(p))return p.toISOString();if(V.isBoolean(p))return p.toString();if(!a&&V.isBlob(p))throw new TA("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(p)||V.isTypedArray(p)?a&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,f,w){let F=p;if(p&&!w&&typeof p=="object"){if(V.endsWith(f,"{}"))f=t?f:f.slice(0,-2),p=JSON.stringify(p);else if(V.isArray(p)&&g0(p)||(V.isFileList(p)||V.endsWith(f,"[]"))&&(F=V.toArray(p)))return f=Sl(f),F.forEach(function(E,U){!(V.isUndefined(E)||E===null)&&A.append(n===!0?Hl([f],U,s):n===null?f:f+"[]",l(E))}),!1}return Un(p)?!0:(A.append(Hl(w,f,s),l(p)),!1)}const u=[],d=Object.assign(B0,{defaultVisitor:c,convertValue:l,isVisitable:Un});function B(p,f){if(!V.isUndefined(p)){if(u.indexOf(p)!==-1)throw Error("Circular reference detected in "+f.join("."));u.push(p),V.forEach(p,function(F,C){(!(V.isUndefined(F)||F===null)&&i.call(A,F,V.isString(C)?C.trim():C,f,d))===!0&&B(F,f?f.concat(C):[C])}),u.pop()}}if(!V.isObject(r))throw new TypeError("data must be an object");return B(r),A}function Ll(r){const A={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(t){return A[t]})}function En(r,A){this._pairs=[],r&&xi(r,this,A)}const Il=En.prototype;Il.append=function(A,e){this._pairs.push([A,e])},Il.toString=function(A){const e=A?function(t){return A.call(this,t,Ll)}:Ll;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function w0(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ml(r,A,e){if(!A)return r;const t=e&&e.encode||w0,i=V.isFunction(e)?{serialize:e}:e,s=i&&i.serialize;let n;if(s?n=s(A,i):n=V.isURLSearchParams(A)?A.toString():new En(A,i).toString(t),n){const o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+n}return r}class Dl{constructor(){this.handlers=[]}use(A,e,t){return this.handlers.push({fulfilled:A,rejected:e,synchronous:t?t.synchronous:!1,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(A){this.handlers[A]&&(this.handlers[A]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(A){V.forEach(this.handlers,function(t){t!==null&&A(t)})}}const xn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},m0={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:En,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Tn=typeof window<"u"&&typeof document<"u",Sn=typeof navigator=="object"&&navigator||void 0,C0=Tn&&(!Sn||["ReactNative","NativeScript","NS"].indexOf(Sn.product)<0),v0=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",b0=Tn&&window.location.href||"http://localhost",pe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Tn,hasStandardBrowserEnv:C0,hasStandardBrowserWebWorkerEnv:v0,navigator:Sn,origin:b0},Symbol.toStringTag,{value:"Module"})),...m0};function y0(r,A){return xi(r,new pe.classes.URLSearchParams,{visitor:function(e,t,i,s){return pe.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...A})}function Q0(r){return V.matchAll(/\w+|\[(\w*)]/g,r).map(A=>A[0]==="[]"?"":A[1]||A[0])}function F0(r){const A={},e=Object.keys(r);let t;const i=e.length;let s;for(t=0;t<i;t++)s=e[t],A[s]=r[s];return A}function _l(r){function A(e,t,i,s){let n=e[s++];if(n==="__proto__")return!0;const o=Number.isFinite(+n),a=s>=e.length;return n=!n&&V.isArray(i)?i.length:n,a?(V.hasOwnProp(i,n)?i[n]=[i[n],t]:i[n]=t,!o):((!i[n]||!V.isObject(i[n]))&&(i[n]=[]),A(e,t,i[n],s)&&V.isArray(i[n])&&(i[n]=F0(i[n])),!o)}if(V.isFormData(r)&&V.isFunction(r.entries)){const e={};return V.forEachEntry(r,(t,i)=>{A(Q0(t),i,e,0)}),e}return null}function U0(r,A,e){if(V.isString(r))try{return(A||JSON.parse)(r),V.trim(r)}catch(t){if(t.name!=="SyntaxError")throw t}return(e||JSON.stringify)(r)}const xr={transitional:xn,adapter:["xhr","http","fetch"],transformRequest:[function(A,e){const t=e.getContentType()||"",i=t.indexOf("application/json")>-1,s=V.isObject(A);if(s&&V.isHTMLForm(A)&&(A=new FormData(A)),V.isFormData(A))return i?JSON.stringify(_l(A)):A;if(V.isArrayBuffer(A)||V.isBuffer(A)||V.isStream(A)||V.isFile(A)||V.isBlob(A)||V.isReadableStream(A))return A;if(V.isArrayBufferView(A))return A.buffer;if(V.isURLSearchParams(A))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),A.toString();let o;if(s){if(t.indexOf("application/x-www-form-urlencoded")>-1)return y0(A,this.formSerializer).toString();if((o=V.isFileList(A))||t.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return xi(o?{"files[]":A}:A,a&&new a,this.formSerializer)}}return s||i?(e.setContentType("application/json",!1),U0(A)):A}],transformResponse:[function(A){const e=this.transitional||xr.transitional,t=e&&e.forcedJSONParsing,i=this.responseType==="json";if(V.isResponse(A)||V.isReadableStream(A))return A;if(A&&V.isString(A)&&(t&&!this.responseType||i)){const n=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(A,this.parseReviver)}catch(o){if(n)throw o.name==="SyntaxError"?TA.from(o,TA.ERR_BAD_RESPONSE,this,null,this.response):o}}return A}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pe.classes.FormData,Blob:pe.classes.Blob},validateStatus:function(A){return A>=200&&A<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],r=>{xr.headers[r]={}});const E0=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),x0=r=>{const A={};let e,t,i;return r&&r.split(`
2
+ `).forEach(function(n){i=n.indexOf(":"),e=n.substring(0,i).trim().toLowerCase(),t=n.substring(i+1).trim(),!(!e||A[e]&&E0[e])&&(e==="set-cookie"?A[e]?A[e].push(t):A[e]=[t]:A[e]=A[e]?A[e]+", "+t:t)}),A},kl=Symbol("internals");function Tr(r){return r&&String(r).trim().toLowerCase()}function Ti(r){return r===!1||r==null?r:V.isArray(r)?r.map(Ti):String(r)}function T0(r){const A=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let t;for(;t=e.exec(r);)A[t[1]]=t[2];return A}const S0=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function Hn(r,A,e,t,i){if(V.isFunction(t))return t.call(this,A,e);if(i&&(A=e),!!V.isString(A)){if(V.isString(t))return A.indexOf(t)!==-1;if(V.isRegExp(t))return t.test(A)}}function H0(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(A,e,t)=>e.toUpperCase()+t)}function L0(r,A){const e=V.toCamelCase(" "+A);["get","set","has"].forEach(t=>{Object.defineProperty(r,t+e,{value:function(i,s,n){return this[t].call(this,A,i,s,n)},configurable:!0})})}let Ee=class{constructor(A){A&&this.set(A)}set(A,e,t){const i=this;function s(o,a,l){const c=Tr(a);if(!c)throw new Error("header name must be a non-empty string");const u=V.findKey(i,c);(!u||i[u]===void 0||l===!0||l===void 0&&i[u]!==!1)&&(i[u||a]=Ti(o))}const n=(o,a)=>V.forEach(o,(l,c)=>s(l,c,a));if(V.isPlainObject(A)||A instanceof this.constructor)n(A,e);else if(V.isString(A)&&(A=A.trim())&&!S0(A))n(x0(A),e);else if(V.isObject(A)&&V.isIterable(A)){let o={},a,l;for(const c of A){if(!V.isArray(c))throw TypeError("Object iterator must return a key-value pair");o[l=c[0]]=(a=o[l])?V.isArray(a)?[...a,c[1]]:[a,c[1]]:c[1]}n(o,e)}else A!=null&&s(e,A,t);return this}get(A,e){if(A=Tr(A),A){const t=V.findKey(this,A);if(t){const i=this[t];if(!e)return i;if(e===!0)return T0(i);if(V.isFunction(e))return e.call(this,i,t);if(V.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(A,e){if(A=Tr(A),A){const t=V.findKey(this,A);return!!(t&&this[t]!==void 0&&(!e||Hn(this,this[t],t,e)))}return!1}delete(A,e){const t=this;let i=!1;function s(n){if(n=Tr(n),n){const o=V.findKey(t,n);o&&(!e||Hn(t,t[o],o,e))&&(delete t[o],i=!0)}}return V.isArray(A)?A.forEach(s):s(A),i}clear(A){const e=Object.keys(this);let t=e.length,i=!1;for(;t--;){const s=e[t];(!A||Hn(this,this[s],s,A,!0))&&(delete this[s],i=!0)}return i}normalize(A){const e=this,t={};return V.forEach(this,(i,s)=>{const n=V.findKey(t,s);if(n){e[n]=Ti(i),delete e[s];return}const o=A?H0(s):String(s).trim();o!==s&&delete e[s],e[o]=Ti(i),t[o]=!0}),this}concat(...A){return this.constructor.concat(this,...A)}toJSON(A){const e=Object.create(null);return V.forEach(this,(t,i)=>{t!=null&&t!==!1&&(e[i]=A&&V.isArray(t)?t.join(", "):t)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([A,e])=>A+": "+e).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(A){return A instanceof this?A:new this(A)}static concat(A,...e){const t=new this(A);return e.forEach(i=>t.set(i)),t}static accessor(A){const t=(this[kl]=this[kl]={accessors:{}}).accessors,i=this.prototype;function s(n){const o=Tr(n);t[o]||(L0(i,n),t[o]=!0)}return V.isArray(A)?A.forEach(s):s(A),this}};Ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Ee.prototype,({value:r},A)=>{let e=A[0].toUpperCase()+A.slice(1);return{get:()=>r,set(t){this[e]=t}}}),V.freezeMethods(Ee);function Ln(r,A){const e=this||xr,t=A||e,i=Ee.from(t.headers);let s=t.data;return V.forEach(r,function(o){s=o.call(e,s,i.normalize(),A?A.status:void 0)}),i.normalize(),s}function Ol(r){return!!(r&&r.__CANCEL__)}let Sr=class extends TA{constructor(A,e,t){super(A??"canceled",TA.ERR_CANCELED,e,t),this.name="CanceledError",this.__CANCEL__=!0}};function Nl(r,A,e){const t=e.config.validateStatus;!e.status||!t||t(e.status)?r(e):A(new TA("Request failed with status code "+e.status,[TA.ERR_BAD_REQUEST,TA.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function I0(r){const A=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return A&&A[1]||""}function M0(r,A){r=r||10;const e=new Array(r),t=new Array(r);let i=0,s=0,n;return A=A!==void 0?A:1e3,function(a){const l=Date.now(),c=t[s];n||(n=l),e[i]=a,t[i]=l;let u=s,d=0;for(;u!==i;)d+=e[u++],u=u%r;if(i=(i+1)%r,i===s&&(s=(s+1)%r),l-n<A)return;const B=c&&l-c;return B?Math.round(d*1e3/B):void 0}}function D0(r,A){let e=0,t=1e3/A,i,s;const n=(l,c=Date.now())=>{e=c,i=null,s&&(clearTimeout(s),s=null),r(...l)};return[(...l)=>{const c=Date.now(),u=c-e;u>=t?n(l,c):(i=l,s||(s=setTimeout(()=>{s=null,n(i)},t-u)))},()=>i&&n(i)]}const Si=(r,A,e=3)=>{let t=0;const i=M0(50,250);return D0(s=>{const n=s.loaded,o=s.lengthComputable?s.total:void 0,a=n-t,l=i(a),c=n<=o;t=n;const u={loaded:n,total:o,progress:o?n/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-n)/l:void 0,event:s,lengthComputable:o!=null,[A?"download":"upload"]:!0};r(u)},e)},Kl=(r,A)=>{const e=r!=null;return[t=>A[0]({lengthComputable:e,total:r,loaded:t}),A[1]]},Vl=r=>(...A)=>V.asap(()=>r(...A)),_0=pe.hasStandardBrowserEnv?((r,A)=>e=>(e=new URL(e,pe.origin),r.protocol===e.protocol&&r.host===e.host&&(A||r.port===e.port)))(new URL(pe.origin),pe.navigator&&/(msie|trident)/i.test(pe.navigator.userAgent)):()=>!0,k0=pe.hasStandardBrowserEnv?{write(r,A,e,t,i,s,n){if(typeof document>"u")return;const o=[`${r}=${encodeURIComponent(A)}`];V.isNumber(e)&&o.push(`expires=${new Date(e).toUTCString()}`),V.isString(t)&&o.push(`path=${t}`),V.isString(i)&&o.push(`domain=${i}`),s===!0&&o.push("secure"),V.isString(n)&&o.push(`SameSite=${n}`),document.cookie=o.join("; ")},read(r){if(typeof document>"u")return null;const A=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)"));return A?decodeURIComponent(A[1]):null},remove(r){this.write(r,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function O0(r){return typeof r!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function N0(r,A){return A?r.replace(/\/?\/$/,"")+"/"+A.replace(/^\/+/,""):r}function Pl(r,A,e){let t=!O0(A);return r&&(t||e==!1)?N0(r,A):A}const zl=r=>r instanceof Ee?{...r}:r;function _t(r,A){A=A||{};const e={};function t(l,c,u,d){return V.isPlainObject(l)&&V.isPlainObject(c)?V.merge.call({caseless:d},l,c):V.isPlainObject(c)?V.merge({},c):V.isArray(c)?c.slice():c}function i(l,c,u,d){if(V.isUndefined(c)){if(!V.isUndefined(l))return t(void 0,l,u,d)}else return t(l,c,u,d)}function s(l,c){if(!V.isUndefined(c))return t(void 0,c)}function n(l,c){if(V.isUndefined(c)){if(!V.isUndefined(l))return t(void 0,l)}else return t(void 0,c)}function o(l,c,u){if(u in A)return t(l,c);if(u in r)return t(void 0,l)}const a={url:s,method:s,data:s,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:o,headers:(l,c,u)=>i(zl(l),zl(c),u,!0)};return V.forEach(Object.keys({...r,...A}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;const u=V.hasOwnProp(a,c)?a[c]:i,d=u(r[c],A[c],c);V.isUndefined(d)&&u!==o||(e[c]=d)}),e}const Gl=r=>{const A=_t({},r);let{data:e,withXSRFToken:t,xsrfHeaderName:i,xsrfCookieName:s,headers:n,auth:o}=A;if(A.headers=n=Ee.from(n),A.url=Ml(Pl(A.baseURL,A.url,A.allowAbsoluteUrls),r.params,r.paramsSerializer),o&&n.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),V.isFormData(e)){if(pe.hasStandardBrowserEnv||pe.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if(V.isFunction(e.getHeaders)){const a=e.getHeaders(),l=["content-type","content-length"];Object.entries(a).forEach(([c,u])=>{l.includes(c.toLowerCase())&&n.set(c,u)})}}if(pe.hasStandardBrowserEnv&&(t&&V.isFunction(t)&&(t=t(A)),t||t!==!1&&_0(A.url))){const a=i&&s&&k0.read(s);a&&n.set(i,a)}return A},K0=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(e,t){const i=Gl(r);let s=i.data;const n=Ee.from(i.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:l}=i,c,u,d,B,p;function f(){B&&B(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let w=new XMLHttpRequest;w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout;function F(){if(!w)return;const E=Ee.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),S={data:!o||o==="text"||o==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:E,config:r,request:w};Nl(function(z){e(z),f()},function(z){t(z),f()},S),w=null}"onloadend"in w?w.onloadend=F:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(F)},w.onabort=function(){w&&(t(new TA("Request aborted",TA.ECONNABORTED,r,w)),w=null)},w.onerror=function(U){const S=U&&U.message?U.message:"Network Error",P=new TA(S,TA.ERR_NETWORK,r,w);P.event=U||null,t(P),w=null},w.ontimeout=function(){let U=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||xn;i.timeoutErrorMessage&&(U=i.timeoutErrorMessage),t(new TA(U,S.clarifyTimeoutError?TA.ETIMEDOUT:TA.ECONNABORTED,r,w)),w=null},s===void 0&&n.setContentType(null),"setRequestHeader"in w&&V.forEach(n.toJSON(),function(U,S){w.setRequestHeader(S,U)}),V.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),o&&o!=="json"&&(w.responseType=i.responseType),l&&([d,p]=Si(l,!0),w.addEventListener("progress",d)),a&&w.upload&&([u,B]=Si(a),w.upload.addEventListener("progress",u),w.upload.addEventListener("loadend",B)),(i.cancelToken||i.signal)&&(c=E=>{w&&(t(!E||E.type?new Sr(null,r,w):E),w.abort(),w=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const C=I0(i.url);if(C&&pe.protocols.indexOf(C)===-1){t(new TA("Unsupported protocol "+C+":",TA.ERR_BAD_REQUEST,r));return}w.send(s||null)})},V0=(r,A)=>{const{length:e}=r=r?r.filter(Boolean):[];if(A||e){let t=new AbortController,i;const s=function(l){if(!i){i=!0,o();const c=l instanceof Error?l:this.reason;t.abort(c instanceof TA?c:new Sr(c instanceof Error?c.message:c))}};let n=A&&setTimeout(()=>{n=null,s(new TA(`timeout of ${A}ms exceeded`,TA.ETIMEDOUT))},A);const o=()=>{r&&(n&&clearTimeout(n),n=null,r.forEach(l=>{l.unsubscribe?l.unsubscribe(s):l.removeEventListener("abort",s)}),r=null)};r.forEach(l=>l.addEventListener("abort",s));const{signal:a}=t;return a.unsubscribe=()=>V.asap(o),a}},P0=function*(r,A){let e=r.byteLength;if(e<A){yield r;return}let t=0,i;for(;t<e;)i=t+A,yield r.slice(t,i),t=i},z0=async function*(r,A){for await(const e of G0(r))yield*P0(e,A)},G0=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const A=r.getReader();try{for(;;){const{done:e,value:t}=await A.read();if(e)break;yield t}}finally{await A.cancel()}},Rl=(r,A,e,t)=>{const i=z0(r,A);let s=0,n,o=a=>{n||(n=!0,t&&t(a))};return new ReadableStream({async pull(a){try{const{done:l,value:c}=await i.next();if(l){o(),a.close();return}let u=c.byteLength;if(e){let d=s+=u;e(d)}a.enqueue(new Uint8Array(c))}catch(l){throw o(l),l}},cancel(a){return o(a),i.return()}},{highWaterMark:2})},Wl=64*1024,{isFunction:Hi}=V,R0=(({Request:r,Response:A})=>({Request:r,Response:A}))(V.global),{ReadableStream:$l,TextEncoder:Xl}=V.global,Jl=(r,...A)=>{try{return!!r(...A)}catch{return!1}},W0=r=>{r=V.merge.call({skipUndefined:!0},R0,r);const{fetch:A,Request:e,Response:t}=r,i=A?Hi(A):typeof fetch=="function",s=Hi(e),n=Hi(t);if(!i)return!1;const o=i&&Hi($l),a=i&&(typeof Xl=="function"?(p=>f=>p.encode(f))(new Xl):async p=>new Uint8Array(await new e(p).arrayBuffer())),l=s&&o&&Jl(()=>{let p=!1;const f=new e(pe.origin,{body:new $l,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!f}),c=n&&o&&Jl(()=>V.isReadableStream(new t("").body)),u={stream:c&&(p=>p.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!u[p]&&(u[p]=(f,w)=>{let F=f&&f[p];if(F)return F.call(f);throw new TA(`Response type '${p}' is not supported`,TA.ERR_NOT_SUPPORT,w)})});const d=async p=>{if(p==null)return 0;if(V.isBlob(p))return p.size;if(V.isSpecCompliantForm(p))return(await new e(pe.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(V.isArrayBufferView(p)||V.isArrayBuffer(p))return p.byteLength;if(V.isURLSearchParams(p)&&(p=p+""),V.isString(p))return(await a(p)).byteLength},B=async(p,f)=>{const w=V.toFiniteNumber(p.getContentLength());return w??d(f)};return async p=>{let{url:f,method:w,data:F,signal:C,cancelToken:E,timeout:U,onDownloadProgress:S,onUploadProgress:P,responseType:z,headers:J,withCredentials:N="same-origin",fetchOptions:Z}=Gl(p),W=A||fetch;z=z?(z+"").toLowerCase():"text";let aA=V0([C,E&&E.toAbortSignal()],U),nA=null;const cA=aA&&aA.unsubscribe&&(()=>{aA.unsubscribe()});let SA;try{if(P&&l&&w!=="get"&&w!=="head"&&(SA=await B(J,F))!==0){let vA=new e(f,{method:"POST",body:F,duplex:"half"}),hA;if(V.isFormData(F)&&(hA=vA.headers.get("content-type"))&&J.setContentType(hA),vA.body){const[j,eA]=Kl(SA,Si(Vl(P)));F=Rl(vA.body,Wl,j,eA)}}V.isString(N)||(N=N?"include":"omit");const CA=s&&"credentials"in e.prototype,MA={...Z,signal:aA,method:w.toUpperCase(),headers:J.normalize().toJSON(),body:F,duplex:"half",credentials:CA?N:void 0};nA=s&&new e(f,MA);let HA=await(s?W(nA,Z):W(f,MA));const UA=c&&(z==="stream"||z==="response");if(c&&(S||UA&&cA)){const vA={};["status","statusText","headers"].forEach(QA=>{vA[QA]=HA[QA]});const hA=V.toFiniteNumber(HA.headers.get("content-length")),[j,eA]=S&&Kl(hA,Si(Vl(S),!0))||[];HA=new t(Rl(HA.body,Wl,j,()=>{eA&&eA(),cA&&cA()}),vA)}z=z||"text";let yA=await u[V.findKey(u,z)||"text"](HA,p);return!UA&&cA&&cA(),await new Promise((vA,hA)=>{Nl(vA,hA,{data:yA,headers:Ee.from(HA.headers),status:HA.status,statusText:HA.statusText,config:p,request:nA})})}catch(CA){throw cA&&cA(),CA&&CA.name==="TypeError"&&/Load failed|fetch/i.test(CA.message)?Object.assign(new TA("Network Error",TA.ERR_NETWORK,p,nA,CA&&CA.response),{cause:CA.cause||CA}):TA.from(CA,CA&&CA.code,p,nA,CA&&CA.response)}}},$0=new Map,Zl=r=>{let A=r&&r.env||{};const{fetch:e,Request:t,Response:i}=A,s=[t,i,e];let n=s.length,o=n,a,l,c=$0;for(;o--;)a=s[o],l=c.get(a),l===void 0&&c.set(a,l=o?new Map:W0(A)),c=l;return l};Zl();const In={http:p0,xhr:K0,fetch:{get:Zl}};V.forEach(In,(r,A)=>{if(r){try{Object.defineProperty(r,"name",{value:A})}catch{}Object.defineProperty(r,"adapterName",{value:A})}});const Yl=r=>`- ${r}`,X0=r=>V.isFunction(r)||r===null||r===!1;function J0(r,A){r=V.isArray(r)?r:[r];const{length:e}=r;let t,i;const s={};for(let n=0;n<e;n++){t=r[n];let o;if(i=t,!X0(t)&&(i=In[(o=String(t)).toLowerCase()],i===void 0))throw new TA(`Unknown adapter '${o}'`);if(i&&(V.isFunction(i)||(i=i.get(A))))break;s[o||"#"+n]=i}if(!i){const n=Object.entries(s).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?n.length>1?`since :
4
4
  `+n.map(Yl).join(`
5
- `):" "+Yl(n[0]):"as no adapter specified";throw new TA("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i}const ql={getAdapter:X0,adapters:In};function Mn(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Sr(null,r)}function jl(r){return Mn(r),r.headers=Ee.from(r.headers),r.data=Ln.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),ql.getAdapter(r.adapter||xr.adapter,r)(r).then(function(t){return Mn(r),t.data=Ln.call(r,r.transformResponse,t),t.headers=Ee.from(t.headers),t},function(t){return Ol(t)||(Mn(r),t&&t.response&&(t.response.data=Ln.call(r,r.transformResponse,t.response),t.response.headers=Ee.from(t.response.headers))),Promise.reject(t)})}const Ac="1.13.5",Li={};["object","boolean","number","function","string","symbol"].forEach((r,A)=>{Li[r]=function(t){return typeof t===r||"a"+(A<1?"n ":" ")+r}});const ec={};Li.transitional=function(A,e,t){function i(s,n){return"[Axios v"+Ac+"] Transitional option '"+s+"'"+n+(t?". "+t:"")}return(s,n,o)=>{if(A===!1)throw new TA(i(n," has been removed"+(e?" in "+e:"")),TA.ERR_DEPRECATED);return e&&!ec[n]&&(ec[n]=!0,console.warn(i(n," has been deprecated since v"+e+" and will be removed in the near future"))),A?A(s,n,o):!0}},Li.spelling=function(A){return(e,t)=>(console.warn(`${t} is likely a misspelling of ${A}`),!0)};function J0(r,A,e){if(typeof r!="object")throw new TA("options must be an object",TA.ERR_BAD_OPTION_VALUE);const t=Object.keys(r);let i=t.length;for(;i-- >0;){const s=t[i],n=A[s];if(n){const o=r[s],a=o===void 0||n(o,s,r);if(a!==!0)throw new TA("option "+s+" must be "+a,TA.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new TA("Unknown option "+s,TA.ERR_BAD_OPTION)}}const Ii={assertOptions:J0,validators:Li},ke=Ii.validators;let kt=class{constructor(A){this.defaults=A||{},this.interceptors={request:new Dl,response:new Dl}}async request(A,e){try{return await this._request(A,e)}catch(t){if(t instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{t.stack?s&&!String(t.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(t.stack+=`
6
- `+s):t.stack=s}catch{}}throw t}}_request(A,e){typeof A=="string"?(e=e||{},e.url=A):e=A||{},e=_t(this.defaults,e);const{transitional:t,paramsSerializer:i,headers:s}=e;t!==void 0&&Ii.assertOptions(t,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean),legacyInterceptorReqResOrdering:ke.transitional(ke.boolean)},!1),i!=null&&(K.isFunction(i)?e.paramsSerializer={serialize:i}:Ii.assertOptions(i,{encode:ke.function,serialize:ke.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ii.assertOptions(e,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let n=s&&K.merge(s.common,s[e.method]);s&&K.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),e.headers=Ee.concat(n,s);const o=[];let a=!0;this.interceptors.request.forEach(function(f){if(typeof f.runWhen=="function"&&f.runWhen(e)===!1)return;a=a&&f.synchronous;const g=e.transitional||xn;g&&g.legacyInterceptorReqResOrdering?o.unshift(f.fulfilled,f.rejected):o.push(f.fulfilled,f.rejected)});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let c,u=0,d;if(!a){const p=[jl.bind(this),void 0];for(p.unshift(...o),p.push(...l),d=p.length,c=Promise.resolve(e);u<d;)c=c.then(p[u++],p[u++]);return c}d=o.length;let B=e;for(;u<d;){const p=o[u++],f=o[u++];try{B=p(B)}catch(g){f.call(this,g);break}}try{c=jl.call(this,B)}catch(p){return Promise.reject(p)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(A){A=_t(this.defaults,A);const e=Pl(A.baseURL,A.url,A.allowAbsoluteUrls);return Ml(e,A.params,A.paramsSerializer)}};K.forEach(["delete","get","head","options"],function(A){kt.prototype[A]=function(e,t){return this.request(_t(t||{},{method:A,url:e,data:(t||{}).data}))}}),K.forEach(["post","put","patch"],function(A){function e(t){return function(s,n,o){return this.request(_t(o||{},{method:A,headers:t?{"Content-Type":"multipart/form-data"}:{},url:s,data:n}))}}kt.prototype[A]=e(),kt.prototype[A+"Form"]=e(!0)});let Z0=class qu{constructor(A){if(typeof A!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(s){e=s});const t=this;this.promise.then(i=>{if(!t._listeners)return;let s=t._listeners.length;for(;s-- >0;)t._listeners[s](i);t._listeners=null}),this.promise.then=i=>{let s;const n=new Promise(o=>{t.subscribe(o),s=o}).then(i);return n.cancel=function(){t.unsubscribe(s)},n},A(function(s,n,o){t.reason||(t.reason=new Sr(s,n,o),e(t.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(A){if(this.reason){A(this.reason);return}this._listeners?this._listeners.push(A):this._listeners=[A]}unsubscribe(A){if(!this._listeners)return;const e=this._listeners.indexOf(A);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const A=new AbortController,e=t=>{A.abort(t)};return this.subscribe(e),A.signal.unsubscribe=()=>this.unsubscribe(e),A.signal}static source(){let A;return{token:new qu(function(i){A=i}),cancel:A}}};function Y0(r){return function(e){return r.apply(null,e)}}function q0(r){return K.isObject(r)&&r.isAxiosError===!0}const Dn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Dn).forEach(([r,A])=>{Dn[A]=r});function tc(r){const A=new kt(r),e=vl(kt.prototype.request,A);return K.extend(e,kt.prototype,A,{allOwnKeys:!0}),K.extend(e,A,null,{allOwnKeys:!0}),e.create=function(i){return tc(_t(r,i))},e}const XA=tc(xr);XA.Axios=kt,XA.CanceledError=Sr,XA.CancelToken=Z0,XA.isCancel=Ol,XA.VERSION=Ac,XA.toFormData=xi,XA.AxiosError=TA,XA.Cancel=XA.CanceledError,XA.all=function(A){return Promise.all(A)},XA.spread=Y0,XA.isAxiosError=q0,XA.mergeConfig=_t,XA.AxiosHeaders=Ee,XA.formToJSON=r=>_l(K.isHTMLForm(r)?new FormData(r):r),XA.getAdapter=ql.getAdapter,XA.HttpStatusCode=Dn,XA.default=XA;const{Axios:Qb,AxiosError:Fb,CanceledError:Ub,isCancel:Eb,CancelToken:xb,VERSION:Tb,all:Sb,Cancel:Hb,isAxiosError:Lb,spread:Ib,toFormData:Mb,AxiosHeaders:Db,HttpStatusCode:_b,formToJSON:kb,getAdapter:Ob,mergeConfig:Nb}=XA,qe=Object.create(null);qe.open="0",qe.close="1",qe.ping="2",qe.pong="3",qe.message="4",qe.upgrade="5",qe.noop="6";const Mi=Object.create(null);Object.keys(qe).forEach(r=>{Mi[qe[r]]=r});const _n={type:"error",data:"parser error"},rc=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ic=typeof ArrayBuffer=="function",sc=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,kn=({type:r,data:A},e,t)=>rc&&A instanceof Blob?e?t(A):nc(A,t):ic&&(A instanceof ArrayBuffer||sc(A))?e?t(A):nc(new Blob([A]),t):t(qe[r]+(A||"")),nc=(r,A)=>{const e=new FileReader;return e.onload=function(){const t=e.result.split(",")[1];A("b"+(t||""))},e.readAsDataURL(r)};function oc(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let On;function j0(r,A){if(rc&&r.data instanceof Blob)return r.data.arrayBuffer().then(oc).then(A);if(ic&&(r.data instanceof ArrayBuffer||sc(r.data)))return A(oc(r.data));kn(r,!1,e=>{On||(On=new TextEncoder),A(On.encode(e))})}const ac="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<ac.length;r++)Hr[ac.charCodeAt(r)]=r;const AB=r=>{let A=r.length*.75,e=r.length,t,i=0,s,n,o,a;r[r.length-1]==="="&&(A--,r[r.length-2]==="="&&A--);const l=new ArrayBuffer(A),c=new Uint8Array(l);for(t=0;t<e;t+=4)s=Hr[r.charCodeAt(t)],n=Hr[r.charCodeAt(t+1)],o=Hr[r.charCodeAt(t+2)],a=Hr[r.charCodeAt(t+3)],c[i++]=s<<2|n>>4,c[i++]=(n&15)<<4|o>>2,c[i++]=(o&3)<<6|a&63;return l},eB=typeof ArrayBuffer=="function",Nn=(r,A)=>{if(typeof r!="string")return{type:"message",data:lc(r,A)};const e=r.charAt(0);return e==="b"?{type:"message",data:tB(r.substring(1),A)}:Mi[e]?r.length>1?{type:Mi[e],data:r.substring(1)}:{type:Mi[e]}:_n},tB=(r,A)=>{if(eB){const e=AB(r);return lc(e,A)}else return{base64:!0,data:r}},lc=(r,A)=>A==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,cc="",rB=(r,A)=>{const e=r.length,t=new Array(e);let i=0;r.forEach((s,n)=>{kn(s,!1,o=>{t[n]=o,++i===e&&A(t.join(cc))})})},iB=(r,A)=>{const e=r.split(cc),t=[];for(let i=0;i<e.length;i++){const s=Nn(e[i],A);if(t.push(s),s.type==="error")break}return t};function sB(){return new TransformStream({transform(r,A){j0(r,e=>{const t=e.length;let i;if(t<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,t);else if(t<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,t)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(t))}r.data&&typeof r.data!="string"&&(i[0]|=128),A.enqueue(i),A.enqueue(e)})}})}let Kn;function Di(r){return r.reduce((A,e)=>A+e.length,0)}function _i(r,A){if(r[0].length===A)return r.shift();const e=new Uint8Array(A);let t=0;for(let i=0;i<A;i++)e[i]=r[0][t++],t===r[0].length&&(r.shift(),t=0);return r.length&&t<r[0].length&&(r[0]=r[0].slice(t)),e}function nB(r,A){Kn||(Kn=new TextDecoder);const e=[];let t=0,i=-1,s=!1;return new TransformStream({transform(n,o){for(e.push(n);;){if(t===0){if(Di(e)<1)break;const a=_i(e,1);s=(a[0]&128)===128,i=a[0]&127,i<126?t=3:i===126?t=1:t=2}else if(t===1){if(Di(e)<2)break;const a=_i(e,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),t=3}else if(t===2){if(Di(e)<8)break;const a=_i(e,8),l=new DataView(a.buffer,a.byteOffset,a.length),c=l.getUint32(0);if(c>Math.pow(2,21)-1){o.enqueue(_n);break}i=c*Math.pow(2,32)+l.getUint32(4),t=3}else{if(Di(e)<i)break;const a=_i(e,i);o.enqueue(Nn(s?a:Kn.decode(a),A)),t=0}if(i===0||i>r){o.enqueue(_n);break}}}})}const hc=4;function ie(r){if(r)return oB(r)}function oB(r){for(var A in ie.prototype)r[A]=ie.prototype[A];return r}ie.prototype.on=ie.prototype.addEventListener=function(r,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(A),this},ie.prototype.once=function(r,A){function e(){this.off(r,e),A.apply(this,arguments)}return e.fn=A,this.on(r,e),this},ie.prototype.off=ie.prototype.removeListener=ie.prototype.removeAllListeners=ie.prototype.removeEventListener=function(r,A){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var e=this._callbacks["$"+r];if(!e)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var t,i=0;i<e.length;i++)if(t=e[i],t===A||t.fn===A){e.splice(i,1);break}return e.length===0&&delete this._callbacks["$"+r],this},ie.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var A=new Array(arguments.length-1),e=this._callbacks["$"+r],t=1;t<arguments.length;t++)A[t-1]=arguments[t];if(e){e=e.slice(0);for(var t=0,i=e.length;t<i;++t)e[t].apply(this,A)}return this},ie.prototype.emitReserved=ie.prototype.emit,ie.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]},ie.prototype.hasListeners=function(r){return!!this.listeners(r).length};const ki=typeof Promise=="function"&&typeof Promise.resolve=="function"?A=>Promise.resolve().then(A):(A,e)=>e(A,0),Oe=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),aB="arraybuffer";function Kb(){}function uc(r,...A){return A.reduce((e,t)=>(r.hasOwnProperty(t)&&(e[t]=r[t]),e),{})}const lB=Oe.setTimeout,cB=Oe.clearTimeout;function Oi(r,A){A.useNativeTimers?(r.setTimeoutFn=lB.bind(Oe),r.clearTimeoutFn=cB.bind(Oe)):(r.setTimeoutFn=Oe.setTimeout.bind(Oe),r.clearTimeoutFn=Oe.clearTimeout.bind(Oe))}const hB=1.33;function uB(r){return typeof r=="string"?dB(r):Math.ceil((r.byteLength||r.size)*hB)}function dB(r){let A=0,e=0;for(let t=0,i=r.length;t<i;t++)A=r.charCodeAt(t),A<128?e+=1:A<2048?e+=2:A<55296||A>=57344?e+=3:(t++,e+=4);return e}function dc(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function fB(r){let A="";for(let e in r)r.hasOwnProperty(e)&&(A.length&&(A+="&"),A+=encodeURIComponent(e)+"="+encodeURIComponent(r[e]));return A}function pB(r){let A={},e=r.split("&");for(let t=0,i=e.length;t<i;t++){let s=e[t].split("=");A[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return A}class BB extends Error{constructor(A,e,t){super(A),this.description=e,this.context=t,this.type="TransportError"}}class Vn extends ie{constructor(A){super(),this.writable=!1,Oi(this,A),this.opts=A,this.query=A.query,this.socket=A.socket,this.supportsBinary=!A.forceBase64}onError(A,e,t){return super.emitReserved("error",new BB(A,e,t)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(A){this.readyState==="open"&&this.write(A)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(A){const e=Nn(A,this.socket.binaryType);this.onPacket(e)}onPacket(A){super.emitReserved("packet",A)}onClose(A){this.readyState="closed",super.emitReserved("close",A)}pause(A){}createUri(A,e={}){return A+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){const A=this.opts.hostname;return A.indexOf(":")===-1?A:"["+A+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(A){const e=fB(A);return e.length?"?"+e:""}}class gB extends Vn{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(A){this.readyState="pausing";const e=()=>{this.readyState="paused",A()};if(this._polling||!this.writable){let t=0;this._polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(A){const e=t=>{if(this.readyState==="opening"&&t.type==="open"&&this.onOpen(),t.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)};iB(A,this.socket.binaryType).forEach(e),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const A=()=>{this.write([{type:"close"}])};this.readyState==="open"?A():this.once("open",A)}write(A){this.writable=!1,rB(A,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const A=this.opts.secure?"https":"http",e=this.query||{};return this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=dc()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.createUri(A,e)}}let fc=!1;try{fc=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const wB=fc;function mB(){}class CB extends gB{constructor(A){if(super(A),typeof location<"u"){const e=location.protocol==="https:";let t=location.port;t||(t=e?"443":"80"),this.xd=typeof location<"u"&&A.hostname!==location.hostname||t!==A.port}}doWrite(A,e){const t=this.request({method:"POST",data:A});t.on("success",e),t.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const A=this.request();A.on("data",this.onData.bind(this)),A.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=A}}class je extends ie{constructor(A,e,t){super(),this.createRequest=A,Oi(this,t),this._opts=t,this._method=t.method||"GET",this._uri=e,this._data=t.data!==void 0?t.data:null,this._create()}_create(){var A;const e=uc(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;const t=this._xhr=this.createRequest(e);try{t.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{t.setRequestHeader("Accept","*/*")}catch{}(A=this._opts.cookieJar)===null||A===void 0||A.addCookies(t),"withCredentials"in t&&(t.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(t.timeout=this._opts.requestTimeout),t.onreadystatechange=()=>{var i;t.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(t.getResponseHeader("set-cookie"))),t.readyState===4&&(t.status===200||t.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof t.status=="number"?t.status:0)},0))},t.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=je.requestsCount++,je.requests[this._index]=this)}_onError(A){this.emitReserved("error",A,this._xhr),this._cleanup(!0)}_cleanup(A){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=mB,A)try{this._xhr.abort()}catch{}typeof document<"u"&&delete je.requests[this._index],this._xhr=null}}_onLoad(){const A=this._xhr.responseText;A!==null&&(this.emitReserved("data",A),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(je.requestsCount=0,je.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",pc);else if(typeof addEventListener=="function"){const r="onpagehide"in Oe?"pagehide":"unload";addEventListener(r,pc,!1)}}function pc(){for(let r in je.requests)je.requests.hasOwnProperty(r)&&je.requests[r].abort()}const vB=(function(){const r=Bc({xdomain:!1});return r&&r.responseType!==null})();class bB extends CB{constructor(A){super(A);const e=A&&A.forceBase64;this.supportsBinary=vB&&!e}request(A={}){return Object.assign(A,{xd:this.xd},this.opts),new je(Bc,this.uri(),A)}}function Bc(r){const A=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!A||wB))return new XMLHttpRequest}catch{}if(!A)try{return new Oe[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const gc=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class yB extends Vn{get name(){return"websocket"}doOpen(){const A=this.uri(),e=this.opts.protocols,t=gc?{}:uc(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(t.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(A,e,t)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=A=>this.onClose({description:"websocket connection closed",context:A}),this.ws.onmessage=A=>this.onData(A.data),this.ws.onerror=A=>this.onError("websocket error",A)}write(A){this.writable=!1;for(let e=0;e<A.length;e++){const t=A[e],i=e===A.length-1;kn(t,this.supportsBinary,s=>{try{this.doWrite(t,s)}catch{}i&&ki(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const A=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=dc()),this.supportsBinary||(e.b64=1),this.createUri(A,e)}}const Pn=Oe.WebSocket||Oe.MozWebSocket;class QB extends yB{createSocket(A,e,t){return gc?new Pn(A,e,t):e?new Pn(A,e):new Pn(A)}doWrite(A,e){this.ws.send(e)}}class FB extends Vn{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(A){return this.emitReserved("error",A)}this._transport.closed.then(()=>{this.onClose()}).catch(A=>{this.onError("webtransport error",A)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(A=>{const e=nB(Number.MAX_SAFE_INTEGER,this.socket.binaryType),t=A.readable.pipeThrough(e).getReader(),i=sB();i.readable.pipeTo(A.writable),this._writer=i.writable.getWriter();const s=()=>{t.read().then(({done:o,value:a})=>{o||(this.onPacket(a),s())}).catch(o=>{})};s();const n={type:"open"};this.query.sid&&(n.data=`{"sid":"${this.query.sid}"}`),this._writer.write(n).then(()=>this.onOpen())})})}write(A){this.writable=!1;for(let e=0;e<A.length;e++){const t=A[e],i=e===A.length-1;this._writer.write(t).then(()=>{i&&ki(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var A;(A=this._transport)===null||A===void 0||A.close()}}const UB={websocket:QB,webtransport:FB,polling:bB},EB=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,xB=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zn(r){if(r.length>8e3)throw"URI too long";const A=r,e=r.indexOf("["),t=r.indexOf("]");e!=-1&&t!=-1&&(r=r.substring(0,e)+r.substring(e,t).replace(/:/g,";")+r.substring(t,r.length));let i=EB.exec(r||""),s={},n=14;for(;n--;)s[xB[n]]=i[n]||"";return e!=-1&&t!=-1&&(s.source=A,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=TB(s,s.path),s.queryKey=SB(s,s.query),s}function TB(r,A){const e=/\/{2,9}/g,t=A.replace(e,"/").split("/");return(A.slice(0,1)=="/"||A.length===0)&&t.splice(0,1),A.slice(-1)=="/"&&t.splice(t.length-1,1),t}function SB(r,A){const e={};return A.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,i,s){i&&(e[i]=s)}),e}const Gn=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ni=[];Gn&&addEventListener("offline",()=>{Ni.forEach(r=>r())},!1);class mt extends ie{constructor(A,e){if(super(),this.binaryType=aB,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,A&&typeof A=="object"&&(e=A,A=null),A){const t=zn(A);e.hostname=t.host,e.secure=t.protocol==="https"||t.protocol==="wss",e.port=t.port,t.query&&(e.query=t.query)}else e.host&&(e.hostname=zn(e.host).host);Oi(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(t=>{const i=t.prototype.name;this.transports.push(i),this._transportsByName[i]=t}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=pB(this.opts.query)),Gn&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ni.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(A){const e=Object.assign({},this.opts.query);e.EIO=hc,e.transport=A,this.id&&(e.sid=this.id);const t=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[A]);return new this._transportsByName[A](t)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const A=this.opts.rememberUpgrade&&mt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const e=this.createTransport(A);e.open(),this.setTransport(e)}setTransport(A){this.transport&&this.transport.removeAllListeners(),this.transport=A,A.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",mt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(A){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",A),this.emitReserved("heartbeat"),A.type){case"open":this.onHandshake(JSON.parse(A.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const e=new Error("server error");e.code=A.data,this._onError(e);break;case"message":this.emitReserved("data",A.data),this.emitReserved("message",A.data);break}}onHandshake(A){this.emitReserved("handshake",A),this.id=A.sid,this.transport.query.sid=A.sid,this._pingInterval=A.pingInterval,this._pingTimeout=A.pingTimeout,this._maxPayload=A.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const A=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+A,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},A),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const A=this._getWritablePackets();this.transport.send(A),this._prevBufferLen=A.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const i=this.writeBuffer[t].data;if(i&&(e+=uB(i)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const A=Date.now()>this._pingTimeoutTime;return A&&(this._pingTimeoutTime=0,ki(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),A}write(A,e,t){return this._sendPacket("message",A,e,t),this}send(A,e,t){return this._sendPacket("message",A,e,t),this}_sendPacket(A,e,t,i){if(typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=null),this.readyState==="closing"||this.readyState==="closed")return;t=t||{},t.compress=t.compress!==!1;const s={type:A,data:e,options:t};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const A=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),A()},t=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?t():A()}):this.upgrading?t():A()),this}_onError(A){if(mt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",A),this._onClose("transport error",A)}_onClose(A,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Gn&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const t=Ni.indexOf(this._offlineEventListener);t!==-1&&Ni.splice(t,1)}this.readyState="closed",this.id=null,this.emitReserved("close",A,e),this.writeBuffer=[],this._prevBufferLen=0}}}mt.protocol=hc;class HB extends mt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let A=0;A<this._upgrades.length;A++)this._probe(this._upgrades[A])}_probe(A){let e=this.createTransport(A),t=!1;mt.priorWebsocketSuccess=!1;const i=()=>{t||(e.send([{type:"ping",data:"probe"}]),e.once("packet",u=>{if(!t)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;mt.priorWebsocketSuccess=e.name==="websocket",this.transport.pause(()=>{t||this.readyState!=="closed"&&(c(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=e.name,this.emitReserved("upgradeError",d)}}))};function s(){t||(t=!0,c(),e.close(),e=null)}const n=u=>{const d=new Error("probe error: "+u);d.transport=e.name,s(),this.emitReserved("upgradeError",d)};function o(){n("transport closed")}function a(){n("socket closed")}function l(u){e&&u.name!==e.name&&s()}const c=()=>{e.removeListener("open",i),e.removeListener("error",n),e.removeListener("close",o),this.off("close",a),this.off("upgrading",l)};e.once("open",i),e.once("error",n),e.once("close",o),this.once("close",a),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&A!=="webtransport"?this.setTimeoutFn(()=>{t||e.open()},200):e.open()}onHandshake(A){this._upgrades=this._filterUpgrades(A.upgrades),super.onHandshake(A)}_filterUpgrades(A){const e=[];for(let t=0;t<A.length;t++)~this.transports.indexOf(A[t])&&e.push(A[t]);return e}}let LB=class extends HB{constructor(A,e={}){const t=typeof A=="object"?A:e;(!t.transports||t.transports&&typeof t.transports[0]=="string")&&(t.transports=(t.transports||["polling","websocket","webtransport"]).map(i=>UB[i]).filter(i=>!!i)),super(A,t)}};function IB(r,A="",e){let t=r;e=e||typeof location<"u"&&location,r==null&&(r=e.protocol+"//"+e.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=e.protocol+r:r=e.host+r),/^(https?|wss?):\/\//.test(r)||(typeof e<"u"?r=e.protocol+"//"+r:r="https://"+r),t=zn(r)),t.port||(/^(http|ws)$/.test(t.protocol)?t.port="80":/^(http|ws)s$/.test(t.protocol)&&(t.port="443")),t.path=t.path||"/";const s=t.host.indexOf(":")!==-1?"["+t.host+"]":t.host;return t.id=t.protocol+"://"+s+":"+t.port+A,t.href=t.protocol+"://"+s+(e&&e.port===t.port?"":":"+t.port),t}const MB=typeof ArrayBuffer=="function",DB=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,wc=Object.prototype.toString,_B=typeof Blob=="function"||typeof Blob<"u"&&wc.call(Blob)==="[object BlobConstructor]",kB=typeof File=="function"||typeof File<"u"&&wc.call(File)==="[object FileConstructor]";function Rn(r){return MB&&(r instanceof ArrayBuffer||DB(r))||_B&&r instanceof Blob||kB&&r instanceof File}function Ki(r,A){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let e=0,t=r.length;e<t;e++)if(Ki(r[e]))return!0;return!1}if(Rn(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return Ki(r.toJSON(),!0);for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&Ki(r[e]))return!0;return!1}function OB(r){const A=[],e=r.data,t=r;return t.data=Wn(e,A),t.attachments=A.length,{packet:t,buffers:A}}function Wn(r,A){if(!r)return r;if(Rn(r)){const e={_placeholder:!0,num:A.length};return A.push(r),e}else if(Array.isArray(r)){const e=new Array(r.length);for(let t=0;t<r.length;t++)e[t]=Wn(r[t],A);return e}else if(typeof r=="object"&&!(r instanceof Date)){const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=Wn(r[t],A));return e}return r}function NB(r,A){return r.data=$n(r.data,A),delete r.attachments,r}function $n(r,A){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<A.length)return A[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=$n(r[e],A);else if(typeof r=="object")for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=$n(r[e],A));return r}const KB=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var NA;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(NA||(NA={}));class VB{constructor(A){this.replacer=A}encode(A){return(A.type===NA.EVENT||A.type===NA.ACK)&&Ki(A)?this.encodeAsBinary({type:A.type===NA.EVENT?NA.BINARY_EVENT:NA.BINARY_ACK,nsp:A.nsp,data:A.data,id:A.id}):[this.encodeAsString(A)]}encodeAsString(A){let e=""+A.type;return(A.type===NA.BINARY_EVENT||A.type===NA.BINARY_ACK)&&(e+=A.attachments+"-"),A.nsp&&A.nsp!=="/"&&(e+=A.nsp+","),A.id!=null&&(e+=A.id),A.data!=null&&(e+=JSON.stringify(A.data,this.replacer)),e}encodeAsBinary(A){const e=OB(A),t=this.encodeAsString(e.packet),i=e.buffers;return i.unshift(t),i}}class Xn extends ie{constructor(A){super(),this.reviver=A}add(A){let e;if(typeof A=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(A);const t=e.type===NA.BINARY_EVENT;t||e.type===NA.BINARY_ACK?(e.type=t?NA.EVENT:NA.ACK,this.reconstructor=new PB(e),e.attachments===0&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else if(Rn(A)||A.base64)if(this.reconstructor)e=this.reconstructor.takeBinaryData(A),e&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+A)}decodeString(A){let e=0;const t={type:Number(A.charAt(0))};if(NA[t.type]===void 0)throw new Error("unknown packet type "+t.type);if(t.type===NA.BINARY_EVENT||t.type===NA.BINARY_ACK){const s=e+1;for(;A.charAt(++e)!=="-"&&e!=A.length;);const n=A.substring(s,e);if(n!=Number(n)||A.charAt(e)!=="-")throw new Error("Illegal attachments");t.attachments=Number(n)}if(A.charAt(e+1)==="/"){const s=e+1;for(;++e&&!(A.charAt(e)===","||e===A.length););t.nsp=A.substring(s,e)}else t.nsp="/";const i=A.charAt(e+1);if(i!==""&&Number(i)==i){const s=e+1;for(;++e;){const n=A.charAt(e);if(n==null||Number(n)!=n){--e;break}if(e===A.length)break}t.id=Number(A.substring(s,e+1))}if(A.charAt(++e)){const s=this.tryParse(A.substr(e));if(Xn.isPayloadValid(t.type,s))t.data=s;else throw new Error("invalid payload")}return t}tryParse(A){try{return JSON.parse(A,this.reviver)}catch{return!1}}static isPayloadValid(A,e){switch(A){case NA.CONNECT:return mc(e);case NA.DISCONNECT:return e===void 0;case NA.CONNECT_ERROR:return typeof e=="string"||mc(e);case NA.EVENT:case NA.BINARY_EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&KB.indexOf(e[0])===-1);case NA.ACK:case NA.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class PB{constructor(A){this.packet=A,this.buffers=[],this.reconPack=A}takeBinaryData(A){if(this.buffers.push(A),this.buffers.length===this.reconPack.attachments){const e=NB(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function mc(r){return Object.prototype.toString.call(r)==="[object Object]"}const zB=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Xn,Encoder:VB,get PacketType(){return NA}},Symbol.toStringTag,{value:"Module"}));function $e(r,A,e){return r.on(A,e),function(){r.off(A,e)}}const GB=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Cc extends ie{constructor(A,e,t){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=A,this.nsp=e,t&&t.auth&&(this.auth=t.auth),this._opts=Object.assign({},t),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const A=this.io;this.subs=[$e(A,"open",this.onopen.bind(this)),$e(A,"packet",this.onpacket.bind(this)),$e(A,"error",this.onerror.bind(this)),$e(A,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...A){return A.unshift("message"),this.emit.apply(this,A),this}emit(A,...e){var t,i,s;if(GB.hasOwnProperty(A))throw new Error('"'+A.toString()+'" is a reserved event name');if(e.unshift(A),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const n={type:NA.EVENT,data:e};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){const c=this.ids++,u=e.pop();this._registerAckCallback(c,u),n.id=c}const o=(i=(t=this.io.engine)===null||t===void 0?void 0:t.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!o||(a?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(A,e){var t;const i=(t=this.flags.timeout)!==null&&t!==void 0?t:this._opts.ackTimeout;if(i===void 0){this.acks[A]=e;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[A];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===A&&this.sendBuffer.splice(o,1);e.call(this,new Error("operation has timed out"))},i),n=(...o)=>{this.io.clearTimeoutFn(s),e.apply(this,o)};n.withError=!0,this.acks[A]=n}emitWithAck(A,...e){return new Promise((t,i)=>{const s=(n,o)=>n?i(n):t(o);s.withError=!0,e.push(s),this.emit(A,...e)})}_addToQueue(A){let e;typeof A[A.length-1]=="function"&&(e=A.pop());const t={id:this._queueSeq++,tryCount:0,pending:!1,args:A,flags:Object.assign({fromQueue:!0},this.flags)};A.push((i,...s)=>(this._queue[0],i!==null?t.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(i)):(this._queue.shift(),e&&e(null,...s)),t.pending=!1,this._drainQueue())),this._queue.push(t),this._drainQueue()}_drainQueue(A=!1){if(!this.connected||this._queue.length===0)return;const e=this._queue[0];e.pending&&!A||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(A){A.nsp=this.nsp,this.io._packet(A)}onopen(){typeof this.auth=="function"?this.auth(A=>{this._sendConnectPacket(A)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(A){this.packet({type:NA.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},A):A})}onerror(A){this.connected||this.emitReserved("connect_error",A)}onclose(A,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",A,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(A=>{if(!this.sendBuffer.some(t=>String(t.id)===A)){const t=this.acks[A];delete this.acks[A],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(A){if(A.nsp===this.nsp)switch(A.type){case NA.CONNECT:A.data&&A.data.sid?this.onconnect(A.data.sid,A.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case NA.EVENT:case NA.BINARY_EVENT:this.onevent(A);break;case NA.ACK:case NA.BINARY_ACK:this.onack(A);break;case NA.DISCONNECT:this.ondisconnect();break;case NA.CONNECT_ERROR:this.destroy();const t=new Error(A.data.message);t.data=A.data.data,this.emitReserved("connect_error",t);break}}onevent(A){const e=A.data||[];A.id!=null&&e.push(this.ack(A.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(A){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const t of e)t.apply(this,A)}super.emit.apply(this,A),this._pid&&A.length&&typeof A[A.length-1]=="string"&&(this._lastOffset=A[A.length-1])}ack(A){const e=this;let t=!1;return function(...i){t||(t=!0,e.packet({type:NA.ACK,id:A,data:i}))}}onack(A){const e=this.acks[A.id];typeof e=="function"&&(delete this.acks[A.id],e.withError&&A.data.unshift(null),e.apply(this,A.data))}onconnect(A,e){this.id=A,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(A=>this.emitEvent(A)),this.receiveBuffer=[],this.sendBuffer.forEach(A=>{this.notifyOutgoingListeners(A),this.packet(A)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(A=>A()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:NA.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(A){return this.flags.compress=A,this}get volatile(){return this.flags.volatile=!0,this}timeout(A){return this.flags.timeout=A,this}onAny(A){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(A),this}prependAny(A){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(A),this}offAny(A){if(!this._anyListeners)return this;if(A){const e=this._anyListeners;for(let t=0;t<e.length;t++)if(A===e[t])return e.splice(t,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(A){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(A),this}prependAnyOutgoing(A){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(A),this}offAnyOutgoing(A){if(!this._anyOutgoingListeners)return this;if(A){const e=this._anyOutgoingListeners;for(let t=0;t<e.length;t++)if(A===e[t])return e.splice(t,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(A){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const t of e)t.apply(this,A.data)}}}function jt(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}jt.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var A=Math.random(),e=Math.floor(A*this.jitter*r);r=(Math.floor(A*10)&1)==0?r-e:r+e}return Math.min(r,this.max)|0},jt.prototype.reset=function(){this.attempts=0},jt.prototype.setMin=function(r){this.ms=r},jt.prototype.setMax=function(r){this.max=r},jt.prototype.setJitter=function(r){this.jitter=r};class Jn extends ie{constructor(A,e){var t;super(),this.nsps={},this.subs=[],A&&typeof A=="object"&&(e=A,A=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,Oi(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((t=e.randomizationFactor)!==null&&t!==void 0?t:.5),this.backoff=new jt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=A;const i=e.parser||zB;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(A){return arguments.length?(this._reconnection=!!A,A||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(A){return A===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=A,this)}reconnectionDelay(A){var e;return A===void 0?this._reconnectionDelay:(this._reconnectionDelay=A,(e=this.backoff)===null||e===void 0||e.setMin(A),this)}randomizationFactor(A){var e;return A===void 0?this._randomizationFactor:(this._randomizationFactor=A,(e=this.backoff)===null||e===void 0||e.setJitter(A),this)}reconnectionDelayMax(A){var e;return A===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=A,(e=this.backoff)===null||e===void 0||e.setMax(A),this)}timeout(A){return arguments.length?(this._timeout=A,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(A){if(~this._readyState.indexOf("open"))return this;this.engine=new LB(this.uri,this.opts);const e=this.engine,t=this;this._readyState="opening",this.skipReconnect=!1;const i=$e(e,"open",function(){t.onopen(),A&&A()}),s=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),A?A(o):this.maybeReconnectOnOpen()},n=$e(e,"error",s);if(this._timeout!==!1){const o=this._timeout,a=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),e.close()},o);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(n),this}connect(A){return this.open(A)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const A=this.engine;this.subs.push($e(A,"ping",this.onping.bind(this)),$e(A,"data",this.ondata.bind(this)),$e(A,"error",this.onerror.bind(this)),$e(A,"close",this.onclose.bind(this)),$e(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(A){try{this.decoder.add(A)}catch(e){this.onclose("parse error",e)}}ondecoded(A){ki(()=>{this.emitReserved("packet",A)},this.setTimeoutFn)}onerror(A){this.emitReserved("error",A)}socket(A,e){let t=this.nsps[A];return t?this._autoConnect&&!t.active&&t.connect():(t=new Cc(this,A,e),this.nsps[A]=t),t}_destroy(A){const e=Object.keys(this.nsps);for(const t of e)if(this.nsps[t].active)return;this._close()}_packet(A){const e=this.encoder.encode(A);for(let t=0;t<e.length;t++)this.engine.write(e[t],A.options)}cleanup(){this.subs.forEach(A=>A()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(A,e){var t;this.cleanup(),(t=this.engine)===null||t===void 0||t.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",A,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const A=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const t=this.setTimeoutFn(()=>{A.skipReconnect||(this.emitReserved("reconnect_attempt",A.backoff.attempts),!A.skipReconnect&&A.open(i=>{i?(A._reconnecting=!1,A.reconnect(),this.emitReserved("reconnect_error",i)):A.onreconnect()}))},e);this.opts.autoUnref&&t.unref(),this.subs.push(()=>{this.clearTimeoutFn(t)})}}onreconnect(){const A=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",A)}}const Lr={};function Vi(r,A){typeof r=="object"&&(A=r,r=void 0),A=A||{};const e=IB(r,A.path||"/socket.io"),t=e.source,i=e.id,s=e.path,n=Lr[i]&&s in Lr[i].nsps,o=A.forceNew||A["force new connection"]||A.multiplex===!1||n;let a;return o?a=new Jn(t,A):(Lr[i]||(Lr[i]=new Jn(t,A)),a=Lr[i]),e.query&&!A.query&&(A.query=e.queryKey),a.socket(e.path,A)}Object.assign(Vi,{Manager:Jn,Socket:Cc,io:Vi,connect:Vi});let xe="http://localhost:8000";function vc(r){if(!r){console.warn("⚠️ [SOCKET DEBUG] setBaseUrl called with empty URL");return}if(r!==xe){const A=xe;xe=r,console.log(`🔄 [SOCKET DEBUG] SocketService: Changing baseUrl from ${A} to ${r}`),qA&&(console.log("🔄 [SOCKET DEBUG] Disconnecting old socket..."),qA.disconnect(),qA.removeAllListeners(),qA=null)}else console.log(`✅ [SOCKET DEBUG] BaseUrl already set to ${r}, no change needed`)}let qA=null;function RB(){const A=(()=>{try{return localStorage.getItem("token")||localStorage.getItem("authToken")||localStorage.getItem("accessToken")||localStorage.getItem("jwt_token")}catch{return null}})();console.log("🔧 [SOCKET DEBUG] Creating socket for MT5 backend:",{baseUrl:xe,hasToken:!!A,tokenLength:A?.length||0,note:"Connecting to MT5 backend WebSocket (root namespace for candles)"});const e=Vi(xe,{transports:["polling","websocket"],reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:10,timeout:15e3,forceNew:!1,withCredentials:!1,autoConnect:!0,auth:A?{token:A}:void 0});return e.on("connect",()=>{console.log("✅ [SOCKET DEBUG] SocketService: connected to ROOT namespace",{socketId:e.id,baseUrl:xe,transport:e.io.engine.transport.name,namespace:e.nsp.name||"/",note:"This socket connects to CandlesGateway (root namespace)"})}),e.on("disconnect",t=>{console.log("⚠️ [SOCKET DEBUG] SocketService: disconnected:",{reason:t,socketId:e.id})}),e.on("connect_error",t=>{console.error("❌ [SOCKET DEBUG] SocketService: connection error to ROOT namespace:",{message:t?.message,description:t?.description,context:t?.context,type:t?.type,baseUrl:xe,namespace:e.nsp.name||"/",note:"CandlesGateway requires JWT authentication - check if token is valid"})}),e.on("reconnect_attempt",t=>{console.log("🔄 [SOCKET DEBUG] SocketService: reconnect attempt",{attempt:t,baseUrl:xe})}),e.on("reconnect_failed",()=>{console.error("❌ [SOCKET DEBUG] SocketService: failed to reconnect",{baseUrl:xe})}),e.on("reconnect",t=>{console.log("✅ [SOCKET DEBUG] SocketService: reconnected after",{attempts:t,socketId:e.id})}),e}function Zn(){const r=qA?.io?.uri||qA?.io?.opts?.host||null;return!qA||qA.io&&r&&r!==xe?(qA&&(console.log("🔄 [SOCKET DEBUG] Recreating socket:",{oldUri:r,newBaseUrl:xe,wasConnected:qA.connected,reason:"baseUrl changed"}),qA.disconnect(),qA.removeAllListeners(),qA=null),console.log("🔧 [SOCKET DEBUG] Creating new socket instance for MT5 backend:",xe),qA=RB()):qA.connected?console.log("✅ [SOCKET DEBUG] Reusing existing connected socket:",{socketId:qA.id,connected:qA.connected,baseUrl:xe,uri:r}):console.log("⏳ [SOCKET DEBUG] Socket exists but not connected, waiting...",{socketId:qA.id,baseUrl:xe}),qA}function WB(r,A){const e=Zn();return e.on(r,A),()=>e.off(r,A)}function $B(r,A){qA&&qA.off(r,A)}function XB(r,A){Zn().emit(r,A)}function JB(){return qA?qA.connected?"connected":"connecting":"disconnected"}const Pi={getSocket:Zn,on:WB,off:$B,emit:XB,getStatus:JB,setBaseUrl:vc},ZB={},bc=O.createContext(),Be=()=>{const r=O.useContext(bc);if(!r)throw new Error("useTrading must be used within TradingProvider");return r},YB=({children:r,baseUrl:A,endpoints:e,accountId:t})=>{const i=A??(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ns&&Ns.tagName.toUpperCase()==="SCRIPT"&&Ns.src||new URL("chart-sdk.umd.js",document.baseURI).href}<"u"&&ZB?.VITE_BASE_URL)??"http://localhost:8000",n={...{candles:"/api/chart/candles",symbols:"/symbols",trades:"/trades",account:"/api/user/account"},...e},o=e?.params||{},[a,l]=O.useState("BTCUSD"),[c,u]=O.useState("M1"),[d,B]=O.useState([]),[p,f]=O.useState(!0),[g,Q]=O.useState([]),[m,E]=O.useState(!1),[F,S]=O.useState(1e5),[P,z]=O.useState(null),[eA,V]=O.useState([]),[Y,X]=O.useState(!0),[fA,oA]=O.useState(!1),[pA,IA]=O.useState(!0),[vA,MA]=O.useState("candles"),[SA,UA]=O.useState(!1),[bA,CA]=O.useState("dark"),aA=O.useRef(null);O.useEffect(()=>{Pi.setBaseUrl(i)},[i]);const J=O.useRef(new Map),q=O.useRef(null),yA=1e3,BA=O.useCallback(async()=>{if(!t){console.log("⚠️ No accountId, skipping orders fetch");return}try{const HA=localStorage.getItem("token");if(!HA){console.log("⚠️ No token, skipping orders fetch");return}E(!0);const KA=await XA.get(`${i}/trades/account/${t}`,{headers:{Authorization:`Bearer ${HA}`}});let uA=[];Array.isArray(KA.data)?uA=KA.data:KA.data?.data&&Array.isArray(KA.data.data)&&(uA=KA.data.data);const mA=uA.filter(gA=>gA.closePrice===null||gA.closePrice===void 0).map(gA=>({id:gA.id,ticket:gA.id?.substring(0,8),symbol:gA.symbol,type:gA.type,volume:gA.volume,price:gA.openPrice,stopLoss:gA.stopLoss,takeProfit:gA.takeProfit,comment:gA.comment||"",status:"OPEN",swap:0,profit:gA.profit||0,profitCurrency:"USD",time:new Date(gA.openedAt||gA.openAt||Date.now()).toLocaleTimeString(),openAt:gA.openedAt||gA.openAt,closeAt:gA.closedAt||gA.closeAt}));Q(mA)}catch(HA){console.error("❌ Error fetching orders:",HA.response?.data||HA.message),Q([])}finally{E(!1)}},[i,t]),EA=O.useCallback((HA,KA)=>!KA||!HA.price||isNaN(KA)||isNaN(HA.price)?HA.profit||0:(HA.type==="BUY"?KA-HA.price:HA.price-KA)*HA.volume,[]),WA=O.useCallback(async()=>{try{const HA=localStorage.getItem("token");if(!HA){console.log("⚠️ No token, skipping balance fetch");return}const KA=await XA.get(`${i}${n.account}`,{headers:{Authorization:`Bearer ${HA}`}});if(KA.data&&KA.data.data){const uA=parseFloat(KA.data.data.balance);isNaN(uA)||S(uA)}}catch(HA){console.error("❌ Error fetching user balance:",HA.response?.data||HA.message)}},[i]),zA=O.useMemo(()=>{const HA=F,KA=g.reduce((LA,FA)=>LA+FA.volume*FA.price*.01,0),uA=g.reduce((LA,FA)=>{const le=d.find(Me=>Me.symbol===FA.symbol);if(le){const Me=FA.type==="BUY"?parseFloat(le.bid||0):parseFloat(le.ask||0);if(Me&&Me>0&&!isNaN(Me))return LA+EA(FA,Me)}return LA+(FA.profit||0)},0),mA=HA+uA,gA=mA-KA,lA=KA>0?mA/KA*100:0;return{balance:HA,equity:mA,margin:KA,freeMargin:gA,level:lA.toFixed(2)}},[g,d,F,EA]);O.useEffect(()=>{localStorage.getItem("token")&&t&&(BA(),WA())},[BA,WA,t]),O.useEffect(()=>{(async()=>{try{f(!0);const KA=n.symbols.includes("?")?`${i}${n.symbols}`:`${i}${n.symbols}`,uA=await XA.get(KA);let mA=[];Array.isArray(uA.data)?(console.log("1 console",uA.data),mA=uA.data):uA.data&&uA.data.data&&Array.isArray(uA.data.data)?(console.log("2 console",uA.data.data),mA=uA.data.data):uA.data&&uA.data.prices&&Array.isArray(uA.data.prices)?(console.log("3 console",uA.data.price),mA=uA.data.prices):uA.data&&Array.isArray(uA.data)&&(mA=uA.data,console.log("else format",uA.data));const gA=mA.map(lA=>lA.symbol&&(lA.bid!==void 0||lA.price!==void 0)?{symbol:lA.symbol,bid:lA.bid??lA.price??0,ask:lA.ask??lA.price??0,change:lA.change??0}:lA);gA.length>0?(B(gA),gA.find(LA=>LA.symbol===a)||l(gA[0].symbol)):B([])}catch(KA){console.error("❌ Error fetching symbols:",KA.response?.data||KA.message),B([])}finally{f(!1)}})()},[i,n.symbols]);const dt=O.useCallback(()=>{const HA=J.current;if(HA.size===0)return;const KA=new Map(HA);HA.clear(),B(uA=>uA.map(mA=>{const gA=KA.get(mA.symbol);return gA?{...mA,...gA}:mA})),Q(uA=>{let mA=!1;const gA=uA.map(lA=>{const LA=KA.get(lA.symbol);if(!LA)return lA;const FA=lA.type==="BUY"?parseFloat(LA.bid||0):parseFloat(LA.ask||0);if(!FA||isNaN(FA)||FA<=0)return lA;const le=EA(lA,FA);return le===lA.profit?lA:(mA=!0,{...lA,profit:le})});return mA?gA:uA})},[EA]);O.useEffect(()=>{aA.current||(aA.current=Pi.getSocket());const HA=aA.current,KA=()=>console.log("✅ TradingContext: Connected"),uA=()=>console.log("⚠️ TradingContext: Disconnected"),mA=lA=>{lA?.symbol&&(J.current.set(lA.symbol,lA),q.current||(q.current=setTimeout(()=>{q.current=null,dt()},yA)))},gA=async lA=>{if(console.log("🔔 Trade closed event received:",lA),!!lA){if(lA.newBalance!==void 0){const LA=parseFloat(lA.newBalance);isNaN(LA)||S(LA)}if(window.notify){const LA=lA.profitLoss||lA.profit||0,FA=LA>=0?`+${LA.toFixed(2)}`:LA.toFixed(2),le=lA.symbol||"Trade",Me=lA.reason||"Closed";window.notify(`Trade Closed: ${Me} | ${le} | P/L: ${FA} USD`,LA>=0?"success":"error")}lA.tradeId&&Q(LA=>LA.filter(FA=>FA.id!==lA.tradeId)),await BA(),await WA()}};return HA.on("connect",KA),HA.on("disconnect",uA),HA.on("priceUpdate",mA),HA.on("tradeClosed",gA),()=>{HA.off("connect",KA),HA.off("disconnect",uA),HA.off("priceUpdate",mA),HA.off("tradeClosed",gA),q.current&&(clearTimeout(q.current),q.current=null),J.current.clear()}},[dt,BA,WA]),O.useEffect(()=>{try{const HA=document.documentElement;if(!HA)return;HA.dataset.theme=bA}catch{}},[bA]);const ae=O.useMemo(()=>d.find(HA=>HA.symbol===a)||{bid:"0.00000",ask:"0.00000",change:0},[d,a]),ft=O.useMemo(()=>({selectedSymbol:a,setSelectedSymbol:l,selectedTimeframe:c,setSelectedTimeframe:u,symbols:d,setSymbols:B,symbolsLoading:p,orders:g,setOrders:Q,ordersLoading:m,fetchOrders:BA,fetchUserBalance:WA,userBalance:F,setUserBalance:S,accountSummary:zA,currentSymbolData:ae,activeTool:P,setActiveTool:z,chartObjects:eA,setChartObjects:V,showGrid:Y,setShowGrid:X,snapToGrid:fA,setSnapToGrid:oA,drawingsVisible:pA,setDrawingsVisible:IA,chartType:vA,setChartType:MA,chartLocked:SA,setChartLocked:UA,theme:bA,setTheme:CA,baseUrl:i,endpoints:n,endpointParams:o,accountId:t}),[a,c,d,p,g,m,BA,WA,F,zA,ae,P,eA,Y,fA,pA,vA,SA,bA,i,n,o]);return h.jsx(bc.Provider,{value:ft,children:r})};var yc={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Qc=O.createContext&&O.createContext(yc),qB=["attr","size","title"];function jB(r,A){if(r==null)return{};var e=Ag(r,A),t,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)t=s[i],!(A.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(e[t]=r[t])}return e}function Ag(r,A){if(r==null)return{};var e={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){if(A.indexOf(t)>=0)continue;e[t]=r[t]}return e}function zi(){return zi=Object.assign?Object.assign.bind():function(r){for(var A=1;A<arguments.length;A++){var e=arguments[A];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},zi.apply(this,arguments)}function Fc(r,A){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);A&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),e.push.apply(e,t)}return e}function Gi(r){for(var A=1;A<arguments.length;A++){var e=arguments[A]!=null?arguments[A]:{};A%2?Fc(Object(e),!0).forEach(function(t){eg(r,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Fc(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}return r}function eg(r,A,e){return A=tg(A),A in r?Object.defineProperty(r,A,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[A]=e,r}function tg(r){var A=rg(r,"string");return typeof A=="symbol"?A:A+""}function rg(r,A){if(typeof r!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var t=e.call(r,A);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(r)}function Uc(r){return r&&r.map((A,e)=>O.createElement(A.tag,Gi({key:e},A.attr),Uc(A.child)))}function Ir(r){return A=>O.createElement(ig,zi({attr:Gi({},r.attr)},A),Uc(r.child))}function ig(r){var A=e=>{var{attr:t,size:i,title:s}=r,n=jB(r,qB),o=i||e.size||"1em",a;return e.className&&(a=e.className),r.className&&(a=(a?a+" ":"")+r.className),O.createElement("svg",zi({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,t,n,{className:a,style:Gi(Gi({color:r.color||e.color},e.style),r.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&O.createElement("title",null,s),r.children)};return Qc!==void 0?O.createElement(Qc.Consumer,null,e=>A(e)):A(yc)}function sg(r){return Ir({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(r)}function ng(r){return Ir({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z"},child:[]}]})(r)}const Ec=({bidPrice:r,askPrice:A,onBuyClick:e,onSellClick:t})=>{const{theme:i}=Be(),s=i==="light",[n,o]=O.useState("0.01"),a=s?"bg-slate-100":"bg-[#12161d]",l=s?"text-slate-700":"text-white",c=s?"hover:bg-slate-200":"hover:bg-[#1e2635]",u=p=>{const f=parseFloat(n)||.01,g=Math.max(.01,f+p);o(g.toFixed(2))},d=()=>{e&&e({volume:parseFloat(n)})},B=()=>{t&&t({volume:parseFloat(n)})};return h.jsxs("div",{className:"flex items-stretch h-[30px] text-xs font-semibold select-none",children:[h.jsxs("button",{onClick:B,className:"flex items-stretch overflow-hidden",children:[h.jsx("span",{className:"flex items-center px-2.5 font-mono tabular-nums bg-[#BD3E3E] text-white",children:r||"—"}),h.jsx("span",{className:"flex items-center px-2.5 tracking-wide bg-[#DE4848] text-white",children:"SELL"})]}),h.jsxs("div",{className:`flex items-stretch ${a}`,children:[h.jsx("button",{type:"button",onClick:()=>u(-.01),className:`w-5 flex items-center justify-center ${l} ${c} transition-colors`,children:h.jsx(sg,{size:8})}),h.jsx("input",{type:"number",value:n,onChange:p=>{const f=p.target.value;(f===""||parseFloat(f)>=0)&&o(f)},onBlur:()=>{const p=parseFloat(n);o(isNaN(p)||p<.01?"0.01":p.toFixed(2))},className:`w-14 text-center focus:outline-none ${a} ${l}`,step:"0.01",min:"0.01",style:{MozAppearance:"textfield"}}),h.jsx("button",{type:"button",onClick:()=>u(.01),className:`w-5 flex items-center justify-center ${l} ${c} transition-colors`,children:h.jsx(ng,{size:8})})]}),h.jsxs("button",{onClick:d,className:"flex items-stretch overflow-hidden",children:[h.jsx("span",{className:"flex items-center px-2.5 tracking-wide bg-[#2869CE] text-white",children:"BUY"}),h.jsx("span",{className:"flex items-center px-2.5 font-mono tabular-nums bg-[#2F7CF2] text-white",children:A||"—"})]})]})},og={},xc=({isOpen:r,onClose:A,orderType:e,bidPrice:t,askPrice:i,onExecuteTrade:s,userAccountId:n,initialVolume:o})=>{const{selectedSymbol:a,selectedTimeframe:l,setOrders:c,symbols:u,fetchOrders:d,theme:B,baseUrl:p,endpoints:f}=Be(),g=B==="light",[Q,m]=O.useState("0.01"),[E,F]=O.useState(""),[S,P]=O.useState(""),[z,eA]=O.useState(""),[V,Y]=O.useState(!1),[X,fA]=O.useState(null),[oA,pA]=O.useState(""),[IA,vA]=O.useState(e||"BUY"),[MA,SA]=O.useState(parseFloat(t)||0),[UA,bA]=O.useState(parseFloat(i)||0),[CA,aA]=O.useState("text-white"),[J,q]=O.useState("text-white"),yA=O.useRef(parseFloat(t)||0),BA=O.useRef(parseFloat(i)||0);O.useEffect(()=>{if(!r)return;const uA=Pi.getSocket(),mA=lA=>{if(!(!lA||!lA.symbol)&&lA.symbol.toUpperCase()===a?.toUpperCase()){const LA=parseFloat(lA.bid)||0,FA=parseFloat(lA.ask)||0;LA>0&&(LA>yA.current?(aA("text-green-400"),setTimeout(()=>aA("text-white"),500)):LA<yA.current&&yA.current>0&&(aA("text-red-400"),setTimeout(()=>aA("text-white"),500)),SA(LA),yA.current=LA),FA>0&&(FA>BA.current?(q("text-green-400"),setTimeout(()=>q("text-white"),500)):FA<BA.current&&BA.current>0&&(q("text-red-400"),setTimeout(()=>q("text-white"),500)),bA(FA),BA.current=FA)}};uA.on("priceUpdate",mA);const gA=u.find(lA=>lA.symbol===a);if(gA){const lA=parseFloat(gA.bid)||0,LA=parseFloat(gA.ask)||0;lA>0&&(SA(lA),yA.current=lA),LA>0&&(bA(LA),BA.current=LA)}return()=>{uA.off("priceUpdate",mA)}},[r,a,u]),O.useEffect(()=>{if(r){m(o?String(o):"0.01"),F(""),P(""),eA(""),pA(""),vA(e||"BUY");const uA=parseFloat(t)||0,mA=parseFloat(i)||0;uA>0&&(SA(uA),yA.current=uA),mA>0&&(bA(mA),BA.current=mA)}},[r,e,t,i,o]);const EA=MA||0,WA=UA||0,zA=uA=>{const mA=parseFloat(Q)||.01,gA=Math.max(.01,mA+uA);m(gA.toFixed(2))},dt=uA=>{const mA=parseFloat(E)||0,gA=parseFloat(IA==="BUY"?UA:MA)||0;if(!gA){pA("Current price not available. Please wait...");return}let lA=mA+uA;IA==="BUY"?lA=Math.max(1e-5,Math.min(lA,gA-1e-5)):lA=Math.max(gA+1e-5,lA),F(lA>0?lA.toFixed(5):""),pA("")},ae=uA=>{const mA=parseFloat(S)||0,gA=parseFloat(IA==="BUY"?UA:MA)||0;if(!gA){pA("Current price not available. Please wait...");return}let lA=mA+uA;IA==="BUY"?lA=Math.max(gA+1e-5,lA):lA=Math.max(1e-5,Math.min(lA,gA-1e-5)),P(lA>0?lA.toFixed(5):""),pA("")},ft=async uA=>{pA("");const mA=uA||IA,gA=parseFloat(mA==="BUY"?UA:MA),lA=parseFloat(Q),LA=E?parseFloat(E):null,FA=S?parseFloat(S):null;if(!lA||lA<=0||isNaN(lA)){pA("Please enter a valid volume (minimum 0.01)");return}if(lA<.01){pA("Volume must be at least 0.01");return}if(!gA||gA<=0||isNaN(gA)){pA("Invalid price. Please refresh and try again.");return}if(LA!==null&&LA!==""){if(isNaN(LA)||LA<=0){pA("Stop Loss must be a valid positive number");return}if(mA==="BUY"&&LA>=gA){pA("Stop Loss must be below the current price for BUY orders");return}if(mA==="SELL"&&LA<=gA){pA("Stop Loss must be above the current price for SELL orders");return}}if(FA!==null&&FA!==""){if(isNaN(FA)||FA<=0){pA("Take Profit must be a valid positive number");return}if(mA==="BUY"){if(FA<=gA){pA(`Take Profit must be above the entry price (${gA.toFixed(5)}) for BUY orders`);return}}else if(mA==="SELL"&&FA>=gA){pA(`Take Profit must be below the entry price (${gA.toFixed(5)}) for SELL orders`);return}}vA(mA),fA(mA),Y(!0);const le=new Date,Me=le.toLocaleTimeString(),pt=`temp_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,ri=localStorage.getItem("token");if(!ri){pA("Please login to place trades"),Y(!1),fA(null);return}const Gt={accountId:n,symbol:a,type:mA,volume:lA,price:gA,takeProfit:FA,stopLoss:LA,comment:z.trim()||null},Os={ticket:pt.substring(0,8),symbol:a,type:mA,volume:parseFloat(lA),price:parseFloat(gA),time:Me,stopLoss:LA?parseFloat(LA):null,takeProfit:FA?parseFloat(FA):null,swap:0,profit:0,profitCurrency:"USD",comment:z.trim()||"",id:pt,status:"OPEN",openAt:le.toISOString()};if(c&&c(Bt=>[...Bt,Os]),s){Y(!1),fA(null),A();const Bt={symbol:a,type:mA,lotSize:lA,entryPrice:gA,stopLoss:LA,takeProfit:FA,comment:z.trim()||null};Promise.resolve(s(Bt)).then(()=>{console.log("✅ Trade executed successfully via parent handler"),d&&d()}).catch(ii=>{console.error("❌ Trade execution failed:",ii),c&&c(Le=>Le.filter(ne=>ne.id!==pt))})}else{Y(!1),fA(null),A();const Bt=p||og?.VITE_BASE_URL||"http://localhost:8000",ii=f?.trades||"/api/trades";XA.post(`${Bt}${ii}`,Gt,{headers:{Authorization:`Bearer ${ri}`,"Content-Type":"application/json"}}).then(Le=>{if(Le.data&&Le.data.data){const ne=Le.data.data.trade;c&&c(xA=>xA.map(jA=>jA.id===pt?{...jA,id:ne.id,ticket:ne.id.substring(0,8),time:Me,openAt:ne.openAt}:jA)),console.log("✅ Trade saved successfully:",ne),window.notify&&window.notify(`Trade placed successfully: ${ne.symbol} ${ne.type}`,"success")}else{c&&c(xA=>xA.filter(jA=>jA.id!==pt));const ne=Le.data?.message||"Failed to place trade";window.notify&&window.notify(ne,"error")}}).catch(Le=>{console.error("Error placing trade:",Le),c&&c(xA=>xA.filter(jA=>jA.id!==pt));let ne="Failed to place trade";if(Le.response){const xA=Le.response.status,jA=Le.response.data;xA===400?ne=jA?.message||"Invalid trade data. Please check your inputs.":xA===401?ne="Authentication failed. Please login again.":xA===404?ne=jA?.message||"Symbol not found. Please select a valid symbol.":xA===500?ne="Server error. Please try again later.":ne=jA?.message||`Error: ${xA}`}else Le.request&&(ne="Network error. Please check your internet connection.");window.notify&&window.notify(ne,"error")})}},KA=((parseFloat(Q)||0)*1e5).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return r?h.jsxs("div",{className:`w-full flex flex-col pointer-events-auto z-30 h-full ${g?"bg-white border-r border-slate-300":"bg-[#12161d] border-r border-slate-700"}`,children:[h.jsxs("div",{className:`px-4 py-2.5 flex items-center justify-between border-b ${g?"border-slate-300 bg-white":"border-slate-700 bg-[#12161d]"}`,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h3",{className:`text-sm font-semibold ${g?"text-slate-800":"text-white"}`,children:"Market Execution"}),h.jsx("button",{className:`p-0.5 transition-colors ${g?"text-slate-600 hover:text-slate-800":"text-white hover:text-white"}`,children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),h.jsx("button",{onClick:A,className:`p-1 rounded transition-colors ${g?"text-slate-600 hover:text-slate-800 hover:bg-slate-100":"text-white hover:text-white hover:bg-[#12161d]"}`,children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"overflow-y-auto p-4 space-y-4 flex-1",children:[oA&&h.jsx("div",{className:"p-2 rounded-lg bg-rose-500/10 border border-rose-500/50 text-rose-400 text-xs",children:oA}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("label",{className:`text-sm font-medium ${g?"text-slate-700":"text-white"}`,children:"Volume"}),h.jsxs("span",{className:`text-sm ${g?"text-slate-700":"text-white"}`,children:[KA," ",a]})]}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx("button",{type:"button",onClick:()=>zA(-.01),className:`absolute left-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${g?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,children:"−"}),h.jsx("input",{type:"number",value:Q,onChange:uA=>{m(uA.target.value),pA("")},className:`w-full px-10 py-2 rounded text-sm focus:outline-none focus:border-secondary text-center ${g?"bg-white border border-slate-400 text-slate-800":"bg-[#12161d] border border-slate-700 text-white"}`,step:"0.01",min:"0.01",placeholder:"0.01"}),h.jsx("button",{type:"button",onClick:()=>zA(.01),className:`absolute right-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${g?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,children:"+"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx("div",{className:"flex items-center justify-between mb-2",children:h.jsx("label",{className:`text-sm font-medium ${g?"text-slate-700":"text-white"}`,children:"Stop Loss"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx("button",{type:"button",onClick:()=>dt(-1e-4),className:`absolute left-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${g?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,title:"Decrease SL",children:"−"}),h.jsx("input",{type:"text",value:E,onChange:uA=>{const mA=uA.target.value;(mA===""||/^\d*\.?\d*$/.test(mA))&&(F(mA),pA(""))},onBlur:uA=>{const mA=parseFloat(uA.target.value);!isNaN(mA)&&mA>0?F(mA.toFixed(5)):uA.target.value===""&&F("")},placeholder:"0.00000",className:`w-full px-10 py-2 rounded text-sm focus:outline-none focus:border-secondary text-center ${g?"bg-white border border-slate-400 text-slate-800":"bg-[#12161d] border border-slate-700 text-slate-100"}`}),h.jsx("button",{type:"button",onClick:()=>dt(1e-4),className:`absolute right-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${g?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,title:"Increase SL",children:"+"})]})]}),h.jsxs("div",{children:[h.jsx("div",{className:"flex items-center justify-between mb-2",children:h.jsx("label",{className:`text-sm font-medium ${g?"text-slate-700":"text-white"}`,children:"Take Profit"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx("button",{type:"button",onClick:()=>ae(-1e-4),className:`absolute left-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${g?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,title:"Decrease TP",children:"−"}),h.jsx("input",{type:"text",value:S,onChange:uA=>{const mA=uA.target.value;(mA===""||/^\d*\.?\d*$/.test(mA))&&(P(mA),pA(""))},onBlur:uA=>{const mA=parseFloat(uA.target.value);!isNaN(mA)&&mA>0?P(mA.toFixed(5)):uA.target.value===""&&P("")},placeholder:"0.00000",className:`w-full px-10 py-2 rounded text-sm focus:outline-none focus:border-secondary text-center ${g?"bg-white border border-slate-400 text-slate-800":"bg-[#12161d] border border-slate-700 text-slate-100"}`}),h.jsx("button",{type:"button",onClick:()=>ae(1e-4),className:`absolute right-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${g?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,title:"Increase TP",children:"+"})]})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:`block text-sm font-medium mb-2 ${g?"text-slate-700":"text-white"}`,children:"Comment"}),h.jsx("textarea",{value:z,onChange:uA=>eA(uA.target.value),placeholder:"Optional comment",rows:2,className:`w-full px-3 py-2 rounded text-sm focus:outline-none focus:border-secondary resize-none ${g?"bg-white border border-slate-400 text-slate-800":"bg-[#12161d] border border-slate-700 text-slate-100"}`})]}),h.jsxs("div",{className:`flex items-center justify-between py-2 border-t ${g?"border-slate-400":"border-slate-700"}`,children:[h.jsxs("div",{className:"text-sm",children:[h.jsx("span",{className:g?"text-slate-700":"text-white",children:"Bid: "}),h.jsx("span",{className:`${CA} font-medium transition-colors duration-400`,children:EA>0?EA.toFixed(5):"---"})]}),h.jsxs("div",{className:"text-sm",children:[h.jsx("span",{className:g?"text-slate-700":"text-white",children:"Ask: "}),h.jsx("span",{className:`${J} font-medium transition-colors duration-400`,children:WA>0?WA.toFixed(5):"---"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3 pt-2",children:[h.jsx("button",{onClick:()=>ft("SELL"),disabled:V,className:"px-4 py-3 bg-rose-600 hover:bg-rose-700 text-white font-semibold rounded text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:V&&X==="SELL"?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Placing..."]}):"Sell by Market"}),h.jsx("button",{onClick:()=>ft("BUY"),disabled:V,className:"px-4 py-3 bg-sky-600 hover:bg-sky-700 text-white font-semibold rounded text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:V&&X==="BUY"?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Placing..."]}):"Buy by Market"})]})]})]}):null};function sA(r){if(r==null)return null;if(typeof r=="number"){if(Number.isNaN(r)||!Number.isFinite(r))return null;let A;r>1e10?A=r/1e3:(r<1e9,A=r);const e=Math.floor(A);return e<946684800||e>4102444800?null:e}if(typeof r=="string"){const A=Date.parse(r);return Number.isNaN(A)?null:Math.floor(A/1e3)}if(typeof r=="object"&&"year"in r&&"month"in r&&"day"in r){const e=new Date(Date.UTC(r.year,r.month-1,r.day)).getTime();return Number.isNaN(e)?null:Math.floor(e/1e3)}return null}function ag(r,A){if(!r||r.length<2)return[];const e=[],t=2;for(let i=1;i<r.length;i++){const s=r[i-1].time,n=r[i].time,o=n-s;o>A*t&&e.push({from:s,to:n,gapSeconds:o,gapHours:(o/3600).toFixed(1),fromDate:new Date(s*1e3).toISOString(),toDate:new Date(n*1e3).toISOString()})}return e}function lg(r,A="America/New_York"){const e=new Date(r*1e3),t=new Date(e.toLocaleString("en-US",{timeZone:A})),i=t.getDay();return!(i===0||i===6||i===5&&t.getHours()>=17)}function Tc(r){return Array.isArray(r)?r.map(A=>({...A,time:sA(A.time)})).filter(A=>A.time!=null):[]}function cg(r){if(!r||r.length<2)return!0;for(let A=1;A<r.length;A++)if(r[A].time<=r[A-1].time)return!1;return!0}function Ar(r,A){return!Number.isFinite(r)||!Number.isFinite(A)||A<=0?r:Math.floor(r/A)*A}const ge="17:00-17:00",we="America/New_York",At="24x7",et="UTC",Sc={EURUSD:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},GBPUSD:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},USDJPY:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},USDCHF:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},AUDUSD:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},USDCAD:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},NZDUSD:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},EURGBP:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},EURJPY:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},GBPJPY:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},CADJPY:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},EURJPY:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},XAUUSD:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},XAGUSD:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},OILUSD:{type:"forex",sessionTZ:we,session:ge,priceMode:"mid"},BTCUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},ETHUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},BNBUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},SOLUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},ADAUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},XRPUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},DOGEUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},DOTUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},MATICUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},LINKUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"}},Hc={type:"forex",sessionTZ:we,session:ge,priceMode:"mid"};function Mr(r){return r&&Sc[r.toUpperCase()]||Hc}function hg(r){return Mr(r).type==="forex"}function ug(r){return Mr(r).type==="crypto"}function dg(r){return Mr(r).session==="24x7"}function Lc(r){if(!r||typeof r!="object")return!1;const{time:A,open:e,high:t,low:i,close:s,volume:n}=r;return!(sA(A)==null||typeof e!="number"||!Number.isFinite(e)||typeof t!="number"||!Number.isFinite(t)||typeof i!="number"||!Number.isFinite(i)||typeof s!="number"||!Number.isFinite(s)||n!=null&&(typeof n!="number"||n<0||!Number.isFinite(n))||t<e||t<s||t<i||i>e||i>s||i>t||e<=0||t<=0||i<=0||s<=0)}function Ic(r){const A=n=>Math.round(n*1e5)/1e5;let e=A(r.open),t=A(r.high),i=A(r.low),s=A(r.close);return t=Math.max(t,e,s,i),i=Math.min(i,e,s,t),{...r,open:e,high:t,low:i,close:s,volume:r.volume!=null?Math.round(r.volume):r.volume}}function Mc(r){if(!Array.isArray(r)||r.length===0)return[];const A=new Map;return r.forEach(e=>{const t=sA(e.time);if(t!=null)if(A.has(t)){const i=A.get(t);A.set(t,{...e,time:t,open:e.open,high:Math.max(i.high,e.high),low:Math.min(i.low,e.low),close:e.close,volume:(i.volume||0)+(e.volume||0)})}else A.set(t,{...e,time:t})}),Array.from(A.values())}function fg(r,A="percentile"){if(!Array.isArray(r)||r.length<3)return r;const e=r.map(n=>n.close).filter(n=>Number.isFinite(n));if(e.length<3)return r;const t=[...e].sort((n,o)=>n-o);let i,s;if(A==="percentile"){const n=Math.floor(t.length*.25),o=Math.floor(t.length*.75),a=t[n],l=t[o],c=l-a;i=a-1.5*c,s=l+1.5*c}else{const n=e.reduce((l,c)=>l+c,0)/e.length,o=e.reduce((l,c)=>l+Math.pow(c-n,2),0)/e.length,a=Math.sqrt(o);if(a===0)return r;i=n-3*a,s=n+3*a}return r.map((n,o)=>{const a=n.close;if(a<i||a>s){if(o===0)return n;const l=r[o-1].close;return{...n,open:l,high:Math.max(l,n.high),low:Math.min(l,n.low),close:l}}return n})}function pg(r,A){if(!Array.isArray(r)||r.length===0)return r;const e=[],t=Math.max(A*10080,604800),i=1e4;for(let o=0;o<r.length;o++)if(e.push(r[o]),o<r.length-1){const a=r[o].time,l=r[o+1].time,c=l-a;if(c>t&&((c/3600).toFixed(1),(t/3600).toFixed(1)),c>A&&c<=t){const u=r[o];let d=a+A,B=0;for(d=Ar(d,A);d<l&&B<i;){const p=Ar(d,A);e.some(g=>g.time===p)||(e.push({time:p,open:u.close,high:u.close,low:u.close,close:u.close,volume:0}),B++),d+=A}if(d<l&&B>=i){const p=Ar(l-A,A);e.some(g=>g.time===p)||e.push({time:p,open:u.close,high:u.close,low:u.close,close:u.close,volume:0})}}}e.sort((o,a)=>o.time-a.time);const s=[],n=new Set;for(const o of e)n.has(o.time)||(n.add(o.time),s.push(o));return s}function Ot(r){if(!r||typeof r!="string")return 60;const A=r.toUpperCase();if(A==="MN")return 2592e3;let e=A.match(/^([MHDW])(\d+)$/);if(e){const t=e[1];return parseInt(e[2],10)*({M:60,H:3600,D:86400,W:604800}[t]||60)}if(e=r.match(/^(\d+)([mhdwy])$/i),e){const t=parseInt(e[1],10),i=e[2].toLowerCase();return t*({m:60,h:3600,d:86400,w:604800,y:31536e3}[i]||60)}return 60}function Dc(r,A,e){if(!Array.isArray(r)||r.length===0)return{candles:[],stats:{original:0,processed:0,duplicates:0,outliers:0,gaps:[]}};const t=Mr(A),i=Ot(e),o=Tc(r).map(g=>({...g,time:Ar(g.time,i)})).filter(g=>Lc(g)).map(g=>Ic(g)),a=Mc(o);a.sort((g,Q)=>g.time-Q.time);const l=a.filter((g,Q)=>Q===0?!0:g.time>a[Q-1].time),c=l.length>10?fg(l,"percentile"):l,u=Mc(c);u.sort((g,Q)=>g.time-Q.time);const d=pg(u,i),B=[];for(let g=1;g<d.length;g++){const Q=d[g].time-d[g-1].time;Q>i*2&&B.push({from:d[g-1].time,to:d[g].time,gapSeconds:Q,gapMinutes:Math.round(Q/60),fromDate:new Date(d[g-1].time*1e3).toISOString(),toDate:new Date(d[g].time*1e3).toISOString()})}const p=c.filter((g,Q)=>Q===0?!1:g.close===c[Q-1].close&&g.open===c[Q-1].close).length,f={original:r.length,processed:d.length,duplicates:r.length-a.length,outliers:p,gaps:B,filledGaps:d.length-u.length,symbolConfig:t};return{candles:d,stats:f}}function _c(r,A,e="1m"){if(!r||!A||!Lc(r))return null;const t=sA(r.time);if(t==null)return null;const i=Ot(e),s=Ar(t,i);return Ic({...r,time:s})}var Yn=function(r,A){return Yn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},Yn(r,A)};function Xe(r,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");Yn(r,A);function e(){this.constructor=r}r.prototype=A===null?Object.create(A):(e.prototype=A.prototype,new e)}var qn=function(){return qn=Object.assign||function(A){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(A[s]=e[s])}return A},qn.apply(this,arguments)};function ye(r,A,e,t){function i(s){return s instanceof e?s:new e(function(n){n(s)})}return new(e||(e=Promise))(function(s,n){function o(c){try{l(t.next(c))}catch(u){n(u)}}function a(c){try{l(t.throw(c))}catch(u){n(u)}}function l(c){c.done?s(c.value):i(c.value).then(o,a)}l((t=t.apply(r,[])).next())})}function me(r,A){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},t,i,s,n;return n={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function o(l){return function(c){return a([l,c])}}function a(l){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=A.call(r,e)}catch(c){l=[6,c],i=0}finally{t=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ri(r,A,e){if(arguments.length===2)for(var t=0,i=A.length,s;t<i;t++)(s||!(t in A))&&(s||(s=Array.prototype.slice.call(A,0,t)),s[t]=A[t]);return r.concat(s||A)}for(var lt=(function(){function r(A,e,t,i){this.left=A,this.top=e,this.width=t,this.height=i}return r.prototype.add=function(A,e,t,i){return new r(this.left+A,this.top+e,this.width+t,this.height+i)},r.fromClientRect=function(A,e){return new r(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height)},r.fromDOMRectList=function(A,e){var t=Array.from(e).find(function(i){return i.width!==0});return t?new r(t.left+A.windowBounds.left,t.top+A.windowBounds.top,t.width,t.height):r.EMPTY},r.EMPTY=new r(0,0,0,0),r})(),Wi=function(r,A){return lt.fromClientRect(r,A.getBoundingClientRect())},Bg=function(r){var A=r.body,e=r.documentElement;if(!A||!e)throw new Error("Unable to get document size");var t=Math.max(Math.max(A.scrollWidth,e.scrollWidth),Math.max(A.offsetWidth,e.offsetWidth),Math.max(A.clientWidth,e.clientWidth)),i=Math.max(Math.max(A.scrollHeight,e.scrollHeight),Math.max(A.offsetHeight,e.offsetHeight),Math.max(A.clientHeight,e.clientHeight));return new lt(0,0,t,i)},$i=function(r){for(var A=[],e=0,t=r.length;e<t;){var i=r.charCodeAt(e++);if(i>=55296&&i<=56319&&e<t){var s=r.charCodeAt(e++);(s&64512)===56320?A.push(((i&1023)<<10)+(s&1023)+65536):(A.push(i),e--)}else A.push(i)}return A},te=function(){for(var r=[],A=0;A<arguments.length;A++)r[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,r);var e=r.length;if(!e)return"";for(var t=[],i=-1,s="";++i<e;){var n=r[i];n<=65535?t.push(n):(n-=65536,t.push((n>>10)+55296,n%1024+56320)),(i+1===e||t.length>16384)&&(s+=String.fromCharCode.apply(String,t),t.length=0)}return s},kc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gg=typeof Uint8Array>"u"?[]:new Uint8Array(256),Xi=0;Xi<kc.length;Xi++)gg[kc.charCodeAt(Xi)]=Xi;for(var Oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Dr=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ji=0;Ji<Oc.length;Ji++)Dr[Oc.charCodeAt(Ji)]=Ji;for(var wg=function(r){var A=r.length*.75,e=r.length,t,i=0,s,n,o,a;r[r.length-1]==="="&&(A--,r[r.length-2]==="="&&A--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(A):new Array(A),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t<e;t+=4)s=Dr[r.charCodeAt(t)],n=Dr[r.charCodeAt(t+1)],o=Dr[r.charCodeAt(t+2)],a=Dr[r.charCodeAt(t+3)],c[i++]=s<<2|n>>4,c[i++]=(n&15)<<4|o>>2,c[i++]=(o&3)<<6|a&63;return l},mg=function(r){for(var A=r.length,e=[],t=0;t<A;t+=2)e.push(r[t+1]<<8|r[t]);return e},Cg=function(r){for(var A=r.length,e=[],t=0;t<A;t+=4)e.push(r[t+3]<<24|r[t+2]<<16|r[t+1]<<8|r[t]);return e},Nt=5,jn=11,Ao=2,vg=jn-Nt,Nc=65536>>Nt,bg=1<<Nt,eo=bg-1,yg=1024>>Nt,Qg=Nc+yg,Fg=Qg,Ug=32,Eg=Fg+Ug,xg=65536>>jn,Tg=1<<vg,Sg=Tg-1,Kc=function(r,A,e){return r.slice?r.slice(A,e):new Uint16Array(Array.prototype.slice.call(r,A,e))},Hg=function(r,A,e){return r.slice?r.slice(A,e):new Uint32Array(Array.prototype.slice.call(r,A,e))},Lg=function(r,A){var e=wg(r),t=Array.isArray(e)?Cg(e):new Uint32Array(e),i=Array.isArray(e)?mg(e):new Uint16Array(e),s=24,n=Kc(i,s/2,t[4]/2),o=t[5]===2?Kc(i,(s+t[4])/2):Hg(t,Math.ceil((s+t[4])/4));return new Ig(t[0],t[1],t[2],t[3],n,o)},Ig=(function(){function r(A,e,t,i,s,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=i,this.index=s,this.data=n}return r.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=this.index[A>>Nt],e=(e<<Ao)+(A&eo),this.data[e];if(A<=65535)return e=this.index[Nc+(A-55296>>Nt)],e=(e<<Ao)+(A&eo),this.data[e];if(A<this.highStart)return e=Eg-xg+(A>>jn),e=this.index[e],e+=A>>Nt&Sg,e=this.index[e],e=(e<<Ao)+(A&eo),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},r})(),Vc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mg=typeof Uint8Array>"u"?[]:new Uint8Array(256),Zi=0;Zi<Vc.length;Zi++)Mg[Vc.charCodeAt(Zi)]=Zi;var Dg="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",Pc=50,_g=1,zc=2,Gc=3,kg=4,Og=5,Rc=7,Wc=8,$c=9,Ct=10,to=11,Xc=12,ro=13,Ng=14,_r=15,io=16,Yi=17,kr=18,Kg=19,Jc=20,so=21,Or=22,no=23,er=24,Ie=25,Nr=26,Kr=27,tr=28,Vg=29,Kt=30,Pg=31,qi=32,ji=33,oo=34,ao=35,lo=36,Vr=37,co=38,As=39,es=40,ho=41,Zc=42,zg=43,Gg=[9001,65288],Yc="!",OA="×",ts="÷",uo=Lg(Dg),ct=[Kt,lo],fo=[_g,zc,Gc,Og],qc=[Ct,Wc],jc=[Kr,Nr],Rg=fo.concat(qc),Ah=[co,As,es,oo,ao],Wg=[_r,ro],$g=function(r,A){A===void 0&&(A="strict");var e=[],t=[],i=[];return r.forEach(function(s,n){var o=uo.get(s);if(o>Pc?(i.push(!0),o-=Pc):i.push(!1),["normal","auto","loose"].indexOf(A)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return t.push(n),e.push(io);if(o===kg||o===to){if(n===0)return t.push(n),e.push(Kt);var a=e[n-1];return Rg.indexOf(a)===-1?(t.push(t[n-1]),e.push(a)):(t.push(n),e.push(Kt))}if(t.push(n),o===Pg)return e.push(A==="strict"?so:Vr);if(o===Zc||o===Vg)return e.push(Kt);if(o===zg)return s>=131072&&s<=196605||s>=196608&&s<=262141?e.push(Vr):e.push(Kt);e.push(o)}),[t,e,i]},po=function(r,A,e,t){var i=t[e];if(Array.isArray(r)?r.indexOf(i)!==-1:r===i)for(var s=e;s<=t.length;){s++;var n=t[s];if(n===A)return!0;if(n!==Ct)break}if(i===Ct)for(var s=e;s>0;){s--;var o=t[s];if(Array.isArray(r)?r.indexOf(o)!==-1:r===o)for(var a=e;a<=t.length;){a++;var n=t[a];if(n===A)return!0;if(n!==Ct)break}if(o!==Ct)break}return!1},eh=function(r,A){for(var e=r;e>=0;){var t=A[e];if(t===Ct)e--;else return t}return 0},Xg=function(r,A,e,t,i){if(e[t]===0)return OA;var s=t-1;if(Array.isArray(i)&&i[s]===!0)return OA;var n=s-1,o=s+1,a=A[s],l=n>=0?A[n]:0,c=A[o];if(a===zc&&c===Gc)return OA;if(fo.indexOf(a)!==-1)return Yc;if(fo.indexOf(c)!==-1||qc.indexOf(c)!==-1)return OA;if(eh(s,A)===Wc)return ts;if(uo.get(r[s])===to||(a===qi||a===ji)&&uo.get(r[o])===to||a===Rc||c===Rc||a===$c||[Ct,ro,_r].indexOf(a)===-1&&c===$c||[Yi,kr,Kg,er,tr].indexOf(c)!==-1||eh(s,A)===Or||po(no,Or,s,A)||po([Yi,kr],so,s,A)||po(Xc,Xc,s,A))return OA;if(a===Ct)return ts;if(a===no||c===no)return OA;if(c===io||a===io)return ts;if([ro,_r,so].indexOf(c)!==-1||a===Ng||l===lo&&Wg.indexOf(a)!==-1||a===tr&&c===lo||c===Jc||ct.indexOf(c)!==-1&&a===Ie||ct.indexOf(a)!==-1&&c===Ie||a===Kr&&[Vr,qi,ji].indexOf(c)!==-1||[Vr,qi,ji].indexOf(a)!==-1&&c===Nr||ct.indexOf(a)!==-1&&jc.indexOf(c)!==-1||jc.indexOf(a)!==-1&&ct.indexOf(c)!==-1||[Kr,Nr].indexOf(a)!==-1&&(c===Ie||[Or,_r].indexOf(c)!==-1&&A[o+1]===Ie)||[Or,_r].indexOf(a)!==-1&&c===Ie||a===Ie&&[Ie,tr,er].indexOf(c)!==-1)return OA;if([Ie,tr,er,Yi,kr].indexOf(c)!==-1)for(var u=s;u>=0;){var d=A[u];if(d===Ie)return OA;if([tr,er].indexOf(d)!==-1)u--;else break}if([Kr,Nr].indexOf(c)!==-1)for(var u=[Yi,kr].indexOf(a)!==-1?n:s;u>=0;){var d=A[u];if(d===Ie)return OA;if([tr,er].indexOf(d)!==-1)u--;else break}if(co===a&&[co,As,oo,ao].indexOf(c)!==-1||[As,oo].indexOf(a)!==-1&&[As,es].indexOf(c)!==-1||[es,ao].indexOf(a)!==-1&&c===es||Ah.indexOf(a)!==-1&&[Jc,Nr].indexOf(c)!==-1||Ah.indexOf(c)!==-1&&a===Kr||ct.indexOf(a)!==-1&&ct.indexOf(c)!==-1||a===er&&ct.indexOf(c)!==-1||ct.concat(Ie).indexOf(a)!==-1&&c===Or&&Gg.indexOf(r[o])===-1||ct.concat(Ie).indexOf(c)!==-1&&a===kr)return OA;if(a===ho&&c===ho){for(var B=e[s],p=1;B>0&&(B--,A[B]===ho);)p++;if(p%2!==0)return OA}return a===qi&&c===ji?OA:ts},Jg=function(r,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var e=$g(r,A.lineBreak),t=e[0],i=e[1],s=e[2];(A.wordBreak==="break-all"||A.wordBreak==="break-word")&&(i=i.map(function(o){return[Ie,Kt,Zc].indexOf(o)!==-1?Vr:o}));var n=A.wordBreak==="keep-all"?s.map(function(o,a){return o&&r[a]>=19968&&r[a]<=40959}):void 0;return[t,i,n]},Zg=(function(){function r(A,e,t,i){this.codePoints=A,this.required=e===Yc,this.start=t,this.end=i}return r.prototype.slice=function(){return te.apply(void 0,this.codePoints.slice(this.start,this.end))},r})(),Yg=function(r,A){var e=$i(r),t=Jg(e,A),i=t[0],s=t[1],n=t[2],o=e.length,a=0,l=0;return{next:function(){if(l>=o)return{done:!0,value:null};for(var c=OA;l<o&&(c=Xg(e,s,i,++l,n))===OA;);if(c!==OA||l===o){var u=new Zg(e,c,a,l);return a=l,{value:u,done:!1}}return{done:!0,value:null}}}},qg=1,jg=2,Pr=4,th=8,rs=10,rh=47,zr=92,Aw=9,ew=32,is=34,Gr=61,tw=35,rw=36,iw=37,ss=39,ns=40,Rr=41,sw=95,Te=45,nw=33,ow=60,aw=62,lw=64,cw=91,hw=93,uw=61,dw=123,os=63,fw=125,ih=124,pw=126,Bw=128,sh=65533,Bo=42,Vt=43,gw=44,ww=58,mw=59,Wr=46,Cw=0,vw=8,bw=11,yw=14,Qw=31,Fw=127,tt=-1,nh=48,oh=97,ah=101,Uw=102,Ew=117,xw=122,lh=65,ch=69,hh=70,Tw=85,Sw=90,Ce=function(r){return r>=nh&&r<=57},Hw=function(r){return r>=55296&&r<=57343},rr=function(r){return Ce(r)||r>=lh&&r<=hh||r>=oh&&r<=Uw},Lw=function(r){return r>=oh&&r<=xw},Iw=function(r){return r>=lh&&r<=Sw},Mw=function(r){return Lw(r)||Iw(r)},Dw=function(r){return r>=Bw},as=function(r){return r===rs||r===Aw||r===ew},ls=function(r){return Mw(r)||Dw(r)||r===sw},uh=function(r){return ls(r)||Ce(r)||r===Te},_w=function(r){return r>=Cw&&r<=vw||r===bw||r>=yw&&r<=Qw||r===Fw},vt=function(r,A){return r!==zr?!1:A!==rs},cs=function(r,A,e){return r===Te?ls(A)||vt(A,e):ls(r)?!0:!!(r===zr&&vt(r,A))},go=function(r,A,e){return r===Vt||r===Te?Ce(A)?!0:A===Wr&&Ce(e):Ce(r===Wr?A:r)},kw=function(r){var A=0,e=1;(r[A]===Vt||r[A]===Te)&&(r[A]===Te&&(e=-1),A++);for(var t=[];Ce(r[A]);)t.push(r[A++]);var i=t.length?parseInt(te.apply(void 0,t),10):0;r[A]===Wr&&A++;for(var s=[];Ce(r[A]);)s.push(r[A++]);var n=s.length,o=n?parseInt(te.apply(void 0,s),10):0;(r[A]===ch||r[A]===ah)&&A++;var a=1;(r[A]===Vt||r[A]===Te)&&(r[A]===Te&&(a=-1),A++);for(var l=[];Ce(r[A]);)l.push(r[A++]);var c=l.length?parseInt(te.apply(void 0,l),10):0;return e*(i+o*Math.pow(10,-n))*Math.pow(10,a*c)},Ow={type:2},Nw={type:3},Kw={type:4},Vw={type:13},Pw={type:8},zw={type:21},Gw={type:9},Rw={type:10},Ww={type:11},$w={type:12},Xw={type:14},hs={type:23},Jw={type:1},Zw={type:25},Yw={type:24},qw={type:26},jw={type:27},A1={type:28},e1={type:29},t1={type:31},wo={type:32},dh=(function(){function r(){this._value=[]}return r.prototype.write=function(A){this._value=this._value.concat($i(A))},r.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==wo;)A.push(e),e=this.consumeToken();return A},r.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case is:return this.consumeStringToken(is);case tw:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),i=this.peekCodePoint(2);if(uh(e)||vt(t,i)){var s=cs(e,t,i)?jg:qg,n=this.consumeName();return{type:5,value:n,flags:s}}break;case rw:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Vw;break;case ss:return this.consumeStringToken(ss);case ns:return Ow;case Rr:return Nw;case Bo:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Xw;break;case Vt:if(go(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case gw:return Kw;case Te:var o=A,a=this.peekCodePoint(0),l=this.peekCodePoint(1);if(go(o,a,l))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(cs(o,a,l))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(a===Te&&l===aw)return this.consumeCodePoint(),this.consumeCodePoint(),Yw;break;case Wr:if(go(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case rh:if(this.peekCodePoint(0)===Bo)for(this.consumeCodePoint();;){var c=this.consumeCodePoint();if(c===Bo&&(c=this.consumeCodePoint(),c===rh))return this.consumeToken();if(c===tt)return this.consumeToken()}break;case ww:return qw;case mw:return jw;case ow:if(this.peekCodePoint(0)===nw&&this.peekCodePoint(1)===Te&&this.peekCodePoint(2)===Te)return this.consumeCodePoint(),this.consumeCodePoint(),Zw;break;case lw:var u=this.peekCodePoint(0),d=this.peekCodePoint(1),B=this.peekCodePoint(2);if(cs(u,d,B)){var n=this.consumeName();return{type:7,value:n}}break;case cw:return A1;case zr:if(vt(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case hw:return e1;case uw:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Pw;break;case dw:return Ww;case fw:return $w;case Ew:case Tw:var p=this.peekCodePoint(0),f=this.peekCodePoint(1);return p===Vt&&(rr(f)||f===os)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case ih:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Gw;if(this.peekCodePoint(0)===ih)return this.consumeCodePoint(),zw;break;case pw:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Rw;break;case tt:return wo}return as(A)?(this.consumeWhiteSpace(),t1):Ce(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):ls(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:te(A)}},r.prototype.consumeCodePoint=function(){var A=this._value.shift();return typeof A>"u"?-1:A},r.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},r.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},r.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();rr(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;e===os&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t){var i=parseInt(te.apply(void 0,A.map(function(a){return a===os?nh:a})),16),s=parseInt(te.apply(void 0,A.map(function(a){return a===os?hh:a})),16);return{type:30,start:i,end:s}}var n=parseInt(te.apply(void 0,A),16);if(this.peekCodePoint(0)===Te&&rr(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var o=[];rr(e)&&o.length<6;)o.push(e),e=this.consumeCodePoint();var s=parseInt(te.apply(void 0,o),16);return{type:30,start:n,end:s}}else return{type:30,start:n,end:n}},r.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return A.toLowerCase()==="url"&&this.peekCodePoint(0)===ns?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===ns?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},r.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===tt)return{type:22,value:""};var e=this.peekCodePoint(0);if(e===ss||e===is){var t=this.consumeStringToken(this.consumeCodePoint());return t.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===tt||this.peekCodePoint(0)===Rr)?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),hs)}for(;;){var i=this.consumeCodePoint();if(i===tt||i===Rr)return{type:22,value:te.apply(void 0,A)};if(as(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===tt||this.peekCodePoint(0)===Rr?(this.consumeCodePoint(),{type:22,value:te.apply(void 0,A)}):(this.consumeBadUrlRemnants(),hs);if(i===is||i===ss||i===ns||_w(i))return this.consumeBadUrlRemnants(),hs;if(i===zr)if(vt(i,this.peekCodePoint(0)))A.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),hs;else A.push(i)}},r.prototype.consumeWhiteSpace=function(){for(;as(this.peekCodePoint(0));)this.consumeCodePoint()},r.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(A===Rr||A===tt)return;vt(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},r.prototype.consumeStringSlice=function(A){for(var e=5e4,t="";A>0;){var i=Math.min(e,A);t+=te.apply(void 0,this._value.splice(0,i)),A-=i}return this._value.shift(),t},r.prototype.consumeStringToken=function(A){var e="",t=0;do{var i=this._value[t];if(i===tt||i===void 0||i===A)return e+=this.consumeStringSlice(t),{type:0,value:e};if(i===rs)return this._value.splice(0,t),Jw;if(i===zr){var s=this._value[t+1];s!==tt&&s!==void 0&&(s===rs?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):vt(i,s)&&(e+=this.consumeStringSlice(t),e+=te(this.consumeEscapedCodePoint()),t=-1))}t++}while(!0)},r.prototype.consumeNumber=function(){var A=[],e=Pr,t=this.peekCodePoint(0);for((t===Vt||t===Te)&&A.push(this.consumeCodePoint());Ce(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(t===Wr&&Ce(i))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=th;Ce(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),i=this.peekCodePoint(1);var s=this.peekCodePoint(2);if((t===ch||t===ah)&&((i===Vt||i===Te)&&Ce(s)||Ce(i)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=th;Ce(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[kw(A),e]},r.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],i=this.peekCodePoint(0),s=this.peekCodePoint(1),n=this.peekCodePoint(2);if(cs(i,s,n)){var o=this.consumeName();return{type:15,number:e,flags:t,unit:o}}return i===iw?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},r.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(rr(A)){for(var e=te(A);rr(this.peekCodePoint(0))&&e.length<6;)e+=te(this.consumeCodePoint());as(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return t===0||Hw(t)||t>1114111?sh:t}return A===tt?sh:A},r.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(uh(e))A+=te(e);else if(vt(e,this.peekCodePoint(0)))A+=te(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(e),A}},r})(),fh=(function(){function r(A){this._tokens=A}return r.create=function(A){var e=new dh;return e.write(A),new r(e.read())},r.parseValue=function(A){return r.create(A).parseComponentValue()},r.parseValues=function(A){return r.create(A).parseComponentValues()},r.prototype.parseComponentValue=function(){for(var A=this.consumeToken();A.type===31;)A=this.consumeToken();if(A.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do A=this.consumeToken();while(A.type===31);if(A.type===32)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},r.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(e.type===32)return A;A.push(e),A.push()}},r.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},r.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(t.type===32||i1(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},r.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(t.type===32||t.type===3)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},r.prototype.consumeToken=function(){var A=this._tokens.shift();return typeof A>"u"?wo:A},r.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},r})(),$r=function(r){return r.type===15},ir=function(r){return r.type===17},GA=function(r){return r.type===20},r1=function(r){return r.type===0},mo=function(r,A){return GA(r)&&r.value===A},ph=function(r){return r.type!==31},sr=function(r){return r.type!==31&&r.type!==4},rt=function(r){var A=[],e=[];return r.forEach(function(t){if(t.type===4){if(e.length===0)throw new Error("Error parsing function args, zero tokens for arg");A.push(e),e=[];return}t.type!==31&&e.push(t)}),e.length&&A.push(e),A},i1=function(r,A){return A===11&&r.type===12||A===28&&r.type===29?!0:A===2&&r.type===3},bt=function(r){return r.type===17||r.type===15},se=function(r){return r.type===16||bt(r)},Bh=function(r){return r.length>1?[r[0],r[1]]:[r[0]]},de={type:17,number:0,flags:Pr},Co={type:16,number:50,flags:Pr},yt={type:16,number:100,flags:Pr},Xr=function(r,A,e){var t=r[0],i=r[1];return[RA(t,A),RA(typeof i<"u"?i:t,e)]},RA=function(r,A){if(r.type===16)return r.number/100*A;if($r(r))switch(r.unit){case"rem":case"em":return 16*r.number;default:return r.number}return r.number},gh="deg",wh="grad",mh="rad",Ch="turn",us={name:"angle",parse:function(r,A){if(A.type===15)switch(A.unit){case gh:return Math.PI*A.number/180;case wh:return Math.PI/200*A.number;case mh:return A.number;case Ch:return Math.PI*2*A.number}throw new Error("Unsupported angle type")}},vh=function(r){return r.type===15&&(r.unit===gh||r.unit===wh||r.unit===mh||r.unit===Ch)},bh=function(r){var A=r.filter(GA).map(function(e){return e.value}).join(" ");switch(A){case"to bottom right":case"to right bottom":case"left top":case"top left":return[de,de];case"to top":case"bottom":return Ne(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[de,yt];case"to right":case"left":return Ne(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[yt,yt];case"to bottom":case"top":return Ne(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[yt,de];case"to left":case"right":return Ne(270)}return 0},Ne=function(r){return Math.PI*r/180},Qt={name:"color",parse:function(r,A){if(A.type===18){var e=s1[A.name];if(typeof e>"u")throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return e(r,A.values)}if(A.type===5){if(A.value.length===3){var t=A.value.substring(0,1),i=A.value.substring(1,2),s=A.value.substring(2,3);return Ut(parseInt(t+t,16),parseInt(i+i,16),parseInt(s+s,16),1)}if(A.value.length===4){var t=A.value.substring(0,1),i=A.value.substring(1,2),s=A.value.substring(2,3),n=A.value.substring(3,4);return Ut(parseInt(t+t,16),parseInt(i+i,16),parseInt(s+s,16),parseInt(n+n,16)/255)}if(A.value.length===6){var t=A.value.substring(0,2),i=A.value.substring(2,4),s=A.value.substring(4,6);return Ut(parseInt(t,16),parseInt(i,16),parseInt(s,16),1)}if(A.value.length===8){var t=A.value.substring(0,2),i=A.value.substring(2,4),s=A.value.substring(4,6),n=A.value.substring(6,8);return Ut(parseInt(t,16),parseInt(i,16),parseInt(s,16),parseInt(n,16)/255)}}if(A.type===20){var o=ht[A.value.toUpperCase()];if(typeof o<"u")return o}return ht.TRANSPARENT}},Ft=function(r){return(255&r)===0},ce=function(r){var A=255&r,e=255&r>>8,t=255&r>>16,i=255&r>>24;return A<255?"rgba("+i+","+t+","+e+","+A/255+")":"rgb("+i+","+t+","+e+")"},Ut=function(r,A,e,t){return(r<<24|A<<16|e<<8|Math.round(t*255)<<0)>>>0},yh=function(r,A){if(r.type===17)return r.number;if(r.type===16){var e=A===3?1:255;return A===3?r.number/100*e:Math.round(r.number/100*e)}return 0},Qh=function(r,A){var e=A.filter(sr);if(e.length===3){var t=e.map(yh),i=t[0],s=t[1],n=t[2];return Ut(i,s,n,1)}if(e.length===4){var o=e.map(yh),i=o[0],s=o[1],n=o[2],a=o[3];return Ut(i,s,n,a)}return 0};function vo(r,A,e){return e<0&&(e+=1),e>=1&&(e-=1),e<1/6?(A-r)*e*6+r:e<1/2?A:e<2/3?(A-r)*6*(2/3-e)+r:r}var Fh=function(r,A){var e=A.filter(sr),t=e[0],i=e[1],s=e[2],n=e[3],o=(t.type===17?Ne(t.number):us.parse(r,t))/(Math.PI*2),a=se(i)?i.number/100:0,l=se(s)?s.number/100:0,c=typeof n<"u"&&se(n)?RA(n,1):1;if(a===0)return Ut(l*255,l*255,l*255,1);var u=l<=.5?l*(a+1):l+a-l*a,d=l*2-u,B=vo(d,u,o+1/3),p=vo(d,u,o),f=vo(d,u,o-1/3);return Ut(B*255,p*255,f*255,c)},s1={hsl:Fh,hsla:Fh,rgb:Qh,rgba:Qh},Jr=function(r,A){return Qt.parse(r,fh.create(A).parseComponentValue())},ht={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},n1={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(r,A){return A.map(function(e){if(GA(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},o1={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ds=function(r,A){var e=Qt.parse(r,A[0]),t=A[1];return t&&se(t)?{color:e,stop:t}:{color:e,stop:null}},Uh=function(r,A){var e=r[0],t=r[r.length-1];e.stop===null&&(e.stop=de),t.stop===null&&(t.stop=yt);for(var i=[],s=0,n=0;n<r.length;n++){var o=r[n].stop;if(o!==null){var a=RA(o,A);a>s?i.push(a):i.push(s),s=a}else i.push(null)}for(var l=null,n=0;n<i.length;n++){var c=i[n];if(c===null)l===null&&(l=n);else if(l!==null){for(var u=n-l,d=i[l-1],B=(c-d)/(u+1),p=1;p<=u;p++)i[l+p-1]=B*p;l=null}}return r.map(function(f,g){var Q=f.color;return{color:Q,stop:Math.max(Math.min(1,i[g]/A),0)}})},a1=function(r,A,e){var t=A/2,i=e/2,s=RA(r[0],A)-t,n=i-RA(r[1],e);return(Math.atan2(n,s)+Math.PI*2)%(Math.PI*2)},l1=function(r,A,e){var t=typeof r=="number"?r:a1(r,A,e),i=Math.abs(A*Math.sin(t))+Math.abs(e*Math.cos(t)),s=A/2,n=e/2,o=i/2,a=Math.sin(t-Math.PI/2)*o,l=Math.cos(t-Math.PI/2)*o;return[i,s-l,s+l,n-a,n+a]},Je=function(r,A){return Math.sqrt(r*r+A*A)},Eh=function(r,A,e,t,i){var s=[[0,0],[0,A],[r,0],[r,A]];return s.reduce(function(n,o){var a=o[0],l=o[1],c=Je(e-a,t-l);return(i?c<n.optimumDistance:c>n.optimumDistance)?{optimumCorner:o,optimumDistance:c}:n},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},c1=function(r,A,e,t,i){var s=0,n=0;switch(r.size){case 0:r.shape===0?s=n=Math.min(Math.abs(A),Math.abs(A-t),Math.abs(e),Math.abs(e-i)):r.shape===1&&(s=Math.min(Math.abs(A),Math.abs(A-t)),n=Math.min(Math.abs(e),Math.abs(e-i)));break;case 2:if(r.shape===0)s=n=Math.min(Je(A,e),Je(A,e-i),Je(A-t,e),Je(A-t,e-i));else if(r.shape===1){var o=Math.min(Math.abs(e),Math.abs(e-i))/Math.min(Math.abs(A),Math.abs(A-t)),a=Eh(t,i,A,e,!0),l=a[0],c=a[1];s=Je(l-A,(c-e)/o),n=o*s}break;case 1:r.shape===0?s=n=Math.max(Math.abs(A),Math.abs(A-t),Math.abs(e),Math.abs(e-i)):r.shape===1&&(s=Math.max(Math.abs(A),Math.abs(A-t)),n=Math.max(Math.abs(e),Math.abs(e-i)));break;case 3:if(r.shape===0)s=n=Math.max(Je(A,e),Je(A,e-i),Je(A-t,e),Je(A-t,e-i));else if(r.shape===1){var o=Math.max(Math.abs(e),Math.abs(e-i))/Math.max(Math.abs(A),Math.abs(A-t)),u=Eh(t,i,A,e,!1),l=u[0],c=u[1];s=Je(l-A,(c-e)/o),n=o*s}break}return Array.isArray(r.size)&&(s=RA(r.size[0],t),n=r.size.length===2?RA(r.size[1],i):s),[s,n]},h1=function(r,A){var e=Ne(180),t=[];return rt(A).forEach(function(i,s){if(s===0){var n=i[0];if(n.type===20&&n.value==="to"){e=bh(i);return}else if(vh(n)){e=us.parse(r,n);return}}var o=ds(r,i);t.push(o)}),{angle:e,stops:t,type:1}},fs=function(r,A){var e=Ne(180),t=[];return rt(A).forEach(function(i,s){if(s===0){var n=i[0];if(n.type===20&&["top","left","right","bottom"].indexOf(n.value)!==-1){e=bh(i);return}else if(vh(n)){e=(us.parse(r,n)+Ne(270))%Ne(360);return}}var o=ds(r,i);t.push(o)}),{angle:e,stops:t,type:1}},u1=function(r,A){var e=Ne(180),t=[],i=1,s=0,n=3,o=[];return rt(A).forEach(function(a,l){var c=a[0];if(l===0){if(GA(c)&&c.value==="linear"){i=1;return}else if(GA(c)&&c.value==="radial"){i=2;return}}if(c.type===18){if(c.name==="from"){var u=Qt.parse(r,c.values[0]);t.push({stop:de,color:u})}else if(c.name==="to"){var u=Qt.parse(r,c.values[0]);t.push({stop:yt,color:u})}else if(c.name==="color-stop"){var d=c.values.filter(sr);if(d.length===2){var u=Qt.parse(r,d[1]),B=d[0];ir(B)&&t.push({stop:{type:16,number:B.number*100,flags:B.flags},color:u})}}}}),i===1?{angle:(e+Ne(180))%Ne(360),stops:t,type:i}:{size:n,shape:s,stops:t,position:o,type:i}},xh="closest-side",Th="farthest-side",Sh="closest-corner",Hh="farthest-corner",Lh="circle",Ih="ellipse",Mh="cover",Dh="contain",d1=function(r,A){var e=0,t=3,i=[],s=[];return rt(A).forEach(function(n,o){var a=!0;if(o===0){var l=!1;a=n.reduce(function(u,d){if(l)if(GA(d))switch(d.value){case"center":return s.push(Co),u;case"top":case"left":return s.push(de),u;case"right":case"bottom":return s.push(yt),u}else(se(d)||bt(d))&&s.push(d);else if(GA(d))switch(d.value){case Lh:return e=0,!1;case Ih:return e=1,!1;case"at":return l=!0,!1;case xh:return t=0,!1;case Mh:case Th:return t=1,!1;case Dh:case Sh:return t=2,!1;case Hh:return t=3,!1}else if(bt(d)||se(d))return Array.isArray(t)||(t=[]),t.push(d),!1;return u},a)}if(a){var c=ds(r,n);i.push(c)}}),{size:t,shape:e,stops:i,position:s,type:2}},ps=function(r,A){var e=0,t=3,i=[],s=[];return rt(A).forEach(function(n,o){var a=!0;if(o===0?a=n.reduce(function(c,u){if(GA(u))switch(u.value){case"center":return s.push(Co),!1;case"top":case"left":return s.push(de),!1;case"right":case"bottom":return s.push(yt),!1}else if(se(u)||bt(u))return s.push(u),!1;return c},a):o===1&&(a=n.reduce(function(c,u){if(GA(u))switch(u.value){case Lh:return e=0,!1;case Ih:return e=1,!1;case Dh:case xh:return t=0,!1;case Th:return t=1,!1;case Sh:return t=2,!1;case Mh:case Hh:return t=3,!1}else if(bt(u)||se(u))return Array.isArray(t)||(t=[]),t.push(u),!1;return c},a)),a){var l=ds(r,n);i.push(l)}}),{size:t,shape:e,stops:i,position:s,type:2}},f1=function(r){return r.type===1},p1=function(r){return r.type===2},bo={name:"image",parse:function(r,A){if(A.type===22){var e={url:A.value,type:0};return r.cache.addImage(A.value),e}if(A.type===18){var t=_h[A.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return t(r,A.values)}throw new Error("Unsupported image type "+A.type)}};function B1(r){return!(r.type===20&&r.value==="none")&&(r.type!==18||!!_h[r.name])}var _h={"linear-gradient":h1,"-moz-linear-gradient":fs,"-ms-linear-gradient":fs,"-o-linear-gradient":fs,"-webkit-linear-gradient":fs,"radial-gradient":d1,"-moz-radial-gradient":ps,"-ms-radial-gradient":ps,"-o-radial-gradient":ps,"-webkit-radial-gradient":ps,"-webkit-gradient":u1},g1={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(r,A){if(A.length===0)return[];var e=A[0];return e.type===20&&e.value==="none"?[]:A.filter(function(t){return sr(t)&&B1(t)}).map(function(t){return bo.parse(r,t)})}},w1={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(r,A){return A.map(function(e){if(GA(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},m1={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(r,A){return rt(A).map(function(e){return e.filter(se)}).map(Bh)}},C1={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(r,A){return rt(A).map(function(e){return e.filter(GA).map(function(t){return t.value}).join(" ")}).map(v1)}},v1=function(r){switch(r){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}},nr;(function(r){r.AUTO="auto",r.CONTAIN="contain",r.COVER="cover"})(nr||(nr={}));var b1={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(r,A){return rt(A).map(function(e){return e.filter(y1)})}},y1=function(r){return GA(r)||se(r)},Bs=function(r){return{name:"border-"+r+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Q1=Bs("top"),F1=Bs("right"),U1=Bs("bottom"),E1=Bs("left"),gs=function(r){return{name:"border-radius-"+r,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return Bh(e.filter(se))}}},x1=gs("top-left"),T1=gs("top-right"),S1=gs("bottom-right"),H1=gs("bottom-left"),ws=function(r){return{name:"border-"+r+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},L1=ws("top"),I1=ws("right"),M1=ws("bottom"),D1=ws("left"),ms=function(r){return{name:"border-"+r+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return $r(e)?e.number:0}}},_1=ms("top"),k1=ms("right"),O1=ms("bottom"),N1=ms("left"),K1={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},V1={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(r,A){return A==="rtl"?1:0}},P1={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(r,A){return A.filter(GA).reduce(function(e,t){return e|z1(t.value)},0)}},z1=function(r){switch(r){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},G1={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(r,A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},R1={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(r,A){return A.type===20&&A.value==="normal"?0:A.type===17||A.type===15?A.number:0}},Cs;(function(r){r.NORMAL="normal",r.STRICT="strict"})(Cs||(Cs={}));var W1={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(r,A){return A==="strict"?Cs.STRICT:Cs.NORMAL}},$1={name:"line-height",initialValue:"normal",prefix:!1,type:4},kh=function(r,A){return GA(r)&&r.value==="normal"?1.2*A:r.type===17?A*r.number:se(r)?RA(r,A):A},X1={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(r,A){return A.type===20&&A.value==="none"?null:bo.parse(r,A)}},J1={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(r,A){return A==="inside"?0:1}},yo={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(r,A){switch(A){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},vs=function(r){return{name:"margin-"+r,initialValue:"0",prefix:!1,type:4}},Z1=vs("top"),Y1=vs("right"),q1=vs("bottom"),j1=vs("left"),Am={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(r,A){return A.filter(GA).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},em={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(r,A){return A==="break-word"?"break-word":"normal"}},bs=function(r){return{name:"padding-"+r,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},tm=bs("top"),rm=bs("right"),im=bs("bottom"),sm=bs("left"),nm={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(r,A){switch(A){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},om={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(r,A){switch(A){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},am={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(r,A){return A.length===1&&mo(A[0],"none")?[]:rt(A).map(function(e){for(var t={color:ht.TRANSPARENT,offsetX:de,offsetY:de,blur:de},i=0,s=0;s<e.length;s++){var n=e[s];bt(n)?(i===0?t.offsetX=n:i===1?t.offsetY=n:t.blur=n,i++):t.color=Qt.parse(r,n)}return t})}},lm={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(r,A){switch(A){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},cm={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(r,A){if(A.type===20&&A.value==="none")return null;if(A.type===18){var e=dm[A.name];if(typeof e>"u")throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return e(A.values)}return null}},hm=function(r){var A=r.filter(function(e){return e.type===17}).map(function(e){return e.number});return A.length===6?A:null},um=function(r){var A=r.filter(function(a){return a.type===17}).map(function(a){return a.number}),e=A[0],t=A[1];A[2],A[3];var i=A[4],s=A[5];A[6],A[7],A[8],A[9],A[10],A[11];var n=A[12],o=A[13];return A[14],A[15],A.length===16?[e,t,i,s,n,o]:null},dm={matrix:hm,matrix3d:um},Oh={type:16,number:50,flags:Pr},fm=[Oh,Oh],pm={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(r,A){var e=A.filter(se);return e.length!==2?fm:[e[0],e[1]]}},Bm={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(r,A){switch(A){case"hidden":return 1;case"collapse":return 2;default:return 0}}},Zr;(function(r){r.NORMAL="normal",r.BREAK_ALL="break-all",r.KEEP_ALL="keep-all"})(Zr||(Zr={}));for(var gm={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(r,A){switch(A){case"break-all":return Zr.BREAK_ALL;case"keep-all":return Zr.KEEP_ALL;default:return Zr.NORMAL}}},wm={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(r,A){if(A.type===20)return{auto:!0,order:0};if(ir(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},Nh={name:"time",parse:function(r,A){if(A.type===15)switch(A.unit.toLowerCase()){case"s":return 1e3*A.number;case"ms":return A.number}throw new Error("Unsupported time type")}},mm={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(r,A){return ir(A)?A.number:1}},Cm={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},vm={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(r,A){return A.filter(GA).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return e!==0})}},bm={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(r,A){var e=[],t=[];return A.forEach(function(i){switch(i.type){case 20:case 0:e.push(i.value);break;case 17:e.push(i.number.toString());break;case 4:t.push(e.join(" ")),e.length=0;break}}),e.length&&t.push(e.join(" ")),t.map(function(i){return i.indexOf(" ")===-1?i:"'"+i+"'"})}},ym={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},Qm={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(r,A){return ir(A)?A.number:GA(A)&&A.value==="bold"?700:400}},Fm={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(r,A){return A.filter(GA).map(function(e){return e.value})}},Um={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(r,A){switch(A){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},oe=function(r,A){return(r&A)!==0},Em={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(r,A){if(A.length===0)return[];var e=A[0];return e.type===20&&e.value==="none"?[]:A}},xm={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(r,A){if(A.length===0)return null;var e=A[0];if(e.type===20&&e.value==="none")return null;for(var t=[],i=A.filter(ph),s=0;s<i.length;s++){var n=i[s],o=i[s+1];if(n.type===20){var a=o&&ir(o)?o.number:1;t.push({counter:n.value,increment:a})}}return t}},Tm={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(r,A){if(A.length===0)return[];for(var e=[],t=A.filter(ph),i=0;i<t.length;i++){var s=t[i],n=t[i+1];if(GA(s)&&s.value!=="none"){var o=n&&ir(n)?n.number:0;e.push({counter:s.value,reset:o})}}return e}},Sm={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(r,A){return A.filter($r).map(function(e){return Nh.parse(r,e)})}},Hm={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(r,A){if(A.length===0)return null;var e=A[0];if(e.type===20&&e.value==="none")return null;var t=[],i=A.filter(r1);if(i.length%2!==0)return null;for(var s=0;s<i.length;s+=2){var n=i[s].value,o=i[s+1].value;t.push({open:n,close:o})}return t}},Kh=function(r,A,e){if(!r)return"";var t=r[Math.min(A,r.length-1)];return t?e?t.open:t.close:""},Lm={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(r,A){return A.length===1&&mo(A[0],"none")?[]:rt(A).map(function(e){for(var t={color:255,offsetX:de,offsetY:de,blur:de,spread:de,inset:!1},i=0,s=0;s<e.length;s++){var n=e[s];mo(n,"inset")?t.inset=!0:bt(n)?(i===0?t.offsetX=n:i===1?t.offsetY=n:i===2?t.blur=n:t.spread=n,i++):t.color=Qt.parse(r,n)}return t})}},Im={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(r,A){var e=[0,1,2],t=[];return A.filter(GA).forEach(function(i){switch(i.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2);break}}),e.forEach(function(i){t.indexOf(i)===-1&&t.push(i)}),t}},Mm={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Dm={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(r,A){return $r(A)?A.number:0}},_m=(function(){function r(A,e){var t,i;this.animationDuration=dA(A,Sm,e.animationDuration),this.backgroundClip=dA(A,n1,e.backgroundClip),this.backgroundColor=dA(A,o1,e.backgroundColor),this.backgroundImage=dA(A,g1,e.backgroundImage),this.backgroundOrigin=dA(A,w1,e.backgroundOrigin),this.backgroundPosition=dA(A,m1,e.backgroundPosition),this.backgroundRepeat=dA(A,C1,e.backgroundRepeat),this.backgroundSize=dA(A,b1,e.backgroundSize),this.borderTopColor=dA(A,Q1,e.borderTopColor),this.borderRightColor=dA(A,F1,e.borderRightColor),this.borderBottomColor=dA(A,U1,e.borderBottomColor),this.borderLeftColor=dA(A,E1,e.borderLeftColor),this.borderTopLeftRadius=dA(A,x1,e.borderTopLeftRadius),this.borderTopRightRadius=dA(A,T1,e.borderTopRightRadius),this.borderBottomRightRadius=dA(A,S1,e.borderBottomRightRadius),this.borderBottomLeftRadius=dA(A,H1,e.borderBottomLeftRadius),this.borderTopStyle=dA(A,L1,e.borderTopStyle),this.borderRightStyle=dA(A,I1,e.borderRightStyle),this.borderBottomStyle=dA(A,M1,e.borderBottomStyle),this.borderLeftStyle=dA(A,D1,e.borderLeftStyle),this.borderTopWidth=dA(A,_1,e.borderTopWidth),this.borderRightWidth=dA(A,k1,e.borderRightWidth),this.borderBottomWidth=dA(A,O1,e.borderBottomWidth),this.borderLeftWidth=dA(A,N1,e.borderLeftWidth),this.boxShadow=dA(A,Lm,e.boxShadow),this.color=dA(A,K1,e.color),this.direction=dA(A,V1,e.direction),this.display=dA(A,P1,e.display),this.float=dA(A,G1,e.cssFloat),this.fontFamily=dA(A,bm,e.fontFamily),this.fontSize=dA(A,ym,e.fontSize),this.fontStyle=dA(A,Um,e.fontStyle),this.fontVariant=dA(A,Fm,e.fontVariant),this.fontWeight=dA(A,Qm,e.fontWeight),this.letterSpacing=dA(A,R1,e.letterSpacing),this.lineBreak=dA(A,W1,e.lineBreak),this.lineHeight=dA(A,$1,e.lineHeight),this.listStyleImage=dA(A,X1,e.listStyleImage),this.listStylePosition=dA(A,J1,e.listStylePosition),this.listStyleType=dA(A,yo,e.listStyleType),this.marginTop=dA(A,Z1,e.marginTop),this.marginRight=dA(A,Y1,e.marginRight),this.marginBottom=dA(A,q1,e.marginBottom),this.marginLeft=dA(A,j1,e.marginLeft),this.opacity=dA(A,mm,e.opacity);var s=dA(A,Am,e.overflow);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0],this.overflowWrap=dA(A,em,e.overflowWrap),this.paddingTop=dA(A,tm,e.paddingTop),this.paddingRight=dA(A,rm,e.paddingRight),this.paddingBottom=dA(A,im,e.paddingBottom),this.paddingLeft=dA(A,sm,e.paddingLeft),this.paintOrder=dA(A,Im,e.paintOrder),this.position=dA(A,om,e.position),this.textAlign=dA(A,nm,e.textAlign),this.textDecorationColor=dA(A,Cm,(t=e.textDecorationColor)!==null&&t!==void 0?t:e.color),this.textDecorationLine=dA(A,vm,(i=e.textDecorationLine)!==null&&i!==void 0?i:e.textDecoration),this.textShadow=dA(A,am,e.textShadow),this.textTransform=dA(A,lm,e.textTransform),this.transform=dA(A,cm,e.transform),this.transformOrigin=dA(A,pm,e.transformOrigin),this.visibility=dA(A,Bm,e.visibility),this.webkitTextStrokeColor=dA(A,Mm,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=dA(A,Dm,e.webkitTextStrokeWidth),this.wordBreak=dA(A,gm,e.wordBreak),this.zIndex=dA(A,wm,e.zIndex)}return r.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},r.prototype.isTransparent=function(){return Ft(this.backgroundColor)},r.prototype.isTransformed=function(){return this.transform!==null},r.prototype.isPositioned=function(){return this.position!==0},r.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},r.prototype.isFloating=function(){return this.float!==0},r.prototype.isInlineLevel=function(){return oe(this.display,4)||oe(this.display,33554432)||oe(this.display,268435456)||oe(this.display,536870912)||oe(this.display,67108864)||oe(this.display,134217728)},r})(),km=(function(){function r(A,e){this.content=dA(A,Em,e.content),this.quotes=dA(A,Hm,e.quotes)}return r})(),Vh=(function(){function r(A,e){this.counterIncrement=dA(A,xm,e.counterIncrement),this.counterReset=dA(A,Tm,e.counterReset)}return r})(),dA=function(r,A,e){var t=new dh,i=e!==null&&typeof e<"u"?e.toString():A.initialValue;t.write(i);var s=new fh(t.read());switch(A.type){case 2:var n=s.parseComponentValue();return A.parse(r,GA(n)?n.value:A.initialValue);case 0:return A.parse(r,s.parseComponentValue());case 1:return A.parse(r,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(A.format){case"angle":return us.parse(r,s.parseComponentValue());case"color":return Qt.parse(r,s.parseComponentValue());case"image":return bo.parse(r,s.parseComponentValue());case"length":var o=s.parseComponentValue();return bt(o)?o:de;case"length-percentage":var a=s.parseComponentValue();return se(a)?a:de;case"time":return Nh.parse(r,s.parseComponentValue())}break}},Om="data-html2canvas-debug",Nm=function(r){var A=r.getAttribute(Om);switch(A){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Qo=function(r,A){var e=Nm(r);return e===1||A===e},it=(function(){function r(A,e){if(this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Qo(e,3))debugger;this.styles=new _m(A,window.getComputedStyle(e,null)),Oo(e)&&(this.styles.animationDuration.some(function(t){return t>0})&&(e.style.animationDuration="0s"),this.styles.transform!==null&&(e.style.transform="none")),this.bounds=Wi(this.context,e),Qo(e,4)&&(this.flags|=16)}return r})(),Km="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Ph="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yr=typeof Uint8Array>"u"?[]:new Uint8Array(256),ys=0;ys<Ph.length;ys++)Yr[Ph.charCodeAt(ys)]=ys;for(var Vm=function(r){var A=r.length*.75,e=r.length,t,i=0,s,n,o,a;r[r.length-1]==="="&&(A--,r[r.length-2]==="="&&A--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(A):new Array(A),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t<e;t+=4)s=Yr[r.charCodeAt(t)],n=Yr[r.charCodeAt(t+1)],o=Yr[r.charCodeAt(t+2)],a=Yr[r.charCodeAt(t+3)],c[i++]=s<<2|n>>4,c[i++]=(n&15)<<4|o>>2,c[i++]=(o&3)<<6|a&63;return l},Pm=function(r){for(var A=r.length,e=[],t=0;t<A;t+=2)e.push(r[t+1]<<8|r[t]);return e},zm=function(r){for(var A=r.length,e=[],t=0;t<A;t+=4)e.push(r[t+3]<<24|r[t+2]<<16|r[t+1]<<8|r[t]);return e},Pt=5,Fo=11,Uo=2,Gm=Fo-Pt,zh=65536>>Pt,Rm=1<<Pt,Eo=Rm-1,Wm=1024>>Pt,$m=zh+Wm,Xm=$m,Jm=32,Zm=Xm+Jm,Ym=65536>>Fo,qm=1<<Gm,jm=qm-1,Gh=function(r,A,e){return r.slice?r.slice(A,e):new Uint16Array(Array.prototype.slice.call(r,A,e))},AC=function(r,A,e){return r.slice?r.slice(A,e):new Uint32Array(Array.prototype.slice.call(r,A,e))},eC=function(r,A){var e=Vm(r),t=Array.isArray(e)?zm(e):new Uint32Array(e),i=Array.isArray(e)?Pm(e):new Uint16Array(e),s=24,n=Gh(i,s/2,t[4]/2),o=t[5]===2?Gh(i,(s+t[4])/2):AC(t,Math.ceil((s+t[4])/4));return new tC(t[0],t[1],t[2],t[3],n,o)},tC=(function(){function r(A,e,t,i,s,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=i,this.index=s,this.data=n}return r.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=this.index[A>>Pt],e=(e<<Uo)+(A&Eo),this.data[e];if(A<=65535)return e=this.index[zh+(A-55296>>Pt)],e=(e<<Uo)+(A&Eo),this.data[e];if(A<this.highStart)return e=Zm-Ym+(A>>Fo),e=this.index[e],e+=A>>Pt&jm,e=this.index[e],e=(e<<Uo)+(A&Eo),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},r})(),Rh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rC=typeof Uint8Array>"u"?[]:new Uint8Array(256),Qs=0;Qs<Rh.length;Qs++)rC[Rh.charCodeAt(Qs)]=Qs;var iC=1,xo=2,To=3,Wh=4,$h=5,sC=7,Xh=8,So=9,Ho=10,Jh=11,Zh=12,Yh=13,qh=14,Lo=15,nC=function(r){for(var A=[],e=0,t=r.length;e<t;){var i=r.charCodeAt(e++);if(i>=55296&&i<=56319&&e<t){var s=r.charCodeAt(e++);(s&64512)===56320?A.push(((i&1023)<<10)+(s&1023)+65536):(A.push(i),e--)}else A.push(i)}return A},oC=function(){for(var r=[],A=0;A<arguments.length;A++)r[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,r);var e=r.length;if(!e)return"";for(var t=[],i=-1,s="";++i<e;){var n=r[i];n<=65535?t.push(n):(n-=65536,t.push((n>>10)+55296,n%1024+56320)),(i+1===e||t.length>16384)&&(s+=String.fromCharCode.apply(String,t),t.length=0)}return s},aC=eC(Km),Ke="×",Io="÷",lC=function(r){return aC.get(r)},cC=function(r,A,e){var t=e-2,i=A[t],s=A[e-1],n=A[e];if(s===xo&&n===To)return Ke;if(s===xo||s===To||s===Wh||n===xo||n===To||n===Wh)return Io;if(s===Xh&&[Xh,So,Jh,Zh].indexOf(n)!==-1||(s===Jh||s===So)&&(n===So||n===Ho)||(s===Zh||s===Ho)&&n===Ho||n===Yh||n===$h||n===sC||s===iC)return Ke;if(s===Yh&&n===qh){for(;i===$h;)i=A[--t];if(i===qh)return Ke}if(s===Lo&&n===Lo){for(var o=0;i===Lo;)o++,i=A[--t];if(o%2===0)return Ke}return Io},hC=function(r){var A=nC(r),e=A.length,t=0,i=0,s=A.map(lC);return{next:function(){if(t>=e)return{done:!0,value:null};for(var n=Ke;t<e&&(n=cC(A,s,++t))===Ke;);if(n!==Ke||t===e){var o=oC.apply(null,A.slice(i,t));return i=t,{value:o,done:!1}}return{done:!0,value:null}}}},uC=function(r){for(var A=hC(r),e=[],t;!(t=A.next()).done;)t.value&&e.push(t.value.slice());return e},dC=function(r){var A=123;if(r.createRange){var e=r.createRange();if(e.getBoundingClientRect){var t=r.createElement("boundtest");t.style.height=A+"px",t.style.display="block",r.body.appendChild(t),e.selectNode(t);var i=e.getBoundingClientRect(),s=Math.round(i.height);if(r.body.removeChild(t),s===A)return!0}}return!1},fC=function(r){var A=r.createElement("boundtest");A.style.width="50px",A.style.display="block",A.style.fontSize="12px",A.style.letterSpacing="0px",A.style.wordSpacing="0px",r.body.appendChild(A);var e=r.createRange();A.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var t=A.firstChild,i=$i(t.data).map(function(a){return te(a)}),s=0,n={},o=i.every(function(a,l){e.setStart(t,s),e.setEnd(t,s+a.length);var c=e.getBoundingClientRect();s+=a.length;var u=c.x>n.x||c.y>n.y;return n=c,l===0?!0:u});return r.body.removeChild(A),o},pC=function(){return typeof new Image().crossOrigin<"u"},BC=function(){return typeof new XMLHttpRequest().responseType=="string"},gC=function(r){var A=new Image,e=r.createElement("canvas"),t=e.getContext("2d");if(!t)return!1;A.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{t.drawImage(A,0,0),e.toDataURL()}catch{return!1}return!0},jh=function(r){return r[0]===0&&r[1]===255&&r[2]===0&&r[3]===255},wC=function(r){var A=r.createElement("canvas"),e=100;A.width=e,A.height=e;var t=A.getContext("2d");if(!t)return Promise.reject(!1);t.fillStyle="rgb(0, 255, 0)",t.fillRect(0,0,e,e);var i=new Image,s=A.toDataURL();i.src=s;var n=Mo(e,e,0,0,i);return t.fillStyle="red",t.fillRect(0,0,e,e),Au(n).then(function(o){t.drawImage(o,0,0);var a=t.getImageData(0,0,e,e).data;t.fillStyle="red",t.fillRect(0,0,e,e);var l=r.createElement("div");return l.style.backgroundImage="url("+s+")",l.style.height=e+"px",jh(a)?Au(Mo(e,e,0,0,l)):Promise.reject(!1)}).then(function(o){return t.drawImage(o,0,0),jh(t.getImageData(0,0,e,e).data)}).catch(function(){return!1})},Mo=function(r,A,e,t,i){var s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return n.setAttributeNS(null,"width",r.toString()),n.setAttributeNS(null,"height",A.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",e.toString()),o.setAttributeNS(null,"y",t.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),n.appendChild(o),o.appendChild(i),n},Au=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},fe={get SUPPORT_RANGE_BOUNDS(){var r=dC(document);return Object.defineProperty(fe,"SUPPORT_RANGE_BOUNDS",{value:r}),r},get SUPPORT_WORD_BREAKING(){var r=fe.SUPPORT_RANGE_BOUNDS&&fC(document);return Object.defineProperty(fe,"SUPPORT_WORD_BREAKING",{value:r}),r},get SUPPORT_SVG_DRAWING(){var r=gC(document);return Object.defineProperty(fe,"SUPPORT_SVG_DRAWING",{value:r}),r},get SUPPORT_FOREIGNOBJECT_DRAWING(){var r=typeof Array.from=="function"&&typeof window.fetch=="function"?wC(document):Promise.resolve(!1);return Object.defineProperty(fe,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:r}),r},get SUPPORT_CORS_IMAGES(){var r=pC();return Object.defineProperty(fe,"SUPPORT_CORS_IMAGES",{value:r}),r},get SUPPORT_RESPONSE_TYPE(){var r=BC();return Object.defineProperty(fe,"SUPPORT_RESPONSE_TYPE",{value:r}),r},get SUPPORT_CORS_XHR(){var r="withCredentials"in new XMLHttpRequest;return Object.defineProperty(fe,"SUPPORT_CORS_XHR",{value:r}),r},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var r=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(fe,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:r}),r}},qr=(function(){function r(A,e){this.text=A,this.bounds=e}return r})(),mC=function(r,A,e,t){var i=bC(A,e),s=[],n=0;return i.forEach(function(o){if(e.textDecorationLine.length||o.trim().length>0)if(fe.SUPPORT_RANGE_BOUNDS){var a=eu(t,n,o.length).getClientRects();if(a.length>1){var l=Do(o),c=0;l.forEach(function(d){s.push(new qr(d,lt.fromDOMRectList(r,eu(t,c+n,d.length).getClientRects()))),c+=d.length})}else s.push(new qr(o,lt.fromDOMRectList(r,a)))}else{var u=t.splitText(o.length);s.push(new qr(o,CC(r,t))),t=u}else fe.SUPPORT_RANGE_BOUNDS||(t=t.splitText(o.length));n+=o.length}),s},CC=function(r,A){var e=A.ownerDocument;if(e){var t=e.createElement("html2canvaswrapper");t.appendChild(A.cloneNode(!0));var i=A.parentNode;if(i){i.replaceChild(t,A);var s=Wi(r,t);return t.firstChild&&i.replaceChild(t.firstChild,t),s}}return lt.EMPTY},eu=function(r,A,e){var t=r.ownerDocument;if(!t)throw new Error("Node has no owner document");var i=t.createRange();return i.setStart(r,A),i.setEnd(r,A+e),i},Do=function(r){if(fe.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(A.segment(r)).map(function(e){return e.segment})}return uC(r)},vC=function(r,A){if(fe.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(e.segment(r)).map(function(t){return t.segment})}return QC(r,A)},bC=function(r,A){return A.letterSpacing!==0?Do(r):vC(r,A)},yC=[32,160,4961,65792,65793,4153,4241],QC=function(r,A){for(var e=Yg(r,{lineBreak:A.lineBreak,wordBreak:A.overflowWrap==="break-word"?"break-word":A.wordBreak}),t=[],i,s=function(){if(i.value){var n=i.value.slice(),o=$i(n),a="";o.forEach(function(l){yC.indexOf(l)===-1?a+=te(l):(a.length&&t.push(a),t.push(te(l)),a="")}),a.length&&t.push(a)}};!(i=e.next()).done;)s();return t},FC=(function(){function r(A,e,t){this.text=UC(e.data,t.textTransform),this.textBounds=mC(A,this.text,t,e)}return r})(),UC=function(r,A){switch(A){case 1:return r.toLowerCase();case 3:return r.replace(EC,xC);case 2:return r.toUpperCase();default:return r}},EC=/(^|\s|:|-|\(|\))([a-z])/g,xC=function(r,A,e){return r.length>0?A+e.toUpperCase():r},tu=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.src=t.currentSrc||t.src,i.intrinsicWidth=t.naturalWidth,i.intrinsicHeight=t.naturalHeight,i.context.cache.addImage(i.src),i}return A})(it),ru=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.canvas=t,i.intrinsicWidth=t.width,i.intrinsicHeight=t.height,i}return A})(it),iu=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this,s=new XMLSerializer,n=Wi(e,t);return t.setAttribute("width",n.width+"px"),t.setAttribute("height",n.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(s.serializeToString(t)),i.intrinsicWidth=t.width.baseVal.value,i.intrinsicHeight=t.height.baseVal.value,i.context.cache.addImage(i.svg),i}return A})(it),su=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.value=t.value,i}return A})(it),_o=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.start=t.start,i.reversed=typeof t.reversed=="boolean"&&t.reversed===!0,i}return A})(it),TC=[{type:15,flags:0,unit:"px",number:3}],SC=[{type:16,flags:0,number:50}],HC=function(r){return r.width>r.height?new lt(r.left+(r.width-r.height)/2,r.top,r.height,r.height):r.width<r.height?new lt(r.left,r.top+(r.height-r.width)/2,r.width,r.width):r},LC=function(r){var A=r.type===IC?new Array(r.value.length+1).join("•"):r.value;return A.length===0?r.placeholder||"":A},Fs="checkbox",Us="radio",IC="password",nu=707406591,ko=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;switch(i.type=t.type.toLowerCase(),i.checked=t.checked,i.value=LC(t),(i.type===Fs||i.type===Us)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=HC(i.bounds)),i.type){case Fs:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=TC;break;case Us:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=SC;break}return i}return A})(it),ou=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this,s=t.options[t.selectedIndex||0];return i.value=s&&s.text||"",i}return A})(it),au=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.value=t.value,i}return A})(it),lu=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;i.src=t.src,i.width=parseInt(t.width,10)||0,i.height=parseInt(t.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){i.tree=hu(e,t.contentWindow.document.documentElement);var s=t.contentWindow.document.documentElement?Jr(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):ht.TRANSPARENT,n=t.contentWindow.document.body?Jr(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):ht.TRANSPARENT;i.backgroundColor=Ft(s)?Ft(n)?i.styles.backgroundColor:n:s}}catch{}return i}return A})(it),MC=["OL","UL","MENU"],Es=function(r,A,e,t){for(var i=A.firstChild,s=void 0;i;i=s)if(s=i.nextSibling,uu(i)&&i.data.trim().length>0)e.textNodes.push(new FC(r,i,e.styles));else if(or(i))if(wu(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return Es(r,o,e,t)});else{var n=cu(r,i);n.styles.isVisible()&&(DC(i,n,t)?n.flags|=4:_C(n.styles)&&(n.flags|=2),MC.indexOf(i.tagName)!==-1&&(n.flags|=8),e.elements.push(n),i.slot,i.shadowRoot?Es(r,i.shadowRoot,n,t):!Ts(i)&&!du(i)&&!Ss(i)&&Es(r,i,n,t))}},cu=function(r,A){return Ko(A)?new tu(r,A):fu(A)?new ru(r,A):du(A)?new iu(r,A):kC(A)?new su(r,A):OC(A)?new _o(r,A):NC(A)?new ko(r,A):Ss(A)?new ou(r,A):Ts(A)?new au(r,A):Bu(A)?new lu(r,A):new it(r,A)},hu=function(r,A){var e=cu(r,A);return e.flags|=4,Es(r,A,e,e),e},DC=function(r,A,e){return A.styles.isPositionedWithZIndex()||A.styles.opacity<1||A.styles.isTransformed()||No(r)&&e.styles.isTransparent()},_C=function(r){return r.isPositioned()||r.isFloating()},uu=function(r){return r.nodeType===Node.TEXT_NODE},or=function(r){return r.nodeType===Node.ELEMENT_NODE},Oo=function(r){return or(r)&&typeof r.style<"u"&&!xs(r)},xs=function(r){return typeof r.className=="object"},kC=function(r){return r.tagName==="LI"},OC=function(r){return r.tagName==="OL"},NC=function(r){return r.tagName==="INPUT"},KC=function(r){return r.tagName==="HTML"},du=function(r){return r.tagName==="svg"},No=function(r){return r.tagName==="BODY"},fu=function(r){return r.tagName==="CANVAS"},pu=function(r){return r.tagName==="VIDEO"},Ko=function(r){return r.tagName==="IMG"},Bu=function(r){return r.tagName==="IFRAME"},gu=function(r){return r.tagName==="STYLE"},VC=function(r){return r.tagName==="SCRIPT"},Ts=function(r){return r.tagName==="TEXTAREA"},Ss=function(r){return r.tagName==="SELECT"},wu=function(r){return r.tagName==="SLOT"},mu=function(r){return r.tagName.indexOf("-")>0},PC=(function(){function r(){this.counters={}}return r.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},r.prototype.getCounterValues=function(A){var e=this.counters[A];return e||[]},r.prototype.pop=function(A){var e=this;A.forEach(function(t){return e.counters[t].pop()})},r.prototype.parse=function(A){var e=this,t=A.counterIncrement,i=A.counterReset,s=!0;t!==null&&t.forEach(function(o){var a=e.counters[o.counter];a&&o.increment!==0&&(s=!1,a.length||a.push(1),a[Math.max(0,a.length-1)]+=o.increment)});var n=[];return s&&i.forEach(function(o){var a=e.counters[o.counter];n.push(o.counter),a||(a=e.counters[o.counter]=[]),a.push(o.reset)}),n},r})(),Cu={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},vu={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},zC={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},GC={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ar=function(r,A,e,t,i,s){return r<A||r>e?Ai(r,i,s.length>0):t.integers.reduce(function(n,o,a){for(;r>=o;)r-=o,n+=t.values[a];return n},"")+s},bu=function(r,A,e,t){var i="";do e||r--,i=t(r)+i,r/=A;while(r*A>=A);return i},re=function(r,A,e,t,i){var s=e-A+1;return(r<0?"-":"")+(bu(Math.abs(r),s,t,function(n){return te(Math.floor(n%s)+A)})+i)},zt=function(r,A,e){e===void 0&&(e=". ");var t=A.length;return bu(Math.abs(r),t,!1,function(i){return A[Math.floor(i%t)]})+e},lr=1,Et=2,xt=4,jr=8,ut=function(r,A,e,t,i,s){if(r<-9999||r>9999)return Ai(r,4,i.length>0);var n=Math.abs(r),o=i;if(n===0)return A[0]+o;for(var a=0;n>0&&a<=4;a++){var l=n%10;l===0&&oe(s,lr)&&o!==""?o=A[l]+o:l>1||l===1&&a===0||l===1&&a===1&&oe(s,Et)||l===1&&a===1&&oe(s,xt)&&r>100||l===1&&a>1&&oe(s,jr)?o=A[l]+(a>0?e[a-1]:"")+o:l===1&&a>0&&(o=e[a-1]+o),n=Math.floor(n/10)}return(r<0?t:"")+o},yu="十百千萬",Qu="拾佰仟萬",Fu="マイナス",Vo="마이너스",Ai=function(r,A,e){var t=e?". ":"",i=e?"、":"",s=e?", ":"",n=e?" ":"";switch(A){case 0:return"•"+n;case 1:return"◦"+n;case 2:return"◾"+n;case 5:var o=re(r,48,57,!0,t);return o.length<4?"0"+o:o;case 4:return zt(r,"〇一二三四五六七八九",i);case 6:return ar(r,1,3999,Cu,3,t).toLowerCase();case 7:return ar(r,1,3999,Cu,3,t);case 8:return re(r,945,969,!1,t);case 9:return re(r,97,122,!1,t);case 10:return re(r,65,90,!1,t);case 11:return re(r,1632,1641,!0,t);case 12:case 49:return ar(r,1,9999,vu,3,t);case 35:return ar(r,1,9999,vu,3,t).toLowerCase();case 13:return re(r,2534,2543,!0,t);case 14:case 30:return re(r,6112,6121,!0,t);case 15:return zt(r,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return zt(r,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return ut(r,"零一二三四五六七八九",yu,"負",i,Et|xt|jr);case 47:return ut(r,"零壹貳參肆伍陸柒捌玖",Qu,"負",i,lr|Et|xt|jr);case 42:return ut(r,"零一二三四五六七八九",yu,"负",i,Et|xt|jr);case 41:return ut(r,"零壹贰叁肆伍陆柒捌玖",Qu,"负",i,lr|Et|xt|jr);case 26:return ut(r,"〇一二三四五六七八九","十百千万",Fu,i,0);case 25:return ut(r,"零壱弐参四伍六七八九","拾百千万",Fu,i,lr|Et|xt);case 31:return ut(r,"영일이삼사오육칠팔구","십백천만",Vo,s,lr|Et|xt);case 33:return ut(r,"零一二三四五六七八九","十百千萬",Vo,s,0);case 32:return ut(r,"零壹貳參四五六七八九","拾百千",Vo,s,lr|Et|xt);case 18:return re(r,2406,2415,!0,t);case 20:return ar(r,1,19999,GC,3,t);case 21:return re(r,2790,2799,!0,t);case 22:return re(r,2662,2671,!0,t);case 22:return ar(r,1,10999,zC,3,t);case 23:return zt(r,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return zt(r,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return re(r,3302,3311,!0,t);case 28:return zt(r,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return zt(r,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return re(r,3792,3801,!0,t);case 37:return re(r,6160,6169,!0,t);case 38:return re(r,4160,4169,!0,t);case 39:return re(r,2918,2927,!0,t);case 40:return re(r,1776,1785,!0,t);case 43:return re(r,3046,3055,!0,t);case 44:return re(r,3174,3183,!0,t);case 45:return re(r,3664,3673,!0,t);case 46:return re(r,3872,3881,!0,t);default:return re(r,48,57,!0,t)}},Uu="data-html2canvas-ignore",Eu=(function(){function r(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new PC,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return r.prototype.toIFrame=function(A,e){var t=this,i=RC(A,e);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var s=A.defaultView.pageXOffset,n=A.defaultView.pageYOffset,o=i.contentWindow,a=o.document,l=XC(i).then(function(){return ye(t,void 0,void 0,function(){var c,u;return me(this,function(d){switch(d.label){case 0:return this.scrolledElements.forEach(qC),o&&(o.scrollTo(e.left,e.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==e.top||o.scrollX!==e.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-e.left,o.scrollY-e.top,0,0))),c=this.options.onclone,u=this.clonedReferenceElement,typeof u>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:d.sent(),d.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,$C(a)]:[3,4];case 3:d.sent(),d.label=4;case 4:return typeof c=="function"?[2,Promise.resolve().then(function(){return c(a,u)}).then(function(){return i})]:[2,i]}})})});return a.open(),a.write(ZC(document.doctype)+"<html></html>"),YC(this.referenceElement.ownerDocument,s,n),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),l},r.prototype.createElementClone=function(A){if(Qo(A,2))debugger;if(fu(A))return this.createCanvasClone(A);if(pu(A))return this.createVideoClone(A);if(gu(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Ko(e)&&(Ko(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager")),mu(e)?this.createCustomElementClone(e):e},r.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return Po(A.style,e),e},r.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(s,n){return n&&typeof n.cssText=="string"?s+n.cssText:s},""),i=A.cloneNode(!1);return i.textContent=t,i}}catch(s){if(this.context.logger.error("Unable to access cssRules property",s),s.name!=="SecurityError")throw s}return A.cloneNode(!1)},r.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var i=A.cloneNode(!1);try{i.width=A.width,i.height=A.height;var s=A.getContext("2d"),n=i.getContext("2d");if(n)if(!this.options.allowTaint&&s)n.putImageData(s.getImageData(0,0,A.width,A.height),0,0);else{var o=(e=A.getContext("webgl2"))!==null&&e!==void 0?e:A.getContext("webgl");if(o){var a=o.getContextAttributes();a?.preserveDrawingBuffer===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}n.drawImage(A,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",A)}return i},r.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch{this.context.logger.info("Unable to clone video as it is tainted",A)}var i=A.ownerDocument.createElement("canvas");return i.width=A.offsetWidth,i.height=A.offsetHeight,i},r.prototype.appendChildNode=function(A,e,t){(!or(e)||!VC(e)&&!e.hasAttribute(Uu)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(e)))&&(!this.options.copyStyles||!or(e)||!gu(e))&&A.appendChild(this.cloneNode(e,t))},r.prototype.cloneChildNodes=function(A,e,t){for(var i=this,s=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;s;s=s.nextSibling)if(or(s)&&wu(s)&&typeof s.assignedNodes=="function"){var n=s.assignedNodes();n.length&&n.forEach(function(o){return i.appendChildNode(e,o,t)})}else this.appendChildNode(e,s,t)},r.prototype.cloneNode=function(A,e){if(uu(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&or(A)&&(Oo(A)||xs(A))){var i=this.createElementClone(A);i.style.transitionProperty="none";var s=t.getComputedStyle(A),n=t.getComputedStyle(A,":before"),o=t.getComputedStyle(A,":after");this.referenceElement===A&&Oo(i)&&(this.clonedReferenceElement=i),No(i)&&ev(i);var a=this.counters.parse(new Vh(this.context,s)),l=this.resolvePseudoContent(A,i,n,ei.BEFORE);mu(A)&&(e=!0),pu(A)||this.cloneChildNodes(A,i,e),l&&i.insertBefore(l,i.firstChild);var c=this.resolvePseudoContent(A,i,o,ei.AFTER);return c&&i.appendChild(c),this.counters.pop(a),(s&&(this.options.copyStyles||xs(A))&&!Bu(A)||e)&&Po(s,i),(A.scrollTop!==0||A.scrollLeft!==0)&&this.scrolledElements.push([i,A.scrollLeft,A.scrollTop]),(Ts(A)||Ss(A))&&(Ts(i)||Ss(i))&&(i.value=A.value),i}return A.cloneNode(!1)},r.prototype.resolvePseudoContent=function(A,e,t,i){var s=this;if(t){var n=t.content,o=e.ownerDocument;if(!(!o||!n||n==="none"||n==="-moz-alt-content"||t.display==="none")){this.counters.parse(new Vh(this.context,t));var a=new km(this.context,t),l=o.createElement("html2canvaspseudoelement");Po(t,l),a.content.forEach(function(u){if(u.type===0)l.appendChild(o.createTextNode(u.value));else if(u.type===22){var d=o.createElement("img");d.src=u.value,d.style.opacity="1",l.appendChild(d)}else if(u.type===18){if(u.name==="attr"){var B=u.values.filter(GA);B.length&&l.appendChild(o.createTextNode(A.getAttribute(B[0].value)||""))}else if(u.name==="counter"){var p=u.values.filter(sr),f=p[0],g=p[1];if(f&&GA(f)){var Q=s.counters.getCounterValue(f.value),m=g&&GA(g)?yo.parse(s.context,g.value):3;l.appendChild(o.createTextNode(Ai(Q,m,!1)))}}else if(u.name==="counters"){var E=u.values.filter(sr),f=E[0],F=E[1],g=E[2];if(f&&GA(f)){var S=s.counters.getCounterValues(f.value),P=g&&GA(g)?yo.parse(s.context,g.value):3,z=F&&F.type===0?F.value:"",eA=S.map(function(X){return Ai(X,P,!1)}).join(z);l.appendChild(o.createTextNode(eA))}}}else if(u.type===20)switch(u.value){case"open-quote":l.appendChild(o.createTextNode(Kh(a.quotes,s.quoteDepth++,!0)));break;case"close-quote":l.appendChild(o.createTextNode(Kh(a.quotes,--s.quoteDepth,!1)));break;default:l.appendChild(o.createTextNode(u.value))}}),l.className=zo+" "+Go;var c=i===ei.BEFORE?" "+zo:" "+Go;return xs(e)?e.className.baseValue+=c:e.className+=c,l}}},r.destroy=function(A){return A.parentNode?(A.parentNode.removeChild(A),!0):!1},r})(),ei;(function(r){r[r.BEFORE=0]="BEFORE",r[r.AFTER=1]="AFTER"})(ei||(ei={}));var RC=function(r,A){var e=r.createElement("iframe");return e.className="html2canvas-container",e.style.visibility="hidden",e.style.position="fixed",e.style.left="-10000px",e.style.top="0px",e.style.border="0",e.width=A.width.toString(),e.height=A.height.toString(),e.scrolling="no",e.setAttribute(Uu,"true"),r.body.appendChild(e),e},WC=function(r){return new Promise(function(A){if(r.complete){A();return}if(!r.src){A();return}r.onload=A,r.onerror=A})},$C=function(r){return Promise.all([].slice.call(r.images,0).map(WC))},XC=function(r){return new Promise(function(A,e){var t=r.contentWindow;if(!t)return e("No window assigned for iframe");var i=t.document;t.onload=r.onload=function(){t.onload=r.onload=null;var s=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(s),A(r))},50)}})},JC=["all","d","content"],Po=function(r,A){for(var e=r.length-1;e>=0;e--){var t=r.item(e);JC.indexOf(t)===-1&&A.style.setProperty(t,r.getPropertyValue(t))}return A},ZC=function(r){var A="";return r&&(A+="<!DOCTYPE ",r.name&&(A+=r.name),r.internalSubset&&(A+=r.internalSubset),r.publicId&&(A+='"'+r.publicId+'"'),r.systemId&&(A+='"'+r.systemId+'"'),A+=">"),A},YC=function(r,A,e){r&&r.defaultView&&(A!==r.defaultView.pageXOffset||e!==r.defaultView.pageYOffset)&&r.defaultView.scrollTo(A,e)},qC=function(r){var A=r[0],e=r[1],t=r[2];A.scrollLeft=e,A.scrollTop=t},jC=":before",Av=":after",zo="___html2canvas___pseudoelement_before",Go="___html2canvas___pseudoelement_after",xu=`{
5
+ `):" "+Yl(n[0]):"as no adapter specified";throw new TA("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i}const jl={getAdapter:J0,adapters:In};function Mn(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Sr(null,r)}function ql(r){return Mn(r),r.headers=Ee.from(r.headers),r.data=Ln.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),jl.getAdapter(r.adapter||xr.adapter,r)(r).then(function(t){return Mn(r),t.data=Ln.call(r,r.transformResponse,t),t.headers=Ee.from(t.headers),t},function(t){return Ol(t)||(Mn(r),t&&t.response&&(t.response.data=Ln.call(r,r.transformResponse,t.response),t.response.headers=Ee.from(t.response.headers))),Promise.reject(t)})}const Ac="1.13.5",Li={};["object","boolean","number","function","string","symbol"].forEach((r,A)=>{Li[r]=function(t){return typeof t===r||"a"+(A<1?"n ":" ")+r}});const ec={};Li.transitional=function(A,e,t){function i(s,n){return"[Axios v"+Ac+"] Transitional option '"+s+"'"+n+(t?". "+t:"")}return(s,n,o)=>{if(A===!1)throw new TA(i(n," has been removed"+(e?" in "+e:"")),TA.ERR_DEPRECATED);return e&&!ec[n]&&(ec[n]=!0,console.warn(i(n," has been deprecated since v"+e+" and will be removed in the near future"))),A?A(s,n,o):!0}},Li.spelling=function(A){return(e,t)=>(console.warn(`${t} is likely a misspelling of ${A}`),!0)};function Z0(r,A,e){if(typeof r!="object")throw new TA("options must be an object",TA.ERR_BAD_OPTION_VALUE);const t=Object.keys(r);let i=t.length;for(;i-- >0;){const s=t[i],n=A[s];if(n){const o=r[s],a=o===void 0||n(o,s,r);if(a!==!0)throw new TA("option "+s+" must be "+a,TA.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new TA("Unknown option "+s,TA.ERR_BAD_OPTION)}}const Ii={assertOptions:Z0,validators:Li},Oe=Ii.validators;let kt=class{constructor(A){this.defaults=A||{},this.interceptors={request:new Dl,response:new Dl}}async request(A,e){try{return await this._request(A,e)}catch(t){if(t instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{t.stack?s&&!String(t.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(t.stack+=`
6
+ `+s):t.stack=s}catch{}}throw t}}_request(A,e){typeof A=="string"?(e=e||{},e.url=A):e=A||{},e=_t(this.defaults,e);const{transitional:t,paramsSerializer:i,headers:s}=e;t!==void 0&&Ii.assertOptions(t,{silentJSONParsing:Oe.transitional(Oe.boolean),forcedJSONParsing:Oe.transitional(Oe.boolean),clarifyTimeoutError:Oe.transitional(Oe.boolean),legacyInterceptorReqResOrdering:Oe.transitional(Oe.boolean)},!1),i!=null&&(V.isFunction(i)?e.paramsSerializer={serialize:i}:Ii.assertOptions(i,{encode:Oe.function,serialize:Oe.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ii.assertOptions(e,{baseUrl:Oe.spelling("baseURL"),withXsrfToken:Oe.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let n=s&&V.merge(s.common,s[e.method]);s&&V.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),e.headers=Ee.concat(n,s);const o=[];let a=!0;this.interceptors.request.forEach(function(f){if(typeof f.runWhen=="function"&&f.runWhen(e)===!1)return;a=a&&f.synchronous;const w=e.transitional||xn;w&&w.legacyInterceptorReqResOrdering?o.unshift(f.fulfilled,f.rejected):o.push(f.fulfilled,f.rejected)});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let c,u=0,d;if(!a){const p=[ql.bind(this),void 0];for(p.unshift(...o),p.push(...l),d=p.length,c=Promise.resolve(e);u<d;)c=c.then(p[u++],p[u++]);return c}d=o.length;let B=e;for(;u<d;){const p=o[u++],f=o[u++];try{B=p(B)}catch(w){f.call(this,w);break}}try{c=ql.call(this,B)}catch(p){return Promise.reject(p)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(A){A=_t(this.defaults,A);const e=Pl(A.baseURL,A.url,A.allowAbsoluteUrls);return Ml(e,A.params,A.paramsSerializer)}};V.forEach(["delete","get","head","options"],function(A){kt.prototype[A]=function(e,t){return this.request(_t(t||{},{method:A,url:e,data:(t||{}).data}))}}),V.forEach(["post","put","patch"],function(A){function e(t){return function(s,n,o){return this.request(_t(o||{},{method:A,headers:t?{"Content-Type":"multipart/form-data"}:{},url:s,data:n}))}}kt.prototype[A]=e(),kt.prototype[A+"Form"]=e(!0)});let Y0=class qu{constructor(A){if(typeof A!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(s){e=s});const t=this;this.promise.then(i=>{if(!t._listeners)return;let s=t._listeners.length;for(;s-- >0;)t._listeners[s](i);t._listeners=null}),this.promise.then=i=>{let s;const n=new Promise(o=>{t.subscribe(o),s=o}).then(i);return n.cancel=function(){t.unsubscribe(s)},n},A(function(s,n,o){t.reason||(t.reason=new Sr(s,n,o),e(t.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(A){if(this.reason){A(this.reason);return}this._listeners?this._listeners.push(A):this._listeners=[A]}unsubscribe(A){if(!this._listeners)return;const e=this._listeners.indexOf(A);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const A=new AbortController,e=t=>{A.abort(t)};return this.subscribe(e),A.signal.unsubscribe=()=>this.unsubscribe(e),A.signal}static source(){let A;return{token:new qu(function(i){A=i}),cancel:A}}};function j0(r){return function(e){return r.apply(null,e)}}function q0(r){return V.isObject(r)&&r.isAxiosError===!0}const Dn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Dn).forEach(([r,A])=>{Dn[A]=r});function tc(r){const A=new kt(r),e=vl(kt.prototype.request,A);return V.extend(e,kt.prototype,A,{allOwnKeys:!0}),V.extend(e,A,null,{allOwnKeys:!0}),e.create=function(i){return tc(_t(r,i))},e}const $A=tc(xr);$A.Axios=kt,$A.CanceledError=Sr,$A.CancelToken=Y0,$A.isCancel=Ol,$A.VERSION=Ac,$A.toFormData=xi,$A.AxiosError=TA,$A.Cancel=$A.CanceledError,$A.all=function(A){return Promise.all(A)},$A.spread=j0,$A.isAxiosError=q0,$A.mergeConfig=_t,$A.AxiosHeaders=Ee,$A.formToJSON=r=>_l(V.isHTMLForm(r)?new FormData(r):r),$A.getAdapter=jl.getAdapter,$A.HttpStatusCode=Dn,$A.default=$A;const{Axios:Fb,AxiosError:Ub,CanceledError:Eb,isCancel:xb,CancelToken:Tb,VERSION:Sb,all:Hb,Cancel:Lb,isAxiosError:Ib,spread:Mb,toFormData:Db,AxiosHeaders:_b,HttpStatusCode:kb,formToJSON:Ob,getAdapter:Nb,mergeConfig:Kb}=$A,je=Object.create(null);je.open="0",je.close="1",je.ping="2",je.pong="3",je.message="4",je.upgrade="5",je.noop="6";const Mi=Object.create(null);Object.keys(je).forEach(r=>{Mi[je[r]]=r});const _n={type:"error",data:"parser error"},rc=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ic=typeof ArrayBuffer=="function",sc=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,kn=({type:r,data:A},e,t)=>rc&&A instanceof Blob?e?t(A):nc(A,t):ic&&(A instanceof ArrayBuffer||sc(A))?e?t(A):nc(new Blob([A]),t):t(je[r]+(A||"")),nc=(r,A)=>{const e=new FileReader;return e.onload=function(){const t=e.result.split(",")[1];A("b"+(t||""))},e.readAsDataURL(r)};function oc(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let On;function Ag(r,A){if(rc&&r.data instanceof Blob)return r.data.arrayBuffer().then(oc).then(A);if(ic&&(r.data instanceof ArrayBuffer||sc(r.data)))return A(oc(r.data));kn(r,!1,e=>{On||(On=new TextEncoder),A(On.encode(e))})}const ac="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<ac.length;r++)Hr[ac.charCodeAt(r)]=r;const eg=r=>{let A=r.length*.75,e=r.length,t,i=0,s,n,o,a;r[r.length-1]==="="&&(A--,r[r.length-2]==="="&&A--);const l=new ArrayBuffer(A),c=new Uint8Array(l);for(t=0;t<e;t+=4)s=Hr[r.charCodeAt(t)],n=Hr[r.charCodeAt(t+1)],o=Hr[r.charCodeAt(t+2)],a=Hr[r.charCodeAt(t+3)],c[i++]=s<<2|n>>4,c[i++]=(n&15)<<4|o>>2,c[i++]=(o&3)<<6|a&63;return l},tg=typeof ArrayBuffer=="function",Nn=(r,A)=>{if(typeof r!="string")return{type:"message",data:lc(r,A)};const e=r.charAt(0);return e==="b"?{type:"message",data:rg(r.substring(1),A)}:Mi[e]?r.length>1?{type:Mi[e],data:r.substring(1)}:{type:Mi[e]}:_n},rg=(r,A)=>{if(tg){const e=eg(r);return lc(e,A)}else return{base64:!0,data:r}},lc=(r,A)=>A==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,cc="",ig=(r,A)=>{const e=r.length,t=new Array(e);let i=0;r.forEach((s,n)=>{kn(s,!1,o=>{t[n]=o,++i===e&&A(t.join(cc))})})},sg=(r,A)=>{const e=r.split(cc),t=[];for(let i=0;i<e.length;i++){const s=Nn(e[i],A);if(t.push(s),s.type==="error")break}return t};function ng(){return new TransformStream({transform(r,A){Ag(r,e=>{const t=e.length;let i;if(t<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,t);else if(t<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,t)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(t))}r.data&&typeof r.data!="string"&&(i[0]|=128),A.enqueue(i),A.enqueue(e)})}})}let Kn;function Di(r){return r.reduce((A,e)=>A+e.length,0)}function _i(r,A){if(r[0].length===A)return r.shift();const e=new Uint8Array(A);let t=0;for(let i=0;i<A;i++)e[i]=r[0][t++],t===r[0].length&&(r.shift(),t=0);return r.length&&t<r[0].length&&(r[0]=r[0].slice(t)),e}function og(r,A){Kn||(Kn=new TextDecoder);const e=[];let t=0,i=-1,s=!1;return new TransformStream({transform(n,o){for(e.push(n);;){if(t===0){if(Di(e)<1)break;const a=_i(e,1);s=(a[0]&128)===128,i=a[0]&127,i<126?t=3:i===126?t=1:t=2}else if(t===1){if(Di(e)<2)break;const a=_i(e,2);i=new DataView(a.buffer,a.byteOffset,a.length).getUint16(0),t=3}else if(t===2){if(Di(e)<8)break;const a=_i(e,8),l=new DataView(a.buffer,a.byteOffset,a.length),c=l.getUint32(0);if(c>Math.pow(2,21)-1){o.enqueue(_n);break}i=c*Math.pow(2,32)+l.getUint32(4),t=3}else{if(Di(e)<i)break;const a=_i(e,i);o.enqueue(Nn(s?a:Kn.decode(a),A)),t=0}if(i===0||i>r){o.enqueue(_n);break}}}})}const hc=4;function ie(r){if(r)return ag(r)}function ag(r){for(var A in ie.prototype)r[A]=ie.prototype[A];return r}ie.prototype.on=ie.prototype.addEventListener=function(r,A){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(A),this},ie.prototype.once=function(r,A){function e(){this.off(r,e),A.apply(this,arguments)}return e.fn=A,this.on(r,e),this},ie.prototype.off=ie.prototype.removeListener=ie.prototype.removeAllListeners=ie.prototype.removeEventListener=function(r,A){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var e=this._callbacks["$"+r];if(!e)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var t,i=0;i<e.length;i++)if(t=e[i],t===A||t.fn===A){e.splice(i,1);break}return e.length===0&&delete this._callbacks["$"+r],this},ie.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var A=new Array(arguments.length-1),e=this._callbacks["$"+r],t=1;t<arguments.length;t++)A[t-1]=arguments[t];if(e){e=e.slice(0);for(var t=0,i=e.length;t<i;++t)e[t].apply(this,A)}return this},ie.prototype.emitReserved=ie.prototype.emit,ie.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]},ie.prototype.hasListeners=function(r){return!!this.listeners(r).length};const ki=typeof Promise=="function"&&typeof Promise.resolve=="function"?A=>Promise.resolve().then(A):(A,e)=>e(A,0),Ne=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),lg="arraybuffer";function Vb(){}function uc(r,...A){return A.reduce((e,t)=>(r.hasOwnProperty(t)&&(e[t]=r[t]),e),{})}const cg=Ne.setTimeout,hg=Ne.clearTimeout;function Oi(r,A){A.useNativeTimers?(r.setTimeoutFn=cg.bind(Ne),r.clearTimeoutFn=hg.bind(Ne)):(r.setTimeoutFn=Ne.setTimeout.bind(Ne),r.clearTimeoutFn=Ne.clearTimeout.bind(Ne))}const ug=1.33;function dg(r){return typeof r=="string"?fg(r):Math.ceil((r.byteLength||r.size)*ug)}function fg(r){let A=0,e=0;for(let t=0,i=r.length;t<i;t++)A=r.charCodeAt(t),A<128?e+=1:A<2048?e+=2:A<55296||A>=57344?e+=3:(t++,e+=4);return e}function dc(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function pg(r){let A="";for(let e in r)r.hasOwnProperty(e)&&(A.length&&(A+="&"),A+=encodeURIComponent(e)+"="+encodeURIComponent(r[e]));return A}function gg(r){let A={},e=r.split("&");for(let t=0,i=e.length;t<i;t++){let s=e[t].split("=");A[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return A}class Bg extends Error{constructor(A,e,t){super(A),this.description=e,this.context=t,this.type="TransportError"}}class Vn extends ie{constructor(A){super(),this.writable=!1,Oi(this,A),this.opts=A,this.query=A.query,this.socket=A.socket,this.supportsBinary=!A.forceBase64}onError(A,e,t){return super.emitReserved("error",new Bg(A,e,t)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(A){this.readyState==="open"&&this.write(A)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(A){const e=Nn(A,this.socket.binaryType);this.onPacket(e)}onPacket(A){super.emitReserved("packet",A)}onClose(A){this.readyState="closed",super.emitReserved("close",A)}pause(A){}createUri(A,e={}){return A+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){const A=this.opts.hostname;return A.indexOf(":")===-1?A:"["+A+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(A){const e=pg(A);return e.length?"?"+e:""}}class wg extends Vn{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(A){this.readyState="pausing";const e=()=>{this.readyState="paused",A()};if(this._polling||!this.writable){let t=0;this._polling&&(t++,this.once("pollComplete",function(){--t||e()})),this.writable||(t++,this.once("drain",function(){--t||e()}))}else e()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(A){const e=t=>{if(this.readyState==="opening"&&t.type==="open"&&this.onOpen(),t.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)};sg(A,this.socket.binaryType).forEach(e),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const A=()=>{this.write([{type:"close"}])};this.readyState==="open"?A():this.once("open",A)}write(A){this.writable=!1,ig(A,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const A=this.opts.secure?"https":"http",e=this.query||{};return this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=dc()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.createUri(A,e)}}let fc=!1;try{fc=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const mg=fc;function Cg(){}class vg extends wg{constructor(A){if(super(A),typeof location<"u"){const e=location.protocol==="https:";let t=location.port;t||(t=e?"443":"80"),this.xd=typeof location<"u"&&A.hostname!==location.hostname||t!==A.port}}doWrite(A,e){const t=this.request({method:"POST",data:A});t.on("success",e),t.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const A=this.request();A.on("data",this.onData.bind(this)),A.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=A}}class qe extends ie{constructor(A,e,t){super(),this.createRequest=A,Oi(this,t),this._opts=t,this._method=t.method||"GET",this._uri=e,this._data=t.data!==void 0?t.data:null,this._create()}_create(){var A;const e=uc(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;const t=this._xhr=this.createRequest(e);try{t.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{t.setRequestHeader("Accept","*/*")}catch{}(A=this._opts.cookieJar)===null||A===void 0||A.addCookies(t),"withCredentials"in t&&(t.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(t.timeout=this._opts.requestTimeout),t.onreadystatechange=()=>{var i;t.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(t.getResponseHeader("set-cookie"))),t.readyState===4&&(t.status===200||t.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof t.status=="number"?t.status:0)},0))},t.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=qe.requestsCount++,qe.requests[this._index]=this)}_onError(A){this.emitReserved("error",A,this._xhr),this._cleanup(!0)}_cleanup(A){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Cg,A)try{this._xhr.abort()}catch{}typeof document<"u"&&delete qe.requests[this._index],this._xhr=null}}_onLoad(){const A=this._xhr.responseText;A!==null&&(this.emitReserved("data",A),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(qe.requestsCount=0,qe.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",pc);else if(typeof addEventListener=="function"){const r="onpagehide"in Ne?"pagehide":"unload";addEventListener(r,pc,!1)}}function pc(){for(let r in qe.requests)qe.requests.hasOwnProperty(r)&&qe.requests[r].abort()}const bg=(function(){const r=gc({xdomain:!1});return r&&r.responseType!==null})();class yg extends vg{constructor(A){super(A);const e=A&&A.forceBase64;this.supportsBinary=bg&&!e}request(A={}){return Object.assign(A,{xd:this.xd},this.opts),new qe(gc,this.uri(),A)}}function gc(r){const A=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!A||mg))return new XMLHttpRequest}catch{}if(!A)try{return new Ne[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Bc=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Qg extends Vn{get name(){return"websocket"}doOpen(){const A=this.uri(),e=this.opts.protocols,t=Bc?{}:uc(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(t.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(A,e,t)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=A=>this.onClose({description:"websocket connection closed",context:A}),this.ws.onmessage=A=>this.onData(A.data),this.ws.onerror=A=>this.onError("websocket error",A)}write(A){this.writable=!1;for(let e=0;e<A.length;e++){const t=A[e],i=e===A.length-1;kn(t,this.supportsBinary,s=>{try{this.doWrite(t,s)}catch{}i&&ki(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const A=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=dc()),this.supportsBinary||(e.b64=1),this.createUri(A,e)}}const Pn=Ne.WebSocket||Ne.MozWebSocket;class Fg extends Qg{createSocket(A,e,t){return Bc?new Pn(A,e,t):e?new Pn(A,e):new Pn(A)}doWrite(A,e){this.ws.send(e)}}class Ug extends Vn{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(A){return this.emitReserved("error",A)}this._transport.closed.then(()=>{this.onClose()}).catch(A=>{this.onError("webtransport error",A)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(A=>{const e=og(Number.MAX_SAFE_INTEGER,this.socket.binaryType),t=A.readable.pipeThrough(e).getReader(),i=ng();i.readable.pipeTo(A.writable),this._writer=i.writable.getWriter();const s=()=>{t.read().then(({done:o,value:a})=>{o||(this.onPacket(a),s())}).catch(o=>{})};s();const n={type:"open"};this.query.sid&&(n.data=`{"sid":"${this.query.sid}"}`),this._writer.write(n).then(()=>this.onOpen())})})}write(A){this.writable=!1;for(let e=0;e<A.length;e++){const t=A[e],i=e===A.length-1;this._writer.write(t).then(()=>{i&&ki(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var A;(A=this._transport)===null||A===void 0||A.close()}}const Eg={websocket:Fg,webtransport:Ug,polling:yg},xg=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Tg=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zn(r){if(r.length>8e3)throw"URI too long";const A=r,e=r.indexOf("["),t=r.indexOf("]");e!=-1&&t!=-1&&(r=r.substring(0,e)+r.substring(e,t).replace(/:/g,";")+r.substring(t,r.length));let i=xg.exec(r||""),s={},n=14;for(;n--;)s[Tg[n]]=i[n]||"";return e!=-1&&t!=-1&&(s.source=A,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=Sg(s,s.path),s.queryKey=Hg(s,s.query),s}function Sg(r,A){const e=/\/{2,9}/g,t=A.replace(e,"/").split("/");return(A.slice(0,1)=="/"||A.length===0)&&t.splice(0,1),A.slice(-1)=="/"&&t.splice(t.length-1,1),t}function Hg(r,A){const e={};return A.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,i,s){i&&(e[i]=s)}),e}const Gn=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ni=[];Gn&&addEventListener("offline",()=>{Ni.forEach(r=>r())},!1);class mt extends ie{constructor(A,e){if(super(),this.binaryType=lg,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,A&&typeof A=="object"&&(e=A,A=null),A){const t=zn(A);e.hostname=t.host,e.secure=t.protocol==="https"||t.protocol==="wss",e.port=t.port,t.query&&(e.query=t.query)}else e.host&&(e.hostname=zn(e.host).host);Oi(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(t=>{const i=t.prototype.name;this.transports.push(i),this._transportsByName[i]=t}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=gg(this.opts.query)),Gn&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ni.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(A){const e=Object.assign({},this.opts.query);e.EIO=hc,e.transport=A,this.id&&(e.sid=this.id);const t=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[A]);return new this._transportsByName[A](t)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const A=this.opts.rememberUpgrade&&mt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const e=this.createTransport(A);e.open(),this.setTransport(e)}setTransport(A){this.transport&&this.transport.removeAllListeners(),this.transport=A,A.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",mt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(A){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",A),this.emitReserved("heartbeat"),A.type){case"open":this.onHandshake(JSON.parse(A.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const e=new Error("server error");e.code=A.data,this._onError(e);break;case"message":this.emitReserved("data",A.data),this.emitReserved("message",A.data);break}}onHandshake(A){this.emitReserved("handshake",A),this.id=A.sid,this.transport.query.sid=A.sid,this._pingInterval=A.pingInterval,this._pingTimeout=A.pingTimeout,this._maxPayload=A.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const A=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+A,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},A),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const A=this._getWritablePackets();this.transport.send(A),this._prevBufferLen=A.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const i=this.writeBuffer[t].data;if(i&&(e+=dg(i)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const A=Date.now()>this._pingTimeoutTime;return A&&(this._pingTimeoutTime=0,ki(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),A}write(A,e,t){return this._sendPacket("message",A,e,t),this}send(A,e,t){return this._sendPacket("message",A,e,t),this}_sendPacket(A,e,t,i){if(typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=null),this.readyState==="closing"||this.readyState==="closed")return;t=t||{},t.compress=t.compress!==!1;const s={type:A,data:e,options:t};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const A=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),A()},t=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?t():A()}):this.upgrading?t():A()),this}_onError(A){if(mt.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",A),this._onClose("transport error",A)}_onClose(A,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Gn&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const t=Ni.indexOf(this._offlineEventListener);t!==-1&&Ni.splice(t,1)}this.readyState="closed",this.id=null,this.emitReserved("close",A,e),this.writeBuffer=[],this._prevBufferLen=0}}}mt.protocol=hc;class Lg extends mt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let A=0;A<this._upgrades.length;A++)this._probe(this._upgrades[A])}_probe(A){let e=this.createTransport(A),t=!1;mt.priorWebsocketSuccess=!1;const i=()=>{t||(e.send([{type:"ping",data:"probe"}]),e.once("packet",u=>{if(!t)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;mt.priorWebsocketSuccess=e.name==="websocket",this.transport.pause(()=>{t||this.readyState!=="closed"&&(c(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=e.name,this.emitReserved("upgradeError",d)}}))};function s(){t||(t=!0,c(),e.close(),e=null)}const n=u=>{const d=new Error("probe error: "+u);d.transport=e.name,s(),this.emitReserved("upgradeError",d)};function o(){n("transport closed")}function a(){n("socket closed")}function l(u){e&&u.name!==e.name&&s()}const c=()=>{e.removeListener("open",i),e.removeListener("error",n),e.removeListener("close",o),this.off("close",a),this.off("upgrading",l)};e.once("open",i),e.once("error",n),e.once("close",o),this.once("close",a),this.once("upgrading",l),this._upgrades.indexOf("webtransport")!==-1&&A!=="webtransport"?this.setTimeoutFn(()=>{t||e.open()},200):e.open()}onHandshake(A){this._upgrades=this._filterUpgrades(A.upgrades),super.onHandshake(A)}_filterUpgrades(A){const e=[];for(let t=0;t<A.length;t++)~this.transports.indexOf(A[t])&&e.push(A[t]);return e}}let Ig=class extends Lg{constructor(A,e={}){const t=typeof A=="object"?A:e;(!t.transports||t.transports&&typeof t.transports[0]=="string")&&(t.transports=(t.transports||["polling","websocket","webtransport"]).map(i=>Eg[i]).filter(i=>!!i)),super(A,t)}};function Mg(r,A="",e){let t=r;e=e||typeof location<"u"&&location,r==null&&(r=e.protocol+"//"+e.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=e.protocol+r:r=e.host+r),/^(https?|wss?):\/\//.test(r)||(typeof e<"u"?r=e.protocol+"//"+r:r="https://"+r),t=zn(r)),t.port||(/^(http|ws)$/.test(t.protocol)?t.port="80":/^(http|ws)s$/.test(t.protocol)&&(t.port="443")),t.path=t.path||"/";const s=t.host.indexOf(":")!==-1?"["+t.host+"]":t.host;return t.id=t.protocol+"://"+s+":"+t.port+A,t.href=t.protocol+"://"+s+(e&&e.port===t.port?"":":"+t.port),t}const Dg=typeof ArrayBuffer=="function",_g=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,wc=Object.prototype.toString,kg=typeof Blob=="function"||typeof Blob<"u"&&wc.call(Blob)==="[object BlobConstructor]",Og=typeof File=="function"||typeof File<"u"&&wc.call(File)==="[object FileConstructor]";function Rn(r){return Dg&&(r instanceof ArrayBuffer||_g(r))||kg&&r instanceof Blob||Og&&r instanceof File}function Ki(r,A){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let e=0,t=r.length;e<t;e++)if(Ki(r[e]))return!0;return!1}if(Rn(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return Ki(r.toJSON(),!0);for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&Ki(r[e]))return!0;return!1}function Ng(r){const A=[],e=r.data,t=r;return t.data=Wn(e,A),t.attachments=A.length,{packet:t,buffers:A}}function Wn(r,A){if(!r)return r;if(Rn(r)){const e={_placeholder:!0,num:A.length};return A.push(r),e}else if(Array.isArray(r)){const e=new Array(r.length);for(let t=0;t<r.length;t++)e[t]=Wn(r[t],A);return e}else if(typeof r=="object"&&!(r instanceof Date)){const e={};for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=Wn(r[t],A));return e}return r}function Kg(r,A){return r.data=$n(r.data,A),delete r.attachments,r}function $n(r,A){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<A.length)return A[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=$n(r[e],A);else if(typeof r=="object")for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=$n(r[e],A));return r}const Vg=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var NA;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(NA||(NA={}));class Pg{constructor(A){this.replacer=A}encode(A){return(A.type===NA.EVENT||A.type===NA.ACK)&&Ki(A)?this.encodeAsBinary({type:A.type===NA.EVENT?NA.BINARY_EVENT:NA.BINARY_ACK,nsp:A.nsp,data:A.data,id:A.id}):[this.encodeAsString(A)]}encodeAsString(A){let e=""+A.type;return(A.type===NA.BINARY_EVENT||A.type===NA.BINARY_ACK)&&(e+=A.attachments+"-"),A.nsp&&A.nsp!=="/"&&(e+=A.nsp+","),A.id!=null&&(e+=A.id),A.data!=null&&(e+=JSON.stringify(A.data,this.replacer)),e}encodeAsBinary(A){const e=Ng(A),t=this.encodeAsString(e.packet),i=e.buffers;return i.unshift(t),i}}class Xn extends ie{constructor(A){super(),this.reviver=A}add(A){let e;if(typeof A=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(A);const t=e.type===NA.BINARY_EVENT;t||e.type===NA.BINARY_ACK?(e.type=t?NA.EVENT:NA.ACK,this.reconstructor=new zg(e),e.attachments===0&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else if(Rn(A)||A.base64)if(this.reconstructor)e=this.reconstructor.takeBinaryData(A),e&&(this.reconstructor=null,super.emitReserved("decoded",e));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+A)}decodeString(A){let e=0;const t={type:Number(A.charAt(0))};if(NA[t.type]===void 0)throw new Error("unknown packet type "+t.type);if(t.type===NA.BINARY_EVENT||t.type===NA.BINARY_ACK){const s=e+1;for(;A.charAt(++e)!=="-"&&e!=A.length;);const n=A.substring(s,e);if(n!=Number(n)||A.charAt(e)!=="-")throw new Error("Illegal attachments");t.attachments=Number(n)}if(A.charAt(e+1)==="/"){const s=e+1;for(;++e&&!(A.charAt(e)===","||e===A.length););t.nsp=A.substring(s,e)}else t.nsp="/";const i=A.charAt(e+1);if(i!==""&&Number(i)==i){const s=e+1;for(;++e;){const n=A.charAt(e);if(n==null||Number(n)!=n){--e;break}if(e===A.length)break}t.id=Number(A.substring(s,e+1))}if(A.charAt(++e)){const s=this.tryParse(A.substr(e));if(Xn.isPayloadValid(t.type,s))t.data=s;else throw new Error("invalid payload")}return t}tryParse(A){try{return JSON.parse(A,this.reviver)}catch{return!1}}static isPayloadValid(A,e){switch(A){case NA.CONNECT:return mc(e);case NA.DISCONNECT:return e===void 0;case NA.CONNECT_ERROR:return typeof e=="string"||mc(e);case NA.EVENT:case NA.BINARY_EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Vg.indexOf(e[0])===-1);case NA.ACK:case NA.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class zg{constructor(A){this.packet=A,this.buffers=[],this.reconPack=A}takeBinaryData(A){if(this.buffers.push(A),this.buffers.length===this.reconPack.attachments){const e=Kg(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function mc(r){return Object.prototype.toString.call(r)==="[object Object]"}const Gg=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Xn,Encoder:Pg,get PacketType(){return NA}},Symbol.toStringTag,{value:"Module"}));function $e(r,A,e){return r.on(A,e),function(){r.off(A,e)}}const Rg=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Cc extends ie{constructor(A,e,t){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=A,this.nsp=e,t&&t.auth&&(this.auth=t.auth),this._opts=Object.assign({},t),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const A=this.io;this.subs=[$e(A,"open",this.onopen.bind(this)),$e(A,"packet",this.onpacket.bind(this)),$e(A,"error",this.onerror.bind(this)),$e(A,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...A){return A.unshift("message"),this.emit.apply(this,A),this}emit(A,...e){var t,i,s;if(Rg.hasOwnProperty(A))throw new Error('"'+A.toString()+'" is a reserved event name');if(e.unshift(A),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const n={type:NA.EVENT,data:e};if(n.options={},n.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){const c=this.ids++,u=e.pop();this._registerAckCallback(c,u),n.id=c}const o=(i=(t=this.io.engine)===null||t===void 0?void 0:t.transport)===null||i===void 0?void 0:i.writable,a=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!o||(a?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(A,e){var t;const i=(t=this.flags.timeout)!==null&&t!==void 0?t:this._opts.ackTimeout;if(i===void 0){this.acks[A]=e;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[A];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===A&&this.sendBuffer.splice(o,1);e.call(this,new Error("operation has timed out"))},i),n=(...o)=>{this.io.clearTimeoutFn(s),e.apply(this,o)};n.withError=!0,this.acks[A]=n}emitWithAck(A,...e){return new Promise((t,i)=>{const s=(n,o)=>n?i(n):t(o);s.withError=!0,e.push(s),this.emit(A,...e)})}_addToQueue(A){let e;typeof A[A.length-1]=="function"&&(e=A.pop());const t={id:this._queueSeq++,tryCount:0,pending:!1,args:A,flags:Object.assign({fromQueue:!0},this.flags)};A.push((i,...s)=>(this._queue[0],i!==null?t.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(i)):(this._queue.shift(),e&&e(null,...s)),t.pending=!1,this._drainQueue())),this._queue.push(t),this._drainQueue()}_drainQueue(A=!1){if(!this.connected||this._queue.length===0)return;const e=this._queue[0];e.pending&&!A||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(A){A.nsp=this.nsp,this.io._packet(A)}onopen(){typeof this.auth=="function"?this.auth(A=>{this._sendConnectPacket(A)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(A){this.packet({type:NA.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},A):A})}onerror(A){this.connected||this.emitReserved("connect_error",A)}onclose(A,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",A,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(A=>{if(!this.sendBuffer.some(t=>String(t.id)===A)){const t=this.acks[A];delete this.acks[A],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(A){if(A.nsp===this.nsp)switch(A.type){case NA.CONNECT:A.data&&A.data.sid?this.onconnect(A.data.sid,A.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case NA.EVENT:case NA.BINARY_EVENT:this.onevent(A);break;case NA.ACK:case NA.BINARY_ACK:this.onack(A);break;case NA.DISCONNECT:this.ondisconnect();break;case NA.CONNECT_ERROR:this.destroy();const t=new Error(A.data.message);t.data=A.data.data,this.emitReserved("connect_error",t);break}}onevent(A){const e=A.data||[];A.id!=null&&e.push(this.ack(A.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(A){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const t of e)t.apply(this,A)}super.emit.apply(this,A),this._pid&&A.length&&typeof A[A.length-1]=="string"&&(this._lastOffset=A[A.length-1])}ack(A){const e=this;let t=!1;return function(...i){t||(t=!0,e.packet({type:NA.ACK,id:A,data:i}))}}onack(A){const e=this.acks[A.id];typeof e=="function"&&(delete this.acks[A.id],e.withError&&A.data.unshift(null),e.apply(this,A.data))}onconnect(A,e){this.id=A,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(A=>this.emitEvent(A)),this.receiveBuffer=[],this.sendBuffer.forEach(A=>{this.notifyOutgoingListeners(A),this.packet(A)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(A=>A()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:NA.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(A){return this.flags.compress=A,this}get volatile(){return this.flags.volatile=!0,this}timeout(A){return this.flags.timeout=A,this}onAny(A){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(A),this}prependAny(A){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(A),this}offAny(A){if(!this._anyListeners)return this;if(A){const e=this._anyListeners;for(let t=0;t<e.length;t++)if(A===e[t])return e.splice(t,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(A){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(A),this}prependAnyOutgoing(A){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(A),this}offAnyOutgoing(A){if(!this._anyOutgoingListeners)return this;if(A){const e=this._anyOutgoingListeners;for(let t=0;t<e.length;t++)if(A===e[t])return e.splice(t,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(A){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const t of e)t.apply(this,A.data)}}}function qt(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}qt.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var A=Math.random(),e=Math.floor(A*this.jitter*r);r=(Math.floor(A*10)&1)==0?r-e:r+e}return Math.min(r,this.max)|0},qt.prototype.reset=function(){this.attempts=0},qt.prototype.setMin=function(r){this.ms=r},qt.prototype.setMax=function(r){this.max=r},qt.prototype.setJitter=function(r){this.jitter=r};class Jn extends ie{constructor(A,e){var t;super(),this.nsps={},this.subs=[],A&&typeof A=="object"&&(e=A,A=void 0),e=e||{},e.path=e.path||"/socket.io",this.opts=e,Oi(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((t=e.randomizationFactor)!==null&&t!==void 0?t:.5),this.backoff=new qt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=A;const i=e.parser||Gg;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(A){return arguments.length?(this._reconnection=!!A,A||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(A){return A===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=A,this)}reconnectionDelay(A){var e;return A===void 0?this._reconnectionDelay:(this._reconnectionDelay=A,(e=this.backoff)===null||e===void 0||e.setMin(A),this)}randomizationFactor(A){var e;return A===void 0?this._randomizationFactor:(this._randomizationFactor=A,(e=this.backoff)===null||e===void 0||e.setJitter(A),this)}reconnectionDelayMax(A){var e;return A===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=A,(e=this.backoff)===null||e===void 0||e.setMax(A),this)}timeout(A){return arguments.length?(this._timeout=A,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(A){if(~this._readyState.indexOf("open"))return this;this.engine=new Ig(this.uri,this.opts);const e=this.engine,t=this;this._readyState="opening",this.skipReconnect=!1;const i=$e(e,"open",function(){t.onopen(),A&&A()}),s=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),A?A(o):this.maybeReconnectOnOpen()},n=$e(e,"error",s);if(this._timeout!==!1){const o=this._timeout,a=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),e.close()},o);this.opts.autoUnref&&a.unref(),this.subs.push(()=>{this.clearTimeoutFn(a)})}return this.subs.push(i),this.subs.push(n),this}connect(A){return this.open(A)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const A=this.engine;this.subs.push($e(A,"ping",this.onping.bind(this)),$e(A,"data",this.ondata.bind(this)),$e(A,"error",this.onerror.bind(this)),$e(A,"close",this.onclose.bind(this)),$e(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(A){try{this.decoder.add(A)}catch(e){this.onclose("parse error",e)}}ondecoded(A){ki(()=>{this.emitReserved("packet",A)},this.setTimeoutFn)}onerror(A){this.emitReserved("error",A)}socket(A,e){let t=this.nsps[A];return t?this._autoConnect&&!t.active&&t.connect():(t=new Cc(this,A,e),this.nsps[A]=t),t}_destroy(A){const e=Object.keys(this.nsps);for(const t of e)if(this.nsps[t].active)return;this._close()}_packet(A){const e=this.encoder.encode(A);for(let t=0;t<e.length;t++)this.engine.write(e[t],A.options)}cleanup(){this.subs.forEach(A=>A()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(A,e){var t;this.cleanup(),(t=this.engine)===null||t===void 0||t.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",A,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const A=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const t=this.setTimeoutFn(()=>{A.skipReconnect||(this.emitReserved("reconnect_attempt",A.backoff.attempts),!A.skipReconnect&&A.open(i=>{i?(A._reconnecting=!1,A.reconnect(),this.emitReserved("reconnect_error",i)):A.onreconnect()}))},e);this.opts.autoUnref&&t.unref(),this.subs.push(()=>{this.clearTimeoutFn(t)})}}onreconnect(){const A=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",A)}}const Lr={};function Vi(r,A){typeof r=="object"&&(A=r,r=void 0),A=A||{};const e=Mg(r,A.path||"/socket.io"),t=e.source,i=e.id,s=e.path,n=Lr[i]&&s in Lr[i].nsps,o=A.forceNew||A["force new connection"]||A.multiplex===!1||n;let a;return o?a=new Jn(t,A):(Lr[i]||(Lr[i]=new Jn(t,A)),a=Lr[i]),e.query&&!A.query&&(A.query=e.queryKey),a.socket(e.path,A)}Object.assign(Vi,{Manager:Jn,Socket:Cc,io:Vi,connect:Vi});let xe="http://localhost:8000";function vc(r){if(!r){console.warn("⚠️ [SOCKET DEBUG] setBaseUrl called with empty URL");return}if(r!==xe){const A=xe;xe=r,console.log(`🔄 [SOCKET DEBUG] SocketService: Changing baseUrl from ${A} to ${r}`),jA&&(console.log("🔄 [SOCKET DEBUG] Disconnecting old socket..."),jA.disconnect(),jA.removeAllListeners(),jA=null)}else console.log(`✅ [SOCKET DEBUG] BaseUrl already set to ${r}, no change needed`)}let jA=null;function Wg(){const A=(()=>{try{return localStorage.getItem("token")||localStorage.getItem("authToken")||localStorage.getItem("accessToken")||localStorage.getItem("jwt_token")}catch{return null}})();console.log("🔧 [SOCKET DEBUG] Creating socket for MT5 backend:",{baseUrl:xe,hasToken:!!A,tokenLength:A?.length||0,note:"Connecting to MT5 backend WebSocket (root namespace for candles)"});const e=Vi(xe,{transports:["websocket","polling"],reconnection:!0,reconnectionDelay:1e3,reconnectionAttempts:10,timeout:15e3,forceNew:!1,withCredentials:!1,autoConnect:!0,upgrade:!1,auth:A?{token:A}:void 0});return e.on("connect",()=>{console.log("✅ [SOCKET DEBUG] SocketService: connected to ROOT namespace",{socketId:e.id,baseUrl:xe,transport:e.io.engine.transport.name,namespace:e.nsp.name||"/",note:"This socket connects to CandlesGateway (root namespace)"})}),e.on("disconnect",t=>{console.log("⚠️ [SOCKET DEBUG] SocketService: disconnected:",{reason:t,socketId:e.id})}),e.on("connect_error",t=>{console.error("❌ [SOCKET DEBUG] SocketService: connection error to ROOT namespace:",{message:t?.message,description:t?.description,context:t?.context,type:t?.type,baseUrl:xe,namespace:e.nsp.name||"/",note:"CandlesGateway requires JWT authentication - check if token is valid"})}),e.on("reconnect_attempt",t=>{console.log("🔄 [SOCKET DEBUG] SocketService: reconnect attempt",{attempt:t,baseUrl:xe})}),e.on("reconnect_failed",()=>{console.error("❌ [SOCKET DEBUG] SocketService: failed to reconnect",{baseUrl:xe})}),e.on("reconnect",t=>{console.log("✅ [SOCKET DEBUG] SocketService: reconnected after",{attempts:t,socketId:e.id})}),e}function Zn(){const r=jA?.io?.uri||jA?.io?.opts?.host||null;return!jA||jA.io&&r&&r!==xe?(jA&&(console.log("🔄 [SOCKET DEBUG] Recreating socket:",{oldUri:r,newBaseUrl:xe,wasConnected:jA.connected,reason:"baseUrl changed"}),jA.disconnect(),jA.removeAllListeners(),jA=null),console.log("🔧 [SOCKET DEBUG] Creating new socket instance for MT5 backend:",xe),jA=Wg()):jA.connected?console.log("✅ [SOCKET DEBUG] Reusing existing connected socket:",{socketId:jA.id,connected:jA.connected,baseUrl:xe,uri:r}):console.log("⏳ [SOCKET DEBUG] Socket exists but not connected, waiting...",{socketId:jA.id,baseUrl:xe}),jA}function $g(r,A){const e=Zn();return e.on(r,A),()=>e.off(r,A)}function Xg(r,A){jA&&jA.off(r,A)}function Jg(r,A){Zn().emit(r,A)}function Zg(){return jA?jA.connected?"connected":"connecting":"disconnected"}const Pi={getSocket:Zn,on:$g,off:Xg,emit:Jg,getStatus:Zg,setBaseUrl:vc},Yg={},bc=K.createContext(),ge=()=>{const r=K.useContext(bc);if(!r)throw new Error("useTrading must be used within TradingProvider");return r},jg=({children:r,baseUrl:A,endpoints:e,accountId:t})=>{const i=A??(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ns&&Ns.tagName.toUpperCase()==="SCRIPT"&&Ns.src||new URL("chart-sdk.umd.js",document.baseURI).href}<"u"&&Yg?.VITE_BASE_URL)??"http://localhost:8000",n={...{candles:"/api/chart/candles",symbols:"/symbols",trades:"/trades",account:"/api/user/account"},...e},o=e?.params||{},[a,l]=K.useState("BTCUSD"),[c,u]=K.useState("M1"),[d,B]=K.useState([]),[p,f]=K.useState(!0),[w,F]=K.useState([]),[C,E]=K.useState(!1),[U,S]=K.useState(1e5),[P,z]=K.useState(null),[J,N]=K.useState([]),[Z,W]=K.useState(!0),[aA,nA]=K.useState(!1),[cA,SA]=K.useState(!0),[CA,MA]=K.useState("candles"),[HA,UA]=K.useState(!1),[yA,vA]=K.useState("dark"),hA=K.useRef(null);K.useEffect(()=>{Pi.setBaseUrl(i)},[i]);const j=K.useRef(new Map),eA=K.useRef(null),QA=1e3,gA=K.useCallback(async()=>{if(!t){console.log("⚠️ No accountId, skipping orders fetch");return}try{const LA=localStorage.getItem("token");if(!LA){console.log("⚠️ No token, skipping orders fetch");return}E(!0);const KA=await $A.get(`${i}/trades/account/${t}`,{headers:{Authorization:`Bearer ${LA}`}});let fA=[];Array.isArray(KA.data)?fA=KA.data:KA.data?.data&&Array.isArray(KA.data.data)&&(fA=KA.data.data);const mA=fA.filter(BA=>BA.closePrice===null||BA.closePrice===void 0).map(BA=>({id:BA.id,ticket:BA.id?.substring(0,8),symbol:BA.symbol,type:BA.type,volume:BA.volume,price:BA.openPrice,stopLoss:BA.stopLoss,takeProfit:BA.takeProfit,comment:BA.comment||"",status:"OPEN",swap:0,profit:BA.profit||0,profitCurrency:"USD",time:new Date(BA.openedAt||BA.openAt||Date.now()).toLocaleTimeString(),openAt:BA.openedAt||BA.openAt,closeAt:BA.closedAt||BA.closeAt}));F(mA)}catch(LA){console.error("❌ Error fetching orders:",LA.response?.data||LA.message),F([])}finally{E(!1)}},[i,t]),EA=K.useCallback((LA,KA)=>!KA||!LA.price||isNaN(KA)||isNaN(LA.price)?LA.profit||0:(LA.type==="BUY"?KA-LA.price:LA.price-KA)*LA.volume,[]),XA=K.useCallback(async()=>{try{const LA=localStorage.getItem("token");if(!LA){console.log("⚠️ No token, skipping balance fetch");return}const KA=await $A.get(`${i}${n.account}`,{headers:{Authorization:`Bearer ${LA}`}});if(KA.data&&KA.data.data){const fA=parseFloat(KA.data.data.balance);isNaN(fA)||S(fA)}}catch(LA){console.error("❌ Error fetching user balance:",LA.response?.data||LA.message)}},[i]),zA=K.useMemo(()=>{const LA=U,KA=w.reduce((IA,FA)=>IA+FA.volume*FA.price*.01,0),fA=w.reduce((IA,FA)=>{const le=d.find(De=>De.symbol===FA.symbol);if(le){const De=FA.type==="BUY"?parseFloat(le.bid||0):parseFloat(le.ask||0);if(De&&De>0&&!isNaN(De))return IA+EA(FA,De)}return IA+(FA.profit||0)},0),mA=LA+fA,BA=mA-KA,uA=KA>0?mA/KA*100:0;return{balance:LA,equity:mA,margin:KA,freeMargin:BA,level:uA.toFixed(2)}},[w,d,U,EA]);K.useEffect(()=>{localStorage.getItem("token")&&t&&(gA(),XA())},[gA,XA,t]),K.useEffect(()=>{(async()=>{try{f(!0);const KA=n.symbols.includes("?")?`${i}${n.symbols}`:`${i}${n.symbols}`,fA=await $A.get(KA);let mA=[];Array.isArray(fA.data)?(console.log("1 console",fA.data),mA=fA.data):fA.data&&fA.data.data&&Array.isArray(fA.data.data)?(console.log("2 console",fA.data.data),mA=fA.data.data):fA.data&&fA.data.prices&&Array.isArray(fA.data.prices)?(console.log("3 console",fA.data.price),mA=fA.data.prices):fA.data&&Array.isArray(fA.data)&&(mA=fA.data,console.log("else format",fA.data));const BA=mA.map(uA=>uA.symbol&&(uA.bid!==void 0||uA.price!==void 0)?{symbol:uA.symbol,bid:uA.bid??uA.price??0,ask:uA.ask??uA.price??0,change:uA.change??0}:uA);BA.length>0?(B(BA),BA.find(IA=>IA.symbol===a)||l(BA[0].symbol)):B([])}catch(KA){console.error("❌ Error fetching symbols:",KA.response?.data||KA.message),B([])}finally{f(!1)}})()},[i,n.symbols]);const dt=K.useCallback(()=>{const LA=j.current;if(LA.size===0)return;const KA=new Map(LA);LA.clear(),B(fA=>fA.map(mA=>{const BA=KA.get(mA.symbol);return BA?{...mA,...BA}:mA})),F(fA=>{let mA=!1;const BA=fA.map(uA=>{const IA=KA.get(uA.symbol);if(!IA)return uA;const FA=uA.type==="BUY"?parseFloat(IA.bid||0):parseFloat(IA.ask||0);if(!FA||isNaN(FA)||FA<=0)return uA;const le=EA(uA,FA);return le===uA.profit?uA:(mA=!0,{...uA,profit:le})});return mA?BA:fA})},[EA]);K.useEffect(()=>{hA.current||(hA.current=Pi.getSocket());const LA=hA.current,KA=()=>console.log("✅ TradingContext: Connected"),fA=()=>console.log("⚠️ TradingContext: Disconnected"),mA=uA=>{uA?.symbol&&(j.current.set(uA.symbol,uA),eA.current||(eA.current=setTimeout(()=>{eA.current=null,dt()},QA)))},BA=async uA=>{if(console.log("🔔 Trade closed event received:",uA),!!uA){if(uA.newBalance!==void 0){const IA=parseFloat(uA.newBalance);isNaN(IA)||S(IA)}if(window.notify){const IA=uA.profitLoss||uA.profit||0,FA=IA>=0?`+${IA.toFixed(2)}`:IA.toFixed(2),le=uA.symbol||"Trade",De=uA.reason||"Closed";window.notify(`Trade Closed: ${De} | ${le} | P/L: ${FA} USD`,IA>=0?"success":"error")}uA.tradeId&&F(IA=>IA.filter(FA=>FA.id!==uA.tradeId)),await gA(),await XA()}};return LA.on("connect",KA),LA.on("disconnect",fA),LA.on("priceUpdate",mA),LA.on("tradeClosed",BA),()=>{LA.off("connect",KA),LA.off("disconnect",fA),LA.off("priceUpdate",mA),LA.off("tradeClosed",BA),eA.current&&(clearTimeout(eA.current),eA.current=null),j.current.clear()}},[dt,gA,XA]),K.useEffect(()=>{try{const LA=document.documentElement;if(!LA)return;LA.dataset.theme=yA}catch{}},[yA]);const ae=K.useMemo(()=>d.find(LA=>LA.symbol===a)||{bid:"0.00000",ask:"0.00000",change:0},[d,a]),ft=K.useMemo(()=>({selectedSymbol:a,setSelectedSymbol:l,selectedTimeframe:c,setSelectedTimeframe:u,symbols:d,setSymbols:B,symbolsLoading:p,orders:w,setOrders:F,ordersLoading:C,fetchOrders:gA,fetchUserBalance:XA,userBalance:U,setUserBalance:S,accountSummary:zA,currentSymbolData:ae,activeTool:P,setActiveTool:z,chartObjects:J,setChartObjects:N,showGrid:Z,setShowGrid:W,snapToGrid:aA,setSnapToGrid:nA,drawingsVisible:cA,setDrawingsVisible:SA,chartType:CA,setChartType:MA,chartLocked:HA,setChartLocked:UA,theme:yA,setTheme:vA,baseUrl:i,endpoints:n,endpointParams:o,accountId:t}),[a,c,d,p,w,C,gA,XA,U,zA,ae,P,J,Z,aA,cA,CA,HA,yA,i,n,o]);return h.jsx(bc.Provider,{value:ft,children:r})};var yc={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Qc=K.createContext&&K.createContext(yc),qg=["attr","size","title"];function AB(r,A){if(r==null)return{};var e=eB(r,A),t,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i<s.length;i++)t=s[i],!(A.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(e[t]=r[t])}return e}function eB(r,A){if(r==null)return{};var e={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){if(A.indexOf(t)>=0)continue;e[t]=r[t]}return e}function zi(){return zi=Object.assign?Object.assign.bind():function(r){for(var A=1;A<arguments.length;A++){var e=arguments[A];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},zi.apply(this,arguments)}function Fc(r,A){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);A&&(t=t.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),e.push.apply(e,t)}return e}function Gi(r){for(var A=1;A<arguments.length;A++){var e=arguments[A]!=null?arguments[A]:{};A%2?Fc(Object(e),!0).forEach(function(t){tB(r,t,e[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):Fc(Object(e)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))})}return r}function tB(r,A,e){return A=rB(A),A in r?Object.defineProperty(r,A,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[A]=e,r}function rB(r){var A=iB(r,"string");return typeof A=="symbol"?A:A+""}function iB(r,A){if(typeof r!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var t=e.call(r,A);if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(r)}function Uc(r){return r&&r.map((A,e)=>K.createElement(A.tag,Gi({key:e},A.attr),Uc(A.child)))}function Ir(r){return A=>K.createElement(sB,zi({attr:Gi({},r.attr)},A),Uc(r.child))}function sB(r){var A=e=>{var{attr:t,size:i,title:s}=r,n=AB(r,qg),o=i||e.size||"1em",a;return e.className&&(a=e.className),r.className&&(a=(a?a+" ":"")+r.className),K.createElement("svg",zi({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},e.attr,t,n,{className:a,style:Gi(Gi({color:r.color||e.color},e.style),r.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&K.createElement("title",null,s),r.children)};return Qc!==void 0?K.createElement(Qc.Consumer,null,e=>A(e)):A(yc)}function nB(r){return Ir({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z"},child:[]}]})(r)}function oB(r){return Ir({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M240.971 130.524l194.343 194.343c9.373 9.373 9.373 24.569 0 33.941l-22.667 22.667c-9.357 9.357-24.522 9.375-33.901.04L224 227.495 69.255 381.516c-9.379 9.335-24.544 9.317-33.901-.04l-22.667-22.667c-9.373-9.373-9.373-24.569 0-33.941L207.03 130.525c9.372-9.373 24.568-9.373 33.941-.001z"},child:[]}]})(r)}const Ec=({bidPrice:r,askPrice:A,onBuyClick:e,onSellClick:t})=>{const{theme:i}=ge(),s=i==="light",[n,o]=K.useState("0.01"),a=s?"bg-slate-100":"bg-[#12161d]",l=s?"text-slate-700":"text-white",c=s?"hover:bg-slate-200":"hover:bg-[#1e2635]",u=p=>{const f=parseFloat(n)||.01,w=Math.max(.01,f+p);o(w.toFixed(2))},d=()=>{e&&e({volume:parseFloat(n)})},B=()=>{t&&t({volume:parseFloat(n)})};return h.jsxs("div",{className:"flex items-stretch h-[30px] text-xs font-semibold select-none",children:[h.jsxs("button",{onClick:B,className:"flex items-stretch overflow-hidden",children:[h.jsx("span",{className:"flex items-center px-2.5 font-mono tabular-nums bg-[#BD3E3E] text-white",children:r||"—"}),h.jsx("span",{className:"flex items-center px-2.5 tracking-wide bg-[#DE4848] text-white",children:"SELL"})]}),h.jsxs("div",{className:`flex items-stretch ${a}`,children:[h.jsx("button",{type:"button",onClick:()=>u(-.01),className:`w-5 flex items-center justify-center ${l} ${c} transition-colors`,children:h.jsx(nB,{size:8})}),h.jsx("input",{type:"number",value:n,onChange:p=>{const f=p.target.value;(f===""||parseFloat(f)>=0)&&o(f)},onBlur:()=>{const p=parseFloat(n);o(isNaN(p)||p<.01?"0.01":p.toFixed(2))},className:`w-14 text-center focus:outline-none ${a} ${l}`,step:"0.01",min:"0.01",style:{MozAppearance:"textfield"}}),h.jsx("button",{type:"button",onClick:()=>u(.01),className:`w-5 flex items-center justify-center ${l} ${c} transition-colors`,children:h.jsx(oB,{size:8})})]}),h.jsxs("button",{onClick:d,className:"flex items-stretch overflow-hidden",children:[h.jsx("span",{className:"flex items-center px-2.5 tracking-wide bg-[#2869CE] text-white",children:"BUY"}),h.jsx("span",{className:"flex items-center px-2.5 font-mono tabular-nums bg-[#2F7CF2] text-white",children:A||"—"})]})]})},aB={},xc=({isOpen:r,onClose:A,orderType:e,bidPrice:t,askPrice:i,onExecuteTrade:s,userAccountId:n,initialVolume:o})=>{const{selectedSymbol:a,selectedTimeframe:l,setOrders:c,symbols:u,fetchOrders:d,theme:B,baseUrl:p,endpoints:f}=ge(),w=B==="light",[F,C]=K.useState("0.01"),[E,U]=K.useState(""),[S,P]=K.useState(""),[z,J]=K.useState(""),[N,Z]=K.useState(!1),[W,aA]=K.useState(null),[nA,cA]=K.useState(""),[SA,CA]=K.useState(e||"BUY"),[MA,HA]=K.useState(parseFloat(t)||0),[UA,yA]=K.useState(parseFloat(i)||0),[vA,hA]=K.useState("text-white"),[j,eA]=K.useState("text-white"),QA=K.useRef(parseFloat(t)||0),gA=K.useRef(parseFloat(i)||0);K.useEffect(()=>{if(!r)return;const fA=Pi.getSocket(),mA=uA=>{if(!(!uA||!uA.symbol)&&uA.symbol.toUpperCase()===a?.toUpperCase()){const IA=parseFloat(uA.bid)||0,FA=parseFloat(uA.ask)||0;IA>0&&(IA>QA.current?(hA("text-green-400"),setTimeout(()=>hA("text-white"),500)):IA<QA.current&&QA.current>0&&(hA("text-red-400"),setTimeout(()=>hA("text-white"),500)),HA(IA),QA.current=IA),FA>0&&(FA>gA.current?(eA("text-green-400"),setTimeout(()=>eA("text-white"),500)):FA<gA.current&&gA.current>0&&(eA("text-red-400"),setTimeout(()=>eA("text-white"),500)),yA(FA),gA.current=FA)}};fA.on("priceUpdate",mA);const BA=u.find(uA=>uA.symbol===a);if(BA){const uA=parseFloat(BA.bid)||0,IA=parseFloat(BA.ask)||0;uA>0&&(HA(uA),QA.current=uA),IA>0&&(yA(IA),gA.current=IA)}return()=>{fA.off("priceUpdate",mA)}},[r,a,u]),K.useEffect(()=>{if(r){C(o?String(o):"0.01"),U(""),P(""),J(""),cA(""),CA(e||"BUY");const fA=parseFloat(t)||0,mA=parseFloat(i)||0;fA>0&&(HA(fA),QA.current=fA),mA>0&&(yA(mA),gA.current=mA)}},[r,e,t,i,o]);const EA=MA||0,XA=UA||0,zA=fA=>{const mA=parseFloat(F)||.01,BA=Math.max(.01,mA+fA);C(BA.toFixed(2))},dt=fA=>{const mA=parseFloat(E)||0,BA=parseFloat(SA==="BUY"?UA:MA)||0;if(!BA){cA("Current price not available. Please wait...");return}let uA=mA+fA;SA==="BUY"?uA=Math.max(1e-5,Math.min(uA,BA-1e-5)):uA=Math.max(BA+1e-5,uA),U(uA>0?uA.toFixed(5):""),cA("")},ae=fA=>{const mA=parseFloat(S)||0,BA=parseFloat(SA==="BUY"?UA:MA)||0;if(!BA){cA("Current price not available. Please wait...");return}let uA=mA+fA;SA==="BUY"?uA=Math.max(BA+1e-5,uA):uA=Math.max(1e-5,Math.min(uA,BA-1e-5)),P(uA>0?uA.toFixed(5):""),cA("")},ft=async fA=>{cA("");const mA=fA||SA,BA=parseFloat(mA==="BUY"?UA:MA),uA=parseFloat(F),IA=E?parseFloat(E):null,FA=S?parseFloat(S):null;if(!uA||uA<=0||isNaN(uA)){cA("Please enter a valid volume (minimum 0.01)");return}if(uA<.01){cA("Volume must be at least 0.01");return}if(!BA||BA<=0||isNaN(BA)){cA("Invalid price. Please refresh and try again.");return}if(IA!==null&&IA!==""){if(isNaN(IA)||IA<=0){cA("Stop Loss must be a valid positive number");return}if(mA==="BUY"&&IA>=BA){cA("Stop Loss must be below the current price for BUY orders");return}if(mA==="SELL"&&IA<=BA){cA("Stop Loss must be above the current price for SELL orders");return}}if(FA!==null&&FA!==""){if(isNaN(FA)||FA<=0){cA("Take Profit must be a valid positive number");return}if(mA==="BUY"){if(FA<=BA){cA(`Take Profit must be above the entry price (${BA.toFixed(5)}) for BUY orders`);return}}else if(mA==="SELL"&&FA>=BA){cA(`Take Profit must be below the entry price (${BA.toFixed(5)}) for SELL orders`);return}}CA(mA),aA(mA),Z(!0);const le=new Date,De=le.toLocaleTimeString(),pt=`temp_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,ri=localStorage.getItem("token");if(!ri){cA("Please login to place trades"),Z(!1),aA(null);return}const Gt={accountId:n,symbol:a,type:mA,volume:uA,price:BA,takeProfit:FA,stopLoss:IA,comment:z.trim()||null},Os={ticket:pt.substring(0,8),symbol:a,type:mA,volume:parseFloat(uA),price:parseFloat(BA),time:De,stopLoss:IA?parseFloat(IA):null,takeProfit:FA?parseFloat(FA):null,swap:0,profit:0,profitCurrency:"USD",comment:z.trim()||"",id:pt,status:"OPEN",openAt:le.toISOString()};if(c&&c(gt=>[...gt,Os]),s){Z(!1),aA(null),A();const gt={symbol:a,type:mA,lotSize:uA,entryPrice:BA,stopLoss:IA,takeProfit:FA,comment:z.trim()||null};Promise.resolve(s(gt)).then(()=>{console.log("✅ Trade executed successfully via parent handler"),d&&d()}).catch(ii=>{console.error("❌ Trade execution failed:",ii),c&&c(Le=>Le.filter(ne=>ne.id!==pt))})}else{Z(!1),aA(null),A();const gt=p||aB?.VITE_BASE_URL||"http://localhost:8000",ii=f?.trades||"/api/trades";$A.post(`${gt}${ii}`,Gt,{headers:{Authorization:`Bearer ${ri}`,"Content-Type":"application/json"}}).then(Le=>{if(Le.data&&Le.data.data){const ne=Le.data.data.trade;c&&c(xA=>xA.map(qA=>qA.id===pt?{...qA,id:ne.id,ticket:ne.id.substring(0,8),time:De,openAt:ne.openAt}:qA)),console.log("✅ Trade saved successfully:",ne),window.notify&&window.notify(`Trade placed successfully: ${ne.symbol} ${ne.type}`,"success")}else{c&&c(xA=>xA.filter(qA=>qA.id!==pt));const ne=Le.data?.message||"Failed to place trade";window.notify&&window.notify(ne,"error")}}).catch(Le=>{console.error("Error placing trade:",Le),c&&c(xA=>xA.filter(qA=>qA.id!==pt));let ne="Failed to place trade";if(Le.response){const xA=Le.response.status,qA=Le.response.data;xA===400?ne=qA?.message||"Invalid trade data. Please check your inputs.":xA===401?ne="Authentication failed. Please login again.":xA===404?ne=qA?.message||"Symbol not found. Please select a valid symbol.":xA===500?ne="Server error. Please try again later.":ne=qA?.message||`Error: ${xA}`}else Le.request&&(ne="Network error. Please check your internet connection.");window.notify&&window.notify(ne,"error")})}},KA=((parseFloat(F)||0)*1e5).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});return r?h.jsxs("div",{className:`w-full flex flex-col pointer-events-auto z-30 h-full ${w?"bg-white border-r border-slate-300":"bg-[#12161d] border-r border-slate-700"}`,children:[h.jsxs("div",{className:`px-4 py-2.5 flex items-center justify-between border-b ${w?"border-slate-300 bg-white":"border-slate-700 bg-[#12161d]"}`,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h3",{className:`text-sm font-semibold ${w?"text-slate-800":"text-white"}`,children:"Market Execution"}),h.jsx("button",{className:`p-0.5 transition-colors ${w?"text-slate-600 hover:text-slate-800":"text-white hover:text-white"}`,children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),h.jsx("button",{onClick:A,className:`p-1 rounded transition-colors ${w?"text-slate-600 hover:text-slate-800 hover:bg-slate-100":"text-white hover:text-white hover:bg-[#12161d]"}`,children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),h.jsxs("div",{className:"overflow-y-auto p-4 space-y-4 flex-1",children:[nA&&h.jsx("div",{className:"p-2 rounded-lg bg-rose-500/10 border border-rose-500/50 text-rose-400 text-xs",children:nA}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("label",{className:`text-sm font-medium ${w?"text-slate-700":"text-white"}`,children:"Volume"}),h.jsxs("span",{className:`text-sm ${w?"text-slate-700":"text-white"}`,children:[KA," ",a]})]}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx("button",{type:"button",onClick:()=>zA(-.01),className:`absolute left-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${w?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,children:"−"}),h.jsx("input",{type:"number",value:F,onChange:fA=>{C(fA.target.value),cA("")},className:`w-full px-10 py-2 rounded text-sm focus:outline-none focus:border-secondary text-center ${w?"bg-white border border-slate-400 text-slate-800":"bg-[#12161d] border border-slate-700 text-white"}`,step:"0.01",min:"0.01",placeholder:"0.01"}),h.jsx("button",{type:"button",onClick:()=>zA(.01),className:`absolute right-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${w?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,children:"+"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx("div",{className:"flex items-center justify-between mb-2",children:h.jsx("label",{className:`text-sm font-medium ${w?"text-slate-700":"text-white"}`,children:"Stop Loss"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx("button",{type:"button",onClick:()=>dt(-1e-4),className:`absolute left-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${w?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,title:"Decrease SL",children:"−"}),h.jsx("input",{type:"text",value:E,onChange:fA=>{const mA=fA.target.value;(mA===""||/^\d*\.?\d*$/.test(mA))&&(U(mA),cA(""))},onBlur:fA=>{const mA=parseFloat(fA.target.value);!isNaN(mA)&&mA>0?U(mA.toFixed(5)):fA.target.value===""&&U("")},placeholder:"0.00000",className:`w-full px-10 py-2 rounded text-sm focus:outline-none focus:border-secondary text-center ${w?"bg-white border border-slate-400 text-slate-800":"bg-[#12161d] border border-slate-700 text-slate-100"}`}),h.jsx("button",{type:"button",onClick:()=>dt(1e-4),className:`absolute right-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${w?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,title:"Increase SL",children:"+"})]})]}),h.jsxs("div",{children:[h.jsx("div",{className:"flex items-center justify-between mb-2",children:h.jsx("label",{className:`text-sm font-medium ${w?"text-slate-700":"text-white"}`,children:"Take Profit"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx("button",{type:"button",onClick:()=>ae(-1e-4),className:`absolute left-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${w?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,title:"Decrease TP",children:"−"}),h.jsx("input",{type:"text",value:S,onChange:fA=>{const mA=fA.target.value;(mA===""||/^\d*\.?\d*$/.test(mA))&&(P(mA),cA(""))},onBlur:fA=>{const mA=parseFloat(fA.target.value);!isNaN(mA)&&mA>0?P(mA.toFixed(5)):fA.target.value===""&&P("")},placeholder:"0.00000",className:`w-full px-10 py-2 rounded text-sm focus:outline-none focus:border-secondary text-center ${w?"bg-white border border-slate-400 text-slate-800":"bg-[#12161d] border border-slate-700 text-slate-100"}`}),h.jsx("button",{type:"button",onClick:()=>ae(1e-4),className:`absolute right-1 w-8 h-8 flex items-center justify-center rounded text-sm transition-colors z-10 ${w?"bg-slate-100 hover:bg-slate-400 text-slate-700":"bg-[#12161d] hover:bg-slate-600 text-white"}`,title:"Increase TP",children:"+"})]})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:`block text-sm font-medium mb-2 ${w?"text-slate-700":"text-white"}`,children:"Comment"}),h.jsx("textarea",{value:z,onChange:fA=>J(fA.target.value),placeholder:"Optional comment",rows:2,className:`w-full px-3 py-2 rounded text-sm focus:outline-none focus:border-secondary resize-none ${w?"bg-white border border-slate-400 text-slate-800":"bg-[#12161d] border border-slate-700 text-slate-100"}`})]}),h.jsxs("div",{className:`flex items-center justify-between py-2 border-t ${w?"border-slate-400":"border-slate-700"}`,children:[h.jsxs("div",{className:"text-sm",children:[h.jsx("span",{className:w?"text-slate-700":"text-white",children:"Bid: "}),h.jsx("span",{className:`${vA} font-medium transition-colors duration-400`,children:EA>0?EA.toFixed(5):"---"})]}),h.jsxs("div",{className:"text-sm",children:[h.jsx("span",{className:w?"text-slate-700":"text-white",children:"Ask: "}),h.jsx("span",{className:`${j} font-medium transition-colors duration-400`,children:XA>0?XA.toFixed(5):"---"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-3 pt-2",children:[h.jsx("button",{onClick:()=>ft("SELL"),disabled:N,className:"px-4 py-3 bg-rose-600 hover:bg-rose-700 text-white font-semibold rounded text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:N&&W==="SELL"?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Placing..."]}):"Sell by Market"}),h.jsx("button",{onClick:()=>ft("BUY"),disabled:N,className:"px-4 py-3 bg-sky-600 hover:bg-sky-700 text-white font-semibold rounded text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:N&&W==="BUY"?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Placing..."]}):"Buy by Market"})]})]})]}):null};function iA(r){if(r==null)return null;if(typeof r=="number"){if(Number.isNaN(r)||!Number.isFinite(r))return null;let A;r>1e10?A=r/1e3:(r<1e9,A=r);const e=Math.floor(A);return e<946684800||e>4102444800?null:e}if(typeof r=="string"){const A=Date.parse(r);return Number.isNaN(A)?null:Math.floor(A/1e3)}if(typeof r=="object"&&"year"in r&&"month"in r&&"day"in r){const e=new Date(Date.UTC(r.year,r.month-1,r.day)).getTime();return Number.isNaN(e)?null:Math.floor(e/1e3)}return null}function lB(r,A){if(!r||r.length<2)return[];const e=[],t=2;for(let i=1;i<r.length;i++){const s=r[i-1].time,n=r[i].time,o=n-s;o>A*t&&e.push({from:s,to:n,gapSeconds:o,gapHours:(o/3600).toFixed(1),fromDate:new Date(s*1e3).toISOString(),toDate:new Date(n*1e3).toISOString()})}return e}function cB(r,A="America/New_York"){const e=new Date(r*1e3),t=new Date(e.toLocaleString("en-US",{timeZone:A})),i=t.getDay();return!(i===0||i===6||i===5&&t.getHours()>=17)}function Tc(r){return Array.isArray(r)?r.map(A=>({...A,time:iA(A.time)})).filter(A=>A.time!=null):[]}function hB(r){if(!r||r.length<2)return!0;for(let A=1;A<r.length;A++)if(r[A].time<=r[A-1].time)return!1;return!0}function Ar(r,A){return!Number.isFinite(r)||!Number.isFinite(A)||A<=0?r:Math.floor(r/A)*A}const Be="17:00-17:00",we="America/New_York",At="24x7",et="UTC",Sc={EURUSD:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},GBPUSD:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},USDJPY:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},USDCHF:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},AUDUSD:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},USDCAD:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},NZDUSD:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},EURGBP:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},EURJPY:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},GBPJPY:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},CADJPY:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},EURJPY:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},XAUUSD:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},XAGUSD:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},OILUSD:{type:"forex",sessionTZ:we,session:Be,priceMode:"mid"},BTCUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},ETHUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},BNBUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},SOLUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},ADAUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},XRPUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},DOGEUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},DOTUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},MATICUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"},LINKUSDT:{type:"crypto",session:At,sessionTZ:et,priceMode:"last"}},Hc={type:"forex",sessionTZ:we,session:Be,priceMode:"mid"};function Mr(r){return r&&Sc[r.toUpperCase()]||Hc}function uB(r){return Mr(r).type==="forex"}function dB(r){return Mr(r).type==="crypto"}function fB(r){return Mr(r).session==="24x7"}function Lc(r){if(!r||typeof r!="object")return!1;const{time:A,open:e,high:t,low:i,close:s,volume:n}=r;return!(iA(A)==null||typeof e!="number"||!Number.isFinite(e)||typeof t!="number"||!Number.isFinite(t)||typeof i!="number"||!Number.isFinite(i)||typeof s!="number"||!Number.isFinite(s)||n!=null&&(typeof n!="number"||n<0||!Number.isFinite(n))||t<e||t<s||t<i||i>e||i>s||i>t||e<=0||t<=0||i<=0||s<=0)}function Ic(r){const A=n=>Math.round(n*1e5)/1e5;let e=A(r.open),t=A(r.high),i=A(r.low),s=A(r.close);return t=Math.max(t,e,s,i),i=Math.min(i,e,s,t),{...r,open:e,high:t,low:i,close:s,volume:r.volume!=null?Math.round(r.volume):r.volume}}function Mc(r){if(!Array.isArray(r)||r.length===0)return[];const A=new Map;return r.forEach(e=>{const t=iA(e.time);if(t!=null)if(A.has(t)){const i=A.get(t);A.set(t,{...e,time:t,open:e.open,high:Math.max(i.high,e.high),low:Math.min(i.low,e.low),close:e.close,volume:(i.volume||0)+(e.volume||0)})}else A.set(t,{...e,time:t})}),Array.from(A.values())}function pB(r,A="percentile"){if(!Array.isArray(r)||r.length<3)return r;const e=r.map(n=>n.close).filter(n=>Number.isFinite(n));if(e.length<3)return r;const t=[...e].sort((n,o)=>n-o);let i,s;if(A==="percentile"){const n=Math.floor(t.length*.25),o=Math.floor(t.length*.75),a=t[n],l=t[o],c=l-a;i=a-1.5*c,s=l+1.5*c}else{const n=e.reduce((l,c)=>l+c,0)/e.length,o=e.reduce((l,c)=>l+Math.pow(c-n,2),0)/e.length,a=Math.sqrt(o);if(a===0)return r;i=n-3*a,s=n+3*a}return r.map((n,o)=>{const a=n.close;if(a<i||a>s){if(o===0)return n;const l=r[o-1].close;return{...n,open:l,high:Math.max(l,n.high),low:Math.min(l,n.low),close:l}}return n})}function gB(r,A){if(!Array.isArray(r)||r.length===0)return r;const e=[],t=Math.max(A*10080,604800),i=1e4;for(let o=0;o<r.length;o++)if(e.push(r[o]),o<r.length-1){const a=r[o].time,l=r[o+1].time,c=l-a;if(c>t&&((c/3600).toFixed(1),(t/3600).toFixed(1)),c>A&&c<=t){const u=r[o];let d=a+A,B=0;for(d=Ar(d,A);d<l&&B<i;){const p=Ar(d,A);e.some(w=>w.time===p)||(e.push({time:p,open:u.close,high:u.close,low:u.close,close:u.close,volume:0}),B++),d+=A}if(d<l&&B>=i){const p=Ar(l-A,A);e.some(w=>w.time===p)||e.push({time:p,open:u.close,high:u.close,low:u.close,close:u.close,volume:0})}}}e.sort((o,a)=>o.time-a.time);const s=[],n=new Set;for(const o of e)n.has(o.time)||(n.add(o.time),s.push(o));return s}function Ot(r){if(!r||typeof r!="string")return 60;const A=r.toUpperCase();if(A==="MN")return 2592e3;let e=A.match(/^([MHDW])(\d+)$/);if(e){const t=e[1];return parseInt(e[2],10)*({M:60,H:3600,D:86400,W:604800}[t]||60)}if(e=r.match(/^(\d+)([mhdwy])$/i),e){const t=parseInt(e[1],10),i=e[2].toLowerCase();return t*({m:60,h:3600,d:86400,w:604800,y:31536e3}[i]||60)}return 60}function Dc(r,A,e){if(!Array.isArray(r)||r.length===0)return{candles:[],stats:{original:0,processed:0,duplicates:0,outliers:0,gaps:[]}};const t=Mr(A),i=Ot(e),o=Tc(r).map(w=>({...w,time:Ar(w.time,i)})).filter(w=>Lc(w)).map(w=>Ic(w)),a=Mc(o);a.sort((w,F)=>w.time-F.time);const l=a.filter((w,F)=>F===0?!0:w.time>a[F-1].time),c=l.length>10?pB(l,"percentile"):l,u=Mc(c);u.sort((w,F)=>w.time-F.time);const d=gB(u,i),B=[];for(let w=1;w<d.length;w++){const F=d[w].time-d[w-1].time;F>i*2&&B.push({from:d[w-1].time,to:d[w].time,gapSeconds:F,gapMinutes:Math.round(F/60),fromDate:new Date(d[w-1].time*1e3).toISOString(),toDate:new Date(d[w].time*1e3).toISOString()})}const p=c.filter((w,F)=>F===0?!1:w.close===c[F-1].close&&w.open===c[F-1].close).length,f={original:r.length,processed:d.length,duplicates:r.length-a.length,outliers:p,gaps:B,filledGaps:d.length-u.length,symbolConfig:t};return{candles:d,stats:f}}function _c(r,A,e="1m"){if(!r||!A||!Lc(r))return null;const t=iA(r.time);if(t==null)return null;const i=Ot(e),s=Ar(t,i);return Ic({...r,time:s})}var Yn=function(r,A){return Yn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},Yn(r,A)};function Xe(r,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");Yn(r,A);function e(){this.constructor=r}r.prototype=A===null?Object.create(A):(e.prototype=A.prototype,new e)}var jn=function(){return jn=Object.assign||function(A){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(A[s]=e[s])}return A},jn.apply(this,arguments)};function be(r,A,e,t){function i(s){return s instanceof e?s:new e(function(n){n(s)})}return new(e||(e=Promise))(function(s,n){function o(c){try{l(t.next(c))}catch(u){n(u)}}function a(c){try{l(t.throw(c))}catch(u){n(u)}}function l(c){c.done?s(c.value):i(c.value).then(o,a)}l((t=t.apply(r,[])).next())})}function me(r,A){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},t,i,s,n;return n={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(n[Symbol.iterator]=function(){return this}),n;function o(l){return function(c){return a([l,c])}}function a(l){if(t)throw new TypeError("Generator is already executing.");for(;e;)try{if(t=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,i=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){e.label=l[1];break}if(l[0]===6&&e.label<s[1]){e.label=s[1],s=l;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(l);break}s[2]&&e.ops.pop(),e.trys.pop();continue}l=A.call(r,e)}catch(c){l=[6,c],i=0}finally{t=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ri(r,A,e){if(arguments.length===2)for(var t=0,i=A.length,s;t<i;t++)(s||!(t in A))&&(s||(s=Array.prototype.slice.call(A,0,t)),s[t]=A[t]);return r.concat(s||A)}for(var lt=(function(){function r(A,e,t,i){this.left=A,this.top=e,this.width=t,this.height=i}return r.prototype.add=function(A,e,t,i){return new r(this.left+A,this.top+e,this.width+t,this.height+i)},r.fromClientRect=function(A,e){return new r(e.left+A.windowBounds.left,e.top+A.windowBounds.top,e.width,e.height)},r.fromDOMRectList=function(A,e){var t=Array.from(e).find(function(i){return i.width!==0});return t?new r(t.left+A.windowBounds.left,t.top+A.windowBounds.top,t.width,t.height):r.EMPTY},r.EMPTY=new r(0,0,0,0),r})(),Wi=function(r,A){return lt.fromClientRect(r,A.getBoundingClientRect())},BB=function(r){var A=r.body,e=r.documentElement;if(!A||!e)throw new Error("Unable to get document size");var t=Math.max(Math.max(A.scrollWidth,e.scrollWidth),Math.max(A.offsetWidth,e.offsetWidth),Math.max(A.clientWidth,e.clientWidth)),i=Math.max(Math.max(A.scrollHeight,e.scrollHeight),Math.max(A.offsetHeight,e.offsetHeight),Math.max(A.clientHeight,e.clientHeight));return new lt(0,0,t,i)},$i=function(r){for(var A=[],e=0,t=r.length;e<t;){var i=r.charCodeAt(e++);if(i>=55296&&i<=56319&&e<t){var s=r.charCodeAt(e++);(s&64512)===56320?A.push(((i&1023)<<10)+(s&1023)+65536):(A.push(i),e--)}else A.push(i)}return A},te=function(){for(var r=[],A=0;A<arguments.length;A++)r[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,r);var e=r.length;if(!e)return"";for(var t=[],i=-1,s="";++i<e;){var n=r[i];n<=65535?t.push(n):(n-=65536,t.push((n>>10)+55296,n%1024+56320)),(i+1===e||t.length>16384)&&(s+=String.fromCharCode.apply(String,t),t.length=0)}return s},kc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",wB=typeof Uint8Array>"u"?[]:new Uint8Array(256),Xi=0;Xi<kc.length;Xi++)wB[kc.charCodeAt(Xi)]=Xi;for(var Oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Dr=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ji=0;Ji<Oc.length;Ji++)Dr[Oc.charCodeAt(Ji)]=Ji;for(var mB=function(r){var A=r.length*.75,e=r.length,t,i=0,s,n,o,a;r[r.length-1]==="="&&(A--,r[r.length-2]==="="&&A--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(A):new Array(A),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t<e;t+=4)s=Dr[r.charCodeAt(t)],n=Dr[r.charCodeAt(t+1)],o=Dr[r.charCodeAt(t+2)],a=Dr[r.charCodeAt(t+3)],c[i++]=s<<2|n>>4,c[i++]=(n&15)<<4|o>>2,c[i++]=(o&3)<<6|a&63;return l},CB=function(r){for(var A=r.length,e=[],t=0;t<A;t+=2)e.push(r[t+1]<<8|r[t]);return e},vB=function(r){for(var A=r.length,e=[],t=0;t<A;t+=4)e.push(r[t+3]<<24|r[t+2]<<16|r[t+1]<<8|r[t]);return e},Nt=5,qn=11,Ao=2,bB=qn-Nt,Nc=65536>>Nt,yB=1<<Nt,eo=yB-1,QB=1024>>Nt,FB=Nc+QB,UB=FB,EB=32,xB=UB+EB,TB=65536>>qn,SB=1<<bB,HB=SB-1,Kc=function(r,A,e){return r.slice?r.slice(A,e):new Uint16Array(Array.prototype.slice.call(r,A,e))},LB=function(r,A,e){return r.slice?r.slice(A,e):new Uint32Array(Array.prototype.slice.call(r,A,e))},IB=function(r,A){var e=mB(r),t=Array.isArray(e)?vB(e):new Uint32Array(e),i=Array.isArray(e)?CB(e):new Uint16Array(e),s=24,n=Kc(i,s/2,t[4]/2),o=t[5]===2?Kc(i,(s+t[4])/2):LB(t,Math.ceil((s+t[4])/4));return new MB(t[0],t[1],t[2],t[3],n,o)},MB=(function(){function r(A,e,t,i,s,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=i,this.index=s,this.data=n}return r.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=this.index[A>>Nt],e=(e<<Ao)+(A&eo),this.data[e];if(A<=65535)return e=this.index[Nc+(A-55296>>Nt)],e=(e<<Ao)+(A&eo),this.data[e];if(A<this.highStart)return e=xB-TB+(A>>qn),e=this.index[e],e+=A>>Nt&HB,e=this.index[e],e=(e<<Ao)+(A&eo),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},r})(),Vc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",DB=typeof Uint8Array>"u"?[]:new Uint8Array(256),Zi=0;Zi<Vc.length;Zi++)DB[Vc.charCodeAt(Zi)]=Zi;var _B="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",Pc=50,kB=1,zc=2,Gc=3,OB=4,NB=5,Rc=7,Wc=8,$c=9,Ct=10,to=11,Xc=12,ro=13,KB=14,_r=15,io=16,Yi=17,kr=18,VB=19,Jc=20,so=21,Or=22,no=23,er=24,Ie=25,Nr=26,Kr=27,tr=28,PB=29,Kt=30,zB=31,ji=32,qi=33,oo=34,ao=35,lo=36,Vr=37,co=38,As=39,es=40,ho=41,Zc=42,GB=43,RB=[9001,65288],Yc="!",OA="×",ts="÷",uo=IB(_B),ct=[Kt,lo],fo=[kB,zc,Gc,NB],jc=[Ct,Wc],qc=[Kr,Nr],WB=fo.concat(jc),Ah=[co,As,es,oo,ao],$B=[_r,ro],XB=function(r,A){A===void 0&&(A="strict");var e=[],t=[],i=[];return r.forEach(function(s,n){var o=uo.get(s);if(o>Pc?(i.push(!0),o-=Pc):i.push(!1),["normal","auto","loose"].indexOf(A)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return t.push(n),e.push(io);if(o===OB||o===to){if(n===0)return t.push(n),e.push(Kt);var a=e[n-1];return WB.indexOf(a)===-1?(t.push(t[n-1]),e.push(a)):(t.push(n),e.push(Kt))}if(t.push(n),o===zB)return e.push(A==="strict"?so:Vr);if(o===Zc||o===PB)return e.push(Kt);if(o===GB)return s>=131072&&s<=196605||s>=196608&&s<=262141?e.push(Vr):e.push(Kt);e.push(o)}),[t,e,i]},po=function(r,A,e,t){var i=t[e];if(Array.isArray(r)?r.indexOf(i)!==-1:r===i)for(var s=e;s<=t.length;){s++;var n=t[s];if(n===A)return!0;if(n!==Ct)break}if(i===Ct)for(var s=e;s>0;){s--;var o=t[s];if(Array.isArray(r)?r.indexOf(o)!==-1:r===o)for(var a=e;a<=t.length;){a++;var n=t[a];if(n===A)return!0;if(n!==Ct)break}if(o!==Ct)break}return!1},eh=function(r,A){for(var e=r;e>=0;){var t=A[e];if(t===Ct)e--;else return t}return 0},JB=function(r,A,e,t,i){if(e[t]===0)return OA;var s=t-1;if(Array.isArray(i)&&i[s]===!0)return OA;var n=s-1,o=s+1,a=A[s],l=n>=0?A[n]:0,c=A[o];if(a===zc&&c===Gc)return OA;if(fo.indexOf(a)!==-1)return Yc;if(fo.indexOf(c)!==-1||jc.indexOf(c)!==-1)return OA;if(eh(s,A)===Wc)return ts;if(uo.get(r[s])===to||(a===ji||a===qi)&&uo.get(r[o])===to||a===Rc||c===Rc||a===$c||[Ct,ro,_r].indexOf(a)===-1&&c===$c||[Yi,kr,VB,er,tr].indexOf(c)!==-1||eh(s,A)===Or||po(no,Or,s,A)||po([Yi,kr],so,s,A)||po(Xc,Xc,s,A))return OA;if(a===Ct)return ts;if(a===no||c===no)return OA;if(c===io||a===io)return ts;if([ro,_r,so].indexOf(c)!==-1||a===KB||l===lo&&$B.indexOf(a)!==-1||a===tr&&c===lo||c===Jc||ct.indexOf(c)!==-1&&a===Ie||ct.indexOf(a)!==-1&&c===Ie||a===Kr&&[Vr,ji,qi].indexOf(c)!==-1||[Vr,ji,qi].indexOf(a)!==-1&&c===Nr||ct.indexOf(a)!==-1&&qc.indexOf(c)!==-1||qc.indexOf(a)!==-1&&ct.indexOf(c)!==-1||[Kr,Nr].indexOf(a)!==-1&&(c===Ie||[Or,_r].indexOf(c)!==-1&&A[o+1]===Ie)||[Or,_r].indexOf(a)!==-1&&c===Ie||a===Ie&&[Ie,tr,er].indexOf(c)!==-1)return OA;if([Ie,tr,er,Yi,kr].indexOf(c)!==-1)for(var u=s;u>=0;){var d=A[u];if(d===Ie)return OA;if([tr,er].indexOf(d)!==-1)u--;else break}if([Kr,Nr].indexOf(c)!==-1)for(var u=[Yi,kr].indexOf(a)!==-1?n:s;u>=0;){var d=A[u];if(d===Ie)return OA;if([tr,er].indexOf(d)!==-1)u--;else break}if(co===a&&[co,As,oo,ao].indexOf(c)!==-1||[As,oo].indexOf(a)!==-1&&[As,es].indexOf(c)!==-1||[es,ao].indexOf(a)!==-1&&c===es||Ah.indexOf(a)!==-1&&[Jc,Nr].indexOf(c)!==-1||Ah.indexOf(c)!==-1&&a===Kr||ct.indexOf(a)!==-1&&ct.indexOf(c)!==-1||a===er&&ct.indexOf(c)!==-1||ct.concat(Ie).indexOf(a)!==-1&&c===Or&&RB.indexOf(r[o])===-1||ct.concat(Ie).indexOf(c)!==-1&&a===kr)return OA;if(a===ho&&c===ho){for(var B=e[s],p=1;B>0&&(B--,A[B]===ho);)p++;if(p%2!==0)return OA}return a===ji&&c===qi?OA:ts},ZB=function(r,A){A||(A={lineBreak:"normal",wordBreak:"normal"});var e=XB(r,A.lineBreak),t=e[0],i=e[1],s=e[2];(A.wordBreak==="break-all"||A.wordBreak==="break-word")&&(i=i.map(function(o){return[Ie,Kt,Zc].indexOf(o)!==-1?Vr:o}));var n=A.wordBreak==="keep-all"?s.map(function(o,a){return o&&r[a]>=19968&&r[a]<=40959}):void 0;return[t,i,n]},YB=(function(){function r(A,e,t,i){this.codePoints=A,this.required=e===Yc,this.start=t,this.end=i}return r.prototype.slice=function(){return te.apply(void 0,this.codePoints.slice(this.start,this.end))},r})(),jB=function(r,A){var e=$i(r),t=ZB(e,A),i=t[0],s=t[1],n=t[2],o=e.length,a=0,l=0;return{next:function(){if(l>=o)return{done:!0,value:null};for(var c=OA;l<o&&(c=JB(e,s,i,++l,n))===OA;);if(c!==OA||l===o){var u=new YB(e,c,a,l);return a=l,{value:u,done:!1}}return{done:!0,value:null}}}},qB=1,Aw=2,Pr=4,th=8,rs=10,rh=47,zr=92,ew=9,tw=32,is=34,Gr=61,rw=35,iw=36,sw=37,ss=39,ns=40,Rr=41,nw=95,Te=45,ow=33,aw=60,lw=62,cw=64,hw=91,uw=93,dw=61,fw=123,os=63,pw=125,ih=124,gw=126,Bw=128,sh=65533,go=42,Vt=43,ww=44,mw=58,Cw=59,Wr=46,vw=0,bw=8,yw=11,Qw=14,Fw=31,Uw=127,tt=-1,nh=48,oh=97,ah=101,Ew=102,xw=117,Tw=122,lh=65,ch=69,hh=70,Sw=85,Hw=90,Ce=function(r){return r>=nh&&r<=57},Lw=function(r){return r>=55296&&r<=57343},rr=function(r){return Ce(r)||r>=lh&&r<=hh||r>=oh&&r<=Ew},Iw=function(r){return r>=oh&&r<=Tw},Mw=function(r){return r>=lh&&r<=Hw},Dw=function(r){return Iw(r)||Mw(r)},_w=function(r){return r>=Bw},as=function(r){return r===rs||r===ew||r===tw},ls=function(r){return Dw(r)||_w(r)||r===nw},uh=function(r){return ls(r)||Ce(r)||r===Te},kw=function(r){return r>=vw&&r<=bw||r===yw||r>=Qw&&r<=Fw||r===Uw},vt=function(r,A){return r!==zr?!1:A!==rs},cs=function(r,A,e){return r===Te?ls(A)||vt(A,e):ls(r)?!0:!!(r===zr&&vt(r,A))},Bo=function(r,A,e){return r===Vt||r===Te?Ce(A)?!0:A===Wr&&Ce(e):Ce(r===Wr?A:r)},Ow=function(r){var A=0,e=1;(r[A]===Vt||r[A]===Te)&&(r[A]===Te&&(e=-1),A++);for(var t=[];Ce(r[A]);)t.push(r[A++]);var i=t.length?parseInt(te.apply(void 0,t),10):0;r[A]===Wr&&A++;for(var s=[];Ce(r[A]);)s.push(r[A++]);var n=s.length,o=n?parseInt(te.apply(void 0,s),10):0;(r[A]===ch||r[A]===ah)&&A++;var a=1;(r[A]===Vt||r[A]===Te)&&(r[A]===Te&&(a=-1),A++);for(var l=[];Ce(r[A]);)l.push(r[A++]);var c=l.length?parseInt(te.apply(void 0,l),10):0;return e*(i+o*Math.pow(10,-n))*Math.pow(10,a*c)},Nw={type:2},Kw={type:3},Vw={type:4},Pw={type:13},zw={type:8},Gw={type:21},Rw={type:9},Ww={type:10},$w={type:11},Xw={type:12},Jw={type:14},hs={type:23},Zw={type:1},Yw={type:25},jw={type:24},qw={type:26},A1={type:27},e1={type:28},t1={type:29},r1={type:31},wo={type:32},dh=(function(){function r(){this._value=[]}return r.prototype.write=function(A){this._value=this._value.concat($i(A))},r.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==wo;)A.push(e),e=this.consumeToken();return A},r.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case is:return this.consumeStringToken(is);case rw:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),i=this.peekCodePoint(2);if(uh(e)||vt(t,i)){var s=cs(e,t,i)?Aw:qB,n=this.consumeName();return{type:5,value:n,flags:s}}break;case iw:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Pw;break;case ss:return this.consumeStringToken(ss);case ns:return Nw;case Rr:return Kw;case go:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Jw;break;case Vt:if(Bo(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case ww:return Vw;case Te:var o=A,a=this.peekCodePoint(0),l=this.peekCodePoint(1);if(Bo(o,a,l))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(cs(o,a,l))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(a===Te&&l===lw)return this.consumeCodePoint(),this.consumeCodePoint(),jw;break;case Wr:if(Bo(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case rh:if(this.peekCodePoint(0)===go)for(this.consumeCodePoint();;){var c=this.consumeCodePoint();if(c===go&&(c=this.consumeCodePoint(),c===rh))return this.consumeToken();if(c===tt)return this.consumeToken()}break;case mw:return qw;case Cw:return A1;case aw:if(this.peekCodePoint(0)===ow&&this.peekCodePoint(1)===Te&&this.peekCodePoint(2)===Te)return this.consumeCodePoint(),this.consumeCodePoint(),Yw;break;case cw:var u=this.peekCodePoint(0),d=this.peekCodePoint(1),B=this.peekCodePoint(2);if(cs(u,d,B)){var n=this.consumeName();return{type:7,value:n}}break;case hw:return e1;case zr:if(vt(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case uw:return t1;case dw:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),zw;break;case fw:return $w;case pw:return Xw;case xw:case Sw:var p=this.peekCodePoint(0),f=this.peekCodePoint(1);return p===Vt&&(rr(f)||f===os)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case ih:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Rw;if(this.peekCodePoint(0)===ih)return this.consumeCodePoint(),Gw;break;case gw:if(this.peekCodePoint(0)===Gr)return this.consumeCodePoint(),Ww;break;case tt:return wo}return as(A)?(this.consumeWhiteSpace(),r1):Ce(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):ls(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:te(A)}},r.prototype.consumeCodePoint=function(){var A=this._value.shift();return typeof A>"u"?-1:A},r.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},r.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},r.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();rr(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;e===os&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t){var i=parseInt(te.apply(void 0,A.map(function(a){return a===os?nh:a})),16),s=parseInt(te.apply(void 0,A.map(function(a){return a===os?hh:a})),16);return{type:30,start:i,end:s}}var n=parseInt(te.apply(void 0,A),16);if(this.peekCodePoint(0)===Te&&rr(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var o=[];rr(e)&&o.length<6;)o.push(e),e=this.consumeCodePoint();var s=parseInt(te.apply(void 0,o),16);return{type:30,start:n,end:s}}else return{type:30,start:n,end:n}},r.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return A.toLowerCase()==="url"&&this.peekCodePoint(0)===ns?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===ns?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},r.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===tt)return{type:22,value:""};var e=this.peekCodePoint(0);if(e===ss||e===is){var t=this.consumeStringToken(this.consumeCodePoint());return t.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===tt||this.peekCodePoint(0)===Rr)?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),hs)}for(;;){var i=this.consumeCodePoint();if(i===tt||i===Rr)return{type:22,value:te.apply(void 0,A)};if(as(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===tt||this.peekCodePoint(0)===Rr?(this.consumeCodePoint(),{type:22,value:te.apply(void 0,A)}):(this.consumeBadUrlRemnants(),hs);if(i===is||i===ss||i===ns||kw(i))return this.consumeBadUrlRemnants(),hs;if(i===zr)if(vt(i,this.peekCodePoint(0)))A.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),hs;else A.push(i)}},r.prototype.consumeWhiteSpace=function(){for(;as(this.peekCodePoint(0));)this.consumeCodePoint()},r.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(A===Rr||A===tt)return;vt(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},r.prototype.consumeStringSlice=function(A){for(var e=5e4,t="";A>0;){var i=Math.min(e,A);t+=te.apply(void 0,this._value.splice(0,i)),A-=i}return this._value.shift(),t},r.prototype.consumeStringToken=function(A){var e="",t=0;do{var i=this._value[t];if(i===tt||i===void 0||i===A)return e+=this.consumeStringSlice(t),{type:0,value:e};if(i===rs)return this._value.splice(0,t),Zw;if(i===zr){var s=this._value[t+1];s!==tt&&s!==void 0&&(s===rs?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):vt(i,s)&&(e+=this.consumeStringSlice(t),e+=te(this.consumeEscapedCodePoint()),t=-1))}t++}while(!0)},r.prototype.consumeNumber=function(){var A=[],e=Pr,t=this.peekCodePoint(0);for((t===Vt||t===Te)&&A.push(this.consumeCodePoint());Ce(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(t===Wr&&Ce(i))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=th;Ce(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),i=this.peekCodePoint(1);var s=this.peekCodePoint(2);if((t===ch||t===ah)&&((i===Vt||i===Te)&&Ce(s)||Ce(i)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=th;Ce(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[Ow(A),e]},r.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],i=this.peekCodePoint(0),s=this.peekCodePoint(1),n=this.peekCodePoint(2);if(cs(i,s,n)){var o=this.consumeName();return{type:15,number:e,flags:t,unit:o}}return i===sw?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},r.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(rr(A)){for(var e=te(A);rr(this.peekCodePoint(0))&&e.length<6;)e+=te(this.consumeCodePoint());as(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return t===0||Lw(t)||t>1114111?sh:t}return A===tt?sh:A},r.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(uh(e))A+=te(e);else if(vt(e,this.peekCodePoint(0)))A+=te(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(e),A}},r})(),fh=(function(){function r(A){this._tokens=A}return r.create=function(A){var e=new dh;return e.write(A),new r(e.read())},r.parseValue=function(A){return r.create(A).parseComponentValue()},r.parseValues=function(A){return r.create(A).parseComponentValues()},r.prototype.parseComponentValue=function(){for(var A=this.consumeToken();A.type===31;)A=this.consumeToken();if(A.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do A=this.consumeToken();while(A.type===31);if(A.type===32)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},r.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(e.type===32)return A;A.push(e),A.push()}},r.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},r.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(t.type===32||s1(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},r.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(t.type===32||t.type===3)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},r.prototype.consumeToken=function(){var A=this._tokens.shift();return typeof A>"u"?wo:A},r.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},r})(),$r=function(r){return r.type===15},ir=function(r){return r.type===17},GA=function(r){return r.type===20},i1=function(r){return r.type===0},mo=function(r,A){return GA(r)&&r.value===A},ph=function(r){return r.type!==31},sr=function(r){return r.type!==31&&r.type!==4},rt=function(r){var A=[],e=[];return r.forEach(function(t){if(t.type===4){if(e.length===0)throw new Error("Error parsing function args, zero tokens for arg");A.push(e),e=[];return}t.type!==31&&e.push(t)}),e.length&&A.push(e),A},s1=function(r,A){return A===11&&r.type===12||A===28&&r.type===29?!0:A===2&&r.type===3},bt=function(r){return r.type===17||r.type===15},se=function(r){return r.type===16||bt(r)},gh=function(r){return r.length>1?[r[0],r[1]]:[r[0]]},de={type:17,number:0,flags:Pr},Co={type:16,number:50,flags:Pr},yt={type:16,number:100,flags:Pr},Xr=function(r,A,e){var t=r[0],i=r[1];return[RA(t,A),RA(typeof i<"u"?i:t,e)]},RA=function(r,A){if(r.type===16)return r.number/100*A;if($r(r))switch(r.unit){case"rem":case"em":return 16*r.number;default:return r.number}return r.number},Bh="deg",wh="grad",mh="rad",Ch="turn",us={name:"angle",parse:function(r,A){if(A.type===15)switch(A.unit){case Bh:return Math.PI*A.number/180;case wh:return Math.PI/200*A.number;case mh:return A.number;case Ch:return Math.PI*2*A.number}throw new Error("Unsupported angle type")}},vh=function(r){return r.type===15&&(r.unit===Bh||r.unit===wh||r.unit===mh||r.unit===Ch)},bh=function(r){var A=r.filter(GA).map(function(e){return e.value}).join(" ");switch(A){case"to bottom right":case"to right bottom":case"left top":case"top left":return[de,de];case"to top":case"bottom":return Ke(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[de,yt];case"to right":case"left":return Ke(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[yt,yt];case"to bottom":case"top":return Ke(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[yt,de];case"to left":case"right":return Ke(270)}return 0},Ke=function(r){return Math.PI*r/180},Qt={name:"color",parse:function(r,A){if(A.type===18){var e=n1[A.name];if(typeof e>"u")throw new Error('Attempting to parse an unsupported color function "'+A.name+'"');return e(r,A.values)}if(A.type===5){if(A.value.length===3){var t=A.value.substring(0,1),i=A.value.substring(1,2),s=A.value.substring(2,3);return Ut(parseInt(t+t,16),parseInt(i+i,16),parseInt(s+s,16),1)}if(A.value.length===4){var t=A.value.substring(0,1),i=A.value.substring(1,2),s=A.value.substring(2,3),n=A.value.substring(3,4);return Ut(parseInt(t+t,16),parseInt(i+i,16),parseInt(s+s,16),parseInt(n+n,16)/255)}if(A.value.length===6){var t=A.value.substring(0,2),i=A.value.substring(2,4),s=A.value.substring(4,6);return Ut(parseInt(t,16),parseInt(i,16),parseInt(s,16),1)}if(A.value.length===8){var t=A.value.substring(0,2),i=A.value.substring(2,4),s=A.value.substring(4,6),n=A.value.substring(6,8);return Ut(parseInt(t,16),parseInt(i,16),parseInt(s,16),parseInt(n,16)/255)}}if(A.type===20){var o=ht[A.value.toUpperCase()];if(typeof o<"u")return o}return ht.TRANSPARENT}},Ft=function(r){return(255&r)===0},ce=function(r){var A=255&r,e=255&r>>8,t=255&r>>16,i=255&r>>24;return A<255?"rgba("+i+","+t+","+e+","+A/255+")":"rgb("+i+","+t+","+e+")"},Ut=function(r,A,e,t){return(r<<24|A<<16|e<<8|Math.round(t*255)<<0)>>>0},yh=function(r,A){if(r.type===17)return r.number;if(r.type===16){var e=A===3?1:255;return A===3?r.number/100*e:Math.round(r.number/100*e)}return 0},Qh=function(r,A){var e=A.filter(sr);if(e.length===3){var t=e.map(yh),i=t[0],s=t[1],n=t[2];return Ut(i,s,n,1)}if(e.length===4){var o=e.map(yh),i=o[0],s=o[1],n=o[2],a=o[3];return Ut(i,s,n,a)}return 0};function vo(r,A,e){return e<0&&(e+=1),e>=1&&(e-=1),e<1/6?(A-r)*e*6+r:e<1/2?A:e<2/3?(A-r)*6*(2/3-e)+r:r}var Fh=function(r,A){var e=A.filter(sr),t=e[0],i=e[1],s=e[2],n=e[3],o=(t.type===17?Ke(t.number):us.parse(r,t))/(Math.PI*2),a=se(i)?i.number/100:0,l=se(s)?s.number/100:0,c=typeof n<"u"&&se(n)?RA(n,1):1;if(a===0)return Ut(l*255,l*255,l*255,1);var u=l<=.5?l*(a+1):l+a-l*a,d=l*2-u,B=vo(d,u,o+1/3),p=vo(d,u,o),f=vo(d,u,o-1/3);return Ut(B*255,p*255,f*255,c)},n1={hsl:Fh,hsla:Fh,rgb:Qh,rgba:Qh},Jr=function(r,A){return Qt.parse(r,fh.create(A).parseComponentValue())},ht={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},o1={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(r,A){return A.map(function(e){if(GA(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},a1={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ds=function(r,A){var e=Qt.parse(r,A[0]),t=A[1];return t&&se(t)?{color:e,stop:t}:{color:e,stop:null}},Uh=function(r,A){var e=r[0],t=r[r.length-1];e.stop===null&&(e.stop=de),t.stop===null&&(t.stop=yt);for(var i=[],s=0,n=0;n<r.length;n++){var o=r[n].stop;if(o!==null){var a=RA(o,A);a>s?i.push(a):i.push(s),s=a}else i.push(null)}for(var l=null,n=0;n<i.length;n++){var c=i[n];if(c===null)l===null&&(l=n);else if(l!==null){for(var u=n-l,d=i[l-1],B=(c-d)/(u+1),p=1;p<=u;p++)i[l+p-1]=B*p;l=null}}return r.map(function(f,w){var F=f.color;return{color:F,stop:Math.max(Math.min(1,i[w]/A),0)}})},l1=function(r,A,e){var t=A/2,i=e/2,s=RA(r[0],A)-t,n=i-RA(r[1],e);return(Math.atan2(n,s)+Math.PI*2)%(Math.PI*2)},c1=function(r,A,e){var t=typeof r=="number"?r:l1(r,A,e),i=Math.abs(A*Math.sin(t))+Math.abs(e*Math.cos(t)),s=A/2,n=e/2,o=i/2,a=Math.sin(t-Math.PI/2)*o,l=Math.cos(t-Math.PI/2)*o;return[i,s-l,s+l,n-a,n+a]},Je=function(r,A){return Math.sqrt(r*r+A*A)},Eh=function(r,A,e,t,i){var s=[[0,0],[0,A],[r,0],[r,A]];return s.reduce(function(n,o){var a=o[0],l=o[1],c=Je(e-a,t-l);return(i?c<n.optimumDistance:c>n.optimumDistance)?{optimumCorner:o,optimumDistance:c}:n},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},h1=function(r,A,e,t,i){var s=0,n=0;switch(r.size){case 0:r.shape===0?s=n=Math.min(Math.abs(A),Math.abs(A-t),Math.abs(e),Math.abs(e-i)):r.shape===1&&(s=Math.min(Math.abs(A),Math.abs(A-t)),n=Math.min(Math.abs(e),Math.abs(e-i)));break;case 2:if(r.shape===0)s=n=Math.min(Je(A,e),Je(A,e-i),Je(A-t,e),Je(A-t,e-i));else if(r.shape===1){var o=Math.min(Math.abs(e),Math.abs(e-i))/Math.min(Math.abs(A),Math.abs(A-t)),a=Eh(t,i,A,e,!0),l=a[0],c=a[1];s=Je(l-A,(c-e)/o),n=o*s}break;case 1:r.shape===0?s=n=Math.max(Math.abs(A),Math.abs(A-t),Math.abs(e),Math.abs(e-i)):r.shape===1&&(s=Math.max(Math.abs(A),Math.abs(A-t)),n=Math.max(Math.abs(e),Math.abs(e-i)));break;case 3:if(r.shape===0)s=n=Math.max(Je(A,e),Je(A,e-i),Je(A-t,e),Je(A-t,e-i));else if(r.shape===1){var o=Math.max(Math.abs(e),Math.abs(e-i))/Math.max(Math.abs(A),Math.abs(A-t)),u=Eh(t,i,A,e,!1),l=u[0],c=u[1];s=Je(l-A,(c-e)/o),n=o*s}break}return Array.isArray(r.size)&&(s=RA(r.size[0],t),n=r.size.length===2?RA(r.size[1],i):s),[s,n]},u1=function(r,A){var e=Ke(180),t=[];return rt(A).forEach(function(i,s){if(s===0){var n=i[0];if(n.type===20&&n.value==="to"){e=bh(i);return}else if(vh(n)){e=us.parse(r,n);return}}var o=ds(r,i);t.push(o)}),{angle:e,stops:t,type:1}},fs=function(r,A){var e=Ke(180),t=[];return rt(A).forEach(function(i,s){if(s===0){var n=i[0];if(n.type===20&&["top","left","right","bottom"].indexOf(n.value)!==-1){e=bh(i);return}else if(vh(n)){e=(us.parse(r,n)+Ke(270))%Ke(360);return}}var o=ds(r,i);t.push(o)}),{angle:e,stops:t,type:1}},d1=function(r,A){var e=Ke(180),t=[],i=1,s=0,n=3,o=[];return rt(A).forEach(function(a,l){var c=a[0];if(l===0){if(GA(c)&&c.value==="linear"){i=1;return}else if(GA(c)&&c.value==="radial"){i=2;return}}if(c.type===18){if(c.name==="from"){var u=Qt.parse(r,c.values[0]);t.push({stop:de,color:u})}else if(c.name==="to"){var u=Qt.parse(r,c.values[0]);t.push({stop:yt,color:u})}else if(c.name==="color-stop"){var d=c.values.filter(sr);if(d.length===2){var u=Qt.parse(r,d[1]),B=d[0];ir(B)&&t.push({stop:{type:16,number:B.number*100,flags:B.flags},color:u})}}}}),i===1?{angle:(e+Ke(180))%Ke(360),stops:t,type:i}:{size:n,shape:s,stops:t,position:o,type:i}},xh="closest-side",Th="farthest-side",Sh="closest-corner",Hh="farthest-corner",Lh="circle",Ih="ellipse",Mh="cover",Dh="contain",f1=function(r,A){var e=0,t=3,i=[],s=[];return rt(A).forEach(function(n,o){var a=!0;if(o===0){var l=!1;a=n.reduce(function(u,d){if(l)if(GA(d))switch(d.value){case"center":return s.push(Co),u;case"top":case"left":return s.push(de),u;case"right":case"bottom":return s.push(yt),u}else(se(d)||bt(d))&&s.push(d);else if(GA(d))switch(d.value){case Lh:return e=0,!1;case Ih:return e=1,!1;case"at":return l=!0,!1;case xh:return t=0,!1;case Mh:case Th:return t=1,!1;case Dh:case Sh:return t=2,!1;case Hh:return t=3,!1}else if(bt(d)||se(d))return Array.isArray(t)||(t=[]),t.push(d),!1;return u},a)}if(a){var c=ds(r,n);i.push(c)}}),{size:t,shape:e,stops:i,position:s,type:2}},ps=function(r,A){var e=0,t=3,i=[],s=[];return rt(A).forEach(function(n,o){var a=!0;if(o===0?a=n.reduce(function(c,u){if(GA(u))switch(u.value){case"center":return s.push(Co),!1;case"top":case"left":return s.push(de),!1;case"right":case"bottom":return s.push(yt),!1}else if(se(u)||bt(u))return s.push(u),!1;return c},a):o===1&&(a=n.reduce(function(c,u){if(GA(u))switch(u.value){case Lh:return e=0,!1;case Ih:return e=1,!1;case Dh:case xh:return t=0,!1;case Th:return t=1,!1;case Sh:return t=2,!1;case Mh:case Hh:return t=3,!1}else if(bt(u)||se(u))return Array.isArray(t)||(t=[]),t.push(u),!1;return c},a)),a){var l=ds(r,n);i.push(l)}}),{size:t,shape:e,stops:i,position:s,type:2}},p1=function(r){return r.type===1},g1=function(r){return r.type===2},bo={name:"image",parse:function(r,A){if(A.type===22){var e={url:A.value,type:0};return r.cache.addImage(A.value),e}if(A.type===18){var t=_h[A.name];if(typeof t>"u")throw new Error('Attempting to parse an unsupported image function "'+A.name+'"');return t(r,A.values)}throw new Error("Unsupported image type "+A.type)}};function B1(r){return!(r.type===20&&r.value==="none")&&(r.type!==18||!!_h[r.name])}var _h={"linear-gradient":u1,"-moz-linear-gradient":fs,"-ms-linear-gradient":fs,"-o-linear-gradient":fs,"-webkit-linear-gradient":fs,"radial-gradient":f1,"-moz-radial-gradient":ps,"-ms-radial-gradient":ps,"-o-radial-gradient":ps,"-webkit-radial-gradient":ps,"-webkit-gradient":d1},w1={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(r,A){if(A.length===0)return[];var e=A[0];return e.type===20&&e.value==="none"?[]:A.filter(function(t){return sr(t)&&B1(t)}).map(function(t){return bo.parse(r,t)})}},m1={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(r,A){return A.map(function(e){if(GA(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},C1={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(r,A){return rt(A).map(function(e){return e.filter(se)}).map(gh)}},v1={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(r,A){return rt(A).map(function(e){return e.filter(GA).map(function(t){return t.value}).join(" ")}).map(b1)}},b1=function(r){switch(r){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}},nr;(function(r){r.AUTO="auto",r.CONTAIN="contain",r.COVER="cover"})(nr||(nr={}));var y1={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(r,A){return rt(A).map(function(e){return e.filter(Q1)})}},Q1=function(r){return GA(r)||se(r)},gs=function(r){return{name:"border-"+r+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},F1=gs("top"),U1=gs("right"),E1=gs("bottom"),x1=gs("left"),Bs=function(r){return{name:"border-radius-"+r,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return gh(e.filter(se))}}},T1=Bs("top-left"),S1=Bs("top-right"),H1=Bs("bottom-right"),L1=Bs("bottom-left"),ws=function(r){return{name:"border-"+r+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},I1=ws("top"),M1=ws("right"),D1=ws("bottom"),_1=ws("left"),ms=function(r){return{name:"border-"+r+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return $r(e)?e.number:0}}},k1=ms("top"),O1=ms("right"),N1=ms("bottom"),K1=ms("left"),V1={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},P1={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(r,A){return A==="rtl"?1:0}},z1={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(r,A){return A.filter(GA).reduce(function(e,t){return e|G1(t.value)},0)}},G1=function(r){switch(r){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},R1={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(r,A){switch(A){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},W1={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(r,A){return A.type===20&&A.value==="normal"?0:A.type===17||A.type===15?A.number:0}},Cs;(function(r){r.NORMAL="normal",r.STRICT="strict"})(Cs||(Cs={}));var $1={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(r,A){return A==="strict"?Cs.STRICT:Cs.NORMAL}},X1={name:"line-height",initialValue:"normal",prefix:!1,type:4},kh=function(r,A){return GA(r)&&r.value==="normal"?1.2*A:r.type===17?A*r.number:se(r)?RA(r,A):A},J1={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(r,A){return A.type===20&&A.value==="none"?null:bo.parse(r,A)}},Z1={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(r,A){return A==="inside"?0:1}},yo={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(r,A){switch(A){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},vs=function(r){return{name:"margin-"+r,initialValue:"0",prefix:!1,type:4}},Y1=vs("top"),j1=vs("right"),q1=vs("bottom"),Am=vs("left"),em={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(r,A){return A.filter(GA).map(function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},tm={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(r,A){return A==="break-word"?"break-word":"normal"}},bs=function(r){return{name:"padding-"+r,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},rm=bs("top"),im=bs("right"),sm=bs("bottom"),nm=bs("left"),om={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(r,A){switch(A){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},am={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(r,A){switch(A){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},lm={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(r,A){return A.length===1&&mo(A[0],"none")?[]:rt(A).map(function(e){for(var t={color:ht.TRANSPARENT,offsetX:de,offsetY:de,blur:de},i=0,s=0;s<e.length;s++){var n=e[s];bt(n)?(i===0?t.offsetX=n:i===1?t.offsetY=n:t.blur=n,i++):t.color=Qt.parse(r,n)}return t})}},cm={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(r,A){switch(A){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},hm={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(r,A){if(A.type===20&&A.value==="none")return null;if(A.type===18){var e=fm[A.name];if(typeof e>"u")throw new Error('Attempting to parse an unsupported transform function "'+A.name+'"');return e(A.values)}return null}},um=function(r){var A=r.filter(function(e){return e.type===17}).map(function(e){return e.number});return A.length===6?A:null},dm=function(r){var A=r.filter(function(a){return a.type===17}).map(function(a){return a.number}),e=A[0],t=A[1];A[2],A[3];var i=A[4],s=A[5];A[6],A[7],A[8],A[9],A[10],A[11];var n=A[12],o=A[13];return A[14],A[15],A.length===16?[e,t,i,s,n,o]:null},fm={matrix:um,matrix3d:dm},Oh={type:16,number:50,flags:Pr},pm=[Oh,Oh],gm={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(r,A){var e=A.filter(se);return e.length!==2?pm:[e[0],e[1]]}},Bm={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(r,A){switch(A){case"hidden":return 1;case"collapse":return 2;default:return 0}}},Zr;(function(r){r.NORMAL="normal",r.BREAK_ALL="break-all",r.KEEP_ALL="keep-all"})(Zr||(Zr={}));for(var wm={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(r,A){switch(A){case"break-all":return Zr.BREAK_ALL;case"keep-all":return Zr.KEEP_ALL;default:return Zr.NORMAL}}},mm={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(r,A){if(A.type===20)return{auto:!0,order:0};if(ir(A))return{auto:!1,order:A.number};throw new Error("Invalid z-index number parsed")}},Nh={name:"time",parse:function(r,A){if(A.type===15)switch(A.unit.toLowerCase()){case"s":return 1e3*A.number;case"ms":return A.number}throw new Error("Unsupported time type")}},Cm={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(r,A){return ir(A)?A.number:1}},vm={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},bm={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(r,A){return A.filter(GA).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return e!==0})}},ym={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(r,A){var e=[],t=[];return A.forEach(function(i){switch(i.type){case 20:case 0:e.push(i.value);break;case 17:e.push(i.number.toString());break;case 4:t.push(e.join(" ")),e.length=0;break}}),e.length&&t.push(e.join(" ")),t.map(function(i){return i.indexOf(" ")===-1?i:"'"+i+"'"})}},Qm={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},Fm={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(r,A){return ir(A)?A.number:GA(A)&&A.value==="bold"?700:400}},Um={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(r,A){return A.filter(GA).map(function(e){return e.value})}},Em={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(r,A){switch(A){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},oe=function(r,A){return(r&A)!==0},xm={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(r,A){if(A.length===0)return[];var e=A[0];return e.type===20&&e.value==="none"?[]:A}},Tm={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(r,A){if(A.length===0)return null;var e=A[0];if(e.type===20&&e.value==="none")return null;for(var t=[],i=A.filter(ph),s=0;s<i.length;s++){var n=i[s],o=i[s+1];if(n.type===20){var a=o&&ir(o)?o.number:1;t.push({counter:n.value,increment:a})}}return t}},Sm={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(r,A){if(A.length===0)return[];for(var e=[],t=A.filter(ph),i=0;i<t.length;i++){var s=t[i],n=t[i+1];if(GA(s)&&s.value!=="none"){var o=n&&ir(n)?n.number:0;e.push({counter:s.value,reset:o})}}return e}},Hm={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(r,A){return A.filter($r).map(function(e){return Nh.parse(r,e)})}},Lm={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(r,A){if(A.length===0)return null;var e=A[0];if(e.type===20&&e.value==="none")return null;var t=[],i=A.filter(i1);if(i.length%2!==0)return null;for(var s=0;s<i.length;s+=2){var n=i[s].value,o=i[s+1].value;t.push({open:n,close:o})}return t}},Kh=function(r,A,e){if(!r)return"";var t=r[Math.min(A,r.length-1)];return t?e?t.open:t.close:""},Im={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(r,A){return A.length===1&&mo(A[0],"none")?[]:rt(A).map(function(e){for(var t={color:255,offsetX:de,offsetY:de,blur:de,spread:de,inset:!1},i=0,s=0;s<e.length;s++){var n=e[s];mo(n,"inset")?t.inset=!0:bt(n)?(i===0?t.offsetX=n:i===1?t.offsetY=n:i===2?t.blur=n:t.spread=n,i++):t.color=Qt.parse(r,n)}return t})}},Mm={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(r,A){var e=[0,1,2],t=[];return A.filter(GA).forEach(function(i){switch(i.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2);break}}),e.forEach(function(i){t.indexOf(i)===-1&&t.push(i)}),t}},Dm={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},_m={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(r,A){return $r(A)?A.number:0}},km=(function(){function r(A,e){var t,i;this.animationDuration=pA(A,Hm,e.animationDuration),this.backgroundClip=pA(A,o1,e.backgroundClip),this.backgroundColor=pA(A,a1,e.backgroundColor),this.backgroundImage=pA(A,w1,e.backgroundImage),this.backgroundOrigin=pA(A,m1,e.backgroundOrigin),this.backgroundPosition=pA(A,C1,e.backgroundPosition),this.backgroundRepeat=pA(A,v1,e.backgroundRepeat),this.backgroundSize=pA(A,y1,e.backgroundSize),this.borderTopColor=pA(A,F1,e.borderTopColor),this.borderRightColor=pA(A,U1,e.borderRightColor),this.borderBottomColor=pA(A,E1,e.borderBottomColor),this.borderLeftColor=pA(A,x1,e.borderLeftColor),this.borderTopLeftRadius=pA(A,T1,e.borderTopLeftRadius),this.borderTopRightRadius=pA(A,S1,e.borderTopRightRadius),this.borderBottomRightRadius=pA(A,H1,e.borderBottomRightRadius),this.borderBottomLeftRadius=pA(A,L1,e.borderBottomLeftRadius),this.borderTopStyle=pA(A,I1,e.borderTopStyle),this.borderRightStyle=pA(A,M1,e.borderRightStyle),this.borderBottomStyle=pA(A,D1,e.borderBottomStyle),this.borderLeftStyle=pA(A,_1,e.borderLeftStyle),this.borderTopWidth=pA(A,k1,e.borderTopWidth),this.borderRightWidth=pA(A,O1,e.borderRightWidth),this.borderBottomWidth=pA(A,N1,e.borderBottomWidth),this.borderLeftWidth=pA(A,K1,e.borderLeftWidth),this.boxShadow=pA(A,Im,e.boxShadow),this.color=pA(A,V1,e.color),this.direction=pA(A,P1,e.direction),this.display=pA(A,z1,e.display),this.float=pA(A,R1,e.cssFloat),this.fontFamily=pA(A,ym,e.fontFamily),this.fontSize=pA(A,Qm,e.fontSize),this.fontStyle=pA(A,Em,e.fontStyle),this.fontVariant=pA(A,Um,e.fontVariant),this.fontWeight=pA(A,Fm,e.fontWeight),this.letterSpacing=pA(A,W1,e.letterSpacing),this.lineBreak=pA(A,$1,e.lineBreak),this.lineHeight=pA(A,X1,e.lineHeight),this.listStyleImage=pA(A,J1,e.listStyleImage),this.listStylePosition=pA(A,Z1,e.listStylePosition),this.listStyleType=pA(A,yo,e.listStyleType),this.marginTop=pA(A,Y1,e.marginTop),this.marginRight=pA(A,j1,e.marginRight),this.marginBottom=pA(A,q1,e.marginBottom),this.marginLeft=pA(A,Am,e.marginLeft),this.opacity=pA(A,Cm,e.opacity);var s=pA(A,em,e.overflow);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0],this.overflowWrap=pA(A,tm,e.overflowWrap),this.paddingTop=pA(A,rm,e.paddingTop),this.paddingRight=pA(A,im,e.paddingRight),this.paddingBottom=pA(A,sm,e.paddingBottom),this.paddingLeft=pA(A,nm,e.paddingLeft),this.paintOrder=pA(A,Mm,e.paintOrder),this.position=pA(A,am,e.position),this.textAlign=pA(A,om,e.textAlign),this.textDecorationColor=pA(A,vm,(t=e.textDecorationColor)!==null&&t!==void 0?t:e.color),this.textDecorationLine=pA(A,bm,(i=e.textDecorationLine)!==null&&i!==void 0?i:e.textDecoration),this.textShadow=pA(A,lm,e.textShadow),this.textTransform=pA(A,cm,e.textTransform),this.transform=pA(A,hm,e.transform),this.transformOrigin=pA(A,gm,e.transformOrigin),this.visibility=pA(A,Bm,e.visibility),this.webkitTextStrokeColor=pA(A,Dm,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=pA(A,_m,e.webkitTextStrokeWidth),this.wordBreak=pA(A,wm,e.wordBreak),this.zIndex=pA(A,mm,e.zIndex)}return r.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},r.prototype.isTransparent=function(){return Ft(this.backgroundColor)},r.prototype.isTransformed=function(){return this.transform!==null},r.prototype.isPositioned=function(){return this.position!==0},r.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},r.prototype.isFloating=function(){return this.float!==0},r.prototype.isInlineLevel=function(){return oe(this.display,4)||oe(this.display,33554432)||oe(this.display,268435456)||oe(this.display,536870912)||oe(this.display,67108864)||oe(this.display,134217728)},r})(),Om=(function(){function r(A,e){this.content=pA(A,xm,e.content),this.quotes=pA(A,Lm,e.quotes)}return r})(),Vh=(function(){function r(A,e){this.counterIncrement=pA(A,Tm,e.counterIncrement),this.counterReset=pA(A,Sm,e.counterReset)}return r})(),pA=function(r,A,e){var t=new dh,i=e!==null&&typeof e<"u"?e.toString():A.initialValue;t.write(i);var s=new fh(t.read());switch(A.type){case 2:var n=s.parseComponentValue();return A.parse(r,GA(n)?n.value:A.initialValue);case 0:return A.parse(r,s.parseComponentValue());case 1:return A.parse(r,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(A.format){case"angle":return us.parse(r,s.parseComponentValue());case"color":return Qt.parse(r,s.parseComponentValue());case"image":return bo.parse(r,s.parseComponentValue());case"length":var o=s.parseComponentValue();return bt(o)?o:de;case"length-percentage":var a=s.parseComponentValue();return se(a)?a:de;case"time":return Nh.parse(r,s.parseComponentValue())}break}},Nm="data-html2canvas-debug",Km=function(r){var A=r.getAttribute(Nm);switch(A){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Qo=function(r,A){var e=Km(r);return e===1||A===e},it=(function(){function r(A,e){if(this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Qo(e,3))debugger;this.styles=new km(A,window.getComputedStyle(e,null)),Oo(e)&&(this.styles.animationDuration.some(function(t){return t>0})&&(e.style.animationDuration="0s"),this.styles.transform!==null&&(e.style.transform="none")),this.bounds=Wi(this.context,e),Qo(e,4)&&(this.flags|=16)}return r})(),Vm="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Ph="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yr=typeof Uint8Array>"u"?[]:new Uint8Array(256),ys=0;ys<Ph.length;ys++)Yr[Ph.charCodeAt(ys)]=ys;for(var Pm=function(r){var A=r.length*.75,e=r.length,t,i=0,s,n,o,a;r[r.length-1]==="="&&(A--,r[r.length-2]==="="&&A--);var l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(A):new Array(A),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t<e;t+=4)s=Yr[r.charCodeAt(t)],n=Yr[r.charCodeAt(t+1)],o=Yr[r.charCodeAt(t+2)],a=Yr[r.charCodeAt(t+3)],c[i++]=s<<2|n>>4,c[i++]=(n&15)<<4|o>>2,c[i++]=(o&3)<<6|a&63;return l},zm=function(r){for(var A=r.length,e=[],t=0;t<A;t+=2)e.push(r[t+1]<<8|r[t]);return e},Gm=function(r){for(var A=r.length,e=[],t=0;t<A;t+=4)e.push(r[t+3]<<24|r[t+2]<<16|r[t+1]<<8|r[t]);return e},Pt=5,Fo=11,Uo=2,Rm=Fo-Pt,zh=65536>>Pt,Wm=1<<Pt,Eo=Wm-1,$m=1024>>Pt,Xm=zh+$m,Jm=Xm,Zm=32,Ym=Jm+Zm,jm=65536>>Fo,qm=1<<Rm,AC=qm-1,Gh=function(r,A,e){return r.slice?r.slice(A,e):new Uint16Array(Array.prototype.slice.call(r,A,e))},eC=function(r,A,e){return r.slice?r.slice(A,e):new Uint32Array(Array.prototype.slice.call(r,A,e))},tC=function(r,A){var e=Pm(r),t=Array.isArray(e)?Gm(e):new Uint32Array(e),i=Array.isArray(e)?zm(e):new Uint16Array(e),s=24,n=Gh(i,s/2,t[4]/2),o=t[5]===2?Gh(i,(s+t[4])/2):eC(t,Math.ceil((s+t[4])/4));return new rC(t[0],t[1],t[2],t[3],n,o)},rC=(function(){function r(A,e,t,i,s,n){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=i,this.index=s,this.data=n}return r.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=this.index[A>>Pt],e=(e<<Uo)+(A&Eo),this.data[e];if(A<=65535)return e=this.index[zh+(A-55296>>Pt)],e=(e<<Uo)+(A&Eo),this.data[e];if(A<this.highStart)return e=Ym-jm+(A>>Fo),e=this.index[e],e+=A>>Pt&AC,e=this.index[e],e=(e<<Uo)+(A&Eo),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},r})(),Rh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",iC=typeof Uint8Array>"u"?[]:new Uint8Array(256),Qs=0;Qs<Rh.length;Qs++)iC[Rh.charCodeAt(Qs)]=Qs;var sC=1,xo=2,To=3,Wh=4,$h=5,nC=7,Xh=8,So=9,Ho=10,Jh=11,Zh=12,Yh=13,jh=14,Lo=15,oC=function(r){for(var A=[],e=0,t=r.length;e<t;){var i=r.charCodeAt(e++);if(i>=55296&&i<=56319&&e<t){var s=r.charCodeAt(e++);(s&64512)===56320?A.push(((i&1023)<<10)+(s&1023)+65536):(A.push(i),e--)}else A.push(i)}return A},aC=function(){for(var r=[],A=0;A<arguments.length;A++)r[A]=arguments[A];if(String.fromCodePoint)return String.fromCodePoint.apply(String,r);var e=r.length;if(!e)return"";for(var t=[],i=-1,s="";++i<e;){var n=r[i];n<=65535?t.push(n):(n-=65536,t.push((n>>10)+55296,n%1024+56320)),(i+1===e||t.length>16384)&&(s+=String.fromCharCode.apply(String,t),t.length=0)}return s},lC=tC(Vm),Ve="×",Io="÷",cC=function(r){return lC.get(r)},hC=function(r,A,e){var t=e-2,i=A[t],s=A[e-1],n=A[e];if(s===xo&&n===To)return Ve;if(s===xo||s===To||s===Wh||n===xo||n===To||n===Wh)return Io;if(s===Xh&&[Xh,So,Jh,Zh].indexOf(n)!==-1||(s===Jh||s===So)&&(n===So||n===Ho)||(s===Zh||s===Ho)&&n===Ho||n===Yh||n===$h||n===nC||s===sC)return Ve;if(s===Yh&&n===jh){for(;i===$h;)i=A[--t];if(i===jh)return Ve}if(s===Lo&&n===Lo){for(var o=0;i===Lo;)o++,i=A[--t];if(o%2===0)return Ve}return Io},uC=function(r){var A=oC(r),e=A.length,t=0,i=0,s=A.map(cC);return{next:function(){if(t>=e)return{done:!0,value:null};for(var n=Ve;t<e&&(n=hC(A,s,++t))===Ve;);if(n!==Ve||t===e){var o=aC.apply(null,A.slice(i,t));return i=t,{value:o,done:!1}}return{done:!0,value:null}}}},dC=function(r){for(var A=uC(r),e=[],t;!(t=A.next()).done;)t.value&&e.push(t.value.slice());return e},fC=function(r){var A=123;if(r.createRange){var e=r.createRange();if(e.getBoundingClientRect){var t=r.createElement("boundtest");t.style.height=A+"px",t.style.display="block",r.body.appendChild(t),e.selectNode(t);var i=e.getBoundingClientRect(),s=Math.round(i.height);if(r.body.removeChild(t),s===A)return!0}}return!1},pC=function(r){var A=r.createElement("boundtest");A.style.width="50px",A.style.display="block",A.style.fontSize="12px",A.style.letterSpacing="0px",A.style.wordSpacing="0px",r.body.appendChild(A);var e=r.createRange();A.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var t=A.firstChild,i=$i(t.data).map(function(a){return te(a)}),s=0,n={},o=i.every(function(a,l){e.setStart(t,s),e.setEnd(t,s+a.length);var c=e.getBoundingClientRect();s+=a.length;var u=c.x>n.x||c.y>n.y;return n=c,l===0?!0:u});return r.body.removeChild(A),o},gC=function(){return typeof new Image().crossOrigin<"u"},BC=function(){return typeof new XMLHttpRequest().responseType=="string"},wC=function(r){var A=new Image,e=r.createElement("canvas"),t=e.getContext("2d");if(!t)return!1;A.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{t.drawImage(A,0,0),e.toDataURL()}catch{return!1}return!0},qh=function(r){return r[0]===0&&r[1]===255&&r[2]===0&&r[3]===255},mC=function(r){var A=r.createElement("canvas"),e=100;A.width=e,A.height=e;var t=A.getContext("2d");if(!t)return Promise.reject(!1);t.fillStyle="rgb(0, 255, 0)",t.fillRect(0,0,e,e);var i=new Image,s=A.toDataURL();i.src=s;var n=Mo(e,e,0,0,i);return t.fillStyle="red",t.fillRect(0,0,e,e),Au(n).then(function(o){t.drawImage(o,0,0);var a=t.getImageData(0,0,e,e).data;t.fillStyle="red",t.fillRect(0,0,e,e);var l=r.createElement("div");return l.style.backgroundImage="url("+s+")",l.style.height=e+"px",qh(a)?Au(Mo(e,e,0,0,l)):Promise.reject(!1)}).then(function(o){return t.drawImage(o,0,0),qh(t.getImageData(0,0,e,e).data)}).catch(function(){return!1})},Mo=function(r,A,e,t,i){var s="http://www.w3.org/2000/svg",n=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return n.setAttributeNS(null,"width",r.toString()),n.setAttributeNS(null,"height",A.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",e.toString()),o.setAttributeNS(null,"y",t.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),n.appendChild(o),o.appendChild(i),n},Au=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){return A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},fe={get SUPPORT_RANGE_BOUNDS(){var r=fC(document);return Object.defineProperty(fe,"SUPPORT_RANGE_BOUNDS",{value:r}),r},get SUPPORT_WORD_BREAKING(){var r=fe.SUPPORT_RANGE_BOUNDS&&pC(document);return Object.defineProperty(fe,"SUPPORT_WORD_BREAKING",{value:r}),r},get SUPPORT_SVG_DRAWING(){var r=wC(document);return Object.defineProperty(fe,"SUPPORT_SVG_DRAWING",{value:r}),r},get SUPPORT_FOREIGNOBJECT_DRAWING(){var r=typeof Array.from=="function"&&typeof window.fetch=="function"?mC(document):Promise.resolve(!1);return Object.defineProperty(fe,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:r}),r},get SUPPORT_CORS_IMAGES(){var r=gC();return Object.defineProperty(fe,"SUPPORT_CORS_IMAGES",{value:r}),r},get SUPPORT_RESPONSE_TYPE(){var r=BC();return Object.defineProperty(fe,"SUPPORT_RESPONSE_TYPE",{value:r}),r},get SUPPORT_CORS_XHR(){var r="withCredentials"in new XMLHttpRequest;return Object.defineProperty(fe,"SUPPORT_CORS_XHR",{value:r}),r},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var r=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(fe,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:r}),r}},jr=(function(){function r(A,e){this.text=A,this.bounds=e}return r})(),CC=function(r,A,e,t){var i=yC(A,e),s=[],n=0;return i.forEach(function(o){if(e.textDecorationLine.length||o.trim().length>0)if(fe.SUPPORT_RANGE_BOUNDS){var a=eu(t,n,o.length).getClientRects();if(a.length>1){var l=Do(o),c=0;l.forEach(function(d){s.push(new jr(d,lt.fromDOMRectList(r,eu(t,c+n,d.length).getClientRects()))),c+=d.length})}else s.push(new jr(o,lt.fromDOMRectList(r,a)))}else{var u=t.splitText(o.length);s.push(new jr(o,vC(r,t))),t=u}else fe.SUPPORT_RANGE_BOUNDS||(t=t.splitText(o.length));n+=o.length}),s},vC=function(r,A){var e=A.ownerDocument;if(e){var t=e.createElement("html2canvaswrapper");t.appendChild(A.cloneNode(!0));var i=A.parentNode;if(i){i.replaceChild(t,A);var s=Wi(r,t);return t.firstChild&&i.replaceChild(t.firstChild,t),s}}return lt.EMPTY},eu=function(r,A,e){var t=r.ownerDocument;if(!t)throw new Error("Node has no owner document");var i=t.createRange();return i.setStart(r,A),i.setEnd(r,A+e),i},Do=function(r){if(fe.SUPPORT_NATIVE_TEXT_SEGMENTATION){var A=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(A.segment(r)).map(function(e){return e.segment})}return dC(r)},bC=function(r,A){if(fe.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(e.segment(r)).map(function(t){return t.segment})}return FC(r,A)},yC=function(r,A){return A.letterSpacing!==0?Do(r):bC(r,A)},QC=[32,160,4961,65792,65793,4153,4241],FC=function(r,A){for(var e=jB(r,{lineBreak:A.lineBreak,wordBreak:A.overflowWrap==="break-word"?"break-word":A.wordBreak}),t=[],i,s=function(){if(i.value){var n=i.value.slice(),o=$i(n),a="";o.forEach(function(l){QC.indexOf(l)===-1?a+=te(l):(a.length&&t.push(a),t.push(te(l)),a="")}),a.length&&t.push(a)}};!(i=e.next()).done;)s();return t},UC=(function(){function r(A,e,t){this.text=EC(e.data,t.textTransform),this.textBounds=CC(A,this.text,t,e)}return r})(),EC=function(r,A){switch(A){case 1:return r.toLowerCase();case 3:return r.replace(xC,TC);case 2:return r.toUpperCase();default:return r}},xC=/(^|\s|:|-|\(|\))([a-z])/g,TC=function(r,A,e){return r.length>0?A+e.toUpperCase():r},tu=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.src=t.currentSrc||t.src,i.intrinsicWidth=t.naturalWidth,i.intrinsicHeight=t.naturalHeight,i.context.cache.addImage(i.src),i}return A})(it),ru=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.canvas=t,i.intrinsicWidth=t.width,i.intrinsicHeight=t.height,i}return A})(it),iu=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this,s=new XMLSerializer,n=Wi(e,t);return t.setAttribute("width",n.width+"px"),t.setAttribute("height",n.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(s.serializeToString(t)),i.intrinsicWidth=t.width.baseVal.value,i.intrinsicHeight=t.height.baseVal.value,i.context.cache.addImage(i.svg),i}return A})(it),su=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.value=t.value,i}return A})(it),_o=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.start=t.start,i.reversed=typeof t.reversed=="boolean"&&t.reversed===!0,i}return A})(it),SC=[{type:15,flags:0,unit:"px",number:3}],HC=[{type:16,flags:0,number:50}],LC=function(r){return r.width>r.height?new lt(r.left+(r.width-r.height)/2,r.top,r.height,r.height):r.width<r.height?new lt(r.left,r.top+(r.height-r.width)/2,r.width,r.width):r},IC=function(r){var A=r.type===MC?new Array(r.value.length+1).join("•"):r.value;return A.length===0?r.placeholder||"":A},Fs="checkbox",Us="radio",MC="password",nu=707406591,ko=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;switch(i.type=t.type.toLowerCase(),i.checked=t.checked,i.value=IC(t),(i.type===Fs||i.type===Us)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=LC(i.bounds)),i.type){case Fs:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=SC;break;case Us:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=HC;break}return i}return A})(it),ou=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this,s=t.options[t.selectedIndex||0];return i.value=s&&s.text||"",i}return A})(it),au=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.value=t.value,i}return A})(it),lu=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;i.src=t.src,i.width=parseInt(t.width,10)||0,i.height=parseInt(t.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){i.tree=hu(e,t.contentWindow.document.documentElement);var s=t.contentWindow.document.documentElement?Jr(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):ht.TRANSPARENT,n=t.contentWindow.document.body?Jr(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):ht.TRANSPARENT;i.backgroundColor=Ft(s)?Ft(n)?i.styles.backgroundColor:n:s}}catch{}return i}return A})(it),DC=["OL","UL","MENU"],Es=function(r,A,e,t){for(var i=A.firstChild,s=void 0;i;i=s)if(s=i.nextSibling,uu(i)&&i.data.trim().length>0)e.textNodes.push(new UC(r,i,e.styles));else if(or(i))if(wu(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return Es(r,o,e,t)});else{var n=cu(r,i);n.styles.isVisible()&&(_C(i,n,t)?n.flags|=4:kC(n.styles)&&(n.flags|=2),DC.indexOf(i.tagName)!==-1&&(n.flags|=8),e.elements.push(n),i.slot,i.shadowRoot?Es(r,i.shadowRoot,n,t):!Ts(i)&&!du(i)&&!Ss(i)&&Es(r,i,n,t))}},cu=function(r,A){return Ko(A)?new tu(r,A):fu(A)?new ru(r,A):du(A)?new iu(r,A):OC(A)?new su(r,A):NC(A)?new _o(r,A):KC(A)?new ko(r,A):Ss(A)?new ou(r,A):Ts(A)?new au(r,A):gu(A)?new lu(r,A):new it(r,A)},hu=function(r,A){var e=cu(r,A);return e.flags|=4,Es(r,A,e,e),e},_C=function(r,A,e){return A.styles.isPositionedWithZIndex()||A.styles.opacity<1||A.styles.isTransformed()||No(r)&&e.styles.isTransparent()},kC=function(r){return r.isPositioned()||r.isFloating()},uu=function(r){return r.nodeType===Node.TEXT_NODE},or=function(r){return r.nodeType===Node.ELEMENT_NODE},Oo=function(r){return or(r)&&typeof r.style<"u"&&!xs(r)},xs=function(r){return typeof r.className=="object"},OC=function(r){return r.tagName==="LI"},NC=function(r){return r.tagName==="OL"},KC=function(r){return r.tagName==="INPUT"},VC=function(r){return r.tagName==="HTML"},du=function(r){return r.tagName==="svg"},No=function(r){return r.tagName==="BODY"},fu=function(r){return r.tagName==="CANVAS"},pu=function(r){return r.tagName==="VIDEO"},Ko=function(r){return r.tagName==="IMG"},gu=function(r){return r.tagName==="IFRAME"},Bu=function(r){return r.tagName==="STYLE"},PC=function(r){return r.tagName==="SCRIPT"},Ts=function(r){return r.tagName==="TEXTAREA"},Ss=function(r){return r.tagName==="SELECT"},wu=function(r){return r.tagName==="SLOT"},mu=function(r){return r.tagName.indexOf("-")>0},zC=(function(){function r(){this.counters={}}return r.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},r.prototype.getCounterValues=function(A){var e=this.counters[A];return e||[]},r.prototype.pop=function(A){var e=this;A.forEach(function(t){return e.counters[t].pop()})},r.prototype.parse=function(A){var e=this,t=A.counterIncrement,i=A.counterReset,s=!0;t!==null&&t.forEach(function(o){var a=e.counters[o.counter];a&&o.increment!==0&&(s=!1,a.length||a.push(1),a[Math.max(0,a.length-1)]+=o.increment)});var n=[];return s&&i.forEach(function(o){var a=e.counters[o.counter];n.push(o.counter),a||(a=e.counters[o.counter]=[]),a.push(o.reset)}),n},r})(),Cu={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},vu={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},GC={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},RC={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ar=function(r,A,e,t,i,s){return r<A||r>e?Ai(r,i,s.length>0):t.integers.reduce(function(n,o,a){for(;r>=o;)r-=o,n+=t.values[a];return n},"")+s},bu=function(r,A,e,t){var i="";do e||r--,i=t(r)+i,r/=A;while(r*A>=A);return i},re=function(r,A,e,t,i){var s=e-A+1;return(r<0?"-":"")+(bu(Math.abs(r),s,t,function(n){return te(Math.floor(n%s)+A)})+i)},zt=function(r,A,e){e===void 0&&(e=". ");var t=A.length;return bu(Math.abs(r),t,!1,function(i){return A[Math.floor(i%t)]})+e},lr=1,Et=2,xt=4,qr=8,ut=function(r,A,e,t,i,s){if(r<-9999||r>9999)return Ai(r,4,i.length>0);var n=Math.abs(r),o=i;if(n===0)return A[0]+o;for(var a=0;n>0&&a<=4;a++){var l=n%10;l===0&&oe(s,lr)&&o!==""?o=A[l]+o:l>1||l===1&&a===0||l===1&&a===1&&oe(s,Et)||l===1&&a===1&&oe(s,xt)&&r>100||l===1&&a>1&&oe(s,qr)?o=A[l]+(a>0?e[a-1]:"")+o:l===1&&a>0&&(o=e[a-1]+o),n=Math.floor(n/10)}return(r<0?t:"")+o},yu="十百千萬",Qu="拾佰仟萬",Fu="マイナス",Vo="마이너스",Ai=function(r,A,e){var t=e?". ":"",i=e?"、":"",s=e?", ":"",n=e?" ":"";switch(A){case 0:return"•"+n;case 1:return"◦"+n;case 2:return"◾"+n;case 5:var o=re(r,48,57,!0,t);return o.length<4?"0"+o:o;case 4:return zt(r,"〇一二三四五六七八九",i);case 6:return ar(r,1,3999,Cu,3,t).toLowerCase();case 7:return ar(r,1,3999,Cu,3,t);case 8:return re(r,945,969,!1,t);case 9:return re(r,97,122,!1,t);case 10:return re(r,65,90,!1,t);case 11:return re(r,1632,1641,!0,t);case 12:case 49:return ar(r,1,9999,vu,3,t);case 35:return ar(r,1,9999,vu,3,t).toLowerCase();case 13:return re(r,2534,2543,!0,t);case 14:case 30:return re(r,6112,6121,!0,t);case 15:return zt(r,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return zt(r,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return ut(r,"零一二三四五六七八九",yu,"負",i,Et|xt|qr);case 47:return ut(r,"零壹貳參肆伍陸柒捌玖",Qu,"負",i,lr|Et|xt|qr);case 42:return ut(r,"零一二三四五六七八九",yu,"负",i,Et|xt|qr);case 41:return ut(r,"零壹贰叁肆伍陆柒捌玖",Qu,"负",i,lr|Et|xt|qr);case 26:return ut(r,"〇一二三四五六七八九","十百千万",Fu,i,0);case 25:return ut(r,"零壱弐参四伍六七八九","拾百千万",Fu,i,lr|Et|xt);case 31:return ut(r,"영일이삼사오육칠팔구","십백천만",Vo,s,lr|Et|xt);case 33:return ut(r,"零一二三四五六七八九","十百千萬",Vo,s,0);case 32:return ut(r,"零壹貳參四五六七八九","拾百千",Vo,s,lr|Et|xt);case 18:return re(r,2406,2415,!0,t);case 20:return ar(r,1,19999,RC,3,t);case 21:return re(r,2790,2799,!0,t);case 22:return re(r,2662,2671,!0,t);case 22:return ar(r,1,10999,GC,3,t);case 23:return zt(r,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return zt(r,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return re(r,3302,3311,!0,t);case 28:return zt(r,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return zt(r,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return re(r,3792,3801,!0,t);case 37:return re(r,6160,6169,!0,t);case 38:return re(r,4160,4169,!0,t);case 39:return re(r,2918,2927,!0,t);case 40:return re(r,1776,1785,!0,t);case 43:return re(r,3046,3055,!0,t);case 44:return re(r,3174,3183,!0,t);case 45:return re(r,3664,3673,!0,t);case 46:return re(r,3872,3881,!0,t);default:return re(r,48,57,!0,t)}},Uu="data-html2canvas-ignore",Eu=(function(){function r(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new zC,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return r.prototype.toIFrame=function(A,e){var t=this,i=WC(A,e);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var s=A.defaultView.pageXOffset,n=A.defaultView.pageYOffset,o=i.contentWindow,a=o.document,l=JC(i).then(function(){return be(t,void 0,void 0,function(){var c,u;return me(this,function(d){switch(d.label){case 0:return this.scrolledElements.forEach(qC),o&&(o.scrollTo(e.left,e.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==e.top||o.scrollX!==e.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-e.left,o.scrollY-e.top,0,0))),c=this.options.onclone,u=this.clonedReferenceElement,typeof u>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:a.fonts&&a.fonts.ready?[4,a.fonts.ready]:[3,2];case 1:d.sent(),d.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,XC(a)]:[3,4];case 3:d.sent(),d.label=4;case 4:return typeof c=="function"?[2,Promise.resolve().then(function(){return c(a,u)}).then(function(){return i})]:[2,i]}})})});return a.open(),a.write(YC(document.doctype)+"<html></html>"),jC(this.referenceElement.ownerDocument,s,n),a.replaceChild(a.adoptNode(this.documentElement),a.documentElement),a.close(),l},r.prototype.createElementClone=function(A){if(Qo(A,2))debugger;if(fu(A))return this.createCanvasClone(A);if(pu(A))return this.createVideoClone(A);if(Bu(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Ko(e)&&(Ko(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),e.loading==="lazy"&&(e.loading="eager")),mu(e)?this.createCustomElementClone(e):e},r.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return Po(A.style,e),e},r.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(s,n){return n&&typeof n.cssText=="string"?s+n.cssText:s},""),i=A.cloneNode(!1);return i.textContent=t,i}}catch(s){if(this.context.logger.error("Unable to access cssRules property",s),s.name!=="SecurityError")throw s}return A.cloneNode(!1)},r.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var i=A.cloneNode(!1);try{i.width=A.width,i.height=A.height;var s=A.getContext("2d"),n=i.getContext("2d");if(n)if(!this.options.allowTaint&&s)n.putImageData(s.getImageData(0,0,A.width,A.height),0,0);else{var o=(e=A.getContext("webgl2"))!==null&&e!==void 0?e:A.getContext("webgl");if(o){var a=o.getContextAttributes();a?.preserveDrawingBuffer===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}n.drawImage(A,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",A)}return i},r.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch{this.context.logger.info("Unable to clone video as it is tainted",A)}var i=A.ownerDocument.createElement("canvas");return i.width=A.offsetWidth,i.height=A.offsetHeight,i},r.prototype.appendChildNode=function(A,e,t){(!or(e)||!PC(e)&&!e.hasAttribute(Uu)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(e)))&&(!this.options.copyStyles||!or(e)||!Bu(e))&&A.appendChild(this.cloneNode(e,t))},r.prototype.cloneChildNodes=function(A,e,t){for(var i=this,s=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;s;s=s.nextSibling)if(or(s)&&wu(s)&&typeof s.assignedNodes=="function"){var n=s.assignedNodes();n.length&&n.forEach(function(o){return i.appendChildNode(e,o,t)})}else this.appendChildNode(e,s,t)},r.prototype.cloneNode=function(A,e){if(uu(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&or(A)&&(Oo(A)||xs(A))){var i=this.createElementClone(A);i.style.transitionProperty="none";var s=t.getComputedStyle(A),n=t.getComputedStyle(A,":before"),o=t.getComputedStyle(A,":after");this.referenceElement===A&&Oo(i)&&(this.clonedReferenceElement=i),No(i)&&tv(i);var a=this.counters.parse(new Vh(this.context,s)),l=this.resolvePseudoContent(A,i,n,ei.BEFORE);mu(A)&&(e=!0),pu(A)||this.cloneChildNodes(A,i,e),l&&i.insertBefore(l,i.firstChild);var c=this.resolvePseudoContent(A,i,o,ei.AFTER);return c&&i.appendChild(c),this.counters.pop(a),(s&&(this.options.copyStyles||xs(A))&&!gu(A)||e)&&Po(s,i),(A.scrollTop!==0||A.scrollLeft!==0)&&this.scrolledElements.push([i,A.scrollLeft,A.scrollTop]),(Ts(A)||Ss(A))&&(Ts(i)||Ss(i))&&(i.value=A.value),i}return A.cloneNode(!1)},r.prototype.resolvePseudoContent=function(A,e,t,i){var s=this;if(t){var n=t.content,o=e.ownerDocument;if(!(!o||!n||n==="none"||n==="-moz-alt-content"||t.display==="none")){this.counters.parse(new Vh(this.context,t));var a=new Om(this.context,t),l=o.createElement("html2canvaspseudoelement");Po(t,l),a.content.forEach(function(u){if(u.type===0)l.appendChild(o.createTextNode(u.value));else if(u.type===22){var d=o.createElement("img");d.src=u.value,d.style.opacity="1",l.appendChild(d)}else if(u.type===18){if(u.name==="attr"){var B=u.values.filter(GA);B.length&&l.appendChild(o.createTextNode(A.getAttribute(B[0].value)||""))}else if(u.name==="counter"){var p=u.values.filter(sr),f=p[0],w=p[1];if(f&&GA(f)){var F=s.counters.getCounterValue(f.value),C=w&&GA(w)?yo.parse(s.context,w.value):3;l.appendChild(o.createTextNode(Ai(F,C,!1)))}}else if(u.name==="counters"){var E=u.values.filter(sr),f=E[0],U=E[1],w=E[2];if(f&&GA(f)){var S=s.counters.getCounterValues(f.value),P=w&&GA(w)?yo.parse(s.context,w.value):3,z=U&&U.type===0?U.value:"",J=S.map(function(W){return Ai(W,P,!1)}).join(z);l.appendChild(o.createTextNode(J))}}}else if(u.type===20)switch(u.value){case"open-quote":l.appendChild(o.createTextNode(Kh(a.quotes,s.quoteDepth++,!0)));break;case"close-quote":l.appendChild(o.createTextNode(Kh(a.quotes,--s.quoteDepth,!1)));break;default:l.appendChild(o.createTextNode(u.value))}}),l.className=zo+" "+Go;var c=i===ei.BEFORE?" "+zo:" "+Go;return xs(e)?e.className.baseValue+=c:e.className+=c,l}}},r.destroy=function(A){return A.parentNode?(A.parentNode.removeChild(A),!0):!1},r})(),ei;(function(r){r[r.BEFORE=0]="BEFORE",r[r.AFTER=1]="AFTER"})(ei||(ei={}));var WC=function(r,A){var e=r.createElement("iframe");return e.className="html2canvas-container",e.style.visibility="hidden",e.style.position="fixed",e.style.left="-10000px",e.style.top="0px",e.style.border="0",e.width=A.width.toString(),e.height=A.height.toString(),e.scrolling="no",e.setAttribute(Uu,"true"),r.body.appendChild(e),e},$C=function(r){return new Promise(function(A){if(r.complete){A();return}if(!r.src){A();return}r.onload=A,r.onerror=A})},XC=function(r){return Promise.all([].slice.call(r.images,0).map($C))},JC=function(r){return new Promise(function(A,e){var t=r.contentWindow;if(!t)return e("No window assigned for iframe");var i=t.document;t.onload=r.onload=function(){t.onload=r.onload=null;var s=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(s),A(r))},50)}})},ZC=["all","d","content"],Po=function(r,A){for(var e=r.length-1;e>=0;e--){var t=r.item(e);ZC.indexOf(t)===-1&&A.style.setProperty(t,r.getPropertyValue(t))}return A},YC=function(r){var A="";return r&&(A+="<!DOCTYPE ",r.name&&(A+=r.name),r.internalSubset&&(A+=r.internalSubset),r.publicId&&(A+='"'+r.publicId+'"'),r.systemId&&(A+='"'+r.systemId+'"'),A+=">"),A},jC=function(r,A,e){r&&r.defaultView&&(A!==r.defaultView.pageXOffset||e!==r.defaultView.pageYOffset)&&r.defaultView.scrollTo(A,e)},qC=function(r){var A=r[0],e=r[1],t=r[2];A.scrollLeft=e,A.scrollTop=t},Av=":before",ev=":after",zo="___html2canvas___pseudoelement_before",Go="___html2canvas___pseudoelement_after",xu=`{
7
7
  content: "" !important;
8
8
  display: none !important;
9
- }`,ev=function(r){tv(r,"."+zo+jC+xu+`
10
- .`+Go+Av+xu)},tv=function(r,A){var e=r.ownerDocument;if(e){var t=e.createElement("style");t.textContent=A,r.appendChild(t)}},Tu=(function(){function r(){}return r.getOrigin=function(A){var e=r._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},r.isSameOrigin=function(A){return r.getOrigin(A)===r._origin},r.setContext=function(A){r._link=A.document.createElement("a"),r._origin=r.getOrigin(A.location.href)},r._origin="about:blank",r})(),rv=(function(){function r(A,e){this.context=A,this._options=e,this._cache={}}return r.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(Wo(A)||ov(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),e},r.prototype.match=function(A){return this._cache[A]},r.prototype.loadImage=function(A){return ye(this,void 0,void 0,function(){var e,t,i,s,n=this;return me(this,function(o){switch(o.label){case 0:return e=Tu.isSameOrigin(A),t=!Ro(A)&&this._options.useCORS===!0&&fe.SUPPORT_CORS_IMAGES&&!e,i=!Ro(A)&&!e&&!Wo(A)&&typeof this._options.proxy=="string"&&fe.SUPPORT_CORS_XHR&&!t,!e&&this._options.allowTaint===!1&&!Ro(A)&&!Wo(A)&&!i&&!t?[2]:(s=A,i?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(a,l){var c=new Image;c.onload=function(){return a(c)},c.onerror=l,(av(s)||t)&&(c.crossOrigin="anonymous"),c.src=s,c.complete===!0&&setTimeout(function(){return a(c)},500),n._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+n._options.imageTimeout+"ms) loading image")},n._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},r.prototype.has=function(A){return typeof this._cache[A]<"u"},r.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},r.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var i=A.substring(0,256);return new Promise(function(s,n){var o=fe.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")s(a.response);else{var u=new FileReader;u.addEventListener("load",function(){return s(u.result)},!1),u.addEventListener("error",function(d){return n(d)},!1),u.readAsDataURL(a.response)}else n("Failed to proxy resource "+i+" with status code "+a.status)},a.onerror=n;var l=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+l+"url="+encodeURIComponent(A)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),e._options.imageTimeout){var c=e._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return n("Timed out ("+c+"ms) proxying "+i)}}a.send()})},r})(),iv=/^data:image\/svg\+xml/i,sv=/^data:image\/.*;base64,/i,nv=/^data:image\/.*/i,ov=function(r){return fe.SUPPORT_SVG_DRAWING||!lv(r)},Ro=function(r){return nv.test(r)},av=function(r){return sv.test(r)},Wo=function(r){return r.substr(0,4)==="blob"},lv=function(r){return r.substr(-3).toLowerCase()==="svg"||iv.test(r)},hA=(function(){function r(A,e){this.type=0,this.x=A,this.y=e}return r.prototype.add=function(A,e){return new r(this.x+A,this.y+e)},r})(),cr=function(r,A,e){return new hA(r.x+(A.x-r.x)*e,r.y+(A.y-r.y)*e)},Hs=(function(){function r(A,e,t,i){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=i}return r.prototype.subdivide=function(A,e){var t=cr(this.start,this.startControl,A),i=cr(this.startControl,this.endControl,A),s=cr(this.endControl,this.end,A),n=cr(t,i,A),o=cr(i,s,A),a=cr(n,o,A);return e?new r(this.start,t,n,a):new r(a,o,s,this.end)},r.prototype.add=function(A,e){return new r(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},r.prototype.reverse=function(){return new r(this.end,this.endControl,this.startControl,this.start)},r})(),Ve=function(r){return r.type===1},cv=(function(){function r(A){var e=A.styles,t=A.bounds,i=Xr(e.borderTopLeftRadius,t.width,t.height),s=i[0],n=i[1],o=Xr(e.borderTopRightRadius,t.width,t.height),a=o[0],l=o[1],c=Xr(e.borderBottomRightRadius,t.width,t.height),u=c[0],d=c[1],B=Xr(e.borderBottomLeftRadius,t.width,t.height),p=B[0],f=B[1],g=[];g.push((s+a)/t.width),g.push((p+u)/t.width),g.push((n+f)/t.height),g.push((l+d)/t.height);var Q=Math.max.apply(Math,g);Q>1&&(s/=Q,n/=Q,a/=Q,l/=Q,u/=Q,d/=Q,p/=Q,f/=Q);var m=t.width-a,E=t.height-d,F=t.width-u,S=t.height-f,P=e.borderTopWidth,z=e.borderRightWidth,eA=e.borderBottomWidth,V=e.borderLeftWidth,Y=RA(e.paddingTop,A.bounds.width),X=RA(e.paddingRight,A.bounds.width),fA=RA(e.paddingBottom,A.bounds.width),oA=RA(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||n>0?ZA(t.left+V/3,t.top+P/3,s-V/3,n-P/3,PA.TOP_LEFT):new hA(t.left+V/3,t.top+P/3),this.topRightBorderDoubleOuterBox=s>0||n>0?ZA(t.left+m,t.top+P/3,a-z/3,l-P/3,PA.TOP_RIGHT):new hA(t.left+t.width-z/3,t.top+P/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?ZA(t.left+F,t.top+E,u-z/3,d-eA/3,PA.BOTTOM_RIGHT):new hA(t.left+t.width-z/3,t.top+t.height-eA/3),this.bottomLeftBorderDoubleOuterBox=p>0||f>0?ZA(t.left+V/3,t.top+S,p-V/3,f-eA/3,PA.BOTTOM_LEFT):new hA(t.left+V/3,t.top+t.height-eA/3),this.topLeftBorderDoubleInnerBox=s>0||n>0?ZA(t.left+V*2/3,t.top+P*2/3,s-V*2/3,n-P*2/3,PA.TOP_LEFT):new hA(t.left+V*2/3,t.top+P*2/3),this.topRightBorderDoubleInnerBox=s>0||n>0?ZA(t.left+m,t.top+P*2/3,a-z*2/3,l-P*2/3,PA.TOP_RIGHT):new hA(t.left+t.width-z*2/3,t.top+P*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?ZA(t.left+F,t.top+E,u-z*2/3,d-eA*2/3,PA.BOTTOM_RIGHT):new hA(t.left+t.width-z*2/3,t.top+t.height-eA*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||f>0?ZA(t.left+V*2/3,t.top+S,p-V*2/3,f-eA*2/3,PA.BOTTOM_LEFT):new hA(t.left+V*2/3,t.top+t.height-eA*2/3),this.topLeftBorderStroke=s>0||n>0?ZA(t.left+V/2,t.top+P/2,s-V/2,n-P/2,PA.TOP_LEFT):new hA(t.left+V/2,t.top+P/2),this.topRightBorderStroke=s>0||n>0?ZA(t.left+m,t.top+P/2,a-z/2,l-P/2,PA.TOP_RIGHT):new hA(t.left+t.width-z/2,t.top+P/2),this.bottomRightBorderStroke=u>0||d>0?ZA(t.left+F,t.top+E,u-z/2,d-eA/2,PA.BOTTOM_RIGHT):new hA(t.left+t.width-z/2,t.top+t.height-eA/2),this.bottomLeftBorderStroke=p>0||f>0?ZA(t.left+V/2,t.top+S,p-V/2,f-eA/2,PA.BOTTOM_LEFT):new hA(t.left+V/2,t.top+t.height-eA/2),this.topLeftBorderBox=s>0||n>0?ZA(t.left,t.top,s,n,PA.TOP_LEFT):new hA(t.left,t.top),this.topRightBorderBox=a>0||l>0?ZA(t.left+m,t.top,a,l,PA.TOP_RIGHT):new hA(t.left+t.width,t.top),this.bottomRightBorderBox=u>0||d>0?ZA(t.left+F,t.top+E,u,d,PA.BOTTOM_RIGHT):new hA(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=p>0||f>0?ZA(t.left,t.top+S,p,f,PA.BOTTOM_LEFT):new hA(t.left,t.top+t.height),this.topLeftPaddingBox=s>0||n>0?ZA(t.left+V,t.top+P,Math.max(0,s-V),Math.max(0,n-P),PA.TOP_LEFT):new hA(t.left+V,t.top+P),this.topRightPaddingBox=a>0||l>0?ZA(t.left+Math.min(m,t.width-z),t.top+P,m>t.width+z?0:Math.max(0,a-z),Math.max(0,l-P),PA.TOP_RIGHT):new hA(t.left+t.width-z,t.top+P),this.bottomRightPaddingBox=u>0||d>0?ZA(t.left+Math.min(F,t.width-V),t.top+Math.min(E,t.height-eA),Math.max(0,u-z),Math.max(0,d-eA),PA.BOTTOM_RIGHT):new hA(t.left+t.width-z,t.top+t.height-eA),this.bottomLeftPaddingBox=p>0||f>0?ZA(t.left+V,t.top+Math.min(S,t.height-eA),Math.max(0,p-V),Math.max(0,f-eA),PA.BOTTOM_LEFT):new hA(t.left+V,t.top+t.height-eA),this.topLeftContentBox=s>0||n>0?ZA(t.left+V+oA,t.top+P+Y,Math.max(0,s-(V+oA)),Math.max(0,n-(P+Y)),PA.TOP_LEFT):new hA(t.left+V+oA,t.top+P+Y),this.topRightContentBox=a>0||l>0?ZA(t.left+Math.min(m,t.width+V+oA),t.top+P+Y,m>t.width+V+oA?0:a-V+oA,l-(P+Y),PA.TOP_RIGHT):new hA(t.left+t.width-(z+X),t.top+P+Y),this.bottomRightContentBox=u>0||d>0?ZA(t.left+Math.min(F,t.width-(V+oA)),t.top+Math.min(E,t.height+P+Y),Math.max(0,u-(z+X)),d-(eA+fA),PA.BOTTOM_RIGHT):new hA(t.left+t.width-(z+X),t.top+t.height-(eA+fA)),this.bottomLeftContentBox=p>0||f>0?ZA(t.left+V+oA,t.top+S,Math.max(0,p-(V+oA)),f-(eA+fA),PA.BOTTOM_LEFT):new hA(t.left+V+oA,t.top+t.height-(eA+fA))}return r})(),PA;(function(r){r[r.TOP_LEFT=0]="TOP_LEFT",r[r.TOP_RIGHT=1]="TOP_RIGHT",r[r.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",r[r.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(PA||(PA={}));var ZA=function(r,A,e,t,i){var s=4*((Math.sqrt(2)-1)/3),n=e*s,o=t*s,a=r+e,l=A+t;switch(i){case PA.TOP_LEFT:return new Hs(new hA(r,l),new hA(r,l-o),new hA(a-n,A),new hA(a,A));case PA.TOP_RIGHT:return new Hs(new hA(r,A),new hA(r+n,A),new hA(a,l-o),new hA(a,l));case PA.BOTTOM_RIGHT:return new Hs(new hA(a,A),new hA(a,A+o),new hA(r+n,l),new hA(r,l));case PA.BOTTOM_LEFT:default:return new Hs(new hA(a,l),new hA(a-n,l),new hA(r,A+o),new hA(r,A))}},Ls=function(r){return[r.topLeftBorderBox,r.topRightBorderBox,r.bottomRightBorderBox,r.bottomLeftBorderBox]},hv=function(r){return[r.topLeftContentBox,r.topRightContentBox,r.bottomRightContentBox,r.bottomLeftContentBox]},Is=function(r){return[r.topLeftPaddingBox,r.topRightPaddingBox,r.bottomRightPaddingBox,r.bottomLeftPaddingBox]},uv=(function(){function r(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}return r})(),Ms=(function(){function r(A,e){this.path=A,this.target=e,this.type=1}return r})(),dv=(function(){function r(A){this.opacity=A,this.type=2,this.target=6}return r})(),fv=function(r){return r.type===0},Su=function(r){return r.type===1},pv=function(r){return r.type===2},Hu=function(r,A){return r.length===A.length?r.some(function(e,t){return e===A[t]}):!1},Bv=function(r,A,e,t,i){return r.map(function(s,n){switch(n){case 0:return s.add(A,e);case 1:return s.add(A+t,e);case 2:return s.add(A+t,e+i);case 3:return s.add(A,e+i)}return s})},Lu=(function(){function r(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return r})(),Iu=(function(){function r(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new cv(this.container),this.container.styles.opacity<1&&this.effects.push(new dv(this.container.styles.opacity)),this.container.styles.transform!==null){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new uv(t,i,s))}if(this.container.styles.overflowX!==0){var n=Ls(this.curves),o=Is(this.curves);Hu(n,o)?this.effects.push(new Ms(n,6)):(this.effects.push(new Ms(n,2)),this.effects.push(new Ms(o,4)))}}return r.prototype.getEffects=function(A){for(var e=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent,i=this.effects.slice(0);t;){var s=t.effects.filter(function(a){return!Su(a)});if(e||t.container.styles.position!==0||!t.parent){if(i.unshift.apply(i,s),e=[2,3].indexOf(t.container.styles.position)===-1,t.container.styles.overflowX!==0){var n=Ls(t.curves),o=Is(t.curves);Hu(n,o)||i.unshift(new Ms(o,6))}}else i.unshift.apply(i,s);t=t.parent}return i.filter(function(a){return oe(a.target,A)})},r})(),$o=function(r,A,e,t){r.container.elements.forEach(function(i){var s=oe(i.flags,4),n=oe(i.flags,2),o=new Iu(i,r);oe(i.styles.display,2048)&&t.push(o);var a=oe(i.flags,8)?[]:t;if(s||n){var l=s||i.styles.isPositioned()?e:A,c=new Lu(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var u=i.styles.zIndex.order;if(u<0){var d=0;l.negativeZIndex.some(function(p,f){return u>p.element.container.styles.zIndex.order?(d=f,!1):d>0}),l.negativeZIndex.splice(d,0,c)}else if(u>0){var B=0;l.positiveZIndex.some(function(p,f){return u>=p.element.container.styles.zIndex.order?(B=f+1,!1):B>0}),l.positiveZIndex.splice(B,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else i.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);$o(o,c,s?c:e,a)}else i.styles.isInlineLevel()?A.inlineLevel.push(o):A.nonInlineLevel.push(o),$o(o,A,e,a);oe(i.flags,8)&&Mu(i,a)})},Mu=function(r,A){for(var e=r instanceof _o?r.start:1,t=r instanceof _o?r.reversed:!1,i=0;i<A.length;i++){var s=A[i];s.container instanceof su&&typeof s.container.value=="number"&&s.container.value!==0&&(e=s.container.value),s.listValue=Ai(e,s.container.styles.listStyleType,!0),e+=t?-1:1}},gv=function(r){var A=new Iu(r,null),e=new Lu(A),t=[];return $o(A,e,e,t),Mu(A.container,t),e},Du=function(r,A){switch(A){case 0:return Pe(r.topLeftBorderBox,r.topLeftPaddingBox,r.topRightBorderBox,r.topRightPaddingBox);case 1:return Pe(r.topRightBorderBox,r.topRightPaddingBox,r.bottomRightBorderBox,r.bottomRightPaddingBox);case 2:return Pe(r.bottomRightBorderBox,r.bottomRightPaddingBox,r.bottomLeftBorderBox,r.bottomLeftPaddingBox);default:return Pe(r.bottomLeftBorderBox,r.bottomLeftPaddingBox,r.topLeftBorderBox,r.topLeftPaddingBox)}},wv=function(r,A){switch(A){case 0:return Pe(r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox,r.topRightBorderBox,r.topRightBorderDoubleOuterBox);case 1:return Pe(r.topRightBorderBox,r.topRightBorderDoubleOuterBox,r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox);case 2:return Pe(r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox,r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox);default:return Pe(r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox,r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox)}},mv=function(r,A){switch(A){case 0:return Pe(r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox,r.topRightBorderDoubleInnerBox,r.topRightPaddingBox);case 1:return Pe(r.topRightBorderDoubleInnerBox,r.topRightPaddingBox,r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox);case 2:return Pe(r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox,r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox);default:return Pe(r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox,r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox)}},Cv=function(r,A){switch(A){case 0:return Ds(r.topLeftBorderStroke,r.topRightBorderStroke);case 1:return Ds(r.topRightBorderStroke,r.bottomRightBorderStroke);case 2:return Ds(r.bottomRightBorderStroke,r.bottomLeftBorderStroke);default:return Ds(r.bottomLeftBorderStroke,r.topLeftBorderStroke)}},Ds=function(r,A){var e=[];return Ve(r)?e.push(r.subdivide(.5,!1)):e.push(r),Ve(A)?e.push(A.subdivide(.5,!0)):e.push(A),e},Pe=function(r,A,e,t){var i=[];return Ve(r)?i.push(r.subdivide(.5,!1)):i.push(r),Ve(e)?i.push(e.subdivide(.5,!0)):i.push(e),Ve(t)?i.push(t.subdivide(.5,!0).reverse()):i.push(t),Ve(A)?i.push(A.subdivide(.5,!1).reverse()):i.push(A),i},_u=function(r){var A=r.bounds,e=r.styles;return A.add(e.borderLeftWidth,e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth),-(e.borderTopWidth+e.borderBottomWidth))},_s=function(r){var A=r.styles,e=r.bounds,t=RA(A.paddingLeft,e.width),i=RA(A.paddingRight,e.width),s=RA(A.paddingTop,e.width),n=RA(A.paddingBottom,e.width);return e.add(t+A.borderLeftWidth,s+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+t+i),-(A.borderTopWidth+A.borderBottomWidth+s+n))},vv=function(r,A){return r===0?A.bounds:r===2?_s(A):_u(A)},bv=function(r,A){return r===0?A.bounds:r===2?_s(A):_u(A)},Xo=function(r,A,e){var t=vv(ur(r.styles.backgroundOrigin,A),r),i=bv(ur(r.styles.backgroundClip,A),r),s=yv(ur(r.styles.backgroundSize,A),e,t),n=s[0],o=s[1],a=Xr(ur(r.styles.backgroundPosition,A),t.width-n,t.height-o),l=Qv(ur(r.styles.backgroundRepeat,A),a,s,t,i),c=Math.round(t.left+a[0]),u=Math.round(t.top+a[1]);return[l,c,u,n,o]},hr=function(r){return GA(r)&&r.value===nr.AUTO},ks=function(r){return typeof r=="number"},yv=function(r,A,e){var t=A[0],i=A[1],s=A[2],n=r[0],o=r[1];if(!n)return[0,0];if(se(n)&&o&&se(o))return[RA(n,e.width),RA(o,e.height)];var a=ks(s);if(GA(n)&&(n.value===nr.CONTAIN||n.value===nr.COVER)){if(ks(s)){var l=e.width/e.height;return l<s!=(n.value===nr.COVER)?[e.width,e.width/s]:[e.height*s,e.height]}return[e.width,e.height]}var c=ks(t),u=ks(i),d=c||u;if(hr(n)&&(!o||hr(o))){if(c&&u)return[t,i];if(!a&&!d)return[e.width,e.height];if(d&&a){var B=c?t:i*s,p=u?i:t/s;return[B,p]}var f=c?t:e.width,g=u?i:e.height;return[f,g]}if(a){var Q=0,m=0;return se(n)?Q=RA(n,e.width):se(o)&&(m=RA(o,e.height)),hr(n)?Q=m*s:(!o||hr(o))&&(m=Q/s),[Q,m]}var E=null,F=null;if(se(n)?E=RA(n,e.width):o&&se(o)&&(F=RA(o,e.height)),E!==null&&(!o||hr(o))&&(F=c&&u?E/t*i:e.height),F!==null&&hr(n)&&(E=c&&u?F/i*t:e.width),E!==null&&F!==null)return[E,F];throw new Error("Unable to calculate background-size for element")},ur=function(r,A){var e=r[A];return typeof e>"u"?r[0]:e},Qv=function(r,A,e,t,i){var s=A[0],n=A[1],o=e[0],a=e[1];switch(r){case 2:return[new hA(Math.round(t.left),Math.round(t.top+n)),new hA(Math.round(t.left+t.width),Math.round(t.top+n)),new hA(Math.round(t.left+t.width),Math.round(a+t.top+n)),new hA(Math.round(t.left),Math.round(a+t.top+n))];case 3:return[new hA(Math.round(t.left+s),Math.round(t.top)),new hA(Math.round(t.left+s+o),Math.round(t.top)),new hA(Math.round(t.left+s+o),Math.round(t.height+t.top)),new hA(Math.round(t.left+s),Math.round(t.height+t.top))];case 1:return[new hA(Math.round(t.left+s),Math.round(t.top+n)),new hA(Math.round(t.left+s+o),Math.round(t.top+n)),new hA(Math.round(t.left+s+o),Math.round(t.top+n+a)),new hA(Math.round(t.left+s),Math.round(t.top+n+a))];default:return[new hA(Math.round(i.left),Math.round(i.top)),new hA(Math.round(i.left+i.width),Math.round(i.top)),new hA(Math.round(i.left+i.width),Math.round(i.height+i.top)),new hA(Math.round(i.left),Math.round(i.height+i.top))]}},Fv="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ku="Hidden Text",Uv=(function(){function r(A){this._data={},this._document=A}return r.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),i=this._document.createElement("img"),s=this._document.createElement("span"),n=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",n.appendChild(t),i.src=Fv,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",s.style.fontFamily=A,s.style.fontSize=e,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(ku)),t.appendChild(s),t.appendChild(i);var o=i.offsetTop-s.offsetTop+2;t.removeChild(s),t.appendChild(this._document.createTextNode(ku)),t.style.lineHeight="normal",i.style.verticalAlign="super";var a=i.offsetTop-t.offsetTop+2;return n.removeChild(t),{baseline:o,middle:a}},r.prototype.getMetrics=function(A,e){var t=A+" "+e;return typeof this._data[t]>"u"&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},r})(),Ou=(function(){function r(A,e){this.context=A,this.options=e}return r})(),Ev=1e4,xv=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i._activeEffects=[],i.canvas=t.canvas?t.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),t.canvas||(i.canvas.width=Math.floor(t.width*t.scale),i.canvas.height=Math.floor(t.height*t.scale),i.canvas.style.width=t.width+"px",i.canvas.style.height=t.height+"px"),i.fontMetrics=new Uv(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-t.x,-t.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),i}return A.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(i){return t.applyEffect(i)})},A.prototype.applyEffect=function(e){this.ctx.save(),pv(e)&&(this.ctx.globalAlpha=e.opacity),fv(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Su(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(e){return ye(this,void 0,void 0,function(){var t;return me(this,function(i){switch(i.label){case 0:return t=e.element.container.styles,t.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(e){return ye(this,void 0,void 0,function(){return me(this,function(t){switch(t.label){case 0:if(oe(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(e,t,i){var s=this;if(t===0)this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+i);else{var n=Do(e.text);n.reduce(function(o,a){return s.ctx.fillText(a,o,e.bounds.top+i),o+s.ctx.measureText(a).width},e.bounds.left)}},A.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(n){return n==="normal"||n==="small-caps"}).join(""),i=Iv(e.fontFamily).join(", "),s=$r(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,s,i].join(" "),i,s]},A.prototype.renderTextNode=function(e,t){return ye(this,void 0,void 0,function(){var i,s,n,o,a,l,c,u,d=this;return me(this,function(B){return i=this.createFontStyle(t),s=i[0],n=i[1],o=i[2],this.ctx.font=s,this.ctx.direction=t.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(n,o),l=a.baseline,c=a.middle,u=t.paintOrder,e.textBounds.forEach(function(p){u.forEach(function(f){switch(f){case 0:d.ctx.fillStyle=ce(t.color),d.renderTextWithLetterSpacing(p,t.letterSpacing,l);var g=t.textShadow;g.length&&p.text.trim().length&&(g.slice(0).reverse().forEach(function(Q){d.ctx.shadowColor=ce(Q.color),d.ctx.shadowOffsetX=Q.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=Q.offsetY.number*d.options.scale,d.ctx.shadowBlur=Q.blur.number,d.renderTextWithLetterSpacing(p,t.letterSpacing,l)}),d.ctx.shadowColor="",d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),t.textDecorationLine.length&&(d.ctx.fillStyle=ce(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(Q){switch(Q){case 1:d.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top+l),p.bounds.width,1);break;case 2:d.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top),p.bounds.width,1);break;case 3:d.ctx.fillRect(p.bounds.left,Math.ceil(p.bounds.top+c),p.bounds.width,1);break}}));break;case 1:t.webkitTextStrokeWidth&&p.text.trim().length&&(d.ctx.strokeStyle=ce(t.webkitTextStrokeColor),d.ctx.lineWidth=t.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?"miter":"round",d.ctx.strokeText(p.text,p.bounds.left,p.bounds.top+l)),d.ctx.strokeStyle="",d.ctx.lineWidth=0,d.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(e,t,i){if(i&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var s=_s(e),n=Is(t);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,e.intrinsicWidth,e.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return ye(this,void 0,void 0,function(){var t,i,s,n,o,a,m,m,l,c,u,d,F,B,p,S,f,g,Q,m,E,F,S;return me(this,function(P){switch(P.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,i=e.curves,s=t.styles,n=0,o=t.textNodes,P.label=1;case 1:return n<o.length?(a=o[n],[4,this.renderTextNode(a,s)]):[3,4];case 2:P.sent(),P.label=3;case 3:return n++,[3,1];case 4:if(!(t instanceof tu))return[3,8];P.label=5;case 5:return P.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return m=P.sent(),this.renderReplacedElement(t,i,m),[3,8];case 7:return P.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof ru&&this.renderReplacedElement(t,i,t.canvas),!(t instanceof iu))return[3,12];P.label=9;case 9:return P.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return m=P.sent(),this.renderReplacedElement(t,i,m),[3,12];case 11:return P.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof lu&&t.tree?(l=new A(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,l.render(t.tree)]):[3,14];case 13:c=P.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),P.label=14;case 14:if(t instanceof ko&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===Fs?t.checked&&(this.ctx.save(),this.path([new hA(t.bounds.left+u*.39363,t.bounds.top+u*.79),new hA(t.bounds.left+u*.16,t.bounds.top+u*.5549),new hA(t.bounds.left+u*.27347,t.bounds.top+u*.44071),new hA(t.bounds.left+u*.39694,t.bounds.top+u*.5649),new hA(t.bounds.left+u*.72983,t.bounds.top+u*.23),new hA(t.bounds.left+u*.84,t.bounds.top+u*.34085),new hA(t.bounds.left+u*.39363,t.bounds.top+u*.79)]),this.ctx.fillStyle=ce(nu),this.ctx.fill(),this.ctx.restore()):t.type===Us&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=ce(nu),this.ctx.fill(),this.ctx.restore())),Tv(t)&&t.value.length){switch(d=this.createFontStyle(s),F=d[0],B=d[1],p=this.fontMetrics.getMetrics(F,B).baseline,this.ctx.font=F,this.ctx.fillStyle=ce(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Hv(t.styles.textAlign),S=_s(t),f=0,t.styles.textAlign){case 1:f+=S.width/2;break;case 2:f+=S.width;break}g=S.add(f,0,0,-S.height/2+1),this.ctx.save(),this.path([new hA(S.left,S.top),new hA(S.left+S.width,S.top),new hA(S.left+S.width,S.top+S.height),new hA(S.left,S.top+S.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new qr(t.value,g),s.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!oe(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(Q=t.styles.listStyleImage,Q.type!==0)return[3,18];m=void 0,E=Q.url,P.label=15;case 15:return P.trys.push([15,17,,18]),[4,this.context.cache.match(E)];case 16:return m=P.sent(),this.ctx.drawImage(m,t.bounds.left-(m.width+10),t.bounds.top),[3,18];case 17:return P.sent(),this.context.logger.error("Error loading list-style-image "+E),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==-1&&(F=this.createFontStyle(s)[0],this.ctx.font=F,this.ctx.fillStyle=ce(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",S=new lt(t.bounds.left,t.bounds.top+RA(t.styles.paddingTop,t.bounds.width),t.bounds.width,kh(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new qr(e.listValue,S),s.letterSpacing,kh(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),P.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(e){return ye(this,void 0,void 0,function(){var t,i,Q,s,n,Q,o,a,Q,l,c,Q,u,d,Q,B,p,Q,f,g,Q;return me(this,function(m){switch(m.label){case 0:if(oe(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:m.sent(),t=0,i=e.negativeZIndex,m.label=2;case 2:return t<i.length?(Q=i[t],[4,this.renderStack(Q)]):[3,5];case 3:m.sent(),m.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:m.sent(),s=0,n=e.nonInlineLevel,m.label=7;case 7:return s<n.length?(Q=n[s],[4,this.renderNode(Q)]):[3,10];case 8:m.sent(),m.label=9;case 9:return s++,[3,7];case 10:o=0,a=e.nonPositionedFloats,m.label=11;case 11:return o<a.length?(Q=a[o],[4,this.renderStack(Q)]):[3,14];case 12:m.sent(),m.label=13;case 13:return o++,[3,11];case 14:l=0,c=e.nonPositionedInlineLevel,m.label=15;case 15:return l<c.length?(Q=c[l],[4,this.renderStack(Q)]):[3,18];case 16:m.sent(),m.label=17;case 17:return l++,[3,15];case 18:u=0,d=e.inlineLevel,m.label=19;case 19:return u<d.length?(Q=d[u],[4,this.renderNode(Q)]):[3,22];case 20:m.sent(),m.label=21;case 21:return u++,[3,19];case 22:B=0,p=e.zeroOrAutoZIndexOrTransformedOrOpacity,m.label=23;case 23:return B<p.length?(Q=p[B],[4,this.renderStack(Q)]):[3,26];case 24:m.sent(),m.label=25;case 25:return B++,[3,23];case 26:f=0,g=e.positiveZIndex,m.label=27;case 27:return f<g.length?(Q=g[f],[4,this.renderStack(Q)]):[3,30];case 28:m.sent(),m.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},A.prototype.formatPath=function(e){var t=this;e.forEach(function(i,s){var n=Ve(i)?i.start:i;s===0?t.ctx.moveTo(n.x,n.y):t.ctx.lineTo(n.x,n.y),Ve(i)&&t.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},A.prototype.renderRepeat=function(e,t,i,s){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(i,s),this.ctx.fill(),this.ctx.translate(-i,-s)},A.prototype.resizeImage=function(e,t,i){var s;if(e.width===t&&e.height===i)return e;var n=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=n.createElement("canvas");o.width=Math.max(1,t),o.height=Math.max(1,i);var a=o.getContext("2d");return a.drawImage(e,0,0,e.width,e.height,0,0,t,i),o},A.prototype.renderBackgroundImage=function(e){return ye(this,void 0,void 0,function(){var t,i,s,n,o,a;return me(this,function(l){switch(l.label){case 0:t=e.styles.backgroundImage.length-1,i=function(c){var u,d,B,Y,vA,MA,oA,pA,eA,p,Y,vA,MA,oA,pA,f,g,Q,m,E,F,S,P,z,eA,V,Y,X,fA,oA,pA,IA,vA,MA,SA,UA,bA,CA,aA,J,q,yA;return me(this,function(BA){switch(BA.label){case 0:if(c.type!==0)return[3,5];u=void 0,d=c.url,BA.label=1;case 1:return BA.trys.push([1,3,,4]),[4,s.context.cache.match(d)];case 2:return u=BA.sent(),[3,4];case 3:return BA.sent(),s.context.logger.error("Error loading background-image "+d),[3,4];case 4:return u&&(B=Xo(e,t,[u.width,u.height,u.width/u.height]),Y=B[0],vA=B[1],MA=B[2],oA=B[3],pA=B[4],eA=s.ctx.createPattern(s.resizeImage(u,oA,pA),"repeat"),s.renderRepeat(Y,eA,vA,MA)),[3,6];case 5:f1(c)?(p=Xo(e,t,[null,null,null]),Y=p[0],vA=p[1],MA=p[2],oA=p[3],pA=p[4],f=l1(c.angle,oA,pA),g=f[0],Q=f[1],m=f[2],E=f[3],F=f[4],S=document.createElement("canvas"),S.width=oA,S.height=pA,P=S.getContext("2d"),z=P.createLinearGradient(Q,E,m,F),Uh(c.stops,g).forEach(function(EA){return z.addColorStop(EA.stop,ce(EA.color))}),P.fillStyle=z,P.fillRect(0,0,oA,pA),oA>0&&pA>0&&(eA=s.ctx.createPattern(S,"repeat"),s.renderRepeat(Y,eA,vA,MA))):p1(c)&&(V=Xo(e,t,[null,null,null]),Y=V[0],X=V[1],fA=V[2],oA=V[3],pA=V[4],IA=c.position.length===0?[Co]:c.position,vA=RA(IA[0],oA),MA=RA(IA[IA.length-1],pA),SA=c1(c,vA,MA,oA,pA),UA=SA[0],bA=SA[1],UA>0&&bA>0&&(CA=s.ctx.createRadialGradient(X+vA,fA+MA,0,X+vA,fA+MA,UA),Uh(c.stops,UA*2).forEach(function(EA){return CA.addColorStop(EA.stop,ce(EA.color))}),s.path(Y),s.ctx.fillStyle=CA,UA!==bA?(aA=e.bounds.left+.5*e.bounds.width,J=e.bounds.top+.5*e.bounds.height,q=bA/UA,yA=1/q,s.ctx.save(),s.ctx.translate(aA,J),s.ctx.transform(1,0,0,q,0,0),s.ctx.translate(-aA,-J),s.ctx.fillRect(X,yA*(fA-J)+J,oA,pA*yA),s.ctx.restore()):s.ctx.fill())),BA.label=6;case 6:return t--,[2]}})},s=this,n=0,o=e.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return n<o.length?(a=o[n],[5,i(a)]):[3,4];case 2:l.sent(),l.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(e,t,i){return ye(this,void 0,void 0,function(){return me(this,function(s){return this.path(Du(i,t)),this.ctx.fillStyle=ce(e),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(e,t,i,s){return ye(this,void 0,void 0,function(){var n,o;return me(this,function(a){switch(a.label){case 0:return t<3?[4,this.renderSolidBorder(e,i,s)]:[3,2];case 1:return a.sent(),[2];case 2:return n=wv(s,i),this.path(n),this.ctx.fillStyle=ce(e),this.ctx.fill(),o=mv(s,i),this.path(o),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(e){return ye(this,void 0,void 0,function(){var t,i,s,n,o,a,l,c,u=this;return me(this,function(d){switch(d.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,i=!Ft(t.backgroundColor)||t.backgroundImage.length,s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],n=Sv(ur(t.backgroundClip,0),e.curves),i||t.boxShadow.length?(this.ctx.save(),this.path(n),this.ctx.clip(),Ft(t.backgroundColor)||(this.ctx.fillStyle=ce(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(B){u.ctx.save();var p=Ls(e.curves),f=B.inset?0:Ev,g=Bv(p,-f+(B.inset?1:-1)*B.spread.number,(B.inset?1:-1)*B.spread.number,B.spread.number*(B.inset?-2:2),B.spread.number*(B.inset?-2:2));B.inset?(u.path(p),u.ctx.clip(),u.mask(g)):(u.mask(p),u.ctx.clip(),u.path(g)),u.ctx.shadowOffsetX=B.offsetX.number+f,u.ctx.shadowOffsetY=B.offsetY.number,u.ctx.shadowColor=ce(B.color),u.ctx.shadowBlur=B.blur.number,u.ctx.fillStyle=B.inset?ce(B.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),d.label=2;case 2:o=0,a=0,l=s,d.label=3;case 3:return a<l.length?(c=l[a],c.style!==0&&!Ft(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,o,e.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,o,e.curves,3)];case 6:return d.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,o,e.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,o,e.curves)];case 10:d.sent(),d.label=11;case 11:o++,d.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,t,i,s,n){return ye(this,void 0,void 0,function(){var o,a,l,c,u,d,B,p,f,g,Q,m,E,F,S,P,S,P;return me(this,function(z){return this.ctx.save(),o=Cv(s,i),a=Du(s,i),n===2&&(this.path(a),this.ctx.clip()),Ve(a[0])?(l=a[0].start.x,c=a[0].start.y):(l=a[0].x,c=a[0].y),Ve(a[1])?(u=a[1].end.x,d=a[1].end.y):(u=a[1].x,d=a[1].y),i===0||i===2?B=Math.abs(l-u):B=Math.abs(c-d),this.ctx.beginPath(),n===3?this.formatPath(o):this.formatPath(a.slice(0,2)),p=t<3?t*3:t*2,f=t<3?t*2:t,n===3&&(p=t,f=t),g=!0,B<=p*2?g=!1:B<=p*2+f?(Q=B/(2*p+f),p*=Q,f*=Q):(m=Math.floor((B+f)/(p+f)),E=(B-m*p)/(m-1),F=(B-(m+1)*p)/m,f=F<=0||Math.abs(f-E)<Math.abs(f-F)?E:F),g&&(n===3?this.ctx.setLineDash([0,p+f]):this.ctx.setLineDash([p,f])),n===3?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=ce(e),this.ctx.stroke(),this.ctx.setLineDash([]),n===2&&(Ve(a[0])&&(S=a[3],P=a[0],this.ctx.beginPath(),this.formatPath([new hA(S.end.x,S.end.y),new hA(P.start.x,P.start.y)]),this.ctx.stroke()),Ve(a[1])&&(S=a[1],P=a[2],this.ctx.beginPath(),this.formatPath([new hA(S.end.x,S.end.y),new hA(P.start.x,P.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(e){return ye(this,void 0,void 0,function(){var t;return me(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ce(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=gv(e),[4,this.renderStack(t)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},A})(Ou),Tv=function(r){return r instanceof au||r instanceof ou?!0:r instanceof ko&&r.type!==Us&&r.type!==Fs},Sv=function(r,A){switch(r){case 0:return Ls(A);case 2:return hv(A);default:return Is(A)}},Hv=function(r){switch(r){case 1:return"center";case 2:return"right";default:return"left"}},Lv=["-apple-system","system-ui"],Iv=function(r){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?r.filter(function(A){return Lv.indexOf(A)===-1}):r},Mv=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.canvas=t.canvas?t.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=t,i.canvas.width=Math.floor(t.width*t.scale),i.canvas.height=Math.floor(t.height*t.scale),i.canvas.style.width=t.width+"px",i.canvas.style.height=t.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-t.x,-t.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),i}return A.prototype.render=function(e){return ye(this,void 0,void 0,function(){var t,i;return me(this,function(s){switch(s.label){case 0:return t=Mo(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,Dv(t)];case 1:return i=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ce(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A})(Ou),Dv=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},_v=(function(){function r(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return r.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Ri([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.prototype.getTime=function(){return Date.now()-this.start},r.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Ri([this.id,this.getTime()+"ms"],A))},r.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Ri([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Ri([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.instances={},r})(),kv=(function(){function r(A,e){var t;this.windowBounds=e,this.instanceName="#"+r.instanceCount++,this.logger=new _v({id:this.instanceName,enabled:A.logging}),this.cache=(t=A.cache)!==null&&t!==void 0?t:new rv(this,A)}return r.instanceCount=1,r})(),Ov=function(r,A){return A===void 0&&(A={}),Nv(r,A)};typeof window<"u"&&Tu.setContext(window);var Nv=function(r,A){return ye(void 0,void 0,void 0,function(){var e,t,i,s,n,o,a,l,c,u,d,B,p,f,g,Q,m,E,F,S,z,P,z,eA,V,Y,X,fA,oA,pA,IA,vA,MA,SA,UA,bA,CA,aA,J,q;return me(this,function(yA){switch(yA.label){case 0:if(!r||typeof r!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(e=r.ownerDocument,!e)throw new Error("Element is not attached to a Document");if(t=e.defaultView,!t)throw new Error("Document is not attached to a Window");return i={allowTaint:(eA=A.allowTaint)!==null&&eA!==void 0?eA:!1,imageTimeout:(V=A.imageTimeout)!==null&&V!==void 0?V:15e3,proxy:A.proxy,useCORS:(Y=A.useCORS)!==null&&Y!==void 0?Y:!1},s=qn({logging:(X=A.logging)!==null&&X!==void 0?X:!0,cache:A.cache},i),n={windowWidth:(fA=A.windowWidth)!==null&&fA!==void 0?fA:t.innerWidth,windowHeight:(oA=A.windowHeight)!==null&&oA!==void 0?oA:t.innerHeight,scrollX:(pA=A.scrollX)!==null&&pA!==void 0?pA:t.pageXOffset,scrollY:(IA=A.scrollY)!==null&&IA!==void 0?IA:t.pageYOffset},o=new lt(n.scrollX,n.scrollY,n.windowWidth,n.windowHeight),a=new kv(s,o),l=(vA=A.foreignObjectRendering)!==null&&vA!==void 0?vA:!1,c={allowTaint:(MA=A.allowTaint)!==null&&MA!==void 0?MA:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:l,copyStyles:l},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),u=new Eu(a,r,c),d=u.clonedReferenceElement,d?[4,u.toIFrame(e,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return B=yA.sent(),p=No(d)||KC(d)?Bg(d.ownerDocument):Wi(a,d),f=p.width,g=p.height,Q=p.left,m=p.top,E=Kv(a,d,A.backgroundColor),F={canvas:A.canvas,backgroundColor:E,scale:(UA=(SA=A.scale)!==null&&SA!==void 0?SA:t.devicePixelRatio)!==null&&UA!==void 0?UA:1,x:((bA=A.x)!==null&&bA!==void 0?bA:0)+Q,y:((CA=A.y)!==null&&CA!==void 0?CA:0)+m,width:(aA=A.width)!==null&&aA!==void 0?aA:Math.ceil(f),height:(J=A.height)!==null&&J!==void 0?J:Math.ceil(g)},l?(a.logger.debug("Document cloned, using foreign object rendering"),z=new Mv(a,F),[4,z.render(d)]):[3,3];case 2:return S=yA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+Q+","+m+" with size "+f+"x"+g+" using computed rendering"),a.logger.debug("Starting DOM parsing"),P=hu(a,d),E===P.styles.backgroundColor&&(P.styles.backgroundColor=ht.TRANSPARENT),a.logger.debug("Starting renderer for element at "+F.x+","+F.y+" with size "+F.width+"x"+F.height),z=new xv(a,F),[4,z.render(P)];case 4:S=yA.sent(),yA.label=5;case 5:return(!((q=A.removeContainer)!==null&&q!==void 0)||q)&&(Eu.destroy(B)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,S]}})})},Kv=function(r,A,e){var t=A.ownerDocument,i=t.documentElement?Jr(r,getComputedStyle(t.documentElement).backgroundColor):ht.TRANSPARENT,s=t.body?Jr(r,getComputedStyle(t.body).backgroundColor):ht.TRANSPARENT,n=typeof e=="string"?Jr(r,e):e===null?ht.TRANSPARENT:4294967295;return A===t.documentElement?Ft(i)?Ft(s)?n:s:i:n};const Vv={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};class Pv{constructor(A,e,t="#3b82f6",i=2){this.price=A,this.originTime=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null,this._paneView=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=o.context,l=s._chart,c=s._series;if(!l||!c)return;const u=c.priceToCoordinate(s.price);if(u==null)return;const d=Math.round(u*o.verticalPixelRatio),B=l.timeScale().timeToCoordinate(s.originTime),p=B==null?0:Math.max(0,Math.round(B*o.horizontalPixelRatio)),f=o.bitmapSize.width;if(p>=f)return;a.save(),a.beginPath(),a.strokeStyle=s.color,a.lineWidth=s.lineWidth*o.verticalPixelRatio,a.setLineDash([]),a.moveTo(p,d),a.lineTo(f,d),a.stroke(),a.beginPath(),a.fillStyle=s.color;const g=3*o.verticalPixelRatio;a.arc(p,d,g,0,Math.PI*2),a.fill(),a.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class zv{constructor(A,e,t,i="#3b82f6",s=2){this.p1=A,this.p2=e,this.info=t,this.color=i,this.lineWidth=s,this.visible=!0,this._chart=null,this._series=null;const n=this;this._paneView={renderer(){return{draw(o){o.useBitmapCoordinateSpace(a=>{if(!n.visible)return;const l=n._chart,c=n._series;if(!l||!c)return;const u=a.horizontalPixelRatio,d=a.verticalPixelRatio,B=l.timeScale().timeToCoordinate(n.p1.rawTime),p=l.timeScale().timeToCoordinate(n.p2.rawTime),f=c.priceToCoordinate(n.p1.price),g=c.priceToCoordinate(n.p2.price);if(B==null||p==null||f==null||g==null)return;const Q=Math.round(B*u),m=Math.round(f*d),E=Math.round(p*u),F=Math.round(g*d),S=a.context;S.save(),S.beginPath(),S.strokeStyle=n.color,S.lineWidth=n.lineWidth*d,S.setLineDash([]),S.moveTo(Q,m),S.lineTo(E,F),S.stroke(),S.beginPath(),S.fillStyle=n.color,S.arc(Q,m,3*d,0,Math.PI*2),S.fill(),S.beginPath(),S.arc(E,F,3*d,0,Math.PI*2),S.fill();const{priceDiff:P,pricePct:z,bars:eA,days:V,angle:Y}=n.info,X=P>=0?"+":"",fA=[`${X}${P.toFixed(5)} (${X}${z.toFixed(2)}%)`,`${eA} bars (${V} days)`,`∠ ${Y.toFixed(1)}°`],oA=Math.round(11*d);S.font=`${oA}px sans-serif`;const pA=oA*1.6,IA=8*d,vA=Math.max(...fA.map(yA=>S.measureText(yA).width))+IA*2,MA=fA.length*pA+IA*2,SA=E+10*u,UA=F-MA-4*d,bA=a.bitmapSize.width,CA=a.bitmapSize.height,aA=Math.min(Math.max(0,SA),bA-vA-4*u),J=Math.min(Math.max(4*d,UA),CA-MA-4*d),q=4*d;S.beginPath(),S.moveTo(aA+q,J),S.lineTo(aA+vA-q,J),S.quadraticCurveTo(aA+vA,J,aA+vA,J+q),S.lineTo(aA+vA,J+MA-q),S.quadraticCurveTo(aA+vA,J+MA,aA+vA-q,J+MA),S.lineTo(aA+q,J+MA),S.quadraticCurveTo(aA,J+MA,aA,J+MA-q),S.lineTo(aA,J+q),S.quadraticCurveTo(aA,J,aA+q,J),S.closePath(),S.fillStyle="rgba(30, 41, 59, 0.92)",S.fill(),S.strokeStyle=n.color,S.lineWidth=1*d,S.stroke(),S.fillStyle="#e2e8f0",S.textAlign="left",fA.forEach((yA,BA)=>{S.fillText(yA,aA+IA,J+IA+oA+BA*pA)}),S.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Nu{constructor(A,e,t){this.p1=A,this.p2=e,this.info=t,this.visible=!0,this._chart=null,this._series=null;const i=e.price>=A.price;this.color=i?"#3b82f6":"#ef5350",this.fillColor=i?"rgba(59,130,246,0.1)":"rgba(239,83,80,0.1)";const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const g=Math.round(d*c),Q=Math.round(p*u),m=Math.round(B*c),E=Math.round(f*u),F=o.context;F.save(),F.fillStyle=s.fillColor,F.fillRect(Math.min(g,m),Math.min(Q,E),Math.abs(m-g),Math.abs(E-Q)),F.strokeStyle=s.color,F.lineWidth=1*u,F.setLineDash([]),F.strokeRect(Math.min(g,m),Math.min(Q,E),Math.abs(m-g),Math.abs(E-Q)),F.beginPath(),F.strokeStyle=s.color,F.lineWidth=2*u,F.moveTo(g,Q),F.lineTo(m,E),F.stroke(),F.fillStyle=s.color,F.beginPath(),F.arc(g,Q,3*u,0,Math.PI*2),F.fill(),F.beginPath(),F.arc(m,E,3*u,0,Math.PI*2),F.fill();const{priceDiff:S,pricePct:P,bars:z,days:eA}=s.info,V=S>=0?"+":"",Y=[`${V}${S.toFixed(5)} (${V}${P.toFixed(2)}%)`,`${z} bars (${eA} days)`],X=Math.round(11*u);F.font=`${X}px sans-serif`;const fA=X*1.6,oA=8*u,pA=Math.max(...Y.map(J=>F.measureText(J).width))+oA*2,IA=Y.length*fA+oA*2,vA=o.bitmapSize.width,MA=o.bitmapSize.height,SA=m+10*c,UA=E-IA-4*u,bA=Math.min(Math.max(0,SA),vA-pA-4*c),CA=Math.min(Math.max(4*u,UA),MA-IA-4*u),aA=4*u;F.beginPath(),F.moveTo(bA+aA,CA),F.lineTo(bA+pA-aA,CA),F.quadraticCurveTo(bA+pA,CA,bA+pA,CA+aA),F.lineTo(bA+pA,CA+IA-aA),F.quadraticCurveTo(bA+pA,CA+IA,bA+pA-aA,CA+IA),F.lineTo(bA+aA,CA+IA),F.quadraticCurveTo(bA,CA+IA,bA,CA+IA-aA),F.lineTo(bA,CA+aA),F.quadraticCurveTo(bA,CA,bA+aA,CA),F.closePath(),F.fillStyle="rgba(30, 41, 59, 0.92)",F.fill(),F.strokeStyle=s.color,F.lineWidth=1*u,F.stroke(),F.fillStyle="#e2e8f0",F.textAlign="left",Y.forEach((J,q)=>{F.fillText(J,bA+oA,CA+oA+X+q*fA)}),F.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Ku{constructor(A,e,t="#f59e0b",i=2){this.p1=A,this.p2=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const g=Math.round(d*c),Q=Math.round(p*u),m=Math.round(B*c),E=Math.round(f*u),F=o.context;F.save(),F.beginPath(),F.strokeStyle=s.color,F.lineWidth=s.lineWidth*u,F.setLineDash([]),F.moveTo(g,Q),F.lineTo(m,E),F.stroke();const S=Math.atan2(E-Q,m-g),P=11*u,z=Math.PI/7,eA=m-P*Math.cos(S-z),V=E-P*Math.sin(S-z),Y=m-P*Math.cos(S+z),X=E-P*Math.sin(S+z);F.beginPath(),F.fillStyle=s.color,F.moveTo(m,E),F.lineTo(eA,V),F.lineTo(Y,X),F.closePath(),F.fill(),F.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Gv{constructor(A,e,t="#7aa6ae",i=2){this.p1=A,this.p2=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const g=d*c,Q=p*u;let m=B-d,E=f-p;m<0&&(m=-m,E=-E),Math.abs(m)<1e-4&&(m=1e-4);const F=E*u/(m*c),S=Math.max(0,g),P=Q+F*(S-g),z=o.bitmapSize.width,eA=Q+F*(z-g),V=o.context;V.save(),V.beginPath(),V.strokeStyle=s.color,V.lineWidth=s.lineWidth*u,V.setLineDash([]),V.moveTo(S,P),V.lineTo(z,eA),V.stroke(),V.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Rv{constructor(A,e,t="#7aa6ae",i=2){this.p1=A,this.p2=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const g=d*c,Q=p*u;let m=B-d,E=f-p;Math.abs(m)<1e-4&&(m=1e-4);const F=E*u/(m*c),S=0,P=Q+F*(S-g),z=o.bitmapSize.width,eA=Q+F*(z-g),V=o.context;V.save(),V.beginPath(),V.strokeStyle=s.color,V.lineWidth=s.lineWidth*u,V.setLineDash([]),V.moveTo(S,P),V.lineTo(z,eA),V.stroke(),V.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Wv{constructor(A,e="#7aa6ae",t=2){this.center=A,this.color=e,this.lineWidth=t,this.visible=!0,this._chart=null,this._series=null;const i=this;this._paneView={renderer(){return{draw(s){s.useBitmapCoordinateSpace(n=>{if(!i.visible)return;const o=i._chart,a=i._series;if(!o||!a)return;const l=n.horizontalPixelRatio,c=n.verticalPixelRatio,u=o.timeScale().timeToCoordinate(i.center.rawTime),d=a.priceToCoordinate(i.center.price);if(u==null||d==null)return;const B=Math.round(u*l),p=Math.round(d*c),f=n.bitmapSize.width,g=n.bitmapSize.height,Q=n.context;Q.save(),Q.strokeStyle=i.color,Q.lineWidth=i.lineWidth*c,Q.setLineDash([]),Q.beginPath(),Q.moveTo(0,p),Q.lineTo(f,p),Q.stroke(),Q.beginPath(),Q.moveTo(B,0),Q.lineTo(B,g),Q.stroke(),Q.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class $v{constructor(A,e,t="#7aa6ae",i=2){this.p1=A,this.p2=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const g=d*c,Q=p*u,m=B*c,E=f*u,F=g-m,S=Q-E;if(Math.hypot(F,S)<1e-4)return;const z=Math.atan2(S,F),eA=Math.round(Math.abs(z*180/Math.PI)),V=o.context;V.save(),V.strokeStyle=s.color,V.lineWidth=s.lineWidth*u,V.setLineDash([]),V.beginPath(),V.moveTo(g,Q),V.lineTo(m,E),V.stroke();const Y=28*u;V.beginPath(),V.lineWidth=1*u,V.strokeStyle="rgba(122,166,174,0.55)",V.moveTo(m,E),V.lineTo(m+Y,E),V.stroke(),V.beginPath(),V.strokeStyle="rgba(122,166,174,0.45)",V.arc(m,E,Y,0,z,z<0),V.stroke(),V.fillStyle="#4b7c86",V.font=`${Math.round(10*u)}px sans-serif`,V.textAlign="left",V.textBaseline="middle";const X=m+(Y+10*u)*Math.cos(z/2),fA=E+(Y+10*u)*Math.sin(z/2);V.fillText(`${eA}°`,X,fA),V.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Jo{constructor(A,e,t,i,s="#16a34a",n=2,o="rgba(22, 163, 74, 0.12)"){this.p1=A,this.p2=e,this.p3=t,this.p4=i,this.color=s,this.lineWidth=n,this.fillColor=o,this.visible=!0,this._chart=null,this._series=null;const a=this;this._paneView={renderer(){return{draw(l){l.useBitmapCoordinateSpace(c=>{if(!a.visible)return;const u=a._chart,d=a._series;if(!u||!d)return;const B=c.horizontalPixelRatio,p=c.verticalPixelRatio,f=[a.p1,a.p3,a.p4,a.p2].map(z=>{const eA=u.timeScale().timeToCoordinate(z.rawTime),V=d.priceToCoordinate(z.price);return eA==null||V==null?null:{x:eA*B,y:V*p}}).filter(Boolean);if(f.length!==4)return;const[g,Q,m,E]=f,F=c.context;F.save(),F.beginPath(),F.moveTo(g.x,g.y),F.lineTo(Q.x,Q.y),F.lineTo(m.x,m.y),F.lineTo(E.x,E.y),F.closePath(),F.fillStyle=a.fillColor,F.fill(),F.strokeStyle=a.color,F.lineWidth=a.lineWidth*p,F.setLineDash([]),F.beginPath(),F.moveTo(g.x,g.y),F.lineTo(Q.x,Q.y),F.moveTo(E.x,E.y),F.lineTo(m.x,m.y),F.moveTo(g.x,g.y),F.lineTo(E.x,E.y),F.moveTo(Q.x,Q.y),F.lineTo(m.x,m.y),F.stroke(),F.fillStyle="#ffffff",F.strokeStyle="#3b82f6",F.lineWidth=2*p,[g,Q,m,E].forEach(z=>{F.beginPath(),F.arc(z.x,z.y,6*p,0,Math.PI*2),F.fill(),F.stroke()});const S=[a.p1,a.p3,a.p2,a.p4],P=[g,Q,E,m];F.fillStyle=a.color,F.font=`${Math.round(10*p)}px sans-serif`,F.textAlign="left",F.textBaseline="middle",P.forEach((z,eA)=>{const V=S[eA]?.price;typeof V=="number"&&F.fillText(V.toFixed(5),z.x+8*B,z.y)}),F.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Vu extends Jo{constructor(A,e,t,i,s="#3b82f6",n=2){super(A,e,t,i,s,n,"rgba(59, 130, 246, 0.12)")}}class Xv{constructor(A,e="#3b82f6",t=2){this.time=A,this.color=e,this.lineWidth=t,this.visible=!0,this._chart=null,this._series=null;const i=this;this._paneView={renderer(){return{draw(s){s.useBitmapCoordinateSpace(n=>{if(!i.visible)return;const o=i._chart;if(!o)return;const a=o.timeScale().timeToCoordinate(i.time);if(a==null)return;const l=Math.round(a*n.horizontalPixelRatio),c=n.bitmapSize.height,u=n.context;u.save(),u.beginPath(),u.strokeStyle=i.color,u.lineWidth=i.lineWidth*n.horizontalPixelRatio,u.setLineDash([]),u.moveTo(l,0),u.lineTo(l,c),u.stroke(),u.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}const Jv={M1:3,M5:7,M15:14,M30:30,H1:90,H4:180,D1:1095,W1:1825,MN:3650};function Pu(r){if(!r)return 7;const A=String(r).toUpperCase();return Jv[A]??7}function Zv(r,A){const e=String(r||"").toUpperCase(),t=A||Pu(r),i={M1:1440,M5:288,M15:96,M30:48,H1:24,H4:6,D1:1,W1:1/7,MN:1/30}[e]||96,s=Math.ceil(t*(typeof i=="number"?i:96));return Math.min(Math.max(s,500),5e3)}const ve=r=>{if(!Array.isArray(r)||r.length===0)return[];const A=r.map(t=>({...t,time:sA(t.time)})).filter(t=>t.time!=null);A.sort((t,i)=>t.time-i.time);const e=new Map;for(const t of A)e.set(t.time,t);return Array.from(e.values()).sort((t,i)=>t.time-i.time)};function ze(r,A,e,t,i,s){const n=i-e,o=s-t,a=Math.sqrt(n*n+o*o);if(a===0)return Math.hypot(r-e,A-t);let l=((r-e)*n+(A-t)*o)/(a*a);l=Math.max(0,Math.min(1,l));const c=e+l*n,u=t+l*o;return Math.hypot(r-c,A-u)}function Yv(r,A,e,t,i,s){const n=i-e,o=s-t,a=n*n+o*o;if(a===0)return Math.hypot(r-e,A-t);let l=((r-e)*n+(A-t)*o)/a;l<0&&(l=0);const c=e+l*n,u=t+l*o;return Math.hypot(r-c,A-u)}function qv(r,A,e,t,i,s){const n=i-e,o=s-t,a=n*n+o*o;if(a===0)return Math.hypot(r-e,A-t);const l=((r-e)*n+(A-t)*o)/a,c=e+l*n,u=t+l*o;return Math.hypot(r-c,A-u)}function zu(r,A,e){let t=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const n=e[i].x,o=e[i].y,a=e[s].x,l=e[s].y;o>A!=l>A&&r<(a-n)*(A-o)/(l-o+1e-7)+n&&(t=!t)}return t}function Zo(r,A,e,t,i){if(!e||!t||!i)return null;const s=e.time,n=t.time,o=n-s,a=e.price,l=t.price,c=i.price;if(Math.abs(o)<1e-9){const p=c-a;return[{time:s,price:a+p},{time:n+1,price:l+p}]}const u=(l-a)/o,d=c+u*(s-i.time),B=c+u*(n-i.time);return[{time:s,price:d},{time:n,price:B}]}const jv=O.forwardRef(function({bidPrice:A="113.638",askPrice:e="113.649",showBuySellPanel:t=!0,onBuyClick:i,onSellClick:s},n){const o=O.useRef(null),a=O.useRef(null),l=O.useRef(null),c=O.useRef(null),u=O.useRef([]),d=O.useRef(!1),B=O.useRef(null),p=O.useRef(null),f=O.useRef(null),g=O.useRef(null),Q=O.useRef([]),[m,E]=O.useState(null),[F,S]=O.useState([]),[P,z]=O.useState(null),[eA,V]=O.useState([]),Y=O.useRef(null),X=O.useRef(null),fA=O.useRef(null),oA=O.useRef(!1);O.useEffect(()=>{fA.current=m},[m]);const pA=O.useRef(new Map),IA=O.useRef(null),vA=(v,b)=>`${v}_${b}`,MA=()=>{const v=vA(BA,EA);return pA.current.get(v)||null},SA=v=>{if(!v)return;const b=vA(BA,EA);pA.current.set(b,v)},{activeTool:UA,setActiveTool:bA,showGrid:CA,snapToGrid:aA,chartObjects:J,setChartObjects:q,orders:yA,selectedSymbol:BA,selectedTimeframe:EA,drawingsVisible:WA,chartType:zA,chartLocked:dt,theme:ae,baseUrl:ft,endpoints:HA,endpointParams:KA}=Be(),uA=O.useRef([]),[mA,gA]=O.useState(!1),[lA,LA]=O.useState(null),[FA,le]=O.useState([]),[Me,pt]=O.useState(!0),ri=O.useRef(null),Gt=O.useRef(new Map);O.useRef(null);const Os=O.useRef(0);O.useImperativeHandle(n,()=>({zoomIn:()=>{const v=a.current?.timeScale();if(!v)return;const b=v.getVisibleRange();if(!b||!b.from||!b.to)return;const _=b.to-b.from,wA=(b.from+b.to)/2,T=_*.8;try{v.setVisibleRange({from:wA-T/2,to:wA+T/2}),SA(v.getVisibleRange())}catch{}},zoomOut:()=>{const v=a.current?.timeScale();if(!v)return;const b=v.getVisibleRange();if(!b||!b.from||!b.to)return;const _=b.to-b.from,wA=(b.from+b.to)/2,T=_*1.25;try{v.setVisibleRange({from:wA-T/2,to:wA+T/2}),SA(v.getVisibleRange())}catch{}},downloadChartAsPNG:()=>{const v=o.current;if(!v){typeof window.notify=="function"&&window.notify("Chart not ready","error");return}const b=v.querySelectorAll("canvas"),_=ae==="light"?"#ffffff":"#12161d";let wA=null,T=0;if(b.forEach(j=>{if(j.width>0&&j.height>0){const rA=j.width*j.height;rA>T&&(T=rA,wA=j)}}),wA)try{const j=document.createElement("canvas");j.width=wA.width,j.height=wA.height;const rA=j.getContext("2d");rA.fillStyle=_,rA.fillRect(0,0,j.width,j.height),rA.drawImage(wA,0,0);const Z=document.createElement("a");Z.download=`chart-${BA}-${EA}-${Date.now()}.png`,Z.href=j.toDataURL("image/png"),Z.click(),typeof window.notify=="function"&&window.notify("Chart saved as PNG","success");return}catch(j){console.warn("Canvas export failed, trying html2canvas",j)}Ov(v,{useCORS:!0,allowTaint:!0,backgroundColor:_,scale:2,logging:!1}).then(j=>{const rA=document.createElement("a");rA.download=`chart-${BA}-${EA}-${Date.now()}.png`,rA.href=j.toDataURL("image/png"),rA.click(),typeof window.notify=="function"&&window.notify("Chart saved as PNG","success")}).catch(j=>{console.error("Chart screenshot failed",j),typeof window.notify=="function"&&window.notify("Screenshot failed. Try again.","error")})}}),[BA,EA,ae]);const Bt=O.useMemo(()=>FA.length===0?[]:zA==="line"||zA==="area"?FA.map(v=>({time:v.time,value:v.close})):FA,[FA,zA]),ii=v=>{i?i(v):(LA("BUY"),gA(!0))},Le=v=>{s?s(v):(LA("SELL"),gA(!0))},ne=()=>{gA(!1),LA(null)};O.useEffect(()=>{const v=o.current;if(!v)return;const b=v.getBoundingClientRect(),_=L=>{const iA=Math.abs(Number(L));return Number.isFinite(iA)?iA>=1e3?iA.toFixed(2):iA>=1?iA.toFixed(4):iA.toFixed(5):"0"},wA=ae==="light",T=Tp(v,{width:b.width||v.clientWidth,height:b.height||v.clientHeight,autoSize:!0,localization:{priceFormatter:_},layout:{background:{color:wA?"#FFFFFF":"#0d1117",type:"solid"},textColor:wA?"#020617":"#e6edf3",fontSize:12,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},grid:{vertLines:{visible:CA,color:CA?wA?"rgba(100, 116, 139, 0.15)":"rgba(110, 118, 129, 0.15)":"transparent",style:CA?2:0},horzLines:{visible:CA,color:CA?wA?"rgba(100, 116, 139, 0.15)":"rgba(110, 118, 129, 0.15)":"transparent",style:CA?2:0}},rightPriceScale:{borderColor:wA?"#e5e7eb":"#21262d",autoScale:!0,scaleMargins:{top:.1,bottom:.1},ticksVisible:!0,ensureEdgeTickMarksVisible:!0,entireTextOnly:!1,textColor:wA?"#64748b":"#8b949e"},leftPriceScale:{visible:!1},timeScale:{borderColor:wA?"#e5e7eb":"#21262d",timeVisible:!0,secondsVisible:!1,rightOffset:12,barSpacing:6,minBarSpacing:4,shiftVisibleRangeOnNewBar:!1,fixLeftEdge:!1,fixRightEdge:!1,rightBarStaysOnScroll:!0,allowShiftVisibleRangeOnWhitespaceClick:!0},crosshair:{mode:UA===1?1:0,vertLine:{width:1,color:wA?"#3b82f6":"#58a6ff",style:0,labelBackgroundColor:wA?"#eff6ff":"#161b22",labelVisible:!0},horzLine:{width:1,color:wA?"#3b82f6":"#58a6ff",style:0,labelBackgroundColor:wA?"#eff6ff":"#161b22",labelVisible:!0},vertLineVisible:UA===1,horzLineVisible:UA===1},handleScroll:{mouseWheel:!0,pressedMouseMove:UA===null||UA===1,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},axisTouch:{time:!0,price:!0},mouseWheel:!0,pinch:!0}}),j=T.addCandlestickSeries({upColor:wA?"#089981":"#26a69a",downColor:wA?"#f23645":"#ef5350",wickUpColor:wA?"#089981":"#26a69a",wickDownColor:wA?"#f23645":"#ef5350",borderUpColor:wA?"#089981":"#26a69a",borderDownColor:wA?"#f23645":"#ef5350",borderVisible:!0});a.current=T,l.current=j,requestAnimationFrame(()=>{if(v&&T){const L=v.getBoundingClientRect();L.width>0&&L.height>0&&T.resize(L.width,L.height)}});const rA=T.timeScale(),Z=()=>{if(oA.current&&Gt.current.size>0){const L=rA.getVisibleRange();L&&SA(L)}};rA.subscribeVisibleTimeRangeChange(Z);const x=new ResizeObserver(L=>{for(const iA of L){const{width:cA,height:G}=iA.contentRect;if(cA>0&&G>0&&T){const y=rA.getVisibleRange();T.resize(cA,G),y&&setTimeout(()=>{try{rA.setVisibleRange(y)}catch{}},0)}}});return x.observe(v),()=>{rA.unsubscribeVisibleTimeRangeChange(Z),x.disconnect(),T.remove(),a.current=null,l.current=null,c.current=null,u.current=[]}},[]),O.useEffect(()=>{a.current&&a.current.applyOptions({grid:{vertLines:{visible:CA,color:CA?"rgba(110, 118, 129, 0.15)":"transparent",style:CA?2:0},horzLines:{visible:CA,color:CA?"rgba(110, 118, 129, 0.15)":"transparent",style:CA?2:0}}})},[CA]),O.useEffect(()=>{const v=a.current;if(!v)return;const b=ae==="light";v.applyOptions({layout:{background:{color:b?"#FFFFFF":"#12161d"},textColor:b?"#020617":"#fff"},grid:{vertLines:{color:CA?b?"rgba(100, 116, 139, 0.25)":"rgba(148, 163, 184, 0.2)":"transparent"},horzLines:{color:CA?b?"rgba(100, 116, 139, 0.25)":"rgba(148, 163, 184, 0.2)":"transparent"}},rightPriceScale:{borderColor:b?"#e5e7eb":"#1e293b"},timeScale:{borderColor:b?"#e5e7eb":"#1e293b"},crosshair:{vertLine:{color:b?"#3b82f6":"#58a6ff",labelBackgroundColor:b?"#eff6ff":"#161b22",width:1},horzLine:{color:b?"#3b82f6":"#58a6ff",labelBackgroundColor:b?"#eff6ff":"#161b22",width:1}}})},[ae,CA]),O.useEffect(()=>{if(!a.current)return;const b=!dt&&!(UA!==null&&UA!==1&&UA!==0),_=!dt;a.current.applyOptions({crosshair:{mode:UA===1?1:0,vertLine:{visible:UA===1,width:1,color:ae==="light"?"#94a3b8":"#64748b",style:0,labelBackgroundColor:ae==="light"?"#e5e7eb":"#1e293b"},horzLine:{visible:UA===1,width:1,color:ae==="light"?"#94a3b8":"#64748b",style:0,labelBackgroundColor:ae==="light"?"#e5e7eb":"#1e293b"}},handleScroll:{mouseWheel:_,pressedMouseMove:b,horzTouchDrag:b,vertTouchDrag:b},handleScale:{axisPressedMouseMove:{time:b,price:b},axisDoubleClickReset:{time:_,price:_},axisTouch:{time:b,price:b},mouseWheel:_,pinch:_}})},[UA,dt]),O.useEffect(()=>{(async()=>{if(!BA||!EA){le([]),oA.current=!1;return}try{if(pt(!0),le([]),oA.current=!1,l.current)try{l.current.setData([])}catch{}console.log(`📊 Fetching candles for ${BA} @ ${EA}`);const b=Pu(EA),_=Zv(EA,b),wA=ft||Vv?.VITE_BASE_URL||"ws://localhost:8000",T=HA?.candles||"/api/chart/candles",j=KA?.candles||{},rA={symbol:j.symbol||"symbol",timeframe:j.timeframe||"timeframe",limit:j.limit||"limit",daysBack:j.daysBack||"daysBack"},Z={};Z[rA.symbol]=BA,Z[rA.timeframe]=EA,Z[rA.limit]=_,j.daysBack!==!1&&(Z[rA.daysBack]=b);const x=await XA.get(`${wA}${T}`,{params:Z,timeout:1e4});let L=[];if(Array.isArray(x.data)?L=x.data:x.data&&x.data.data&&Array.isArray(x.data.data)?L=x.data.data:x.data&&Array.isArray(x.data)&&(L=x.data),L&&L.length>0){console.log(`✅ Loaded ${L.length} raw candles from server`);const{candles:iA,stats:cA}=Dc(L,BA,EA);iA.length>0?(le(iA),Gt.current=new Map,iA.forEach(G=>{Gt.current.set(G.time,G)})):(console.warn(`⚠️ No valid candles after processing for ${BA}`),le([]))}else console.warn(`⚠️ No candle data returned for ${BA}`),le([])}catch(b){console.error(`❌ Error fetching ${BA}:`,b.message),le([])}finally{pt(!1)}})()},[BA,EA]),O.useEffect(()=>{console.log("🔧 [CANDLES DEBUG] Setting up WebSocket for candles:",{baseUrl:ft,symbol:BA,timeframe:EA}),ri.current=Pi.getSocket();const v=ri.current;console.log("🔌 [CANDLES DEBUG] Socket status for CandlesGateway (ROOT namespace):",{socketId:v.id,connected:v.connected,baseUrl:ft,socketUrl:v.io?.uri||"unknown",namespace:v.nsp?.name||"/",hasAuth:!!v.auth,note:"This socket MUST connect to root namespace for CandlesGateway"});const b=()=>{if(console.log("📡 [CANDLES DEBUG] subscribeToCandles called:",{selectedSymbol:BA,selectedTimeframe:EA,connected:v.connected,socketId:v.id}),BA&&EA&&v.connected){const Z={symbol:BA,timeframe:EA};console.log("📡 [CANDLES DEBUG] Emitting subscribeCandles:",Z),v.emit("subscribeCandles",Z),console.log("✅ [CANDLES DEBUG] subscribeCandles event emitted successfully")}else console.warn("⚠️ [CANDLES DEBUG] Cannot subscribe to candles:",{selectedSymbol:BA,selectedTimeframe:EA,connected:v.connected,socketId:v.id,reason:BA?EA?"Not connected":"No timeframe":"No symbol"})},_=()=>{console.log("✅ [CANDLES DEBUG] Chart WebSocket connected to backend, socket ID:",v.id),setTimeout(()=>{BA&&EA&&(console.log("📡 [CANDLES DEBUG] Backend connected, subscribing to candles..."),b())},200)},wA=Z=>{console.log("⚠️ [CANDLES DEBUG] Chart WebSocket disconnected:",Z)},T=Z=>{console.error("❌ [CANDLES DEBUG] Chart WebSocket connection error:",Z),console.error("❌ [CANDLES DEBUG] Error details:",{message:Z.message,description:Z.description,context:Z.context,type:Z.type})};v.on("connect",_),v.on("disconnect",wA),v.on("connect_error",T),v.on("subscription:confirmed",Z=>{console.log("✅ [CANDLES DEBUG] Subscription confirmed:",Z),Z.type==="candles"&&console.log("✅ [CANDLES DEBUG] Candle subscription confirmed for:",{symbol:Z.symbol,timeframe:Z.timeframe})});const j=Z=>{if(console.log("📊 [CANDLES DEBUG] candleUpdate event received:",Z),!Z||!Z.candle||!Z.symbol){console.warn("⚠️ [CANDLES DEBUG] Invalid candleUpdate data:",Z);return}if(console.log("✅ [CANDLES DEBUG] Valid candleUpdate received:",{symbol:Z.symbol,timeframe:Z.timeframe,candle:Z.candle,selectedSymbol:BA,selectedTimeframe:EA}),Z.symbol.toUpperCase()!==BA?.toUpperCase()){console.log(`⚠️ [CANDLES DEBUG] Symbol mismatch: received ${Z.symbol}, selected ${BA}`);return}const{candle:x}=Z;console.log("✅ [CANDLES DEBUG] Processing candle update:",{symbol:Z.symbol,timeframe:Z.timeframe,candle:x,candleTime:x.time,candleClose:x.close});const L=_c(x,BA,EA);if(!L){console.warn("⚠️ [CANDLES DEBUG] Rejected realtime candle (invalid):",{symbol:Z.symbol,candle:x});return}console.log("✅ [CANDLES DEBUG] Processed candle:",{time:L.time,open:L.open,high:L.high,low:L.low,close:L.close});const iA=Date.now();if(iA-Os.current<200)return;Os.current=iA;const cA=a.current?.timeScale(),G=cA?.getVisibleRange(),y=l.current,H=a.current;if(!y||!H||!oA.current){console.warn("⚠️ [CANDLES DEBUG] Chart not ready for update:",{hasSeries:!!y,hasChart:!!H,hasInitialized:oA.current});return}const N=y?.seriesType?.(),U=zA==="line"?"Line":zA==="area"?"Area":zA==="bars"?"Bar":"Candlestick";if(N!==U){console.warn("⚠️ [CANDLES DEBUG] Series type mismatch:",{expected:U,actual:N,chartType:zA,note:"Chart type switch might be in progress, skipping update"});return}try{const w=Gt.current.get(L.time),I=w?{time:L.time,open:w.open,high:Math.max(w.high,L.close),low:Math.min(w.low,L.close),close:L.close}:L;Gt.current.set(L.time,I);try{zA==="line"||zA==="area"?y.update({time:I.time,value:I.close}):y.update(I),cA&&G&&SA(G),console.log("✅ [CANDLES DEBUG] Candle update completed successfully")}catch(D){throw console.error("❌ [CANDLES DEBUG] Error in s.update():",D),console.error("❌ [CANDLES DEBUG] Series type:",y?.seriesType?.()),console.error("❌ [CANDLES DEBUG] Processed candle:",L),D}}catch(w){console.error("❌ [CANDLES DEBUG] Error updating candle:",w),console.error("❌ [CANDLES DEBUG] Error stack:",w.stack)}};v.on("candleUpdate",j);const rA=()=>{v.connected&&BA&&EA?(console.log("✅ [CANDLES DEBUG] Socket connected, subscribing to backend..."),b()):console.log("⏳ [CANDLES DEBUG] Waiting for socket connection...",{connected:v.connected,hasSymbol:!!BA,hasTimeframe:!!EA})};if(v.connected)rA();else{const Z=()=>{console.log("✅ [CANDLES DEBUG] Socket connected to backend, subscribing..."),setTimeout(rA,200)};v.once("connect",Z),setTimeout(()=>{v.connected&&rA()},500)}return()=>{v.off("candleUpdate",j),v.off("connect",_),v.off("disconnect",wA),v.off("connect_error",T),v.off("subscription:confirmed"),BA&&EA&&v.connected&&(console.log(`🔌 Unsubscribing from: ${BA}@${EA}`),v.emit("unsubscribeCandles",{symbol:BA,timeframe:EA}))}},[BA,EA,ft]),O.useEffect(()=>{const v=l.current,b=a.current;if(!(!v||!b)&&!(FA.length===0&&oA.current)){if(FA.length===0&&!oA.current){if(Me)return;const _=b.timeScale();v.setData([]),_.fitContent();return}if(!oA.current){const _=b.timeScale(),wA=vA(BA,EA);IA.current,IA.current=wA,console.log("sorted candles 1");const T=[...FA].sort((rA,Z)=>rA.time-Z.time);if(console.log("📊 [CANDLES DEBUG] Initializing chart with candles:",{candleCount:T?.length,chartType:zA,seriesType:v?.seriesType?.()||"unknown",firstCandle:T[0],lastCandle:T[T?.length-1]}),console.log("sorted candles 2"),zA==="line"||zA==="area"){const rA=T?.map(Z=>({time:Z.time,value:Z.close})).filter(Z=>Z.time!=null);rA.length>0&&(console.log("📊 [CANDLES DEBUG] Setting line/area data:",rA.length,"points"),v.setData(rA),console.log("✅ [CANDLES DEBUG] Line/area data set successfully"))}else console.log("sorted candles 3"),T?.length>0&&(console.log("📊 [CANDLES DEBUG] Setting candlestick data:",T?.length,"candles"),console.log("📊 [CANDLES DEBUG] First candle sample:",T[0]),console.log("📊 [CANDLES DEBUG] Last candle sample:",T[T?.length-1]),v.setData(T),console.log("✅ [CANDLES DEBUG] Candlestick data set successfully"));if(console.log("sorted candles 4"),T?.length>0){const rA=T[T?.length-1].time,Z=Ot(EA)||60,x=EA==="M1"?150:EA==="M5"?120:100,L=rA-x*Z;console.log("📊 [CANDLES DEBUG] Setting visible range:",{from:L,to:rA+Z*2,visibleBars:x,timeframeSeconds:Z});try{_.setVisibleRange({from:L,to:rA+Z*2}),console.log("✅ [CANDLES DEBUG] Visible range set successfully")}catch(iA){console.warn("⚠️ [CANDLES DEBUG] Failed to set visible range, using fitContent:",iA),_.fitContent()}}else console.warn("⚠️ [CANDLES DEBUG] No candles to set visible range, using fitContent"),_.fitContent();try{b.priceScale("right").applyOptions({borderColor:"#1e293b",autoScale:!0,scaleMargins:{top:.1,bottom:.1},ticksVisible:!0,ensureEdgeTickMarksVisible:!0}),console.log("✅ [CANDLES DEBUG] Price scale configured successfully")}catch{console.warn("⚠️ [CANDLES DEBUG] Failed to configure price scale")}oA.current=!0;const j=_.getVisibleRange();SA(j),console.log("sorted candles 5"),console.log("✅ [CANDLES DEBUG] Chart initialization completed:",{hasInitialized:oA.current,visibleRange:j,candleCount:T?.length})}}},[FA.length,zA,BA,EA]),O.useEffect(()=>{const v=a.current;if(!v||!oA.current||FA.length===0){console.log("⏳ [CANDLES DEBUG] Chart type switch skipped:",{hasChart:!!v,hasInitialized:oA.current,candleCount:FA.length,chartType:zA});return}console.log("🔄 [CANDLES DEBUG] Switching chart type:",{from:l.current?.seriesType?.()||"unknown",to:zA,candleCount:FA.length});const b=v.timeScale(),_=b.getVisibleRange()||MA();if(l.current)try{v.removeSeries(l.current)}catch{}if(c.current)try{v.removeSeries(c.current),c.current=null}catch{}let wA;if(zA==="bars"){const T=ae==="light";wA=v.addBarSeries({upColor:T?"#089981":"#26A69A",downColor:T?"#f23645":"#EF5350",borderUpColor:T?"#089981":"#26A69A",borderDownColor:T?"#f23645":"#EF5350",scaleMargins:{top:.1,bottom:.1}}),console.log("sorted candles 6");const j=[...FA].sort((rA,Z)=>rA.time-Z.time);j?.length>0&&wA.setData(j)}else if(zA==="line"){wA=v.addLineSeries({color:"#38bdf8",lineWidth:2,priceLineVisible:!1,lastValueVisible:!0,scaleMargins:{top:.1,bottom:.1}});const T=ve(Bt);T.length>0&&wA.setData(T)}else if(zA==="area"){wA=v.addAreaSeries({lineColor:"#38bdf8",topColor:"rgba(56,189,248,0.4)",bottomColor:"rgba(56,189,248,0.0)",lineWidth:2,priceLineVisible:!1,lastValueVisible:!0,scaleMargins:{top:.1,bottom:.1}});const T=ve(Bt);T.length>0&&wA.setData(T)}else if(zA==="volume ticks"||zA==="volume"){const T=ae==="light";wA=v.addCandlestickSeries({upColor:T?"#089981":"#26A69A",downColor:T?"#f23645":"#EF5350",wickUpColor:T?"#089981":"#26A69A",wickDownColor:T?"#f23645":"#EF5350",borderUpColor:T?"#089981":"#26A69A",borderDownColor:T?"#f23645":"#EF5350",borderVisible:!0,priceScaleId:"right"}),console.log("sorted candles 7");const j=[...FA].sort((x,L)=>x.time-L.time);j?.length>0&&wA.setData(j);const rA=v.addHistogramSeries({priceFormat:{type:"volume"},priceScaleId:"vol",base:0,priceLineVisible:!1,lastValueVisible:!1,color:"rgba(38,166,154,0.15)"});v.priceScale("right").applyOptions({scaleMargins:{top:.05,bottom:.3}}),v.priceScale("vol").applyOptions({scaleMargins:{top:.75,bottom:0},visible:!1}),console.log("sorted candles 8");const Z=j?.map(x=>({time:x.time,value:x.volume||0,color:x.close>=x.open?"rgba(38,166,154,0.25)":"rgba(239,83,80,0.25)"}));Z.length>0&&rA.setData(Z),c.current=rA}else{const T=ae==="light";wA=v.addCandlestickSeries({upColor:T?"#089981":"#26A69A",downColor:T?"#f23645":"#EF5350",wickUpColor:T?"#089981":"#26A69A",wickDownColor:T?"#f23645":"#EF5350",borderUpColor:T?"#089981":"#26A69A",borderDownColor:T?"#f23645":"#EF5350",borderVisible:!0,scaleMargins:{top:.1,bottom:.1}}),console.log("sorted candles 9");const j=[...FA].sort((rA,Z)=>rA.time-Z.time);j?.length>0&&wA.setData(j)}if(l.current=wA,_&&oA.current)setTimeout(()=>{try{b.setVisibleRange(_),SA(_)}catch{if(FA.length>0)try{const j=FA[FA.length-1].time,rA=j-6e3;b.setVisibleRange({from:rA,to:j}),SA(b.getVisibleRange())}catch{b.fitContent(),SA(b.getVisibleRange())}}try{v.priceScale("right").applyOptions({borderColor:"#1e293b",autoScale:!0,scaleMargins:{top:.1,bottom:.1},ticksVisible:!0,ensureEdgeTickMarksVisible:!0})}catch{}},0);else if(!oA.current){b.fitContent();try{v.priceScale("right").applyOptions({borderColor:"#1e293b",autoScale:!0,scaleMargins:{top:.1,bottom:.1},ticksVisible:!0,ensureEdgeTickMarksVisible:!0})}catch{}oA.current=!0,SA(b.getVisibleRange())}},[zA,FA.length,Bt.length]),O.useEffect(()=>{const v=a.current,b=c.current;if(!v||!b||!oA.current||FA.length===0||zA!=="volume"&&zA!=="volume ticks")return;console.log("sorted candles 10");const _=[...FA].sort((T,j)=>T.time-j.time);console.log("sorted candles 11");const wA=_?.map(T=>({time:T.time,value:T.volume||0,color:T.close>=T.open?"rgba(38,166,154,0.25)":"rgba(239,83,80,0.25)"}));wA.length>0&&b.setData(wA)},[FA,zA]),O.useEffect(()=>{const v=a.current,b=l.current,_=o.current;if(!v||!b||!_)return;const T=UA!==null?[null,null,"trendline","parallellines","fibonacci","rectangle",null,"text",null,null,null,null,null,null,null,null,null,null,null,null,"pricelevel","horizontalray","verticalline","infoline","rulerline","arrowedline","rayline","extendedline","crossline","trendbyangle","disjointchannel","flattopbottom"][UA]:null;if(!T){if(d.current=!1,B.current=null,p.current=null,g.current=null,f.current?.series)try{v.removeSeries(f.current.series)}catch{}f.current=null;return}if(T==="pricelevel"){const x=L=>{const iA=_.getBoundingClientRect(),cA=L.clientX-iA.left,G=L.clientY-iA.top,y=v.timeScale().coordinateToTime(cA),H=b.coordinateToPrice(G);if(y==null||H==null)return;const U={type:"pricelevel",priceLine:b.createPriceLine({price:H,color:"#3b82f6",lineWidth:2,lineStyle:2,axisLabelVisible:!0,title:H.toFixed(5)}),price:H};q(w=>[...w,U]),u.current.push(U)};return _.addEventListener("click",x),()=>{_.removeEventListener("click",x)}}if(T==="horizontalray"){const x=L=>{const iA=_.getBoundingClientRect(),cA=L.clientX-iA.left,G=L.clientY-iA.top,y=v.timeScale().coordinateToTime(cA),H=b.coordinateToPrice(G);if(y==null||H==null)return;const N=new Pv(H,y);b.attachPrimitive(N);const U=sA(y),w={type:"horizontalray",primitive:N,price:H,originTime:U};q(I=>[...I,w]),u.current.push(w)};return _.addEventListener("click",x),()=>_.removeEventListener("click",x)}if(T==="verticalline"){const x=L=>{const iA=_.getBoundingClientRect(),cA=L.clientX-iA.left,G=v.timeScale().coordinateToTime(cA);if(G==null)return;const y=new Xv(G);b.attachPrimitive(y);const H=sA(G),N={type:"verticalline",primitive:y,time:H};q(U=>[...U,N]),u.current.push(N)};return _.addEventListener("click",x),()=>_.removeEventListener("click",x)}if(T==="infoline"){let x=null,L=null;const iA=G=>{if(!x)return;const y=_.getBoundingClientRect(),H=G.clientX-y.left,N=G.clientY-y.top,U=v.timeScale().coordinateToTime(H),w=b.coordinateToPrice(N);if(U==null||w==null)return;L||(L=v.addLineSeries({color:"#3b82f6",lineWidth:2,crosshairMarkerVisible:!1,priceLineVisible:!1,lastValueVisible:!1}));const I=x.normalizedTime,D=sA(U);if(I==null||D==null||I===D)return;const M=I<=D?[{time:I,value:x.price},{time:D,value:w}]:[{time:D,value:w},{time:I,value:x.price}];try{L.setData(M)}catch{}},cA=G=>{const y=_.getBoundingClientRect(),H=G.clientX-y.left,N=G.clientY-y.top,U=v.timeScale().coordinateToTime(H),w=b.coordinateToPrice(N);if(U==null||w==null)return;if(!x){x={rawTime:U,price:w,normalizedTime:sA(U),x:H,y:N};return}if(L){try{v.removeSeries(L)}catch{}L=null}const I=x.normalizedTime,D=sA(U);if(I==null||D==null)return;const M=w-x.price,C=M/Math.abs(x.price)*100,k=Ot(EA)||3600,R=Math.abs(D-I),$=Math.max(1,Math.round(R/k)),W=Math.max(1,Math.round(R/86400)),tA=x.x,nA=x.y,QA=H,VA=Math.atan2(-(N-nA),QA-tA)*(180/Math.PI),Ae={priceDiff:M,pricePct:C,bars:$,days:W,angle:VA},JA=new zv({rawTime:x.rawTime,price:x.price},{rawTime:U,price:w},Ae);b.attachPrimitive(JA);const he={type:"infoline",primitive:JA,p1:{time:I,price:x.price},p2:{time:D,price:w}};q(De=>[...De,he]),u.current.push(he),x=null,bA(null)};return _.addEventListener("mousemove",iA),_.addEventListener("click",cA),()=>{if(_.removeEventListener("mousemove",iA),_.removeEventListener("click",cA),L)try{v.removeSeries(L)}catch{}}}if(T==="rulerline"){let x=null,L=null;const iA=(y,H,N,U)=>{const w=sA(y),I=sA(N),D=U-H,M=D/Math.abs(H)*100,C=Ot(EA)||3600,k=Math.abs((I??0)-(w??0)),R=Math.max(1,Math.round(k/C)),$=Math.max(1,Math.round(k/86400));return{priceDiff:D,pricePct:M,bars:R,days:$}},cA=y=>{if(!x)return;const H=_.getBoundingClientRect(),N=y.clientX-H.left,U=y.clientY-H.top,w=v.timeScale().coordinateToTime(N),I=b.coordinateToPrice(U);if(w==null||I==null)return;const D=sA(w);if(D==null||D===x.normalizedTime)return;const M=iA(x.rawTime,x.price,w,I);if(!L)L=new Nu({rawTime:x.rawTime,price:x.price},{rawTime:w,price:I},M),b.attachPrimitive(L);else{L.p2={rawTime:w,price:I},L.info=M;const C=I>=x.price;L.color=C?"#3b82f6":"#ef5350",L.fillColor=C?"rgba(59,130,246,0.1)":"rgba(239,83,80,0.1)";try{a.current?.applyOptions({})}catch{}}},G=y=>{const H=_.getBoundingClientRect(),N=y.clientX-H.left,U=y.clientY-H.top,w=v.timeScale().coordinateToTime(N),I=b.coordinateToPrice(U);if(w==null||I==null)return;if(!x){x={rawTime:w,price:I,normalizedTime:sA(w)};return}if(L){try{b.detachPrimitive(L)}catch{}L=null}const D=x.normalizedTime,M=sA(w);if(D==null||M==null)return;const C=iA(x.rawTime,x.price,w,I),k=new Nu({rawTime:x.rawTime,price:x.price},{rawTime:w,price:I},C);b.attachPrimitive(k);const R={type:"rulerline",primitive:k,p1:{rawTime:x.rawTime,normalizedTime:D,price:x.price},p2:{rawTime:w,normalizedTime:M,price:I}};q($=>[...$,R]),u.current.push(R),x=null,bA(null)};return _.addEventListener("mousemove",cA),_.addEventListener("click",G),()=>{if(_.removeEventListener("mousemove",cA),_.removeEventListener("click",G),L)try{b.detachPrimitive(L)}catch{}}}if(T==="arrowedline"){let x=null,L=null;const iA=G=>{if(!x)return;const y=_.getBoundingClientRect(),H=G.clientX-y.left,N=G.clientY-y.top,U=v.timeScale().coordinateToTime(H),w=b.coordinateToPrice(N);if(U==null||w==null)return;const I=sA(U);if(!(I==null||I===x.normalizedTime))if(!L)L=new Ku({rawTime:x.rawTime,price:x.price},{rawTime:U,price:w}),b.attachPrimitive(L);else{L.p2={rawTime:U,price:w};try{a.current?.applyOptions({})}catch{}}},cA=G=>{const y=_.getBoundingClientRect(),H=G.clientX-y.left,N=G.clientY-y.top,U=v.timeScale().coordinateToTime(H),w=b.coordinateToPrice(N);if(U==null||w==null)return;if(!x){x={rawTime:U,price:w,normalizedTime:sA(U)};return}if(L){try{b.detachPrimitive(L)}catch{}L=null}const I=x.normalizedTime,D=sA(U);if(I==null||D==null||I===D)return;const M=new Ku({rawTime:x.rawTime,price:x.price},{rawTime:U,price:w});b.attachPrimitive(M);const C={type:"arrowedline",primitive:M,p1:{rawTime:x.rawTime,normalizedTime:I,price:x.price},p2:{rawTime:U,normalizedTime:D,price:w}};q(k=>[...k,C]),u.current.push(C),x=null,bA(null)};return _.addEventListener("mousemove",iA),_.addEventListener("click",cA),()=>{if(_.removeEventListener("mousemove",iA),_.removeEventListener("click",cA),L)try{b.detachPrimitive(L)}catch{}}}if(T==="rayline"){const x=L=>{const iA=_.getBoundingClientRect(),cA=L.clientX-iA.left,G=L.clientY-iA.top,y=v.timeScale().coordinateToTime(cA),H=b.coordinateToPrice(G);if(y==null||H==null)return;const N=cA+140,U=v.timeScale().coordinateToTime(N);if(U==null)return;const w=sA(y),I=sA(U);if(w==null||I==null)return;const D=new Gv({rawTime:y,price:H},{rawTime:U,price:H});b.attachPrimitive(D);const M={type:"rayline",primitive:D,p1:{rawTime:y,normalizedTime:w,price:H},p2:{rawTime:U,normalizedTime:I,price:H}};q(C=>[...C,M]),u.current.push(M),bA(null)};return _.addEventListener("click",x),()=>_.removeEventListener("click",x)}if(T==="extendedline"){const x=L=>{const iA=_.getBoundingClientRect(),cA=L.clientX-iA.left,G=L.clientY-iA.top,y=v.timeScale().coordinateToTime(cA),H=b.coordinateToPrice(G);if(y==null||H==null)return;const N=cA+140,U=v.timeScale().coordinateToTime(N);if(U==null)return;const w=sA(y),I=sA(U);if(w==null||I==null)return;const D=new Rv({rawTime:y,price:H},{rawTime:U,price:H});b.attachPrimitive(D);const M={type:"extendedline",primitive:D,p1:{rawTime:y,normalizedTime:w,price:H},p2:{rawTime:U,normalizedTime:I,price:H}};q(C=>[...C,M]),u.current.push(M),bA(null)};return _.addEventListener("click",x),()=>_.removeEventListener("click",x)}if(T==="crossline"){const x=L=>{const iA=_.getBoundingClientRect(),cA=L.clientX-iA.left,G=L.clientY-iA.top,y=v.timeScale().coordinateToTime(cA),H=b.coordinateToPrice(G);if(y==null||H==null)return;const N=sA(y);if(N==null)return;const U=new Wv({rawTime:y,price:H});b.attachPrimitive(U);const w={type:"crossline",primitive:U,p:{rawTime:y,normalizedTime:N,price:H}};q(I=>[...I,w]),u.current.push(w),bA(null)};return _.addEventListener("click",x),()=>_.removeEventListener("click",x)}if(T==="trendbyangle"){const x=L=>{const iA=_.getBoundingClientRect(),cA=L.clientX-iA.left,G=L.clientY-iA.top,y=v.timeScale().coordinateToTime(cA),H=b.coordinateToPrice(G);if(y==null||H==null)return;const N=cA+140,U=v.timeScale().coordinateToTime(N);if(U==null)return;const w=sA(y),I=sA(U);if(w==null||I==null)return;const D=new $v({rawTime:y,price:H},{rawTime:U,price:H});b.attachPrimitive(D);const M={type:"trendbyangle",primitive:D,p1:{rawTime:y,normalizedTime:w,price:H},p2:{rawTime:U,normalizedTime:I,price:H}};q(C=>[...C,M]),u.current.push(M),bA(null)};return _.addEventListener("click",x),()=>_.removeEventListener("click",x)}if(T==="disjointchannel"){let x=null,L=null,iA=null,cA=null,G=0,y=null;const H=(w,I,D,M)=>{if(!y)y=new Jo(w,I,D,M),b.attachPrimitive(y);else{y.p1=w,y.p2=I,y.p3=D,y.p4=M;try{a.current?.applyOptions({})}catch{}}},N=w=>{if(G===0||!x)return;const I=_.getBoundingClientRect(),D=w.clientX-I.left,M=w.clientY-I.top;if(G===1){const C=b.coordinateToPrice(M);if(C==null)return;L={rawTime:x.rawTime,normalizedTime:x.normalizedTime,price:C},H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price});return}if(G===2&&L){const C=v.timeScale().coordinateToTime(D),k=b.coordinateToPrice(M);if(C==null||k==null)return;const R=sA(C);if(R==null)return;const $=(x.price+L.price)/2;k>=$?(iA={rawTime:C,normalizedTime:R,price:k},cA={rawTime:C,normalizedTime:R,price:2*$-k}):(cA={rawTime:C,normalizedTime:R,price:k},iA={rawTime:C,normalizedTime:R,price:2*$-k}),H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:iA.rawTime,price:iA.price},{rawTime:cA.rawTime,price:cA.price})}},U=w=>{const I=_.getBoundingClientRect(),D=w.clientX-I.left,M=w.clientY-I.top,C=v.timeScale().coordinateToTime(D),k=b.coordinateToPrice(M);if(C==null||k==null)return;const R=sA(C);if(R!=null){if(G===0){x={rawTime:C,normalizedTime:R,price:k},L={rawTime:C,normalizedTime:R,price:k},G=1,H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price});return}if(G===1){const $=b.coordinateToPrice(M);if($==null||Math.abs($-x.price)<1e-7)return;L={rawTime:x.rawTime,normalizedTime:x.normalizedTime,price:$},G=2;return}if(G===2&&y){try{b.detachPrimitive(y)}catch{}const $=new Jo(y.p1,y.p2,y.p3,y.p4);b.attachPrimitive($);const W={type:"disjointchannel",primitive:$,p1:x,p2:L,p3:{rawTime:y.p3.rawTime,normalizedTime:sA(y.p3.rawTime),price:y.p3.price},p4:{rawTime:y.p4.rawTime,normalizedTime:sA(y.p4.rawTime),price:y.p4.price}};q(tA=>[...tA,W]),u.current.push(W),bA(null)}}};return _.addEventListener("mousemove",N),_.addEventListener("click",U),()=>{if(_.removeEventListener("mousemove",N),_.removeEventListener("click",U),y)try{b.detachPrimitive(y)}catch{}}}if(T==="flattopbottom"){let x=null,L=null,iA=null,cA=null,G=0,y=null;const H=(w,I,D,M)=>{if(!y)y=new Vu(w,I,D,M),b.attachPrimitive(y);else{y.p1=w,y.p2=I,y.p3=D,y.p4=M;try{a.current?.applyOptions({})}catch{}}},N=w=>{if(G===0||!x)return;const I=_.getBoundingClientRect(),D=w.clientX-I.left,M=w.clientY-I.top;if(G===1){const C=b.coordinateToPrice(M);if(C==null)return;L={rawTime:x.rawTime,normalizedTime:x.normalizedTime,price:C},H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price});return}if(G===2&&L){const C=v.timeScale().coordinateToTime(D),k=b.coordinateToPrice(M);if(C==null||k==null)return;const R=sA(C);if(R==null)return;iA={rawTime:C,normalizedTime:R,price:k},cA={rawTime:C,normalizedTime:R,price:L.price},H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:iA.rawTime,price:iA.price},{rawTime:cA.rawTime,price:cA.price})}},U=w=>{const I=_.getBoundingClientRect(),D=w.clientX-I.left,M=w.clientY-I.top,C=v.timeScale().coordinateToTime(D),k=b.coordinateToPrice(M);if(C==null||k==null)return;const R=sA(C);if(R!=null){if(G===0){x={rawTime:C,normalizedTime:R,price:k},L={rawTime:C,normalizedTime:R,price:k},G=1,H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price});return}if(G===1){const $=b.coordinateToPrice(M);if($==null||Math.abs($-x.price)<1e-7)return;L={rawTime:x.rawTime,normalizedTime:x.normalizedTime,price:$},G=2;return}if(G===2&&y){try{b.detachPrimitive(y)}catch{}const $=new Vu(y.p1,y.p2,y.p3,y.p4);b.attachPrimitive($);const W={type:"flattopbottom",primitive:$,p1:x,p2:L,p3:{rawTime:y.p3.rawTime,normalizedTime:sA(y.p3.rawTime),price:y.p3.price},p4:{rawTime:y.p4.rawTime,normalizedTime:sA(y.p4.rawTime),price:y.p4.price}};q(tA=>[...tA,W]),u.current.push(W),bA(null)}}};return _.addEventListener("mousemove",N),_.addEventListener("click",U),()=>{if(_.removeEventListener("mousemove",N),_.removeEventListener("click",U),y)try{b.detachPrimitive(y)}catch{}}}if(T==="trendline"){const x=G=>{G.preventDefault(),G.stopPropagation(),G.stopImmediatePropagation();const y=_.getBoundingClientRect(),H=G.clientX-y.left,N=G.clientY-y.top;let U=v.timeScale().coordinateToTime(H);const w=b.coordinateToPrice(N);if(!(U==null||w==null)&&(U=sA(U),U!=null))if(g.current===null){g.current={time:U,price:w};const I=v.addLineSeries({color:"#22c55e",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});f.current={type:"trendline",series:I},I.setData([{time:U,value:w}])}else{const I=g.current,D={time:U,price:w},M=1,C=1e-5,k=Math.abs(D.time-I.time),R=Math.abs(D.price-I.price);if(k<M&&R<C){try{v.removeSeries(f.current.series)}catch{}g.current=null,f.current=null;return}const $={time:I.time,price:I.price},W={time:D.time,price:D.price},tA=ve([{time:$.time,value:$.price},{time:W.time,value:W.price}]);if(tA.length>0){f.current.series.setData(tA);const nA={type:"trendline",series:f.current.series,point1:$,point2:W};q(QA=>[...QA,nA]),u.current.push(nA)}bA(null),g.current=null,f.current=null}},L=G=>{if(g.current===null||f.current?.type!=="trendline")return;G.preventDefault(),G.stopPropagation();const y=_.getBoundingClientRect(),H=G.clientX-y.left,N=G.clientY-y.top;let U=v.timeScale().coordinateToTime(H);const w=b.coordinateToPrice(N);if(U==null||w==null||(U=sA(U),U==null))return;const I=g.current,D=ve([{time:I.time,value:I.price},{time:U,value:w}]);D.length>0&&f.current.series.setData(D)},iA=G=>{G.stopPropagation()},cA={capture:!0,passive:!1};return _.addEventListener("click",x,cA),_.addEventListener("mousemove",L,cA),_.addEventListener("mousemove",iA,cA),()=>{if(g.current=null,f.current?.type==="trendline"&&f.current?.series){try{v.removeSeries(f.current.series)}catch{}f.current=null}_.removeEventListener("click",x,cA),_.removeEventListener("mousemove",L,cA),_.removeEventListener("mousemove",iA,cA)}}if(T==="parallellines"){const x={capture:!0,passive:!1},L=H=>{H.preventDefault(),H.stopPropagation(),H.stopImmediatePropagation();const N=_.getBoundingClientRect(),U=H.clientX-N.left,w=H.clientY-N.top;let I=v.timeScale().coordinateToTime(U);const D=b.coordinateToPrice(w);if(I==null||D==null||(I=sA(I),I==null))return;const M={time:I,price:D},C=Q.current;if(C.length===0){Q.current=[M];const k=v.addLineSeries({color:"#8b5cf6",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});k.setData([{time:I,value:D}]),f.current={type:"parallellines",series:k,previewLine:null}}else if(C.length===1){Q.current=[C[0],M];const k=ve([{time:C[0].time,value:C[0].price},{time:I,value:D}]);k.length>0&&f.current.series.setData(k),f.current.previewLine=v.addLineSeries({color:"#8b5cf6",lineWidth:2,lineStyle:2,priceLineVisible:!1,lastValueVisible:!1});const R=Zo(v,b,C[0],M,M);R&&f.current.previewLine.setData(ve([{time:R[0].time,value:R[0].price},{time:R[1].time,value:R[1].price}]))}else{const[k,R]=C,$=M;if(f.current?.previewLine){try{v.removeSeries(f.current.previewLine)}catch{}f.current.previewLine=null}const W=f.current?.series;if(!W)return;const tA=Zo(v,b,k,R,$);if(!tA)return;const nA=v.addLineSeries({color:"#8b5cf6",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});W.setData(ve([{time:k.time,value:k.price},{time:R.time,value:R.price}])),nA.setData(ve([{time:tA[0].time,value:tA[0].price},{time:tA[1].time,value:tA[1].price}]));const QA={type:"parallellines",point1:k,point2:R,point3:$,baseLine:W,parallelLine:nA};q(_A=>[..._A,QA]),u.current.push(QA),bA(null),Q.current=[],f.current=null}},iA=H=>{const N=Q.current;if(N.length!==1||!f.current?.series)return;const U=_.getBoundingClientRect(),w=H.clientX-U.left,I=H.clientY-U.top;let D=v.timeScale().coordinateToTime(w);const M=b.coordinateToPrice(I);if(D==null||M==null||(D=sA(D),D==null))return;const C=ve([{time:N[0].time,value:N[0].price},{time:D,value:M}]);C.length>0&&f.current.series.setData(C)},cA=H=>{const N=Q.current;if(N.length!==2||!f.current?.previewLine)return;const U=_.getBoundingClientRect(),w=H.clientX-U.left,I=H.clientY-U.top;let D=v.timeScale().coordinateToTime(w);const M=b.coordinateToPrice(I);if(D==null||M==null||(D=sA(D),D==null))return;const C={time:D,price:M},k=Zo(v,b,N[0],N[1],C);k&&f.current.previewLine.setData(ve([{time:k[0].time,value:k[0].price},{time:k[1].time,value:k[1].price}]))},G=H=>{iA(H),cA(H)},y=H=>{H.stopPropagation()};return _.addEventListener("click",L,x),_.addEventListener("mousemove",G,x),_.addEventListener("mousemove",y,x),()=>{if(Q.current=[],f.current?.type==="parallellines"){try{f.current.series&&v.removeSeries(f.current.series),f.current.previewLine&&v.removeSeries(f.current.previewLine)}catch{}f.current=null}_.removeEventListener("click",L,x),_.removeEventListener("mousemove",G,x),_.removeEventListener("mousemove",y,x)}}if(g.current=null,f.current?.type==="trendline"&&f.current?.series){try{v.removeSeries(f.current.series)}catch{}f.current=null}const j=x=>{if(x.preventDefault(),x.stopPropagation(),x.stopImmediatePropagation(),T==="trendline"||T==="parallellines"||T!=="rectangle"&&T!=="fibonacci")return;const L=_.getBoundingClientRect(),iA=x.clientX-L.left,cA=x.clientY-L.top;let G=v.timeScale().coordinateToTime(iA);const y=b.coordinateToPrice(cA);if(!(G==null||y==null)&&(G=sA(G),G!=null)){if(d.current=!0,B.current={time:G,price:y},p.current=null,T==="rectangle"){const H=v.addBaselineSeries({baseValue:{type:"price",price:y},topLineColor:"#2563eb",bottomLineColor:"#2563eb",topFillColor1:"rgba(59, 130, 246, 0.38)",topFillColor2:"rgba(59, 130, 246, 0.22)",bottomFillColor1:"rgba(59, 130, 246, 0.22)",bottomFillColor2:"rgba(59, 130, 246, 0.38)",priceLineVisible:!1,lastValueVisible:!1,lineWidth:2,lineStyle:0});f.current={type:"rectangle",series:H}}if(T==="fibonacci"){const H=v.addLineSeries({color:"#f59e0b",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});f.current={type:"fibonacci",series:H,priceLines:[]}}if(T==="parallellines"){const H=v.addLineSeries({color:"#8b5cf6",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});f.current={type:"parallellines",series:H,firstLine:null,secondLine:null}}}},rA=x=>{if(!d.current||!B.current||!f.current)return;x.preventDefault(),x.stopPropagation(),x.stopImmediatePropagation();const L=_.getBoundingClientRect(),iA=x.clientX-L.left,cA=x.clientY-L.top;let G=v.timeScale().coordinateToTime(iA);const y=b.coordinateToPrice(cA);if(G==null||y==null||(G=sA(G),G==null))return;p.current={time:G,price:y};const H=B.current;if(f.current.type==="rectangle"){const N=Math.max(H.price,y),U=Math.min(H.price,y),w=sA(Math.min(H.time,G)),I=sA(Math.max(H.time,G));if(w==null||I==null||Math.abs(I-w)<1||Math.abs(N-U)<1e-5)return;const D=f.current.series;D.setData(ve([{time:w,value:N},{time:I,value:N}])),D.applyOptions({baseValue:{type:"price",price:U}})}if(f.current.type==="fibonacci"){const N=[{time:H.time,value:H.price},{time:G,value:y}],U=ve(N);U.length>0&&f.current.series.setData(U),p.current={time:G,price:y},f.current.priceLines&&(f.current.priceLines.forEach(w=>{try{b.removePriceLine(w)}catch{}}),f.current.priceLines=[])}if(f.current.type==="parallellines")if(f.current.firstLine){const N=f.current.firstLine;N.endTime-N.startTime;const U=N.endPrice-N.startPrice,w=y,I=w+U;if(f.current.secondLine)f.current.secondLine.setData([{time:H.time,value:w},{time:G,value:I}]);else{const D=v.addLineSeries({color:"#8b5cf6",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});D.setData([{time:H.time,value:w},{time:G,value:I}]),f.current.secondLine=D}}else f.current.series.setData([{time:H.time,value:H.price},{time:G,value:y}])},Z=x=>{if(x&&(x.preventDefault(),x.stopPropagation()),!d.current||!f.current||!B.current)return;const L=B.current,iA=p.current||L;if(f.current.type==="parallellines")if(f.current.firstLine){const cA={type:"parallellines",firstLine:f.current.series,secondLine:f.current.secondLine,firstLineData:f.current.firstLine};q(G=>[...G,cA]),u.current.push(cA),bA(null),f.current=null,d.current=!1,B.current=null,p.current=null;return}else{f.current.firstLine={startTime:L.time,startPrice:L.price,endTime:iA.time,endPrice:iA.price},d.current=!1,B.current=null,p.current=null;return}if(f.current.type==="fibonacci"){const G=(p.current||L).price;if(Math.abs(L.price-G)<1e-4){try{v.removeSeries(f.current.series)}catch{}d.current=!1,B.current=null,p.current=null,f.current=null;return}const y=Math.max(L.price,G),H=Math.min(L.price,G),N=y-H,U=[{level:0,label:"0.0%"},{level:.236,label:"23.6%"},{level:.382,label:"38.2%"},{level:.5,label:"50.0%"},{level:.618,label:"61.8%"},{level:.786,label:"78.6%"},{level:1,label:"100.0%"}],w=[],I=f.current.series;try{v.removeSeries(I)}catch{}U.forEach(({level:M,label:C})=>{const k=y-N*M,R=b.createPriceLine({price:k,color:M===0||M===1?"#f59e0b":"#fbbf24",lineWidth:M===0||M===1?2:1,lineStyle:M===0||M===1?0:2,axisLabelVisible:!0,title:`${C} (${k.toFixed(5)})`,textColor:M===0||M===1?"#f59e0b":"#fbbf24"});w.push(R)});const D={type:"fibonacci",priceLines:w,startPrice:L.price,endPrice:G,high:y,low:H};q(M=>[...M,D]),u.current.push(D),bA(null)}if(f.current.type==="rectangle"){const cA=B.current,G=p.current||cA,y=Math.max(cA.price,G.price),H=Math.min(cA.price,G.price),N=sA(Math.min(cA.time,G.time)),U=sA(Math.max(cA.time,G.time));if(N!=null&&U!=null&&Math.abs(U-N)>=1&&Math.abs(y-H)>=1e-5){const w=f.current.series;w.setData(ve([{time:N,value:y},{time:U,value:y}])),w.applyOptions({baseValue:{type:"price",price:H}});const I={type:"rectangle",timeStart:N,timeEnd:U,priceTop:y,priceBottom:H,series:w};q(D=>[...D,I]),u.current.push(I),bA(null)}else try{v.removeSeries(f.current.series)}catch{}}d.current=!1,B.current=null,p.current=null,f.current=null};if(T==="rectangle"||T==="fibonacci"||T==="parallellines"){const x={capture:!0,passive:!1},L=iA=>{d.current||iA.stopPropagation()};return _.addEventListener("mousedown",j,x),_.addEventListener("mousemove",rA,x),_.addEventListener("mousemove",L,x),_.addEventListener("mouseup",Z,x),()=>{_.removeEventListener("mousedown",j,x),_.removeEventListener("mousemove",rA,x),_.removeEventListener("mousemove",L,x),_.removeEventListener("mouseup",Z,x)}}},[UA,q,bA]),O.useEffect(()=>{const v=a.current,b=l.current,_=o.current,wA=UA===null||UA===1;if(!wA||!v||!b||!_){wA||(E(null),S([]),z(null),V([]));return}const T=10,j=8;function rA(y){if(!y)return[];if(y.type==="trendline"&&y.point1&&y.point2){const H=v.timeScale().timeToCoordinate(y.point1.time),N=b.priceToCoordinate(y.point1.price),U=v.timeScale().timeToCoordinate(y.point2.time),w=b.priceToCoordinate(y.point2.price);return H==null||N==null||U==null||w==null?[]:[{x:H,y:N},{x:U,y:w}]}if(y.type==="arrowedline"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),N=b.priceToCoordinate(y.p1.price),U=v.timeScale().timeToCoordinate(y.p2.rawTime),w=b.priceToCoordinate(y.p2.price);return H==null||N==null||U==null||w==null?[]:[{x:H,y:N},{x:U,y:w}]}if(y.type==="rayline"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),N=b.priceToCoordinate(y.p1.price),U=v.timeScale().timeToCoordinate(y.p2.rawTime),w=b.priceToCoordinate(y.p2.price);return H==null||N==null||U==null||w==null?[]:[{x:H,y:N},{x:U,y:w}]}if(y.type==="extendedline"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),N=b.priceToCoordinate(y.p1.price),U=v.timeScale().timeToCoordinate(y.p2.rawTime),w=b.priceToCoordinate(y.p2.price);return H==null||N==null||U==null||w==null?[]:[{x:H,y:N},{x:U,y:w}]}if(y.type==="crossline"&&y.p){const H=v.timeScale().timeToCoordinate(y.p.rawTime),N=b.priceToCoordinate(y.p.price);return H==null||N==null?[]:[{x:H,y:N}]}if(y.type==="trendbyangle"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),N=b.priceToCoordinate(y.p1.price),U=v.timeScale().timeToCoordinate(y.p2.rawTime),w=b.priceToCoordinate(y.p2.price);return H==null||N==null||U==null||w==null?[]:[{x:H,y:N},{x:U,y:w}]}if(y.type==="disjointchannel"&&y.p1&&y.p2&&y.p3&&y.p4){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),N=b.priceToCoordinate(y.p1.price),U=v.timeScale().timeToCoordinate(y.p2.rawTime),w=b.priceToCoordinate(y.p2.price),I=v.timeScale().timeToCoordinate(y.p3.rawTime),D=b.priceToCoordinate(y.p3.price),M=v.timeScale().timeToCoordinate(y.p4.rawTime),C=b.priceToCoordinate(y.p4.price);return H==null||N==null||U==null||w==null||I==null||D==null||M==null||C==null?[]:[{x:H,y:N},{x:U,y:w},{x:I,y:D},{x:M,y:C}]}if(y.type==="flattopbottom"&&y.p1&&y.p2&&y.p3&&y.p4){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),N=b.priceToCoordinate(y.p1.price),U=v.timeScale().timeToCoordinate(y.p2.rawTime),w=b.priceToCoordinate(y.p2.price),I=v.timeScale().timeToCoordinate(y.p3.rawTime),D=b.priceToCoordinate(y.p3.price),M=v.timeScale().timeToCoordinate(y.p4.rawTime),C=b.priceToCoordinate(y.p4.price);return H==null||N==null||U==null||w==null||I==null||D==null||M==null||C==null?[]:[{x:H,y:N},{x:U,y:w},{x:I,y:D},{x:M,y:C}]}if(y.type==="rulerline"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),N=b.priceToCoordinate(y.p1.price),U=v.timeScale().timeToCoordinate(y.p2.rawTime),w=b.priceToCoordinate(y.p2.price);return H==null||N==null||U==null||w==null?[]:[{x:H,y:N},{x:(H+U)/2,y:(N+w)/2},{x:U,y:w}]}return[]}function Z(y,H){for(let N=J.length-1;N>=0;N--){const U=J[N];if(U.type==="trendline"&&U.point1&&U.point2){const w=v.timeScale().timeToCoordinate(U.point1.time),I=b.priceToCoordinate(U.point1.price),D=v.timeScale().timeToCoordinate(U.point2.time),M=b.priceToCoordinate(U.point2.price);if(w==null||I==null||D==null||M==null)continue;const C=Math.hypot(y-w,H-I),k=Math.hypot(y-D,H-M);if(C<T)return{object:U,mode:"handle1"};if(k<T)return{object:U,mode:"handle2"};if(ze(y,H,w,I,D,M)<j)return{object:U,mode:"line"}}if(U.type==="arrowedline"&&U.p1&&U.p2){const w=v.timeScale().timeToCoordinate(U.p1.rawTime),I=b.priceToCoordinate(U.p1.price),D=v.timeScale().timeToCoordinate(U.p2.rawTime),M=b.priceToCoordinate(U.p2.price);if(w==null||I==null||D==null||M==null)continue;const C=Math.hypot(y-w,H-I),k=Math.hypot(y-D,H-M);if(C<T)return{object:U,mode:"handle1"};if(k<T)return{object:U,mode:"handle2"};if(ze(y,H,w,I,D,M)<j)return{object:U,mode:"line"}}if(U.type==="rayline"&&U.p1&&U.p2){const w=v.timeScale().timeToCoordinate(U.p1.rawTime),I=b.priceToCoordinate(U.p1.price),D=v.timeScale().timeToCoordinate(U.p2.rawTime),M=b.priceToCoordinate(U.p2.price);if(w==null||I==null||D==null||M==null)continue;const C=Math.hypot(y-w,H-I),k=Math.hypot(y-D,H-M);if(C<T)return{object:U,mode:"handle1"};if(k<T)return{object:U,mode:"handle2"};if(Yv(y,H,w,I,D,M)<j)return{object:U,mode:"line"}}if(U.type==="extendedline"&&U.p1&&U.p2){const w=v.timeScale().timeToCoordinate(U.p1.rawTime),I=b.priceToCoordinate(U.p1.price),D=v.timeScale().timeToCoordinate(U.p2.rawTime),M=b.priceToCoordinate(U.p2.price);if(w==null||I==null||D==null||M==null)continue;const C=Math.hypot(y-w,H-I),k=Math.hypot(y-D,H-M);if(C<T)return{object:U,mode:"handle1"};if(k<T)return{object:U,mode:"handle2"};if(qv(y,H,w,I,D,M)<j)return{object:U,mode:"line"}}if(U.type==="crossline"&&U.p){const w=v.timeScale().timeToCoordinate(U.p.rawTime),I=b.priceToCoordinate(U.p.price);if(w==null||I==null)continue;if(Math.hypot(y-w,H-I)<T)return{object:U,mode:"handle1"};const M=Math.abs(H-I),C=Math.abs(y-w);if(M<j||C<j)return{object:U,mode:"line"}}if(U.type==="trendbyangle"&&U.p1&&U.p2){const w=v.timeScale().timeToCoordinate(U.p1.rawTime),I=b.priceToCoordinate(U.p1.price),D=v.timeScale().timeToCoordinate(U.p2.rawTime),M=b.priceToCoordinate(U.p2.price);if(w==null||I==null||D==null||M==null)continue;const C=Math.hypot(y-w,H-I),k=Math.hypot(y-D,H-M);if(C<T)return{object:U,mode:"handle1"};if(k<T)return{object:U,mode:"handle2"};if(ze(y,H,w,I,D,M)<j)return{object:U,mode:"line"}}if(U.type==="disjointchannel"&&U.p1&&U.p2&&U.p3&&U.p4){const w=v.timeScale().timeToCoordinate(U.p1.rawTime),I=b.priceToCoordinate(U.p1.price),D=v.timeScale().timeToCoordinate(U.p2.rawTime),M=b.priceToCoordinate(U.p2.price),C=v.timeScale().timeToCoordinate(U.p3.rawTime),k=b.priceToCoordinate(U.p3.price),R=v.timeScale().timeToCoordinate(U.p4.rawTime),$=b.priceToCoordinate(U.p4.price);if(w==null||I==null||D==null||M==null||C==null||k==null||R==null||$==null)continue;const W=Math.hypot(y-w,H-I),tA=Math.hypot(y-D,H-M),nA=Math.hypot(y-C,H-k),QA=Math.hypot(y-R,H-$);if(W<T)return{object:U,mode:"handle1"};if(tA<T)return{object:U,mode:"handle2"};if(nA<T)return{object:U,mode:"handle3"};if(QA<T)return{object:U,mode:"handle4"};const _A=ze(y,H,w,I,C,k),VA=ze(y,H,D,M,R,$),Ae=ze(y,H,w,I,D,M),JA=ze(y,H,C,k,R,$);if(_A<j||VA<j||Ae<j||JA<j||zu(y,H,[{x:w,y:I},{x:C,y:k},{x:R,y:$},{x:D,y:M}]))return{object:U,mode:"line"}}if(U.type==="flattopbottom"&&U.p1&&U.p2&&U.p3&&U.p4){const w=v.timeScale().timeToCoordinate(U.p1.rawTime),I=b.priceToCoordinate(U.p1.price),D=v.timeScale().timeToCoordinate(U.p2.rawTime),M=b.priceToCoordinate(U.p2.price),C=v.timeScale().timeToCoordinate(U.p3.rawTime),k=b.priceToCoordinate(U.p3.price),R=v.timeScale().timeToCoordinate(U.p4.rawTime),$=b.priceToCoordinate(U.p4.price);if(w==null||I==null||D==null||M==null||C==null||k==null||R==null||$==null)continue;const W=Math.hypot(y-w,H-I),tA=Math.hypot(y-D,H-M),nA=Math.hypot(y-C,H-k),QA=Math.hypot(y-R,H-$);if(W<T)return{object:U,mode:"handle1"};if(tA<T)return{object:U,mode:"handle2"};if(nA<T)return{object:U,mode:"handle3"};if(QA<T)return{object:U,mode:"handle4"};const _A=ze(y,H,w,I,C,k),VA=ze(y,H,D,M,R,$),Ae=ze(y,H,w,I,D,M),JA=ze(y,H,C,k,R,$);if(_A<j||VA<j||Ae<j||JA<j||zu(y,H,[{x:w,y:I},{x:C,y:k},{x:R,y:$},{x:D,y:M}]))return{object:U,mode:"line"}}if(U.type==="rulerline"&&U.p1&&U.p2){const w=v.timeScale().timeToCoordinate(U.p1.rawTime),I=b.priceToCoordinate(U.p1.price),D=v.timeScale().timeToCoordinate(U.p2.rawTime),M=b.priceToCoordinate(U.p2.price);if(w==null||I==null||D==null||M==null)continue;const C=(w+D)/2,k=(I+M)/2,R=Math.hypot(y-w,H-I),$=Math.hypot(y-D,H-M),W=Math.hypot(y-C,H-k);if(R<T)return{object:U,mode:"handle1"};if($<T)return{object:U,mode:"handle2"};if(W<T)return{object:U,mode:"line"};if(ze(y,H,w,I,D,M)<j)return{object:U,mode:"line"}}}return null}const x=y=>{const H=_.getBoundingClientRect(),N=y.clientX-H.left,U=y.clientY-H.top,w=Z(N,U);w?(y.preventDefault(),y.stopPropagation(),E(w.object),z(null),V([]),Y.current=w.mode,w.object.type==="rayline"&&(w.mode==="handle1"||w.mode==="handle2")&&(X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2}}),w.object.type==="extendedline"&&(w.mode==="handle1"||w.mode==="handle2")&&(X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2}}),w.object.type==="crossline"&&(w.mode==="handle1"||w.mode==="line")&&(X.current={x:N,y:U,p:{...w.object.p}}),w.object.type==="trendbyangle"&&(w.mode==="handle1"||w.mode==="handle2")&&(X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2}}),w.object.type==="disjointchannel"&&(w.mode==="handle1"||w.mode==="handle2"||w.mode==="handle3"||w.mode==="handle4")&&(X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2},p3:{...w.object.p3},p4:{...w.object.p4}}),w.object.type==="flattopbottom"&&(w.mode==="handle1"||w.mode==="handle2"||w.mode==="handle3"||w.mode==="handle4")&&(X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2},p3:{...w.object.p3},p4:{...w.object.p4}}),w.mode==="line"&&(w.object.type==="rulerline"?X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2}}:w.object.type==="arrowedline"?X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2}}:w.object.type==="rayline"?X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2}}:w.object.type==="extendedline"?X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2}}:w.object.type==="crossline"?X.current={x:N,y:U,p:{...w.object.p}}:w.object.type==="trendbyangle"?X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2}}:w.object.type==="disjointchannel"?X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2},p3:{...w.object.p3},p4:{...w.object.p4}}:w.object.type==="flattopbottom"?X.current={x:N,y:U,p1:{...w.object.p1},p2:{...w.object.p2},p3:{...w.object.p3},p4:{...w.object.p4}}:X.current={x:N,y:U,point1:{...w.object.point1},point2:{...w.object.point2}})):(E(null),Y.current=null,S([]),z(null),V([]))},L=y=>{const H=_.getBoundingClientRect(),N=y.clientX-H.left,U=y.clientY-H.top;if(!Y.current){const M=Z(N,U);if(M?.object&&!fA.current){const C=rA(M.object);z(k=>k===M.object?k:M.object),V(k=>k.length===C.length&&k.every((R,$)=>R.x===C[$].x&&R.y===C[$].y)?k:C)}else z(C=>C==null?C:null),V(C=>C.length===0?C:[]);return}const w=fA.current;if(!w)return;let I=v.timeScale().coordinateToTime(N);const D=b.coordinateToPrice(U);if(!(I==null||D==null)&&(I=sA(I),I!=null)){if(w.type==="rulerline"&&w.p1&&w.p2){const M=(C,k)=>{const R=C.normalizedTime??C.rawTime,$=k.normalizedTime??k.rawTime,W=k.price-C.price,tA=W/Math.abs(C.price)*100,nA=Ot(EA)||3600,QA=Math.abs($-R),_A=Math.max(1,Math.round(QA/nA)),VA=Math.max(1,Math.round(QA/86400)),Ae={priceDiff:W,pricePct:tA,bars:_A,days:VA},JA=w.primitive;if(JA){JA.p1={rawTime:C.rawTime,price:C.price},JA.p2={rawTime:k.rawTime,price:k.price},JA.info=Ae;const De=k.price>=C.price;JA.color=De?"#3b82f6":"#ef5350",JA.fillColor=De?"rgba(59,130,246,0.1)":"rgba(239,83,80,0.1)";try{a.current?.applyOptions({})}catch{}}const he={...w,p1:C,p2:k};q(De=>{const jo=De.map(Zu=>Zu===w?he:Zu);return u.current=jo,jo}),E(he),fA.current=he};if(Y.current==="handle1"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;M({rawTime:C,normalizedTime:I,price:D},w.p2)}else if(Y.current==="handle2"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;M(w.p1,{rawTime:C,normalizedTime:I,price:D})}else if(Y.current==="line"){const C=X.current;if(!C)return;const k=v.timeScale().coordinateToTime(C.x),R=b.coordinateToPrice(C.y);if(k==null||R==null)return;const $=I-sA(k),W=D-R,tA=sA(C.p1.normalizedTime+$),nA=sA(C.p2.normalizedTime+$);if(tA==null||nA==null)return;const QA=(v.timeScale().coordinateToTime(N)??C.p1.rawTime)-C.p1.rawTime;M({rawTime:C.p1.rawTime+QA,normalizedTime:tA,price:C.p1.price+W},{rawTime:C.p2.rawTime+QA,normalizedTime:nA,price:C.p2.price+W})}return}if(w.type==="arrowedline"&&w.p1&&w.p2){const M=(C,k)=>{const R=w.primitive;if(R){R.p1={rawTime:C.rawTime,price:C.price},R.p2={rawTime:k.rawTime,price:k.price};try{a.current?.applyOptions({})}catch{}}const $={...w,p1:C,p2:k};q(W=>{const tA=W.map(nA=>nA===w?$:nA);return u.current=tA,tA}),E($),fA.current=$};if(Y.current==="handle1"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;M({rawTime:C,normalizedTime:I,price:D},w.p2)}else if(Y.current==="handle2"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;M(w.p1,{rawTime:C,normalizedTime:I,price:D})}else if(Y.current==="line"){const C=X.current;if(!C)return;const k=v.timeScale().coordinateToTime(C.x),R=b.coordinateToPrice(C.y);if(k==null||R==null)return;const $=I-sA(k),W=D-R,tA=sA(C.p1.normalizedTime+$),nA=sA(C.p2.normalizedTime+$);if(tA==null||nA==null)return;const QA=(v.timeScale().coordinateToTime(N)??C.p1.rawTime)-C.p1.rawTime;M({rawTime:C.p1.rawTime+QA,normalizedTime:tA,price:C.p1.price+W},{rawTime:C.p2.rawTime+QA,normalizedTime:nA,price:C.p2.price+W})}return}if(w.type==="rayline"&&w.p1&&w.p2){const M=(C,k)=>{const R=w.primitive;if(R){R.p1={rawTime:C.rawTime,price:C.price},R.p2={rawTime:k.rawTime,price:k.price};try{a.current?.applyOptions({})}catch{}}const $={...w,p1:C,p2:k};q(W=>{const tA=W.map(nA=>nA===w?$:nA);return u.current=tA,tA}),E($),fA.current=$};if(Y.current==="handle1"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;M({rawTime:C,normalizedTime:I,price:D},w.p2)}else if(Y.current==="handle2"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;const k=sA(C);if(k==null)return;M(w.p1,{rawTime:C,normalizedTime:k,price:D})}else if(Y.current==="line"){const C=X.current;if(!C)return;const k=v.timeScale().coordinateToTime(C.x),R=b.coordinateToPrice(C.y);if(k==null||R==null)return;const $=I-sA(k),W=D-R,tA=sA(C.p1.normalizedTime+$),nA=sA(C.p2.normalizedTime+$);if(tA==null||nA==null)return;const QA=(v.timeScale().coordinateToTime(N)??C.p1.rawTime)-C.p1.rawTime;M({rawTime:C.p1.rawTime+QA,normalizedTime:tA,price:C.p1.price+W},{rawTime:C.p2.rawTime+QA,normalizedTime:nA,price:C.p2.price+W})}return}if(w.type==="extendedline"&&w.p1&&w.p2){const M=(C,k)=>{const R=w.primitive;if(R){R.p1={rawTime:C.rawTime,price:C.price},R.p2={rawTime:k.rawTime,price:k.price};try{a.current?.applyOptions({})}catch{}}const $={...w,p1:C,p2:k};q(W=>{const tA=W.map(nA=>nA===w?$:nA);return u.current=tA,tA}),E($),fA.current=$};if(Y.current==="handle1"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;M({rawTime:C,normalizedTime:I,price:D},w.p2)}else if(Y.current==="handle2"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;M(w.p1,{rawTime:C,normalizedTime:I,price:D})}else if(Y.current==="line"){const C=X.current;if(!C)return;const k=v.timeScale().coordinateToTime(C.x),R=b.coordinateToPrice(C.y);if(k==null||R==null)return;const $=I-sA(k),W=D-R,tA=sA(C.p1.normalizedTime+$),nA=sA(C.p2.normalizedTime+$);if(tA==null||nA==null)return;const QA=(v.timeScale().coordinateToTime(N)??C.p1.rawTime)-C.p1.rawTime;M({rawTime:C.p1.rawTime+QA,normalizedTime:tA,price:C.p1.price+W},{rawTime:C.p2.rawTime+QA,normalizedTime:nA,price:C.p2.price+W})}return}if(w.type==="crossline"&&w.p){const M=k=>{const R=w.primitive;if(R){R.center={rawTime:k.rawTime,price:k.price};try{a.current?.applyOptions({})}catch{}}const $={...w,p:k};q(W=>{const tA=W.map(nA=>nA===w?$:nA);return u.current=tA,tA}),E($),fA.current=$},C=v.timeScale().coordinateToTime(N);if(C==null)return;M({rawTime:C,normalizedTime:I,price:D});return}if(w.type==="trendbyangle"&&w.p1&&w.p2){const M=(C,k)=>{const R=w.primitive;if(R){R.p1={rawTime:C.rawTime,price:C.price},R.p2={rawTime:k.rawTime,price:k.price};try{a.current?.applyOptions({})}catch{}}const $={...w,p1:C,p2:k};q(W=>{const tA=W.map(nA=>nA===w?$:nA);return u.current=tA,tA}),E($),fA.current=$};if(Y.current==="handle1"){const C=v.timeScale().coordinateToTime(N);if(C==null)return;M({rawTime:C,normalizedTime:I,price:D},w.p2)}else if(Y.current==="handle2"||Y.current==="line"){const C=X.current;if(!C)return;const k=v.timeScale().coordinateToTime(C.x),R=b.coordinateToPrice(C.y);if(k==null||R==null)return;const $=I-sA(k),W=D-R,tA=sA(C.p1.normalizedTime+$),nA=sA(C.p2.normalizedTime+$);if(tA==null||nA==null)return;const QA=(v.timeScale().coordinateToTime(N)??C.p1.rawTime)-C.p1.rawTime;M({rawTime:C.p1.rawTime+QA,normalizedTime:tA,price:C.p1.price+W},{rawTime:C.p2.rawTime+QA,normalizedTime:nA,price:C.p2.price+W})}return}if(w.type==="disjointchannel"&&w.p1&&w.p2&&w.p3&&w.p4){const M=(W,tA,nA,QA)=>{const _A=w.primitive;if(_A){_A.p1={rawTime:W.rawTime,price:W.price},_A.p2={rawTime:tA.rawTime,price:tA.price},_A.p3={rawTime:nA.rawTime,price:nA.price},_A.p4={rawTime:QA.rawTime,price:QA.price};try{a.current?.applyOptions({})}catch{}}const VA={...w,p1:W,p2:tA,p3:nA,p4:QA};q(Ae=>{const JA=Ae.map(he=>he===w?VA:he);return u.current=JA,JA}),E(VA),fA.current=VA},C=X.current;if(!C)return;const k=v.timeScale().coordinateToTime(N);if(k==null)return;const R=sA(k);if(R==null)return;const $=(W,tA,nA,QA)=>{const _A=W.normalizedTime??sA(W.rawTime);if(_A==null)return null;const VA=sA(_A+nA);return VA==null?null:{rawTime:W.rawTime+tA,normalizedTime:VA,price:W.price+QA}};if(Y.current==="line"){const W=v.timeScale().coordinateToTime(C.x),tA=b.coordinateToPrice(C.y);if(W==null||tA==null)return;const nA=sA(W);if(nA==null)return;const QA=k-W,_A=R-nA,VA=D-tA,Ae=$(C.p1,QA,_A,VA),JA=$(C.p2,QA,_A,VA),he=$(C.p3,QA,_A,VA),De=$(C.p4,QA,_A,VA);if(!Ae||!JA||!he||!De)return;M(Ae,JA,he,De);return}if(Y.current==="handle1"){const W=(C.p1.price+C.p2.price)/2,tA={rawTime:k,normalizedTime:R,price:D},nA={rawTime:k,normalizedTime:R,price:2*W-D};M(tA,nA,C.p3,C.p4);return}if(Y.current==="handle3"){const W=(C.p3.price+C.p4.price)/2,tA={rawTime:k,normalizedTime:R,price:D},nA={rawTime:k,normalizedTime:R,price:2*W-D};M(C.p1,C.p2,tA,nA);return}if(Y.current==="handle2"){const W=(C.p1.price+C.p2.price)/2,tA={rawTime:C.p1.rawTime,normalizedTime:C.p1.normalizedTime??sA(C.p1.rawTime),price:D};if(tA.normalizedTime==null)return;const nA={rawTime:C.p1.rawTime,normalizedTime:C.p1.normalizedTime??sA(C.p1.rawTime),price:2*W-D};if(nA.normalizedTime==null)return;M(nA,tA,C.p3,C.p4);return}if(Y.current==="handle4"){const W=D-C.p4.price,tA={rawTime:C.p3.rawTime,normalizedTime:C.p3.normalizedTime??sA(C.p3.rawTime),price:C.p4.price+W};if(tA.normalizedTime==null)return;const nA={rawTime:C.p1.rawTime,normalizedTime:C.p1.normalizedTime??sA(C.p1.rawTime),price:C.p2.price+W};if(nA.normalizedTime==null)return;M(C.p1,nA,C.p3,tA);return}}if(w.type==="flattopbottom"&&w.p1&&w.p2&&w.p3&&w.p4){const M=(W,tA,nA,QA)=>{const _A=w.primitive;if(_A){_A.p1={rawTime:W.rawTime,price:W.price},_A.p2={rawTime:tA.rawTime,price:tA.price},_A.p3={rawTime:nA.rawTime,price:nA.price},_A.p4={rawTime:QA.rawTime,price:QA.price};try{a.current?.applyOptions({})}catch{}}const VA={...w,p1:W,p2:tA,p3:nA,p4:QA};q(Ae=>{const JA=Ae.map(he=>he===w?VA:he);return u.current=JA,JA}),E(VA),fA.current=VA},C=X.current;if(!C)return;const k=v.timeScale().coordinateToTime(N);if(k==null)return;const R=sA(k);if(R==null)return;const $=(W,tA,nA,QA)=>{const _A=W.normalizedTime??sA(W.rawTime);if(_A==null)return null;const VA=sA(_A+nA);return VA==null?null:{rawTime:W.rawTime+tA,normalizedTime:VA,price:W.price+QA}};if(Y.current==="line"){const W=v.timeScale().coordinateToTime(C.x),tA=b.coordinateToPrice(C.y);if(W==null||tA==null)return;const nA=sA(W);if(nA==null)return;const QA=k-W,_A=R-nA,VA=D-tA,Ae=$(C.p1,QA,_A,VA),JA=$(C.p2,QA,_A,VA),he=$(C.p3,QA,_A,VA),De=$(C.p4,QA,_A,VA);if(!Ae||!JA||!he||!De)return;M(Ae,JA,he,De);return}if(Y.current==="handle1"){const W={rawTime:k,normalizedTime:R,price:D},tA={rawTime:k,normalizedTime:R,price:C.p2.price};M(W,tA,C.p3,C.p4);return}if(Y.current==="handle3"){const W={rawTime:k,normalizedTime:R,price:D},tA={rawTime:k,normalizedTime:R,price:C.p4.price};M(C.p1,C.p2,W,tA);return}if(Y.current==="handle2"||Y.current==="handle4"){const W=Y.current==="handle2"?C.p2:C.p4,tA=D-W.price,nA={rawTime:C.p1.rawTime,normalizedTime:C.p1.normalizedTime??sA(C.p1.rawTime),price:C.p2.price+tA},QA={rawTime:C.p3.rawTime,normalizedTime:C.p3.normalizedTime??sA(C.p3.rawTime),price:C.p4.price+tA};if(nA.normalizedTime==null||QA.normalizedTime==null)return;M(C.p1,nA,C.p3,QA);return}}if(!(!w.point1||!w.point2)){if(Y.current==="handle1"){const M={time:I,price:D},C=ve([{time:M.time,value:M.price},{time:w.point2.time,value:w.point2.price}]);C.length>0&&w.series.setData(C);const k={...w,point1:M};q(R=>{const $=R.map(W=>W===w?k:W);return u.current=$,$}),E(k),fA.current=k}else if(Y.current==="handle2"){const M={time:I,price:D},C=ve([{time:w.point1.time,value:w.point1.price},{time:M.time,value:M.price}]);C.length>0&&w.series.setData(C);const k={...w,point2:M};q(R=>{const $=R.map(W=>W===w?k:W);return u.current=$,$}),E(k),fA.current=k}else if(Y.current==="line"){const M=X.current;if(!M)return;const C=v.timeScale().coordinateToTime(M.x),k=b.coordinateToPrice(M.y);if(C==null||k==null)return;const R=I-C,$=D-k,W={time:sA(M.point1.time+R),price:M.point1.price+$},tA={time:sA(M.point2.time+R),price:M.point2.price+$},nA=ve([{time:W.time,value:W.price},{time:tA.time,value:tA.price}]);nA.length>0&&w.series.setData(nA);const QA={...w,point1:W,point2:tA};q(_A=>{const VA=_A.map(Ae=>Ae===w?QA:Ae);return u.current=VA,VA}),E(QA),fA.current=QA}}}},iA=()=>{Y.current=null,X.current=null},cA=()=>{Y.current||fA.current||(z(null),V([]))},G={capture:!0,passive:!1};return _.addEventListener("mousedown",x,G),_.addEventListener("mousemove",L,G),_.addEventListener("mouseup",iA,G),_.addEventListener("mouseleave",cA,G),()=>{_.removeEventListener("mousedown",x,G),_.removeEventListener("mousemove",L,G),_.removeEventListener("mouseup",iA,G),_.removeEventListener("mouseleave",cA,G)}},[UA,J,q]),O.useEffect(()=>{const v=a.current,b=l.current;if(!v||!b)return;const _=()=>{const T=m;if(!T){S([]);return}const j=v.timeScale();if(T.type==="rulerline"&&T.p1&&T.p2){const rA=j.timeToCoordinate(T.p1.rawTime),Z=b.priceToCoordinate(T.p1.price),x=j.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);rA!=null&&Z!=null&&x!=null&&L!=null?S([{x:rA,y:Z},{x:(rA+x)/2,y:(Z+L)/2},{x,y:L}]):S([]);return}if(T.type==="arrowedline"&&T.p1&&T.p2){const rA=j.timeToCoordinate(T.p1.rawTime),Z=b.priceToCoordinate(T.p1.price),x=j.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);rA!=null&&Z!=null&&x!=null&&L!=null?S([{x:rA,y:Z},{x,y:L}]):S([]);return}if(T.type==="rayline"&&T.p1&&T.p2){const rA=j.timeToCoordinate(T.p1.rawTime),Z=b.priceToCoordinate(T.p1.price),x=j.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);rA!=null&&Z!=null&&x!=null&&L!=null?S([{x:rA,y:Z},{x,y:L}]):S([]);return}if(T.type==="extendedline"&&T.p1&&T.p2){const rA=j.timeToCoordinate(T.p1.rawTime),Z=b.priceToCoordinate(T.p1.price),x=j.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);rA!=null&&Z!=null&&x!=null&&L!=null?S([{x:rA,y:Z},{x,y:L}]):S([]);return}if(T.type==="crossline"&&T.p){const rA=j.timeToCoordinate(T.p.rawTime),Z=b.priceToCoordinate(T.p.price);rA!=null&&Z!=null?S([{x:rA,y:Z}]):S([]);return}if(T.type==="trendbyangle"&&T.p1&&T.p2){const rA=j.timeToCoordinate(T.p1.rawTime),Z=b.priceToCoordinate(T.p1.price),x=j.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);rA!=null&&Z!=null&&x!=null&&L!=null?S([{x:rA,y:Z},{x,y:L}]):S([]);return}if(T.type==="disjointchannel"&&T.p1&&T.p2&&T.p3&&T.p4){const rA=j.timeToCoordinate(T.p1.rawTime),Z=b.priceToCoordinate(T.p1.price),x=j.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price),iA=j.timeToCoordinate(T.p3.rawTime),cA=b.priceToCoordinate(T.p3.price),G=j.timeToCoordinate(T.p4.rawTime),y=b.priceToCoordinate(T.p4.price);rA!=null&&Z!=null&&x!=null&&L!=null&&iA!=null&&cA!=null&&G!=null&&y!=null?S([{x:rA,y:Z},{x,y:L},{x:iA,y:cA},{x:G,y}]):S([]);return}if(T.type==="flattopbottom"&&T.p1&&T.p2&&T.p3&&T.p4){const rA=j.timeToCoordinate(T.p1.rawTime),Z=b.priceToCoordinate(T.p1.price),x=j.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price),iA=j.timeToCoordinate(T.p3.rawTime),cA=b.priceToCoordinate(T.p3.price),G=j.timeToCoordinate(T.p4.rawTime),y=b.priceToCoordinate(T.p4.price);rA!=null&&Z!=null&&x!=null&&L!=null&&iA!=null&&cA!=null&&G!=null&&y!=null?S([{x:rA,y:Z},{x,y:L},{x:iA,y:cA},{x:G,y}]):S([]);return}if(T.type==="trendline"&&T.point1&&T.point2){const rA=j.timeToCoordinate(T.point1.time),Z=b.priceToCoordinate(T.point1.price),x=j.timeToCoordinate(T.point2.time),L=b.priceToCoordinate(T.point2.price);rA!=null&&Z!=null&&x!=null&&L!=null?S([{x:rA,y:Z},{x,y:L}]):S([]);return}S([])};_();const wA=v.timeScale();return wA.subscribeVisibleTimeRangeChange(_),()=>{wA.unsubscribeVisibleTimeRangeChange(_)}},[m]),O.useEffect(()=>{!a.current||!l.current||u.current.forEach(v=>{if(v.series&&v.series.applyOptions({visible:WA}),v.priceLine&&v.priceLine.applyOptions(WA?{color:"#3b82f6",axisLabelVisible:!0,title:typeof v.price=="number"?v.price.toFixed(5):""}:{color:"rgba(0,0,0,0)",axisLabelVisible:!1,title:""}),v.type==="fibonacci"&&v.priceLines&&v.priceLines.forEach(b=>{try{b.applyOptions({lineVisible:WA,axisLabelVisible:WA})}catch{}}),v.type==="rectangle"&&v.series&&v.series.applyOptions({visible:WA}),v.type==="parallellines"&&(v.baseLine&&v.baseLine.applyOptions({visible:WA}),v.parallelLine&&v.parallelLine.applyOptions({visible:WA}),v.firstLine&&v.firstLine.applyOptions({visible:WA}),v.secondLine&&v.secondLine.applyOptions({visible:WA})),(v.type==="horizontalray"||v.type==="verticalline"||v.type==="infoline"||v.type==="rulerline"||v.type==="arrowedline"||v.type==="rayline"||v.type==="extendedline"||v.type==="crossline"||v.type==="trendbyangle"||v.type==="disjointchannel"||v.type==="flattopbottom")&&v.primitive){v.primitive.visible=WA;try{a.current?.applyOptions({})}catch{}}})},[WA,J]),O.useEffect(()=>{!WA&&m&&(E(null),S([]))},[WA,m]),O.useEffect(()=>{if(u.current.length>J.length){const v=u.current.filter((b,_)=>!J.includes(b));m&&v.some(b=>b===m)&&(E(null),S([])),v.forEach(b=>{if(b.series&&a.current?.removeSeries(b.series),b.priceLine&&l.current?.removePriceLine(b.priceLine),b.type==="horizontalray"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="verticalline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="infoline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="rulerline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="arrowedline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="rayline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="extendedline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="crossline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="trendbyangle"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="disjointchannel"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="flattopbottom"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="fibonacci"&&b.priceLines&&b.priceLines.forEach(_=>{try{l.current?.removePriceLine(_)}catch{}}),b.type==="rectangle"&&b.series)try{a.current?.removeSeries(b.series)}catch{}if(b.type==="parallellines")try{b.baseLine&&a.current?.removeSeries(b.baseLine),b.parallelLine&&a.current?.removeSeries(b.parallelLine),b.firstLine&&a.current?.removeSeries(b.firstLine),b.secondLine&&a.current?.removeSeries(b.secondLine)}catch{}}),u.current=J}},[J,m]),O.useEffect(()=>{const v=l.current;return v?(uA.current.forEach(_=>{try{v.removePriceLine(_)}catch{}}),uA.current=[],yA.filter(_=>_.symbol===BA).forEach(_=>{const wA=parseFloat(_.price);if(isNaN(wA))return;const j=_.type==="BUY"?"#26A69A":"#EF5350",rA=v.createPriceLine({price:wA,color:j,lineWidth:2,lineStyle:0,axisLabelVisible:!0,title:`${_.type} ${_.volume} @ ${_.price}`,textColor:j});uA.current.push(rA)}),()=>{uA.current.forEach(_=>{try{v.removePriceLine(_)}catch{}}),uA.current=[]}):void 0},[yA,BA]);const xA=m??P,jA=m?F:eA;return h.jsx("div",{className:`flex-1 flex flex-col min-w-0 overflow-hidden ${ae==="light"?"bg-white":"bg-[#12161d]"}`,children:h.jsxs("div",{ref:o,className:"flex-1 w-full h-full relative",style:{cursor:UA===1||UA!==null?"crosshair":"default",minHeight:0,minWidth:0},onDoubleClick:v=>{a.current&&!d.current&&(v.preventDefault(),v.stopPropagation(),a.current.timeScale().fitContent(),SA(a.current.timeScale().getVisibleRange()))},children:[t&&h.jsx("div",{className:"absolute top-3 left-3 z-50",children:h.jsx(Ec,{bidPrice:A,askPrice:e,onBuyClick:ii,onSellClick:Le})}),h.jsx(xc,{isOpen:mA,onClose:ne,orderType:lA,bidPrice:A,askPrice:e}),WA&&(xA?.type==="trendline"&&xA?.point1&&xA?.point2&&jA.length===2||xA?.type==="arrowedline"&&xA?.p1&&xA?.p2&&jA.length===2||xA?.type==="rayline"&&xA?.p1&&xA?.p2&&jA.length===2||xA?.type==="extendedline"&&xA?.p1&&xA?.p2&&jA.length===2||xA?.type==="crossline"&&xA?.p&&jA.length===1||xA?.type==="trendbyangle"&&xA?.p1&&xA?.p2&&jA.length===2||xA?.type==="disjointchannel"&&xA?.p1&&xA?.p2&&xA?.p3&&xA?.p4&&jA.length===4||xA?.type==="flattopbottom"&&xA?.p1&&xA?.p2&&xA?.p3&&xA?.p4&&jA.length===4||xA?.type==="rulerline"&&xA?.p1&&xA?.p2&&jA.length===3)&&h.jsx("div",{className:"absolute inset-0 z-20 pointer-events-none","aria-hidden":!0,children:jA.map((v,b)=>h.jsx("div",{className:"absolute w-[10px] h-[10px] rounded-full border-2 border-white shadow",style:{left:v.x-5,top:v.y-5,backgroundColor:xA?.type==="rulerline"?"#3b82f6":xA?.type==="arrowedline"?"#f59e0b":xA?.type==="rayline"||xA?.type==="extendedline"||xA?.type==="crossline"||xA?.type==="trendbyangle"?"#7aa6ae":xA?.type==="disjointchannel"?"#16a34a":xA?.type==="flattopbottom"?"#3b82f6":"#22c55e"}},b))})]})})}),YA={container:{position:"relative",display:"inline-block",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},button:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",color:"#e2e8f0",fontSize:"13px",fontWeight:600,cursor:"pointer",minWidth:"120px",justifyContent:"space-between",transition:"all 0.15s ease"},buttonHover:{borderColor:"#3b82f6",backgroundColor:"#1e3a5f"},arrow:{fontSize:"10px",color:"#94a3b8",transition:"transform 0.2s ease"},arrowOpen:{transform:"rotate(180deg)"},dropdown:{position:"absolute",top:"100%",left:0,marginTop:"4px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:1e3,minWidth:"220px",maxHeight:"320px",overflow:"hidden",display:"flex",flexDirection:"column"},searchContainer:{padding:"8px",borderBottom:"1px solid #334155"},searchInput:{width:"100%",padding:"6px 10px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"12px",outline:"none",boxSizing:"border-box"},list:{overflowY:"auto",maxHeight:"260px",padding:"4px 0"},item:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer",fontSize:"13px",color:"#cbd5e1",transition:"background-color 0.1s ease"},itemSelected:{backgroundColor:"#1e3a5f",color:"#60a5fa"},symbolName:{fontWeight:600},symbolPrice:{fontSize:"11px",color:"#94a3b8"},priceUp:{color:"#26A69A"},priceDown:{color:"#EF5350"},categoryLabel:{padding:"6px 12px 4px",fontSize:"10px",fontWeight:700,color:"#64748b",textTransform:"uppercase",letterSpacing:"0.05em"},empty:{padding:"16px",textAlign:"center",color:"#64748b",fontSize:"12px"}};function Gu({style:r,className:A}){const{selectedSymbol:e,setSelectedSymbol:t,symbols:i,symbolsLoading:s}=Be(),[n,o]=O.useState(!1),[a,l]=O.useState(""),[c,u]=O.useState(-1),d=O.useRef(null),B=O.useRef(null);O.useEffect(()=>{const m=E=>{d.current&&!d.current.contains(E.target)&&(o(!1),l(""))};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]),O.useEffect(()=>{n&&B.current&&B.current.focus()},[n]);const p=i.filter(m=>m.symbol.toLowerCase().includes(a.toLowerCase())),f=p.filter(m=>!m.symbol.endsWith("USDT")),g=p.filter(m=>m.symbol.endsWith("USDT")),Q=m=>{t(m),o(!1),l("")};return i.find(m=>m.symbol===e),h.jsxs("div",{ref:d,style:{...YA.container,...r},className:A,children:[h.jsxs("button",{style:YA.button,onClick:()=>o(!n),onMouseEnter:m=>Object.assign(m.currentTarget.style,YA.buttonHover),onMouseLeave:m=>{m.currentTarget.style.borderColor="#334155",m.currentTarget.style.backgroundColor="#1e293b"},children:[h.jsx("span",{children:s?"Loading...":e||"Select Coin"}),h.jsx("span",{style:{...YA.arrow,...n?YA.arrowOpen:{}},children:"▼"})]}),n&&h.jsxs("div",{style:YA.dropdown,children:[h.jsx("div",{style:YA.searchContainer,children:h.jsx("input",{ref:B,style:YA.searchInput,type:"text",placeholder:"Search symbol...",value:a,onChange:m=>l(m.target.value)})}),h.jsx("div",{style:YA.list,children:p.length===0?h.jsx("div",{style:YA.empty,children:"No symbols found"}):h.jsxs(h.Fragment,{children:[f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:YA.categoryLabel,children:"Forex & Metals"}),f.map(m=>h.jsxs("div",{style:{...YA.item,...m.symbol===e?YA.itemSelected:{}},onClick:()=>Q(m.symbol),onMouseEnter:E=>{m.symbol!==e&&(E.currentTarget.style.backgroundColor="#334155")},onMouseLeave:E=>{m.symbol!==e&&(E.currentTarget.style.backgroundColor="transparent")},children:[h.jsx("span",{style:YA.symbolName,children:m.symbol}),m.bid&&h.jsx("span",{style:{...YA.symbolPrice,...parseFloat(m.change)>=0?YA.priceUp:YA.priceDown},children:parseFloat(m.bid).toFixed(5)})]},m.symbol))]}),g.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:YA.categoryLabel,children:"Crypto"}),g.map(m=>h.jsxs("div",{style:{...YA.item,...m.symbol===e?YA.itemSelected:{}},onClick:()=>Q(m.symbol),onMouseEnter:E=>{m.symbol!==e&&(E.currentTarget.style.backgroundColor="#334155")},onMouseLeave:E=>{m.symbol!==e&&(E.currentTarget.style.backgroundColor="transparent")},children:[h.jsx("span",{style:YA.symbolName,children:m.symbol}),m.bid&&h.jsx("span",{style:{...YA.symbolPrice,...parseFloat(m.change)>=0?YA.priceUp:YA.priceDown},children:parseFloat(m.bid).toFixed(2)})]},m.symbol))]})]})})]})]})}const st={container:{display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},label:{fontSize:"11px",color:"#94a3b8",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",marginRight:"4px",whiteSpace:"nowrap"},btn:{display:"flex",alignItems:"center",justifyContent:"center",width:"26px",height:"26px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"14px",fontWeight:700,cursor:"pointer",transition:"all 0.15s ease",padding:0,lineHeight:1,userSelect:"none"},btnHover:{borderColor:"#3b82f6",backgroundColor:"#1e3a5f"},input:{width:"70px",padding:"4px 6px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"13px",fontWeight:600,textAlign:"center",outline:"none",boxSizing:"border-box"},presets:{display:"inline-flex",gap:"2px",marginLeft:"4px"},preset:{padding:"3px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"11px",cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap"},presetActive:{backgroundColor:"#1e3a5f",borderColor:"#3b82f6",color:"#60a5fa"}},Ab=[.01,.05,.1,.5,1];function Ru({value:r,onChange:A,min:e=.01,max:t=100,step:i=.01,presets:s=Ab,showPresets:n=!0,showLabel:o=!0,label:a="Vol",style:l,className:c}){const[u,d]=O.useState(.1),B=r!==void 0?r:u,p=O.useCallback(m=>{const E=Math.max(e,Math.min(t,parseFloat(m)||e)),F=Math.round(E/i)*i,S=parseFloat(F.toFixed(8));r!==void 0||d(S),A?.(S)},[e,t,i,r,A]),f=()=>p(B+i),g=()=>p(B-i),Q=(B>=1,B.toFixed(2));return h.jsxs("div",{style:{...st.container,...l},className:c,children:[o&&h.jsx("span",{style:st.label,children:a}),h.jsx("button",{style:st.btn,onClick:g,onMouseEnter:m=>Object.assign(m.currentTarget.style,st.btnHover),onMouseLeave:m=>{m.currentTarget.style.borderColor="#334155",m.currentTarget.style.backgroundColor="#1e293b"},children:"−"}),h.jsx("input",{style:st.input,type:"text",value:Q,onChange:m=>{const E=m.target.value;if(E===""||E==="."||E==="0.")return;const F=parseFloat(E);isNaN(F)||p(F)},onBlur:()=>p(B)}),h.jsx("button",{style:st.btn,onClick:f,onMouseEnter:m=>Object.assign(m.currentTarget.style,st.btnHover),onMouseLeave:m=>{m.currentTarget.style.borderColor="#334155",m.currentTarget.style.backgroundColor="#1e293b"},children:"+"}),n&&s&&s.length>0&&h.jsx("div",{style:st.presets,children:s.map(m=>h.jsx("button",{style:{...st.preset,...Math.abs(B-m)<1e-4?st.presetActive:{}},onClick:()=>p(m),onMouseEnter:E=>{Math.abs(B-m)>=1e-4&&Object.assign(E.currentTarget.style,{borderColor:"#3b82f6"})},onMouseLeave:E=>{Math.abs(B-m)>=1e-4&&(E.currentTarget.style.borderColor="#334155")},children:m},m))})]})}const Se={container:{display:"inline-flex",alignItems:"center",gap:"6px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},label:{fontSize:"11px",fontWeight:700,color:"#EF5350",textTransform:"uppercase",letterSpacing:"0.03em",whiteSpace:"nowrap"},toggle:{position:"relative",width:"32px",height:"18px",borderRadius:"9px",cursor:"pointer",transition:"background-color 0.2s ease",border:"none",padding:0},toggleOff:{backgroundColor:"#334155"},toggleOn:{backgroundColor:"#EF5350"},toggleKnob:{position:"absolute",top:"2px",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#fff",transition:"left 0.2s ease"},knobOff:{left:"2px"},knobOn:{left:"16px"},inputGroup:{display:"inline-flex",alignItems:"center",gap:"4px"},input:{width:"90px",padding:"4px 8px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"13px",fontWeight:600,textAlign:"right",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s ease"},modeBtn:{padding:"3px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"10px",cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap"},modeBtnActive:{backgroundColor:"#3b1515",borderColor:"#EF5350",color:"#EF5350"}};function Wu({value:r,onChange:A,enabled:e,onEnabledChange:t,mode:i,onModeChange:s,showToggle:n=!0,showModeSwitch:o=!0,showLabel:a=!0,label:l="SL",style:c,className:u}){const{currentSymbolData:d}=Be(),[B,p]=O.useState(""),[f,g]=O.useState(!1),[Q,m]=O.useState("price"),E=r!==void 0?r:B,F=e!==void 0?e:f,S=i!==void 0?i:Q,P=O.useCallback(X=>{e!==void 0||g(X),t?.(X)},[e,t]),z=O.useCallback(X=>{i!==void 0||m(X),s?.(X)},[i,s]),eA=O.useCallback(X=>{r!==void 0||p(X),A?.(X)},[r,A]),V=X=>{const fA=X.target.value;if(fA===""||fA==="."||fA==="0."){eA(fA);return}const oA=parseFloat(fA);isNaN(oA)||eA(fA)},Y=S==="price"?d?.bid?parseFloat(d.bid).toFixed(5):"0.00000":"50";return h.jsxs("div",{style:{...Se.container,...c},className:u,children:[a&&h.jsx("span",{style:Se.label,children:l}),n&&h.jsx("button",{style:{...Se.toggle,...F?Se.toggleOn:Se.toggleOff},onClick:()=>P(!F),children:h.jsx("div",{style:{...Se.toggleKnob,...F?Se.knobOn:Se.knobOff}})}),(F||!n)&&h.jsxs("div",{style:Se.inputGroup,children:[h.jsx("input",{style:Se.input,type:"text",value:E,onChange:V,placeholder:Y,onFocus:X=>X.currentTarget.style.borderColor="#EF5350",onBlur:X=>X.currentTarget.style.borderColor="#334155"}),o&&h.jsxs(h.Fragment,{children:[h.jsx("button",{style:{...Se.modeBtn,...S==="price"?Se.modeBtnActive:{}},onClick:()=>z("price"),children:"Price"}),h.jsx("button",{style:{...Se.modeBtn,...S==="pips"?Se.modeBtnActive:{}},onClick:()=>z("pips"),children:"Pips"})]})]})]})}const He={container:{display:"inline-flex",alignItems:"center",gap:"6px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},label:{fontSize:"11px",fontWeight:700,color:"#26A69A",textTransform:"uppercase",letterSpacing:"0.03em",whiteSpace:"nowrap"},toggle:{position:"relative",width:"32px",height:"18px",borderRadius:"9px",cursor:"pointer",transition:"background-color 0.2s ease",border:"none",padding:0},toggleOff:{backgroundColor:"#334155"},toggleOn:{backgroundColor:"#26A69A"},toggleKnob:{position:"absolute",top:"2px",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#fff",transition:"left 0.2s ease"},knobOff:{left:"2px"},knobOn:{left:"16px"},inputGroup:{display:"inline-flex",alignItems:"center",gap:"4px"},input:{width:"90px",padding:"4px 8px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"13px",fontWeight:600,textAlign:"right",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s ease"},modeBtn:{padding:"3px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"10px",cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap"},modeBtnActive:{backgroundColor:"#0d2e2a",borderColor:"#26A69A",color:"#26A69A"}};function $u({value:r,onChange:A,enabled:e,onEnabledChange:t,mode:i,onModeChange:s,showToggle:n=!0,showModeSwitch:o=!0,showLabel:a=!0,label:l="TP",style:c,className:u}){const{currentSymbolData:d}=Be(),[B,p]=O.useState(""),[f,g]=O.useState(!1),[Q,m]=O.useState("price"),E=r!==void 0?r:B,F=e!==void 0?e:f,S=i!==void 0?i:Q,P=O.useCallback(X=>{e!==void 0||g(X),t?.(X)},[e,t]),z=O.useCallback(X=>{i!==void 0||m(X),s?.(X)},[i,s]),eA=O.useCallback(X=>{r!==void 0||p(X),A?.(X)},[r,A]),V=X=>{const fA=X.target.value;if(fA===""||fA==="."||fA==="0."){eA(fA);return}const oA=parseFloat(fA);isNaN(oA)||eA(fA)},Y=S==="price"?d?.ask?parseFloat(d.ask).toFixed(5):"0.00000":"50";return h.jsxs("div",{style:{...He.container,...c},className:u,children:[a&&h.jsx("span",{style:He.label,children:l}),n&&h.jsx("button",{style:{...He.toggle,...F?He.toggleOn:He.toggleOff},onClick:()=>P(!F),children:h.jsx("div",{style:{...He.toggleKnob,...F?He.knobOn:He.knobOff}})}),(F||!n)&&h.jsxs("div",{style:He.inputGroup,children:[h.jsx("input",{style:He.input,type:"text",value:E,onChange:V,placeholder:Y,onFocus:X=>X.currentTarget.style.borderColor="#26A69A",onBlur:X=>X.currentTarget.style.borderColor="#334155"}),o&&h.jsxs(h.Fragment,{children:[h.jsx("button",{style:{...He.modeBtn,...S==="price"?He.modeBtnActive:{}},onClick:()=>z("price"),children:"Price"}),h.jsx("button",{style:{...He.modeBtn,...S==="pips"?He.modeBtnActive:{}},onClick:()=>z("pips"),children:"Pips"})]})]})]})}const eb=[{id:1,name:"Crosshair",icon:"+"},{id:2,name:"Trend Line",icon:"╱"},{id:3,name:"Parallel Channel",icon:"═"},{id:4,name:"Fibonacci",icon:"≡"},{id:5,name:"Rectangle",icon:"▭"},{id:6,name:"Price Level",icon:"─"}],nt={container:{display:"inline-flex",alignItems:"center",gap:"2px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},label:{fontSize:"11px",color:"#94a3b8",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",marginRight:"4px",whiteSpace:"nowrap"},btn:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"14px",cursor:"pointer",transition:"all 0.15s ease",padding:0,position:"relative"},btnActive:{backgroundColor:"#1e3a5f",borderColor:"#3b82f6",color:"#60a5fa"},btnHover:{borderColor:"#3b82f6",backgroundColor:"#1e3a5f"},tooltip:{position:"absolute",bottom:"calc(100% + 6px)",left:"50%",transform:"translateX(-50%)",padding:"4px 8px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"11px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:100},divider:{width:"1px",height:"20px",backgroundColor:"#334155",margin:"0 4px"},deleteBtn:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"13px",cursor:"pointer",transition:"all 0.15s ease",padding:0},deleteBtnHover:{borderColor:"#EF5350",backgroundColor:"#3b1515",color:"#EF5350"},visibilityBtn:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"13px",cursor:"pointer",transition:"all 0.15s ease",padding:0}};function Xu({showLabel:r=!0,showDelete:A=!0,showVisibility:e=!0,tools:t,label:i="Draw",style:s,className:n}){const{activeTool:o,setActiveTool:a,drawingsVisible:l,setDrawingsVisible:c,chartObjects:u,setChartObjects:d}=Be(),[B,p]=O.useState(null),f=t||eb,g=E=>{a(o===E?null:E)},Q=()=>{d([]),a(null)},m=()=>{c(!l)};return h.jsxs("div",{style:{...nt.container,...s},className:n,children:[r&&h.jsx("span",{style:nt.label,children:i}),f.map(E=>h.jsxs("button",{style:{...nt.btn,...o===E.id?nt.btnActive:{}},onClick:()=>g(E.id),onMouseEnter:F=>{p(E.id),o!==E.id&&Object.assign(F.currentTarget.style,nt.btnHover)},onMouseLeave:F=>{p(null),o!==E.id&&(F.currentTarget.style.borderColor="#334155",F.currentTarget.style.backgroundColor="#1e293b",F.currentTarget.style.color="#94a3b8")},title:E.name,children:[E.icon,B===E.id&&h.jsx("div",{style:nt.tooltip,children:E.name})]},E.id)),(A||e)&&h.jsx("div",{style:nt.divider}),e&&h.jsx("button",{style:{...nt.visibilityBtn,...l?{}:{color:"#64748b",backgroundColor:"#0f172a"}},onClick:m,onMouseEnter:E=>{E.currentTarget.style.borderColor="#3b82f6"},onMouseLeave:E=>{E.currentTarget.style.borderColor="#334155"},title:l?"Hide Drawings":"Show Drawings",children:l?"👁":"○"}),A&&h.jsx("button",{style:nt.deleteBtn,onClick:Q,onMouseEnter:E=>Object.assign(E.currentTarget.style,nt.deleteBtnHover),onMouseLeave:E=>{E.currentTarget.style.borderColor="#334155",E.currentTarget.style.backgroundColor="#1e293b",E.currentTarget.style.color="#94a3b8"},title:"Delete All Drawings",children:"🗑"})]})}const Ju={toolbar:{display:"flex",alignItems:"center",gap:"12px",padding:"6px 12px",backgroundColor:"#0f172a",borderBottom:"1px solid #1e293b",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",flexWrap:"wrap",minHeight:"42px"},divider:{width:"1px",height:"24px",backgroundColor:"#1e293b",flexShrink:0}};function tb({showCoinSelector:r=!0,showVolumeControl:A=!0,showStopLoss:e=!0,showTakeProfit:t=!0,showDrawingTools:i=!0,showDividers:s=!0,volume:n,onVolumeChange:o,stopLoss:a,onStopLossChange:l,stopLossEnabled:c,onStopLossEnabledChange:u,takeProfit:d,onTakeProfitChange:B,takeProfitEnabled:p,onTakeProfitEnabledChange:f,coinSelectorProps:g={},volumeControlProps:Q={},stopLossProps:m={},takeProfitProps:E={},drawingToolsProps:F={},style:S,className:P}){const z=[];r&&z.push(h.jsx(Gu,{...g},"coin")),A&&z.push(h.jsx(Ru,{value:n,onChange:o,...Q},"volume")),e&&z.push(h.jsx(Wu,{value:a,onChange:l,enabled:c,onEnabledChange:u,...m},"sl")),t&&z.push(h.jsx($u,{value:d,onChange:B,enabled:p,onEnabledChange:f,...E},"tp")),i&&z.push(h.jsx(Xu,{...F},"draw"));const eA=[];return z.forEach((V,Y)=>{eA.push(V),s&&Y<z.length-1&&eA.push(h.jsx("div",{style:Ju.divider},`div-${Y}`))}),h.jsx("div",{style:{...Ju.toolbar,...S},className:P,children:eA})}const rb=[{label:"M1",value:"M1"},{label:"M5",value:"M5"},{label:"M15",value:"M15"},{label:"M30",value:"M30"},{label:"H1",value:"H1"},{label:"H4",value:"H4"},{label:"D1",value:"D1"},{label:"W1",value:"W1"}],Yo={container:{display:"inline-flex",alignItems:"center",gap:"2px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},btn:{padding:"4px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"11px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap"},btnActive:{backgroundColor:"#1e3a5f",borderColor:"#3b82f6",color:"#60a5fa"}};function ib({style:r,className:A}){const{selectedTimeframe:e,setSelectedTimeframe:t}=Be();return h.jsx("div",{style:{...Yo.container,...r},className:A,children:rb.map(i=>h.jsx("button",{style:{...Yo.btn,...e===i.value?Yo.btnActive:{}},onClick:()=>t(i.value),onMouseEnter:s=>{e!==i.value&&(s.currentTarget.style.borderColor="#3b82f6")},onMouseLeave:s=>{e!==i.value&&(s.currentTarget.style.borderColor="#334155")},children:i.label},i.value))})}const sb=[{label:"Candles",value:"candles",icon:"📊"},{label:"Line",value:"line",icon:"📈"},{label:"Area",value:"area",icon:"▤"},{label:"Bars",value:"bars",icon:"▥"}],qo={container:{display:"inline-flex",alignItems:"center",gap:"2px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},btn:{padding:"4px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"11px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"3px"},btnActive:{backgroundColor:"#1e3a5f",borderColor:"#3b82f6",color:"#60a5fa"}};function nb({style:r,className:A}){const{chartType:e,setChartType:t}=Be();return h.jsx("div",{style:{...qo.container,...r},className:A,children:sb.map(i=>h.jsxs("button",{style:{...qo.btn,...e===i.value?qo.btnActive:{}},onClick:()=>t(i.value),onMouseEnter:s=>{e!==i.value&&(s.currentTarget.style.borderColor="#3b82f6")},onMouseLeave:s=>{e!==i.value&&(s.currentTarget.style.borderColor="#334155")},title:i.label,children:[h.jsx("span",{children:i.icon}),h.jsx("span",{children:i.label})]},i.value))})}const Qe={container:{display:"inline-flex",alignItems:"center",gap:"6px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},priceBox:{display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 10px",backgroundColor:"#0f172a",borderRadius:"4px",minWidth:"80px"},priceLabel:{fontSize:"9px",color:"#64748b",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},priceValue:{fontSize:"13px",fontWeight:700,fontFamily:"monospace"},spread:{fontSize:"9px",color:"#64748b",padding:"0 4px",display:"flex",flexDirection:"column",alignItems:"center",gap:"1px"},spreadLabel:{fontSize:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},spreadValue:{fontSize:"10px",fontWeight:700,color:"#94a3b8"},sellBtn:{padding:"6px 16px",backgroundColor:"#7f1d1d",border:"1px solid #991b1b",borderRadius:"4px",color:"#fca5a5",fontSize:"12px",fontWeight:700,cursor:"pointer",transition:"all 0.15s ease",textTransform:"uppercase",letterSpacing:"0.03em",minWidth:"70px"},sellBtnHover:{backgroundColor:"#991b1b",borderColor:"#EF5350"},buyBtn:{padding:"6px 16px",backgroundColor:"#14532d",border:"1px solid #166534",borderRadius:"4px",color:"#86efac",fontSize:"12px",fontWeight:700,cursor:"pointer",transition:"all 0.15s ease",textTransform:"uppercase",letterSpacing:"0.03em",minWidth:"70px"},buyBtnHover:{backgroundColor:"#166534",borderColor:"#26A69A"},status:{fontSize:"10px",padding:"2px 8px",borderRadius:"3px",fontWeight:600,whiteSpace:"nowrap"}};function ob({volume:r=.1,stopLoss:A,takeProfit:e,onTradeExecuted:t,style:i,className:s}){const{selectedSymbol:n,currentSymbolData:o,setOrders:a,setUserBalance:l}=Be(),[c,u]=O.useState(null),d=parseFloat(o?.bid||0),B=parseFloat(o?.ask||0),p=B>0&&d>0?Math.abs(B-d):0,f=m=>!m||m===0?"-.-----":m>=1e3?m.toFixed(2):m>=1?m.toFixed(4):m.toFixed(5),g=m=>m===0?"-":m>=1?m.toFixed(1):m>=.01?m.toFixed(3):(m*1e4).toFixed(1)+"p",Q=O.useCallback(m=>{if(!n)return;const E=m==="BUY"?B:d;if(!E||E<=0){u({type:"error",message:"No price available"});return}const F={id:Date.now().toString(),ticket:Math.floor(Math.random()*9e5)+1e5,symbol:n,type:m,volume:r,price:E,stopLoss:A?parseFloat(A):null,takeProfit:e?parseFloat(e):null,status:"OPEN",profit:0,swap:0,openAt:new Date().toISOString(),time:new Date().toLocaleTimeString()};a(P=>[...P,F]);const S=r*E*.01;l(P=>P-S),u({type:"success",message:`${m} executed`}),t?.(F),setTimeout(()=>u(null),3e3)},[n,B,d,r,A,e,a,l,t]);return h.jsxs("div",{style:{...Qe.container,...i},className:s,children:[h.jsx("button",{style:Qe.sellBtn,onClick:()=>Q("SELL"),onMouseEnter:m=>{Object.assign(m.currentTarget.style,Qe.sellBtnHover)},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="#7f1d1d",m.currentTarget.style.borderColor="#991b1b"},children:"Sell"}),h.jsxs("div",{style:Qe.priceBox,children:[h.jsx("span",{style:Qe.priceLabel,children:"Bid"}),h.jsx("span",{style:{...Qe.priceValue,color:"#EF5350"},children:f(d)})]}),h.jsxs("div",{style:Qe.spread,children:[h.jsx("span",{style:Qe.spreadLabel,children:"Spread"}),h.jsx("span",{style:Qe.spreadValue,children:g(p)})]}),h.jsxs("div",{style:Qe.priceBox,children:[h.jsx("span",{style:Qe.priceLabel,children:"Ask"}),h.jsx("span",{style:{...Qe.priceValue,color:"#26A69A"},children:f(B)})]}),h.jsx("button",{style:Qe.buyBtn,onClick:()=>Q("BUY"),onMouseEnter:m=>{Object.assign(m.currentTarget.style,Qe.buyBtnHover)},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="#14532d",m.currentTarget.style.borderColor="#166534"},children:"Buy"}),c&&h.jsx("span",{style:{...Qe.status,backgroundColor:c.type==="success"?"#14532d":"#7f1d1d",color:c.type==="success"?"#86efac":"#fca5a5",border:`1px solid ${c.type==="success"?"#166534":"#991b1b"}`},children:c.message})]})}const kA={container:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",backgroundColor:"#0f172a",borderTop:"1px solid #1e293b",fontSize:"11px",overflow:"hidden",display:"flex",flexDirection:"column"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",backgroundColor:"#0f172a",borderBottom:"1px solid #1e293b"},headerTitle:{color:"#94a3b8",fontSize:"11px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},summary:{display:"flex",gap:"16px",fontSize:"11px"},summaryItem:{display:"flex",gap:"4px",alignItems:"center"},summaryLabel:{color:"#64748b",fontWeight:600},summaryValue:{fontWeight:700,fontFamily:"monospace"},table:{width:"100%",borderCollapse:"collapse"},th:{padding:"4px 8px",textAlign:"left",color:"#64748b",fontWeight:700,fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.05em",borderBottom:"1px solid #1e293b",whiteSpace:"nowrap"},td:{padding:"4px 8px",color:"#cbd5e1",borderBottom:"1px solid #1e293b",whiteSpace:"nowrap",fontFamily:"monospace",fontSize:"11px"},closeBtn:{padding:"2px 8px",backgroundColor:"#7f1d1d",border:"1px solid #991b1b",borderRadius:"3px",color:"#fca5a5",fontSize:"10px",fontWeight:700,cursor:"pointer",transition:"all 0.15s ease"},emptyRow:{padding:"16px",textAlign:"center",color:"#475569",fontSize:"12px"},scrollArea:{overflowY:"auto",maxHeight:"200px"},typeBuy:{color:"#26A69A",fontWeight:700},typeSell:{color:"#EF5350",fontWeight:700}};function ab({style:r,className:A,maxHeight:e=200}){const{orders:t,setOrders:i,symbols:s,accountSummary:n,setUserBalance:o}=Be(),[a,l]=O.useState(null),c=t.filter(f=>f.status==="OPEN"||!f.closeAt),u=O.useCallback((f,g)=>{const Q=s.find(m=>m.symbol===f);return Q?parseFloat(g==="BUY"?Q.bid||0:Q.ask||0):0},[s]),d=O.useCallback(f=>{if(a)return;l(f.id);const g=u(f.symbol,f.type),m=(f.type==="BUY"?g-f.price:f.price-g)*f.volume,E=f.volume*f.price*.01;i(F=>F.filter(S=>S.id!==f.id)),o(F=>F+E+m),l(null)},[a,u,i,o]),B=f=>{const g=parseFloat(f);return!g||isNaN(g)?"-":g>=1e3?g.toFixed(2):g>=1?g.toFixed(4):g.toFixed(5)},p=f=>{const g=parseFloat(f);return isNaN(g)?"-":(g>=0?"+":"")+g.toFixed(2)};return h.jsxs("div",{style:{...kA.container,...r},className:A,children:[h.jsxs("div",{style:kA.header,children:[h.jsxs("span",{style:kA.headerTitle,children:["Positions (",c.length,")"]}),h.jsxs("div",{style:kA.summary,children:[h.jsxs("div",{style:kA.summaryItem,children:[h.jsx("span",{style:kA.summaryLabel,children:"Balance:"}),h.jsxs("span",{style:{...kA.summaryValue,color:"#e2e8f0"},children:["$",n?.balance?.toFixed(2)||"0.00"]})]}),h.jsxs("div",{style:kA.summaryItem,children:[h.jsx("span",{style:kA.summaryLabel,children:"Equity:"}),h.jsxs("span",{style:{...kA.summaryValue,color:(n?.equity||0)>=(n?.balance||0)?"#26A69A":"#EF5350"},children:["$",n?.equity?.toFixed(2)||"0.00"]})]}),h.jsxs("div",{style:kA.summaryItem,children:[h.jsx("span",{style:kA.summaryLabel,children:"Free:"}),h.jsxs("span",{style:{...kA.summaryValue,color:"#94a3b8"},children:["$",n?.freeMargin?.toFixed(2)||"0.00"]})]})]})]}),h.jsx("div",{style:{...kA.scrollArea,maxHeight:e},children:h.jsxs("table",{style:kA.table,children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{style:kA.th,children:"Symbol"}),h.jsx("th",{style:kA.th,children:"Type"}),h.jsx("th",{style:kA.th,children:"Volume"}),h.jsx("th",{style:kA.th,children:"Open Price"}),h.jsx("th",{style:kA.th,children:"Current"}),h.jsx("th",{style:kA.th,children:"SL"}),h.jsx("th",{style:kA.th,children:"TP"}),h.jsx("th",{style:kA.th,children:"Profit"}),h.jsx("th",{style:kA.th,children:"Action"})]})}),h.jsx("tbody",{children:c.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:9,style:kA.emptyRow,children:"No open positions"})}):c.map(f=>{const g=u(f.symbol,f.type),Q=f.profit||0;return h.jsxs("tr",{children:[h.jsx("td",{style:{...kA.td,fontWeight:700,color:"#e2e8f0"},children:f.symbol}),h.jsx("td",{style:{...kA.td,...f.type==="BUY"?kA.typeBuy:kA.typeSell},children:f.type}),h.jsx("td",{style:kA.td,children:f.volume}),h.jsx("td",{style:kA.td,children:B(f.price)}),h.jsx("td",{style:kA.td,children:B(g)}),h.jsx("td",{style:kA.td,children:f.stopLoss?B(f.stopLoss):"-"}),h.jsx("td",{style:kA.td,children:f.takeProfit?B(f.takeProfit):"-"}),h.jsx("td",{style:{...kA.td,color:Q>=0?"#26A69A":"#EF5350",fontWeight:700},children:p(Q)}),h.jsx("td",{style:kA.td,children:h.jsx("button",{style:{...kA.closeBtn,...a===f.id?{opacity:.5,cursor:"not-allowed"}:{}},onClick:()=>d(f),disabled:a===f.id,onMouseEnter:m=>{a!==f.id&&(m.currentTarget.style.backgroundColor="#991b1b")},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="#7f1d1d"},children:a===f.id?"...":"Close"})})]},f.id)})})]})})]})}function lb(r){return Ir({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"},child:[]}]})(r)}function cb(r){return Ir({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 13H5v-2h14v2z"},child:[]}]})(r)}const hb=({selectedSymbol:r,selectedTimeframe:A,onTimeframeChange:e,chartType:t="candles",onChartTypeChange:i,onNewOrder:s,onZoomIn:n,onZoomOut:o,onToggleBuySell:a,onDownloadChartPNG:l,onToggleFullscreen:c,marketWatchOpen:u=!0,onToggleMarketWatch:d,buySellPanelOpen:B,onMove:p})=>{const{theme:f}=Be(),g=f==="light",Q=["M1","M5","M15","M30","H1","H4","D1","W1","MN"],m={bars:h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{fillRule:"evenodd",d:"M20.999 15.002H19v3a1 1 0 0 1-2.001 0V8H15a1 1 0 1 1 0-2h1.999v-3A1 1 0 1 1 19 3v10h1.999a1 1 0 0 1 0 2Zm-10.999-4H6.999v10a1 1 0 1 1-1.999 0v-3H3a1 1 0 0 1 0-2h2v-11a1 1 0 1 1 1.999 0V9H10a1 1 0 0 1 0 2Z",clipRule:"evenodd",fill:"currentColor"})]}),candles:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M9 3V9H11V18H9V21H7V18H5V9H7V3H9ZM17 3V6H19V16H17V19H15V16H13V6H15V3H17ZM17 8H15V14H17V8Z",fill:"currentColor"})}),area:h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{d:"m2.166 16.571 7.013-7.194c.38-.583 1.116-.273 1.707.256l4.14 2.31 5.136-6.692c.277-.425 1.853-.182 1.853-.182v13.952H2.047a7.772 7.772 0 0 1 .119-2.45Z",opacity:".2",fill:"currentColor"}),h.jsx("path",{d:"M3.027 18.011a1 1 0 0 1-.81-1.58c.81-1.128 1.5-2.154 2.113-3.065 1.938-2.887 3.22-4.795 5.234-5.042 1.607-.195 3.364.683 6.28 3.212l4.35-6.086a1 1 0 0 1 1.626 1.16l-4.994 6.99a1 1 0 0 1-1.483.16c-2.824-2.552-4.481-3.587-5.536-3.454-1.108.136-2.186 1.742-3.82 4.173-.621.927-1.323 1.971-2.148 3.117a1.001 1.001 0 0 1-.812.415Z",fill:"currentColor"})]}),line:h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{d:"M3.027 18.011a1 1 0 0 1-.81-1.58c.81-1.128 1.5-2.154 2.113-3.065 1.938-2.887 3.22-4.795 5.234-5.042 1.607-.195 3.364.683 6.28 3.212l4.35-6.086a1 1 0 0 1 1.626 1.16l-4.994 6.99a1 1 0 0 1-1.483.16c-2.824-2.552-4.481-3.587-5.536-3.454-1.108.136-2.186 1.742-3.82 4.173-.621.927-1.323 1.971-2.148 3.117a1.001 1.001 0 0 1-.812.415Z",fill:"currentColor"})]}),volume:h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{fillRule:"evenodd",d:"M19.024 17.844H19a1 1 0 0 1-1-1V13a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v3.844a1 1 0 0 1-1 1Zm-3 0H16a1 1 0 0 1-1-1v-5.845A1 1 0 0 1 16 10h.024a1 1 0 0 1 1 .999v5.845a1 1 0 0 1-1 1Zm-3 0H13a1 1 0 0 1-1-1V6.999A1 1 0 0 1 13 6h.024a1 1 0 0 1 1 .999v9.845a1 1 0 0 1-1 1Zm-3 0H10a1 1 0 0 1-1-1V12a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v4.844a1 1 0 0 1-1 1Zm-3 0H7a1 1 0 0 1-1-1V9.999A.999.999 0 0 1 7 9h.024a1 1 0 0 1 1 .999v6.845a1 1 0 0 1-1 1Zm-3 0H4a1 1 0 0 1-1-1v-2.845a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v2.845a1 1 0 0 1-1 1Z",clipRule:"evenodd",fill:"currentColor"})]}),"volume ticks":h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{fillRule:"evenodd",d:"M20.009 6.993h-.985v3.985a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1V6.993h-.946c-.565 0-1.023-.441-1.023-.985v-.024c0-.543.458-.984 1.023-.984h3.955c.565 0 1.023.441 1.023.984v.024c0 .544-.458.985-1.023.985Zm-3.985 6.14v5.845a1 1 0 0 1-1 1H15a1 1 0 0 1-1-1v-5.845a1 1 0 0 1 1-.999h.024a1 1 0 0 1 1 .999Zm-4 6.845H12a1 1 0 0 1-1-1V9.133a1 1 0 0 1 1-.999h.024a1 1 0 0 1 1 .999v9.845a1 1 0 0 1-1 1Zm-3 0H9a1 1 0 0 1-1-1v-4.844a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v4.844a1 1 0 0 1-1 1Zm-3 0H6a1 1 0 0 1-1-1v-6.845a.998.998 0 0 1 1-.999h.024a1 1 0 0 1 1 .999v6.845a1 1 0 0 1-1 1Zm-3 0H3a1 1 0 0 1-1-1v-2.845a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v2.845a1 1 0 0 1-1 1ZM18 14.134h.024a1 1 0 0 1 1 1v3.844a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-3.844a1 1 0 0 1 1-1Z",clipRule:"evenodd",fill:"currentColor"})]})};return h.jsxs("div",{className:`flex items-center justify-between px-4 py-1 border-b ${g?"bg-white border-slate-200":"bg-[#12161d] border-slate-700"}`,children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("div",{className:`flex items-center gap-1 border-r pr-3 ${g?"border-slate-200":"border-slate-700"}`,children:["bars","candles","line","area"].map(E=>h.jsx("button",{onClick:()=>i(E),className:`px-1 py-1.5 text-[11px] font-medium rounded transition-colors capitalize flex items-center gap-1.5
11
- ${t===E?g?"text-sky-600":"text-sky-400":g?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-white hover:text-slate-200 hover:bg-slate-800"}
12
- `,title:E,children:m[E]},E))}),h.jsx("div",{className:`flex items-center gap-1 border-r ${g?"border-slate-200":"border-slate-700"} pr-1`,children:["volume ticks","volume"].map(E=>h.jsx("button",{onClick:()=>i(E),className:`px-1 py-1.5 text-[11px] font-medium rounded transition-colors capitalize flex items-center gap-1.5
13
- ${t===E?g?"text-sky-600":"text-sky-400":g?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-white hover:text-slate-200 hover:bg-slate-800"}
14
- `,title:E,children:m[E]},E))}),h.jsxs("div",{className:"flex items-center gap-2",children:[Q.map(E=>h.jsx("button",{onClick:()=>e(E),className:`px-1.5 py-2 text-sm font-medium rounded transition-colors ${A===E?g?"text-sky-600":"text-sky-400":g?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-white hover:text-slate-200 hover:bg-slate-800"}`,children:E},E)),h.jsx("div",{className:`border-r h-6 mx-1 ${g?"border-slate-200":"border-slate-700"}`}),h.jsx("button",{onClick:()=>a?.(),title:B?"Hide Buy/Sell on Chart":"Show Buy/Sell on Chart",className:`px-2 py-2 flex justify-center items-center rounded transition-colors ${B?g?"text-sky-600 bg-sky-50 hover:bg-[#E5F4FF]":"text-sky-400 bg-slate-700 hover:bg-[#25303C]":g?"text-slate-600 hover:text-sky-600 hover:bg-[#E5F4FF]":"text-slate-200 hover:bg-[#25303C]"}`,children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{fill:"#DA5244",d:"M11.5 5v4H9c-1.054 0-1.918.816-1.995 1.85L7 11v2c0 1.105.895 2 2 2h2.5v4H4c-1.105 0-2-.895-2-2V7c0-1.105.895-2 2-2h7.5z"}),h.jsx("path",{fill:"#3687ED",d:"M20 5c1.105 0 2 .895 2 2v10c0 1.105-.895 2-2 2h-7.5v-4H15c1.054 0 1.918-.816 1.995-1.85L17 13v-2c0-1.105-.895-2-2-2h-2.5V5H20z"}),h.jsx("path",{fill:"#B0BEC5",d:"M10 10h4c1.105 0 2 .895 2 2s-.895 2-2 2h-4c-1.105 0-2-.895-2-2s.895-2 2-2z"})]})})}),h.jsxs("button",{onClick:s,className:`px-2 py-2 flex justify-center items-center gap-1 cursor-pointer text-xs font-medium rounded transition-colors ${g?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-white hover:bg-[#25303C]"}`,children:[h.jsx("svg",{width:24,height:24,viewBox:"0 0 24 24 ",xmlns:"http://www.w3.org/2000/svg",children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{fill:"#DA5244",d:"M11.5 4v2.02C8.42 6.276 6 8.856 6 12c0 3.145 2.42 5.725 5.5 5.98V20H10c-4.418 0-8-3.582-8-8s3.582-8 8-8h1.5z"}),h.jsx("path",{fill:"#3687ED",d:"M14 4c4.418 0 8 3.582 8 8s-3.582 8-8 8h-1.5v-2.02c3.08-.256 5.5-2.836 5.5-5.98 0-3.145-2.42-5.725-5.5-5.98V4H14z"}),h.jsx("path",{fill:"#B0BEC5",d:"M13 8v4.186l2.657 2.657-1.414 1.414L11 13V8z"})]})}),h.jsx("span",{className:"button-text svelte-1iwf8ix",children:"New Order"})]}),h.jsx("div",{className:`border-r ${g?"border-slate-200":"border-slate-700"} h-6 mx-1`}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:n,className:`p-1 ${g?"text-slate-700 hover:bg-[#E5F4FF]":"text-white hover:bg-slate-800"} rounded transition-colors`,title:"Zoom In",children:h.jsx(lb,{className:"w-5 h-5"})}),h.jsx("button",{onClick:o,className:`p-2 ${g?"text-slate-700 hover:bg-[#E5F4FF]":"text-white hover:bg-slate-800"} rounded transition-colors`,title:"Zoom Out",children:h.jsx(cb,{className:"w-5 h-5"})}),h.jsx("div",{className:`border-r ${g?"border-slate-200":"border-slate-700"} h-6 mx-1`}),h.jsx("button",{onClick:p,className:`px-2 py-2 flex justify-center items-center gap-1 cursor-pointer text-xs font-medium rounded transition-colors ${g?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-slate-200 hover:bg-[#25303C]"}`,children:h.jsx("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M9 4V5H15V4H17V5H19C20.1046 5 21 5.89543 21 7V18C21 19.1046 20.1046 20 19 20H5C3.89543 20 3 19.1046 3 18V7C3 5.89543 3.89543 5 5 5H7V4H9ZM7 7H6C5.44772 7 5 7.44772 5 8V17C5 17.5523 5.44772 18 6 18H18C18.5523 18 19 17.5523 19 17V8C19 7.44772 18.5523 7 18 7H17V8H15V7H9V8H7V7ZM13 14V16H11V14H13ZM9 14V16H7V14H9ZM17 14V16H15V14H17ZM13 10V12H11V10H13ZM17 10V12H15V10H17Z",clipRule:"evenodd"})})}),h.jsx("div",{className:`border-r ${g?"border-slate-200":"border-slate-700"} h-6 mx-1`}),h.jsx("button",{type:"button",onClick:()=>d?.(),title:u?"Close Market Watch":"Open Market Watch",className:`px-2 py-2 flex justify-center items-center gap-1 cursor-pointer text-xs font-medium rounded transition-colors ${u?g?"text-sky-600 bg-sky-50 hover:bg-[#E5F4FF]":"text-sky-400 bg-slate-700 hover:bg-[#25303C]":g?"text-slate-600 hover:text-sky-600 hover:bg-[#E5F4FF]":"text-slate-200 hover:bg-[#25303C]"}`,children:h.jsxs("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[h.jsx("path",{d:"M15 7H7v2h8V7ZM7 15h5v2H7v-2ZM17 11H7v2h10v-2Z"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14Zm-1 2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h12Z"})]})})]})]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{type:"button",onClick:()=>l?.(),title:"Download chart as PNG",className:`p-2 rounded transition-colors ${g?"text-slate-500 hover:text-slate-800 hover:bg-slate-100":"text-slate-300 hover:text-white hover:bg-slate-800"}`,children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",className:"inline-block",fill:"currentColor",children:h.jsx("path",{d:"M22 10a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0-4a1 1 0 0 1-1-1V4h-1a1 1 0 1 1 0-2h1a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1Zm1 7v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-8l3.764-1s.45-.428.789-1.105l.171-.342a.998.998 0 0 1 .894-.553h4.764a1 1 0 0 1 .894.552l.171.342c.339.678.789 1.106.789 1.106L23 13Zm-8 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6Zm0 4.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3ZM16 4h-2a1 1 0 1 1 0-2h2a1 1 0 1 1 0 2Zm-6 0H8a1 1 0 0 1 0-2h2a1 1 0 1 1 0 2ZM4 22H3a2 2 0 0 1-2-2v-1a1 1 0 1 1 2 0v1h1a1 1 0 1 1 0 2ZM4 4H3v1a1 1 0 0 1-2 0V4a2 2 0 0 1 2-2h1a1 1 0 0 1 0 2ZM2 8a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1Zm0 5a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1Z"})})}),h.jsx("button",{type:"button",onClick:()=>c?.(),title:"Full screen (F11)",className:`p-2 rounded transition-colors ${g?"text-slate-600 hover:text-slate-800 hover:bg-slate-100":"text-slate-300 hover:text-white hover:bg-slate-800"}`,children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})})})]})]})},ti=[{label:"Trendline",toolId:2,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{fillRule:"evenodd",d:"M19.054 7.988a2.988 2.988 0 0 1-1.31-.312l-10 10a3.027 3.027 0 1 1-1.38-1.381l10-10a2.994 2.994 0 1 1 2.69 1.693Zm-14 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm14-14a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",clipRule:"evenodd",fill:"currentColor"})]})},{label:"Horizontal Line",toolId:20,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M4 12h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("circle",{cx:"4",cy:"12",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"20",cy:"12",r:"1.5",fill:"currentColor"})]})},{label:"Horizontal Ray",toolId:21,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M4 12h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("circle",{cx:"4",cy:"12",r:"1.5",fill:"currentColor"}),h.jsx("path",{d:"M19 9l3 3-3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})},{label:"Vertical Line",toolId:22,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M12 4v16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("circle",{cx:"12",cy:"4",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"12",cy:"20",r:"1.5",fill:"currentColor"})]})},{label:"Info Line",toolId:23,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{fillRule:"evenodd",d:"M19.054 7.988a2.988 2.988 0 0 1-1.31-.312l-10 10a3.027 3.027 0 1 1-1.38-1.381l10-10a2.994 2.994 0 1 1 2.69 1.693Zm-14 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm14-14a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",clipRule:"evenodd",fill:"currentColor"}),h.jsx("rect",{x:"10",y:"5",width:"7",height:"5",rx:"1",fill:"currentColor",opacity:"0.5"}),h.jsx("text",{x:"11",y:"9",fontSize:"4",fill:"white",fontWeight:"bold",children:"i"})]})},{label:"Ruler Line",toolId:24,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[h.jsx("line",{x1:"4",y1:"20",x2:"20",y2:"4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),h.jsx("rect",{x:"7",y:"7",width:"10",height:"5",rx:"1",transform:"rotate(-45 12 12)",stroke:"currentColor",strokeWidth:"1.3",fill:"none"}),h.jsx("line",{x1:"10.5",y1:"13.5",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"}),h.jsx("line",{x1:"12.5",y1:"11.5",x2:"14",y2:"10",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"}),h.jsx("circle",{cx:"4.5",cy:"19.5",r:"1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),h.jsx("circle",{cx:"19.5",cy:"4.5",r:"1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})},{label:"Arrowed Line",toolId:25,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{fillRule:"evenodd",d:"M5.054 17.988a2.988 2.988 0 0 1-1.31-.312 2.994 2.994 0 1 1 2.69 1.693 2.988 2.988 0 0 1-1.38-.381Zm-1 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",clipRule:"evenodd",fill:"currentColor"}),h.jsx("path",{d:"M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M14 6h4v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})},{label:"Ray",toolId:26,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("circle",{cx:"5",cy:"19",r:"2",fill:"currentColor"}),h.jsx("path",{d:"M6.4 17.6L19 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M16 5h3v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})},{label:"Extended Line",toolId:27,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M2 19L22 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 0 3"}),h.jsx("circle",{cx:"8",cy:"15",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"16",cy:"9",r:"1.5",fill:"currentColor"})]})},{label:"Cross Line",toolId:28,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M12 4v16M4 12h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]})},{label:"Trend By Angle",toolId:29,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M5 19L19 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M5 19h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),h.jsx("path",{d:"M5 13a6 6 0 0 1 0 6",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]})},{label:"Disjoint Channel",toolId:30,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M3 17L9 11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M9 17L15 11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M15 17L21 11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M3 14L21 14",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeDasharray:"2 2"})]})},{label:"Flat Top/Bottom",toolId:31,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M4 8h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M4 16h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M8 8v8M16 8v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"2 2"})]})}],ub=({children:r,top:A,panelRef:e,isLight:t})=>h.jsx("div",{ref:e,className:`absolute left-12 z-50 w-56 border shadow-2xl overflow-visible ${t?"bg-white border-slate-200":"bg-[#262F3F] border-white/10"}`,style:{top:A},children:h.jsx("div",{className:"py-1",children:r})}),db=({AccountId:r,UserName:A,UserId:e})=>{const{activeTool:t,setActiveTool:i,showGrid:s,setShowGrid:n,snapToGrid:o,setSnapToGrid:a,chartObjects:l,setChartObjects:c,drawingsVisible:u,setDrawingsVisible:d,chartLocked:B,setChartLocked:p,theme:f,setTheme:g}=Be(),[Q,m]=O.useState(!1),[E,F]=O.useState(null),[S,P]=O.useState(!1),[z,eA]=O.useState(0),[V,Y]=O.useState(!1),[X,fA]=O.useState({chart:"Grid",colors:"Green & Red",lang:"English"}),oA=O.useRef(null),pA=O.useRef(null),IA=O.useRef(null);O.useEffect(()=>{const J=q=>{const yA=oA.current;Q&&yA&&!yA.contains(q.target)&&(m(!1),F(null));const BA=pA.current;S&&BA&&!BA.contains(q.target)&&P(!1)};return window.addEventListener("mousedown",J),()=>window.removeEventListener("mousedown",J)},[Q,S]),O.useEffect(()=>{const J=q=>{q.key==="Escape"&&(m(!1),F(null),P(!1))};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[]);const vA=O.useMemo(()=>[{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 18H21V16H3V18ZM3 13H21V11H3V13ZM3 6V8H21V6H3Z",fill:"currentColor"})]})}),label:"Menu",description:"Opens/closes navigation menu"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",fill:"currentColor"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 13H15.874C15.5122 14.4056 14.4056 15.5122 13 15.874V20C13 20.2652 12.8946 20.5196 12.7071 20.7071C12.5196 20.8946 12.2652 21 12 21C11.7348 21 11.4804 20.8946 11.2929 20.7071C11.1054 20.5196 11 20.2652 11 20V15.874C9.59439 15.5122 8.4878 14.4056 8.12602 13H4C3.73478 13 3.48043 12.8946 3.29289 12.7071C3.10536 12.5196 3 12.2652 3 12C3 11.7348 3.10536 11.4804 3.29289 11.2929C3.48043 11.1054 3.73478 11 4 11H8.12602C8.4878 9.59439 9.59439 8.4878 11 8.12602V4C11 3.73478 11.1054 3.48043 11.2929 3.29289C11.4804 3.10536 11.7348 3 12 3C12.2652 3 12.5196 3.10536 12.7071 3.29289C12.8946 3.48043 13 3.73478 13 4V8.12602C14.4056 8.4878 15.5122 9.59439 15.874 11H20C20.2652 11 20.5196 11.1054 20.7071 11.2929C20.8946 11.4804 21 11.7348 21 12C21 12.2652 20.8946 12.5196 20.7071 12.7071C20.5196 12.8946 20.2652 13 20 13ZM12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10Z",fill:"currentColor"})]})}),label:"Crosshair",description:"Precise cursor positioning for measurement on chart"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{fillRule:"evenodd",d:"M19.054 7.988a2.988 2.988 0 0 1-1.31-.312l-10 10a3.027 3.027 0 1 1-1.38-1.381l10-10a2.994 2.994 0 1 1 2.69 1.693Zm-14 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm14-14a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",clipRule:"evenodd",fill:"currentColor"})]})}),label:"Trend Line",description:"Draw trend line (drag from first point to second point)"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"m2.285 10.333 8.048-8.048a.977.977 0 1 1 1.381 1.381l-8.048 8.049a.977.977 0 0 1-1.381-1.382Zm10 10 8.048-8.048a.977.977 0 1 1 1.381 1.381l-8.048 8.049a.977.977 0 0 1-1.381-1.382ZM19 8a2.966 2.966 0 0 1-1.308-.312l-10 10c.202.408.307.857.308 1.312a3.03 3.03 0 1 1-1.693-2.689l10-10A2.993 2.993 0 1 1 19 8ZM5 18a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM19 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})}),label:"Parallel Lines",description:"Draw two parallel trend lines (draw first line, then second)"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M21 15H3a1 1 0 0 1 0-2h18a1 1 0 0 1 0 2Zm-2-3a2.99 2.99 0 0 1-2.816-2H3a1 1 0 0 1 0-2h13.184A2.995 2.995 0 1 1 19 12Zm0-4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm2-3H3a1 1 0 0 1 0-2h18a1 1 0 1 1 0 2ZM5 16a2.99 2.99 0 0 1 2.816 2H21a1 1 0 0 1 0 2H7.816A2.995 2.995 0 1 1 5 16Zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})}),label:"Fibonacci",description:"Draw Fibonacci retracement levels"},{icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M3 6C3 7.30622 3.83481 8.41746 5 8.82929V15.1707C3.83481 15.5825 3 16.6938 3 18C3 19.6569 4.34315 21 6 21C7.30622 21 8.41746 20.1652 8.82929 19H15.1707C15.5825 20.1652 16.6938 21 18 21C19.6569 21 21 19.6569 21 18C21 16.6938 20.1652 15.5825 19 15.1707V8.82929C20.1652 8.41746 21 7.30622 21 6C21 4.34315 19.6569 3 18 3C16.6938 3 15.5825 3.83481 15.1707 5H8.82929C8.41746 3.83481 7.30622 3 6 3C4.34315 3 3 4.34315 3 6ZM6 7C6.55228 7 7 6.55228 7 6C7 5.44772 6.55228 5 6 5C5.44772 5 5 5.44772 5 6C5 6.55228 5.44772 7 6 7ZM17 15.1707V8.82929C16.1476 8.52801 15.472 7.85242 15.1707 7H8.82929C8.52801 7.85241 7.85241 8.52801 7 8.82929V15.1707C7.85241 15.472 8.52801 16.1476 8.82929 17H15.1707C15.472 16.1476 16.1476 15.472 17 15.1707ZM18 7C18.5523 7 19 6.55228 19 6C19 5.44772 18.5523 5 18 5C17.4477 5 17 5.44772 17 6C17 6.55228 17.4477 7 18 7ZM7 18C7 18.5523 6.55228 19 6 19C5.44772 19 5 18.5523 5 18C5 17.4477 5.44772 17 6 17C6.55228 17 7 17.4477 7 18ZM19 18C19 18.5523 18.5523 19 18 19C17.4477 19 17 18.5523 17 18C17 17.4477 17.4477 17 18 17C18.5523 17 19 17.4477 19 18Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})})}),label:"Rectangle",description:"Draw support/resistance zone (drag from corner to corner)"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20 4V8H18V6H13V18H16V20H8V18H11V6H6V8H4V4H20Z",fill:"currentColor"})})}),label:"Text",description:"Add text label on chart (coming soon)"},{icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M12.76 17.958c-.504.07-1.016.07-1.52 0C6.07 17.532 2 12.932 2 12c0-.977 4.48-6 10-6s10 5.043 10 6c0 .912-4.07 5.529-9.24 5.958ZM3.63 12a11.724 11.724 0 0 0 3.03 2.741 5.963 5.963 0 0 1 .02-5.492A11.7 11.7 0 0 0 3.63 12ZM12 7.57a4.443 4.443 0 1 0-.006 8.886A4.443 4.443 0 0 0 12 7.57Zm5.31 1.652a5.954 5.954 0 0 1 .01 5.546A11.45 11.45 0 0 0 20.37 12a11.525 11.525 0 0 0-3.06-2.778ZM12 14a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})})}),label:"Eye",description:"Show or hide all drawing objects on chart"},{icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M16 20H8a2 2 0 0 1-2-2v-7a2 2 0 0 1 1.05-1.749A1.044 1.044 0 0 1 7 9a5 5 0 0 1 8.75-3.3 1.008 1.008 0 0 1-.09 1.411 1 1 0 0 1-1.41-.09A3 3 0 0 0 9 9h7a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2Zm0-9H8v7h8v-7Zm-4 2a1 1 0 0 1 1 1v1a1 1 0 0 1-2 0v-1a1 1 0 0 1 1-1Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})})}),label:"Lock",description:"Lock chart (disable pan and zoom)"},{icon:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),label:"Delete",description:"Remove last drawn object from chart"},{icon:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16M6 4v16M12 4v16M18 4v16"})}),label:"Grid",description:"Toggle grid display on/off for chart alignment"},{icon:h.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("circle",{cx:"12",cy:"12",r:"8",strokeWidth:2}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l-3 3m6-3l-3-3"})]}),label:"History",description:"Undo/redo actions and view action history"},{icon:h.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("rect",{x:"3",y:"3",width:"8",height:"8",strokeWidth:2}),h.jsx("rect",{x:"13",y:"3",width:"8",height:"8",strokeWidth:2}),h.jsx("rect",{x:"3",y:"13",width:"8",height:"8",strokeWidth:2}),h.jsx("rect",{x:"13",y:"13",width:"8",height:"8",strokeWidth:2})]}),label:"Layout",description:"Manage chart layouts and panel arrangements"}],[]),MA=J=>{const q=vA[J].label;if(q==="Menu"){m(yA=>!yA),F(null);return}if(q==="Grid"){n(!s);return}if(q==="Magnet"){a(!o),i(o?null:J);return}if(q==="Delete"){if(l.length>0){const yA=[...l];yA.pop(),c(yA)}return}if(q==="Eye"){d(!u);return}if(q==="Lock"){p(!B);return}if(q==="Light Theme"||q==="Dark Theme"){g(f==="light"?"dark":"light"),m(!1),F(null);return}i(t===J?null:J)},SA=vA.slice(0,12),UA=vA.slice(12),bA=[{key:"accounts",label:"Trading accounts",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:h.jsx("path",{d:"M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 14a6 6 0 0 0-5 2 8 8 0 0 0 5 2l5-2a6 6 0 0 0-5-2zm0-12a8 8 0 0 0-6 13 8 8 0 0 1 6-3 8 8 0 0 1 6 3 8 8 0 0 0-6-13zm0 2a4 4 0 1 1 0 8 4 4 0 0 1 0-8zm0 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",fill:"currentColor"})})})}),submenu:[{label:"Connect to account",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Open Demo account",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"#CDFDDA",fillRule:"evenodd",d:"M14.5 13.103c1.836 0 3.667.723 5.5 2.14V19l-10.5.5-.5-4.257c1.833-1.417 3.664-2.14 5.5-2.14Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#00AC00",fillRule:"evenodd",d:"M9.53 15.469 9.5 19l10-.477v-3.032c-1.703-1.27-3.365-1.888-5-1.888-1.626 0-3.277.611-4.97 1.866Zm-.836-.622c1.895-1.465 3.83-2.244 5.806-2.244 1.975 0 3.91.78 5.806 2.244l.194.15v4.48l-12.03.545V15.02l.224-.173Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#CDFDDA",fillRule:"evenodd",d:"m7.736 13.701-.734 2.345L7.001 20H4.5a1 1 0 0 1-1-1v-4c1.412-.669 2.824-1.102 4.236-1.299Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#00AC00",fillRule:"evenodd",d:"m7.913 13.678-.475 1.086c-.988.111-1.87.308-2.646.59l-.29.11v3.529H7L7.002 20H4.5a1 1 0 0 1-1-1v-4c1.471-.697 2.942-1.138 4.413-1.322Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#CDFDDA",d:"M14.5 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"}),h.jsx("path",{fill:"#00AC00",fillRule:"evenodd",d:"M14.5 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm0 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#00AC00",d:"M11.471 11.979A4.992 4.992 0 0 1 9.5 8c0-.67.131-1.308.37-1.891a3.5 3.5 0 1 0 1.601 5.87Z"}),h.jsx("path",{fill:"#CDFDDA",d:"M9.586 7.07a2.5 2.5 0 1 0 1.153 4.226A4.981 4.981 0 0 1 9.5 8c0-.318.03-.63.086-.93Z"})]})})})}]},{key:"chart",label:"Chart settings",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M9 3V9H11V18H9V21H7V18H5V9H7V3H9ZM17 3V6H19V16H17V19H15V16H13V6H15V3H17ZM17 8H15V14H17V8Z",stroke:"currentColor"})})})}),submenu:[{label:"Grid",icon:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("g",{clipPath:"url(#a)",children:h.jsx("path",{fillRule:"evenodd","clip-rule":"evenodd",d:"M20 6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6zm-2 3V6h-3v3h3zm-4-3h-4v2.999h4V6zM9 6H6v3l3-.001V6zm-3 4v4l3-.001v-4H6zm0 5v3h3v-3.001H6zm4 3h4v-3.001h-4V18zm5 0h3v-3h-3v3zm3-4v-4h-3v4h3zm-8-.001v-4h4v4h-4z",fill:"currentColor"})})})},{label:"Trade Orders",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M4 9H20V10H4V9Z",fill:"#3183FF"}),h.jsx("path",{d:"M4 17H20V18H4V17Z",fill:"#EA4C4C"}),h.jsx("react",{x:"4",y:"14",width:"5",height:"2",fill:"#EA4C4C"}),h.jsx("react",{x:"4",y:"6",width:"5",height:"2",fill:"#3183FF"})]})})})},{label:"Trade Position",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M16 10L12 5H20L16 10Z",fill:"#D95852"}),h.jsx("path",{d:"M16 10H20V11H4V10H16Z",fill:"#D95852"}),h.jsx("path",{d:"M20 13H4V14H8L4 19H12L8 14H20V13Z",fill:"#4682F7"})]})})})},{label:"Trade History",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M4 19L8 14L12 19H4Z",fill:"#3183FF"}),h.jsx("path",{d:"M7 16L17.5 8",stroke:"#3183FF",strokeDasharray:"2 2"}),h.jsx("path",{d:"M13 5L17 10L21 5H13Z",fill:"#EA4C4C"})]})})})},{label:"SL/TP Levels",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"m4.688 17.773-.375.91c.43.277.911.415 1.445.415.614 0 1.104-.15 1.469-.45.367-.299.55-.68.55-1.144 0-.258-.044-.491-.132-.7a1.568 1.568 0 0 0-.387-.55c-.17-.159-.446-.332-.828-.52-.727-.354-1.09-.695-1.09-1.023 0-.198.064-.358.191-.48.13-.126.313-.188.547-.188.396 0 .772.128 1.129.383l.309-.875c-.31-.248-.796-.371-1.457-.371-.508 0-.925.146-1.25.437a1.421 1.421 0 0 0-.485 1.102c0 .237.04.453.121.648.084.195.2.365.352.508.154.14.45.322.887.543.44.219.73.417.87.594.141.177.212.363.212.558 0 .417-.299.625-.895.625-.388 0-.782-.14-1.184-.422ZM8.68 13.277V19h3.601v-.902H9.695v-4.82H8.68ZM20 20H4v1h16v-1Z",fill:"#EA4C4C"}),h.jsx("path",{d:"M10.5 10V7.895c.193.018.346.027.46.027 1.548 0 2.321-.656 2.321-1.969 0-.588-.21-1.02-.629-1.297-.416-.278-1.076-.418-1.98-.418-.115 0-.51.015-1.188.043V10H10.5Zm0-3.008V5.16c.099-.013.202-.02.309-.02.955 0 1.433.298 1.433.891 0 .35-.107.602-.32.758-.214.154-.552.23-1.016.23-.099 0-.234-.009-.406-.027Z",fill:"#3183FF",fillRule:"evenodd","clip-rule":"evenodd"}),h.jsx("path",{d:"M6.914 10V5.18h1.902v-.903H4.078v.903h1.82V10h1.016ZM20 11H4v1h16v-1Z",fill:"#3183FF"})]})})})},{label:"Ask Price",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"m6.926 14-.418-1.16H4.547L4.148 14H3.02L5.3 8.2h.446l2.3 5.8h-1.12ZM5.523 9.95l-.687 2.113H6.21l-.688-2.114Zm2.86 3.734.375-.91c.4.28.795.421 1.183.421.597 0 .895-.208.895-.625a.886.886 0 0 0-.211-.558c-.14-.177-.431-.375-.871-.594-.438-.221-.733-.402-.887-.543a1.506 1.506 0 0 1-.351-.508 1.682 1.682 0 0 1-.121-.648c0-.443.161-.81.484-1.102.325-.291.742-.437 1.25-.437.661 0 1.147.123 1.457.37l-.309.876a1.909 1.909 0 0 0-1.129-.383c-.234 0-.416.062-.546.187a.635.635 0 0 0-.192.48c0 .33.363.67 1.09 1.024.383.188.659.361.828.52.17.156.298.34.387.55.088.209.133.442.133.7 0 .463-.184.845-.551 1.144-.365.3-.854.45-1.469.45a2.617 2.617 0 0 1-1.445-.414Zm7.613.316-1.594-2.438-.636.872V14H12.75V8.277h1.016v2.739l1.945-2.739h1.156l-1.793 2.5L17.211 14h-1.215ZM3 15h18v1H3z",fill:"#C96057"})})})})},{label:"Chart Controls",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M10 10L20 14L18 16L20 18L18 20L16 18L14 20L10 10Z",fill:"currentColor"}),h.jsx("path",{d:"M11.2574 18.9959C11.1719 18.9986 11.0861 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11C19 11.0599 18.9993 11.1196 18.998 11.1791L16.9574 10.2813C16.6023 7.3064 14.0705 5 11 5C7.68629 5 5 7.68629 5 11C5 14.191 7.49101 16.8002 10.6345 16.9891L11.2574 18.9959Z",fill:"currentColor"})]})})})},{label:"Trade Notification",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Crosshair cursor",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0-6 0",stroke:"currentColor",strokeWidth:"2"}),h.jsx("path",{d:"M12 2v4M12 18v4M2 12h4M18 12h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Show OHLC",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M7 17V7M12 17v-6M17 17v-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}]},{key:"oneclick",label:"One Click Trading",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20.9914 12.3966L18.9885 11.5954C18.7789 7.91769 15.7302 5 12 5C8.13401 5 5 8.13401 5 12C5 15.7302 7.91769 18.7789 11.5954 18.9885L12.3966 20.9914C12.2651 20.9971 12.1329 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 12.1329 20.9971 12.2651 20.9914 12.3966ZM11 11L21 15L19 17L22 20L20 22L17 19L15 21L11 11Z",fill:"currentColor"})})})})},{key:"theme",label:f==="light"?"Dark Theme":"Light Theme",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"m4.408 12.954-2.265-.756a.209.209 0 0 1 0-.396l2.265-.755a.209.209 0 0 1 .276.198v1.51c0 .143-.14.244-.276.198ZM5.959 7.306 4.89 5.17c-.09-.18.1-.37.28-.28l2.136 1.068a.209.209 0 0 1 .054.334L6.293 7.36c-.1.101-.27.074-.334-.054ZM11.802 21.857l-.755-2.265a.209.209 0 0 1 .198-.276h1.51c.143 0 .244.14.198.276l-.755 2.265a.21.21 0 0 1-.396 0ZM11.802 2.143l-.755 2.265a.209.209 0 0 0 .198.276h1.51c.143 0 .244-.14.198-.276l-.755-2.265a.209.209 0 0 0-.396 0ZM18.83 19.11l-2.137-1.068a.209.209 0 0 1-.054-.335l1.068-1.068c.1-.1.27-.073.334.055l1.069 2.136c.09.18-.101.37-.28.28ZM16.693 5.958 18.83 4.89c.18-.09.37.1.28.28l-1.068 2.136a.209.209 0 0 1-.334.054l-1.068-1.068a.209.209 0 0 1 .054-.334ZM4.89 18.83l1.069-2.136a.209.209 0 0 1 .334-.055l1.068 1.068c.101.101.074.271-.054.335L5.171 19.11c-.18.09-.37-.1-.28-.28ZM21.857 12.198l-2.265.755a.209.209 0 0 1-.276-.198v-1.51c0-.143.14-.244.276-.198l2.265.755a.21.21 0 0 1 0 .396Z",fill:"#FEBC5A"}),h.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"#FED05A"})]})})})},{key:"colors",label:"Color Templates",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fillRule:"evenodd",d:"M20.775 8.992C20.922 9.638 21 10.31 21 11a8.354 8.354 0 0 0-.787 0c-1.467.072-2.422.564-3.082 1.283l-1.18-1.65c.761-.718 1.697-1.205 2.81-1.452A7 7 0 1 0 12 18c.396-.001.565-.082.63-.12.07-.042.17-.124.295-.34.218-.375.36-.835.534-1.49l1.518 1.822C14.485 19.102 13.705 20 12 20a9 9 0 1 1 8.775-11.008Z","clip-rule":"evenodd",fill:"currentColor"}),h.jsx("circle",{cx:"8.5",cy:"12.5",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"9.5",cy:"8.5",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"13.5",cy:"7.5",r:"1.5",fill:"currentColor"}),h.jsx("path",{d:"M13.892 14.693c-2.034.46-2.59-1.07-2.892-4.693 3.85.352 5.232 1.05 4.697 3.012L20 17.192s.038 1.023-.361 1.447c-.463.49-1.687.361-1.687.361l-4.06-4.307Z",fill:"currentColor"})]})})}),submenu:[{label:"Green & Red",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M17.0579 5.11914V7.08486H19.0236V17.8963H17.0579V20.8449H15.0922V17.8963H13.1265V7.08486H15.0922V5.11914H17.0579Z",fill:"#ef5350"}),h.jsx("path",{d:"M9.19522 7.08376V3.15234H7.22951V7.08376H5.26379V15.9295H7.22951V20.8438H9.19522V15.9295H11.1609V7.08376H9.19522Z",fill:"#26a69a"})]})})})},{label:"Blue & Red",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M17.0579 5.11914V7.08486H19.0236V17.8963H17.0579V20.8449H15.0922V17.8963H13.1265V7.08486H15.0922V5.11914H17.0579Z",fill:"#ff574d"}),h.jsx("path",{d:"M9.19522 7.08376V3.15234H7.22951V7.08376H5.26379V15.9295H7.22951V20.8438H9.19522V15.9295H11.1609V7.08376H9.19522Z",fill:"#578cf2"})]})})})},{label:"Black & White",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M17.0579 5.11914V7.08486H19.0236V17.8963H17.0579V20.8449H15.0922V17.8963H13.1265V7.08486H15.0922V5.11914H17.0579Z",fill:"#7a7a7a"}),h.jsx("path",{d:"M9.19522 7.08376V3.15234H7.22951V7.08376H5.26379V15.9295H7.22951V20.8438H9.19522V15.9295H11.1609V7.08376H9.19522Z",fill:"#ffffff"})]})})})},{label:"Neutral",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M17.0579 5.11914V7.08486H19.0236V17.8963H17.0579V20.8449H15.0922V17.8963H13.1265V7.08486H15.0922V5.11914H17.0579Z",fill:"#c86a6a"}),h.jsx("path",{d:"M9.19522 7.08376V3.15234H7.22951V7.08376H5.26379V15.9295H7.22951V20.8438H9.19522V15.9295H11.1609V7.08376H9.19522Z",fill:"#76ac85"})]})})})}]},{key:"lang",label:"Language",rightText:"EN",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M17.9 17.39C17.64 16.59 16.89 16 16 16H15V13C15 12.4477 14.5523 12 14 12H8V10H10C10.5523 10 11 9.55228 11 9V7H13C14.1046 7 15 6.10457 15 5V4.59C17.93 5.77 20 8.64 20 12C20 14.08 19.2 15.97 17.9 17.39ZM11 19.93C7.05 19.44 4 16.08 4 12C4 11.38 4.08 10.78 4.21 10.21L9 15V16C9 17.1046 9.89543 18 11 18V19.93ZM12 2C6.47715 2 2 6.47715 2 12C2 14.6522 3.05357 17.1957 4.92893 19.0711C6.8043 20.9464 9.34784 22 12 22C14.6522 22 17.1957 20.9464 19.0711 19.0711C20.9464 17.1957 22 14.6522 22 12C22 9.34784 20.9464 6.8043 19.0711 4.92893C17.1957 3.05357 14.6522 2 12 2Z",fill:"currentColor"})})})}),submenu:[{label:"English",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),h.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Arabic",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),h.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Bulgarian",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Chinese Simplified",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Chinese Traditional",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Czech",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Dutch",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Urdu",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})}]},{key:"shortcuts",label:"Shortcuts",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM11 18H13V16H11V18ZM12 6C9.79 6 8 7.79 8 10H10C10 8.9 10.9 8 12 8C13.1 8 14 8.9 14 10C14 12 11 11.75 11 15H13C13 12.75 16 12.5 16 10C16 7.79 14.21 6 12 6Z",fill:"currentColor"})})})})},{key:"contact",label:"Contact us",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M5 4C3.89543 4 3 4.89543 3 6V15C3 16.1046 3.89543 17 5 17H5.98719L6 21L13 17H19C20.1046 17 21 16.1046 21 15V6C21 4.89543 20.1046 4 19 4H5ZM6 6H18C18.5128 6 18.9355 6.38604 18.9933 6.88338L19 7V14C19 14.5128 18.614 14.9355 18.1166 14.9933L18 15H12.5339C12.4234 15 12.314 15.0183 12.21 15.0539L12.108 15.0952L8 17.0289V16C8 15.4872 7.61396 15.0645 7.11662 15.0067L7 15H6C5.48716 15 5.06449 14.614 5.00673 14.1166L5 14V7C5 6.48716 5.38604 6.06449 5.88338 6.00673L6 6Z",fillRule:"evenodd","clip-rule":"evenodd",fill:"currentColor"})})})})},{key:"about",label:"About program",icon:h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Z",stroke:"currentColor",strokeWidth:"2"}),h.jsx("path",{d:"M12 10v7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M12 7h.01",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}],CA=({item:J})=>{const q=!!J.submenu?.length;return h.jsxs("div",{className:"relative",onMouseEnter:()=>{IA.current&&(clearTimeout(IA.current),IA.current=null),q&&F(J.key)},onMouseLeave:()=>{q&&(IA.current=setTimeout(()=>F(null),120))},children:[h.jsxs("button",{type:"button",onClick:()=>{q?F(yA=>yA===J.key?null:J.key):(J.key==="theme"&&g(yA=>yA==="light"?"dark":"light"),m(!1),F(null))},className:`w-full flex items-center gap-3 px-4 py-2.5 text-left text-[13px] ${aA?"text-slate-700 hover:bg-slate-100":"text-slate-200 hover:bg-[#202933]"}`,children:[h.jsx("span",{className:`w-5 h-5 flex shrink-0 items-center justify-center ${aA?"text-slate-500":"text-slate-400"}`,children:J.icon}),h.jsx("span",{className:"flex-1 text-[15px]",children:J.label}),J.rightText&&h.jsx("span",{className:`text-xs ${aA?"text-slate-500":"text-slate-400"}`,children:J.rightText}),q&&h.jsx("svg",{className:`w-4 h-4 ${aA?"text-slate-500":"text-slate-400"}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M9 6l6 6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),q&&E===J.key&&h.jsx("div",{className:`absolute top-0 left-full ml-0 w-52 min-w-44 rounded-md shadow-2xl overflow-hidden z-100 border ${aA?"bg-white border-slate-200":"bg-[#262F3F] border-white/10"}`,children:h.jsx("div",{className:"py-1",children:J.submenu.map((yA,BA)=>{const EA=X[J.key]===yA.label||yA.selected&&X[J.key]==null;return h.jsxs("button",{type:"button",onClick:()=>{fA(WA=>({...WA,[J.key]:yA.label})),console.log("Sub selected:",J.key,yA.label)},className:`w-full flex items-center gap-3 pl-3 pr-3 py-2 text-[13px] text-left ${aA?"text-slate-700 hover:bg-slate-100":"text-slate-200 hover:bg-[#202933]"}`,children:[h.jsx("span",{className:`w-5 h-5 flex shrink-0 items-center justify-center ${aA?"text-slate-500":"text-slate-400"}`,children:yA.icon||null}),h.jsx("span",{className:"flex-1 min-w-0",children:yA.label}),EA&&h.jsx("span",{className:"w-5 h-5 flex shrink-0 items-center justify-center text-emerald-400",children:h.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},BA)})})})]})},aA=f==="light";return h.jsxs("div",{className:"relative h-full",children:[h.jsxs("div",{className:`w-12 flex flex-col items-center py-3 h-full border-r ${aA?"bg-white border-slate-200":"bg-[#12161d] border-slate-700"}`,children:[h.jsx("div",{className:"flex flex-col items-center gap-2",children:SA.map((J,q)=>h.jsxs(O.Fragment,{children:[q===2?h.jsxs("div",{className:"relative",children:[h.jsx("button",{onClick:()=>{const yA=ti[z].toolId;i(t===yA?null:yA)},className:`relative w-10 h-10 flex items-center justify-center transition-colors duration-150
15
- ${t===ti[z].toolId?aA?"text-sky-600 hover:bg-sky-100":"text-sky-300 hover:bg-slate-700":aA?"text-slate-600 hover:bg-sky-100":"text-slate-400 hover:bg-slate-700"}`,title:ti[z].label,children:ti[z].icon}),h.jsx("span",{onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1),onMouseDown:yA=>{yA.stopPropagation(),P(BA=>!BA)},style:{position:"absolute",bottom:1,right:1,width:V?10:7,height:V?10:7,cursor:"pointer",transition:"width 0.12s, height 0.12s",display:"flex",alignItems:"center",justifyContent:"center"},title:"More line tools",children:h.jsx("svg",{viewBox:"0 0 10 10",width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("polygon",{points:"10,10 0,10 10,0",fill:aA?"#64748b":"#94a3b8"})})})]}):h.jsx("button",{onClick:()=>MA(q),className:`w-10 h-10 flex items-center justify-center transition-colors duration-150
16
- ${J.label==="Grid"&&s||J.label==="Eye"&&!u||J.label==="Lock"&&B||t===q?aA?"text-sky-600 hover:bg-sky-100":"text-sky-300 hover:bg-slate-700":aA?"text-slate-600 hover:bg-sky-100":"text-slate-400 hover:bg-slate-700"}`,title:`${J.label}: ${J.description}`,children:J.icon}),J.label==="Text"&&h.jsx("div",{className:`w-8 border-t my-1 ${aA?"border-slate-200":"border-slate-700"}`})]},J.label))}),h.jsx("div",{className:"flex-1"}),h.jsx("div",{className:"flex flex-col items-center gap-2 pb-1",children:UA.map((J,q)=>{const yA=12+q;return h.jsx("button",{onClick:()=>MA(yA),className:`w-10 h-10 flex items-center justify-center transition-colors duration-150
17
- ${J.label==="Grid"&&s||J.label==="Eye"&&!u||J.label==="Lock"&&B||t===yA?aA?"text-sky-600 hover:bg-sky-100":"text-sky-300 hover:bg-slate-700":aA?"text-slate-600 hover:bg-sky-100":"text-slate-400 hover:bg-slate-700"}`,title:`${J.label}: ${J.description}`,children:J.icon},J.label)})})]}),S&&h.jsx(ub,{top:84,panelRef:pA,isLight:aA,children:ti.map((J,q)=>{const yA=z===q;return h.jsxs("button",{type:"button",onMouseDown:BA=>{BA.stopPropagation(),eA(q),i(J.toolId),P(!1)},className:`w-full flex items-center gap-3 px-4 py-2.5 text-[13px] text-left ${aA?"text-slate-700 hover:bg-slate-100":"text-slate-200 hover:bg-[#202933]"}`,children:[h.jsx("span",{className:`w-5 h-5 flex shrink-0 items-center justify-center ${aA?"text-slate-500":"text-slate-400"}`,children:J.icon}),h.jsx("span",{className:"flex-1",children:J.label}),yA&&h.jsx("span",{className:"w-4 h-4 flex shrink-0 items-center justify-center text-emerald-400",children:h.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},J.toolId)})}),Q&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20",onClick:()=>{m(!1),F(null)},"aria-hidden":"true"}),h.jsxs("div",{ref:oA,className:`absolute left-12 top-2 z-[999] w-68 border shadow-2xl overflow-visible ${aA?"bg-white border-slate-200":"bg-[#262F3F] border-white/10"}`,children:[h.jsxs("div",{className:`relative px-4 py-3 border-b overflow-hidden ${aA?"bg-white border-slate-200":"border-white/10 bg-[#262F3F]"}`,children:[h.jsx("div",{className:`z-[999]text-[16px] font-medium pr-12 ${aA?"text-slate-800":"text-slate-100"}`,children:A||"MT5 Account"}),h.jsx("div",{className:`text-[12px] mt-0.5 ${aA?"text-slate-500":"text-slate-400"}`,children:r})]}),h.jsx("div",{className:"py-2",children:bA.map(J=>h.jsx(CA,{item:J},J.key))})]})]})]})};function fb(r){return Ir({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M337.509 305.372h-17.501l-6.571-5.486c20.791-25.232 33.922-57.054 33.922-93.257C347.358 127.632 283.896 64 205.135 64 127.452 64 64 127.632 64 206.629s63.452 142.628 142.225 142.628c35.011 0 67.831-13.167 92.991-34.008l6.561 5.487v17.551L415.18 448 448 415.086 337.509 305.372zm-131.284 0c-54.702 0-98.463-43.887-98.463-98.743 0-54.858 43.761-98.742 98.463-98.742 54.7 0 98.462 43.884 98.462 98.742 0 54.856-43.762 98.743-98.462 98.743z"},child:[]}]})(r)}const pb=({width:r=256,symbols:A=[],selectedSymbol:e,onSymbolSelect:t,symbolsLoading:i=!1,isOpen:s})=>{const{theme:n}=Be(),o=n==="light",[a,l]=O.useState(""),c=A.filter(B=>B.symbol.toLowerCase().includes(a.toLowerCase())),u=c.filter(B=>!B.symbol.toUpperCase().endsWith("USDT")),d=c.filter(B=>B.symbol.toUpperCase().endsWith("USDT"));return h.jsxs(h.Fragment,{children:[h.jsx("style",{children:`
9
+ }`,tv=function(r){rv(r,"."+zo+Av+xu+`
10
+ .`+Go+ev+xu)},rv=function(r,A){var e=r.ownerDocument;if(e){var t=e.createElement("style");t.textContent=A,r.appendChild(t)}},Tu=(function(){function r(){}return r.getOrigin=function(A){var e=r._link;return e?(e.href=A,e.href=e.href,e.protocol+e.hostname+e.port):"about:blank"},r.isSameOrigin=function(A){return r.getOrigin(A)===r._origin},r.setContext=function(A){r._link=A.document.createElement("a"),r._origin=r.getOrigin(A.location.href)},r._origin="about:blank",r})(),iv=(function(){function r(A,e){this.context=A,this._options=e,this._cache={}}return r.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)||(Wo(A)||av(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),e},r.prototype.match=function(A){return this._cache[A]},r.prototype.loadImage=function(A){return be(this,void 0,void 0,function(){var e,t,i,s,n=this;return me(this,function(o){switch(o.label){case 0:return e=Tu.isSameOrigin(A),t=!Ro(A)&&this._options.useCORS===!0&&fe.SUPPORT_CORS_IMAGES&&!e,i=!Ro(A)&&!e&&!Wo(A)&&typeof this._options.proxy=="string"&&fe.SUPPORT_CORS_XHR&&!t,!e&&this._options.allowTaint===!1&&!Ro(A)&&!Wo(A)&&!i&&!t?[2]:(s=A,i?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(a,l){var c=new Image;c.onload=function(){return a(c)},c.onerror=l,(lv(s)||t)&&(c.crossOrigin="anonymous"),c.src=s,c.complete===!0&&setTimeout(function(){return a(c)},500),n._options.imageTimeout>0&&setTimeout(function(){return l("Timed out ("+n._options.imageTimeout+"ms) loading image")},n._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},r.prototype.has=function(A){return typeof this._cache[A]<"u"},r.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},r.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var i=A.substring(0,256);return new Promise(function(s,n){var o=fe.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(a.status===200)if(o==="text")s(a.response);else{var u=new FileReader;u.addEventListener("load",function(){return s(u.result)},!1),u.addEventListener("error",function(d){return n(d)},!1),u.readAsDataURL(a.response)}else n("Failed to proxy resource "+i+" with status code "+a.status)},a.onerror=n;var l=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+l+"url="+encodeURIComponent(A)+"&responseType="+o),o!=="text"&&a instanceof XMLHttpRequest&&(a.responseType=o),e._options.imageTimeout){var c=e._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return n("Timed out ("+c+"ms) proxying "+i)}}a.send()})},r})(),sv=/^data:image\/svg\+xml/i,nv=/^data:image\/.*;base64,/i,ov=/^data:image\/.*/i,av=function(r){return fe.SUPPORT_SVG_DRAWING||!cv(r)},Ro=function(r){return ov.test(r)},lv=function(r){return nv.test(r)},Wo=function(r){return r.substr(0,4)==="blob"},cv=function(r){return r.substr(-3).toLowerCase()==="svg"||sv.test(r)},dA=(function(){function r(A,e){this.type=0,this.x=A,this.y=e}return r.prototype.add=function(A,e){return new r(this.x+A,this.y+e)},r})(),cr=function(r,A,e){return new dA(r.x+(A.x-r.x)*e,r.y+(A.y-r.y)*e)},Hs=(function(){function r(A,e,t,i){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=i}return r.prototype.subdivide=function(A,e){var t=cr(this.start,this.startControl,A),i=cr(this.startControl,this.endControl,A),s=cr(this.endControl,this.end,A),n=cr(t,i,A),o=cr(i,s,A),a=cr(n,o,A);return e?new r(this.start,t,n,a):new r(a,o,s,this.end)},r.prototype.add=function(A,e){return new r(this.start.add(A,e),this.startControl.add(A,e),this.endControl.add(A,e),this.end.add(A,e))},r.prototype.reverse=function(){return new r(this.end,this.endControl,this.startControl,this.start)},r})(),Pe=function(r){return r.type===1},hv=(function(){function r(A){var e=A.styles,t=A.bounds,i=Xr(e.borderTopLeftRadius,t.width,t.height),s=i[0],n=i[1],o=Xr(e.borderTopRightRadius,t.width,t.height),a=o[0],l=o[1],c=Xr(e.borderBottomRightRadius,t.width,t.height),u=c[0],d=c[1],B=Xr(e.borderBottomLeftRadius,t.width,t.height),p=B[0],f=B[1],w=[];w.push((s+a)/t.width),w.push((p+u)/t.width),w.push((n+f)/t.height),w.push((l+d)/t.height);var F=Math.max.apply(Math,w);F>1&&(s/=F,n/=F,a/=F,l/=F,u/=F,d/=F,p/=F,f/=F);var C=t.width-a,E=t.height-d,U=t.width-u,S=t.height-f,P=e.borderTopWidth,z=e.borderRightWidth,J=e.borderBottomWidth,N=e.borderLeftWidth,Z=RA(e.paddingTop,A.bounds.width),W=RA(e.paddingRight,A.bounds.width),aA=RA(e.paddingBottom,A.bounds.width),nA=RA(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||n>0?ZA(t.left+N/3,t.top+P/3,s-N/3,n-P/3,PA.TOP_LEFT):new dA(t.left+N/3,t.top+P/3),this.topRightBorderDoubleOuterBox=s>0||n>0?ZA(t.left+C,t.top+P/3,a-z/3,l-P/3,PA.TOP_RIGHT):new dA(t.left+t.width-z/3,t.top+P/3),this.bottomRightBorderDoubleOuterBox=u>0||d>0?ZA(t.left+U,t.top+E,u-z/3,d-J/3,PA.BOTTOM_RIGHT):new dA(t.left+t.width-z/3,t.top+t.height-J/3),this.bottomLeftBorderDoubleOuterBox=p>0||f>0?ZA(t.left+N/3,t.top+S,p-N/3,f-J/3,PA.BOTTOM_LEFT):new dA(t.left+N/3,t.top+t.height-J/3),this.topLeftBorderDoubleInnerBox=s>0||n>0?ZA(t.left+N*2/3,t.top+P*2/3,s-N*2/3,n-P*2/3,PA.TOP_LEFT):new dA(t.left+N*2/3,t.top+P*2/3),this.topRightBorderDoubleInnerBox=s>0||n>0?ZA(t.left+C,t.top+P*2/3,a-z*2/3,l-P*2/3,PA.TOP_RIGHT):new dA(t.left+t.width-z*2/3,t.top+P*2/3),this.bottomRightBorderDoubleInnerBox=u>0||d>0?ZA(t.left+U,t.top+E,u-z*2/3,d-J*2/3,PA.BOTTOM_RIGHT):new dA(t.left+t.width-z*2/3,t.top+t.height-J*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||f>0?ZA(t.left+N*2/3,t.top+S,p-N*2/3,f-J*2/3,PA.BOTTOM_LEFT):new dA(t.left+N*2/3,t.top+t.height-J*2/3),this.topLeftBorderStroke=s>0||n>0?ZA(t.left+N/2,t.top+P/2,s-N/2,n-P/2,PA.TOP_LEFT):new dA(t.left+N/2,t.top+P/2),this.topRightBorderStroke=s>0||n>0?ZA(t.left+C,t.top+P/2,a-z/2,l-P/2,PA.TOP_RIGHT):new dA(t.left+t.width-z/2,t.top+P/2),this.bottomRightBorderStroke=u>0||d>0?ZA(t.left+U,t.top+E,u-z/2,d-J/2,PA.BOTTOM_RIGHT):new dA(t.left+t.width-z/2,t.top+t.height-J/2),this.bottomLeftBorderStroke=p>0||f>0?ZA(t.left+N/2,t.top+S,p-N/2,f-J/2,PA.BOTTOM_LEFT):new dA(t.left+N/2,t.top+t.height-J/2),this.topLeftBorderBox=s>0||n>0?ZA(t.left,t.top,s,n,PA.TOP_LEFT):new dA(t.left,t.top),this.topRightBorderBox=a>0||l>0?ZA(t.left+C,t.top,a,l,PA.TOP_RIGHT):new dA(t.left+t.width,t.top),this.bottomRightBorderBox=u>0||d>0?ZA(t.left+U,t.top+E,u,d,PA.BOTTOM_RIGHT):new dA(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=p>0||f>0?ZA(t.left,t.top+S,p,f,PA.BOTTOM_LEFT):new dA(t.left,t.top+t.height),this.topLeftPaddingBox=s>0||n>0?ZA(t.left+N,t.top+P,Math.max(0,s-N),Math.max(0,n-P),PA.TOP_LEFT):new dA(t.left+N,t.top+P),this.topRightPaddingBox=a>0||l>0?ZA(t.left+Math.min(C,t.width-z),t.top+P,C>t.width+z?0:Math.max(0,a-z),Math.max(0,l-P),PA.TOP_RIGHT):new dA(t.left+t.width-z,t.top+P),this.bottomRightPaddingBox=u>0||d>0?ZA(t.left+Math.min(U,t.width-N),t.top+Math.min(E,t.height-J),Math.max(0,u-z),Math.max(0,d-J),PA.BOTTOM_RIGHT):new dA(t.left+t.width-z,t.top+t.height-J),this.bottomLeftPaddingBox=p>0||f>0?ZA(t.left+N,t.top+Math.min(S,t.height-J),Math.max(0,p-N),Math.max(0,f-J),PA.BOTTOM_LEFT):new dA(t.left+N,t.top+t.height-J),this.topLeftContentBox=s>0||n>0?ZA(t.left+N+nA,t.top+P+Z,Math.max(0,s-(N+nA)),Math.max(0,n-(P+Z)),PA.TOP_LEFT):new dA(t.left+N+nA,t.top+P+Z),this.topRightContentBox=a>0||l>0?ZA(t.left+Math.min(C,t.width+N+nA),t.top+P+Z,C>t.width+N+nA?0:a-N+nA,l-(P+Z),PA.TOP_RIGHT):new dA(t.left+t.width-(z+W),t.top+P+Z),this.bottomRightContentBox=u>0||d>0?ZA(t.left+Math.min(U,t.width-(N+nA)),t.top+Math.min(E,t.height+P+Z),Math.max(0,u-(z+W)),d-(J+aA),PA.BOTTOM_RIGHT):new dA(t.left+t.width-(z+W),t.top+t.height-(J+aA)),this.bottomLeftContentBox=p>0||f>0?ZA(t.left+N+nA,t.top+S,Math.max(0,p-(N+nA)),f-(J+aA),PA.BOTTOM_LEFT):new dA(t.left+N+nA,t.top+t.height-(J+aA))}return r})(),PA;(function(r){r[r.TOP_LEFT=0]="TOP_LEFT",r[r.TOP_RIGHT=1]="TOP_RIGHT",r[r.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",r[r.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(PA||(PA={}));var ZA=function(r,A,e,t,i){var s=4*((Math.sqrt(2)-1)/3),n=e*s,o=t*s,a=r+e,l=A+t;switch(i){case PA.TOP_LEFT:return new Hs(new dA(r,l),new dA(r,l-o),new dA(a-n,A),new dA(a,A));case PA.TOP_RIGHT:return new Hs(new dA(r,A),new dA(r+n,A),new dA(a,l-o),new dA(a,l));case PA.BOTTOM_RIGHT:return new Hs(new dA(a,A),new dA(a,A+o),new dA(r+n,l),new dA(r,l));case PA.BOTTOM_LEFT:default:return new Hs(new dA(a,l),new dA(a-n,l),new dA(r,A+o),new dA(r,A))}},Ls=function(r){return[r.topLeftBorderBox,r.topRightBorderBox,r.bottomRightBorderBox,r.bottomLeftBorderBox]},uv=function(r){return[r.topLeftContentBox,r.topRightContentBox,r.bottomRightContentBox,r.bottomLeftContentBox]},Is=function(r){return[r.topLeftPaddingBox,r.topRightPaddingBox,r.bottomRightPaddingBox,r.bottomLeftPaddingBox]},dv=(function(){function r(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6}return r})(),Ms=(function(){function r(A,e){this.path=A,this.target=e,this.type=1}return r})(),fv=(function(){function r(A){this.opacity=A,this.type=2,this.target=6}return r})(),pv=function(r){return r.type===0},Su=function(r){return r.type===1},gv=function(r){return r.type===2},Hu=function(r,A){return r.length===A.length?r.some(function(e,t){return e===A[t]}):!1},Bv=function(r,A,e,t,i){return r.map(function(s,n){switch(n){case 0:return s.add(A,e);case 1:return s.add(A+t,e);case 2:return s.add(A+t,e+i);case 3:return s.add(A,e+i)}return s})},Lu=(function(){function r(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return r})(),Iu=(function(){function r(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new hv(this.container),this.container.styles.opacity<1&&this.effects.push(new fv(this.container.styles.opacity)),this.container.styles.transform!==null){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new dv(t,i,s))}if(this.container.styles.overflowX!==0){var n=Ls(this.curves),o=Is(this.curves);Hu(n,o)?this.effects.push(new Ms(n,6)):(this.effects.push(new Ms(n,2)),this.effects.push(new Ms(o,4)))}}return r.prototype.getEffects=function(A){for(var e=[2,3].indexOf(this.container.styles.position)===-1,t=this.parent,i=this.effects.slice(0);t;){var s=t.effects.filter(function(a){return!Su(a)});if(e||t.container.styles.position!==0||!t.parent){if(i.unshift.apply(i,s),e=[2,3].indexOf(t.container.styles.position)===-1,t.container.styles.overflowX!==0){var n=Ls(t.curves),o=Is(t.curves);Hu(n,o)||i.unshift(new Ms(o,6))}}else i.unshift.apply(i,s);t=t.parent}return i.filter(function(a){return oe(a.target,A)})},r})(),$o=function(r,A,e,t){r.container.elements.forEach(function(i){var s=oe(i.flags,4),n=oe(i.flags,2),o=new Iu(i,r);oe(i.styles.display,2048)&&t.push(o);var a=oe(i.flags,8)?[]:t;if(s||n){var l=s||i.styles.isPositioned()?e:A,c=new Lu(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var u=i.styles.zIndex.order;if(u<0){var d=0;l.negativeZIndex.some(function(p,f){return u>p.element.container.styles.zIndex.order?(d=f,!1):d>0}),l.negativeZIndex.splice(d,0,c)}else if(u>0){var B=0;l.positiveZIndex.some(function(p,f){return u>=p.element.container.styles.zIndex.order?(B=f+1,!1):B>0}),l.positiveZIndex.splice(B,0,c)}else l.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else i.styles.isFloating()?l.nonPositionedFloats.push(c):l.nonPositionedInlineLevel.push(c);$o(o,c,s?c:e,a)}else i.styles.isInlineLevel()?A.inlineLevel.push(o):A.nonInlineLevel.push(o),$o(o,A,e,a);oe(i.flags,8)&&Mu(i,a)})},Mu=function(r,A){for(var e=r instanceof _o?r.start:1,t=r instanceof _o?r.reversed:!1,i=0;i<A.length;i++){var s=A[i];s.container instanceof su&&typeof s.container.value=="number"&&s.container.value!==0&&(e=s.container.value),s.listValue=Ai(e,s.container.styles.listStyleType,!0),e+=t?-1:1}},wv=function(r){var A=new Iu(r,null),e=new Lu(A),t=[];return $o(A,e,e,t),Mu(A.container,t),e},Du=function(r,A){switch(A){case 0:return ze(r.topLeftBorderBox,r.topLeftPaddingBox,r.topRightBorderBox,r.topRightPaddingBox);case 1:return ze(r.topRightBorderBox,r.topRightPaddingBox,r.bottomRightBorderBox,r.bottomRightPaddingBox);case 2:return ze(r.bottomRightBorderBox,r.bottomRightPaddingBox,r.bottomLeftBorderBox,r.bottomLeftPaddingBox);default:return ze(r.bottomLeftBorderBox,r.bottomLeftPaddingBox,r.topLeftBorderBox,r.topLeftPaddingBox)}},mv=function(r,A){switch(A){case 0:return ze(r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox,r.topRightBorderBox,r.topRightBorderDoubleOuterBox);case 1:return ze(r.topRightBorderBox,r.topRightBorderDoubleOuterBox,r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox);case 2:return ze(r.bottomRightBorderBox,r.bottomRightBorderDoubleOuterBox,r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox);default:return ze(r.bottomLeftBorderBox,r.bottomLeftBorderDoubleOuterBox,r.topLeftBorderBox,r.topLeftBorderDoubleOuterBox)}},Cv=function(r,A){switch(A){case 0:return ze(r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox,r.topRightBorderDoubleInnerBox,r.topRightPaddingBox);case 1:return ze(r.topRightBorderDoubleInnerBox,r.topRightPaddingBox,r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox);case 2:return ze(r.bottomRightBorderDoubleInnerBox,r.bottomRightPaddingBox,r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox);default:return ze(r.bottomLeftBorderDoubleInnerBox,r.bottomLeftPaddingBox,r.topLeftBorderDoubleInnerBox,r.topLeftPaddingBox)}},vv=function(r,A){switch(A){case 0:return Ds(r.topLeftBorderStroke,r.topRightBorderStroke);case 1:return Ds(r.topRightBorderStroke,r.bottomRightBorderStroke);case 2:return Ds(r.bottomRightBorderStroke,r.bottomLeftBorderStroke);default:return Ds(r.bottomLeftBorderStroke,r.topLeftBorderStroke)}},Ds=function(r,A){var e=[];return Pe(r)?e.push(r.subdivide(.5,!1)):e.push(r),Pe(A)?e.push(A.subdivide(.5,!0)):e.push(A),e},ze=function(r,A,e,t){var i=[];return Pe(r)?i.push(r.subdivide(.5,!1)):i.push(r),Pe(e)?i.push(e.subdivide(.5,!0)):i.push(e),Pe(t)?i.push(t.subdivide(.5,!0).reverse()):i.push(t),Pe(A)?i.push(A.subdivide(.5,!1).reverse()):i.push(A),i},_u=function(r){var A=r.bounds,e=r.styles;return A.add(e.borderLeftWidth,e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth),-(e.borderTopWidth+e.borderBottomWidth))},_s=function(r){var A=r.styles,e=r.bounds,t=RA(A.paddingLeft,e.width),i=RA(A.paddingRight,e.width),s=RA(A.paddingTop,e.width),n=RA(A.paddingBottom,e.width);return e.add(t+A.borderLeftWidth,s+A.borderTopWidth,-(A.borderRightWidth+A.borderLeftWidth+t+i),-(A.borderTopWidth+A.borderBottomWidth+s+n))},bv=function(r,A){return r===0?A.bounds:r===2?_s(A):_u(A)},yv=function(r,A){return r===0?A.bounds:r===2?_s(A):_u(A)},Xo=function(r,A,e){var t=bv(ur(r.styles.backgroundOrigin,A),r),i=yv(ur(r.styles.backgroundClip,A),r),s=Qv(ur(r.styles.backgroundSize,A),e,t),n=s[0],o=s[1],a=Xr(ur(r.styles.backgroundPosition,A),t.width-n,t.height-o),l=Fv(ur(r.styles.backgroundRepeat,A),a,s,t,i),c=Math.round(t.left+a[0]),u=Math.round(t.top+a[1]);return[l,c,u,n,o]},hr=function(r){return GA(r)&&r.value===nr.AUTO},ks=function(r){return typeof r=="number"},Qv=function(r,A,e){var t=A[0],i=A[1],s=A[2],n=r[0],o=r[1];if(!n)return[0,0];if(se(n)&&o&&se(o))return[RA(n,e.width),RA(o,e.height)];var a=ks(s);if(GA(n)&&(n.value===nr.CONTAIN||n.value===nr.COVER)){if(ks(s)){var l=e.width/e.height;return l<s!=(n.value===nr.COVER)?[e.width,e.width/s]:[e.height*s,e.height]}return[e.width,e.height]}var c=ks(t),u=ks(i),d=c||u;if(hr(n)&&(!o||hr(o))){if(c&&u)return[t,i];if(!a&&!d)return[e.width,e.height];if(d&&a){var B=c?t:i*s,p=u?i:t/s;return[B,p]}var f=c?t:e.width,w=u?i:e.height;return[f,w]}if(a){var F=0,C=0;return se(n)?F=RA(n,e.width):se(o)&&(C=RA(o,e.height)),hr(n)?F=C*s:(!o||hr(o))&&(C=F/s),[F,C]}var E=null,U=null;if(se(n)?E=RA(n,e.width):o&&se(o)&&(U=RA(o,e.height)),E!==null&&(!o||hr(o))&&(U=c&&u?E/t*i:e.height),U!==null&&hr(n)&&(E=c&&u?U/i*t:e.width),E!==null&&U!==null)return[E,U];throw new Error("Unable to calculate background-size for element")},ur=function(r,A){var e=r[A];return typeof e>"u"?r[0]:e},Fv=function(r,A,e,t,i){var s=A[0],n=A[1],o=e[0],a=e[1];switch(r){case 2:return[new dA(Math.round(t.left),Math.round(t.top+n)),new dA(Math.round(t.left+t.width),Math.round(t.top+n)),new dA(Math.round(t.left+t.width),Math.round(a+t.top+n)),new dA(Math.round(t.left),Math.round(a+t.top+n))];case 3:return[new dA(Math.round(t.left+s),Math.round(t.top)),new dA(Math.round(t.left+s+o),Math.round(t.top)),new dA(Math.round(t.left+s+o),Math.round(t.height+t.top)),new dA(Math.round(t.left+s),Math.round(t.height+t.top))];case 1:return[new dA(Math.round(t.left+s),Math.round(t.top+n)),new dA(Math.round(t.left+s+o),Math.round(t.top+n)),new dA(Math.round(t.left+s+o),Math.round(t.top+n+a)),new dA(Math.round(t.left+s),Math.round(t.top+n+a))];default:return[new dA(Math.round(i.left),Math.round(i.top)),new dA(Math.round(i.left+i.width),Math.round(i.top)),new dA(Math.round(i.left+i.width),Math.round(i.height+i.top)),new dA(Math.round(i.left),Math.round(i.height+i.top))]}},Uv="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ku="Hidden Text",Ev=(function(){function r(A){this._data={},this._document=A}return r.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),i=this._document.createElement("img"),s=this._document.createElement("span"),n=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",n.appendChild(t),i.src=Uv,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",s.style.fontFamily=A,s.style.fontSize=e,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(ku)),t.appendChild(s),t.appendChild(i);var o=i.offsetTop-s.offsetTop+2;t.removeChild(s),t.appendChild(this._document.createTextNode(ku)),t.style.lineHeight="normal",i.style.verticalAlign="super";var a=i.offsetTop-t.offsetTop+2;return n.removeChild(t),{baseline:o,middle:a}},r.prototype.getMetrics=function(A,e){var t=A+" "+e;return typeof this._data[t]>"u"&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},r})(),Ou=(function(){function r(A,e){this.context=A,this.options=e}return r})(),xv=1e4,Tv=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i._activeEffects=[],i.canvas=t.canvas?t.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),t.canvas||(i.canvas.width=Math.floor(t.width*t.scale),i.canvas.height=Math.floor(t.height*t.scale),i.canvas.style.width=t.width+"px",i.canvas.style.height=t.height+"px"),i.fontMetrics=new Ev(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-t.x,-t.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),i}return A.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach(function(i){return t.applyEffect(i)})},A.prototype.applyEffect=function(e){this.ctx.save(),gv(e)&&(this.ctx.globalAlpha=e.opacity),pv(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Su(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},A.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},A.prototype.renderStack=function(e){return be(this,void 0,void 0,function(){var t;return me(this,function(i){switch(i.label){case 0:return t=e.element.container.styles,t.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},A.prototype.renderNode=function(e){return be(this,void 0,void 0,function(){return me(this,function(t){switch(t.label){case 0:if(oe(e.container.flags,16))debugger;return e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})},A.prototype.renderTextWithLetterSpacing=function(e,t,i){var s=this;if(t===0)this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+i);else{var n=Do(e.text);n.reduce(function(o,a){return s.ctx.fillText(a,o,e.bounds.top+i),o+s.ctx.measureText(a).width},e.bounds.left)}},A.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(n){return n==="normal"||n==="small-caps"}).join(""),i=Mv(e.fontFamily).join(", "),s=$r(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,s,i].join(" "),i,s]},A.prototype.renderTextNode=function(e,t){return be(this,void 0,void 0,function(){var i,s,n,o,a,l,c,u,d=this;return me(this,function(B){return i=this.createFontStyle(t),s=i[0],n=i[1],o=i[2],this.ctx.font=s,this.ctx.direction=t.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(n,o),l=a.baseline,c=a.middle,u=t.paintOrder,e.textBounds.forEach(function(p){u.forEach(function(f){switch(f){case 0:d.ctx.fillStyle=ce(t.color),d.renderTextWithLetterSpacing(p,t.letterSpacing,l);var w=t.textShadow;w.length&&p.text.trim().length&&(w.slice(0).reverse().forEach(function(F){d.ctx.shadowColor=ce(F.color),d.ctx.shadowOffsetX=F.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=F.offsetY.number*d.options.scale,d.ctx.shadowBlur=F.blur.number,d.renderTextWithLetterSpacing(p,t.letterSpacing,l)}),d.ctx.shadowColor="",d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),t.textDecorationLine.length&&(d.ctx.fillStyle=ce(t.textDecorationColor||t.color),t.textDecorationLine.forEach(function(F){switch(F){case 1:d.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top+l),p.bounds.width,1);break;case 2:d.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top),p.bounds.width,1);break;case 3:d.ctx.fillRect(p.bounds.left,Math.ceil(p.bounds.top+c),p.bounds.width,1);break}}));break;case 1:t.webkitTextStrokeWidth&&p.text.trim().length&&(d.ctx.strokeStyle=ce(t.webkitTextStrokeColor),d.ctx.lineWidth=t.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?"miter":"round",d.ctx.strokeText(p.text,p.bounds.left,p.bounds.top+l)),d.ctx.strokeStyle="",d.ctx.lineWidth=0,d.ctx.lineJoin="miter";break}})}),[2]})})},A.prototype.renderReplacedElement=function(e,t,i){if(i&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var s=_s(e),n=Is(t);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,e.intrinsicWidth,e.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},A.prototype.renderNodeContent=function(e){return be(this,void 0,void 0,function(){var t,i,s,n,o,a,C,C,l,c,u,d,U,B,p,S,f,w,F,C,E,U,S;return me(this,function(P){switch(P.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,i=e.curves,s=t.styles,n=0,o=t.textNodes,P.label=1;case 1:return n<o.length?(a=o[n],[4,this.renderTextNode(a,s)]):[3,4];case 2:P.sent(),P.label=3;case 3:return n++,[3,1];case 4:if(!(t instanceof tu))return[3,8];P.label=5;case 5:return P.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return C=P.sent(),this.renderReplacedElement(t,i,C),[3,8];case 7:return P.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof ru&&this.renderReplacedElement(t,i,t.canvas),!(t instanceof iu))return[3,12];P.label=9;case 9:return P.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return C=P.sent(),this.renderReplacedElement(t,i,C),[3,12];case 11:return P.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof lu&&t.tree?(l=new A(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}),[4,l.render(t.tree)]):[3,14];case 13:c=P.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),P.label=14;case 14:if(t instanceof ko&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===Fs?t.checked&&(this.ctx.save(),this.path([new dA(t.bounds.left+u*.39363,t.bounds.top+u*.79),new dA(t.bounds.left+u*.16,t.bounds.top+u*.5549),new dA(t.bounds.left+u*.27347,t.bounds.top+u*.44071),new dA(t.bounds.left+u*.39694,t.bounds.top+u*.5649),new dA(t.bounds.left+u*.72983,t.bounds.top+u*.23),new dA(t.bounds.left+u*.84,t.bounds.top+u*.34085),new dA(t.bounds.left+u*.39363,t.bounds.top+u*.79)]),this.ctx.fillStyle=ce(nu),this.ctx.fill(),this.ctx.restore()):t.type===Us&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,Math.PI*2,!0),this.ctx.fillStyle=ce(nu),this.ctx.fill(),this.ctx.restore())),Sv(t)&&t.value.length){switch(d=this.createFontStyle(s),U=d[0],B=d[1],p=this.fontMetrics.getMetrics(U,B).baseline,this.ctx.font=U,this.ctx.fillStyle=ce(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=Lv(t.styles.textAlign),S=_s(t),f=0,t.styles.textAlign){case 1:f+=S.width/2;break;case 2:f+=S.width;break}w=S.add(f,0,0,-S.height/2+1),this.ctx.save(),this.path([new dA(S.left,S.top),new dA(S.left+S.width,S.top),new dA(S.left+S.width,S.top+S.height),new dA(S.left,S.top+S.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new jr(t.value,w),s.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!oe(t.styles.display,2048))return[3,20];if(t.styles.listStyleImage===null)return[3,19];if(F=t.styles.listStyleImage,F.type!==0)return[3,18];C=void 0,E=F.url,P.label=15;case 15:return P.trys.push([15,17,,18]),[4,this.context.cache.match(E)];case 16:return C=P.sent(),this.ctx.drawImage(C,t.bounds.left-(C.width+10),t.bounds.top),[3,18];case 17:return P.sent(),this.context.logger.error("Error loading list-style-image "+E),[3,18];case 18:return[3,20];case 19:e.listValue&&t.styles.listStyleType!==-1&&(U=this.createFontStyle(s)[0],this.ctx.font=U,this.ctx.fillStyle=ce(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",S=new lt(t.bounds.left,t.bounds.top+RA(t.styles.paddingTop,t.bounds.width),t.bounds.width,kh(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new jr(e.listValue,S),s.letterSpacing,kh(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),P.label=20;case 20:return[2]}})})},A.prototype.renderStackContent=function(e){return be(this,void 0,void 0,function(){var t,i,F,s,n,F,o,a,F,l,c,F,u,d,F,B,p,F,f,w,F;return me(this,function(C){switch(C.label){case 0:if(oe(e.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:C.sent(),t=0,i=e.negativeZIndex,C.label=2;case 2:return t<i.length?(F=i[t],[4,this.renderStack(F)]):[3,5];case 3:C.sent(),C.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:C.sent(),s=0,n=e.nonInlineLevel,C.label=7;case 7:return s<n.length?(F=n[s],[4,this.renderNode(F)]):[3,10];case 8:C.sent(),C.label=9;case 9:return s++,[3,7];case 10:o=0,a=e.nonPositionedFloats,C.label=11;case 11:return o<a.length?(F=a[o],[4,this.renderStack(F)]):[3,14];case 12:C.sent(),C.label=13;case 13:return o++,[3,11];case 14:l=0,c=e.nonPositionedInlineLevel,C.label=15;case 15:return l<c.length?(F=c[l],[4,this.renderStack(F)]):[3,18];case 16:C.sent(),C.label=17;case 17:return l++,[3,15];case 18:u=0,d=e.inlineLevel,C.label=19;case 19:return u<d.length?(F=d[u],[4,this.renderNode(F)]):[3,22];case 20:C.sent(),C.label=21;case 21:return u++,[3,19];case 22:B=0,p=e.zeroOrAutoZIndexOrTransformedOrOpacity,C.label=23;case 23:return B<p.length?(F=p[B],[4,this.renderStack(F)]):[3,26];case 24:C.sent(),C.label=25;case 25:return B++,[3,23];case 26:f=0,w=e.positiveZIndex,C.label=27;case 27:return f<w.length?(F=w[f],[4,this.renderStack(F)]):[3,30];case 28:C.sent(),C.label=29;case 29:return f++,[3,27];case 30:return[2]}})})},A.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},A.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},A.prototype.formatPath=function(e){var t=this;e.forEach(function(i,s){var n=Pe(i)?i.start:i;s===0?t.ctx.moveTo(n.x,n.y):t.ctx.lineTo(n.x,n.y),Pe(i)&&t.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},A.prototype.renderRepeat=function(e,t,i,s){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(i,s),this.ctx.fill(),this.ctx.translate(-i,-s)},A.prototype.resizeImage=function(e,t,i){var s;if(e.width===t&&e.height===i)return e;var n=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=n.createElement("canvas");o.width=Math.max(1,t),o.height=Math.max(1,i);var a=o.getContext("2d");return a.drawImage(e,0,0,e.width,e.height,0,0,t,i),o},A.prototype.renderBackgroundImage=function(e){return be(this,void 0,void 0,function(){var t,i,s,n,o,a;return me(this,function(l){switch(l.label){case 0:t=e.styles.backgroundImage.length-1,i=function(c){var u,d,B,Z,CA,MA,nA,cA,J,p,Z,CA,MA,nA,cA,f,w,F,C,E,U,S,P,z,J,N,Z,W,aA,nA,cA,SA,CA,MA,HA,UA,yA,vA,hA,j,eA,QA;return me(this,function(gA){switch(gA.label){case 0:if(c.type!==0)return[3,5];u=void 0,d=c.url,gA.label=1;case 1:return gA.trys.push([1,3,,4]),[4,s.context.cache.match(d)];case 2:return u=gA.sent(),[3,4];case 3:return gA.sent(),s.context.logger.error("Error loading background-image "+d),[3,4];case 4:return u&&(B=Xo(e,t,[u.width,u.height,u.width/u.height]),Z=B[0],CA=B[1],MA=B[2],nA=B[3],cA=B[4],J=s.ctx.createPattern(s.resizeImage(u,nA,cA),"repeat"),s.renderRepeat(Z,J,CA,MA)),[3,6];case 5:p1(c)?(p=Xo(e,t,[null,null,null]),Z=p[0],CA=p[1],MA=p[2],nA=p[3],cA=p[4],f=c1(c.angle,nA,cA),w=f[0],F=f[1],C=f[2],E=f[3],U=f[4],S=document.createElement("canvas"),S.width=nA,S.height=cA,P=S.getContext("2d"),z=P.createLinearGradient(F,E,C,U),Uh(c.stops,w).forEach(function(EA){return z.addColorStop(EA.stop,ce(EA.color))}),P.fillStyle=z,P.fillRect(0,0,nA,cA),nA>0&&cA>0&&(J=s.ctx.createPattern(S,"repeat"),s.renderRepeat(Z,J,CA,MA))):g1(c)&&(N=Xo(e,t,[null,null,null]),Z=N[0],W=N[1],aA=N[2],nA=N[3],cA=N[4],SA=c.position.length===0?[Co]:c.position,CA=RA(SA[0],nA),MA=RA(SA[SA.length-1],cA),HA=h1(c,CA,MA,nA,cA),UA=HA[0],yA=HA[1],UA>0&&yA>0&&(vA=s.ctx.createRadialGradient(W+CA,aA+MA,0,W+CA,aA+MA,UA),Uh(c.stops,UA*2).forEach(function(EA){return vA.addColorStop(EA.stop,ce(EA.color))}),s.path(Z),s.ctx.fillStyle=vA,UA!==yA?(hA=e.bounds.left+.5*e.bounds.width,j=e.bounds.top+.5*e.bounds.height,eA=yA/UA,QA=1/eA,s.ctx.save(),s.ctx.translate(hA,j),s.ctx.transform(1,0,0,eA,0,0),s.ctx.translate(-hA,-j),s.ctx.fillRect(W,QA*(aA-j)+j,nA,cA*QA),s.ctx.restore()):s.ctx.fill())),gA.label=6;case 6:return t--,[2]}})},s=this,n=0,o=e.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return n<o.length?(a=o[n],[5,i(a)]):[3,4];case 2:l.sent(),l.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},A.prototype.renderSolidBorder=function(e,t,i){return be(this,void 0,void 0,function(){return me(this,function(s){return this.path(Du(i,t)),this.ctx.fillStyle=ce(e),this.ctx.fill(),[2]})})},A.prototype.renderDoubleBorder=function(e,t,i,s){return be(this,void 0,void 0,function(){var n,o;return me(this,function(a){switch(a.label){case 0:return t<3?[4,this.renderSolidBorder(e,i,s)]:[3,2];case 1:return a.sent(),[2];case 2:return n=mv(s,i),this.path(n),this.ctx.fillStyle=ce(e),this.ctx.fill(),o=Cv(s,i),this.path(o),this.ctx.fill(),[2]}})})},A.prototype.renderNodeBackgroundAndBorders=function(e){return be(this,void 0,void 0,function(){var t,i,s,n,o,a,l,c,u=this;return me(this,function(d){switch(d.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,i=!Ft(t.backgroundColor)||t.backgroundImage.length,s=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],n=Hv(ur(t.backgroundClip,0),e.curves),i||t.boxShadow.length?(this.ctx.save(),this.path(n),this.ctx.clip(),Ft(t.backgroundColor)||(this.ctx.fillStyle=ce(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:d.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(B){u.ctx.save();var p=Ls(e.curves),f=B.inset?0:xv,w=Bv(p,-f+(B.inset?1:-1)*B.spread.number,(B.inset?1:-1)*B.spread.number,B.spread.number*(B.inset?-2:2),B.spread.number*(B.inset?-2:2));B.inset?(u.path(p),u.ctx.clip(),u.mask(w)):(u.mask(p),u.ctx.clip(),u.path(w)),u.ctx.shadowOffsetX=B.offsetX.number+f,u.ctx.shadowOffsetY=B.offsetY.number,u.ctx.shadowColor=ce(B.color),u.ctx.shadowBlur=B.blur.number,u.ctx.fillStyle=B.inset?ce(B.color):"rgba(0,0,0,1)",u.ctx.fill(),u.ctx.restore()}),d.label=2;case 2:o=0,a=0,l=s,d.label=3;case 3:return a<l.length?(c=l[a],c.style!==0&&!Ft(c.color)&&c.width>0?c.style!==2?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,o,e.curves,2)]:[3,11]):[3,13];case 4:return d.sent(),[3,11];case 5:return c.style!==3?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,o,e.curves,3)];case 6:return d.sent(),[3,11];case 7:return c.style!==4?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,o,e.curves)];case 8:return d.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,o,e.curves)];case 10:d.sent(),d.label=11;case 11:o++,d.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},A.prototype.renderDashedDottedBorder=function(e,t,i,s,n){return be(this,void 0,void 0,function(){var o,a,l,c,u,d,B,p,f,w,F,C,E,U,S,P,S,P;return me(this,function(z){return this.ctx.save(),o=vv(s,i),a=Du(s,i),n===2&&(this.path(a),this.ctx.clip()),Pe(a[0])?(l=a[0].start.x,c=a[0].start.y):(l=a[0].x,c=a[0].y),Pe(a[1])?(u=a[1].end.x,d=a[1].end.y):(u=a[1].x,d=a[1].y),i===0||i===2?B=Math.abs(l-u):B=Math.abs(c-d),this.ctx.beginPath(),n===3?this.formatPath(o):this.formatPath(a.slice(0,2)),p=t<3?t*3:t*2,f=t<3?t*2:t,n===3&&(p=t,f=t),w=!0,B<=p*2?w=!1:B<=p*2+f?(F=B/(2*p+f),p*=F,f*=F):(C=Math.floor((B+f)/(p+f)),E=(B-C*p)/(C-1),U=(B-(C+1)*p)/C,f=U<=0||Math.abs(f-E)<Math.abs(f-U)?E:U),w&&(n===3?this.ctx.setLineDash([0,p+f]):this.ctx.setLineDash([p,f])),n===3?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=t*2+1.1,this.ctx.strokeStyle=ce(e),this.ctx.stroke(),this.ctx.setLineDash([]),n===2&&(Pe(a[0])&&(S=a[3],P=a[0],this.ctx.beginPath(),this.formatPath([new dA(S.end.x,S.end.y),new dA(P.start.x,P.start.y)]),this.ctx.stroke()),Pe(a[1])&&(S=a[1],P=a[2],this.ctx.beginPath(),this.formatPath([new dA(S.end.x,S.end.y),new dA(P.start.x,P.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},A.prototype.render=function(e){return be(this,void 0,void 0,function(){var t;return me(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ce(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=wv(e),[4,this.renderStack(t)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},A})(Ou),Sv=function(r){return r instanceof au||r instanceof ou?!0:r instanceof ko&&r.type!==Us&&r.type!==Fs},Hv=function(r,A){switch(r){case 0:return Ls(A);case 2:return uv(A);default:return Is(A)}},Lv=function(r){switch(r){case 1:return"center";case 2:return"right";default:return"left"}},Iv=["-apple-system","system-ui"],Mv=function(r){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?r.filter(function(A){return Iv.indexOf(A)===-1}):r},Dv=(function(r){Xe(A,r);function A(e,t){var i=r.call(this,e,t)||this;return i.canvas=t.canvas?t.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=t,i.canvas.width=Math.floor(t.width*t.scale),i.canvas.height=Math.floor(t.height*t.scale),i.canvas.style.width=t.width+"px",i.canvas.style.height=t.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-t.x,-t.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),i}return A.prototype.render=function(e){return be(this,void 0,void 0,function(){var t,i;return me(this,function(s){switch(s.label){case 0:return t=Mo(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,_v(t)];case 1:return i=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ce(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},A})(Ou),_v=function(r){return new Promise(function(A,e){var t=new Image;t.onload=function(){A(t)},t.onerror=e,t.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(r))})},kv=(function(){function r(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return r.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,Ri([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.prototype.getTime=function(){return Date.now()-this.start},r.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,Ri([this.id,this.getTime()+"ms"],A))},r.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,Ri([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,Ri([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},r.instances={},r})(),Ov=(function(){function r(A,e){var t;this.windowBounds=e,this.instanceName="#"+r.instanceCount++,this.logger=new kv({id:this.instanceName,enabled:A.logging}),this.cache=(t=A.cache)!==null&&t!==void 0?t:new iv(this,A)}return r.instanceCount=1,r})(),Nv=function(r,A){return A===void 0&&(A={}),Kv(r,A)};typeof window<"u"&&Tu.setContext(window);var Kv=function(r,A){return be(void 0,void 0,void 0,function(){var e,t,i,s,n,o,a,l,c,u,d,B,p,f,w,F,C,E,U,S,z,P,z,J,N,Z,W,aA,nA,cA,SA,CA,MA,HA,UA,yA,vA,hA,j,eA;return me(this,function(QA){switch(QA.label){case 0:if(!r||typeof r!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(e=r.ownerDocument,!e)throw new Error("Element is not attached to a Document");if(t=e.defaultView,!t)throw new Error("Document is not attached to a Window");return i={allowTaint:(J=A.allowTaint)!==null&&J!==void 0?J:!1,imageTimeout:(N=A.imageTimeout)!==null&&N!==void 0?N:15e3,proxy:A.proxy,useCORS:(Z=A.useCORS)!==null&&Z!==void 0?Z:!1},s=jn({logging:(W=A.logging)!==null&&W!==void 0?W:!0,cache:A.cache},i),n={windowWidth:(aA=A.windowWidth)!==null&&aA!==void 0?aA:t.innerWidth,windowHeight:(nA=A.windowHeight)!==null&&nA!==void 0?nA:t.innerHeight,scrollX:(cA=A.scrollX)!==null&&cA!==void 0?cA:t.pageXOffset,scrollY:(SA=A.scrollY)!==null&&SA!==void 0?SA:t.pageYOffset},o=new lt(n.scrollX,n.scrollY,n.windowWidth,n.windowHeight),a=new Ov(s,o),l=(CA=A.foreignObjectRendering)!==null&&CA!==void 0?CA:!1,c={allowTaint:(MA=A.allowTaint)!==null&&MA!==void 0?MA:!1,onclone:A.onclone,ignoreElements:A.ignoreElements,inlineImages:l,copyStyles:l},a.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),u=new Eu(a,r,c),d=u.clonedReferenceElement,d?[4,u.toIFrame(e,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return B=QA.sent(),p=No(d)||VC(d)?BB(d.ownerDocument):Wi(a,d),f=p.width,w=p.height,F=p.left,C=p.top,E=Vv(a,d,A.backgroundColor),U={canvas:A.canvas,backgroundColor:E,scale:(UA=(HA=A.scale)!==null&&HA!==void 0?HA:t.devicePixelRatio)!==null&&UA!==void 0?UA:1,x:((yA=A.x)!==null&&yA!==void 0?yA:0)+F,y:((vA=A.y)!==null&&vA!==void 0?vA:0)+C,width:(hA=A.width)!==null&&hA!==void 0?hA:Math.ceil(f),height:(j=A.height)!==null&&j!==void 0?j:Math.ceil(w)},l?(a.logger.debug("Document cloned, using foreign object rendering"),z=new Dv(a,U),[4,z.render(d)]):[3,3];case 2:return S=QA.sent(),[3,5];case 3:return a.logger.debug("Document cloned, element located at "+F+","+C+" with size "+f+"x"+w+" using computed rendering"),a.logger.debug("Starting DOM parsing"),P=hu(a,d),E===P.styles.backgroundColor&&(P.styles.backgroundColor=ht.TRANSPARENT),a.logger.debug("Starting renderer for element at "+U.x+","+U.y+" with size "+U.width+"x"+U.height),z=new Tv(a,U),[4,z.render(P)];case 4:S=QA.sent(),QA.label=5;case 5:return(!((eA=A.removeContainer)!==null&&eA!==void 0)||eA)&&(Eu.destroy(B)||a.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),a.logger.debug("Finished rendering"),[2,S]}})})},Vv=function(r,A,e){var t=A.ownerDocument,i=t.documentElement?Jr(r,getComputedStyle(t.documentElement).backgroundColor):ht.TRANSPARENT,s=t.body?Jr(r,getComputedStyle(t.body).backgroundColor):ht.TRANSPARENT,n=typeof e=="string"?Jr(r,e):e===null?ht.TRANSPARENT:4294967295;return A===t.documentElement?Ft(i)?Ft(s)?n:s:i:n};const Pv={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1};class zv{constructor(A,e,t="#3b82f6",i=2){this.price=A,this.originTime=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null,this._paneView=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=o.context,l=s._chart,c=s._series;if(!l||!c)return;const u=c.priceToCoordinate(s.price);if(u==null)return;const d=Math.round(u*o.verticalPixelRatio),B=l.timeScale().timeToCoordinate(s.originTime),p=B==null?0:Math.max(0,Math.round(B*o.horizontalPixelRatio)),f=o.bitmapSize.width;if(p>=f)return;a.save(),a.beginPath(),a.strokeStyle=s.color,a.lineWidth=s.lineWidth*o.verticalPixelRatio,a.setLineDash([]),a.moveTo(p,d),a.lineTo(f,d),a.stroke(),a.beginPath(),a.fillStyle=s.color;const w=3*o.verticalPixelRatio;a.arc(p,d,w,0,Math.PI*2),a.fill(),a.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Gv{constructor(A,e,t,i="#3b82f6",s=2){this.p1=A,this.p2=e,this.info=t,this.color=i,this.lineWidth=s,this.visible=!0,this._chart=null,this._series=null;const n=this;this._paneView={renderer(){return{draw(o){o.useBitmapCoordinateSpace(a=>{if(!n.visible)return;const l=n._chart,c=n._series;if(!l||!c)return;const u=a.horizontalPixelRatio,d=a.verticalPixelRatio,B=l.timeScale().timeToCoordinate(n.p1.rawTime),p=l.timeScale().timeToCoordinate(n.p2.rawTime),f=c.priceToCoordinate(n.p1.price),w=c.priceToCoordinate(n.p2.price);if(B==null||p==null||f==null||w==null)return;const F=Math.round(B*u),C=Math.round(f*d),E=Math.round(p*u),U=Math.round(w*d),S=a.context;S.save(),S.beginPath(),S.strokeStyle=n.color,S.lineWidth=n.lineWidth*d,S.setLineDash([]),S.moveTo(F,C),S.lineTo(E,U),S.stroke(),S.beginPath(),S.fillStyle=n.color,S.arc(F,C,3*d,0,Math.PI*2),S.fill(),S.beginPath(),S.arc(E,U,3*d,0,Math.PI*2),S.fill();const{priceDiff:P,pricePct:z,bars:J,days:N,angle:Z}=n.info,W=P>=0?"+":"",aA=[`${W}${P.toFixed(5)} (${W}${z.toFixed(2)}%)`,`${J} bars (${N} days)`,`∠ ${Z.toFixed(1)}°`],nA=Math.round(11*d);S.font=`${nA}px sans-serif`;const cA=nA*1.6,SA=8*d,CA=Math.max(...aA.map(QA=>S.measureText(QA).width))+SA*2,MA=aA.length*cA+SA*2,HA=E+10*u,UA=U-MA-4*d,yA=a.bitmapSize.width,vA=a.bitmapSize.height,hA=Math.min(Math.max(0,HA),yA-CA-4*u),j=Math.min(Math.max(4*d,UA),vA-MA-4*d),eA=4*d;S.beginPath(),S.moveTo(hA+eA,j),S.lineTo(hA+CA-eA,j),S.quadraticCurveTo(hA+CA,j,hA+CA,j+eA),S.lineTo(hA+CA,j+MA-eA),S.quadraticCurveTo(hA+CA,j+MA,hA+CA-eA,j+MA),S.lineTo(hA+eA,j+MA),S.quadraticCurveTo(hA,j+MA,hA,j+MA-eA),S.lineTo(hA,j+eA),S.quadraticCurveTo(hA,j,hA+eA,j),S.closePath(),S.fillStyle="rgba(30, 41, 59, 0.92)",S.fill(),S.strokeStyle=n.color,S.lineWidth=1*d,S.stroke(),S.fillStyle="#e2e8f0",S.textAlign="left",aA.forEach((QA,gA)=>{S.fillText(QA,hA+SA,j+SA+nA+gA*cA)}),S.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Nu{constructor(A,e,t){this.p1=A,this.p2=e,this.info=t,this.visible=!0,this._chart=null,this._series=null;const i=e.price>=A.price;this.color=i?"#3b82f6":"#ef5350",this.fillColor=i?"rgba(59,130,246,0.1)":"rgba(239,83,80,0.1)";const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const w=Math.round(d*c),F=Math.round(p*u),C=Math.round(B*c),E=Math.round(f*u),U=o.context;U.save(),U.fillStyle=s.fillColor,U.fillRect(Math.min(w,C),Math.min(F,E),Math.abs(C-w),Math.abs(E-F)),U.strokeStyle=s.color,U.lineWidth=1*u,U.setLineDash([]),U.strokeRect(Math.min(w,C),Math.min(F,E),Math.abs(C-w),Math.abs(E-F)),U.beginPath(),U.strokeStyle=s.color,U.lineWidth=2*u,U.moveTo(w,F),U.lineTo(C,E),U.stroke(),U.fillStyle=s.color,U.beginPath(),U.arc(w,F,3*u,0,Math.PI*2),U.fill(),U.beginPath(),U.arc(C,E,3*u,0,Math.PI*2),U.fill();const{priceDiff:S,pricePct:P,bars:z,days:J}=s.info,N=S>=0?"+":"",Z=[`${N}${S.toFixed(5)} (${N}${P.toFixed(2)}%)`,`${z} bars (${J} days)`],W=Math.round(11*u);U.font=`${W}px sans-serif`;const aA=W*1.6,nA=8*u,cA=Math.max(...Z.map(j=>U.measureText(j).width))+nA*2,SA=Z.length*aA+nA*2,CA=o.bitmapSize.width,MA=o.bitmapSize.height,HA=C+10*c,UA=E-SA-4*u,yA=Math.min(Math.max(0,HA),CA-cA-4*c),vA=Math.min(Math.max(4*u,UA),MA-SA-4*u),hA=4*u;U.beginPath(),U.moveTo(yA+hA,vA),U.lineTo(yA+cA-hA,vA),U.quadraticCurveTo(yA+cA,vA,yA+cA,vA+hA),U.lineTo(yA+cA,vA+SA-hA),U.quadraticCurveTo(yA+cA,vA+SA,yA+cA-hA,vA+SA),U.lineTo(yA+hA,vA+SA),U.quadraticCurveTo(yA,vA+SA,yA,vA+SA-hA),U.lineTo(yA,vA+hA),U.quadraticCurveTo(yA,vA,yA+hA,vA),U.closePath(),U.fillStyle="rgba(30, 41, 59, 0.92)",U.fill(),U.strokeStyle=s.color,U.lineWidth=1*u,U.stroke(),U.fillStyle="#e2e8f0",U.textAlign="left",Z.forEach((j,eA)=>{U.fillText(j,yA+nA,vA+nA+W+eA*aA)}),U.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Ku{constructor(A,e,t="#f59e0b",i=2){this.p1=A,this.p2=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const w=Math.round(d*c),F=Math.round(p*u),C=Math.round(B*c),E=Math.round(f*u),U=o.context;U.save(),U.beginPath(),U.strokeStyle=s.color,U.lineWidth=s.lineWidth*u,U.setLineDash([]),U.moveTo(w,F),U.lineTo(C,E),U.stroke();const S=Math.atan2(E-F,C-w),P=11*u,z=Math.PI/7,J=C-P*Math.cos(S-z),N=E-P*Math.sin(S-z),Z=C-P*Math.cos(S+z),W=E-P*Math.sin(S+z);U.beginPath(),U.fillStyle=s.color,U.moveTo(C,E),U.lineTo(J,N),U.lineTo(Z,W),U.closePath(),U.fill(),U.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Rv{constructor(A,e,t="#7aa6ae",i=2){this.p1=A,this.p2=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const w=d*c,F=p*u;let C=B-d,E=f-p;C<0&&(C=-C,E=-E),Math.abs(C)<1e-4&&(C=1e-4);const U=E*u/(C*c),S=Math.max(0,w),P=F+U*(S-w),z=o.bitmapSize.width,J=F+U*(z-w),N=o.context;N.save(),N.beginPath(),N.strokeStyle=s.color,N.lineWidth=s.lineWidth*u,N.setLineDash([]),N.moveTo(S,P),N.lineTo(z,J),N.stroke(),N.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Wv{constructor(A,e,t="#7aa6ae",i=2){this.p1=A,this.p2=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const w=d*c,F=p*u;let C=B-d,E=f-p;Math.abs(C)<1e-4&&(C=1e-4);const U=E*u/(C*c),S=0,P=F+U*(S-w),z=o.bitmapSize.width,J=F+U*(z-w),N=o.context;N.save(),N.beginPath(),N.strokeStyle=s.color,N.lineWidth=s.lineWidth*u,N.setLineDash([]),N.moveTo(S,P),N.lineTo(z,J),N.stroke(),N.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class $v{constructor(A,e="#7aa6ae",t=2){this.center=A,this.color=e,this.lineWidth=t,this.visible=!0,this._chart=null,this._series=null;const i=this;this._paneView={renderer(){return{draw(s){s.useBitmapCoordinateSpace(n=>{if(!i.visible)return;const o=i._chart,a=i._series;if(!o||!a)return;const l=n.horizontalPixelRatio,c=n.verticalPixelRatio,u=o.timeScale().timeToCoordinate(i.center.rawTime),d=a.priceToCoordinate(i.center.price);if(u==null||d==null)return;const B=Math.round(u*l),p=Math.round(d*c),f=n.bitmapSize.width,w=n.bitmapSize.height,F=n.context;F.save(),F.strokeStyle=i.color,F.lineWidth=i.lineWidth*c,F.setLineDash([]),F.beginPath(),F.moveTo(0,p),F.lineTo(f,p),F.stroke(),F.beginPath(),F.moveTo(B,0),F.lineTo(B,w),F.stroke(),F.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Xv{constructor(A,e,t="#7aa6ae",i=2){this.p1=A,this.p2=e,this.color=t,this.lineWidth=i,this.visible=!0,this._chart=null,this._series=null;const s=this;this._paneView={renderer(){return{draw(n){n.useBitmapCoordinateSpace(o=>{if(!s.visible)return;const a=s._chart,l=s._series;if(!a||!l)return;const c=o.horizontalPixelRatio,u=o.verticalPixelRatio,d=a.timeScale().timeToCoordinate(s.p1.rawTime),B=a.timeScale().timeToCoordinate(s.p2.rawTime),p=l.priceToCoordinate(s.p1.price),f=l.priceToCoordinate(s.p2.price);if(d==null||B==null||p==null||f==null)return;const w=d*c,F=p*u,C=B*c,E=f*u,U=w-C,S=F-E;if(Math.hypot(U,S)<1e-4)return;const z=Math.atan2(S,U),J=Math.round(Math.abs(z*180/Math.PI)),N=o.context;N.save(),N.strokeStyle=s.color,N.lineWidth=s.lineWidth*u,N.setLineDash([]),N.beginPath(),N.moveTo(w,F),N.lineTo(C,E),N.stroke();const Z=28*u;N.beginPath(),N.lineWidth=1*u,N.strokeStyle="rgba(122,166,174,0.55)",N.moveTo(C,E),N.lineTo(C+Z,E),N.stroke(),N.beginPath(),N.strokeStyle="rgba(122,166,174,0.45)",N.arc(C,E,Z,0,z,z<0),N.stroke(),N.fillStyle="#4b7c86",N.font=`${Math.round(10*u)}px sans-serif`,N.textAlign="left",N.textBaseline="middle";const W=C+(Z+10*u)*Math.cos(z/2),aA=E+(Z+10*u)*Math.sin(z/2);N.fillText(`${J}°`,W,aA),N.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Jo{constructor(A,e,t,i,s="#16a34a",n=2,o="rgba(22, 163, 74, 0.12)"){this.p1=A,this.p2=e,this.p3=t,this.p4=i,this.color=s,this.lineWidth=n,this.fillColor=o,this.visible=!0,this._chart=null,this._series=null;const a=this;this._paneView={renderer(){return{draw(l){l.useBitmapCoordinateSpace(c=>{if(!a.visible)return;const u=a._chart,d=a._series;if(!u||!d)return;const B=c.horizontalPixelRatio,p=c.verticalPixelRatio,f=[a.p1,a.p3,a.p4,a.p2].map(z=>{const J=u.timeScale().timeToCoordinate(z.rawTime),N=d.priceToCoordinate(z.price);return J==null||N==null?null:{x:J*B,y:N*p}}).filter(Boolean);if(f.length!==4)return;const[w,F,C,E]=f,U=c.context;U.save(),U.beginPath(),U.moveTo(w.x,w.y),U.lineTo(F.x,F.y),U.lineTo(C.x,C.y),U.lineTo(E.x,E.y),U.closePath(),U.fillStyle=a.fillColor,U.fill(),U.strokeStyle=a.color,U.lineWidth=a.lineWidth*p,U.setLineDash([]),U.beginPath(),U.moveTo(w.x,w.y),U.lineTo(F.x,F.y),U.moveTo(E.x,E.y),U.lineTo(C.x,C.y),U.moveTo(w.x,w.y),U.lineTo(E.x,E.y),U.moveTo(F.x,F.y),U.lineTo(C.x,C.y),U.stroke(),U.fillStyle="#ffffff",U.strokeStyle="#3b82f6",U.lineWidth=2*p,[w,F,C,E].forEach(z=>{U.beginPath(),U.arc(z.x,z.y,6*p,0,Math.PI*2),U.fill(),U.stroke()});const S=[a.p1,a.p3,a.p2,a.p4],P=[w,F,E,C];U.fillStyle=a.color,U.font=`${Math.round(10*p)}px sans-serif`,U.textAlign="left",U.textBaseline="middle",P.forEach((z,J)=>{const N=S[J]?.price;typeof N=="number"&&U.fillText(N.toFixed(5),z.x+8*B,z.y)}),U.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Vu extends Jo{constructor(A,e,t,i,s="#3b82f6",n=2){super(A,e,t,i,s,n,"rgba(59, 130, 246, 0.12)")}}class Pu{constructor(A,e){this.p1=A,this.p2=e,this.visible=!0,this._chart=null,this._series=null,this._levels=[{ratio:0,label:"0.000"},{ratio:.236,label:"0.236"},{ratio:.382,label:"0.382"},{ratio:.5,label:"0.500"},{ratio:.618,label:"0.618"},{ratio:.786,label:"0.786"},{ratio:1,label:"1.000"},{ratio:1.618,label:"1.618"},{ratio:2.618,label:"2.618"},{ratio:3.618,label:"3.618"},{ratio:4.236,label:"4.236"}],this._levelColors={0:"#ff0000",.236:"#ff0000",.382:"#00c853",.5:"#00c853",.618:"#00bcd4",.786:"#00bcd4",1:"#2962ff",1.618:"#2962ff",2.618:"#ff0000",3.618:"#ff0000",4.236:"#e040fb"},this._zoneFills=[{from:0,to:.236,color:"rgba(255, 0, 0, 0.06)"},{from:.236,to:.382,color:"rgba(0, 200, 83, 0.06)"},{from:.382,to:.5,color:"rgba(0, 200, 83, 0.06)"},{from:.5,to:.618,color:"rgba(0, 200, 83, 0.06)"},{from:.618,to:.786,color:"rgba(0, 188, 212, 0.06)"},{from:.786,to:1,color:"rgba(41, 98, 255, 0.08)"},{from:1,to:1.618,color:"rgba(255, 138, 128, 0.10)"},{from:1.618,to:2.618,color:"rgba(255, 138, 128, 0.10)"},{from:2.618,to:3.618,color:"rgba(224, 64, 251, 0.08)"},{from:3.618,to:4.236,color:"rgba(224, 64, 251, 0.08)"}];const t=this;this._paneView={renderer(){return{draw(i){i.useBitmapCoordinateSpace(s=>{if(!t.visible)return;const n=t._chart,o=t._series;if(!n||!o)return;const a=s.horizontalPixelRatio,l=s.verticalPixelRatio,c=s.context,u=s.bitmapSize.width;s.bitmapSize.height;const d=t.p1.price,B=t.p2.price,p=d-B,f=J=>B+p*J,w=n.timeScale().timeToCoordinate(t.p1.rawTime),F=n.timeScale().timeToCoordinate(t.p2.rawTime),C=o.priceToCoordinate(d),E=o.priceToCoordinate(B),U=w!=null&&F!=null?Math.round(Math.min(w,F)*a):0,S=w!=null&&F!=null?Math.round(Math.max(w,F)*a):u,P=S-U;c.save(),t._zoneFills.forEach(({from:J,to:N,color:Z})=>{const W=f(J),aA=f(N),nA=o.priceToCoordinate(W),cA=o.priceToCoordinate(aA);if(nA==null||cA==null)return;const SA=Math.round(nA*l),CA=Math.round(cA*l);c.fillStyle=Z,c.fillRect(U,Math.min(SA,CA),P,Math.abs(CA-SA))}),t._levels.forEach(({ratio:J,label:N})=>{const Z=f(J),W=o.priceToCoordinate(Z);if(W==null)return;const aA=Math.round(W*l),nA=t._levelColors[J]||"#888888";c.beginPath(),c.strokeStyle=nA,c.lineWidth=J===0||J===1?1.5*l:1*l,J!==0&&J!==1&&J<1?c.setLineDash([4*a,4*a]):c.setLineDash([]),c.moveTo(U,aA),c.lineTo(S,aA),c.stroke(),c.setLineDash([])});const z=Math.round(11*l);if(c.font=`${z}px sans-serif`,c.textAlign="left",t._levels.forEach(({ratio:J,label:N})=>{const Z=f(J),W=o.priceToCoordinate(Z);if(W==null)return;const aA=Math.round(W*l),nA=t._levelColors[J]||"#888888",cA=`${N} (${Z.toFixed(5)})`;c.fillStyle=nA,c.textAlign="right",c.fillText(cA,U-4*a,aA-4*l)}),w!=null&&F!=null&&C!=null&&E!=null){const J=Math.round(w*a),N=Math.round(C*l),Z=Math.round(F*a),W=Math.round(E*l);c.beginPath(),c.strokeStyle="rgba(128, 128, 128, 0.6)",c.lineWidth=1*l,c.setLineDash([]),c.moveTo(J,N),c.lineTo(Z,W),c.stroke(),c.beginPath(),c.fillStyle="#2962ff",c.arc(J,N,4*l,0,Math.PI*2),c.fill(),c.strokeStyle="#ffffff",c.lineWidth=1*l,c.stroke(),c.beginPath(),c.fillStyle="#2962ff",c.arc(Z,W,4*l,0,Math.PI*2),c.fill(),c.strokeStyle="#ffffff",c.lineWidth=1*l,c.stroke()}c.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}class Jv{constructor(A,e="#3b82f6",t=2){this.time=A,this.color=e,this.lineWidth=t,this.visible=!0,this._chart=null,this._series=null;const i=this;this._paneView={renderer(){return{draw(s){s.useBitmapCoordinateSpace(n=>{if(!i.visible)return;const o=i._chart;if(!o)return;const a=o.timeScale().timeToCoordinate(i.time);if(a==null)return;const l=Math.round(a*n.horizontalPixelRatio),c=n.bitmapSize.height,u=n.context;u.save(),u.beginPath(),u.strokeStyle=i.color,u.lineWidth=i.lineWidth*n.horizontalPixelRatio,u.setLineDash([]),u.moveTo(l,0),u.lineTo(l,c),u.stroke(),u.restore()})}}}}}attached({chart:A,series:e}){this._chart=A,this._series=e}detached(){this._chart=null,this._series=null}paneViews(){return[this._paneView]}}const Zv={M1:3,M5:7,M15:14,M30:30,H1:90,H4:180,D1:1095,W1:1825,MN:3650};function zu(r){if(!r)return 7;const A=String(r).toUpperCase();return Zv[A]??7}function Yv(r,A){const e=String(r||"").toUpperCase(),t=A||zu(r),i={M1:1440,M5:288,M15:96,M30:48,H1:24,H4:6,D1:1,W1:1/7,MN:1/30}[e]||96,s=Math.ceil(t*(typeof i=="number"?i:96));return Math.min(Math.max(s,500),5e3)}const ye=r=>{if(!Array.isArray(r)||r.length===0)return[];const A=r.map(t=>({...t,time:iA(t.time)})).filter(t=>t.time!=null);A.sort((t,i)=>t.time-i.time);const e=new Map;for(const t of A)e.set(t.time,t);return Array.from(e.values()).sort((t,i)=>t.time-i.time)};function Me(r,A,e,t,i,s){const n=i-e,o=s-t,a=Math.sqrt(n*n+o*o);if(a===0)return Math.hypot(r-e,A-t);let l=((r-e)*n+(A-t)*o)/(a*a);l=Math.max(0,Math.min(1,l));const c=e+l*n,u=t+l*o;return Math.hypot(r-c,A-u)}function jv(r,A,e,t,i,s){const n=i-e,o=s-t,a=n*n+o*o;if(a===0)return Math.hypot(r-e,A-t);let l=((r-e)*n+(A-t)*o)/a;l<0&&(l=0);const c=e+l*n,u=t+l*o;return Math.hypot(r-c,A-u)}function qv(r,A,e,t,i,s){const n=i-e,o=s-t,a=n*n+o*o;if(a===0)return Math.hypot(r-e,A-t);const l=((r-e)*n+(A-t)*o)/a,c=e+l*n,u=t+l*o;return Math.hypot(r-c,A-u)}function Gu(r,A,e){let t=!1;for(let i=0,s=e.length-1;i<e.length;s=i++){const n=e[i].x,o=e[i].y,a=e[s].x,l=e[s].y;o>A!=l>A&&r<(a-n)*(A-o)/(l-o+1e-7)+n&&(t=!t)}return t}function Zo(r,A,e,t,i){if(!e||!t||!i)return null;const s=e.time,n=t.time,o=n-s,a=e.price,l=t.price,c=i.price;if(Math.abs(o)<1e-9){const p=c-a;return[{time:s,price:a+p},{time:n+1,price:l+p}]}const u=(l-a)/o,d=c+u*(s-i.time),B=c+u*(n-i.time);return[{time:s,price:d},{time:n,price:B}]}const Ab=K.forwardRef(function({bidPrice:A="113.638",askPrice:e="113.649",showBuySellPanel:t=!0,onBuyClick:i,onSellClick:s},n){const o=K.useRef(null),a=K.useRef(null),l=K.useRef(null),c=K.useRef(null),u=K.useRef([]),d=K.useRef(!1),B=K.useRef(null),p=K.useRef(null),f=K.useRef(null),w=K.useRef(null),F=K.useRef([]),[C,E]=K.useState(null),[U,S]=K.useState([]),[P,z]=K.useState(null),[J,N]=K.useState([]),Z=K.useRef(null),W=K.useRef(null),aA=K.useRef(null),nA=K.useRef(!1);K.useEffect(()=>{aA.current=C},[C]);const cA=K.useRef(new Map),SA=K.useRef(null),CA=(v,b)=>`${v}_${b}`,MA=()=>{const v=CA(gA,EA);return cA.current.get(v)||null},HA=v=>{if(!v)return;const b=CA(gA,EA);cA.current.set(b,v)},{activeTool:UA,setActiveTool:yA,showGrid:vA,snapToGrid:hA,chartObjects:j,setChartObjects:eA,orders:QA,selectedSymbol:gA,selectedTimeframe:EA,drawingsVisible:XA,chartType:zA,chartLocked:dt,theme:ae,baseUrl:ft,endpoints:LA,endpointParams:KA}=ge(),fA=K.useRef([]),[mA,BA]=K.useState(!1),[uA,IA]=K.useState(null),[FA,le]=K.useState([]),[De,pt]=K.useState(!0),ri=K.useRef(null),Gt=K.useRef(new Map);K.useRef(null);const Os=K.useRef(0);K.useImperativeHandle(n,()=>({zoomIn:()=>{const v=a.current?.timeScale();if(!v)return;const b=v.getVisibleRange();if(!b||!b.from||!b.to)return;const k=b.to-b.from,wA=(b.from+b.to)/2,T=k*.8;try{v.setVisibleRange({from:wA-T/2,to:wA+T/2}),HA(v.getVisibleRange())}catch{}},zoomOut:()=>{const v=a.current?.timeScale();if(!v)return;const b=v.getVisibleRange();if(!b||!b.from||!b.to)return;const k=b.to-b.from,wA=(b.from+b.to)/2,T=k*1.25;try{v.setVisibleRange({from:wA-T/2,to:wA+T/2}),HA(v.getVisibleRange())}catch{}},downloadChartAsPNG:()=>{const v=o.current;if(!v){typeof window.notify=="function"&&window.notify("Chart not ready","error");return}const b=v.querySelectorAll("canvas"),k=ae==="light"?"#ffffff":"#12161d";let wA=null,T=0;if(b.forEach(q=>{if(q.width>0&&q.height>0){const sA=q.width*q.height;sA>T&&(T=sA,wA=q)}}),wA)try{const q=document.createElement("canvas");q.width=wA.width,q.height=wA.height;const sA=q.getContext("2d");sA.fillStyle=k,sA.fillRect(0,0,q.width,q.height),sA.drawImage(wA,0,0);const Y=document.createElement("a");Y.download=`chart-${gA}-${EA}-${Date.now()}.png`,Y.href=q.toDataURL("image/png"),Y.click(),typeof window.notify=="function"&&window.notify("Chart saved as PNG","success");return}catch(q){console.warn("Canvas export failed, trying html2canvas",q)}Nv(v,{useCORS:!0,allowTaint:!0,backgroundColor:k,scale:2,logging:!1}).then(q=>{const sA=document.createElement("a");sA.download=`chart-${gA}-${EA}-${Date.now()}.png`,sA.href=q.toDataURL("image/png"),sA.click(),typeof window.notify=="function"&&window.notify("Chart saved as PNG","success")}).catch(q=>{console.error("Chart screenshot failed",q),typeof window.notify=="function"&&window.notify("Screenshot failed. Try again.","error")})}}),[gA,EA,ae]);const gt=K.useMemo(()=>FA.length===0?[]:zA==="line"||zA==="area"?FA.map(v=>({time:v.time,value:v.close})):FA,[FA,zA]),ii=v=>{i?i(v):(IA("BUY"),BA(!0))},Le=v=>{s?s(v):(IA("SELL"),BA(!0))},ne=()=>{BA(!1),IA(null)};K.useEffect(()=>{const v=o.current;if(!v)return;const b=v.getBoundingClientRect(),k=L=>{const oA=Math.abs(Number(L));return Number.isFinite(oA)?oA>=1e3?oA.toFixed(2):oA>=1?oA.toFixed(4):oA.toFixed(5):"0"},wA=ae==="light",T=Sp(v,{width:b.width||v.clientWidth,height:b.height||v.clientHeight,autoSize:!0,localization:{priceFormatter:k},layout:{background:{color:wA?"#FFFFFF":"#0d1117",type:"solid"},textColor:wA?"#020617":"#e6edf3",fontSize:12,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif'},grid:{vertLines:{visible:vA,color:vA?wA?"rgba(100, 116, 139, 0.15)":"rgba(110, 118, 129, 0.15)":"transparent",style:vA?2:0},horzLines:{visible:vA,color:vA?wA?"rgba(100, 116, 139, 0.15)":"rgba(110, 118, 129, 0.15)":"transparent",style:vA?2:0}},rightPriceScale:{borderColor:wA?"#e5e7eb":"#21262d",autoScale:!0,scaleMargins:{top:.1,bottom:.1},ticksVisible:!0,ensureEdgeTickMarksVisible:!0,entireTextOnly:!1,textColor:wA?"#64748b":"#8b949e"},leftPriceScale:{visible:!1},timeScale:{borderColor:wA?"#e5e7eb":"#21262d",timeVisible:!0,secondsVisible:!1,rightOffset:12,barSpacing:6,minBarSpacing:4,shiftVisibleRangeOnNewBar:!1,fixLeftEdge:!1,fixRightEdge:!1,rightBarStaysOnScroll:!0,allowShiftVisibleRangeOnWhitespaceClick:!0},crosshair:{mode:UA===1?1:0,vertLine:{width:1,color:wA?"#3b82f6":"#58a6ff",style:0,labelBackgroundColor:wA?"#eff6ff":"#161b22",labelVisible:!0},horzLine:{width:1,color:wA?"#3b82f6":"#58a6ff",style:0,labelBackgroundColor:wA?"#eff6ff":"#161b22",labelVisible:!0},vertLineVisible:UA===1,horzLineVisible:UA===1},handleScroll:{mouseWheel:!0,pressedMouseMove:UA===null||UA===1,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},axisTouch:{time:!0,price:!0},mouseWheel:!0,pinch:!0}}),q=T.addCandlestickSeries({upColor:wA?"#089981":"#26a69a",downColor:wA?"#f23645":"#ef5350",wickUpColor:wA?"#089981":"#26a69a",wickDownColor:wA?"#f23645":"#ef5350",borderUpColor:wA?"#089981":"#26a69a",borderDownColor:wA?"#f23645":"#ef5350",borderVisible:!0});a.current=T,l.current=q,requestAnimationFrame(()=>{if(v&&T){const L=v.getBoundingClientRect();L.width>0&&L.height>0&&T.resize(L.width,L.height)}});const sA=T.timeScale(),Y=()=>{if(nA.current&&Gt.current.size>0){const L=sA.getVisibleRange();L&&HA(L)}};sA.subscribeVisibleTimeRangeChange(Y);const x=new ResizeObserver(L=>{for(const oA of L){const{width:lA,height:R}=oA.contentRect;if(lA>0&&R>0&&T){const y=sA.getVisibleRange();T.resize(lA,R),y&&setTimeout(()=>{try{sA.setVisibleRange(y)}catch{}},0)}}});return x.observe(v),()=>{sA.unsubscribeVisibleTimeRangeChange(Y),x.disconnect(),T.remove(),a.current=null,l.current=null,c.current=null,u.current=[]}},[]),K.useEffect(()=>{a.current&&a.current.applyOptions({grid:{vertLines:{visible:vA,color:vA?"rgba(110, 118, 129, 0.15)":"transparent",style:vA?2:0},horzLines:{visible:vA,color:vA?"rgba(110, 118, 129, 0.15)":"transparent",style:vA?2:0}}})},[vA]),K.useEffect(()=>{const v=a.current;if(!v)return;const b=ae==="light";v.applyOptions({layout:{background:{color:b?"#FFFFFF":"#12161d"},textColor:b?"#020617":"#fff"},grid:{vertLines:{color:vA?b?"rgba(100, 116, 139, 0.25)":"rgba(148, 163, 184, 0.2)":"transparent"},horzLines:{color:vA?b?"rgba(100, 116, 139, 0.25)":"rgba(148, 163, 184, 0.2)":"transparent"}},rightPriceScale:{borderColor:b?"#e5e7eb":"#1e293b"},timeScale:{borderColor:b?"#e5e7eb":"#1e293b"},crosshair:{vertLine:{color:b?"#3b82f6":"#58a6ff",labelBackgroundColor:b?"#eff6ff":"#161b22",width:1},horzLine:{color:b?"#3b82f6":"#58a6ff",labelBackgroundColor:b?"#eff6ff":"#161b22",width:1}}})},[ae,vA]),K.useEffect(()=>{if(!a.current)return;const b=!dt&&!(UA!==null&&UA!==1&&UA!==0),k=!dt;a.current.applyOptions({crosshair:{mode:UA===1?1:0,vertLine:{visible:UA===1,width:1,color:ae==="light"?"#94a3b8":"#64748b",style:0,labelBackgroundColor:ae==="light"?"#e5e7eb":"#1e293b"},horzLine:{visible:UA===1,width:1,color:ae==="light"?"#94a3b8":"#64748b",style:0,labelBackgroundColor:ae==="light"?"#e5e7eb":"#1e293b"}},handleScroll:{mouseWheel:k,pressedMouseMove:b,horzTouchDrag:b,vertTouchDrag:b},handleScale:{axisPressedMouseMove:{time:b,price:b},axisDoubleClickReset:{time:k,price:k},axisTouch:{time:b,price:b},mouseWheel:k,pinch:k}})},[UA,dt]),K.useEffect(()=>{(async()=>{if(!gA||!EA){le([]),nA.current=!1;return}try{if(pt(!0),le([]),nA.current=!1,l.current)try{l.current.setData([])}catch{}console.log(`📊 Fetching candles for ${gA} @ ${EA}`);const b=zu(EA),k=Yv(EA,b),wA=ft||Pv?.VITE_BASE_URL||"ws://localhost:8000",T=LA?.candles||"/api/chart/candles",q=KA?.candles||{},sA={symbol:q.symbol||"symbol",timeframe:q.timeframe||"timeframe",limit:q.limit||"limit",daysBack:q.daysBack||"daysBack"},Y={};Y[sA.symbol]=gA,Y[sA.timeframe]=EA,Y[sA.limit]=k,q.daysBack!==!1&&(Y[sA.daysBack]=b);const x=await $A.get(`${wA}${T}`,{params:Y,timeout:1e4});let L=[];if(Array.isArray(x.data)?L=x.data:x.data&&x.data.data&&Array.isArray(x.data.data)?L=x.data.data:x.data&&Array.isArray(x.data)&&(L=x.data),L&&L.length>0){console.log(`✅ Loaded ${L.length} raw candles from server`);const{candles:oA,stats:lA}=Dc(L,gA,EA);oA.length>0?(le(oA),Gt.current=new Map,oA.forEach(R=>{Gt.current.set(R.time,R)})):(console.warn(`⚠️ No valid candles after processing for ${gA}`),le([]))}else console.warn(`⚠️ No candle data returned for ${gA}`),le([])}catch(b){console.error(`❌ Error fetching ${gA}:`,b.message),le([])}finally{pt(!1)}})()},[gA,EA]),K.useEffect(()=>{console.log("🔧 [CANDLES DEBUG] Setting up WebSocket for candles:",{baseUrl:ft,symbol:gA,timeframe:EA}),ri.current=Pi.getSocket();const v=ri.current;console.log("🔌 [CANDLES DEBUG] Socket status for CandlesGateway (ROOT namespace):",{socketId:v.id,connected:v.connected,baseUrl:ft,socketUrl:v.io?.uri||"unknown",namespace:v.nsp?.name||"/",hasAuth:!!v.auth,note:"This socket MUST connect to root namespace for CandlesGateway"});const b=()=>{if(console.log("📡 [CANDLES DEBUG] subscribeToCandles called:",{selectedSymbol:gA,selectedTimeframe:EA,connected:v.connected,socketId:v.id}),gA&&EA&&v.connected){const Y={symbol:gA,timeframe:EA};console.log("📡 [CANDLES DEBUG] Emitting subscribeCandles:",Y),v.emit("subscribeCandles",Y),console.log("✅ [CANDLES DEBUG] subscribeCandles event emitted successfully")}else console.warn("⚠️ [CANDLES DEBUG] Cannot subscribe to candles:",{selectedSymbol:gA,selectedTimeframe:EA,connected:v.connected,socketId:v.id,reason:gA?EA?"Not connected":"No timeframe":"No symbol"})},k=()=>{console.log("✅ [CANDLES DEBUG] Chart WebSocket connected to backend, socket ID:",v.id),setTimeout(()=>{gA&&EA&&(console.log("📡 [CANDLES DEBUG] Backend connected, subscribing to candles..."),b())},200)},wA=Y=>{console.log("⚠️ [CANDLES DEBUG] Chart WebSocket disconnected:",Y)},T=Y=>{console.error("❌ [CANDLES DEBUG] Chart WebSocket connection error:",Y),console.error("❌ [CANDLES DEBUG] Error details:",{message:Y.message,description:Y.description,context:Y.context,type:Y.type})};v.on("connect",k),v.on("disconnect",wA),v.on("connect_error",T),v.on("subscription:confirmed",Y=>{console.log("✅ [CANDLES DEBUG] Subscription confirmed:",Y),Y.type==="candles"&&console.log("✅ [CANDLES DEBUG] Candle subscription confirmed for:",{symbol:Y.symbol,timeframe:Y.timeframe})});const q=Y=>{if(console.log("📊 [CANDLES DEBUG] candleUpdate event received:",Y),!Y||!Y.candle||!Y.symbol){console.warn("⚠️ [CANDLES DEBUG] Invalid candleUpdate data:",Y);return}if(console.log("✅ [CANDLES DEBUG] Valid candleUpdate received:",{symbol:Y.symbol,timeframe:Y.timeframe,candle:Y.candle,selectedSymbol:gA,selectedTimeframe:EA}),Y.symbol.toUpperCase()!==gA?.toUpperCase()){console.log(`⚠️ [CANDLES DEBUG] Symbol mismatch: received ${Y.symbol}, selected ${gA}`);return}const{candle:x}=Y;console.log("✅ [CANDLES DEBUG] Processing candle update:",{symbol:Y.symbol,timeframe:Y.timeframe,candle:x,candleTime:x.time,candleClose:x.close});const L=_c(x,gA,EA);if(!L){console.warn("⚠️ [CANDLES DEBUG] Rejected realtime candle (invalid):",{symbol:Y.symbol,candle:x});return}console.log("✅ [CANDLES DEBUG] Processed candle:",{time:L.time,open:L.open,high:L.high,low:L.low,close:L.close});const oA=Date.now();if(oA-Os.current<200)return;Os.current=oA;const lA=a.current?.timeScale(),R=lA?.getVisibleRange(),y=l.current,H=a.current;if(!y||!H||!nA.current){console.warn("⚠️ [CANDLES DEBUG] Chart not ready for update:",{hasSeries:!!y,hasChart:!!H,hasInitialized:nA.current});return}const O=y?.seriesType?.(),Q=zA==="line"?"Line":zA==="area"?"Area":zA==="bars"?"Bar":"Candlestick";if(O!==Q){console.warn("⚠️ [CANDLES DEBUG] Series type mismatch:",{expected:Q,actual:O,chartType:zA,note:"Chart type switch might be in progress, skipping update"});return}try{const g=Gt.current.get(L.time),I=g?{time:L.time,open:g.open,high:Math.max(g.high,L.close),low:Math.min(g.low,L.close),close:L.close}:L;Gt.current.set(L.time,I);try{zA==="line"||zA==="area"?y.update({time:I.time,value:I.close}):y.update(I),lA&&R&&HA(R),console.log("✅ [CANDLES DEBUG] Candle update completed successfully")}catch(M){throw console.error("❌ [CANDLES DEBUG] Error in s.update():",M),console.error("❌ [CANDLES DEBUG] Series type:",y?.seriesType?.()),console.error("❌ [CANDLES DEBUG] Processed candle:",L),M}}catch(g){console.error("❌ [CANDLES DEBUG] Error updating candle:",g),console.error("❌ [CANDLES DEBUG] Error stack:",g.stack)}};v.on("candleUpdate",q);const sA=()=>{v.connected&&gA&&EA?(console.log("✅ [CANDLES DEBUG] Socket connected, subscribing to backend..."),b()):console.log("⏳ [CANDLES DEBUG] Waiting for socket connection...",{connected:v.connected,hasSymbol:!!gA,hasTimeframe:!!EA})};if(v.connected)sA();else{const Y=()=>{console.log("✅ [CANDLES DEBUG] Socket connected to backend, subscribing..."),setTimeout(sA,200)};v.once("connect",Y),setTimeout(()=>{v.connected&&sA()},500)}return()=>{v.off("candleUpdate",q),v.off("connect",k),v.off("disconnect",wA),v.off("connect_error",T),v.off("subscription:confirmed"),gA&&EA&&v.connected&&(console.log(`🔌 Unsubscribing from: ${gA}@${EA}`),v.emit("unsubscribeCandles",{symbol:gA,timeframe:EA}))}},[gA,EA,ft]),K.useEffect(()=>{const v=l.current,b=a.current;if(!(!v||!b)&&!(FA.length===0&&nA.current)){if(FA.length===0&&!nA.current){if(De)return;const k=b.timeScale();v.setData([]),k.fitContent();return}if(!nA.current){const k=b.timeScale(),wA=CA(gA,EA);SA.current,SA.current=wA,console.log("sorted candles 1");const T=[...FA].sort((sA,Y)=>sA.time-Y.time);if(console.log("📊 [CANDLES DEBUG] Initializing chart with candles:",{candleCount:T?.length,chartType:zA,seriesType:v?.seriesType?.()||"unknown",firstCandle:T[0],lastCandle:T[T?.length-1]}),console.log("sorted candles 2"),zA==="line"||zA==="area"){const sA=T?.map(Y=>({time:Y.time,value:Y.close})).filter(Y=>Y.time!=null);sA.length>0&&(console.log("📊 [CANDLES DEBUG] Setting line/area data:",sA.length,"points"),v.setData(sA),console.log("✅ [CANDLES DEBUG] Line/area data set successfully"))}else console.log("sorted candles 3"),T?.length>0&&(console.log("📊 [CANDLES DEBUG] Setting candlestick data:",T?.length,"candles"),console.log("📊 [CANDLES DEBUG] First candle sample:",T[0]),console.log("📊 [CANDLES DEBUG] Last candle sample:",T[T?.length-1]),v.setData(T),console.log("✅ [CANDLES DEBUG] Candlestick data set successfully"));if(console.log("sorted candles 4"),T?.length>0){const sA=T[T?.length-1].time,Y=Ot(EA)||60,x=EA==="M1"?150:EA==="M5"?120:100,L=sA-x*Y;console.log("📊 [CANDLES DEBUG] Setting visible range:",{from:L,to:sA+Y*2,visibleBars:x,timeframeSeconds:Y});try{k.setVisibleRange({from:L,to:sA+Y*2}),console.log("✅ [CANDLES DEBUG] Visible range set successfully")}catch(oA){console.warn("⚠️ [CANDLES DEBUG] Failed to set visible range, using fitContent:",oA),k.fitContent()}}else console.warn("⚠️ [CANDLES DEBUG] No candles to set visible range, using fitContent"),k.fitContent();try{b.priceScale("right").applyOptions({borderColor:"#1e293b",autoScale:!0,scaleMargins:{top:.1,bottom:.1},ticksVisible:!0,ensureEdgeTickMarksVisible:!0}),console.log("✅ [CANDLES DEBUG] Price scale configured successfully")}catch{console.warn("⚠️ [CANDLES DEBUG] Failed to configure price scale")}nA.current=!0;const q=k.getVisibleRange();HA(q),console.log("sorted candles 5"),console.log("✅ [CANDLES DEBUG] Chart initialization completed:",{hasInitialized:nA.current,visibleRange:q,candleCount:T?.length})}}},[FA.length,zA,gA,EA]),K.useEffect(()=>{const v=a.current;if(!v||!nA.current||FA.length===0){console.log("⏳ [CANDLES DEBUG] Chart type switch skipped:",{hasChart:!!v,hasInitialized:nA.current,candleCount:FA.length,chartType:zA});return}console.log("🔄 [CANDLES DEBUG] Switching chart type:",{from:l.current?.seriesType?.()||"unknown",to:zA,candleCount:FA.length});const b=v.timeScale(),k=b.getVisibleRange()||MA();if(l.current)try{v.removeSeries(l.current)}catch{}if(c.current)try{v.removeSeries(c.current),c.current=null}catch{}let wA;if(zA==="bars"){const T=ae==="light";wA=v.addBarSeries({upColor:T?"#089981":"#26A69A",downColor:T?"#f23645":"#EF5350",borderUpColor:T?"#089981":"#26A69A",borderDownColor:T?"#f23645":"#EF5350",scaleMargins:{top:.1,bottom:.1}}),console.log("sorted candles 6");const q=[...FA].sort((sA,Y)=>sA.time-Y.time);q?.length>0&&wA.setData(q)}else if(zA==="line"){wA=v.addLineSeries({color:"#38bdf8",lineWidth:2,priceLineVisible:!1,lastValueVisible:!0,scaleMargins:{top:.1,bottom:.1}});const T=ye(gt);T.length>0&&wA.setData(T)}else if(zA==="area"){wA=v.addAreaSeries({lineColor:"#38bdf8",topColor:"rgba(56,189,248,0.4)",bottomColor:"rgba(56,189,248,0.0)",lineWidth:2,priceLineVisible:!1,lastValueVisible:!0,scaleMargins:{top:.1,bottom:.1}});const T=ye(gt);T.length>0&&wA.setData(T)}else if(zA==="volume ticks"||zA==="volume"){const T=ae==="light";wA=v.addCandlestickSeries({upColor:T?"#089981":"#26A69A",downColor:T?"#f23645":"#EF5350",wickUpColor:T?"#089981":"#26A69A",wickDownColor:T?"#f23645":"#EF5350",borderUpColor:T?"#089981":"#26A69A",borderDownColor:T?"#f23645":"#EF5350",borderVisible:!0,priceScaleId:"right"}),console.log("sorted candles 7");const q=[...FA].sort((x,L)=>x.time-L.time);q?.length>0&&wA.setData(q);const sA=v.addHistogramSeries({priceFormat:{type:"volume"},priceScaleId:"vol",base:0,priceLineVisible:!1,lastValueVisible:!1,color:"rgba(38,166,154,0.15)"});v.priceScale("right").applyOptions({scaleMargins:{top:.05,bottom:.3}}),v.priceScale("vol").applyOptions({scaleMargins:{top:.75,bottom:0},visible:!1}),console.log("sorted candles 8");const Y=q?.map(x=>({time:x.time,value:x.volume||0,color:x.close>=x.open?"rgba(38,166,154,0.25)":"rgba(239,83,80,0.25)"}));Y.length>0&&sA.setData(Y),c.current=sA}else{const T=ae==="light";wA=v.addCandlestickSeries({upColor:T?"#089981":"#26A69A",downColor:T?"#f23645":"#EF5350",wickUpColor:T?"#089981":"#26A69A",wickDownColor:T?"#f23645":"#EF5350",borderUpColor:T?"#089981":"#26A69A",borderDownColor:T?"#f23645":"#EF5350",borderVisible:!0,scaleMargins:{top:.1,bottom:.1}}),console.log("sorted candles 9");const q=[...FA].sort((sA,Y)=>sA.time-Y.time);q?.length>0&&wA.setData(q)}if(l.current=wA,k&&nA.current)setTimeout(()=>{try{b.setVisibleRange(k),HA(k)}catch{if(FA.length>0)try{const q=FA[FA.length-1].time,sA=q-6e3;b.setVisibleRange({from:sA,to:q}),HA(b.getVisibleRange())}catch{b.fitContent(),HA(b.getVisibleRange())}}try{v.priceScale("right").applyOptions({borderColor:"#1e293b",autoScale:!0,scaleMargins:{top:.1,bottom:.1},ticksVisible:!0,ensureEdgeTickMarksVisible:!0})}catch{}},0);else if(!nA.current){b.fitContent();try{v.priceScale("right").applyOptions({borderColor:"#1e293b",autoScale:!0,scaleMargins:{top:.1,bottom:.1},ticksVisible:!0,ensureEdgeTickMarksVisible:!0})}catch{}nA.current=!0,HA(b.getVisibleRange())}},[zA,FA.length,gt.length]),K.useEffect(()=>{const v=a.current,b=c.current;if(!v||!b||!nA.current||FA.length===0||zA!=="volume"&&zA!=="volume ticks")return;console.log("sorted candles 10");const k=[...FA].sort((T,q)=>T.time-q.time);console.log("sorted candles 11");const wA=k?.map(T=>({time:T.time,value:T.volume||0,color:T.close>=T.open?"rgba(38,166,154,0.25)":"rgba(239,83,80,0.25)"}));wA.length>0&&b.setData(wA)},[FA,zA]),K.useEffect(()=>{const v=a.current,b=l.current,k=o.current;if(!v||!b||!k)return;const T=UA!==null?[null,null,"trendline","parallellines","fibonacci","rectangle",null,"text",null,null,null,null,null,null,null,null,null,null,null,null,"pricelevel","horizontalray","verticalline","infoline","rulerline","arrowedline","rayline","extendedline","crossline","trendbyangle","disjointchannel","flattopbottom"][UA]:null;if(!T){if(d.current=!1,B.current=null,p.current=null,w.current=null,f.current?.series)try{v.removeSeries(f.current.series)}catch{}f.current=null;return}if(T==="pricelevel"){const x=L=>{const oA=k.getBoundingClientRect(),lA=L.clientX-oA.left,R=L.clientY-oA.top,y=v.timeScale().coordinateToTime(lA),H=b.coordinateToPrice(R);if(y==null||H==null)return;const Q={type:"pricelevel",priceLine:b.createPriceLine({price:H,color:"#3b82f6",lineWidth:2,lineStyle:2,axisLabelVisible:!0,title:H.toFixed(5)}),price:H};eA(g=>[...g,Q]),u.current.push(Q)};return k.addEventListener("click",x),()=>{k.removeEventListener("click",x)}}if(T==="horizontalray"){const x=L=>{const oA=k.getBoundingClientRect(),lA=L.clientX-oA.left,R=L.clientY-oA.top,y=v.timeScale().coordinateToTime(lA),H=b.coordinateToPrice(R);if(y==null||H==null)return;const O=new zv(H,y);b.attachPrimitive(O);const Q=iA(y),g={type:"horizontalray",primitive:O,price:H,originTime:Q};eA(I=>[...I,g]),u.current.push(g)};return k.addEventListener("click",x),()=>k.removeEventListener("click",x)}if(T==="verticalline"){const x=L=>{const oA=k.getBoundingClientRect(),lA=L.clientX-oA.left,R=v.timeScale().coordinateToTime(lA);if(R==null)return;const y=new Jv(R);b.attachPrimitive(y);const H=iA(R),O={type:"verticalline",primitive:y,time:H};eA(Q=>[...Q,O]),u.current.push(O)};return k.addEventListener("click",x),()=>k.removeEventListener("click",x)}if(T==="infoline"){let x=null,L=null;const oA=R=>{if(!x)return;const y=k.getBoundingClientRect(),H=R.clientX-y.left,O=R.clientY-y.top,Q=v.timeScale().coordinateToTime(H),g=b.coordinateToPrice(O);if(Q==null||g==null)return;L||(L=v.addLineSeries({color:"#3b82f6",lineWidth:2,crosshairMarkerVisible:!1,priceLineVisible:!1,lastValueVisible:!1}));const I=x.normalizedTime,M=iA(Q);if(I==null||M==null||I===M)return;const D=I<=M?[{time:I,value:x.price},{time:M,value:g}]:[{time:M,value:g},{time:I,value:x.price}];try{L.setData(D)}catch{}},lA=R=>{const y=k.getBoundingClientRect(),H=R.clientX-y.left,O=R.clientY-y.top,Q=v.timeScale().coordinateToTime(H),g=b.coordinateToPrice(O);if(Q==null||g==null)return;if(!x){x={rawTime:Q,price:g,normalizedTime:iA(Q),x:H,y:O};return}if(L){try{v.removeSeries(L)}catch{}L=null}const I=x.normalizedTime,M=iA(Q);if(I==null||M==null)return;const D=g-x.price,m=D/Math.abs(x.price)*100,_=Ot(EA)||3600,G=Math.abs(M-I),$=Math.max(1,Math.round(G/_)),X=Math.max(1,Math.round(G/86400)),AA=x.x,rA=x.y,bA=H,VA=Math.atan2(-(O-rA),bA-AA)*(180/Math.PI),Ae={priceDiff:D,pricePct:m,bars:$,days:X,angle:VA},JA=new Gv({rawTime:x.rawTime,price:x.price},{rawTime:Q,price:g},Ae);b.attachPrimitive(JA);const he={type:"infoline",primitive:JA,p1:{time:I,price:x.price},p2:{time:M,price:g}};eA(_e=>[..._e,he]),u.current.push(he),x=null,yA(null)};return k.addEventListener("mousemove",oA),k.addEventListener("click",lA),()=>{if(k.removeEventListener("mousemove",oA),k.removeEventListener("click",lA),L)try{v.removeSeries(L)}catch{}}}if(T==="rulerline"){let x=null,L=null;const oA=(y,H,O,Q)=>{const g=iA(y),I=iA(O),M=Q-H,D=M/Math.abs(H)*100,m=Ot(EA)||3600,_=Math.abs((I??0)-(g??0)),G=Math.max(1,Math.round(_/m)),$=Math.max(1,Math.round(_/86400));return{priceDiff:M,pricePct:D,bars:G,days:$}},lA=y=>{if(!x)return;const H=k.getBoundingClientRect(),O=y.clientX-H.left,Q=y.clientY-H.top,g=v.timeScale().coordinateToTime(O),I=b.coordinateToPrice(Q);if(g==null||I==null)return;const M=iA(g);if(M==null||M===x.normalizedTime)return;const D=oA(x.rawTime,x.price,g,I);if(!L)L=new Nu({rawTime:x.rawTime,price:x.price},{rawTime:g,price:I},D),b.attachPrimitive(L);else{L.p2={rawTime:g,price:I},L.info=D;const m=I>=x.price;L.color=m?"#3b82f6":"#ef5350",L.fillColor=m?"rgba(59,130,246,0.1)":"rgba(239,83,80,0.1)";try{a.current?.applyOptions({})}catch{}}},R=y=>{const H=k.getBoundingClientRect(),O=y.clientX-H.left,Q=y.clientY-H.top,g=v.timeScale().coordinateToTime(O),I=b.coordinateToPrice(Q);if(g==null||I==null)return;if(!x){x={rawTime:g,price:I,normalizedTime:iA(g)};return}if(L){try{b.detachPrimitive(L)}catch{}L=null}const M=x.normalizedTime,D=iA(g);if(M==null||D==null)return;const m=oA(x.rawTime,x.price,g,I),_=new Nu({rawTime:x.rawTime,price:x.price},{rawTime:g,price:I},m);b.attachPrimitive(_);const G={type:"rulerline",primitive:_,p1:{rawTime:x.rawTime,normalizedTime:M,price:x.price},p2:{rawTime:g,normalizedTime:D,price:I}};eA($=>[...$,G]),u.current.push(G),x=null,yA(null)};return k.addEventListener("mousemove",lA),k.addEventListener("click",R),()=>{if(k.removeEventListener("mousemove",lA),k.removeEventListener("click",R),L)try{b.detachPrimitive(L)}catch{}}}if(T==="arrowedline"){let x=null,L=null;const oA=R=>{if(!x)return;const y=k.getBoundingClientRect(),H=R.clientX-y.left,O=R.clientY-y.top,Q=v.timeScale().coordinateToTime(H),g=b.coordinateToPrice(O);if(Q==null||g==null)return;const I=iA(Q);if(!(I==null||I===x.normalizedTime))if(!L)L=new Ku({rawTime:x.rawTime,price:x.price},{rawTime:Q,price:g}),b.attachPrimitive(L);else{L.p2={rawTime:Q,price:g};try{a.current?.applyOptions({})}catch{}}},lA=R=>{const y=k.getBoundingClientRect(),H=R.clientX-y.left,O=R.clientY-y.top,Q=v.timeScale().coordinateToTime(H),g=b.coordinateToPrice(O);if(Q==null||g==null)return;if(!x){x={rawTime:Q,price:g,normalizedTime:iA(Q)};return}if(L){try{b.detachPrimitive(L)}catch{}L=null}const I=x.normalizedTime,M=iA(Q);if(I==null||M==null||I===M)return;const D=new Ku({rawTime:x.rawTime,price:x.price},{rawTime:Q,price:g});b.attachPrimitive(D);const m={type:"arrowedline",primitive:D,p1:{rawTime:x.rawTime,normalizedTime:I,price:x.price},p2:{rawTime:Q,normalizedTime:M,price:g}};eA(_=>[..._,m]),u.current.push(m),x=null,yA(null)};return k.addEventListener("mousemove",oA),k.addEventListener("click",lA),()=>{if(k.removeEventListener("mousemove",oA),k.removeEventListener("click",lA),L)try{b.detachPrimitive(L)}catch{}}}if(T==="rayline"){const x=L=>{const oA=k.getBoundingClientRect(),lA=L.clientX-oA.left,R=L.clientY-oA.top,y=v.timeScale().coordinateToTime(lA),H=b.coordinateToPrice(R);if(y==null||H==null)return;const O=lA+140,Q=v.timeScale().coordinateToTime(O);if(Q==null)return;const g=iA(y),I=iA(Q);if(g==null||I==null)return;const M=new Rv({rawTime:y,price:H},{rawTime:Q,price:H});b.attachPrimitive(M);const D={type:"rayline",primitive:M,p1:{rawTime:y,normalizedTime:g,price:H},p2:{rawTime:Q,normalizedTime:I,price:H}};eA(m=>[...m,D]),u.current.push(D),yA(null)};return k.addEventListener("click",x),()=>k.removeEventListener("click",x)}if(T==="extendedline"){const x=L=>{const oA=k.getBoundingClientRect(),lA=L.clientX-oA.left,R=L.clientY-oA.top,y=v.timeScale().coordinateToTime(lA),H=b.coordinateToPrice(R);if(y==null||H==null)return;const O=lA+140,Q=v.timeScale().coordinateToTime(O);if(Q==null)return;const g=iA(y),I=iA(Q);if(g==null||I==null)return;const M=new Wv({rawTime:y,price:H},{rawTime:Q,price:H});b.attachPrimitive(M);const D={type:"extendedline",primitive:M,p1:{rawTime:y,normalizedTime:g,price:H},p2:{rawTime:Q,normalizedTime:I,price:H}};eA(m=>[...m,D]),u.current.push(D),yA(null)};return k.addEventListener("click",x),()=>k.removeEventListener("click",x)}if(T==="crossline"){const x=L=>{const oA=k.getBoundingClientRect(),lA=L.clientX-oA.left,R=L.clientY-oA.top,y=v.timeScale().coordinateToTime(lA),H=b.coordinateToPrice(R);if(y==null||H==null)return;const O=iA(y);if(O==null)return;const Q=new $v({rawTime:y,price:H});b.attachPrimitive(Q);const g={type:"crossline",primitive:Q,p:{rawTime:y,normalizedTime:O,price:H}};eA(I=>[...I,g]),u.current.push(g),yA(null)};return k.addEventListener("click",x),()=>k.removeEventListener("click",x)}if(T==="trendbyangle"){const x=L=>{const oA=k.getBoundingClientRect(),lA=L.clientX-oA.left,R=L.clientY-oA.top,y=v.timeScale().coordinateToTime(lA),H=b.coordinateToPrice(R);if(y==null||H==null)return;const O=lA+140,Q=v.timeScale().coordinateToTime(O);if(Q==null)return;const g=iA(y),I=iA(Q);if(g==null||I==null)return;const M=new Xv({rawTime:y,price:H},{rawTime:Q,price:H});b.attachPrimitive(M);const D={type:"trendbyangle",primitive:M,p1:{rawTime:y,normalizedTime:g,price:H},p2:{rawTime:Q,normalizedTime:I,price:H}};eA(m=>[...m,D]),u.current.push(D),yA(null)};return k.addEventListener("click",x),()=>k.removeEventListener("click",x)}if(T==="disjointchannel"){let x=null,L=null,oA=null,lA=null,R=0,y=null;const H=(g,I,M,D)=>{if(!y)y=new Jo(g,I,M,D),b.attachPrimitive(y);else{y.p1=g,y.p2=I,y.p3=M,y.p4=D;try{a.current?.applyOptions({})}catch{}}},O=g=>{if(R===0||!x)return;const I=k.getBoundingClientRect(),M=g.clientX-I.left,D=g.clientY-I.top;if(R===1){const m=b.coordinateToPrice(D);if(m==null)return;L={rawTime:x.rawTime,normalizedTime:x.normalizedTime,price:m},H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price});return}if(R===2&&L){const m=v.timeScale().coordinateToTime(M),_=b.coordinateToPrice(D);if(m==null||_==null)return;const G=iA(m);if(G==null)return;const $=(x.price+L.price)/2;_>=$?(oA={rawTime:m,normalizedTime:G,price:_},lA={rawTime:m,normalizedTime:G,price:2*$-_}):(lA={rawTime:m,normalizedTime:G,price:_},oA={rawTime:m,normalizedTime:G,price:2*$-_}),H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:oA.rawTime,price:oA.price},{rawTime:lA.rawTime,price:lA.price})}},Q=g=>{const I=k.getBoundingClientRect(),M=g.clientX-I.left,D=g.clientY-I.top,m=v.timeScale().coordinateToTime(M),_=b.coordinateToPrice(D);if(m==null||_==null)return;const G=iA(m);if(G!=null){if(R===0){x={rawTime:m,normalizedTime:G,price:_},L={rawTime:m,normalizedTime:G,price:_},R=1,H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price});return}if(R===1){const $=b.coordinateToPrice(D);if($==null||Math.abs($-x.price)<1e-7)return;L={rawTime:x.rawTime,normalizedTime:x.normalizedTime,price:$},R=2;return}if(R===2&&y){try{b.detachPrimitive(y)}catch{}const $=new Jo(y.p1,y.p2,y.p3,y.p4);b.attachPrimitive($);const X={type:"disjointchannel",primitive:$,p1:x,p2:L,p3:{rawTime:y.p3.rawTime,normalizedTime:iA(y.p3.rawTime),price:y.p3.price},p4:{rawTime:y.p4.rawTime,normalizedTime:iA(y.p4.rawTime),price:y.p4.price}};eA(AA=>[...AA,X]),u.current.push(X),yA(null)}}};return k.addEventListener("mousemove",O),k.addEventListener("click",Q),()=>{if(k.removeEventListener("mousemove",O),k.removeEventListener("click",Q),y)try{b.detachPrimitive(y)}catch{}}}if(T==="flattopbottom"){let x=null,L=null,oA=null,lA=null,R=0,y=null;const H=(g,I,M,D)=>{if(!y)y=new Vu(g,I,M,D),b.attachPrimitive(y);else{y.p1=g,y.p2=I,y.p3=M,y.p4=D;try{a.current?.applyOptions({})}catch{}}},O=g=>{if(R===0||!x)return;const I=k.getBoundingClientRect(),M=g.clientX-I.left,D=g.clientY-I.top;if(R===1){const m=b.coordinateToPrice(D);if(m==null)return;L={rawTime:x.rawTime,normalizedTime:x.normalizedTime,price:m},H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price});return}if(R===2&&L){const m=v.timeScale().coordinateToTime(M),_=b.coordinateToPrice(D);if(m==null||_==null)return;const G=iA(m);if(G==null)return;oA={rawTime:m,normalizedTime:G,price:_},lA={rawTime:m,normalizedTime:G,price:L.price},H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:oA.rawTime,price:oA.price},{rawTime:lA.rawTime,price:lA.price})}},Q=g=>{const I=k.getBoundingClientRect(),M=g.clientX-I.left,D=g.clientY-I.top,m=v.timeScale().coordinateToTime(M),_=b.coordinateToPrice(D);if(m==null||_==null)return;const G=iA(m);if(G!=null){if(R===0){x={rawTime:m,normalizedTime:G,price:_},L={rawTime:m,normalizedTime:G,price:_},R=1,H({rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price},{rawTime:x.rawTime,price:x.price},{rawTime:L.rawTime,price:L.price});return}if(R===1){const $=b.coordinateToPrice(D);if($==null||Math.abs($-x.price)<1e-7)return;L={rawTime:x.rawTime,normalizedTime:x.normalizedTime,price:$},R=2;return}if(R===2&&y){try{b.detachPrimitive(y)}catch{}const $=new Vu(y.p1,y.p2,y.p3,y.p4);b.attachPrimitive($);const X={type:"flattopbottom",primitive:$,p1:x,p2:L,p3:{rawTime:y.p3.rawTime,normalizedTime:iA(y.p3.rawTime),price:y.p3.price},p4:{rawTime:y.p4.rawTime,normalizedTime:iA(y.p4.rawTime),price:y.p4.price}};eA(AA=>[...AA,X]),u.current.push(X),yA(null)}}};return k.addEventListener("mousemove",O),k.addEventListener("click",Q),()=>{if(k.removeEventListener("mousemove",O),k.removeEventListener("click",Q),y)try{b.detachPrimitive(y)}catch{}}}if(T==="trendline"){const x=R=>{R.preventDefault(),R.stopPropagation(),R.stopImmediatePropagation();const y=k.getBoundingClientRect(),H=R.clientX-y.left,O=R.clientY-y.top;let Q=v.timeScale().coordinateToTime(H);const g=b.coordinateToPrice(O);if(!(Q==null||g==null)&&(Q=iA(Q),Q!=null))if(w.current===null){w.current={time:Q,price:g};const I=v.addLineSeries({color:"#22c55e",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});f.current={type:"trendline",series:I},I.setData([{time:Q,value:g}])}else{const I=w.current,M={time:Q,price:g},D=1,m=1e-5,_=Math.abs(M.time-I.time),G=Math.abs(M.price-I.price);if(_<D&&G<m){try{v.removeSeries(f.current.series)}catch{}w.current=null,f.current=null;return}const $={time:I.time,price:I.price},X={time:M.time,price:M.price},AA=ye([{time:$.time,value:$.price},{time:X.time,value:X.price}]);if(AA.length>0){f.current.series.setData(AA);const rA={type:"trendline",series:f.current.series,point1:$,point2:X};eA(bA=>[...bA,rA]),u.current.push(rA)}yA(null),w.current=null,f.current=null}},L=R=>{if(w.current===null||f.current?.type!=="trendline")return;R.preventDefault(),R.stopPropagation();const y=k.getBoundingClientRect(),H=R.clientX-y.left,O=R.clientY-y.top;let Q=v.timeScale().coordinateToTime(H);const g=b.coordinateToPrice(O);if(Q==null||g==null||(Q=iA(Q),Q==null))return;const I=w.current,M=ye([{time:I.time,value:I.price},{time:Q,value:g}]);M.length>0&&f.current.series.setData(M)},oA=R=>{R.stopPropagation()},lA={capture:!0,passive:!1};return k.addEventListener("click",x,lA),k.addEventListener("mousemove",L,lA),k.addEventListener("mousemove",oA,lA),()=>{if(w.current=null,f.current?.type==="trendline"&&f.current?.series){try{v.removeSeries(f.current.series)}catch{}f.current=null}k.removeEventListener("click",x,lA),k.removeEventListener("mousemove",L,lA),k.removeEventListener("mousemove",oA,lA)}}if(T==="parallellines"){const x={capture:!0,passive:!1},L=H=>{H.preventDefault(),H.stopPropagation(),H.stopImmediatePropagation();const O=k.getBoundingClientRect(),Q=H.clientX-O.left,g=H.clientY-O.top;let I=v.timeScale().coordinateToTime(Q);const M=b.coordinateToPrice(g);if(I==null||M==null||(I=iA(I),I==null))return;const D={time:I,price:M},m=F.current;if(m.length===0){F.current=[D];const _=v.addLineSeries({color:"#8b5cf6",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});_.setData([{time:I,value:M}]),f.current={type:"parallellines",series:_,previewLine:null}}else if(m.length===1){F.current=[m[0],D];const _=ye([{time:m[0].time,value:m[0].price},{time:I,value:M}]);_.length>0&&f.current.series.setData(_),f.current.previewLine=v.addLineSeries({color:"#8b5cf6",lineWidth:2,lineStyle:2,priceLineVisible:!1,lastValueVisible:!1});const G=Zo(v,b,m[0],D,D);G&&f.current.previewLine.setData(ye([{time:G[0].time,value:G[0].price},{time:G[1].time,value:G[1].price}]))}else{const[_,G]=m,$=D;if(f.current?.previewLine){try{v.removeSeries(f.current.previewLine)}catch{}f.current.previewLine=null}const X=f.current?.series;if(!X)return;const AA=Zo(v,b,_,G,$);if(!AA)return;const rA=v.addLineSeries({color:"#8b5cf6",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});X.setData(ye([{time:_.time,value:_.price},{time:G.time,value:G.price}])),rA.setData(ye([{time:AA[0].time,value:AA[0].price},{time:AA[1].time,value:AA[1].price}]));const bA={type:"parallellines",point1:_,point2:G,point3:$,baseLine:X,parallelLine:rA};eA(_A=>[..._A,bA]),u.current.push(bA),yA(null),F.current=[],f.current=null}},oA=H=>{const O=F.current;if(O.length!==1||!f.current?.series)return;const Q=k.getBoundingClientRect(),g=H.clientX-Q.left,I=H.clientY-Q.top;let M=v.timeScale().coordinateToTime(g);const D=b.coordinateToPrice(I);if(M==null||D==null||(M=iA(M),M==null))return;const m=ye([{time:O[0].time,value:O[0].price},{time:M,value:D}]);m.length>0&&f.current.series.setData(m)},lA=H=>{const O=F.current;if(O.length!==2||!f.current?.previewLine)return;const Q=k.getBoundingClientRect(),g=H.clientX-Q.left,I=H.clientY-Q.top;let M=v.timeScale().coordinateToTime(g);const D=b.coordinateToPrice(I);if(M==null||D==null||(M=iA(M),M==null))return;const m={time:M,price:D},_=Zo(v,b,O[0],O[1],m);_&&f.current.previewLine.setData(ye([{time:_[0].time,value:_[0].price},{time:_[1].time,value:_[1].price}]))},R=H=>{oA(H),lA(H)},y=H=>{H.stopPropagation()};return k.addEventListener("click",L,x),k.addEventListener("mousemove",R,x),k.addEventListener("mousemove",y,x),()=>{if(F.current=[],f.current?.type==="parallellines"){try{f.current.series&&v.removeSeries(f.current.series),f.current.previewLine&&v.removeSeries(f.current.previewLine)}catch{}f.current=null}k.removeEventListener("click",L,x),k.removeEventListener("mousemove",R,x),k.removeEventListener("mousemove",y,x)}}if(T==="fibonacci"){let x=null,L=null;const oA=R=>{if(!x)return;const y=k.getBoundingClientRect(),H=R.clientX-y.left,O=R.clientY-y.top,Q=v.timeScale().coordinateToTime(H),g=b.coordinateToPrice(O);if(!(Q==null||g==null))if(!L)L=new Pu({rawTime:x.rawTime,price:x.price},{rawTime:Q,price:g}),b.attachPrimitive(L);else{L.p2={rawTime:Q,price:g};try{v.applyOptions({})}catch{}}},lA=R=>{const y=k.getBoundingClientRect(),H=R.clientX-y.left,O=R.clientY-y.top,Q=v.timeScale().coordinateToTime(H),g=b.coordinateToPrice(O);if(Q==null||g==null)return;if(!x){x={rawTime:Q,price:g,normalizedTime:iA(Q)};return}if(L){try{b.detachPrimitive(L)}catch{}L=null}const I=x.normalizedTime,M=iA(Q);if(I==null||M==null)return;if(Math.abs(g-x.price)<1e-5){x=null;return}const D=new Pu({rawTime:x.rawTime,price:x.price},{rawTime:Q,price:g});b.attachPrimitive(D);const m={type:"fibonacci",primitive:D,p1:{rawTime:x.rawTime,normalizedTime:I,price:x.price},p2:{rawTime:Q,normalizedTime:M,price:g}};eA(_=>[..._,m]),u.current.push(m),x=null,yA(null)};return k.addEventListener("mousemove",oA),k.addEventListener("click",lA),()=>{if(k.removeEventListener("mousemove",oA),k.removeEventListener("click",lA),L)try{b.detachPrimitive(L)}catch{}}}if(w.current=null,f.current?.type==="trendline"&&f.current?.series){try{v.removeSeries(f.current.series)}catch{}f.current=null}const q=x=>{if(x.preventDefault(),x.stopPropagation(),x.stopImmediatePropagation(),T==="trendline"||T==="parallellines"||T==="fibonacci"||T!=="rectangle")return;const L=k.getBoundingClientRect(),oA=x.clientX-L.left,lA=x.clientY-L.top;let R=v.timeScale().coordinateToTime(oA);const y=b.coordinateToPrice(lA);if(!(R==null||y==null)&&(R=iA(R),R!=null)){if(d.current=!0,B.current={time:R,price:y},p.current=null,T==="rectangle"){const H=v.addBaselineSeries({baseValue:{type:"price",price:y},topLineColor:"#2563eb",bottomLineColor:"#2563eb",topFillColor1:"rgba(59, 130, 246, 0.38)",topFillColor2:"rgba(59, 130, 246, 0.22)",bottomFillColor1:"rgba(59, 130, 246, 0.22)",bottomFillColor2:"rgba(59, 130, 246, 0.38)",priceLineVisible:!1,lastValueVisible:!1,lineWidth:2,lineStyle:0});f.current={type:"rectangle",series:H}}if(T==="parallellines"){const H=v.addLineSeries({color:"#8b5cf6",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});f.current={type:"parallellines",series:H,firstLine:null,secondLine:null}}}},sA=x=>{if(!d.current||!B.current||!f.current)return;x.preventDefault(),x.stopPropagation(),x.stopImmediatePropagation();const L=k.getBoundingClientRect(),oA=x.clientX-L.left,lA=x.clientY-L.top;let R=v.timeScale().coordinateToTime(oA);const y=b.coordinateToPrice(lA);if(R==null||y==null||(R=iA(R),R==null))return;p.current={time:R,price:y};const H=B.current;if(f.current.type==="rectangle"){const O=Math.max(H.price,y),Q=Math.min(H.price,y),g=iA(Math.min(H.time,R)),I=iA(Math.max(H.time,R));if(g==null||I==null||Math.abs(I-g)<1||Math.abs(O-Q)<1e-5)return;const M=f.current.series;M.setData(ye([{time:g,value:O},{time:I,value:O}])),M.applyOptions({baseValue:{type:"price",price:Q}})}if(f.current.type==="parallellines")if(f.current.firstLine){const O=f.current.firstLine;O.endTime-O.startTime;const Q=O.endPrice-O.startPrice,g=y,I=g+Q;if(f.current.secondLine)f.current.secondLine.setData([{time:H.time,value:g},{time:R,value:I}]);else{const M=v.addLineSeries({color:"#8b5cf6",lineWidth:2,priceLineVisible:!1,lastValueVisible:!1});M.setData([{time:H.time,value:g},{time:R,value:I}]),f.current.secondLine=M}}else f.current.series.setData([{time:H.time,value:H.price},{time:R,value:y}])},Y=x=>{if(x&&(x.preventDefault(),x.stopPropagation()),!d.current||!f.current||!B.current)return;const L=B.current,oA=p.current||L;if(f.current.type==="parallellines")if(f.current.firstLine){const lA={type:"parallellines",firstLine:f.current.series,secondLine:f.current.secondLine,firstLineData:f.current.firstLine};eA(R=>[...R,lA]),u.current.push(lA),yA(null),f.current=null,d.current=!1,B.current=null,p.current=null;return}else{f.current.firstLine={startTime:L.time,startPrice:L.price,endTime:oA.time,endPrice:oA.price},d.current=!1,B.current=null,p.current=null;return}if(f.current.type==="rectangle"){const lA=B.current,R=p.current||lA,y=Math.max(lA.price,R.price),H=Math.min(lA.price,R.price),O=iA(Math.min(lA.time,R.time)),Q=iA(Math.max(lA.time,R.time));if(O!=null&&Q!=null&&Math.abs(Q-O)>=1&&Math.abs(y-H)>=1e-5){const g=f.current.series;g.setData(ye([{time:O,value:y},{time:Q,value:y}])),g.applyOptions({baseValue:{type:"price",price:H}});const I={type:"rectangle",timeStart:O,timeEnd:Q,priceTop:y,priceBottom:H,series:g};eA(M=>[...M,I]),u.current.push(I),yA(null)}else try{v.removeSeries(f.current.series)}catch{}}d.current=!1,B.current=null,p.current=null,f.current=null};if(T==="rectangle"||T==="parallellines"){const x={capture:!0,passive:!1},L=oA=>{d.current||oA.stopPropagation()};return k.addEventListener("mousedown",q,x),k.addEventListener("mousemove",sA,x),k.addEventListener("mousemove",L,x),k.addEventListener("mouseup",Y,x),()=>{k.removeEventListener("mousedown",q,x),k.removeEventListener("mousemove",sA,x),k.removeEventListener("mousemove",L,x),k.removeEventListener("mouseup",Y,x)}}},[UA,eA,yA]),K.useEffect(()=>{const v=a.current,b=l.current,k=o.current,wA=UA===null||UA===1;if(!wA||!v||!b||!k){wA||(E(null),S([]),z(null),N([]));return}const T=10,q=8;function sA(y){if(!y)return[];if(y.type==="trendline"&&y.point1&&y.point2){const H=v.timeScale().timeToCoordinate(y.point1.time),O=b.priceToCoordinate(y.point1.price),Q=v.timeScale().timeToCoordinate(y.point2.time),g=b.priceToCoordinate(y.point2.price);return H==null||O==null||Q==null||g==null?[]:[{x:H,y:O},{x:Q,y:g}]}if(y.type==="arrowedline"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),O=b.priceToCoordinate(y.p1.price),Q=v.timeScale().timeToCoordinate(y.p2.rawTime),g=b.priceToCoordinate(y.p2.price);return H==null||O==null||Q==null||g==null?[]:[{x:H,y:O},{x:Q,y:g}]}if(y.type==="rayline"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),O=b.priceToCoordinate(y.p1.price),Q=v.timeScale().timeToCoordinate(y.p2.rawTime),g=b.priceToCoordinate(y.p2.price);return H==null||O==null||Q==null||g==null?[]:[{x:H,y:O},{x:Q,y:g}]}if(y.type==="extendedline"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),O=b.priceToCoordinate(y.p1.price),Q=v.timeScale().timeToCoordinate(y.p2.rawTime),g=b.priceToCoordinate(y.p2.price);return H==null||O==null||Q==null||g==null?[]:[{x:H,y:O},{x:Q,y:g}]}if(y.type==="crossline"&&y.p){const H=v.timeScale().timeToCoordinate(y.p.rawTime),O=b.priceToCoordinate(y.p.price);return H==null||O==null?[]:[{x:H,y:O}]}if(y.type==="trendbyangle"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),O=b.priceToCoordinate(y.p1.price),Q=v.timeScale().timeToCoordinate(y.p2.rawTime),g=b.priceToCoordinate(y.p2.price);return H==null||O==null||Q==null||g==null?[]:[{x:H,y:O},{x:Q,y:g}]}if(y.type==="disjointchannel"&&y.p1&&y.p2&&y.p3&&y.p4){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),O=b.priceToCoordinate(y.p1.price),Q=v.timeScale().timeToCoordinate(y.p2.rawTime),g=b.priceToCoordinate(y.p2.price),I=v.timeScale().timeToCoordinate(y.p3.rawTime),M=b.priceToCoordinate(y.p3.price),D=v.timeScale().timeToCoordinate(y.p4.rawTime),m=b.priceToCoordinate(y.p4.price);return H==null||O==null||Q==null||g==null||I==null||M==null||D==null||m==null?[]:[{x:H,y:O},{x:Q,y:g},{x:I,y:M},{x:D,y:m}]}if(y.type==="flattopbottom"&&y.p1&&y.p2&&y.p3&&y.p4){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),O=b.priceToCoordinate(y.p1.price),Q=v.timeScale().timeToCoordinate(y.p2.rawTime),g=b.priceToCoordinate(y.p2.price),I=v.timeScale().timeToCoordinate(y.p3.rawTime),M=b.priceToCoordinate(y.p3.price),D=v.timeScale().timeToCoordinate(y.p4.rawTime),m=b.priceToCoordinate(y.p4.price);return H==null||O==null||Q==null||g==null||I==null||M==null||D==null||m==null?[]:[{x:H,y:O},{x:Q,y:g},{x:I,y:M},{x:D,y:m}]}if(y.type==="rulerline"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),O=b.priceToCoordinate(y.p1.price),Q=v.timeScale().timeToCoordinate(y.p2.rawTime),g=b.priceToCoordinate(y.p2.price);return H==null||O==null||Q==null||g==null?[]:[{x:H,y:O},{x:(H+Q)/2,y:(O+g)/2},{x:Q,y:g}]}if(y.type==="fibonacci"&&y.p1&&y.p2){const H=v.timeScale().timeToCoordinate(y.p1.rawTime),O=b.priceToCoordinate(y.p1.price),Q=v.timeScale().timeToCoordinate(y.p2.rawTime),g=b.priceToCoordinate(y.p2.price);return H==null||O==null||Q==null||g==null?[]:[{x:H,y:O},{x:Q,y:g}]}return[]}function Y(y,H){for(let O=j.length-1;O>=0;O--){const Q=j[O];if(Q.type==="trendline"&&Q.point1&&Q.point2){const g=v.timeScale().timeToCoordinate(Q.point1.time),I=b.priceToCoordinate(Q.point1.price),M=v.timeScale().timeToCoordinate(Q.point2.time),D=b.priceToCoordinate(Q.point2.price);if(g==null||I==null||M==null||D==null)continue;const m=Math.hypot(y-g,H-I),_=Math.hypot(y-M,H-D);if(m<T)return{object:Q,mode:"handle1"};if(_<T)return{object:Q,mode:"handle2"};if(Me(y,H,g,I,M,D)<q)return{object:Q,mode:"line"}}if(Q.type==="arrowedline"&&Q.p1&&Q.p2){const g=v.timeScale().timeToCoordinate(Q.p1.rawTime),I=b.priceToCoordinate(Q.p1.price),M=v.timeScale().timeToCoordinate(Q.p2.rawTime),D=b.priceToCoordinate(Q.p2.price);if(g==null||I==null||M==null||D==null)continue;const m=Math.hypot(y-g,H-I),_=Math.hypot(y-M,H-D);if(m<T)return{object:Q,mode:"handle1"};if(_<T)return{object:Q,mode:"handle2"};if(Me(y,H,g,I,M,D)<q)return{object:Q,mode:"line"}}if(Q.type==="rayline"&&Q.p1&&Q.p2){const g=v.timeScale().timeToCoordinate(Q.p1.rawTime),I=b.priceToCoordinate(Q.p1.price),M=v.timeScale().timeToCoordinate(Q.p2.rawTime),D=b.priceToCoordinate(Q.p2.price);if(g==null||I==null||M==null||D==null)continue;const m=Math.hypot(y-g,H-I),_=Math.hypot(y-M,H-D);if(m<T)return{object:Q,mode:"handle1"};if(_<T)return{object:Q,mode:"handle2"};if(jv(y,H,g,I,M,D)<q)return{object:Q,mode:"line"}}if(Q.type==="extendedline"&&Q.p1&&Q.p2){const g=v.timeScale().timeToCoordinate(Q.p1.rawTime),I=b.priceToCoordinate(Q.p1.price),M=v.timeScale().timeToCoordinate(Q.p2.rawTime),D=b.priceToCoordinate(Q.p2.price);if(g==null||I==null||M==null||D==null)continue;const m=Math.hypot(y-g,H-I),_=Math.hypot(y-M,H-D);if(m<T)return{object:Q,mode:"handle1"};if(_<T)return{object:Q,mode:"handle2"};if(qv(y,H,g,I,M,D)<q)return{object:Q,mode:"line"}}if(Q.type==="crossline"&&Q.p){const g=v.timeScale().timeToCoordinate(Q.p.rawTime),I=b.priceToCoordinate(Q.p.price);if(g==null||I==null)continue;if(Math.hypot(y-g,H-I)<T)return{object:Q,mode:"handle1"};const D=Math.abs(H-I),m=Math.abs(y-g);if(D<q||m<q)return{object:Q,mode:"line"}}if(Q.type==="trendbyangle"&&Q.p1&&Q.p2){const g=v.timeScale().timeToCoordinate(Q.p1.rawTime),I=b.priceToCoordinate(Q.p1.price),M=v.timeScale().timeToCoordinate(Q.p2.rawTime),D=b.priceToCoordinate(Q.p2.price);if(g==null||I==null||M==null||D==null)continue;const m=Math.hypot(y-g,H-I),_=Math.hypot(y-M,H-D);if(m<T)return{object:Q,mode:"handle1"};if(_<T)return{object:Q,mode:"handle2"};if(Me(y,H,g,I,M,D)<q)return{object:Q,mode:"line"}}if(Q.type==="disjointchannel"&&Q.p1&&Q.p2&&Q.p3&&Q.p4){const g=v.timeScale().timeToCoordinate(Q.p1.rawTime),I=b.priceToCoordinate(Q.p1.price),M=v.timeScale().timeToCoordinate(Q.p2.rawTime),D=b.priceToCoordinate(Q.p2.price),m=v.timeScale().timeToCoordinate(Q.p3.rawTime),_=b.priceToCoordinate(Q.p3.price),G=v.timeScale().timeToCoordinate(Q.p4.rawTime),$=b.priceToCoordinate(Q.p4.price);if(g==null||I==null||M==null||D==null||m==null||_==null||G==null||$==null)continue;const X=Math.hypot(y-g,H-I),AA=Math.hypot(y-M,H-D),rA=Math.hypot(y-m,H-_),bA=Math.hypot(y-G,H-$);if(X<T)return{object:Q,mode:"handle1"};if(AA<T)return{object:Q,mode:"handle2"};if(rA<T)return{object:Q,mode:"handle3"};if(bA<T)return{object:Q,mode:"handle4"};const _A=Me(y,H,g,I,m,_),VA=Me(y,H,M,D,G,$),Ae=Me(y,H,g,I,M,D),JA=Me(y,H,m,_,G,$);if(_A<q||VA<q||Ae<q||JA<q||Gu(y,H,[{x:g,y:I},{x:m,y:_},{x:G,y:$},{x:M,y:D}]))return{object:Q,mode:"line"}}if(Q.type==="flattopbottom"&&Q.p1&&Q.p2&&Q.p3&&Q.p4){const g=v.timeScale().timeToCoordinate(Q.p1.rawTime),I=b.priceToCoordinate(Q.p1.price),M=v.timeScale().timeToCoordinate(Q.p2.rawTime),D=b.priceToCoordinate(Q.p2.price),m=v.timeScale().timeToCoordinate(Q.p3.rawTime),_=b.priceToCoordinate(Q.p3.price),G=v.timeScale().timeToCoordinate(Q.p4.rawTime),$=b.priceToCoordinate(Q.p4.price);if(g==null||I==null||M==null||D==null||m==null||_==null||G==null||$==null)continue;const X=Math.hypot(y-g,H-I),AA=Math.hypot(y-M,H-D),rA=Math.hypot(y-m,H-_),bA=Math.hypot(y-G,H-$);if(X<T)return{object:Q,mode:"handle1"};if(AA<T)return{object:Q,mode:"handle2"};if(rA<T)return{object:Q,mode:"handle3"};if(bA<T)return{object:Q,mode:"handle4"};const _A=Me(y,H,g,I,m,_),VA=Me(y,H,M,D,G,$),Ae=Me(y,H,g,I,M,D),JA=Me(y,H,m,_,G,$);if(_A<q||VA<q||Ae<q||JA<q||Gu(y,H,[{x:g,y:I},{x:m,y:_},{x:G,y:$},{x:M,y:D}]))return{object:Q,mode:"line"}}if(Q.type==="rulerline"&&Q.p1&&Q.p2){const g=v.timeScale().timeToCoordinate(Q.p1.rawTime),I=b.priceToCoordinate(Q.p1.price),M=v.timeScale().timeToCoordinate(Q.p2.rawTime),D=b.priceToCoordinate(Q.p2.price);if(g==null||I==null||M==null||D==null)continue;const m=(g+M)/2,_=(I+D)/2,G=Math.hypot(y-g,H-I),$=Math.hypot(y-M,H-D),X=Math.hypot(y-m,H-_);if(G<T)return{object:Q,mode:"handle1"};if($<T)return{object:Q,mode:"handle2"};if(X<T)return{object:Q,mode:"line"};if(Me(y,H,g,I,M,D)<q)return{object:Q,mode:"line"}}if(Q.type==="fibonacci"&&Q.p1&&Q.p2){const g=v.timeScale().timeToCoordinate(Q.p1.rawTime),I=b.priceToCoordinate(Q.p1.price),M=v.timeScale().timeToCoordinate(Q.p2.rawTime),D=b.priceToCoordinate(Q.p2.price);if(g==null||I==null||M==null||D==null)continue;const m=Math.hypot(y-g,H-I),_=Math.hypot(y-M,H-D);if(m<T)return{object:Q,mode:"handle1"};if(_<T)return{object:Q,mode:"handle2"};if(Me(y,H,g,I,M,D)<q)return{object:Q,mode:"line"}}}return null}const x=y=>{const H=k.getBoundingClientRect(),O=y.clientX-H.left,Q=y.clientY-H.top,g=Y(O,Q);g?(y.preventDefault(),y.stopPropagation(),E(g.object),z(null),N([]),Z.current=g.mode,g.object.type==="rayline"&&(g.mode==="handle1"||g.mode==="handle2")&&(W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}),g.object.type==="extendedline"&&(g.mode==="handle1"||g.mode==="handle2")&&(W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}),g.object.type==="crossline"&&(g.mode==="handle1"||g.mode==="line")&&(W.current={x:O,y:Q,p:{...g.object.p}}),g.object.type==="trendbyangle"&&(g.mode==="handle1"||g.mode==="handle2")&&(W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}),g.object.type==="disjointchannel"&&(g.mode==="handle1"||g.mode==="handle2"||g.mode==="handle3"||g.mode==="handle4")&&(W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2},p3:{...g.object.p3},p4:{...g.object.p4}}),g.object.type==="flattopbottom"&&(g.mode==="handle1"||g.mode==="handle2"||g.mode==="handle3"||g.mode==="handle4")&&(W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2},p3:{...g.object.p3},p4:{...g.object.p4}}),g.object.type==="fibonacci"&&(g.mode==="handle1"||g.mode==="handle2")&&(W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}),g.mode==="line"&&(g.object.type==="rulerline"?W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}:g.object.type==="arrowedline"?W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}:g.object.type==="rayline"?W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}:g.object.type==="extendedline"?W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}:g.object.type==="crossline"?W.current={x:O,y:Q,p:{...g.object.p}}:g.object.type==="trendbyangle"?W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}:g.object.type==="disjointchannel"?W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2},p3:{...g.object.p3},p4:{...g.object.p4}}:g.object.type==="flattopbottom"?W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2},p3:{...g.object.p3},p4:{...g.object.p4}}:g.object.type==="fibonacci"?W.current={x:O,y:Q,p1:{...g.object.p1},p2:{...g.object.p2}}:W.current={x:O,y:Q,point1:{...g.object.point1},point2:{...g.object.point2}})):(E(null),Z.current=null,S([]),z(null),N([]))},L=y=>{const H=k.getBoundingClientRect(),O=y.clientX-H.left,Q=y.clientY-H.top;if(!Z.current){const D=Y(O,Q);if(D?.object&&!aA.current){const m=sA(D.object);z(_=>_===D.object?_:D.object),N(_=>_.length===m.length&&_.every((G,$)=>G.x===m[$].x&&G.y===m[$].y)?_:m)}else z(m=>m==null?m:null),N(m=>m.length===0?m:[]);return}const g=aA.current;if(!g)return;let I=v.timeScale().coordinateToTime(O);const M=b.coordinateToPrice(Q);if(!(I==null||M==null)&&(I=iA(I),I!=null)){if(g.type==="rulerline"&&g.p1&&g.p2){const D=(m,_)=>{const G=m.normalizedTime??m.rawTime,$=_.normalizedTime??_.rawTime,X=_.price-m.price,AA=X/Math.abs(m.price)*100,rA=Ot(EA)||3600,bA=Math.abs($-G),_A=Math.max(1,Math.round(bA/rA)),VA=Math.max(1,Math.round(bA/86400)),Ae={priceDiff:X,pricePct:AA,bars:_A,days:VA},JA=g.primitive;if(JA){JA.p1={rawTime:m.rawTime,price:m.price},JA.p2={rawTime:_.rawTime,price:_.price},JA.info=Ae;const _e=_.price>=m.price;JA.color=_e?"#3b82f6":"#ef5350",JA.fillColor=_e?"rgba(59,130,246,0.1)":"rgba(239,83,80,0.1)";try{a.current?.applyOptions({})}catch{}}const he={...g,p1:m,p2:_};eA(_e=>{const qo=_e.map(Yu=>Yu===g?he:Yu);return u.current=qo,qo}),E(he),aA.current=he};if(Z.current==="handle1"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D({rawTime:m,normalizedTime:I,price:M},g.p2)}else if(Z.current==="handle2"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D(g.p1,{rawTime:m,normalizedTime:I,price:M})}else if(Z.current==="line"){const m=W.current;if(!m)return;const _=v.timeScale().coordinateToTime(m.x),G=b.coordinateToPrice(m.y);if(_==null||G==null)return;const $=I-iA(_),X=M-G,AA=iA(m.p1.normalizedTime+$),rA=iA(m.p2.normalizedTime+$);if(AA==null||rA==null)return;const bA=(v.timeScale().coordinateToTime(O)??m.p1.rawTime)-m.p1.rawTime;D({rawTime:m.p1.rawTime+bA,normalizedTime:AA,price:m.p1.price+X},{rawTime:m.p2.rawTime+bA,normalizedTime:rA,price:m.p2.price+X})}return}if(g.type==="arrowedline"&&g.p1&&g.p2){const D=(m,_)=>{const G=g.primitive;if(G){G.p1={rawTime:m.rawTime,price:m.price},G.p2={rawTime:_.rawTime,price:_.price};try{a.current?.applyOptions({})}catch{}}const $={...g,p1:m,p2:_};eA(X=>{const AA=X.map(rA=>rA===g?$:rA);return u.current=AA,AA}),E($),aA.current=$};if(Z.current==="handle1"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D({rawTime:m,normalizedTime:I,price:M},g.p2)}else if(Z.current==="handle2"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D(g.p1,{rawTime:m,normalizedTime:I,price:M})}else if(Z.current==="line"){const m=W.current;if(!m)return;const _=v.timeScale().coordinateToTime(m.x),G=b.coordinateToPrice(m.y);if(_==null||G==null)return;const $=I-iA(_),X=M-G,AA=iA(m.p1.normalizedTime+$),rA=iA(m.p2.normalizedTime+$);if(AA==null||rA==null)return;const bA=(v.timeScale().coordinateToTime(O)??m.p1.rawTime)-m.p1.rawTime;D({rawTime:m.p1.rawTime+bA,normalizedTime:AA,price:m.p1.price+X},{rawTime:m.p2.rawTime+bA,normalizedTime:rA,price:m.p2.price+X})}return}if(g.type==="rayline"&&g.p1&&g.p2){const D=(m,_)=>{const G=g.primitive;if(G){G.p1={rawTime:m.rawTime,price:m.price},G.p2={rawTime:_.rawTime,price:_.price};try{a.current?.applyOptions({})}catch{}}const $={...g,p1:m,p2:_};eA(X=>{const AA=X.map(rA=>rA===g?$:rA);return u.current=AA,AA}),E($),aA.current=$};if(Z.current==="handle1"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D({rawTime:m,normalizedTime:I,price:M},g.p2)}else if(Z.current==="handle2"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;const _=iA(m);if(_==null)return;D(g.p1,{rawTime:m,normalizedTime:_,price:M})}else if(Z.current==="line"){const m=W.current;if(!m)return;const _=v.timeScale().coordinateToTime(m.x),G=b.coordinateToPrice(m.y);if(_==null||G==null)return;const $=I-iA(_),X=M-G,AA=iA(m.p1.normalizedTime+$),rA=iA(m.p2.normalizedTime+$);if(AA==null||rA==null)return;const bA=(v.timeScale().coordinateToTime(O)??m.p1.rawTime)-m.p1.rawTime;D({rawTime:m.p1.rawTime+bA,normalizedTime:AA,price:m.p1.price+X},{rawTime:m.p2.rawTime+bA,normalizedTime:rA,price:m.p2.price+X})}return}if(g.type==="extendedline"&&g.p1&&g.p2){const D=(m,_)=>{const G=g.primitive;if(G){G.p1={rawTime:m.rawTime,price:m.price},G.p2={rawTime:_.rawTime,price:_.price};try{a.current?.applyOptions({})}catch{}}const $={...g,p1:m,p2:_};eA(X=>{const AA=X.map(rA=>rA===g?$:rA);return u.current=AA,AA}),E($),aA.current=$};if(Z.current==="handle1"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D({rawTime:m,normalizedTime:I,price:M},g.p2)}else if(Z.current==="handle2"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D(g.p1,{rawTime:m,normalizedTime:I,price:M})}else if(Z.current==="line"){const m=W.current;if(!m)return;const _=v.timeScale().coordinateToTime(m.x),G=b.coordinateToPrice(m.y);if(_==null||G==null)return;const $=I-iA(_),X=M-G,AA=iA(m.p1.normalizedTime+$),rA=iA(m.p2.normalizedTime+$);if(AA==null||rA==null)return;const bA=(v.timeScale().coordinateToTime(O)??m.p1.rawTime)-m.p1.rawTime;D({rawTime:m.p1.rawTime+bA,normalizedTime:AA,price:m.p1.price+X},{rawTime:m.p2.rawTime+bA,normalizedTime:rA,price:m.p2.price+X})}return}if(g.type==="crossline"&&g.p){const D=_=>{const G=g.primitive;if(G){G.center={rawTime:_.rawTime,price:_.price};try{a.current?.applyOptions({})}catch{}}const $={...g,p:_};eA(X=>{const AA=X.map(rA=>rA===g?$:rA);return u.current=AA,AA}),E($),aA.current=$},m=v.timeScale().coordinateToTime(O);if(m==null)return;D({rawTime:m,normalizedTime:I,price:M});return}if(g.type==="trendbyangle"&&g.p1&&g.p2){const D=(m,_)=>{const G=g.primitive;if(G){G.p1={rawTime:m.rawTime,price:m.price},G.p2={rawTime:_.rawTime,price:_.price};try{a.current?.applyOptions({})}catch{}}const $={...g,p1:m,p2:_};eA(X=>{const AA=X.map(rA=>rA===g?$:rA);return u.current=AA,AA}),E($),aA.current=$};if(Z.current==="handle1"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D({rawTime:m,normalizedTime:I,price:M},g.p2)}else if(Z.current==="handle2"||Z.current==="line"){const m=W.current;if(!m)return;const _=v.timeScale().coordinateToTime(m.x),G=b.coordinateToPrice(m.y);if(_==null||G==null)return;const $=I-iA(_),X=M-G,AA=iA(m.p1.normalizedTime+$),rA=iA(m.p2.normalizedTime+$);if(AA==null||rA==null)return;const bA=(v.timeScale().coordinateToTime(O)??m.p1.rawTime)-m.p1.rawTime;D({rawTime:m.p1.rawTime+bA,normalizedTime:AA,price:m.p1.price+X},{rawTime:m.p2.rawTime+bA,normalizedTime:rA,price:m.p2.price+X})}return}if(g.type==="disjointchannel"&&g.p1&&g.p2&&g.p3&&g.p4){const D=(X,AA,rA,bA)=>{const _A=g.primitive;if(_A){_A.p1={rawTime:X.rawTime,price:X.price},_A.p2={rawTime:AA.rawTime,price:AA.price},_A.p3={rawTime:rA.rawTime,price:rA.price},_A.p4={rawTime:bA.rawTime,price:bA.price};try{a.current?.applyOptions({})}catch{}}const VA={...g,p1:X,p2:AA,p3:rA,p4:bA};eA(Ae=>{const JA=Ae.map(he=>he===g?VA:he);return u.current=JA,JA}),E(VA),aA.current=VA},m=W.current;if(!m)return;const _=v.timeScale().coordinateToTime(O);if(_==null)return;const G=iA(_);if(G==null)return;const $=(X,AA,rA,bA)=>{const _A=X.normalizedTime??iA(X.rawTime);if(_A==null)return null;const VA=iA(_A+rA);return VA==null?null:{rawTime:X.rawTime+AA,normalizedTime:VA,price:X.price+bA}};if(Z.current==="line"){const X=v.timeScale().coordinateToTime(m.x),AA=b.coordinateToPrice(m.y);if(X==null||AA==null)return;const rA=iA(X);if(rA==null)return;const bA=_-X,_A=G-rA,VA=M-AA,Ae=$(m.p1,bA,_A,VA),JA=$(m.p2,bA,_A,VA),he=$(m.p3,bA,_A,VA),_e=$(m.p4,bA,_A,VA);if(!Ae||!JA||!he||!_e)return;D(Ae,JA,he,_e);return}if(Z.current==="handle1"){const X=(m.p1.price+m.p2.price)/2,AA={rawTime:_,normalizedTime:G,price:M},rA={rawTime:_,normalizedTime:G,price:2*X-M};D(AA,rA,m.p3,m.p4);return}if(Z.current==="handle3"){const X=(m.p3.price+m.p4.price)/2,AA={rawTime:_,normalizedTime:G,price:M},rA={rawTime:_,normalizedTime:G,price:2*X-M};D(m.p1,m.p2,AA,rA);return}if(Z.current==="handle2"){const X=(m.p1.price+m.p2.price)/2,AA={rawTime:m.p1.rawTime,normalizedTime:m.p1.normalizedTime??iA(m.p1.rawTime),price:M};if(AA.normalizedTime==null)return;const rA={rawTime:m.p1.rawTime,normalizedTime:m.p1.normalizedTime??iA(m.p1.rawTime),price:2*X-M};if(rA.normalizedTime==null)return;D(rA,AA,m.p3,m.p4);return}if(Z.current==="handle4"){const X=M-m.p4.price,AA={rawTime:m.p3.rawTime,normalizedTime:m.p3.normalizedTime??iA(m.p3.rawTime),price:m.p4.price+X};if(AA.normalizedTime==null)return;const rA={rawTime:m.p1.rawTime,normalizedTime:m.p1.normalizedTime??iA(m.p1.rawTime),price:m.p2.price+X};if(rA.normalizedTime==null)return;D(m.p1,rA,m.p3,AA);return}}if(g.type==="flattopbottom"&&g.p1&&g.p2&&g.p3&&g.p4){const D=(X,AA,rA,bA)=>{const _A=g.primitive;if(_A){_A.p1={rawTime:X.rawTime,price:X.price},_A.p2={rawTime:AA.rawTime,price:AA.price},_A.p3={rawTime:rA.rawTime,price:rA.price},_A.p4={rawTime:bA.rawTime,price:bA.price};try{a.current?.applyOptions({})}catch{}}const VA={...g,p1:X,p2:AA,p3:rA,p4:bA};eA(Ae=>{const JA=Ae.map(he=>he===g?VA:he);return u.current=JA,JA}),E(VA),aA.current=VA},m=W.current;if(!m)return;const _=v.timeScale().coordinateToTime(O);if(_==null)return;const G=iA(_);if(G==null)return;const $=(X,AA,rA,bA)=>{const _A=X.normalizedTime??iA(X.rawTime);if(_A==null)return null;const VA=iA(_A+rA);return VA==null?null:{rawTime:X.rawTime+AA,normalizedTime:VA,price:X.price+bA}};if(Z.current==="line"){const X=v.timeScale().coordinateToTime(m.x),AA=b.coordinateToPrice(m.y);if(X==null||AA==null)return;const rA=iA(X);if(rA==null)return;const bA=_-X,_A=G-rA,VA=M-AA,Ae=$(m.p1,bA,_A,VA),JA=$(m.p2,bA,_A,VA),he=$(m.p3,bA,_A,VA),_e=$(m.p4,bA,_A,VA);if(!Ae||!JA||!he||!_e)return;D(Ae,JA,he,_e);return}if(Z.current==="handle1"){const X={rawTime:_,normalizedTime:G,price:M},AA={rawTime:_,normalizedTime:G,price:m.p2.price};D(X,AA,m.p3,m.p4);return}if(Z.current==="handle3"){const X={rawTime:_,normalizedTime:G,price:M},AA={rawTime:_,normalizedTime:G,price:m.p4.price};D(m.p1,m.p2,X,AA);return}if(Z.current==="handle2"||Z.current==="handle4"){const X=Z.current==="handle2"?m.p2:m.p4,AA=M-X.price,rA={rawTime:m.p1.rawTime,normalizedTime:m.p1.normalizedTime??iA(m.p1.rawTime),price:m.p2.price+AA},bA={rawTime:m.p3.rawTime,normalizedTime:m.p3.normalizedTime??iA(m.p3.rawTime),price:m.p4.price+AA};if(rA.normalizedTime==null||bA.normalizedTime==null)return;D(m.p1,rA,m.p3,bA);return}}if(g.type==="fibonacci"&&g.p1&&g.p2){const D=(m,_)=>{const G=g.primitive;if(G){G.p1={rawTime:m.rawTime,price:m.price},G.p2={rawTime:_.rawTime,price:_.price};try{a.current?.applyOptions({})}catch{}}const $={...g,p1:m,p2:_};eA(X=>{const AA=X.map(rA=>rA===g?$:rA);return u.current=AA,AA}),E($),aA.current=$};if(Z.current==="handle1"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D({rawTime:m,normalizedTime:I,price:M},g.p2)}else if(Z.current==="handle2"){const m=v.timeScale().coordinateToTime(O);if(m==null)return;D(g.p1,{rawTime:m,normalizedTime:I,price:M})}else if(Z.current==="line"){const m=W.current;if(!m)return;const _=v.timeScale().coordinateToTime(m.x),G=b.coordinateToPrice(m.y);if(_==null||G==null)return;const $=I-iA(_),X=M-G,AA=iA(m.p1.normalizedTime+$),rA=iA(m.p2.normalizedTime+$);if(AA==null||rA==null)return;const bA=(v.timeScale().coordinateToTime(O)??m.p1.rawTime)-m.p1.rawTime;D({rawTime:m.p1.rawTime+bA,normalizedTime:AA,price:m.p1.price+X},{rawTime:m.p2.rawTime+bA,normalizedTime:rA,price:m.p2.price+X})}return}if(!(!g.point1||!g.point2)){if(Z.current==="handle1"){const D={time:I,price:M},m=ye([{time:D.time,value:D.price},{time:g.point2.time,value:g.point2.price}]);m.length>0&&g.series.setData(m);const _={...g,point1:D};eA(G=>{const $=G.map(X=>X===g?_:X);return u.current=$,$}),E(_),aA.current=_}else if(Z.current==="handle2"){const D={time:I,price:M},m=ye([{time:g.point1.time,value:g.point1.price},{time:D.time,value:D.price}]);m.length>0&&g.series.setData(m);const _={...g,point2:D};eA(G=>{const $=G.map(X=>X===g?_:X);return u.current=$,$}),E(_),aA.current=_}else if(Z.current==="line"){const D=W.current;if(!D)return;const m=v.timeScale().coordinateToTime(D.x),_=b.coordinateToPrice(D.y);if(m==null||_==null)return;const G=I-m,$=M-_,X={time:iA(D.point1.time+G),price:D.point1.price+$},AA={time:iA(D.point2.time+G),price:D.point2.price+$},rA=ye([{time:X.time,value:X.price},{time:AA.time,value:AA.price}]);rA.length>0&&g.series.setData(rA);const bA={...g,point1:X,point2:AA};eA(_A=>{const VA=_A.map(Ae=>Ae===g?bA:Ae);return u.current=VA,VA}),E(bA),aA.current=bA}}}},oA=()=>{Z.current=null,W.current=null},lA=()=>{Z.current||aA.current||(z(null),N([]))},R={capture:!0,passive:!1};return k.addEventListener("mousedown",x,R),k.addEventListener("mousemove",L,R),k.addEventListener("mouseup",oA,R),k.addEventListener("mouseleave",lA,R),()=>{k.removeEventListener("mousedown",x,R),k.removeEventListener("mousemove",L,R),k.removeEventListener("mouseup",oA,R),k.removeEventListener("mouseleave",lA,R)}},[UA,j,eA]),K.useEffect(()=>{const v=a.current,b=l.current;if(!v||!b)return;const k=()=>{const T=C;if(!T){S([]);return}const q=v.timeScale();if(T.type==="rulerline"&&T.p1&&T.p2){const sA=q.timeToCoordinate(T.p1.rawTime),Y=b.priceToCoordinate(T.p1.price),x=q.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);sA!=null&&Y!=null&&x!=null&&L!=null?S([{x:sA,y:Y},{x:(sA+x)/2,y:(Y+L)/2},{x,y:L}]):S([]);return}if(T.type==="arrowedline"&&T.p1&&T.p2){const sA=q.timeToCoordinate(T.p1.rawTime),Y=b.priceToCoordinate(T.p1.price),x=q.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);sA!=null&&Y!=null&&x!=null&&L!=null?S([{x:sA,y:Y},{x,y:L}]):S([]);return}if(T.type==="rayline"&&T.p1&&T.p2){const sA=q.timeToCoordinate(T.p1.rawTime),Y=b.priceToCoordinate(T.p1.price),x=q.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);sA!=null&&Y!=null&&x!=null&&L!=null?S([{x:sA,y:Y},{x,y:L}]):S([]);return}if(T.type==="extendedline"&&T.p1&&T.p2){const sA=q.timeToCoordinate(T.p1.rawTime),Y=b.priceToCoordinate(T.p1.price),x=q.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);sA!=null&&Y!=null&&x!=null&&L!=null?S([{x:sA,y:Y},{x,y:L}]):S([]);return}if(T.type==="crossline"&&T.p){const sA=q.timeToCoordinate(T.p.rawTime),Y=b.priceToCoordinate(T.p.price);sA!=null&&Y!=null?S([{x:sA,y:Y}]):S([]);return}if(T.type==="trendbyangle"&&T.p1&&T.p2){const sA=q.timeToCoordinate(T.p1.rawTime),Y=b.priceToCoordinate(T.p1.price),x=q.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);sA!=null&&Y!=null&&x!=null&&L!=null?S([{x:sA,y:Y},{x,y:L}]):S([]);return}if(T.type==="disjointchannel"&&T.p1&&T.p2&&T.p3&&T.p4){const sA=q.timeToCoordinate(T.p1.rawTime),Y=b.priceToCoordinate(T.p1.price),x=q.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price),oA=q.timeToCoordinate(T.p3.rawTime),lA=b.priceToCoordinate(T.p3.price),R=q.timeToCoordinate(T.p4.rawTime),y=b.priceToCoordinate(T.p4.price);sA!=null&&Y!=null&&x!=null&&L!=null&&oA!=null&&lA!=null&&R!=null&&y!=null?S([{x:sA,y:Y},{x,y:L},{x:oA,y:lA},{x:R,y}]):S([]);return}if(T.type==="flattopbottom"&&T.p1&&T.p2&&T.p3&&T.p4){const sA=q.timeToCoordinate(T.p1.rawTime),Y=b.priceToCoordinate(T.p1.price),x=q.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price),oA=q.timeToCoordinate(T.p3.rawTime),lA=b.priceToCoordinate(T.p3.price),R=q.timeToCoordinate(T.p4.rawTime),y=b.priceToCoordinate(T.p4.price);sA!=null&&Y!=null&&x!=null&&L!=null&&oA!=null&&lA!=null&&R!=null&&y!=null?S([{x:sA,y:Y},{x,y:L},{x:oA,y:lA},{x:R,y}]):S([]);return}if(T.type==="fibonacci"&&T.p1&&T.p2){const sA=q.timeToCoordinate(T.p1.rawTime),Y=b.priceToCoordinate(T.p1.price),x=q.timeToCoordinate(T.p2.rawTime),L=b.priceToCoordinate(T.p2.price);sA!=null&&Y!=null&&x!=null&&L!=null?S([{x:sA,y:Y},{x,y:L}]):S([]);return}if(T.type==="trendline"&&T.point1&&T.point2){const sA=q.timeToCoordinate(T.point1.time),Y=b.priceToCoordinate(T.point1.price),x=q.timeToCoordinate(T.point2.time),L=b.priceToCoordinate(T.point2.price);sA!=null&&Y!=null&&x!=null&&L!=null?S([{x:sA,y:Y},{x,y:L}]):S([]);return}S([])};k();const wA=v.timeScale();return wA.subscribeVisibleTimeRangeChange(k),()=>{wA.unsubscribeVisibleTimeRangeChange(k)}},[C]),K.useEffect(()=>{!a.current||!l.current||u.current.forEach(v=>{if(v.series&&v.series.applyOptions({visible:XA}),v.priceLine&&v.priceLine.applyOptions(XA?{color:"#3b82f6",axisLabelVisible:!0,title:typeof v.price=="number"?v.price.toFixed(5):""}:{color:"rgba(0,0,0,0)",axisLabelVisible:!1,title:""}),v.type==="fibonacci"&&v.primitive){v.primitive.visible=XA;try{a.current?.applyOptions({})}catch{}}if(v.type==="rectangle"&&v.series&&v.series.applyOptions({visible:XA}),v.type==="parallellines"&&(v.baseLine&&v.baseLine.applyOptions({visible:XA}),v.parallelLine&&v.parallelLine.applyOptions({visible:XA}),v.firstLine&&v.firstLine.applyOptions({visible:XA}),v.secondLine&&v.secondLine.applyOptions({visible:XA})),(v.type==="horizontalray"||v.type==="verticalline"||v.type==="infoline"||v.type==="rulerline"||v.type==="arrowedline"||v.type==="rayline"||v.type==="extendedline"||v.type==="crossline"||v.type==="trendbyangle"||v.type==="disjointchannel"||v.type==="flattopbottom")&&v.primitive){v.primitive.visible=XA;try{a.current?.applyOptions({})}catch{}}})},[XA,j]),K.useEffect(()=>{!XA&&C&&(E(null),S([]))},[XA,C]),K.useEffect(()=>{if(u.current.length>j.length){const v=u.current.filter((b,k)=>!j.includes(b));C&&v.some(b=>b===C)&&(E(null),S([])),v.forEach(b=>{if(b.series&&a.current?.removeSeries(b.series),b.priceLine&&l.current?.removePriceLine(b.priceLine),b.type==="horizontalray"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="verticalline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="infoline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="rulerline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="arrowedline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="rayline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="extendedline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="crossline"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="trendbyangle"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="disjointchannel"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="flattopbottom"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="fibonacci"&&b.primitive)try{l.current?.detachPrimitive(b.primitive)}catch{}if(b.type==="rectangle"&&b.series)try{a.current?.removeSeries(b.series)}catch{}if(b.type==="parallellines")try{b.baseLine&&a.current?.removeSeries(b.baseLine),b.parallelLine&&a.current?.removeSeries(b.parallelLine),b.firstLine&&a.current?.removeSeries(b.firstLine),b.secondLine&&a.current?.removeSeries(b.secondLine)}catch{}}),u.current=j}},[j,C]),K.useEffect(()=>{const v=l.current;return v?(fA.current.forEach(k=>{try{v.removePriceLine(k)}catch{}}),fA.current=[],QA.filter(k=>k.symbol===gA).forEach(k=>{const wA=parseFloat(k.price);if(isNaN(wA))return;const q=k.type==="BUY"?"#26A69A":"#EF5350",sA=v.createPriceLine({price:wA,color:q,lineWidth:2,lineStyle:0,axisLabelVisible:!0,title:`${k.type} ${k.volume} @ ${k.price}`,textColor:q});fA.current.push(sA)}),()=>{fA.current.forEach(k=>{try{v.removePriceLine(k)}catch{}}),fA.current=[]}):void 0},[QA,gA]);const xA=C??P,qA=C?U:J;return h.jsx("div",{className:`flex-1 flex flex-col min-w-0 overflow-hidden ${ae==="light"?"bg-white":"bg-[#12161d]"}`,children:h.jsxs("div",{ref:o,className:"flex-1 w-full h-full relative",style:{cursor:UA===1||UA!==null?"crosshair":"default",minHeight:0,minWidth:0},onDoubleClick:v=>{a.current&&!d.current&&(v.preventDefault(),v.stopPropagation(),a.current.timeScale().fitContent(),HA(a.current.timeScale().getVisibleRange()))},children:[t&&h.jsx("div",{className:"absolute top-3 left-3 z-50",children:h.jsx(Ec,{bidPrice:A,askPrice:e,onBuyClick:ii,onSellClick:Le})}),h.jsx(xc,{isOpen:mA,onClose:ne,orderType:uA,bidPrice:A,askPrice:e}),XA&&(xA?.type==="trendline"&&xA?.point1&&xA?.point2&&qA.length===2||xA?.type==="arrowedline"&&xA?.p1&&xA?.p2&&qA.length===2||xA?.type==="rayline"&&xA?.p1&&xA?.p2&&qA.length===2||xA?.type==="extendedline"&&xA?.p1&&xA?.p2&&qA.length===2||xA?.type==="crossline"&&xA?.p&&qA.length===1||xA?.type==="trendbyangle"&&xA?.p1&&xA?.p2&&qA.length===2||xA?.type==="disjointchannel"&&xA?.p1&&xA?.p2&&xA?.p3&&xA?.p4&&qA.length===4||xA?.type==="flattopbottom"&&xA?.p1&&xA?.p2&&xA?.p3&&xA?.p4&&qA.length===4||xA?.type==="rulerline"&&xA?.p1&&xA?.p2&&qA.length===3)&&h.jsx("div",{className:"absolute inset-0 z-20 pointer-events-none","aria-hidden":!0,children:qA.map((v,b)=>h.jsx("div",{className:"absolute w-[10px] h-[10px] rounded-full border-2 border-white shadow",style:{left:v.x-5,top:v.y-5,backgroundColor:xA?.type==="rulerline"?"#3b82f6":xA?.type==="arrowedline"?"#f59e0b":xA?.type==="rayline"||xA?.type==="extendedline"||xA?.type==="crossline"||xA?.type==="trendbyangle"?"#7aa6ae":xA?.type==="disjointchannel"?"#16a34a":xA?.type==="flattopbottom"?"#3b82f6":"#22c55e"}},b))})]})})}),YA={container:{position:"relative",display:"inline-block",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},button:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"6px",color:"#e2e8f0",fontSize:"13px",fontWeight:600,cursor:"pointer",minWidth:"120px",justifyContent:"space-between",transition:"all 0.15s ease"},buttonHover:{borderColor:"#3b82f6",backgroundColor:"#1e3a5f"},arrow:{fontSize:"10px",color:"#94a3b8",transition:"transform 0.2s ease"},arrowOpen:{transform:"rotate(180deg)"},dropdown:{position:"absolute",top:"100%",left:0,marginTop:"4px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:1e3,minWidth:"220px",maxHeight:"320px",overflow:"hidden",display:"flex",flexDirection:"column"},searchContainer:{padding:"8px",borderBottom:"1px solid #334155"},searchInput:{width:"100%",padding:"6px 10px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"12px",outline:"none",boxSizing:"border-box"},list:{overflowY:"auto",maxHeight:"260px",padding:"4px 0"},item:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",cursor:"pointer",fontSize:"13px",color:"#cbd5e1",transition:"background-color 0.1s ease"},itemSelected:{backgroundColor:"#1e3a5f",color:"#60a5fa"},symbolName:{fontWeight:600},symbolPrice:{fontSize:"11px",color:"#94a3b8"},priceUp:{color:"#26A69A"},priceDown:{color:"#EF5350"},categoryLabel:{padding:"6px 12px 4px",fontSize:"10px",fontWeight:700,color:"#64748b",textTransform:"uppercase",letterSpacing:"0.05em"},empty:{padding:"16px",textAlign:"center",color:"#64748b",fontSize:"12px"}};function Ru({style:r,className:A}){const{selectedSymbol:e,setSelectedSymbol:t,symbols:i,symbolsLoading:s}=ge(),[n,o]=K.useState(!1),[a,l]=K.useState(""),[c,u]=K.useState(-1),d=K.useRef(null),B=K.useRef(null);K.useEffect(()=>{const C=E=>{d.current&&!d.current.contains(E.target)&&(o(!1),l(""))};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[]),K.useEffect(()=>{n&&B.current&&B.current.focus()},[n]);const p=i.filter(C=>C.symbol.toLowerCase().includes(a.toLowerCase())),f=p.filter(C=>!C.symbol.endsWith("USDT")),w=p.filter(C=>C.symbol.endsWith("USDT")),F=C=>{t(C),o(!1),l("")};return i.find(C=>C.symbol===e),h.jsxs("div",{ref:d,style:{...YA.container,...r},className:A,children:[h.jsxs("button",{style:YA.button,onClick:()=>o(!n),onMouseEnter:C=>Object.assign(C.currentTarget.style,YA.buttonHover),onMouseLeave:C=>{C.currentTarget.style.borderColor="#334155",C.currentTarget.style.backgroundColor="#1e293b"},children:[h.jsx("span",{children:s?"Loading...":e||"Select Coin"}),h.jsx("span",{style:{...YA.arrow,...n?YA.arrowOpen:{}},children:"▼"})]}),n&&h.jsxs("div",{style:YA.dropdown,children:[h.jsx("div",{style:YA.searchContainer,children:h.jsx("input",{ref:B,style:YA.searchInput,type:"text",placeholder:"Search symbol...",value:a,onChange:C=>l(C.target.value)})}),h.jsx("div",{style:YA.list,children:p.length===0?h.jsx("div",{style:YA.empty,children:"No symbols found"}):h.jsxs(h.Fragment,{children:[f.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:YA.categoryLabel,children:"Forex & Metals"}),f.map(C=>h.jsxs("div",{style:{...YA.item,...C.symbol===e?YA.itemSelected:{}},onClick:()=>F(C.symbol),onMouseEnter:E=>{C.symbol!==e&&(E.currentTarget.style.backgroundColor="#334155")},onMouseLeave:E=>{C.symbol!==e&&(E.currentTarget.style.backgroundColor="transparent")},children:[h.jsx("span",{style:YA.symbolName,children:C.symbol}),C.bid&&h.jsx("span",{style:{...YA.symbolPrice,...parseFloat(C.change)>=0?YA.priceUp:YA.priceDown},children:parseFloat(C.bid).toFixed(5)})]},C.symbol))]}),w.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{style:YA.categoryLabel,children:"Crypto"}),w.map(C=>h.jsxs("div",{style:{...YA.item,...C.symbol===e?YA.itemSelected:{}},onClick:()=>F(C.symbol),onMouseEnter:E=>{C.symbol!==e&&(E.currentTarget.style.backgroundColor="#334155")},onMouseLeave:E=>{C.symbol!==e&&(E.currentTarget.style.backgroundColor="transparent")},children:[h.jsx("span",{style:YA.symbolName,children:C.symbol}),C.bid&&h.jsx("span",{style:{...YA.symbolPrice,...parseFloat(C.change)>=0?YA.priceUp:YA.priceDown},children:parseFloat(C.bid).toFixed(2)})]},C.symbol))]})]})})]})]})}const st={container:{display:"inline-flex",alignItems:"center",gap:"4px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},label:{fontSize:"11px",color:"#94a3b8",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",marginRight:"4px",whiteSpace:"nowrap"},btn:{display:"flex",alignItems:"center",justifyContent:"center",width:"26px",height:"26px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"14px",fontWeight:700,cursor:"pointer",transition:"all 0.15s ease",padding:0,lineHeight:1,userSelect:"none"},btnHover:{borderColor:"#3b82f6",backgroundColor:"#1e3a5f"},input:{width:"70px",padding:"4px 6px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"13px",fontWeight:600,textAlign:"center",outline:"none",boxSizing:"border-box"},presets:{display:"inline-flex",gap:"2px",marginLeft:"4px"},preset:{padding:"3px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"11px",cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap"},presetActive:{backgroundColor:"#1e3a5f",borderColor:"#3b82f6",color:"#60a5fa"}},eb=[.01,.05,.1,.5,1];function Wu({value:r,onChange:A,min:e=.01,max:t=100,step:i=.01,presets:s=eb,showPresets:n=!0,showLabel:o=!0,label:a="Vol",style:l,className:c}){const[u,d]=K.useState(.1),B=r!==void 0?r:u,p=K.useCallback(C=>{const E=Math.max(e,Math.min(t,parseFloat(C)||e)),U=Math.round(E/i)*i,S=parseFloat(U.toFixed(8));r!==void 0||d(S),A?.(S)},[e,t,i,r,A]),f=()=>p(B+i),w=()=>p(B-i),F=(B>=1,B.toFixed(2));return h.jsxs("div",{style:{...st.container,...l},className:c,children:[o&&h.jsx("span",{style:st.label,children:a}),h.jsx("button",{style:st.btn,onClick:w,onMouseEnter:C=>Object.assign(C.currentTarget.style,st.btnHover),onMouseLeave:C=>{C.currentTarget.style.borderColor="#334155",C.currentTarget.style.backgroundColor="#1e293b"},children:"−"}),h.jsx("input",{style:st.input,type:"text",value:F,onChange:C=>{const E=C.target.value;if(E===""||E==="."||E==="0.")return;const U=parseFloat(E);isNaN(U)||p(U)},onBlur:()=>p(B)}),h.jsx("button",{style:st.btn,onClick:f,onMouseEnter:C=>Object.assign(C.currentTarget.style,st.btnHover),onMouseLeave:C=>{C.currentTarget.style.borderColor="#334155",C.currentTarget.style.backgroundColor="#1e293b"},children:"+"}),n&&s&&s.length>0&&h.jsx("div",{style:st.presets,children:s.map(C=>h.jsx("button",{style:{...st.preset,...Math.abs(B-C)<1e-4?st.presetActive:{}},onClick:()=>p(C),onMouseEnter:E=>{Math.abs(B-C)>=1e-4&&Object.assign(E.currentTarget.style,{borderColor:"#3b82f6"})},onMouseLeave:E=>{Math.abs(B-C)>=1e-4&&(E.currentTarget.style.borderColor="#334155")},children:C},C))})]})}const Se={container:{display:"inline-flex",alignItems:"center",gap:"6px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},label:{fontSize:"11px",fontWeight:700,color:"#EF5350",textTransform:"uppercase",letterSpacing:"0.03em",whiteSpace:"nowrap"},toggle:{position:"relative",width:"32px",height:"18px",borderRadius:"9px",cursor:"pointer",transition:"background-color 0.2s ease",border:"none",padding:0},toggleOff:{backgroundColor:"#334155"},toggleOn:{backgroundColor:"#EF5350"},toggleKnob:{position:"absolute",top:"2px",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#fff",transition:"left 0.2s ease"},knobOff:{left:"2px"},knobOn:{left:"16px"},inputGroup:{display:"inline-flex",alignItems:"center",gap:"4px"},input:{width:"90px",padding:"4px 8px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"13px",fontWeight:600,textAlign:"right",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s ease"},modeBtn:{padding:"3px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"10px",cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap"},modeBtnActive:{backgroundColor:"#3b1515",borderColor:"#EF5350",color:"#EF5350"}};function $u({value:r,onChange:A,enabled:e,onEnabledChange:t,mode:i,onModeChange:s,showToggle:n=!0,showModeSwitch:o=!0,showLabel:a=!0,label:l="SL",style:c,className:u}){const{currentSymbolData:d}=ge(),[B,p]=K.useState(""),[f,w]=K.useState(!1),[F,C]=K.useState("price"),E=r!==void 0?r:B,U=e!==void 0?e:f,S=i!==void 0?i:F,P=K.useCallback(W=>{e!==void 0||w(W),t?.(W)},[e,t]),z=K.useCallback(W=>{i!==void 0||C(W),s?.(W)},[i,s]),J=K.useCallback(W=>{r!==void 0||p(W),A?.(W)},[r,A]),N=W=>{const aA=W.target.value;if(aA===""||aA==="."||aA==="0."){J(aA);return}const nA=parseFloat(aA);isNaN(nA)||J(aA)},Z=S==="price"?d?.bid?parseFloat(d.bid).toFixed(5):"0.00000":"50";return h.jsxs("div",{style:{...Se.container,...c},className:u,children:[a&&h.jsx("span",{style:Se.label,children:l}),n&&h.jsx("button",{style:{...Se.toggle,...U?Se.toggleOn:Se.toggleOff},onClick:()=>P(!U),children:h.jsx("div",{style:{...Se.toggleKnob,...U?Se.knobOn:Se.knobOff}})}),(U||!n)&&h.jsxs("div",{style:Se.inputGroup,children:[h.jsx("input",{style:Se.input,type:"text",value:E,onChange:N,placeholder:Z,onFocus:W=>W.currentTarget.style.borderColor="#EF5350",onBlur:W=>W.currentTarget.style.borderColor="#334155"}),o&&h.jsxs(h.Fragment,{children:[h.jsx("button",{style:{...Se.modeBtn,...S==="price"?Se.modeBtnActive:{}},onClick:()=>z("price"),children:"Price"}),h.jsx("button",{style:{...Se.modeBtn,...S==="pips"?Se.modeBtnActive:{}},onClick:()=>z("pips"),children:"Pips"})]})]})]})}const He={container:{display:"inline-flex",alignItems:"center",gap:"6px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},label:{fontSize:"11px",fontWeight:700,color:"#26A69A",textTransform:"uppercase",letterSpacing:"0.03em",whiteSpace:"nowrap"},toggle:{position:"relative",width:"32px",height:"18px",borderRadius:"9px",cursor:"pointer",transition:"background-color 0.2s ease",border:"none",padding:0},toggleOff:{backgroundColor:"#334155"},toggleOn:{backgroundColor:"#26A69A"},toggleKnob:{position:"absolute",top:"2px",width:"14px",height:"14px",borderRadius:"50%",backgroundColor:"#fff",transition:"left 0.2s ease"},knobOff:{left:"2px"},knobOn:{left:"16px"},inputGroup:{display:"inline-flex",alignItems:"center",gap:"4px"},input:{width:"90px",padding:"4px 8px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"13px",fontWeight:600,textAlign:"right",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s ease"},modeBtn:{padding:"3px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"10px",cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap"},modeBtnActive:{backgroundColor:"#0d2e2a",borderColor:"#26A69A",color:"#26A69A"}};function Xu({value:r,onChange:A,enabled:e,onEnabledChange:t,mode:i,onModeChange:s,showToggle:n=!0,showModeSwitch:o=!0,showLabel:a=!0,label:l="TP",style:c,className:u}){const{currentSymbolData:d}=ge(),[B,p]=K.useState(""),[f,w]=K.useState(!1),[F,C]=K.useState("price"),E=r!==void 0?r:B,U=e!==void 0?e:f,S=i!==void 0?i:F,P=K.useCallback(W=>{e!==void 0||w(W),t?.(W)},[e,t]),z=K.useCallback(W=>{i!==void 0||C(W),s?.(W)},[i,s]),J=K.useCallback(W=>{r!==void 0||p(W),A?.(W)},[r,A]),N=W=>{const aA=W.target.value;if(aA===""||aA==="."||aA==="0."){J(aA);return}const nA=parseFloat(aA);isNaN(nA)||J(aA)},Z=S==="price"?d?.ask?parseFloat(d.ask).toFixed(5):"0.00000":"50";return h.jsxs("div",{style:{...He.container,...c},className:u,children:[a&&h.jsx("span",{style:He.label,children:l}),n&&h.jsx("button",{style:{...He.toggle,...U?He.toggleOn:He.toggleOff},onClick:()=>P(!U),children:h.jsx("div",{style:{...He.toggleKnob,...U?He.knobOn:He.knobOff}})}),(U||!n)&&h.jsxs("div",{style:He.inputGroup,children:[h.jsx("input",{style:He.input,type:"text",value:E,onChange:N,placeholder:Z,onFocus:W=>W.currentTarget.style.borderColor="#26A69A",onBlur:W=>W.currentTarget.style.borderColor="#334155"}),o&&h.jsxs(h.Fragment,{children:[h.jsx("button",{style:{...He.modeBtn,...S==="price"?He.modeBtnActive:{}},onClick:()=>z("price"),children:"Price"}),h.jsx("button",{style:{...He.modeBtn,...S==="pips"?He.modeBtnActive:{}},onClick:()=>z("pips"),children:"Pips"})]})]})]})}const tb=[{id:1,name:"Crosshair",icon:"+"},{id:2,name:"Trend Line",icon:"╱"},{id:3,name:"Parallel Channel",icon:"═"},{id:4,name:"Fibonacci",icon:"≡"},{id:5,name:"Rectangle",icon:"▭"},{id:6,name:"Price Level",icon:"─"}],nt={container:{display:"inline-flex",alignItems:"center",gap:"2px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},label:{fontSize:"11px",color:"#94a3b8",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.03em",marginRight:"4px",whiteSpace:"nowrap"},btn:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"14px",cursor:"pointer",transition:"all 0.15s ease",padding:0,position:"relative"},btnActive:{backgroundColor:"#1e3a5f",borderColor:"#3b82f6",color:"#60a5fa"},btnHover:{borderColor:"#3b82f6",backgroundColor:"#1e3a5f"},tooltip:{position:"absolute",bottom:"calc(100% + 6px)",left:"50%",transform:"translateX(-50%)",padding:"4px 8px",backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"4px",color:"#e2e8f0",fontSize:"11px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:100},divider:{width:"1px",height:"20px",backgroundColor:"#334155",margin:"0 4px"},deleteBtn:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"13px",cursor:"pointer",transition:"all 0.15s ease",padding:0},deleteBtnHover:{borderColor:"#EF5350",backgroundColor:"#3b1515",color:"#EF5350"},visibilityBtn:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"13px",cursor:"pointer",transition:"all 0.15s ease",padding:0}};function Ju({showLabel:r=!0,showDelete:A=!0,showVisibility:e=!0,tools:t,label:i="Draw",style:s,className:n}){const{activeTool:o,setActiveTool:a,drawingsVisible:l,setDrawingsVisible:c,chartObjects:u,setChartObjects:d}=ge(),[B,p]=K.useState(null),f=t||tb,w=E=>{a(o===E?null:E)},F=()=>{d([]),a(null)},C=()=>{c(!l)};return h.jsxs("div",{style:{...nt.container,...s},className:n,children:[r&&h.jsx("span",{style:nt.label,children:i}),f.map(E=>h.jsxs("button",{style:{...nt.btn,...o===E.id?nt.btnActive:{}},onClick:()=>w(E.id),onMouseEnter:U=>{p(E.id),o!==E.id&&Object.assign(U.currentTarget.style,nt.btnHover)},onMouseLeave:U=>{p(null),o!==E.id&&(U.currentTarget.style.borderColor="#334155",U.currentTarget.style.backgroundColor="#1e293b",U.currentTarget.style.color="#94a3b8")},title:E.name,children:[E.icon,B===E.id&&h.jsx("div",{style:nt.tooltip,children:E.name})]},E.id)),(A||e)&&h.jsx("div",{style:nt.divider}),e&&h.jsx("button",{style:{...nt.visibilityBtn,...l?{}:{color:"#64748b",backgroundColor:"#0f172a"}},onClick:C,onMouseEnter:E=>{E.currentTarget.style.borderColor="#3b82f6"},onMouseLeave:E=>{E.currentTarget.style.borderColor="#334155"},title:l?"Hide Drawings":"Show Drawings",children:l?"👁":"○"}),A&&h.jsx("button",{style:nt.deleteBtn,onClick:F,onMouseEnter:E=>Object.assign(E.currentTarget.style,nt.deleteBtnHover),onMouseLeave:E=>{E.currentTarget.style.borderColor="#334155",E.currentTarget.style.backgroundColor="#1e293b",E.currentTarget.style.color="#94a3b8"},title:"Delete All Drawings",children:"🗑"})]})}const Zu={toolbar:{display:"flex",alignItems:"center",gap:"12px",padding:"6px 12px",backgroundColor:"#0f172a",borderBottom:"1px solid #1e293b",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",flexWrap:"wrap",minHeight:"42px"},divider:{width:"1px",height:"24px",backgroundColor:"#1e293b",flexShrink:0}};function rb({showCoinSelector:r=!0,showVolumeControl:A=!0,showStopLoss:e=!0,showTakeProfit:t=!0,showDrawingTools:i=!0,showDividers:s=!0,volume:n,onVolumeChange:o,stopLoss:a,onStopLossChange:l,stopLossEnabled:c,onStopLossEnabledChange:u,takeProfit:d,onTakeProfitChange:B,takeProfitEnabled:p,onTakeProfitEnabledChange:f,coinSelectorProps:w={},volumeControlProps:F={},stopLossProps:C={},takeProfitProps:E={},drawingToolsProps:U={},style:S,className:P}){const z=[];r&&z.push(h.jsx(Ru,{...w},"coin")),A&&z.push(h.jsx(Wu,{value:n,onChange:o,...F},"volume")),e&&z.push(h.jsx($u,{value:a,onChange:l,enabled:c,onEnabledChange:u,...C},"sl")),t&&z.push(h.jsx(Xu,{value:d,onChange:B,enabled:p,onEnabledChange:f,...E},"tp")),i&&z.push(h.jsx(Ju,{...U},"draw"));const J=[];return z.forEach((N,Z)=>{J.push(N),s&&Z<z.length-1&&J.push(h.jsx("div",{style:Zu.divider},`div-${Z}`))}),h.jsx("div",{style:{...Zu.toolbar,...S},className:P,children:J})}const ib=[{label:"M1",value:"M1"},{label:"M5",value:"M5"},{label:"M15",value:"M15"},{label:"M30",value:"M30"},{label:"H1",value:"H1"},{label:"H4",value:"H4"},{label:"D1",value:"D1"},{label:"W1",value:"W1"}],Yo={container:{display:"inline-flex",alignItems:"center",gap:"2px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},btn:{padding:"4px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"11px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap"},btnActive:{backgroundColor:"#1e3a5f",borderColor:"#3b82f6",color:"#60a5fa"}};function sb({style:r,className:A}){const{selectedTimeframe:e,setSelectedTimeframe:t}=ge();return h.jsx("div",{style:{...Yo.container,...r},className:A,children:ib.map(i=>h.jsx("button",{style:{...Yo.btn,...e===i.value?Yo.btnActive:{}},onClick:()=>t(i.value),onMouseEnter:s=>{e!==i.value&&(s.currentTarget.style.borderColor="#3b82f6")},onMouseLeave:s=>{e!==i.value&&(s.currentTarget.style.borderColor="#334155")},children:i.label},i.value))})}const nb=[{label:"Candles",value:"candles",icon:"📊"},{label:"Line",value:"line",icon:"📈"},{label:"Area",value:"area",icon:"▤"},{label:"Bars",value:"bars",icon:"▥"}],jo={container:{display:"inline-flex",alignItems:"center",gap:"2px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},btn:{padding:"4px 8px",backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"4px",color:"#94a3b8",fontSize:"11px",fontWeight:600,cursor:"pointer",transition:"all 0.15s ease",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"3px"},btnActive:{backgroundColor:"#1e3a5f",borderColor:"#3b82f6",color:"#60a5fa"}};function ob({style:r,className:A}){const{chartType:e,setChartType:t}=ge();return h.jsx("div",{style:{...jo.container,...r},className:A,children:nb.map(i=>h.jsxs("button",{style:{...jo.btn,...e===i.value?jo.btnActive:{}},onClick:()=>t(i.value),onMouseEnter:s=>{e!==i.value&&(s.currentTarget.style.borderColor="#3b82f6")},onMouseLeave:s=>{e!==i.value&&(s.currentTarget.style.borderColor="#334155")},title:i.label,children:[h.jsx("span",{children:i.icon}),h.jsx("span",{children:i.label})]},i.value))})}const Qe={container:{display:"inline-flex",alignItems:"center",gap:"6px",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif"},priceBox:{display:"flex",flexDirection:"column",alignItems:"center",padding:"4px 10px",backgroundColor:"#0f172a",borderRadius:"4px",minWidth:"80px"},priceLabel:{fontSize:"9px",color:"#64748b",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.05em"},priceValue:{fontSize:"13px",fontWeight:700,fontFamily:"monospace"},spread:{fontSize:"9px",color:"#64748b",padding:"0 4px",display:"flex",flexDirection:"column",alignItems:"center",gap:"1px"},spreadLabel:{fontSize:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},spreadValue:{fontSize:"10px",fontWeight:700,color:"#94a3b8"},sellBtn:{padding:"6px 16px",backgroundColor:"#7f1d1d",border:"1px solid #991b1b",borderRadius:"4px",color:"#fca5a5",fontSize:"12px",fontWeight:700,cursor:"pointer",transition:"all 0.15s ease",textTransform:"uppercase",letterSpacing:"0.03em",minWidth:"70px"},sellBtnHover:{backgroundColor:"#991b1b",borderColor:"#EF5350"},buyBtn:{padding:"6px 16px",backgroundColor:"#14532d",border:"1px solid #166534",borderRadius:"4px",color:"#86efac",fontSize:"12px",fontWeight:700,cursor:"pointer",transition:"all 0.15s ease",textTransform:"uppercase",letterSpacing:"0.03em",minWidth:"70px"},buyBtnHover:{backgroundColor:"#166534",borderColor:"#26A69A"},status:{fontSize:"10px",padding:"2px 8px",borderRadius:"3px",fontWeight:600,whiteSpace:"nowrap"}};function ab({volume:r=.1,stopLoss:A,takeProfit:e,onTradeExecuted:t,style:i,className:s}){const{selectedSymbol:n,currentSymbolData:o,setOrders:a,setUserBalance:l}=ge(),[c,u]=K.useState(null),d=parseFloat(o?.bid||0),B=parseFloat(o?.ask||0),p=B>0&&d>0?Math.abs(B-d):0,f=C=>!C||C===0?"-.-----":C>=1e3?C.toFixed(2):C>=1?C.toFixed(4):C.toFixed(5),w=C=>C===0?"-":C>=1?C.toFixed(1):C>=.01?C.toFixed(3):(C*1e4).toFixed(1)+"p",F=K.useCallback(C=>{if(!n)return;const E=C==="BUY"?B:d;if(!E||E<=0){u({type:"error",message:"No price available"});return}const U={id:Date.now().toString(),ticket:Math.floor(Math.random()*9e5)+1e5,symbol:n,type:C,volume:r,price:E,stopLoss:A?parseFloat(A):null,takeProfit:e?parseFloat(e):null,status:"OPEN",profit:0,swap:0,openAt:new Date().toISOString(),time:new Date().toLocaleTimeString()};a(P=>[...P,U]);const S=r*E*.01;l(P=>P-S),u({type:"success",message:`${C} executed`}),t?.(U),setTimeout(()=>u(null),3e3)},[n,B,d,r,A,e,a,l,t]);return h.jsxs("div",{style:{...Qe.container,...i},className:s,children:[h.jsx("button",{style:Qe.sellBtn,onClick:()=>F("SELL"),onMouseEnter:C=>{Object.assign(C.currentTarget.style,Qe.sellBtnHover)},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="#7f1d1d",C.currentTarget.style.borderColor="#991b1b"},children:"Sell"}),h.jsxs("div",{style:Qe.priceBox,children:[h.jsx("span",{style:Qe.priceLabel,children:"Bid"}),h.jsx("span",{style:{...Qe.priceValue,color:"#EF5350"},children:f(d)})]}),h.jsxs("div",{style:Qe.spread,children:[h.jsx("span",{style:Qe.spreadLabel,children:"Spread"}),h.jsx("span",{style:Qe.spreadValue,children:w(p)})]}),h.jsxs("div",{style:Qe.priceBox,children:[h.jsx("span",{style:Qe.priceLabel,children:"Ask"}),h.jsx("span",{style:{...Qe.priceValue,color:"#26A69A"},children:f(B)})]}),h.jsx("button",{style:Qe.buyBtn,onClick:()=>F("BUY"),onMouseEnter:C=>{Object.assign(C.currentTarget.style,Qe.buyBtnHover)},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="#14532d",C.currentTarget.style.borderColor="#166534"},children:"Buy"}),c&&h.jsx("span",{style:{...Qe.status,backgroundColor:c.type==="success"?"#14532d":"#7f1d1d",color:c.type==="success"?"#86efac":"#fca5a5",border:`1px solid ${c.type==="success"?"#166534":"#991b1b"}`},children:c.message})]})}const kA={container:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",backgroundColor:"#0f172a",borderTop:"1px solid #1e293b",fontSize:"11px",overflow:"hidden",display:"flex",flexDirection:"column"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",backgroundColor:"#0f172a",borderBottom:"1px solid #1e293b"},headerTitle:{color:"#94a3b8",fontSize:"11px",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},summary:{display:"flex",gap:"16px",fontSize:"11px"},summaryItem:{display:"flex",gap:"4px",alignItems:"center"},summaryLabel:{color:"#64748b",fontWeight:600},summaryValue:{fontWeight:700,fontFamily:"monospace"},table:{width:"100%",borderCollapse:"collapse"},th:{padding:"4px 8px",textAlign:"left",color:"#64748b",fontWeight:700,fontSize:"10px",textTransform:"uppercase",letterSpacing:"0.05em",borderBottom:"1px solid #1e293b",whiteSpace:"nowrap"},td:{padding:"4px 8px",color:"#cbd5e1",borderBottom:"1px solid #1e293b",whiteSpace:"nowrap",fontFamily:"monospace",fontSize:"11px"},closeBtn:{padding:"2px 8px",backgroundColor:"#7f1d1d",border:"1px solid #991b1b",borderRadius:"3px",color:"#fca5a5",fontSize:"10px",fontWeight:700,cursor:"pointer",transition:"all 0.15s ease"},emptyRow:{padding:"16px",textAlign:"center",color:"#475569",fontSize:"12px"},scrollArea:{overflowY:"auto",maxHeight:"200px"},typeBuy:{color:"#26A69A",fontWeight:700},typeSell:{color:"#EF5350",fontWeight:700}};function lb({style:r,className:A,maxHeight:e=200}){const{orders:t,setOrders:i,symbols:s,accountSummary:n,setUserBalance:o}=ge(),[a,l]=K.useState(null),c=t.filter(f=>f.status==="OPEN"||!f.closeAt),u=K.useCallback((f,w)=>{const F=s.find(C=>C.symbol===f);return F?parseFloat(w==="BUY"?F.bid||0:F.ask||0):0},[s]),d=K.useCallback(f=>{if(a)return;l(f.id);const w=u(f.symbol,f.type),C=(f.type==="BUY"?w-f.price:f.price-w)*f.volume,E=f.volume*f.price*.01;i(U=>U.filter(S=>S.id!==f.id)),o(U=>U+E+C),l(null)},[a,u,i,o]),B=f=>{const w=parseFloat(f);return!w||isNaN(w)?"-":w>=1e3?w.toFixed(2):w>=1?w.toFixed(4):w.toFixed(5)},p=f=>{const w=parseFloat(f);return isNaN(w)?"-":(w>=0?"+":"")+w.toFixed(2)};return h.jsxs("div",{style:{...kA.container,...r},className:A,children:[h.jsxs("div",{style:kA.header,children:[h.jsxs("span",{style:kA.headerTitle,children:["Positions (",c.length,")"]}),h.jsxs("div",{style:kA.summary,children:[h.jsxs("div",{style:kA.summaryItem,children:[h.jsx("span",{style:kA.summaryLabel,children:"Balance:"}),h.jsxs("span",{style:{...kA.summaryValue,color:"#e2e8f0"},children:["$",n?.balance?.toFixed(2)||"0.00"]})]}),h.jsxs("div",{style:kA.summaryItem,children:[h.jsx("span",{style:kA.summaryLabel,children:"Equity:"}),h.jsxs("span",{style:{...kA.summaryValue,color:(n?.equity||0)>=(n?.balance||0)?"#26A69A":"#EF5350"},children:["$",n?.equity?.toFixed(2)||"0.00"]})]}),h.jsxs("div",{style:kA.summaryItem,children:[h.jsx("span",{style:kA.summaryLabel,children:"Free:"}),h.jsxs("span",{style:{...kA.summaryValue,color:"#94a3b8"},children:["$",n?.freeMargin?.toFixed(2)||"0.00"]})]})]})]}),h.jsx("div",{style:{...kA.scrollArea,maxHeight:e},children:h.jsxs("table",{style:kA.table,children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{style:kA.th,children:"Symbol"}),h.jsx("th",{style:kA.th,children:"Type"}),h.jsx("th",{style:kA.th,children:"Volume"}),h.jsx("th",{style:kA.th,children:"Open Price"}),h.jsx("th",{style:kA.th,children:"Current"}),h.jsx("th",{style:kA.th,children:"SL"}),h.jsx("th",{style:kA.th,children:"TP"}),h.jsx("th",{style:kA.th,children:"Profit"}),h.jsx("th",{style:kA.th,children:"Action"})]})}),h.jsx("tbody",{children:c.length===0?h.jsx("tr",{children:h.jsx("td",{colSpan:9,style:kA.emptyRow,children:"No open positions"})}):c.map(f=>{const w=u(f.symbol,f.type),F=f.profit||0;return h.jsxs("tr",{children:[h.jsx("td",{style:{...kA.td,fontWeight:700,color:"#e2e8f0"},children:f.symbol}),h.jsx("td",{style:{...kA.td,...f.type==="BUY"?kA.typeBuy:kA.typeSell},children:f.type}),h.jsx("td",{style:kA.td,children:f.volume}),h.jsx("td",{style:kA.td,children:B(f.price)}),h.jsx("td",{style:kA.td,children:B(w)}),h.jsx("td",{style:kA.td,children:f.stopLoss?B(f.stopLoss):"-"}),h.jsx("td",{style:kA.td,children:f.takeProfit?B(f.takeProfit):"-"}),h.jsx("td",{style:{...kA.td,color:F>=0?"#26A69A":"#EF5350",fontWeight:700},children:p(F)}),h.jsx("td",{style:kA.td,children:h.jsx("button",{style:{...kA.closeBtn,...a===f.id?{opacity:.5,cursor:"not-allowed"}:{}},onClick:()=>d(f),disabled:a===f.id,onMouseEnter:C=>{a!==f.id&&(C.currentTarget.style.backgroundColor="#991b1b")},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="#7f1d1d"},children:a===f.id?"...":"Close"})})]},f.id)})})]})})]})}function cb(r){return Ir({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"},child:[]}]})(r)}function hb(r){return Ir({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 13H5v-2h14v2z"},child:[]}]})(r)}const ub=({selectedSymbol:r,selectedTimeframe:A,onTimeframeChange:e,chartType:t="candles",onChartTypeChange:i,onNewOrder:s,onZoomIn:n,onZoomOut:o,onToggleBuySell:a,onDownloadChartPNG:l,onToggleFullscreen:c,marketWatchOpen:u=!0,onToggleMarketWatch:d,buySellPanelOpen:B,onMove:p})=>{const{theme:f}=ge(),w=f==="light",F=["M1","M5","M15","M30","H1","H4","D1","W1","MN"],C={bars:h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{fillRule:"evenodd",d:"M20.999 15.002H19v3a1 1 0 0 1-2.001 0V8H15a1 1 0 1 1 0-2h1.999v-3A1 1 0 1 1 19 3v10h1.999a1 1 0 0 1 0 2Zm-10.999-4H6.999v10a1 1 0 1 1-1.999 0v-3H3a1 1 0 0 1 0-2h2v-11a1 1 0 1 1 1.999 0V9H10a1 1 0 0 1 0 2Z",clipRule:"evenodd",fill:"currentColor"})]}),candles:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M9 3V9H11V18H9V21H7V18H5V9H7V3H9ZM17 3V6H19V16H17V19H15V16H13V6H15V3H17ZM17 8H15V14H17V8Z",fill:"currentColor"})}),area:h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{d:"m2.166 16.571 7.013-7.194c.38-.583 1.116-.273 1.707.256l4.14 2.31 5.136-6.692c.277-.425 1.853-.182 1.853-.182v13.952H2.047a7.772 7.772 0 0 1 .119-2.45Z",opacity:".2",fill:"currentColor"}),h.jsx("path",{d:"M3.027 18.011a1 1 0 0 1-.81-1.58c.81-1.128 1.5-2.154 2.113-3.065 1.938-2.887 3.22-4.795 5.234-5.042 1.607-.195 3.364.683 6.28 3.212l4.35-6.086a1 1 0 0 1 1.626 1.16l-4.994 6.99a1 1 0 0 1-1.483.16c-2.824-2.552-4.481-3.587-5.536-3.454-1.108.136-2.186 1.742-3.82 4.173-.621.927-1.323 1.971-2.148 3.117a1.001 1.001 0 0 1-.812.415Z",fill:"currentColor"})]}),line:h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{d:"M3.027 18.011a1 1 0 0 1-.81-1.58c.81-1.128 1.5-2.154 2.113-3.065 1.938-2.887 3.22-4.795 5.234-5.042 1.607-.195 3.364.683 6.28 3.212l4.35-6.086a1 1 0 0 1 1.626 1.16l-4.994 6.99a1 1 0 0 1-1.483.16c-2.824-2.552-4.481-3.587-5.536-3.454-1.108.136-2.186 1.742-3.82 4.173-.621.927-1.323 1.971-2.148 3.117a1.001 1.001 0 0 1-.812.415Z",fill:"currentColor"})]}),volume:h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{fillRule:"evenodd",d:"M19.024 17.844H19a1 1 0 0 1-1-1V13a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v3.844a1 1 0 0 1-1 1Zm-3 0H16a1 1 0 0 1-1-1v-5.845A1 1 0 0 1 16 10h.024a1 1 0 0 1 1 .999v5.845a1 1 0 0 1-1 1Zm-3 0H13a1 1 0 0 1-1-1V6.999A1 1 0 0 1 13 6h.024a1 1 0 0 1 1 .999v9.845a1 1 0 0 1-1 1Zm-3 0H10a1 1 0 0 1-1-1V12a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v4.844a1 1 0 0 1-1 1Zm-3 0H7a1 1 0 0 1-1-1V9.999A.999.999 0 0 1 7 9h.024a1 1 0 0 1 1 .999v6.845a1 1 0 0 1-1 1Zm-3 0H4a1 1 0 0 1-1-1v-2.845a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v2.845a1 1 0 0 1-1 1Z",clipRule:"evenodd",fill:"currentColor"})]}),"volume ticks":h.jsxs("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{fillRule:"evenodd",d:"M20.009 6.993h-.985v3.985a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1V6.993h-.946c-.565 0-1.023-.441-1.023-.985v-.024c0-.543.458-.984 1.023-.984h3.955c.565 0 1.023.441 1.023.984v.024c0 .544-.458.985-1.023.985Zm-3.985 6.14v5.845a1 1 0 0 1-1 1H15a1 1 0 0 1-1-1v-5.845a1 1 0 0 1 1-.999h.024a1 1 0 0 1 1 .999Zm-4 6.845H12a1 1 0 0 1-1-1V9.133a1 1 0 0 1 1-.999h.024a1 1 0 0 1 1 .999v9.845a1 1 0 0 1-1 1Zm-3 0H9a1 1 0 0 1-1-1v-4.844a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v4.844a1 1 0 0 1-1 1Zm-3 0H6a1 1 0 0 1-1-1v-6.845a.998.998 0 0 1 1-.999h.024a1 1 0 0 1 1 .999v6.845a1 1 0 0 1-1 1Zm-3 0H3a1 1 0 0 1-1-1v-2.845a1 1 0 0 1 1-1h.024a1 1 0 0 1 1 1v2.845a1 1 0 0 1-1 1ZM18 14.134h.024a1 1 0 0 1 1 1v3.844a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-3.844a1 1 0 0 1 1-1Z",clipRule:"evenodd",fill:"currentColor"})]})};return h.jsxs("div",{className:`flex items-center justify-between px-4 py-1 border-b ${w?"bg-white border-slate-200":"bg-[#12161d] border-slate-700"}`,children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("div",{className:`flex items-center gap-1 border-r pr-3 ${w?"border-slate-200":"border-slate-700"}`,children:["bars","candles","line","area"].map(E=>h.jsx("button",{onClick:()=>i(E),className:`px-1 py-1.5 text-[11px] font-medium rounded transition-colors capitalize flex items-center gap-1.5
11
+ ${t===E?w?"text-sky-600":"text-sky-400":w?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-white hover:text-slate-200 hover:bg-slate-800"}
12
+ `,title:E,children:C[E]},E))}),h.jsx("div",{className:`flex items-center gap-1 border-r ${w?"border-slate-200":"border-slate-700"} pr-1`,children:["volume ticks","volume"].map(E=>h.jsx("button",{onClick:()=>i(E),className:`px-1 py-1.5 text-[11px] font-medium rounded transition-colors capitalize flex items-center gap-1.5
13
+ ${t===E?w?"text-sky-600":"text-sky-400":w?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-white hover:text-slate-200 hover:bg-slate-800"}
14
+ `,title:E,children:C[E]},E))}),h.jsxs("div",{className:"flex items-center gap-2",children:[F.map(E=>h.jsx("button",{onClick:()=>e(E),className:`px-1.5 py-2 text-sm font-medium rounded transition-colors ${A===E?w?"text-sky-600":"text-sky-400":w?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-white hover:text-slate-200 hover:bg-slate-800"}`,children:E},E)),h.jsx("div",{className:`border-r h-6 mx-1 ${w?"border-slate-200":"border-slate-700"}`}),h.jsx("button",{onClick:()=>a?.(),title:B?"Hide Buy/Sell on Chart":"Show Buy/Sell on Chart",className:`px-2 py-2 flex justify-center items-center rounded transition-colors ${B?w?"text-sky-600 bg-sky-50 hover:bg-[#E5F4FF]":"text-sky-400 bg-slate-700 hover:bg-[#25303C]":w?"text-slate-600 hover:text-sky-600 hover:bg-[#E5F4FF]":"text-slate-200 hover:bg-[#25303C]"}`,children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{fill:"#DA5244",d:"M11.5 5v4H9c-1.054 0-1.918.816-1.995 1.85L7 11v2c0 1.105.895 2 2 2h2.5v4H4c-1.105 0-2-.895-2-2V7c0-1.105.895-2 2-2h7.5z"}),h.jsx("path",{fill:"#3687ED",d:"M20 5c1.105 0 2 .895 2 2v10c0 1.105-.895 2-2 2h-7.5v-4H15c1.054 0 1.918-.816 1.995-1.85L17 13v-2c0-1.105-.895-2-2-2h-2.5V5H20z"}),h.jsx("path",{fill:"#B0BEC5",d:"M10 10h4c1.105 0 2 .895 2 2s-.895 2-2 2h-4c-1.105 0-2-.895-2-2s.895-2 2-2z"})]})})}),h.jsxs("button",{onClick:s,className:`px-2 py-2 flex justify-center items-center gap-1 cursor-pointer text-xs font-medium rounded transition-colors ${w?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-white hover:bg-[#25303C]"}`,children:[h.jsx("svg",{width:24,height:24,viewBox:"0 0 24 24 ",xmlns:"http://www.w3.org/2000/svg",children:h.jsxs("g",{fill:"none",fillRule:"evenodd",children:[h.jsx("path",{fill:"#DA5244",d:"M11.5 4v2.02C8.42 6.276 6 8.856 6 12c0 3.145 2.42 5.725 5.5 5.98V20H10c-4.418 0-8-3.582-8-8s3.582-8 8-8h1.5z"}),h.jsx("path",{fill:"#3687ED",d:"M14 4c4.418 0 8 3.582 8 8s-3.582 8-8 8h-1.5v-2.02c3.08-.256 5.5-2.836 5.5-5.98 0-3.145-2.42-5.725-5.5-5.98V4H14z"}),h.jsx("path",{fill:"#B0BEC5",d:"M13 8v4.186l2.657 2.657-1.414 1.414L11 13V8z"})]})}),h.jsx("span",{className:"button-text svelte-1iwf8ix",children:"New Order"})]}),h.jsx("div",{className:`border-r ${w?"border-slate-200":"border-slate-700"} h-6 mx-1`}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{onClick:n,className:`p-1 ${w?"text-slate-700 hover:bg-[#E5F4FF]":"text-white hover:bg-slate-800"} rounded transition-colors`,title:"Zoom In",children:h.jsx(cb,{className:"w-5 h-5"})}),h.jsx("button",{onClick:o,className:`p-2 ${w?"text-slate-700 hover:bg-[#E5F4FF]":"text-white hover:bg-slate-800"} rounded transition-colors`,title:"Zoom Out",children:h.jsx(hb,{className:"w-5 h-5"})}),h.jsx("div",{className:`border-r ${w?"border-slate-200":"border-slate-700"} h-6 mx-1`}),h.jsx("button",{onClick:p,className:`px-2 py-2 flex justify-center items-center gap-1 cursor-pointer text-xs font-medium rounded transition-colors ${w?"text-slate-700 hover:text-slate-900 hover:bg-[#E5F4FF]":"text-slate-200 hover:bg-[#25303C]"}`,children:h.jsx("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M9 4V5H15V4H17V5H19C20.1046 5 21 5.89543 21 7V18C21 19.1046 20.1046 20 19 20H5C3.89543 20 3 19.1046 3 18V7C3 5.89543 3.89543 5 5 5H7V4H9ZM7 7H6C5.44772 7 5 7.44772 5 8V17C5 17.5523 5.44772 18 6 18H18C18.5523 18 19 17.5523 19 17V8C19 7.44772 18.5523 7 18 7H17V8H15V7H9V8H7V7ZM13 14V16H11V14H13ZM9 14V16H7V14H9ZM17 14V16H15V14H17ZM13 10V12H11V10H13ZM17 10V12H15V10H17Z",clipRule:"evenodd"})})}),h.jsx("div",{className:`border-r ${w?"border-slate-200":"border-slate-700"} h-6 mx-1`}),h.jsx("button",{type:"button",onClick:()=>d?.(),title:u?"Close Market Watch":"Open Market Watch",className:`px-2 py-2 flex justify-center items-center gap-1 cursor-pointer text-xs font-medium rounded transition-colors ${u?w?"text-sky-600 bg-sky-50 hover:bg-[#E5F4FF]":"text-sky-400 bg-slate-700 hover:bg-[#25303C]":w?"text-slate-600 hover:text-sky-600 hover:bg-[#E5F4FF]":"text-slate-200 hover:bg-[#25303C]"}`,children:h.jsxs("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[h.jsx("path",{d:"M15 7H7v2h8V7ZM7 15h5v2H7v-2ZM17 11H7v2h10v-2Z"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14Zm-1 2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h12Z"})]})})]})]})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{type:"button",onClick:()=>l?.(),title:"Download chart as PNG",className:`p-2 rounded transition-colors ${w?"text-slate-500 hover:text-slate-800 hover:bg-slate-100":"text-slate-300 hover:text-white hover:bg-slate-800"}`,children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",className:"inline-block",fill:"currentColor",children:h.jsx("path",{d:"M22 10a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0-4a1 1 0 0 1-1-1V4h-1a1 1 0 1 1 0-2h1a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1Zm1 7v8a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-8l3.764-1s.45-.428.789-1.105l.171-.342a.998.998 0 0 1 .894-.553h4.764a1 1 0 0 1 .894.552l.171.342c.339.678.789 1.106.789 1.106L23 13Zm-8 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6Zm0 4.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3ZM16 4h-2a1 1 0 1 1 0-2h2a1 1 0 1 1 0 2Zm-6 0H8a1 1 0 0 1 0-2h2a1 1 0 1 1 0 2ZM4 22H3a2 2 0 0 1-2-2v-1a1 1 0 1 1 2 0v1h1a1 1 0 1 1 0 2ZM4 4H3v1a1 1 0 0 1-2 0V4a2 2 0 0 1 2-2h1a1 1 0 0 1 0 2ZM2 8a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0V9a1 1 0 0 1 1-1Zm0 5a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1Z"})})}),h.jsx("button",{type:"button",onClick:()=>c?.(),title:"Full screen (F11)",className:`p-2 rounded transition-colors ${w?"text-slate-600 hover:text-slate-800 hover:bg-slate-100":"text-slate-300 hover:text-white hover:bg-slate-800"}`,children:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"})})})]})]})},ti=[{label:"Trendline",toolId:2,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{fillRule:"evenodd",d:"M19.054 7.988a2.988 2.988 0 0 1-1.31-.312l-10 10a3.027 3.027 0 1 1-1.38-1.381l10-10a2.994 2.994 0 1 1 2.69 1.693Zm-14 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm14-14a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",clipRule:"evenodd",fill:"currentColor"})]})},{label:"Horizontal Line",toolId:20,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M4 12h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("circle",{cx:"4",cy:"12",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"20",cy:"12",r:"1.5",fill:"currentColor"})]})},{label:"Horizontal Ray",toolId:21,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M4 12h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("circle",{cx:"4",cy:"12",r:"1.5",fill:"currentColor"}),h.jsx("path",{d:"M19 9l3 3-3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})},{label:"Vertical Line",toolId:22,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M12 4v16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("circle",{cx:"12",cy:"4",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"12",cy:"20",r:"1.5",fill:"currentColor"})]})},{label:"Info Line",toolId:23,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{fillRule:"evenodd",d:"M19.054 7.988a2.988 2.988 0 0 1-1.31-.312l-10 10a3.027 3.027 0 1 1-1.38-1.381l10-10a2.994 2.994 0 1 1 2.69 1.693Zm-14 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm14-14a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",clipRule:"evenodd",fill:"currentColor"}),h.jsx("rect",{x:"10",y:"5",width:"7",height:"5",rx:"1",fill:"currentColor",opacity:"0.5"}),h.jsx("text",{x:"11",y:"9",fontSize:"4",fill:"white",fontWeight:"bold",children:"i"})]})},{label:"Ruler Line",toolId:24,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:[h.jsx("line",{x1:"4",y1:"20",x2:"20",y2:"4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),h.jsx("rect",{x:"7",y:"7",width:"10",height:"5",rx:"1",transform:"rotate(-45 12 12)",stroke:"currentColor",strokeWidth:"1.3",fill:"none"}),h.jsx("line",{x1:"10.5",y1:"13.5",x2:"12",y2:"12",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"}),h.jsx("line",{x1:"12.5",y1:"11.5",x2:"14",y2:"10",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"}),h.jsx("circle",{cx:"4.5",cy:"19.5",r:"1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),h.jsx("circle",{cx:"19.5",cy:"4.5",r:"1.5",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})},{label:"Arrowed Line",toolId:25,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{fillRule:"evenodd",d:"M5.054 17.988a2.988 2.988 0 0 1-1.31-.312 2.994 2.994 0 1 1 2.69 1.693 2.988 2.988 0 0 1-1.38-.381Zm-1 2a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",clipRule:"evenodd",fill:"currentColor"}),h.jsx("path",{d:"M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M14 6h4v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})},{label:"Ray",toolId:26,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("circle",{cx:"5",cy:"19",r:"2",fill:"currentColor"}),h.jsx("path",{d:"M6.4 17.6L19 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M16 5h3v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]})},{label:"Extended Line",toolId:27,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M2 19L22 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"3 0 3"}),h.jsx("circle",{cx:"8",cy:"15",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"16",cy:"9",r:"1.5",fill:"currentColor"})]})},{label:"Cross Line",toolId:28,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M12 4v16M4 12h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]})},{label:"Trend By Angle",toolId:29,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M5 19L19 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M5 19h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),h.jsx("path",{d:"M5 13a6 6 0 0 1 0 6",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]})},{label:"Disjoint Channel",toolId:30,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M3 17L9 11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M9 17L15 11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M15 17L21 11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M3 14L21 14",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeDasharray:"2 2"})]})},{label:"Flat Top/Bottom",toolId:31,icon:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M4 8h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M4 16h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M8 8v8M16 8v8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"2 2"})]})}],db=({children:r,top:A,panelRef:e,isLight:t})=>h.jsx("div",{ref:e,className:`absolute left-12 z-50 w-56 border shadow-2xl overflow-visible ${t?"bg-white border-slate-200":"bg-[#262F3F] border-white/10"}`,style:{top:A},children:h.jsx("div",{className:"py-1",children:r})}),fb=({AccountId:r,UserName:A,UserId:e})=>{const{activeTool:t,setActiveTool:i,showGrid:s,setShowGrid:n,snapToGrid:o,setSnapToGrid:a,chartObjects:l,setChartObjects:c,drawingsVisible:u,setDrawingsVisible:d,chartLocked:B,setChartLocked:p,theme:f,setTheme:w}=ge(),[F,C]=K.useState(!1),[E,U]=K.useState(null),[S,P]=K.useState(!1),[z,J]=K.useState(0),[N,Z]=K.useState(!1),[W,aA]=K.useState({chart:"Grid",colors:"Green & Red",lang:"English"}),nA=K.useRef(null),cA=K.useRef(null),SA=K.useRef(null);K.useEffect(()=>{const j=eA=>{const QA=nA.current;F&&QA&&!QA.contains(eA.target)&&(C(!1),U(null));const gA=cA.current;S&&gA&&!gA.contains(eA.target)&&P(!1)};return window.addEventListener("mousedown",j),()=>window.removeEventListener("mousedown",j)},[F,S]),K.useEffect(()=>{const j=eA=>{eA.key==="Escape"&&(C(!1),U(null),P(!1))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[]);const CA=K.useMemo(()=>[{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M3 18H21V16H3V18ZM3 13H21V11H3V13ZM3 6V8H21V6H3Z",fill:"currentColor"})]})}),label:"Menu",description:"Opens/closes navigation menu"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M12 13C12.5523 13 13 12.5523 13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12C11 12.5523 11.4477 13 12 13Z",fill:"currentColor"}),h.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 13H15.874C15.5122 14.4056 14.4056 15.5122 13 15.874V20C13 20.2652 12.8946 20.5196 12.7071 20.7071C12.5196 20.8946 12.2652 21 12 21C11.7348 21 11.4804 20.8946 11.2929 20.7071C11.1054 20.5196 11 20.2652 11 20V15.874C9.59439 15.5122 8.4878 14.4056 8.12602 13H4C3.73478 13 3.48043 12.8946 3.29289 12.7071C3.10536 12.5196 3 12.2652 3 12C3 11.7348 3.10536 11.4804 3.29289 11.2929C3.48043 11.1054 3.73478 11 4 11H8.12602C8.4878 9.59439 9.59439 8.4878 11 8.12602V4C11 3.73478 11.1054 3.48043 11.2929 3.29289C11.4804 3.10536 11.7348 3 12 3C12.2652 3 12.5196 3.10536 12.7071 3.29289C12.8946 3.48043 13 3.73478 13 4V8.12602C14.4056 8.4878 15.5122 9.59439 15.874 11H20C20.2652 11 20.5196 11.1054 20.7071 11.2929C20.8946 11.4804 21 11.7348 21 12C21 12.2652 20.8946 12.5196 20.7071 12.7071C20.5196 12.8946 20.2652 13 20 13ZM12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10Z",fill:"currentColor"})]})}),label:"Crosshair",description:"Precise cursor positioning for measurement on chart"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:[h.jsx("path",{fill:"none",d:"M0 0h24v24H0z"}),h.jsx("path",{fillRule:"evenodd",d:"M19.054 7.988a2.988 2.988 0 0 1-1.31-.312l-10 10a3.027 3.027 0 1 1-1.38-1.381l10-10a2.994 2.994 0 1 1 2.69 1.693Zm-14 10a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm14-14a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",clipRule:"evenodd",fill:"currentColor"})]})}),label:"Trend Line",description:"Draw trend line (drag from first point to second point)"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"m2.285 10.333 8.048-8.048a.977.977 0 1 1 1.381 1.381l-8.048 8.049a.977.977 0 0 1-1.381-1.382Zm10 10 8.048-8.048a.977.977 0 1 1 1.381 1.381l-8.048 8.049a.977.977 0 0 1-1.381-1.382ZM19 8a2.966 2.966 0 0 1-1.308-.312l-10 10c.202.408.307.857.308 1.312a3.03 3.03 0 1 1-1.693-2.689l10-10A2.993 2.993 0 1 1 19 8ZM5 18a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM19 4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})}),label:"Parallel Lines",description:"Draw two parallel trend lines (draw first line, then second)"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M21 15H3a1 1 0 0 1 0-2h18a1 1 0 0 1 0 2Zm-2-3a2.99 2.99 0 0 1-2.816-2H3a1 1 0 0 1 0-2h13.184A2.995 2.995 0 1 1 19 12Zm0-4a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm2-3H3a1 1 0 0 1 0-2h18a1 1 0 1 1 0 2ZM5 16a2.99 2.99 0 0 1 2.816 2H21a1 1 0 0 1 0 2H7.816A2.995 2.995 0 1 1 5 16Zm0 4a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})}),label:"Fibonacci",description:"Draw Fibonacci retracement levels"},{icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M3 6C3 7.30622 3.83481 8.41746 5 8.82929V15.1707C3.83481 15.5825 3 16.6938 3 18C3 19.6569 4.34315 21 6 21C7.30622 21 8.41746 20.1652 8.82929 19H15.1707C15.5825 20.1652 16.6938 21 18 21C19.6569 21 21 19.6569 21 18C21 16.6938 20.1652 15.5825 19 15.1707V8.82929C20.1652 8.41746 21 7.30622 21 6C21 4.34315 19.6569 3 18 3C16.6938 3 15.5825 3.83481 15.1707 5H8.82929C8.41746 3.83481 7.30622 3 6 3C4.34315 3 3 4.34315 3 6ZM6 7C6.55228 7 7 6.55228 7 6C7 5.44772 6.55228 5 6 5C5.44772 5 5 5.44772 5 6C5 6.55228 5.44772 7 6 7ZM17 15.1707V8.82929C16.1476 8.52801 15.472 7.85242 15.1707 7H8.82929C8.52801 7.85241 7.85241 8.52801 7 8.82929V15.1707C7.85241 15.472 8.52801 16.1476 8.82929 17H15.1707C15.472 16.1476 16.1476 15.472 17 15.1707ZM18 7C18.5523 7 19 6.55228 19 6C19 5.44772 18.5523 5 18 5C17.4477 5 17 5.44772 17 6C17 6.55228 17.4477 7 18 7ZM7 18C7 18.5523 6.55228 19 6 19C5.44772 19 5 18.5523 5 18C5 17.4477 5.44772 17 6 17C6.55228 17 7 17.4477 7 18ZM19 18C19 18.5523 18.5523 19 18 19C17.4477 19 17 18.5523 17 18C17 17.4477 17.4477 17 18 17C18.5523 17 19 17.4477 19 18Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})})}),label:"Rectangle",description:"Draw support/resistance zone (drag from corner to corner)"},{icon:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20 4V8H18V6H13V18H16V20H8V18H11V6H6V8H4V4H20Z",fill:"currentColor"})})}),label:"Text",description:"Add text label on chart (coming soon)"},{icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M12.76 17.958c-.504.07-1.016.07-1.52 0C6.07 17.532 2 12.932 2 12c0-.977 4.48-6 10-6s10 5.043 10 6c0 .912-4.07 5.529-9.24 5.958ZM3.63 12a11.724 11.724 0 0 0 3.03 2.741 5.963 5.963 0 0 1 .02-5.492A11.7 11.7 0 0 0 3.63 12ZM12 7.57a4.443 4.443 0 1 0-.006 8.886A4.443 4.443 0 0 0 12 7.57Zm5.31 1.652a5.954 5.954 0 0 1 .01 5.546A11.45 11.45 0 0 0 20.37 12a11.525 11.525 0 0 0-3.06-2.778ZM12 14a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})})}),label:"Eye",description:"Show or hide all drawing objects on chart"},{icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)",cursor:"pointer"},children:h.jsx("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M16 20H8a2 2 0 0 1-2-2v-7a2 2 0 0 1 1.05-1.749A1.044 1.044 0 0 1 7 9a5 5 0 0 1 8.75-3.3 1.008 1.008 0 0 1-.09 1.411 1 1 0 0 1-1.41-.09A3 3 0 0 0 9 9h7a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2Zm0-9H8v7h8v-7Zm-4 2a1 1 0 0 1 1 1v1a1 1 0 0 1-2 0v-1a1 1 0 0 1 1-1Z",fillRule:"evenodd",clipRule:"evenodd",fill:"currentColor"})})})}),label:"Lock",description:"Lock chart (disable pan and zoom)"},{icon:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),label:"Delete",description:"Remove last drawn object from chart"},{icon:h.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16M6 4v16M12 4v16M18 4v16"})}),label:"Grid",description:"Toggle grid display on/off for chart alignment"},{icon:h.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("circle",{cx:"12",cy:"12",r:"8",strokeWidth:2}),h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l-3 3m6-3l-3-3"})]}),label:"History",description:"Undo/redo actions and view action history"},{icon:h.jsxs("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[h.jsx("rect",{x:"3",y:"3",width:"8",height:"8",strokeWidth:2}),h.jsx("rect",{x:"13",y:"3",width:"8",height:"8",strokeWidth:2}),h.jsx("rect",{x:"3",y:"13",width:"8",height:"8",strokeWidth:2}),h.jsx("rect",{x:"13",y:"13",width:"8",height:"8",strokeWidth:2})]}),label:"Layout",description:"Manage chart layouts and panel arrangements"}],[]),MA=j=>{const eA=CA[j].label;if(eA==="Menu"){C(QA=>!QA),U(null);return}if(eA==="Grid"){n(!s);return}if(eA==="Magnet"){a(!o),i(o?null:j);return}if(eA==="Delete"){if(l.length>0){const QA=[...l];QA.pop(),c(QA)}return}if(eA==="Eye"){d(!u);return}if(eA==="Lock"){p(!B);return}if(eA==="Light Theme"||eA==="Dark Theme"){w(f==="light"?"dark":"light"),C(!1),U(null);return}i(t===j?null:j)},HA=CA.slice(0,12),UA=CA.slice(12),yA=[{key:"accounts",label:"Trading accounts",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:h.jsx("path",{d:"M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20zm0 14a6 6 0 0 0-5 2 8 8 0 0 0 5 2l5-2a6 6 0 0 0-5-2zm0-12a8 8 0 0 0-6 13 8 8 0 0 1 6-3 8 8 0 0 1 6 3 8 8 0 0 0-6-13zm0 2a4 4 0 1 1 0 8 4 4 0 0 1 0-8zm0 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",fill:"currentColor"})})})}),submenu:[{label:"Connect to account",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Open Demo account",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fill:"#CDFDDA",fillRule:"evenodd",d:"M14.5 13.103c1.836 0 3.667.723 5.5 2.14V19l-10.5.5-.5-4.257c1.833-1.417 3.664-2.14 5.5-2.14Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#00AC00",fillRule:"evenodd",d:"M9.53 15.469 9.5 19l10-.477v-3.032c-1.703-1.27-3.365-1.888-5-1.888-1.626 0-3.277.611-4.97 1.866Zm-.836-.622c1.895-1.465 3.83-2.244 5.806-2.244 1.975 0 3.91.78 5.806 2.244l.194.15v4.48l-12.03.545V15.02l.224-.173Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#CDFDDA",fillRule:"evenodd",d:"m7.736 13.701-.734 2.345L7.001 20H4.5a1 1 0 0 1-1-1v-4c1.412-.669 2.824-1.102 4.236-1.299Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#00AC00",fillRule:"evenodd",d:"m7.913 13.678-.475 1.086c-.988.111-1.87.308-2.646.59l-.29.11v3.529H7L7.002 20H4.5a1 1 0 0 1-1-1v-4c1.471-.697 2.942-1.138 4.413-1.322Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#CDFDDA",d:"M14.5 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"}),h.jsx("path",{fill:"#00AC00",fillRule:"evenodd",d:"M14.5 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm0 1a3 3 0 1 0 0 6 3 3 0 0 0 0-6Z","clip-rule":"evenodd"}),h.jsx("path",{fill:"#00AC00",d:"M11.471 11.979A4.992 4.992 0 0 1 9.5 8c0-.67.131-1.308.37-1.891a3.5 3.5 0 1 0 1.601 5.87Z"}),h.jsx("path",{fill:"#CDFDDA",d:"M9.586 7.07a2.5 2.5 0 1 0 1.153 4.226A4.981 4.981 0 0 1 9.5 8c0-.318.03-.63.086-.93Z"})]})})})}]},{key:"chart",label:"Chart settings",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M9 3V9H11V18H9V21H7V18H5V9H7V3H9ZM17 3V6H19V16H17V19H15V16H13V6H15V3H17ZM17 8H15V14H17V8Z",stroke:"currentColor"})})})}),submenu:[{label:"Grid",icon:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("g",{clipPath:"url(#a)",children:h.jsx("path",{fillRule:"evenodd","clip-rule":"evenodd",d:"M20 6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6zm-2 3V6h-3v3h3zm-4-3h-4v2.999h4V6zM9 6H6v3l3-.001V6zm-3 4v4l3-.001v-4H6zm0 5v3h3v-3.001H6zm4 3h4v-3.001h-4V18zm5 0h3v-3h-3v3zm3-4v-4h-3v4h3zm-8-.001v-4h4v4h-4z",fill:"currentColor"})})})},{label:"Trade Orders",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M4 9H20V10H4V9Z",fill:"#3183FF"}),h.jsx("path",{d:"M4 17H20V18H4V17Z",fill:"#EA4C4C"}),h.jsx("react",{x:"4",y:"14",width:"5",height:"2",fill:"#EA4C4C"}),h.jsx("react",{x:"4",y:"6",width:"5",height:"2",fill:"#3183FF"})]})})})},{label:"Trade Position",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M16 10L12 5H20L16 10Z",fill:"#D95852"}),h.jsx("path",{d:"M16 10H20V11H4V10H16Z",fill:"#D95852"}),h.jsx("path",{d:"M20 13H4V14H8L4 19H12L8 14H20V13Z",fill:"#4682F7"})]})})})},{label:"Trade History",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M4 19L8 14L12 19H4Z",fill:"#3183FF"}),h.jsx("path",{d:"M7 16L17.5 8",stroke:"#3183FF",strokeDasharray:"2 2"}),h.jsx("path",{d:"M13 5L17 10L21 5H13Z",fill:"#EA4C4C"})]})})})},{label:"SL/TP Levels",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"m4.688 17.773-.375.91c.43.277.911.415 1.445.415.614 0 1.104-.15 1.469-.45.367-.299.55-.68.55-1.144 0-.258-.044-.491-.132-.7a1.568 1.568 0 0 0-.387-.55c-.17-.159-.446-.332-.828-.52-.727-.354-1.09-.695-1.09-1.023 0-.198.064-.358.191-.48.13-.126.313-.188.547-.188.396 0 .772.128 1.129.383l.309-.875c-.31-.248-.796-.371-1.457-.371-.508 0-.925.146-1.25.437a1.421 1.421 0 0 0-.485 1.102c0 .237.04.453.121.648.084.195.2.365.352.508.154.14.45.322.887.543.44.219.73.417.87.594.141.177.212.363.212.558 0 .417-.299.625-.895.625-.388 0-.782-.14-1.184-.422ZM8.68 13.277V19h3.601v-.902H9.695v-4.82H8.68ZM20 20H4v1h16v-1Z",fill:"#EA4C4C"}),h.jsx("path",{d:"M10.5 10V7.895c.193.018.346.027.46.027 1.548 0 2.321-.656 2.321-1.969 0-.588-.21-1.02-.629-1.297-.416-.278-1.076-.418-1.98-.418-.115 0-.51.015-1.188.043V10H10.5Zm0-3.008V5.16c.099-.013.202-.02.309-.02.955 0 1.433.298 1.433.891 0 .35-.107.602-.32.758-.214.154-.552.23-1.016.23-.099 0-.234-.009-.406-.027Z",fill:"#3183FF",fillRule:"evenodd","clip-rule":"evenodd"}),h.jsx("path",{d:"M6.914 10V5.18h1.902v-.903H4.078v.903h1.82V10h1.016ZM20 11H4v1h16v-1Z",fill:"#3183FF"})]})})})},{label:"Ask Price",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"m6.926 14-.418-1.16H4.547L4.148 14H3.02L5.3 8.2h.446l2.3 5.8h-1.12ZM5.523 9.95l-.687 2.113H6.21l-.688-2.114Zm2.86 3.734.375-.91c.4.28.795.421 1.183.421.597 0 .895-.208.895-.625a.886.886 0 0 0-.211-.558c-.14-.177-.431-.375-.871-.594-.438-.221-.733-.402-.887-.543a1.506 1.506 0 0 1-.351-.508 1.682 1.682 0 0 1-.121-.648c0-.443.161-.81.484-1.102.325-.291.742-.437 1.25-.437.661 0 1.147.123 1.457.37l-.309.876a1.909 1.909 0 0 0-1.129-.383c-.234 0-.416.062-.546.187a.635.635 0 0 0-.192.48c0 .33.363.67 1.09 1.024.383.188.659.361.828.52.17.156.298.34.387.55.088.209.133.442.133.7 0 .463-.184.845-.551 1.144-.365.3-.854.45-1.469.45a2.617 2.617 0 0 1-1.445-.414Zm7.613.316-1.594-2.438-.636.872V14H12.75V8.277h1.016v2.739l1.945-2.739h1.156l-1.793 2.5L17.211 14h-1.215ZM3 15h18v1H3z",fill:"#C96057"})})})})},{label:"Chart Controls",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M0 0h24v24H0z",fill:"none"}),h.jsx("path",{d:"M10 10L20 14L18 16L20 18L18 20L16 18L14 20L10 10Z",fill:"currentColor"}),h.jsx("path",{d:"M11.2574 18.9959C11.1719 18.9986 11.0861 19 11 19C6.58172 19 3 15.4183 3 11C3 6.58172 6.58172 3 11 3C15.4183 3 19 6.58172 19 11C19 11.0599 18.9993 11.1196 18.998 11.1791L16.9574 10.2813C16.6023 7.3064 14.0705 5 11 5C7.68629 5 5 7.68629 5 11C5 14.191 7.49101 16.8002 10.6345 16.9891L11.2574 18.9959Z",fill:"currentColor"})]})})})},{label:"Trade Notification",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Crosshair cursor",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0-6 0",stroke:"currentColor",strokeWidth:"2"}),h.jsx("path",{d:"M12 2v4M12 18v4M2 12h4M18 12h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Show OHLC",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M7 17V7M12 17v-6M17 17v-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}]},{key:"oneclick",label:"One Click Trading",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20.9914 12.3966L18.9885 11.5954C18.7789 7.91769 15.7302 5 12 5C8.13401 5 5 8.13401 5 12C5 15.7302 7.91769 18.7789 11.5954 18.9885L12.3966 20.9914C12.2651 20.9971 12.1329 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 12.1329 20.9971 12.2651 20.9914 12.3966ZM11 11L21 15L19 17L22 20L20 22L17 19L15 21L11 11Z",fill:"currentColor"})})})})},{key:"theme",label:f==="light"?"Dark Theme":"Light Theme",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"m4.408 12.954-2.265-.756a.209.209 0 0 1 0-.396l2.265-.755a.209.209 0 0 1 .276.198v1.51c0 .143-.14.244-.276.198ZM5.959 7.306 4.89 5.17c-.09-.18.1-.37.28-.28l2.136 1.068a.209.209 0 0 1 .054.334L6.293 7.36c-.1.101-.27.074-.334-.054ZM11.802 21.857l-.755-2.265a.209.209 0 0 1 .198-.276h1.51c.143 0 .244.14.198.276l-.755 2.265a.21.21 0 0 1-.396 0ZM11.802 2.143l-.755 2.265a.209.209 0 0 0 .198.276h1.51c.143 0 .244-.14.198-.276l-.755-2.265a.209.209 0 0 0-.396 0ZM18.83 19.11l-2.137-1.068a.209.209 0 0 1-.054-.335l1.068-1.068c.1-.1.27-.073.334.055l1.069 2.136c.09.18-.101.37-.28.28ZM16.693 5.958 18.83 4.89c.18-.09.37.1.28.28l-1.068 2.136a.209.209 0 0 1-.334.054l-1.068-1.068a.209.209 0 0 1 .054-.334ZM4.89 18.83l1.069-2.136a.209.209 0 0 1 .334-.055l1.068 1.068c.101.101.074.271-.054.335L5.171 19.11c-.18.09-.37-.1-.28-.28ZM21.857 12.198l-2.265.755a.209.209 0 0 1-.276-.198v-1.51c0-.143.14-.244.276-.198l2.265.755a.21.21 0 0 1 0 .396Z",fill:"#FEBC5A"}),h.jsx("circle",{cx:"12",cy:"12",r:"5",fill:"#FED05A"})]})})})},{key:"colors",label:"Color Templates",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{fillRule:"evenodd",d:"M20.775 8.992C20.922 9.638 21 10.31 21 11a8.354 8.354 0 0 0-.787 0c-1.467.072-2.422.564-3.082 1.283l-1.18-1.65c.761-.718 1.697-1.205 2.81-1.452A7 7 0 1 0 12 18c.396-.001.565-.082.63-.12.07-.042.17-.124.295-.34.218-.375.36-.835.534-1.49l1.518 1.822C14.485 19.102 13.705 20 12 20a9 9 0 1 1 8.775-11.008Z","clip-rule":"evenodd",fill:"currentColor"}),h.jsx("circle",{cx:"8.5",cy:"12.5",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"9.5",cy:"8.5",r:"1.5",fill:"currentColor"}),h.jsx("circle",{cx:"13.5",cy:"7.5",r:"1.5",fill:"currentColor"}),h.jsx("path",{d:"M13.892 14.693c-2.034.46-2.59-1.07-2.892-4.693 3.85.352 5.232 1.05 4.697 3.012L20 17.192s.038 1.023-.361 1.447c-.463.49-1.687.361-1.687.361l-4.06-4.307Z",fill:"currentColor"})]})})}),submenu:[{label:"Green & Red",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M17.0579 5.11914V7.08486H19.0236V17.8963H17.0579V20.8449H15.0922V17.8963H13.1265V7.08486H15.0922V5.11914H17.0579Z",fill:"#ef5350"}),h.jsx("path",{d:"M9.19522 7.08376V3.15234H7.22951V7.08376H5.26379V15.9295H7.22951V20.8438H9.19522V15.9295H11.1609V7.08376H9.19522Z",fill:"#26a69a"})]})})})},{label:"Blue & Red",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M17.0579 5.11914V7.08486H19.0236V17.8963H17.0579V20.8449H15.0922V17.8963H13.1265V7.08486H15.0922V5.11914H17.0579Z",fill:"#ff574d"}),h.jsx("path",{d:"M9.19522 7.08376V3.15234H7.22951V7.08376H5.26379V15.9295H7.22951V20.8438H9.19522V15.9295H11.1609V7.08376H9.19522Z",fill:"#578cf2"})]})})})},{label:"Black & White",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M17.0579 5.11914V7.08486H19.0236V17.8963H17.0579V20.8449H15.0922V17.8963H13.1265V7.08486H15.0922V5.11914H17.0579Z",fill:"#7a7a7a"}),h.jsx("path",{d:"M9.19522 7.08376V3.15234H7.22951V7.08376H5.26379V15.9295H7.22951V20.8438H9.19522V15.9295H11.1609V7.08376H9.19522Z",fill:"#ffffff"})]})})})},{label:"Neutral",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M17.0579 5.11914V7.08486H19.0236V17.8963H17.0579V20.8449H15.0922V17.8963H13.1265V7.08486H15.0922V5.11914H17.0579Z",fill:"#c86a6a"}),h.jsx("path",{d:"M9.19522 7.08376V3.15234H7.22951V7.08376H5.26379V15.9295H7.22951V20.8438H9.19522V15.9295H11.1609V7.08376H9.19522Z",fill:"#76ac85"})]})})})}]},{key:"lang",label:"Language",rightText:"EN",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M17.9 17.39C17.64 16.59 16.89 16 16 16H15V13C15 12.4477 14.5523 12 14 12H8V10H10C10.5523 10 11 9.55228 11 9V7H13C14.1046 7 15 6.10457 15 5V4.59C17.93 5.77 20 8.64 20 12C20 14.08 19.2 15.97 17.9 17.39ZM11 19.93C7.05 19.44 4 16.08 4 12C4 11.38 4.08 10.78 4.21 10.21L9 15V16C9 17.1046 9.89543 18 11 18V19.93ZM12 2C6.47715 2 2 6.47715 2 12C2 14.6522 3.05357 17.1957 4.92893 19.0711C6.8043 20.9464 9.34784 22 12 22C14.6522 22 17.1957 20.9464 19.0711 19.0711C20.9464 17.1957 22 14.6522 22 12C22 9.34784 20.9464 6.8043 19.0711 4.92893C17.1957 3.05357 14.6522 2 12 2Z",fill:"currentColor"})})})}),submenu:[{label:"English",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),h.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Arabic",icon:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"}),h.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},{label:"Bulgarian",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Chinese Simplified",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Chinese Traditional",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Czech",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Dutch",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})},{label:"Urdu",icon:h.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2"})})}]},{key:"shortcuts",label:"Shortcuts",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM11 18H13V16H11V18ZM12 6C9.79 6 8 7.79 8 10H10C10 8.9 10.9 8 12 8C13.1 8 14 8.9 14 10C14 12 11 11.75 11 15H13C13 12.75 16 12.5 16 10C16 7.79 14.21 6 12 6Z",fill:"currentColor"})})})})},{key:"contact",label:"Contact us",icon:h.jsx(h.Fragment,{children:h.jsx("div",{className:"icon svelte-1qoe9jm",style:{width:"calc(var(--indent-half) * 6)",height:"calc(var(--indent-half) * 6)"},children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M5 4C3.89543 4 3 4.89543 3 6V15C3 16.1046 3.89543 17 5 17H5.98719L6 21L13 17H19C20.1046 17 21 16.1046 21 15V6C21 4.89543 20.1046 4 19 4H5ZM6 6H18C18.5128 6 18.9355 6.38604 18.9933 6.88338L19 7V14C19 14.5128 18.614 14.9355 18.1166 14.9933L18 15H12.5339C12.4234 15 12.314 15.0183 12.21 15.0539L12.108 15.0952L8 17.0289V16C8 15.4872 7.61396 15.0645 7.11662 15.0067L7 15H6C5.48716 15 5.06449 14.614 5.00673 14.1166L5 14V7C5 6.48716 5.38604 6.06449 5.88338 6.00673L6 6Z",fillRule:"evenodd","clip-rule":"evenodd",fill:"currentColor"})})})})},{key:"about",label:"About program",icon:h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("path",{d:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Z",stroke:"currentColor",strokeWidth:"2"}),h.jsx("path",{d:"M12 10v7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),h.jsx("path",{d:"M12 7h.01",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}],vA=({item:j})=>{const eA=!!j.submenu?.length;return h.jsxs("div",{className:"relative",onMouseEnter:()=>{SA.current&&(clearTimeout(SA.current),SA.current=null),eA&&U(j.key)},onMouseLeave:()=>{eA&&(SA.current=setTimeout(()=>U(null),120))},children:[h.jsxs("button",{type:"button",onClick:()=>{eA?U(QA=>QA===j.key?null:j.key):(j.key==="theme"&&w(QA=>QA==="light"?"dark":"light"),C(!1),U(null))},className:`w-full flex items-center gap-3 px-4 py-2.5 text-left text-[13px] ${hA?"text-slate-700 hover:bg-slate-100":"text-slate-200 hover:bg-[#202933]"}`,children:[h.jsx("span",{className:`w-5 h-5 flex shrink-0 items-center justify-center ${hA?"text-slate-500":"text-slate-400"}`,children:j.icon}),h.jsx("span",{className:"flex-1 text-[15px]",children:j.label}),j.rightText&&h.jsx("span",{className:`text-xs ${hA?"text-slate-500":"text-slate-400"}`,children:j.rightText}),eA&&h.jsx("svg",{className:`w-4 h-4 ${hA?"text-slate-500":"text-slate-400"}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M9 6l6 6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),eA&&E===j.key&&h.jsx("div",{className:`absolute top-0 left-full ml-0 w-52 min-w-44 rounded-md shadow-2xl overflow-hidden z-100 border ${hA?"bg-white border-slate-200":"bg-[#262F3F] border-white/10"}`,children:h.jsx("div",{className:"py-1",children:j.submenu.map((QA,gA)=>{const EA=W[j.key]===QA.label||QA.selected&&W[j.key]==null;return h.jsxs("button",{type:"button",onClick:()=>{aA(XA=>({...XA,[j.key]:QA.label})),console.log("Sub selected:",j.key,QA.label)},className:`w-full flex items-center gap-3 pl-3 pr-3 py-2 text-[13px] text-left ${hA?"text-slate-700 hover:bg-slate-100":"text-slate-200 hover:bg-[#202933]"}`,children:[h.jsx("span",{className:`w-5 h-5 flex shrink-0 items-center justify-center ${hA?"text-slate-500":"text-slate-400"}`,children:QA.icon||null}),h.jsx("span",{className:"flex-1 min-w-0",children:QA.label}),EA&&h.jsx("span",{className:"w-5 h-5 flex shrink-0 items-center justify-center text-emerald-400",children:h.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},gA)})})})]})},hA=f==="light";return h.jsxs("div",{className:"relative h-full",children:[h.jsxs("div",{className:`w-12 flex flex-col items-center py-3 h-full border-r ${hA?"bg-white border-slate-200":"bg-[#12161d] border-slate-700"}`,children:[h.jsx("div",{className:"flex flex-col items-center gap-2",children:HA.map((j,eA)=>h.jsxs(K.Fragment,{children:[eA===2?h.jsxs("div",{className:"relative",children:[h.jsx("button",{onClick:()=>{const QA=ti[z].toolId;i(t===QA?null:QA)},className:`relative w-10 h-10 flex items-center justify-center transition-colors duration-150
15
+ ${t===ti[z].toolId?hA?"text-sky-600 hover:bg-sky-100":"text-sky-300 hover:bg-slate-700":hA?"text-slate-600 hover:bg-sky-100":"text-slate-400 hover:bg-slate-700"}`,title:ti[z].label,children:ti[z].icon}),h.jsx("span",{onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1),onMouseDown:QA=>{QA.stopPropagation(),P(gA=>!gA)},style:{position:"absolute",bottom:1,right:1,width:N?10:7,height:N?10:7,cursor:"pointer",transition:"width 0.12s, height 0.12s",display:"flex",alignItems:"center",justifyContent:"center"},title:"More line tools",children:h.jsx("svg",{viewBox:"0 0 10 10",width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("polygon",{points:"10,10 0,10 10,0",fill:hA?"#64748b":"#94a3b8"})})})]}):h.jsx("button",{onClick:()=>MA(eA),className:`w-10 h-10 flex items-center justify-center transition-colors duration-150
16
+ ${j.label==="Grid"&&s||j.label==="Eye"&&!u||j.label==="Lock"&&B||t===eA?hA?"text-sky-600 hover:bg-sky-100":"text-sky-300 hover:bg-slate-700":hA?"text-slate-600 hover:bg-sky-100":"text-slate-400 hover:bg-slate-700"}`,title:`${j.label}: ${j.description}`,children:j.icon}),j.label==="Text"&&h.jsx("div",{className:`w-8 border-t my-1 ${hA?"border-slate-200":"border-slate-700"}`})]},j.label))}),h.jsx("div",{className:"flex-1"}),h.jsx("div",{className:"flex flex-col items-center gap-2 pb-1",children:UA.map((j,eA)=>{const QA=12+eA;return h.jsx("button",{onClick:()=>MA(QA),className:`w-10 h-10 flex items-center justify-center transition-colors duration-150
17
+ ${j.label==="Grid"&&s||j.label==="Eye"&&!u||j.label==="Lock"&&B||t===QA?hA?"text-sky-600 hover:bg-sky-100":"text-sky-300 hover:bg-slate-700":hA?"text-slate-600 hover:bg-sky-100":"text-slate-400 hover:bg-slate-700"}`,title:`${j.label}: ${j.description}`,children:j.icon},j.label)})})]}),S&&h.jsx(db,{top:84,panelRef:cA,isLight:hA,children:ti.map((j,eA)=>{const QA=z===eA;return h.jsxs("button",{type:"button",onMouseDown:gA=>{gA.stopPropagation(),J(eA),i(j.toolId),P(!1)},className:`w-full flex items-center gap-3 px-4 py-2.5 text-[13px] text-left ${hA?"text-slate-700 hover:bg-slate-100":"text-slate-200 hover:bg-[#202933]"}`,children:[h.jsx("span",{className:`w-5 h-5 flex shrink-0 items-center justify-center ${hA?"text-slate-500":"text-slate-400"}`,children:j.icon}),h.jsx("span",{className:"flex-1",children:j.label}),QA&&h.jsx("span",{className:"w-4 h-4 flex shrink-0 items-center justify-center text-emerald-400",children:h.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},j.toolId)})}),F&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[999] bg-black/20",onClick:()=>{C(!1),U(null)},"aria-hidden":"true"}),h.jsxs("div",{ref:nA,className:`absolute left-12 top-2 z-[999] w-68 border shadow-2xl overflow-visible ${hA?"bg-white border-slate-200":"bg-[#262F3F] border-white/10"}`,children:[h.jsxs("div",{className:`relative px-4 py-3 border-b overflow-hidden ${hA?"bg-white border-slate-200":"border-white/10 bg-[#262F3F]"}`,children:[h.jsx("div",{className:`z-[999]text-[16px] font-medium pr-12 ${hA?"text-slate-800":"text-slate-100"}`,children:A||"MT5 Account"}),h.jsx("div",{className:`text-[12px] mt-0.5 ${hA?"text-slate-500":"text-slate-400"}`,children:r})]}),h.jsx("div",{className:"py-2",children:yA.map(j=>h.jsx(vA,{item:j},j.key))})]})]})]})};function pb(r){return Ir({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M337.509 305.372h-17.501l-6.571-5.486c20.791-25.232 33.922-57.054 33.922-93.257C347.358 127.632 283.896 64 205.135 64 127.452 64 64 127.632 64 206.629s63.452 142.628 142.225 142.628c35.011 0 67.831-13.167 92.991-34.008l6.561 5.487v17.551L415.18 448 448 415.086 337.509 305.372zm-131.284 0c-54.702 0-98.463-43.887-98.463-98.743 0-54.858 43.761-98.742 98.463-98.742 54.7 0 98.462 43.884 98.462 98.742 0 54.856-43.762 98.743-98.462 98.743z"},child:[]}]})(r)}const gb=({width:r=256,symbols:A=[],selectedSymbol:e,onSymbolSelect:t,symbolsLoading:i=!1,isOpen:s})=>{const{theme:n}=ge(),o=n==="light",[a,l]=K.useState(""),c=A.filter(B=>B.symbol.toLowerCase().includes(a.toLowerCase())),u=c.filter(B=>!B.symbol.toUpperCase().endsWith("USDT")),d=c.filter(B=>B.symbol.toUpperCase().endsWith("USDT"));return h.jsxs(h.Fragment,{children:[h.jsx("style",{children:`
18
18
  .scrollbar-dark::-webkit-scrollbar {
19
19
  width: 8px;
20
20
  }
@@ -41,4 +41,4 @@
41
41
  .scrollbar-light::-webkit-scrollbar-thumb:hover {
42
42
  background: #94a3b8;
43
43
  }
44
- `}),h.jsxs("div",{style:{width:`${r}px`,minWidth:"550px",maxWidth:"1900px"},className:`border-l flex flex-col h-full shrink-0 ${o?"bg-white border-slate-200":"bg-[#12161d] border-slate-700"}`,children:[h.jsxs("div",{className:`p-3 border-b flex justify-center items-center gap-2 ${o?"border-slate-200":"border-slate-700"}`,children:[h.jsx(fb,{className:o?"text-2xl text-slate-500":"text-2xl text-slate-400"}),h.jsx("input",{type:"text",placeholder:"Search symbol",value:a,onChange:B=>l(B.target.value),className:`w-full px-3 py-1.5 rounded text-md focus:outline-none focus:border-sky-500 ${o?"bg-white border border-slate-200 text-slate-800 placeholder:text-slate-400":"bg-slate-800 border border-slate-600 text-slate-100 placeholder:text-slate-400"}`})]}),h.jsx("div",{className:`flex-1 overflow-y-auto ${o?"scrollbar-light":"scrollbar-dark"}`,style:{scrollbarWidth:"thin",scrollbarColor:o?"#cbd5e1 #ffffff":"#1e293b #12161d"},children:i?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:`text-sm ${o?"text-slate-700":"text-slate-200"}`,children:"Loading symbols..."})}):c.length===0?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:`text-sm text-center px-4 ${o?"text-slate-700":"text-slate-200"}`,children:A.length===0?"No symbols found. Please check server connection.":"No symbols match your search."})}):h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{className:`sticky top-0 z-10 ${o?"bg-white border-b border-slate-200":"bg-[#12161d] border-b border-slate-700"}`,children:h.jsxs("tr",{children:[h.jsx("th",{className:`px-3 py-2 text-left text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Symbol"}),h.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Bid"}),h.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Ask"}),h.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Change"})]})}),h.jsxs("tbody",{children:[u.length>0&&h.jsx("tr",{className:o?"bg-slate-50":"bg-slate-900",children:h.jsx("td",{colSpan:4,className:`px-3 py-2 text-xs font-semibold ${o?"text-sky-600":"text-sky-400"}`,children:"FOREX"})}),u.map(B=>h.jsxs("tr",{onClick:()=>t(B.symbol),className:`cursor-pointer transition-colors ${e===B.symbol?o?"bg-sky-50 border-l-2 border-sky-500":"bg-slate-800 border-l-2 border-sky-500":o?"hover:bg-slate-50":"hover:bg-slate-800"}`,children:[h.jsx("td",{className:`px-3 py-2 text-md font-medium ${o?"text-slate-800":"text-slate-100"}`,children:B.symbol}),h.jsx("td",{className:`px-3 py-2 text-right text-md ${B.change>=0?o?"text-blue-600":"text-sky-400":o?"text-rose-600":"text-rose-400"}`,children:B.bid}),h.jsx("td",{className:`px-3 py-2 text-right text-md ${B.change>=0?o?"text-blue-600":"text-sky-400":o?"text-rose-600":"text-rose-400"}`,children:B.ask}),h.jsxs("td",{className:`px-3 py-2 text-right font-medium ${B.change>=0?o?"text-emerald-600":"text-emerald-400":o?"text-rose-600":"text-rose-400"}`,children:[B.change>=0?"+":"",B.change,"%"]})]},B.symbol)),d.length>0&&h.jsx("tr",{className:o?"bg-slate-50":"bg-slate-900",children:h.jsx("td",{colSpan:4,className:`px-3 py-2 text-xs font-semibold ${o?"text-emerald-600":"text-emerald-400"}`,children:"CRYPTO"})}),d.map(B=>h.jsxs("tr",{onClick:()=>t(B.symbol),className:`cursor-pointer transition-colors ${e===B.symbol?o?"bg-sky-50 border-l-2 border-sky-500":"bg-slate-800 border-l-2 border-sky-500":o?"hover:bg-slate-50":"hover:bg-slate-800"}`,children:[h.jsx("td",{className:`px-3 py-2 text-md font-medium ${o?"text-slate-800":"text-slate-100"}`,children:B.symbol}),h.jsx("td",{className:`px-3 py-2 text-right text-md ${B.change>=0?o?"text-blue-600":"text-sky-400":o?"text-rose-600":"text-rose-400"}`,children:B.bid}),h.jsx("td",{className:`px-3 py-2 text-right text-md ${B.change>=0?o?"text-blue-600":"text-sky-400":o?"text-rose-600":"text-rose-400"}`,children:B.ask}),h.jsxs("td",{className:`px-3 py-2 text-right font-medium ${B.change>=0?o?"text-emerald-600":"text-emerald-400":o?"text-rose-600":"text-rose-400"}`,children:[B.change>=0?"+":"",B.change,"%"]})]},B.symbol))]})]})})]})]})},Bb=({accountSummary:r,orders:A,height:e})=>{const{accountSummary:t,orders:i,theme:s}=Be(),n=r||t,o=A||i,a=s==="light",l=o?.filter(c=>c.status==="OPEN"||!c.closeAt)||[];return h.jsxs("div",{style:{height:e?`${e}px`:"auto"},className:`flex flex-col overflow-hidden ${a?"bg-white border-t border-slate-200":"bg-[#12161d] border-t border-slate-700"}`,children:[h.jsxs("div",{className:`px-4 py-2 border-b flex items-center justify-between ${a?"border-slate-200":"border-slate-700"}`,children:[h.jsx("h3",{className:`text-sm font-semibold ${a?"text-slate-800":"text-slate-200"}`,children:"Account Summary"}),h.jsxs("div",{className:`text-xs ${a?"text-slate-500":"text-slate-400"}`,children:[l.length," Position",l.length!==1?"s":""]})]}),h.jsxs("div",{className:`px-4 py-3 border-b grid grid-cols-3 gap-4 ${a?"border-slate-200":"border-slate-700"}`,children:[h.jsxs("div",{children:[h.jsx("div",{className:`text-xs ${a?"text-slate-500":"text-slate-400"}`,children:"Balance"}),h.jsxs("div",{className:`text-sm font-semibold ${a?"text-slate-800":"text-slate-200"}`,children:["$",n?.balance?.toFixed(2)||"0.00"]})]}),h.jsxs("div",{children:[h.jsx("div",{className:`text-xs ${a?"text-slate-500":"text-slate-400"}`,children:"Equity"}),h.jsxs("div",{className:`text-sm font-semibold ${(n?.equity||0)>=(n?.balance||0)?"text-emerald-500":"text-rose-500"}`,children:["$",n?.equity?.toFixed(2)||"0.00"]})]}),h.jsxs("div",{children:[h.jsx("div",{className:`text-xs ${a?"text-slate-500":"text-slate-400"}`,children:"Free Margin"}),h.jsxs("div",{className:`text-sm font-semibold ${a?"text-slate-800":"text-slate-200"}`,children:["$",n?.freeMargin?.toFixed(2)||"0.00"]})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:l.length===0?h.jsx("div",{className:`flex items-center justify-center h-full ${a?"text-slate-500":"text-slate-400"}`,children:h.jsx("div",{className:"text-sm",children:"No open positions"})}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{className:`sticky top-0 ${a?"bg-white border-b border-slate-200":"bg-slate-800 border-b border-slate-700"}`,children:h.jsxs("tr",{children:[h.jsx("th",{className:`px-3 py-2 text-left ${a?"text-slate-700":"text-slate-300"}`,children:"Symbol"}),h.jsx("th",{className:`px-3 py-2 text-left ${a?"text-slate-700":"text-slate-300"}`,children:"Type"}),h.jsx("th",{className:`px-3 py-2 text-right ${a?"text-slate-700":"text-slate-300"}`,children:"Volume"}),h.jsx("th",{className:`px-3 py-2 text-right ${a?"text-slate-700":"text-slate-300"}`,children:"Open Price"}),h.jsx("th",{className:`px-3 py-2 text-right ${a?"text-slate-700":"text-slate-300"}`,children:"Profit"})]})}),h.jsx("tbody",{children:l.map(c=>h.jsxs("tr",{className:`${a?"hover:bg-slate-50":"hover:bg-slate-800"}`,children:[h.jsx("td",{className:`px-3 py-2 ${a?"text-slate-800":"text-slate-200"}`,children:c.symbol}),h.jsx("td",{className:`px-3 py-2 ${c.type==="BUY"?"text-emerald-500":"text-rose-500"}`,children:c.type}),h.jsx("td",{className:`px-3 py-2 text-right ${a?"text-slate-800":"text-slate-200"}`,children:c.volume}),h.jsx("td",{className:`px-3 py-2 text-right ${a?"text-slate-800":"text-slate-200"}`,children:c.price?.toFixed(4)||"-"}),h.jsxs("td",{className:`px-3 py-2 text-right font-semibold ${(c.profit||0)>=0?"text-emerald-500":"text-rose-500"}`,children:[(c.profit||0)>=0?"+":"",(c.profit||0).toFixed(2)]})]},c.id))})]})})})]})},gb="1.2.1";DA.AccountPanel=Bb,DA.BuySellPanel=Ec,DA.Chart=jv,DA.ChartTypeSelector=nb,DA.CoinSelector=Gu,DA.DrawingTools=Xu,DA.LeftSidebar=db,DA.MarketExecutionModal=xc,DA.MarketWatch=pb,DA.PositionsPanel=ab,DA.SYMBOL_CONFIG=Sc,DA.StopLoss=Wu,DA.TakeProfit=$u,DA.TimeframeSelector=ib,DA.TopBar=hb,DA.TradePanel=ob,DA.TradingProvider=YB,DA.TradingToolbar=tb,DA.VolumeControl=Ru,DA.alignToTimeframe=Ar,DA.detectGaps=ag,DA.getSymbolConfig=Mr,DA.is24x7Symbol=dg,DA.isCryptoSymbol=ug,DA.isForexSymbol=hg,DA.isWithinTradingSession=lg,DA.normalizeCandleTimes=Tc,DA.normalizeTime=sA,DA.processCandles=Dc,DA.processSingleCandle=_c,DA.setSocketBaseUrl=vc,DA.timeframeToSeconds=Ot,DA.useTrading=Be,DA.validateTimeOrdering=cg,DA.version=gb,Object.defineProperty(DA,Symbol.toStringTag,{value:"Module"})}));
44
+ `}),h.jsxs("div",{style:{width:`${r}px`,minWidth:"550px",maxWidth:"1900px"},className:`border-l flex flex-col h-full shrink-0 ${o?"bg-white border-slate-200":"bg-[#12161d] border-slate-700"}`,children:[h.jsxs("div",{className:`p-3 border-b flex justify-center items-center gap-2 ${o?"border-slate-200":"border-slate-700"}`,children:[h.jsx(pb,{className:o?"text-2xl text-slate-500":"text-2xl text-slate-400"}),h.jsx("input",{type:"text",placeholder:"Search symbol",value:a,onChange:B=>l(B.target.value),className:`w-full px-3 py-1.5 rounded text-md focus:outline-none focus:border-sky-500 ${o?"bg-white border border-slate-200 text-slate-800 placeholder:text-slate-400":"bg-slate-800 border border-slate-600 text-slate-100 placeholder:text-slate-400"}`})]}),h.jsx("div",{className:`flex-1 overflow-y-auto ${o?"scrollbar-light":"scrollbar-dark"}`,style:{scrollbarWidth:"thin",scrollbarColor:o?"#cbd5e1 #ffffff":"#1e293b #12161d"},children:i?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:`text-sm ${o?"text-slate-700":"text-slate-200"}`,children:"Loading symbols..."})}):c.length===0?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:`text-sm text-center px-4 ${o?"text-slate-700":"text-slate-200"}`,children:A.length===0?"No symbols found. Please check server connection.":"No symbols match your search."})}):h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{className:`sticky top-0 z-10 ${o?"bg-white border-b border-slate-200":"bg-[#12161d] border-b border-slate-700"}`,children:h.jsxs("tr",{children:[h.jsx("th",{className:`px-3 py-2 text-left text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Symbol"}),h.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Bid"}),h.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Ask"}),h.jsx("th",{className:`px-3 py-2 text-right text-md ${o?"text-slate-700":"text-slate-300"}`,children:"Change"})]})}),h.jsxs("tbody",{children:[u.length>0&&h.jsx("tr",{className:o?"bg-slate-50":"bg-slate-900",children:h.jsx("td",{colSpan:4,className:`px-3 py-2 text-xs font-semibold ${o?"text-sky-600":"text-sky-400"}`,children:"FOREX"})}),u.map(B=>h.jsxs("tr",{onClick:()=>t(B.symbol),className:`cursor-pointer transition-colors ${e===B.symbol?o?"bg-sky-50 border-l-2 border-sky-500":"bg-slate-800 border-l-2 border-sky-500":o?"hover:bg-slate-50":"hover:bg-slate-800"}`,children:[h.jsx("td",{className:`px-3 py-2 text-md font-medium ${o?"text-slate-800":"text-slate-100"}`,children:B.symbol}),h.jsx("td",{className:`px-3 py-2 text-right text-md ${B.change>=0?o?"text-blue-600":"text-sky-400":o?"text-rose-600":"text-rose-400"}`,children:B.bid}),h.jsx("td",{className:`px-3 py-2 text-right text-md ${B.change>=0?o?"text-blue-600":"text-sky-400":o?"text-rose-600":"text-rose-400"}`,children:B.ask}),h.jsxs("td",{className:`px-3 py-2 text-right font-medium ${B.change>=0?o?"text-emerald-600":"text-emerald-400":o?"text-rose-600":"text-rose-400"}`,children:[B.change>=0?"+":"",B.change,"%"]})]},B.symbol)),d.length>0&&h.jsx("tr",{className:o?"bg-slate-50":"bg-slate-900",children:h.jsx("td",{colSpan:4,className:`px-3 py-2 text-xs font-semibold ${o?"text-emerald-600":"text-emerald-400"}`,children:"CRYPTO"})}),d.map(B=>h.jsxs("tr",{onClick:()=>t(B.symbol),className:`cursor-pointer transition-colors ${e===B.symbol?o?"bg-sky-50 border-l-2 border-sky-500":"bg-slate-800 border-l-2 border-sky-500":o?"hover:bg-slate-50":"hover:bg-slate-800"}`,children:[h.jsx("td",{className:`px-3 py-2 text-md font-medium ${o?"text-slate-800":"text-slate-100"}`,children:B.symbol}),h.jsx("td",{className:`px-3 py-2 text-right text-md ${B.change>=0?o?"text-blue-600":"text-sky-400":o?"text-rose-600":"text-rose-400"}`,children:B.bid}),h.jsx("td",{className:`px-3 py-2 text-right text-md ${B.change>=0?o?"text-blue-600":"text-sky-400":o?"text-rose-600":"text-rose-400"}`,children:B.ask}),h.jsxs("td",{className:`px-3 py-2 text-right font-medium ${B.change>=0?o?"text-emerald-600":"text-emerald-400":o?"text-rose-600":"text-rose-400"}`,children:[B.change>=0?"+":"",B.change,"%"]})]},B.symbol))]})]})})]})]})},Bb=({accountSummary:r,orders:A,height:e})=>{const{accountSummary:t,orders:i,theme:s}=ge(),n=r||t,o=A||i,a=s==="light",l=o?.filter(c=>c.status==="OPEN"||!c.closeAt)||[];return h.jsxs("div",{style:{height:e?`${e}px`:"auto"},className:`flex flex-col overflow-hidden ${a?"bg-white border-t border-slate-200":"bg-[#12161d] border-t border-slate-700"}`,children:[h.jsxs("div",{className:`px-4 py-2 border-b flex items-center justify-between ${a?"border-slate-200":"border-slate-700"}`,children:[h.jsx("h3",{className:`text-sm font-semibold ${a?"text-slate-800":"text-slate-200"}`,children:"Account Summary"}),h.jsxs("div",{className:`text-xs ${a?"text-slate-500":"text-slate-400"}`,children:[l.length," Position",l.length!==1?"s":""]})]}),h.jsxs("div",{className:`px-4 py-3 border-b grid grid-cols-3 gap-4 ${a?"border-slate-200":"border-slate-700"}`,children:[h.jsxs("div",{children:[h.jsx("div",{className:`text-xs ${a?"text-slate-500":"text-slate-400"}`,children:"Balance"}),h.jsxs("div",{className:`text-sm font-semibold ${a?"text-slate-800":"text-slate-200"}`,children:["$",n?.balance?.toFixed(2)||"0.00"]})]}),h.jsxs("div",{children:[h.jsx("div",{className:`text-xs ${a?"text-slate-500":"text-slate-400"}`,children:"Equity"}),h.jsxs("div",{className:`text-sm font-semibold ${(n?.equity||0)>=(n?.balance||0)?"text-emerald-500":"text-rose-500"}`,children:["$",n?.equity?.toFixed(2)||"0.00"]})]}),h.jsxs("div",{children:[h.jsx("div",{className:`text-xs ${a?"text-slate-500":"text-slate-400"}`,children:"Free Margin"}),h.jsxs("div",{className:`text-sm font-semibold ${a?"text-slate-800":"text-slate-200"}`,children:["$",n?.freeMargin?.toFixed(2)||"0.00"]})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:l.length===0?h.jsx("div",{className:`flex items-center justify-center h-full ${a?"text-slate-500":"text-slate-400"}`,children:h.jsx("div",{className:"text-sm",children:"No open positions"})}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{className:`sticky top-0 ${a?"bg-white border-b border-slate-200":"bg-slate-800 border-b border-slate-700"}`,children:h.jsxs("tr",{children:[h.jsx("th",{className:`px-3 py-2 text-left ${a?"text-slate-700":"text-slate-300"}`,children:"Symbol"}),h.jsx("th",{className:`px-3 py-2 text-left ${a?"text-slate-700":"text-slate-300"}`,children:"Type"}),h.jsx("th",{className:`px-3 py-2 text-right ${a?"text-slate-700":"text-slate-300"}`,children:"Volume"}),h.jsx("th",{className:`px-3 py-2 text-right ${a?"text-slate-700":"text-slate-300"}`,children:"Open Price"}),h.jsx("th",{className:`px-3 py-2 text-right ${a?"text-slate-700":"text-slate-300"}`,children:"Profit"})]})}),h.jsx("tbody",{children:l.map(c=>h.jsxs("tr",{className:`${a?"hover:bg-slate-50":"hover:bg-slate-800"}`,children:[h.jsx("td",{className:`px-3 py-2 ${a?"text-slate-800":"text-slate-200"}`,children:c.symbol}),h.jsx("td",{className:`px-3 py-2 ${c.type==="BUY"?"text-emerald-500":"text-rose-500"}`,children:c.type}),h.jsx("td",{className:`px-3 py-2 text-right ${a?"text-slate-800":"text-slate-200"}`,children:c.volume}),h.jsx("td",{className:`px-3 py-2 text-right ${a?"text-slate-800":"text-slate-200"}`,children:c.price?.toFixed(4)||"-"}),h.jsxs("td",{className:`px-3 py-2 text-right font-semibold ${(c.profit||0)>=0?"text-emerald-500":"text-rose-500"}`,children:[(c.profit||0)>=0?"+":"",(c.profit||0).toFixed(2)]})]},c.id))})]})})})]})},wb="1.2.1";DA.AccountPanel=Bb,DA.BuySellPanel=Ec,DA.Chart=Ab,DA.ChartTypeSelector=ob,DA.CoinSelector=Ru,DA.DrawingTools=Ju,DA.LeftSidebar=fb,DA.MarketExecutionModal=xc,DA.MarketWatch=gb,DA.PositionsPanel=lb,DA.SYMBOL_CONFIG=Sc,DA.StopLoss=$u,DA.TakeProfit=Xu,DA.TimeframeSelector=sb,DA.TopBar=ub,DA.TradePanel=ab,DA.TradingProvider=jg,DA.TradingToolbar=rb,DA.VolumeControl=Wu,DA.alignToTimeframe=Ar,DA.detectGaps=lB,DA.getSymbolConfig=Mr,DA.is24x7Symbol=fB,DA.isCryptoSymbol=dB,DA.isForexSymbol=uB,DA.isWithinTradingSession=cB,DA.normalizeCandleTimes=Tc,DA.normalizeTime=iA,DA.processCandles=Dc,DA.processSingleCandle=_c,DA.setSocketBaseUrl=vc,DA.timeframeToSeconds=Ot,DA.useTrading=ge,DA.validateTimeOrdering=hB,DA.version=wb,Object.defineProperty(DA,Symbol.toStringTag,{value:"Module"})}));