scope360-core 0.0.508 → 0.0.509

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.
@@ -40,7 +40,7 @@
40
40
  `):t}function Y$(t,e){const{element:n,datasetIndex:o,index:a}=e,i=t.getDatasetMeta(o).controller,{label:s,value:l}=i.getLabelAndValue(a);return{chart:t,label:s,parsed:i.getParsed(a),raw:t.data.datasets[o].data[a],formattedValue:l,dataset:i.getDataset(),dataIndex:a,datasetIndex:o,element:n}}function c6(t,e){const n=t.chart.ctx,{body:o,footer:a,title:i}=t,{boxWidth:s,boxHeight:l}=e,d=Dt(e.bodyFont),c=Dt(e.titleFont),u=Dt(e.footerFont),h=i.length,p=a.length,f=o.length,_=It(e.padding);let m=_.height,g=0,b=o.reduce((x,v)=>x+v.before.length+v.lines.length+v.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,h&&(m+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),b){const x=e.displayColors?Math.max(l,d.lineHeight):d.lineHeight;m+=f*x+(b-f)*d.lineHeight+(b-1)*e.bodySpacing}p&&(m+=e.footerMarginTop+p*u.lineHeight+(p-1)*e.footerSpacing);let w=0;const y=function(x){g=Math.max(g,n.measureText(x).width+w)};return n.save(),n.font=c.string,He(t.title,y),n.font=d.string,He(t.beforeBody.concat(t.afterBody),y),w=e.displayColors?s+2+e.boxPadding:0,He(o,x=>{He(x.before,y),He(x.lines,y),He(x.after,y)}),w=0,n.font=u.string,He(t.footer,y),n.restore(),g+=_.width,{width:g,height:m}}function W$(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function U$(t,e,n,o){const{x:a,width:i}=o,s=n.caretSize+n.caretPadding;if(t==="left"&&a+i+s>e.width||t==="right"&&a-i-s<0)return!0}function q$(t,e,n,o){const{x:a,width:i}=n,{width:s,chartArea:{left:l,right:d}}=t;let c="center";return o==="center"?c=a<=(l+d)/2?"left":"right":a<=i/2?c="left":a>=s-i/2&&(c="right"),U$(c,t,e,n)&&(c="center"),c}function u6(t,e,n){const o=n.yAlign||e.yAlign||W$(t,n);return{xAlign:n.xAlign||e.xAlign||q$(t,e,n,o),yAlign:o}}function G$(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function X$(t,e,n){let{y:o,height:a}=t;return e==="top"?o+=n:e==="bottom"?o-=a+n:o-=a/2,o}function h6(t,e,n,o){const{caretSize:a,caretPadding:i,cornerRadius:s}=t,{xAlign:l,yAlign:d}=n,c=a+i,{topLeft:u,topRight:h,bottomLeft:p,bottomRight:f}=Ka(s);let _=G$(e,l);const m=X$(e,d,c);return d==="center"?l==="left"?_+=c:l==="right"&&(_-=c):l==="left"?_-=Math.max(u,p)+a:l==="right"&&(_+=Math.max(h,f)+a),{x:Rt(_,0,o.width-e.width),y:Rt(m,0,o.height-e.height)}}function Xl(t,e,n){const o=It(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function p6(t){return fo([],Po(t))}function K$(t,e,n){return pa(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function f6(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const m6={beforeTitle:Vo,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,o=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return n[e.dataIndex]}return""},afterTitle:Vo,beforeBody:Vo,beforeLabel:Vo,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Re(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Vo,afterBody:Vo,beforeFooter:Vo,footer:Vo,afterFooter:Vo};function sn(t,e,n,o){const a=t[e].call(n,o);return typeof a>"u"?m6[e].call(n,o):a}class _6 extends Bo{static positioners=ps;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,o=this.options.setContext(this.getContext()),a=o.enabled&&n.options.animation&&o.animations,i=new i3(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=K$(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:o}=n,a=sn(o,"beforeTitle",this,e),i=sn(o,"title",this,e),s=sn(o,"afterTitle",this,e);let l=[];return l=fo(l,Po(a)),l=fo(l,Po(i)),l=fo(l,Po(s)),l}getBeforeBody(e,n){return p6(sn(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,a=[];return He(e,i=>{const s={before:[],lines:[],after:[]},l=f6(o,i);fo(s.before,Po(sn(l,"beforeLabel",this,i))),fo(s.lines,sn(l,"label",this,i)),fo(s.after,Po(sn(l,"afterLabel",this,i))),a.push(s)}),a}getAfterBody(e,n){return p6(sn(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:o}=n,a=sn(o,"beforeFooter",this,e),i=sn(o,"footer",this,e),s=sn(o,"afterFooter",this,e);let l=[];return l=fo(l,Po(a)),l=fo(l,Po(i)),l=fo(l,Po(s)),l}_createItems(e){const n=this._active,o=this.chart.data,a=[],i=[],s=[];let l=[],d,c;for(d=0,c=n.length;d<c;++d)l.push(Y$(this.chart,n[d]));return e.filter&&(l=l.filter((u,h,p)=>e.filter(u,h,p,o))),e.itemSort&&(l=l.sort((u,h)=>e.itemSort(u,h,o))),He(l,u=>{const h=f6(e.callbacks,u);a.push(sn(h,"labelColor",this,u)),i.push(sn(h,"labelPointStyle",this,u)),s.push(sn(h,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=l,l}update(e,n){const o=this.options.setContext(this.getContext()),a=this._active;let i,s=[];if(!a.length)this.opacity!==0&&(i={opacity:0});else{const l=ps[o.position].call(this,a,this._eventPosition);s=this._createItems(o),this.title=this.getTitle(s,o),this.beforeBody=this.getBeforeBody(s,o),this.body=this.getBody(s,o),this.afterBody=this.getAfterBody(s,o),this.footer=this.getFooter(s,o);const d=this._size=c6(this,o),c=Object.assign({},l,d),u=u6(this.chart,o,c),h=h6(o,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:h.x,y:h.y,width:d.width,height:d.height,caretX:l.x,caretY:l.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&o.external&&o.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,o,a){const i=this.getCaretPosition(e,o,a);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,o){const{xAlign:a,yAlign:i}=this,{caretSize:s,cornerRadius:l}=o,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:h}=Ka(l),{x:p,y:f}=e,{width:_,height:m}=n;let g,b,w,y,x,v;return i==="center"?(x=f+m/2,a==="left"?(g=p,b=g-s,y=x+s,v=x-s):(g=p+_,b=g+s,y=x-s,v=x+s),w=g):(a==="left"?b=p+Math.max(d,u)+s:a==="right"?b=p+_-Math.max(c,h)-s:b=this.caretX,i==="top"?(y=f,x=y-s,g=b-s,w=b+s):(y=f+m,x=y+s,g=b+s,w=b-s),v=y),{x1:g,x2:b,x3:w,y1:y,y2:x,y3:v}}drawTitle(e,n,o){const a=this.title,i=a.length;let s,l,d;if(i){const c=Zr(o.rtl,this.x,this.width);for(e.x=Xl(this,o.titleAlign,o),n.textAlign=c.textAlign(o.titleAlign),n.textBaseline="middle",s=Dt(o.titleFont),l=o.titleSpacing,n.fillStyle=o.titleColor,n.font=s.string,d=0;d<i;++d)n.fillText(a[d],c.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+l,d+1===i&&(e.y+=o.titleMarginBottom-l)}}_drawColorBox(e,n,o,a,i){const s=this.labelColors[o],l=this.labelPointStyles[o],{boxHeight:d,boxWidth:c}=i,u=Dt(i.bodyFont),h=Xl(this,"left",i),p=a.x(h),f=d<u.lineHeight?(u.lineHeight-d)/2:0,_=n.y+f;if(i.usePointStyle){const m={radius:Math.min(c,d)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},g=a.leftForLtr(p,c)+c/2,b=_+d/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,nu(e,m,g,b),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,nu(e,m,g,b)}else{e.lineWidth=Ve(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const m=a.leftForLtr(p,c),g=a.leftForLtr(a.xPlus(p,1),c-2),b=Ka(s.borderRadius);Object.values(b).some(w=>w!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,os(e,{x:m,y:_,w:c,h:d,radius:b}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),os(e,{x:g,y:_+1,w:c-2,h:d-2,radius:b}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(m,_,c,d),e.strokeRect(m,_,c,d),e.fillStyle=s.backgroundColor,e.fillRect(g,_+1,c-2,d-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,n,o){const{body:a}=this,{bodySpacing:i,bodyAlign:s,displayColors:l,boxHeight:d,boxWidth:c,boxPadding:u}=o,h=Dt(o.bodyFont);let p=h.lineHeight,f=0;const _=Zr(o.rtl,this.x,this.width),m=function($){n.fillText($,_.x(e.x+f),e.y+p/2),e.y+=p+i},g=_.textAlign(s);let b,w,y,x,v,M,C;for(n.textAlign=s,n.textBaseline="middle",n.font=h.string,e.x=Xl(this,g,o),n.fillStyle=o.bodyColor,He(this.beforeBody,m),f=l&&g!=="right"?s==="center"?c/2+u:c+2+u:0,x=0,M=a.length;x<M;++x){for(b=a[x],w=this.labelTextColors[x],n.fillStyle=w,He(b.before,m),y=b.lines,l&&y.length&&(this._drawColorBox(n,e,x,_,o),p=Math.max(h.lineHeight,d)),v=0,C=y.length;v<C;++v)m(y[v]),p=h.lineHeight;He(b.after,m)}f=0,p=h.lineHeight,He(this.afterBody,m),e.y-=i}drawFooter(e,n,o){const a=this.footer,i=a.length;let s,l;if(i){const d=Zr(o.rtl,this.x,this.width);for(e.x=Xl(this,o.footerAlign,o),e.y+=o.footerMarginTop,n.textAlign=d.textAlign(o.footerAlign),n.textBaseline="middle",s=Dt(o.footerFont),n.fillStyle=o.footerColor,n.font=s.string,l=0;l<i;++l)n.fillText(a[l],d.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+o.footerSpacing}}drawBackground(e,n,o,a){const{xAlign:i,yAlign:s}=this,{x:l,y:d}=e,{width:c,height:u}=o,{topLeft:h,topRight:p,bottomLeft:f,bottomRight:_}=Ka(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(l+h,d),s==="top"&&this.drawCaret(e,n,o,a),n.lineTo(l+c-p,d),n.quadraticCurveTo(l+c,d,l+c,d+p),s==="center"&&i==="right"&&this.drawCaret(e,n,o,a),n.lineTo(l+c,d+u-_),n.quadraticCurveTo(l+c,d+u,l+c-_,d+u),s==="bottom"&&this.drawCaret(e,n,o,a),n.lineTo(l+f,d+u),n.quadraticCurveTo(l,d+u,l,d+u-f),s==="center"&&i==="left"&&this.drawCaret(e,n,o,a),n.lineTo(l,d+h),n.quadraticCurveTo(l,d,l+h,d),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,o=this.$animations,a=o&&o.x,i=o&&o.y;if(a||i){const s=ps[e.position].call(this,this._active,this._eventPosition);if(!s)return;const l=this._size=c6(this,e),d=Object.assign({},s,this._size),c=u6(n,e,d),u=h6(e,d,c,n);(a._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=l.width,this.height=l.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let o=this.opacity;if(!o)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},i={x:this.x,y:this.y};o=Math.abs(o)<.001?0:o;const s=It(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=o,this.drawBackground(i,e,a,n),K2(e,n.textDirection),i.y+=s.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),Q2(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const o=this._active,a=e.map(({datasetIndex:l,index:d})=>{const c=this.chart.getDatasetMeta(l);if(!c)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:c.data[d],index:d}}),i=!Sl(o,a),s=this._positionChanged(a,n);(i||s)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,o=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,i=this._active||[],s=this._getActiveElements(e,i,n,o),l=this._positionChanged(s,e),d=n||!Sl(s,i)||l;return d&&(this._active=s,(a.enabled||a.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),d}_getActiveElements(e,n,o,a){const i=this.options;if(e.type==="mouseout")return[];if(!a)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,i.mode,i,o);return i.reverse&&s.reverse(),s}_positionChanged(e,n){const{caretX:o,caretY:a,options:i}=this,s=ps[i.position].call(this,e,n);return s!==!1&&(o!==s.x||a!==s.y)}}var Cu={id:"tooltip",_element:_6,positioners:ps,afterInit(t,e,n){n&&(t.tooltip=new _6({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:m6},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Q$=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function J$(t,e,n,o){const a=t.indexOf(e);if(a===-1)return Q$(t,e,n,o);const i=t.lastIndexOf(e);return a!==i?n:a}const eD=(t,e)=>t===null?null:Rt(Math.round(t),0,e);function g6(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Mu extends nr{static id="category";static defaults={ticks:{callback:g6}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const o=this.getLabels();for(const{index:a,label:i}of n)o[a]===i&&o.splice(a,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Re(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:J$(o,e,Se(n,e),this._addedLabels),eD(n,o.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:o,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(o=0),n||(a=this.getLabels().length-1)),this.min=o,this.max=a}buildTicks(){const e=this.min,n=this.max,o=this.options.offset,a=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(o?0:1),1),this._startValue=this.min-(o?.5:0);for(let s=e;s<=n;s++)a.push({value:s});return a}getLabelForValue(e){return g6.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function tD(t,e){const n=[],{bounds:a,step:i,min:s,max:l,precision:d,count:c,maxTicks:u,maxDigits:h,includeBounds:p}=t,f=i||1,_=u-1,{min:m,max:g}=e,b=!Re(s),w=!Re(l),y=!Re(c),x=(g-m)/(h+1);let v=M2((g-m)/_/f)*f,M,C,$,S;if(v<1e-14&&!b&&!w)return[{value:m},{value:g}];S=Math.ceil(g/v)-Math.floor(m/v),S>_&&(v=M2(S*v/_/f)*f),Re(d)||(M=Math.pow(10,d),v=Math.ceil(v*M)/M),a==="ticks"?(C=Math.floor(m/v)*v,$=Math.ceil(g/v)*v):(C=m,$=g),b&&w&&i&&rM((l-s)/i,v/1e3)?(S=Math.round(Math.min((l-s)/v,u)),v=(l-s)/S,C=s,$=l):y?(C=b?s:C,$=w?l:$,S=c-1,v=($-C)/S):(S=($-C)/v,Qi(S,Math.round(S),v/1e3)?S=Math.round(S):S=Math.ceil(S));const E=Math.max(L2(v),L2(C));M=Math.pow(10,Re(d)?E:d),C=Math.round(C*M)/M,$=Math.round($*M)/M;let R=0;for(b&&(p&&C!==s?(n.push({value:s}),C<s&&R++,Qi(Math.round((C+R*v)*M)/M,s,b6(s,x,t))&&R++):C<s&&R++);R<S;++R){const U=Math.round((C+R*v)*M)/M;if(w&&U>l)break;n.push({value:U})}return w&&p&&$!==l?n.length&&Qi(n[n.length-1].value,l,b6(l,x,t))?n[n.length-1].value=l:n.push({value:l}):(!w||$===l)&&n.push({value:$}),n}function b6(t,e,{horizontal:n,minRotation:o}){const a=ho(o),i=(n?Math.sin(a):Math.cos(a))||.001,s=.75*e*(""+t).length;return Math.min(e/i,s)}class Kl extends nr{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Re(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:a,max:i}=this;const s=d=>a=n?a:d,l=d=>i=o?i:d;if(e){const d=uo(a),c=uo(i);d<0&&c<0?l(0):d>0&&c>0&&s(0)}if(a===i){let d=i===0?1:Math.abs(i*.05);l(i+d),e||s(a-d)}this.min=a,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:o}=e,a;return o?(a=Math.ceil(this.max/o)-Math.floor(this.min/o)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${o} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let o=this.getTickLimit();o=Math.max(2,o);const a={maxTicks:o,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=tD(a,i);return e.bounds==="ticks"&&S2(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let n=this.min,o=this.max;if(super.configure(),this.options.offset&&e.length){const a=(o-n)/Math.max(e.length-1,1)/2;n-=a,o+=a}this._startValue=n,this._endValue=o,this._valueRange=o-n}getLabelForValue(e){return Vl(e,this.chart.options.locale,this.options.ticks.format)}}class Su extends Kl{static id="linear";static defaults={ticks:{callback:El.formatters.numeric}};determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ht(e)?e:0,this.max=ht(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=ho(this.options.ticks.minRotation),a=(e?Math.sin(o):Math.cos(o))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/a))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const fs=t=>Math.floor(ha(t)),ar=(t,e)=>Math.pow(10,fs(t)+e);function y6(t){return t/Math.pow(10,fs(t))===1}function w6(t,e,n){const o=Math.pow(10,n),a=Math.floor(t/o);return Math.ceil(e/o)-a}function nD(t,e){const n=e-t;let o=fs(n);for(;w6(t,e,o)>10;)o++;for(;w6(t,e,o)<10;)o--;return Math.min(o,fs(t))}function oD(t,{min:e,max:n}){e=yn(t.min,e);const o=[],a=fs(e);let i=nD(e,n),s=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),d=a>i?Math.pow(10,a):0,c=Math.round((e-d)*s)/s,u=Math.floor((e-d)/l/10)*l*10;let h=Math.floor((c-u)/Math.pow(10,i)),p=yn(t.min,Math.round((d+u+h*Math.pow(10,i))*s)/s);for(;p<n;)o.push({value:p,major:y6(p),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(i++,h=2,s=i>=0?1:s),p=Math.round((d+u+h*Math.pow(10,i))*s)/s;const f=yn(t.max,p);return o.push({value:f,major:y6(f),significand:h}),o}class bK extends nr{static id="logarithmic";static defaults={ticks:{callback:El.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const o=Kl.prototype.parse.apply(this,[e,n]);if(o===0){this._zero=!0;return}return ht(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ht(e)?Math.max(0,e):null,this.max=ht(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ht(this._userMin)&&(this.min=e===ar(this.min,0)?ar(this.min,-1):ar(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let o=this.min,a=this.max;const i=l=>o=e?o:l,s=l=>a=n?a:l;o===a&&(o<=0?(i(1),s(10)):(i(ar(o,-1)),s(ar(a,1)))),o<=0&&i(ar(a,-1)),a<=0&&s(ar(o,1)),this.min=o,this.max=a}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},o=oD(n,this);return e.bounds==="ticks"&&S2(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}getLabelForValue(e){return e===void 0?"0":Vl(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=ha(e),this._valueRange=ha(this.max)-ha(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(ha(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}function Lu(t){const e=t.ticks;if(e.display&&t.display){const n=It(e.backdropPadding);return Se(e.font&&e.font.size,pt.font.size)+n.height}return 0}function aD(t,e,n){return n=nt(n)?n:[n],{w:CM(t,e.string,n),h:n.length*e.lineHeight}}function v6(t,e,n,o,a){return t===o||t===a?{start:e-n/2,end:e+n/2}:t<o||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function rD(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),o=[],a=[],i=t._pointLabels.length,s=t.options.pointLabels,l=s.centerPointLabels?ot/i:0;for(let d=0;d<i;d++){const c=s.setContext(t.getPointLabelContext(d));a[d]=c.padding;const u=t.getPointPosition(d,t.drawingArea+a[d],l),h=Dt(c.font),p=aD(t.ctx,h,t._pointLabels[d]);o[d]=p;const f=wn(t.getIndexAngle(d)+l),_=Math.round(q1(f)),m=v6(_,u.x,p.w,0,180),g=v6(_,u.y,p.h,90,270);iD(n,e,f,m,g)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=dD(t,o,a)}function iD(t,e,n,o,a){const i=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let l=0,d=0;o.start<e.l?(l=(e.l-o.start)/i,t.l=Math.min(t.l,e.l-l)):o.end>e.r&&(l=(o.end-e.r)/i,t.r=Math.max(t.r,e.r+l)),a.start<e.t?(d=(e.t-a.start)/s,t.t=Math.min(t.t,e.t-d)):a.end>e.b&&(d=(a.end-e.b)/s,t.b=Math.max(t.b,e.b+d))}function sD(t,e,n){const o=t.drawingArea,{extra:a,additionalAngle:i,padding:s,size:l}=n,d=t.getPointPosition(e,o+a+s,i),c=Math.round(q1(wn(d.angle+xt))),u=hD(d.y,l.h,c),h=cD(c),p=uD(d.x,l.w,h);return{visible:!0,x:d.x,y:u,textAlign:h,left:p,top:u,right:p+l.w,bottom:u+l.h}}function lD(t,e){if(!e)return!0;const{left:n,top:o,right:a,bottom:i}=t;return!(To({x:n,y:o},e)||To({x:n,y:i},e)||To({x:a,y:o},e)||To({x:a,y:i},e))}function dD(t,e,n){const o=[],a=t._pointLabels.length,i=t.options,{centerPointLabels:s,display:l}=i.pointLabels,d={extra:Lu(i)/2,additionalAngle:s?ot/a:0};let c;for(let u=0;u<a;u++){d.padding=n[u],d.size=e[u];const h=sD(t,u,d);o.push(h),l==="auto"&&(h.visible=lD(h,c),h.visible&&(c=h))}return o}function cD(t){return t===0||t===180?"center":t<180?"left":"right"}function uD(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function hD(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function pD(t,e,n){const{left:o,top:a,right:i,bottom:s}=n,{backdropColor:l}=e;if(!Re(l)){const d=Ka(e.borderRadius),c=It(e.backdropPadding);t.fillStyle=l;const u=o-c.left,h=a-c.top,p=i-o+c.width,f=s-a+c.height;Object.values(d).some(_=>_!==0)?(t.beginPath(),os(t,{x:u,y:h,w:p,h:f,radius:d}),t.fill()):t.fillRect(u,h,p,f)}}function fD(t,e){const{ctx:n,options:{pointLabels:o}}=t;for(let a=e-1;a>=0;a--){const i=t._pointLabelItems[a];if(!i.visible)continue;const s=o.setContext(t.getPointLabelContext(a));pD(n,s,i);const l=Dt(s.font),{x:d,y:c,textAlign:u}=i;Xa(n,t._pointLabels[a],d,c+l.lineHeight/2,l,{color:s.color,textAlign:u,textBaseline:"middle"})}}function x6(t,e,n,o){const{ctx:a}=t;if(n)a.arc(t.xCenter,t.yCenter,e,0,Xe);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let s=1;s<o;s++)i=t.getPointPosition(s,e),a.lineTo(i.x,i.y)}}function mD(t,e,n,o,a){const i=t.ctx,s=e.circular,{color:l,lineWidth:d}=e;!s&&!o||!l||!d||n<0||(i.save(),i.strokeStyle=l,i.lineWidth=d,i.setLineDash(a.dash),i.lineDashOffset=a.dashOffset,i.beginPath(),x6(t,n,s,o),i.closePath(),i.stroke(),i.restore())}function _D(t,e,n){return pa(t,{label:n,index:e,type:"pointLabel"})}class yK extends Kl{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:El.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=It(Lu(this.options)/2),n=this.width=this.maxWidth-e.width,o=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+o/2+e.top),this.drawingArea=Math.floor(Math.min(n,o)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=ht(e)&&!isNaN(e)?e:0,this.max=ht(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Lu(this.options))}generateTickLabels(e){Kl.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const a=Ue(this.options.pointLabels.callback,[n,o],this);return a||a===0?a:""}).filter((n,o)=>this.chart.getDataVisibility(o))}fit(){const e=this.options;e.display&&e.pointLabels.display?rD(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,o,a){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((o-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,o,a))}getIndexAngle(e){const n=Xe/(this._pointLabels.length||1),o=this.options.startAngle||0;return wn(e*n+ho(o))}getDistanceFromCenterForValue(e){if(Re(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(Re(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const o=n[e];return _D(this.getContext(),e,o)}}getPointPosition(e,n,o=0){const a=this.getIndexAngle(e)-xt+o;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:o,right:a,bottom:i}=this._pointLabelItems[e];return{left:n,top:o,right:a,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const o=this.ctx;o.save(),o.beginPath(),x6(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),o.closePath(),o.fillStyle=e,o.fill(),o.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:o,grid:a,border:i}=n,s=this._pointLabels.length;let l,d,c;if(n.pointLabels.display&&fD(this,s),a.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){d=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(h),f=a.setContext(p),_=i.setContext(p);mD(this,f,d,s,_)}}),o.display){for(e.save(),l=s-1;l>=0;l--){const u=o.setContext(this.getPointLabelContext(l)),{color:h,lineWidth:p}=u;!p||!h||(e.lineWidth=p,e.strokeStyle=h,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,d=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(l,d),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,o=n.ticks;if(!o.display)return;const a=this.getIndexAngle(0);let i,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,d)=>{if(d===0&&this.min>=0&&!n.reverse)return;const c=o.setContext(this.getContext(d)),u=Dt(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[d].value),c.showLabelBackdrop){e.font=u.string,s=e.measureText(l.label).width,e.fillStyle=c.backdropColor;const h=It(c.backdropPadding);e.fillRect(-s/2-h.left,-i-u.size/2-h.top,s+h.width,u.size+h.height)}Xa(e,l.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}const Ql={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ln=Object.keys(Ql);function k6(t,e){return t-e}function C6(t,e){if(Re(e))return null;const n=t._adapter,{parser:o,round:a,isoWeekday:i}=t._parseOpts;let s=e;return typeof o=="function"&&(s=o(s)),ht(s)||(s=typeof o=="string"?n.parse(s,o):n.parse(s)),s===null?null:(a&&(s=a==="week"&&(Ji(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,a)),+s)}function M6(t,e,n,o){const a=ln.length;for(let i=ln.indexOf(t);i<a-1;++i){const s=Ql[ln[i]],l=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-e)/(l*s.size))<=o)return ln[i]}return ln[a-1]}function gD(t,e,n,o,a){for(let i=ln.length-1;i>=ln.indexOf(n);i--){const s=ln[i];if(Ql[s].common&&t._adapter.diff(a,o,s)>=e-1)return s}return ln[n?ln.indexOf(n):0]}function bD(t){for(let e=ln.indexOf(t)+1,n=ln.length;e<n;++e)if(Ql[ln[e]].common)return ln[e]}function S6(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:a}=X1(n,e),i=n[o]>=e?n[o]:n[a];t[i]=!0}}function yD(t,e,n,o){const a=t._adapter,i=+a.startOf(e[0].value,o),s=e[e.length-1].value;let l,d;for(l=i;l<=s;l=+a.add(l,1,o))d=n[l],d>=0&&(e[d].major=!0);return e}function L6(t,e,n){const o=[],a={},i=e.length;let s,l;for(s=0;s<i;++s)l=e[s],a[l]=s,o.push({value:l,major:!1});return i===0||!n?o:yD(t,o,a,n)}class $6 extends nr{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const o=e.time||(e.time={}),a=this._adapter=new IS._date(e.adapters.date);a.init(n),Xi(o.displayFormats,a.formats()),this._parseOpts={parser:o.parser,round:o.round,isoWeekday:o.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:C6(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,o=e.time.unit||"day";let{min:a,max:i,minDefined:s,maxDefined:l}=this.getUserBounds();function d(c){!s&&!isNaN(c.min)&&(a=Math.min(a,c.min)),!l&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!l)&&(d(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&d(this.getMinMax(!1))),a=ht(a)&&!isNaN(a)?a:+n.startOf(Date.now(),o),i=ht(i)&&!isNaN(i)?i:+n.endOf(Date.now(),o)+1,this.min=Math.min(a,i-1),this.max=Math.max(a+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],o=e[e.length-1]),{min:n,max:o}}buildTicks(){const e=this.options,n=e.time,o=e.ticks,a=o.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const i=this.min,s=this.max,l=dM(a,i,s);return this._unit=n.unit||(o.autoSkip?M6(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):gD(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:bD(this._unit),this.initOffsets(a),e.reverse&&l.reverse(),L6(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,o=0,a,i;this.options.offset&&e.length&&(a=this.getDecimalForValue(e[0]),e.length===1?n=1-a:n=(this.getDecimalForValue(e[1])-a)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?o=i:o=(i-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;n=Rt(n,0,s),o=Rt(o,0,s),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){const e=this._adapter,n=this.min,o=this.max,a=this.options,i=a.time,s=i.unit||M6(i.minUnit,n,o,this._getLabelCapacity(n)),l=Se(a.ticks.stepSize,1),d=s==="week"?i.isoWeekday:!1,c=Ji(d)||d===!0,u={};let h=n,p,f;if(c&&(h=+e.startOf(h,"isoWeek",d)),h=+e.startOf(h,c?"day":s),e.diff(o,n,s)>1e5*l)throw new Error(n+" and "+o+" are too far apart with stepSize of "+l+" "+s);const _=a.ticks.source==="data"&&this.getDataTimestamps();for(p=h,f=0;p<o;p=+e.add(p,l,s),f++)S6(u,p,_);return(p===o||a.bounds==="ticks"||f===1)&&S6(u,p,_),Object.keys(u).sort(k6).map(m=>+m)}getLabelForValue(e){const n=this._adapter,o=this.options.time;return o.tooltipFormat?n.format(e,o.tooltipFormat):n.format(e,o.displayFormats.datetime)}format(e,n){const a=this.options.time.displayFormats,i=this._unit,s=n||a[i];return this._adapter.format(e,s)}_tickFormatFunction(e,n,o,a){const i=this.options,s=i.ticks.callback;if(s)return Ue(s,[e,n,o],this);const l=i.time.displayFormats,d=this._unit,c=this._majorUnit,u=d&&l[d],h=c&&l[c],p=o[n],f=c&&h&&p&&p.major;return this._adapter.format(e,a||(f?h:u))}generateTickLabels(e){let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n],a.label=this._tickFormatFunction(a.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,o=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+o)*n.factor)}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+o*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,o=this.ctx.measureText(e).width,a=ho(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(a),s=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:o*i+l*s,h:o*s+l*i}}_getLabelCapacity(e){const n=this.options.time,o=n.displayFormats,a=o[n.unit]||o.millisecond,i=this._tickFormatFunction(e,0,L6(this,[e],this._majorUnit),a),s=this._getLabelSize(i),l=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,o;if(e.length)return e;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,o=a.length;n<o;++n)e=e.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,o;if(e.length)return e;const a=this.getLabels();for(n=0,o=a.length;n<o;++n)e.push(C6(this,a[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return E2(e.sort(k6))}}function Jl(t,e,n){let o=0,a=t.length-1,i,s,l,d;n?(e>=t[o].pos&&e<=t[a].pos&&({lo:o,hi:a}=Ua(t,"pos",e)),{pos:i,time:l}=t[o],{pos:s,time:d}=t[a]):(e>=t[o].time&&e<=t[a].time&&({lo:o,hi:a}=Ua(t,"time",e)),{time:i,pos:l}=t[o],{time:s,pos:d}=t[a]);const c=s-i;return c?l+(d-l)*(e-i)/c:l}class wK extends $6{static id="timeseries";static defaults=$6.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=Jl(n,this.min),this._tableRange=Jl(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:o}=this,a=[],i=[];let s,l,d,c,u;for(s=0,l=e.length;s<l;++s)c=e[s],c>=n&&c<=o&&a.push(c);if(a.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(s=0,l=a.length;s<l;++s)u=a[s+1],d=a[s-1],c=a[s],Math.round((u+d)/2)!==c&&i.push({time:c,pos:s/(l-1)});return i}_generate(){const e=this.min,n=this.max;let o=super.getDataTimestamps();return(!o.includes(e)||!o.length)&&o.splice(0,0,e),(!o.includes(n)||o.length===1)&&o.push(n),o.sort((a,i)=>a-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),o=this.getLabelTimestamps();return n.length&&o.length?e=this.normalize(n.concat(o)):e=n.length?n:o,e=this._cache.all=e,e}getDecimalForValue(e){return(Jl(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return Jl(this._table,o*this._tableRange+this._minPos,!0)}}const D6={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},wD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...D6,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},vD=r.version[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function Wr(t){return r.isProxy(t)?r.toRaw(t):t}function xD(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return r.isProxy(e)?new Proxy(t,{}):t}function kD(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function V6(t,e){t.labels=e}function E6(t,e,n){const o=[];t.datasets=e.map(a=>{const i=t.datasets.find(s=>s[n]===a[n]);return!i||!a.data||o.includes(i)?{...a}:(o.push(i),Object.assign(i,a),i)})}function CD(t,e){const n={labels:[],datasets:[]};return V6(n,t.labels),E6(n,t.datasets,e),n}const MD=r.defineComponent({props:wD,setup(t,e){let{expose:n,slots:o}=e;const a=r.ref(null),i=r.shallowRef(null);n({chart:i});const s=()=>{if(!a.value)return;const{type:c,data:u,options:h,plugins:p,datasetIdKey:f}=t,_=CD(u,f),m=xD(_,u);i.value=new or(a.value,{type:c,data:m,options:{...h},plugins:p})},l=()=>{const c=r.toRaw(i.value);c&&(t.destroyDelay>0?setTimeout(()=>{c.destroy(),i.value=null},t.destroyDelay):(c.destroy(),i.value=null))},d=c=>{c.update(t.updateMode)};return r.onMounted(s),r.onUnmounted(l),r.watch([()=>t.options,()=>t.data],(c,u)=>{let[h,p]=c,[f,_]=u;const m=r.toRaw(i.value);if(!m)return;let g=!1;if(h){const b=Wr(h),w=Wr(f);b&&b!==w&&(kD(m,b),g=!0)}if(p){const b=Wr(p.labels),w=Wr(_.labels),y=Wr(p.datasets),x=Wr(_.datasets);b!==w&&(V6(m.config.data,b),g=!0),y&&y!==x&&(E6(m.config.data,y,t.datasetIdKey),g=!0)}g&&r.nextTick(()=>{d(m)})},{deep:!0}),()=>r.h("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:a},[r.h("p",{},[o.default?o.default():""])])}});function $u(t,e){return or.register(e),r.defineComponent({props:D6,setup(n,o){let{expose:a}=o;const i=r.shallowRef(null),s=l=>{i.value=l?.chart};return a({chart:i}),()=>r.h(MD,vD({ref:s},{type:t,...n}))}})}const SD=$u("bar",FS),LD=$u("doughnut",RS),T6=$u("line",HS),$D={class:"chart-container"},Du={__name:"LineChart",props:{data:{type:Array,required:!0},dataType:{type:String,required:!0},isMask:{type:Boolean,default:!1},ticksCallback:{type:Function,default:t=>t},borderColor:{type:String,default:"#007AFF"},gradient:{type:Object,default:{height:450,startColor:"rgba(0, 122, 255, 0.1)",endColor:"rgba(0, 122, 255, 0)"}}},setup(t){or.register(Mu,Su,G3,hs,Cu,a6);const e=t,n=r.ref(0),o=r.inject("darkMode");let a=r.reactive({isEmpty:!0});const i=p=>{const f=new Set,_=[];let m=[];switch(e.dataType){case"balanceChartData":p.length===0?m=[0,0]:m=p.map(b=>(f.add(b.date),at(b.balance*dr(),2)));break;case"performanceChartData":p.length===0?m=[0,0]:m=p.reduce((b,w,y)=>{f.add(w.date);const x=y?b[y-1]:0,v=at(x+w.pnl_to_deposit,2);return b.push(v),b},[]);break}_.push({data:m});const g=Array.from(f);return g.length===1?(g.push(...g),_.forEach(b=>{b.data.push(...b.data)}),a.isEmpty=!1):g.length===0?(a.isEmpty=!0,g.push(0,0)):a.isEmpty=!1,{labels:g,datasets:_}},s=r.computed(()=>i(e.data)),l=p=>{const _=p.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return _.addColorStop(0,e.gradient.startColor),_.addColorStop(1,e.gradient.endColor),_},d=(p,f)=>{let _=document.querySelector(`#${p}-${e.dataType}`);return _||(_=document.createElement("div"),_.classList.add(p),_.setAttribute("id",`${p}-${e.dataType}`),f.canvas.parentNode.appendChild(_)),_},c=p=>{if(!a.isEmpty){const{chart:f,tooltip:_}=p,m=d("chart-tooltip",f);if(_.opacity===0){m.style.opacity="0";return}if(_.body){const M=_.title||[],C=_.body.map(S=>S.lines),$=document.createElement("div");for($.classList.add("chart-tooltip-middle"),$.innerHTML=`<div class="chart-tooltip-content">
41
41
  ${e.dataType==="balanceChartData"?`${ii()}${_e(e.isMask,vd(C[0]),{repeat:6})}`:`${_e(e.isMask,vd(C[0]),{repeat:3})}%`}
42
42
  <span> | ${r0(M[0],"EEE, dd LLL, yyyy")}</span></div>`;m.firstChild;)m.firstChild.remove();m.appendChild($)}const{offsetLeft:g,offsetTop:b,clientWidth:w}=f.canvas;let y=g+_.caretX;const x=b+_.caretY,v=m.clientWidth;y+v>w&&(y-=v),m.style.opacity="1",m.style.left=y+"px",m.style.top=x+"px"}},u=p=>{const{chart:f}=p,_=d("chart-line",f),m=f.chartArea;f.canvas.addEventListener("mousemove",function(g){const b=f.canvas.getBoundingClientRect(),w=g.clientX-b.left,y=g.clientY-b.top;w>=m.left&&w<=m.right&&y>=m.top&&y<=m.bottom?(_.style.left=w+"px",_.style.top=m.top+"px",_.style.height=m.bottom-m.top+"px",_.style.display="flex"):_.style.display="none"}),f.canvas.addEventListener("mouseout",function(){_.style.display="none"})},h=r.computed(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},scales:{x:{ticks:{display:!a.isEmpty,callback:function(p){return p_(this.getLabelForValue(p)).slice(0,3)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15,align:"center"},grid:{display:!1},border:{color:o.value?"#2D2D2D":"#EDEDED"}},y:{ticks:{display:!a.isEmpty,callback:function(p){return e.ticksCallback(p,e.isMask)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15},grid:{color:o.value?"#2D2D2D":"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}},plugins:{tooltip:{enabled:!1,position:"nearest",external:c},legend:!1},elements:{line:{backgroundColor:p=>l(p),tension:.3,borderWidth:2,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:"circle",pointRadius:1,pointHoverRadius:8,pointBackgroundColor:e.borderColor,pointBorderWidth:0,pointHoverBorderWidth:3,pointBorderColor:"#fff",pointHoverBorderColor:"#fff",pointHitRadius:50}},onHover:u}));return r.watch(()=>e.isMask,()=>{n.value+=1},{immediate:!0}),(p,f)=>(r.openBlock(),r.createElementBlock("div",$D,[(r.openBlock(),r.createBlock(r.unref(T6),{key:n.value,data:s.value,options:h.value},null,8,["data","options"]))]))}},Vu={__name:"SimpleLineChart",props:{data:{type:Array,required:!0},borderColor:{type:String,default:"#56B683"},gradient:{type:Object,default:{height:200,startColor:"rgba(86, 182, 131, 0.1)",endColor:"rgba(86, 182, 131, 0)"}}},setup(t){or.register(Mu,Su,G3,hs,a6);const e=t,n=s=>{const l=new Set,d=[],c=s.map(h=>(l.add(h.date),h.balance));return d.push({data:c}),{labels:Array.from(l),datasets:d}},o=r.computed(()=>n(e.data)),a=s=>{const d=s.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return d.addColorStop(0,e.gradient.startColor),d.addColorStop(1,e.gradient.endColor),d},i=r.ref({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},interaction:{mode:"index",intersect:!1},scales:{x:{display:!1},y:{display:!1}},plugins:{tooltip:!1,legend:!1},elements:{line:{backgroundColor:s=>a(s),tension:.05,borderWidth:3,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}}});return(s,l)=>(r.openBlock(),r.createBlock(r.unref(T6),{data:o.value,options:i.value},null,8,["data","options"]))}},DD=t=>(r.pushScopeId("data-v-a1d419ad"),t=t(),r.popScopeId(),t),VD={class:"import-data"},ED={class:"import-data__content"},TD=DD(()=>r.createElementVNode("div",{class:"import-data__text"},[r.createTextVNode(" Importing data from the exchange. "),r.createElementVNode("br"),r.createTextVNode(" The widget will be displayed after the page reloads ")],-1)),dn=ve({__name:"ImportData",emits:["refresh"],setup(t,{emit:e}){const n=e;return(o,a)=>(r.openBlock(),r.createElementBlock("div",VD,[r.createElementVNode("div",ED,[r.createElementVNode("div",{onClick:a[0]||(a[0]=i=>n("refresh")),class:"import-data__refresh-btn"},[r.createVNode(r.unref(Le),{icon:"arrow-rotating"})]),TD])]))}},[["__scopeId","data-v-a1d419ad"]]),OD=t=>(r.pushScopeId("data-v-969073e2"),t=t(),r.popScopeId(),t),BD={class:"account-balance-widget"},PD={class:"account-balance-widget__top"},ND={class:"account-balance-widget__title-wrapper"},AD=OD(()=>r.createElementVNode("div",{class:"account-balance-widget__title"},"Account Balance",-1)),FD=ve({__name:"AccountBalanceWidget",props:{tooltip:{type:String,default:"This graphic widget displays changes to your deposit over a specific time period."},balanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e;return(o,a)=>(r.openBlock(),r.createElementBlock("div",BD,[r.createElementVNode("div",PD,[r.createElementVNode("div",ND,[AD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.tooltip),1)]),_:1})])]),r.createVNode(r.unref(Du),{data:t.balanceChartData,"data-type":"balanceChartData","ticks-callback":r.unref(si),isMask:t.isMask},null,8,["data","ticks-callback","isMask"]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:a[0]||(a[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-969073e2"]]),O6=t=>(r.pushScopeId("data-v-35320c46"),t=t(),r.popScopeId(),t),zD={class:"balance-widget"},RD={class:"balance-part"},HD={class:"balance-part__top"},ID={class:"balance-part__title-wrapper"},jD=O6(()=>r.createElementVNode("div",{class:"balance-part__title"},"Balance",-1)),ZD={key:0,class:"balance-widget__tooltip"},YD={class:"balance-part__content"},WD={class:"balance-part__content__wrapper"},UD={key:0,class:"balance-part__content__bitcoin"},qD={key:0,class:"divider"},GD={key:1,class:"personal-target-part"},XD={class:"personal-target-part__top"},KD={class:"personal-target-part__title-wrapper"},QD=O6(()=>r.createElementVNode("div",{class:"personal-target-part__title"},"Personal target",-1)),JD={key:0,class:"balance-widget__tooltip"},eV={class:"personal-target-part__content"},tV={class:"personal-target-part__content__current"},nV={class:"personal-target-part__content__from"},oV=ve({__name:"BalanceWidget",props:{tooltip:{type:String,default:`Displays the balance of your deposit in USD and BTC equivalent,
43
- additionally showing the growth/fall of your balance.`},showBTC:{type:Boolean,default:!0},BTC:{type:Number,default:0},USDT:{type:Number,default:0},delta:{type:Number,default:0},balanceChartData:{type:Array,default:[]},currentProfit:{type:Number,default:0},profit:{type:Number,default:0},drawdown:{type:Number,default:0},isPercentage:Boolean,isShare:{type:Boolean,default:!1},isHidden:{type:Boolean,default:!1},isMaskBalance:{type:Boolean,default:!1},isMaskPersonalTarget:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["switchModal","switchVisibility","refresh"],setup(t,{emit:e}){const n=e,o=t,a=r.reactive({USDT:0,BTC:0,delta:0}),i=r.reactive({currentProfit:0}),s=r.ref(0),l=r.ref(!1),d=r.ref(!1),c=()=>{n("switchVisibility")},u=()=>{l.value=!0},h=()=>{l.value=!1},p=()=>{d.value=!0},f=()=>{d.value=!1},_=r.computed(()=>({currentProfit:o.currentProfit,profit:o.profit,drawdown:o.drawdown})),m=r.computed(()=>`${44+(String(at(o.USDT,2)).length-1)*16}px`);return r.watch(()=>o.USDT,g=>{$o.to(a,{duration:1.5,USDT:Number(g)||0,BTC:o.BTC,delta:o.delta})},{immediate:!0}),r.watch(()=>o.delta,g=>{$o.to(a,{delta:Number(g)||0})},{deep:!0}),r.watch(()=>_,g=>{s.value=$o.to(i,{duration:1.5,currentProfit:o.currentProfit})},{immediate:!0,deep:!0}),(g,b)=>(r.openBlock(),r.createElementBlock("div",zD,[r.createElementVNode("div",RD,[r.createElementVNode("div",HD,[r.createElementVNode("div",ID,[jD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.tooltip),1)]),_:1})]),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"balance-part__visibility-switcher",onClick:c,onMouseover:u,onMouseleave:h},[r.withDirectives(r.createVNode(r.unref(Le),{icon:"eye"},null,512),[[r.vShow,t.isHidden]]),r.withDirectives(r.createVNode(r.unref(Le),{icon:"eye-slash"},null,512),[[r.vShow,!t.isHidden]]),l.value?(r.openBlock(),r.createElementBlock("div",ZD," Enable or disable Private Mode for a more secure experience. ")):r.createCommentVNode("",!0)],32))]),r.createElementVNode("div",YD,[r.createElementVNode("div",WD,[r.createElementVNode("div",{class:"balance-part__content__count",style:r.normalizeStyle({minWidth:m.value})},r.toDisplayString(r.unref(_e)(t.isMaskBalance,r.unref(Ie)(a.USDT),{prefix:"$"})),5),t.delta?(r.openBlock(),r.createBlock(r.unref(Yd),{key:0,class:"balance-part__content__chips","is-hidden":t.isMaskBalance,percentage:"",delta:a.delta},null,8,["is-hidden","delta"])):r.createCommentVNode("",!0)]),t.showBTC?(r.openBlock(),r.createElementBlock("div",UD," = "+r.toDisplayString(r.unref(_e)(t.isMaskBalance,a.BTC))+" BTC ",1)):r.createCommentVNode("",!0)]),t.isShare?(r.openBlock(),r.createBlock(r.unref(Vu),{key:0,class:"balance-part__chart balance-part__chart--share",data:t.balanceChartData,gradient:{height:500,startColor:"rgba(86, 182, 131, 0.1)",endColor:"rgba(86, 182, 131, 0)"}},null,8,["data"])):(r.openBlock(),r.createBlock(r.unref(Vu),{key:1,class:"balance-part__chart",data:t.balanceChartData},null,8,["data"]))]),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",qD)),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",GD,[r.createElementVNode("div",XD,[r.createElementVNode("div",KD,[QD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(" In this widget, set your desired balance growth target in $ or % for a specific period. It will display your PNL relative to the goal, helping you know when to stop or pay closer attention. ")]),_:1})]),r.createElementVNode("div",{class:"balance-part__modal-switcher",onClick:b[0]||(b[0]=w=>n("switchModal")),onMouseover:p,onMouseleave:f},[r.createVNode(r.unref(Le),{icon:"settings"}),d.value?(r.openBlock(),r.createElementBlock("div",JD," Click to configure goals in the Personal Target widget. ")):r.createCommentVNode("",!0)],32)]),r.createElementVNode("div",eV,[r.createElementVNode("div",tV,r.toDisplayString(r.unref(_e)(t.isMaskPersonalTarget,r.unref(Ie)(i.currentProfit,{isPercentage:t.isPercentage,isFixed:!0}),{prefix:"$",repeat:5})),1),r.createElementVNode("div",nV," / "+r.toDisplayString(r.unref(_e)(t.isMaskPersonalTarget,r.unref(Ie)(t.profit,{isPercentage:t.isPercentage,isFixed:!0}))),1)]),(r.openBlock(),r.createBlock(r.unref(S5),{key:s.value,"current-profit":t.currentProfit,"is-hidden":t.isMaskPersonalTarget,drawdown:t.drawdown,profit:t.profit,"is-percentage":t.isPercentage},null,8,["current-profit","is-hidden","drawdown","profit","is-percentage"]))])),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:b[1]||(b[1]=w=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-35320c46"]]),ed=t=>(r.pushScopeId("data-v-9786b83c"),t=t(),r.popScopeId(),t),aV={class:"calendar-widget"},rV={class:"calendar-widget__calendar"},iV={class:"calendar-widget__top"},sV={class:"calendar-widget__title-wrapper"},lV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),dV={class:"stat-calendar"},cV={class:"stat-calendar__week-days"},uV={key:0,class:"stat-calendar__row-wrapper"},hV={class:"stat-calendar__row"},pV=["onClick"],fV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),mV={key:0,class:"calendar-widget__day"},_V={class:"calendar-widget__day__title-wrapper"},gV={class:"calendar-widget__day__title"},bV={class:"calendar-widget__day__content"},yV={class:"calendar-widget__point"},wV={class:"calendar-widget__point__title"},vV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),xV={class:"calendar-widget__day__trades"},kV={class:"calendar-widget__point"},CV={class:"calendar-widget__point__title"},MV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),SV={__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,minDate:Date,currentDate:{type:Date,default:new Date},maxDate:{type:Date,default:Date()},isCurrentDate:Function,isCurrentDay:Function,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["setNewDate","chooseMonth","refresh","getDetails"],setup(t,{emit:e}){const n=["Mo","Tu","We","Th","Fr","Sa","Su"],o=r.ref(null),a=r.ref(null),i=e,s=t,l=u=>{o.value=u.year,a.value=u.month,i("chooseMonth",u)};r.nextTick(()=>{const u=new Date;o.value=u.getFullYear(),a.value=u.getMonth()});const d=r.computed(()=>[{title:"Total trades",value:s.dailyStatData&&s.dailyStatData.trades_total_count||0},{title:"Winrate",value:Ie(s.dailyStatData&&s.dailyStatData.win_rate||0,{isPercentage:!0,isFixed:!0}),class:s.dailyStatData&&s.dailyStatData.win_rate>=50?"-win":"-loss"},{title:"Return",value:Ie(s.dailyStatData&&s.dailyStatData.return_total||0),class:s.dailyStatData&&s.dailyStatData.return_total>=0?"-win":"-loss"},{title:"Return on winners",value:Ie(s.dailyStatData&&s.dailyStatData.return_win||0)},{title:"Return on losers",value:Ie(s.dailyStatData&&s.dailyStatData.return_lose||0)},{title:"Commission",value:Ie(s.dailyStatData&&s.dailyStatData.commission||0)}]),c=r.computed(()=>[{title:"Win trades",value:s.dailyStatData&&s.dailyStatData.trades_win_count||0,isPositive:!0},{title:"Loss trades",value:-(s.dailyStatData&&s.dailyStatData.trades_lose_count)||0,isNegative:!1}]);return(u,h)=>(r.openBlock(),r.createElementBlock("div",aV,[r.createElementVNode("div",rV,[r.createElementVNode("div",iV,[r.createElementVNode("div",sV,[lV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("A widget that displays the performance of your trades in a calendar format. Here you can see profitable and unprofitable days with detailed statistics for each day. ")]),_:1})]),t.currentDate&&t.minDate?(r.openBlock(),r.createBlock(r.unref(C5),{key:0,"current-date":t.currentDate||new Date,"min-date":t.minDate,"max-date":t.maxDate,onOnChange:l,year:o.value,"onUpdate:year":h[0]||(h[0]=p=>o.value=p),month:a.value,"onUpdate:month":h[1]||(h[1]=p=>a.value=p)},null,8,["current-date","min-date","max-date","year","month"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",dV,[r.createElementVNode("div",cV,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(n,(p,f)=>r.createElementVNode("div",{class:r.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(f)}])},r.toDisplayString(p),3)),64))]),t.rows?(r.openBlock(),r.createElementBlock("div",uV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.rows,p=>(r.openBlock(),r.createElementBlock("div",hV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,f=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["stat-calendar__day",{"-unavailable":f.unavailable,"-empty":!f.date,"-current":t.isCurrentDate(f.date),"-positive":f.win,"-negative":f.win===!1}]),onClick:_=>i("setNewDate",f.date)},r.toDisplayString(f.date?f.date:""),11,pV))),256))]))),256))])):r.createCommentVNode("",!0)])]),fV,t.dailyStatData&&!t.dailyStatData.isNull?(r.openBlock(),r.createElementBlock("div",mV,[r.createElementVNode("div",_V,[r.createElementVNode("div",gV,r.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),r.createVNode(Le,{icon:"preview",onClick:h[2]||(h[2]=p=>i("getDetails"))})]),r.createElementVNode("div",bV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,p=>(r.openBlock(),r.createElementBlock("div",yV,[r.createElementVNode("div",wV,r.toDisplayString(p.title),1),vV,r.createElementVNode("div",{class:r.normalizeClass(["calendar-widget__point__value",p.class?p.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,p.value,{repeat:5})),3)]))),256)),r.createVNode(r.unref(h2),{isHidden:t.isMask,long:t.dailyStatData?.long_count,short:t.dailyStatData?.short_count},null,8,["isHidden","long","short"]),r.createElementVNode("div",xV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,p=>(r.openBlock(),r.createElementBlock("div",kV,[r.createElementVNode("div",CV,r.toDisplayString(p.title),1),MV,r.createVNode(r.unref(Yd),{isHidden:t.isMask,"is-positive":p.isPositive,"is-negative":p.isNegative,delta:p.value},null,8,["isHidden","is-positive","is-negative","delta"])]))),256))])])])):(r.openBlock(),r.createBlock(r.unref(ko),{key:1,class:"-empty"})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:h[3]||(h[3]=p=>i("refresh"))})):r.createCommentVNode("",!0)]))}},LV=ve(SV,[["__scopeId","data-v-9786b83c"]]),Eu=t=>(r.pushScopeId("data-v-f0601396"),t=t(),r.popScopeId(),t),$V={class:"commission-widget"},DV={class:"commission-widget__content"},VV={class:"commission-widget__top"},EV={class:"commission-widget__title-wrapper"},TV=Eu(()=>r.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),OV={class:"commission-widget__info"},BV={class:"commission-widget__total-wrapper"},PV=Eu(()=>r.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),NV={class:"commission-widget__total-wrapper__total"},AV={class:"commission-widget__total-wrapper__value"},FV={class:"commission-widget__points"},zV={class:"commission-widget__point"},RV={class:"commission-widget__point__title"},HV=Eu(()=>r.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),IV=ve({__name:"CommissionsFeesWidget",props:{commissionData:Object,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e,o=t,a=r.reactive({commission:0}),i=r.computed(()=>o.commissionData&&o.commissionData.commission||0),s=r.computed(()=>o.commissionData&&o.commissionData.pnl||0),l=r.computed(()=>[{title:"AVG fees per trade",value:`${Ie(o.commissionData&&o.commissionData.fees_per_trade||0)}`},{title:"PNL / Commission",value:s.value&&i.value?`${Ie(s.value)}/${Ie(i.value)}`:`${Ie(0)}`},{title:"AVG fees per day",value:`${Ie(o.commissionData&&o.commissionData.fees_per_day||0)}`},{title:"Funding",value:`${Ie(o.commissionData&&o.commissionData.funding||0)}`}]);return r.watch(i,d=>{$o.to(a,{duration:1.5,commission:d})},{immediate:!0}),(d,c)=>(r.openBlock(),r.createElementBlock("div",$V,[r.createElementVNode("div",DV,[r.createElementVNode("div",VV,[r.createElementVNode("div",EV,[TV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("This widget helps traders finally understand how much money they spent on commissions and funding. ")]),_:1})])]),r.createElementVNode("div",OV,[r.createElementVNode("div",BV,[PV,r.createElementVNode("div",NV,[r.createElementVNode("div",AV,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(a.commission),{repeat:5})),1)])]),r.createElementVNode("div",FV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(u,h)=>(r.openBlock(),r.createElementBlock("div",zV,[r.createElementVNode("div",RV,r.toDisplayString(u.title),1),HV,r.createElementVNode("div",{class:r.normalizeClass(["commission-widget__point__value",u.class?u.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,u.value,{repeat:5})),3)]))),256))])])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:c[0]||(c[0]=u=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-f0601396"]]),jV={class:"chart-wrapper"},ZV=["id","onMouseover","onMouseleave"],td={__name:"BarChart",props:{data:{type:Object,required:!0},dataType:{type:String,required:!1},borderColor:{type:String,default:"#56B683"},ticksCallback:{type:Function,default:t=>t},yTicksCallback:{type:Function,default:t=>t},altLabels:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1}},setup(t){or.register(Mu,Su,b$,Z$,Cu,l6);const e=r.inject("darkMode"),n=r.ref(0);r.ref(!1);const o=r.ref(null),a=t,i=r.ref(null),s=r.ref([]),l=f=>{o.value=f},d=f=>{o.value=null},c=r.ref({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},interaction:{mode:"index",intersect:!1},elements:{line:{tension:.05,borderWidth:3,borderColor:a.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}},plugins:{tooltip:{enabled:!1,position:"nearest",external:p},legend:!1},scales:{x:{grid:{display:!1},ticks:{callback:function(f){return a.ticksCallback(f,a.data.labels)}}},y:{ticks:{callback:function(f){return a.yTicksCallback(f,a.isMask)}},grid:{color:e?.value?"#2D2D2D":"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}}}),u=()=>{const f=i.value?.chart;if(!f)return;const _=f.scales.x;_&&(s.value=a.data.labels.map((m,g)=>{const b=_.getPixelForTick(g),w=document.getElementById(`label-${g}`),y=w?w.clientWidth:0;return b-y/2}))};function h(f,_){let m=document.querySelector(`#${f}-${a.dataType}`);return m||(m=document.createElement("div"),m.classList.add(f),m.setAttribute("id",`${f}-${a.dataType}`),_.canvas.parentNode.appendChild(m)),m}function p(f){const{chart:_,tooltip:m}=f,g=h("chart-tooltip",_);if(m.opacity===0){g.style.opacity="0";return}if(m.body){m.title,m.body.map($=>$.lines);const C=document.createElement("div");for(C.classList.add("chart-tooltip-middle"),C.innerHTML=`${_e(a.isMask,vd(`${m.dataPoints[0].raw>0?"":"-"}${ii()}${Math.abs(at(m.dataPoints[0].raw))}`),{repeat:3})}`;g.firstChild;)g.firstChild.remove();g.appendChild(C)}const{offsetLeft:b,offsetTop:w,clientWidth:y}=_.canvas;let x=b+m.caretX;const v=w+m.caretY,M=g.clientWidth;x+M>y&&(x-=M),g.style.opacity="1",g.style.left=x+"px",g.style.top=v+"px"}return r.watch(()=>a.isMask,()=>{n.value+=1},{immediate:!0}),r.watch(()=>a.data,()=>{a.altLabels&&setTimeout(()=>{u()},0)},{deep:!0}),r.onMounted(()=>{a.altLabels&&r.nextTick(()=>{u(),window.addEventListener("resize",u)})}),r.onUnmounted(()=>{a.altLabels&&window.removeEventListener("resize",u)}),(f,_)=>(r.openBlock(),r.createElementBlock("div",jV,[(r.openBlock(),r.createBlock(r.unref(SD),{ref_key:"barChart",ref:i,class:"chart-container",key:n.value,data:t.data,options:c.value},null,8,["data","options"])),t.altLabels?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(t.data.labels,(m,g)=>(r.openBlock(),r.createElementBlock("div",{class:"chart-wrapper__labels",id:`label-${g}`,style:r.normalizeStyle({left:`${s.value[g]}px`}),onMouseover:b=>l(g),onMouseleave:b=>d()},[r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(Cs)(m,0)}`)},null,2),r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(Cs)(m,1)}`)},null,2)],44,ZV))),256)):r.createCommentVNode("",!0),o.value!==null?(r.openBlock(),r.createElementBlock("div",{key:1,class:"chart-wrapper__label-tooltip",style:r.normalizeStyle(t.data.labels.length===o.value+1?{right:"0px"}:{left:`${s.value[o.value]-25}px`})},r.toDisplayString(r.unref(cr)(a.data.labels[o.value])),5)):r.createCommentVNode("",!0)]))}},YV=t=>(r.pushScopeId("data-v-3d420a57"),t=t(),r.popScopeId(),t),WV={class:"instrument-widget"},UV={class:"instrument-widget__top"},qV={class:"instrument-widget__title-wrapper"},GV=YV(()=>r.createElementVNode("div",{class:"instrument-widget__title"},"Results by Instrument",-1)),XV={key:0,class:""},KV={key:1,class:"instrument-widget__grid-wrapper"},QV={class:"instrument-widget__grid"},JV={class:"instrument-widget__card"},eE={class:"instrument-widget__card__top"},tE={class:"instrument-widget__card__pair"},nE={class:"instrument-widget__card__pair__icons"},oE={class:"instrument-widget__card__pair__title"},aE={class:"instrument-widget__card__trades"},rE=ve({__name:"InstrumentWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=[{id:0,name:"Overall"},{id:1,name:"Long"},{id:2,name:"Short"}],o=t,a=e,i=r.ref(!1),s=r.ref({id:0,name:"Overall"}),l=r.computed(()=>o.results&&Object.values(o.results).length?c(o.results[s.value.name.toLowerCase()]):[]),d=r.computed(()=>{const p=Object.values(l.value).slice(0,10).map(_=>_.net_pnl_total*dr()),f=Object.values(l.value).slice(0,10).map(_=>_.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(l.value).slice(0,10),datasets:[{data:p,backgroundColor:f,borderRadius:4}]}}),c=p=>Object.fromEntries(Object.entries(p).sort(([,f],[,_])=>_.net_pnl_total-f.net_pnl_total)),u=(p,f)=>"",h=()=>{i.value=!i.value};return(p,f)=>(r.openBlock(),r.createElementBlock("div",WV,[r.createElementVNode("div",UV,[r.createElementVNode("div",qV,[GV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Check your performance across different trading instruments. Use the Overall, Long, or Short filters to view detailed results. ")]),_:1})]),i.value?(r.openBlock(),r.createBlock(r.unref(Cn),{key:0,class:"instrument-widget__btn",view:"secondary",icon:"list",size:"sm",onClick:h})):(r.openBlock(),r.createBlock(r.unref(Cn),{key:1,class:"instrument-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:h}))]),r.createElementVNode("div",{class:r.normalizeClass(["instrument-widget__content",{"-chart-active":i.value}])},[r.createVNode(r.unref(Pc),{class:"instrument-widget__switcher",modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=_=>s.value=_),options:n},null,8,["modelValue"]),l.value&&Object.values(l.value).length?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.value?(r.openBlock(),r.createElementBlock("div",XV,[r.createVNode(td,{class:"instrument-widget__bar",data:d.value,ticksCallback:u,"y-ticks-callback":r.unref(si),"is-mask":t.isMask,"data-type":"instrument","alt-labels":""},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",KV,[r.createElementVNode("div",QV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(_,m,g)=>(r.openBlock(),r.createElementBlock("div",JV,[r.createElementVNode("div",eE,[r.createElementVNode("div",tE,[r.createElementVNode("div",nE,[r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(Cs)(m,0)}`)},null,2),r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(Cs)(m,1)}`)},null,2)]),r.createElementVNode("div",oE,r.toDisplayString(r.unref(cr)(m)),1)]),r.createElementVNode("div",aE,r.toDisplayString(r.unref(_e)(t.isMask,_.trades_count,{repeat:3})),1)]),r.createElementVNode("div",{class:r.normalizeClass(["instrument-widget__card__net-pnl",{"-positive":_.net_pnl_total>0,"-negative":_.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(_.net_pnl_total,{isFixed:!0,isPlus:!0}),{repeat:3})),3)]))),256))])]))],64)):(r.openBlock(),r.createBlock(ko,{key:1,absolute:""}))],2),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:f[1]||(f[1]=_=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-3d420a57"]]),iE=t=>(r.pushScopeId("data-v-e7e7b192"),t=t(),r.popScopeId(),t),sE={class:"size-widget"},lE={class:"size-widget__top"},dE={class:"size-widget__title-wrapper"},cE=iE(()=>r.createElementVNode("div",{class:"size-widget__title"},"Result by position size",-1)),uE={key:0},hE={key:1,class:"size-widget__grid"},pE={class:"size-widget__card"},fE={class:"size-widget__card__top"},mE={class:"size-widget__card__title"},_E={class:"size-widget__card__trades"},gE={class:"size-widget__card__bottom"},bE=ve({__name:"SizeWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=t,o=e,a=r.ref(!1),i=r.computed(()=>{const d=n.results.slice(0,10).map(h=>h.net_pnl*dr()),c=n.results.slice(0,10).map(h=>h.net_pnl>0?"#56B683":"#F18169");return{labels:n.results.slice(0,10).map(h=>h.amount),datasets:[{data:d,backgroundColor:c,borderRadius:4}]}}),s=(d,c)=>c[d],l=()=>{a.value=!a.value};return(d,c)=>(r.openBlock(),r.createElementBlock("div",sE,[r.createElementVNode("div",lE,[r.createElementVNode("div",dE,[cE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Compare your profits or losses based on the size of your positions. Understand how position size influences your trading outcomes. ")]),_:1})]),a.value?(r.openBlock(),r.createBlock(r.unref(Cn),{key:0,class:"size-widget__btn",view:"secondary",icon:"list",size:"sm",onClick:l})):(r.openBlock(),r.createBlock(r.unref(Cn),{key:1,class:"size-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:l}))]),t.results&&t.results.length?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["size-widget__content",{"-chart-active":a.value}])},[a.value?(r.openBlock(),r.createElementBlock("div",uE,[r.createVNode(td,{class:"size-widget__bar",data:i.value,"ticks-callback":s,"y-ticks-callback":r.unref(si),"is-mask":t.isMask,"data-type":"size"},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",hE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.results,u=>(r.openBlock(),r.createElementBlock("div",pE,[r.createElementVNode("div",fE,[r.createElementVNode("div",mE,r.toDisplayString(u.amount)+" lots",1),r.createElementVNode("div",_E,r.toDisplayString(r.unref(_e)(t.isMask,u.total_count,{repeat:3}))+" trades ",1)]),r.createElementVNode("div",gE,[r.createElementVNode("div",{class:r.normalizeClass(["size-widget__card__net-pnl",{"-positive":u.net_pnl>0,"-negative":u.net_pnl<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(u.net_pnl,{isPlus:!0,isFixed:!0}),{repeat:3})),3)])]))),256))]))],2)):(r.openBlock(),r.createBlock(ko,{key:1,absolute:""})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:c[0]||(c[0]=u=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-e7e7b192"]]),yE=t=>(r.pushScopeId("data-v-98670dfc"),t=t(),r.popScopeId(),t),wE={class:"performance-widget"},vE={class:"performance-widget__top"},xE={class:"performance-widget__title-wrapper"},kE=yE(()=>r.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),CE=ve({__name:"PerformanceWidget",props:{performanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){r.ref("week");const n=t,o=e,a=i=>_e(n.isMask,at(i,2)+"%",{repeat:3});return(i,s)=>(r.openBlock(),r.createElementBlock("div",wE,[r.createElementVNode("div",vE,[r.createElementVNode("div",xE,[kE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("The linear graphics widget displays the profit as a percentage of the deposit. ")]),_:1})])]),r.createVNode(r.unref(Du),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":a,isMask:t.isMask},null,8,["data","isMask"]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:s[0]||(s[0]=l=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-98670dfc"]]),Tu=t=>(r.pushScopeId("data-v-174618cb"),t=t(),r.popScopeId(),t),ME={class:"return-widget"},SE={class:"return-widget__content"},LE={class:"return-widget__top"},$E={class:"return-widget__title-wrapper"},DE=Tu(()=>r.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),VE={class:"return-widget__info"},EE={class:"return-widget__total-wrapper"},TE=Tu(()=>r.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),OE={class:"return-widget__total-wrapper__total"},BE={class:"return-widget__points"},PE={class:"return-widget__point"},NE={class:"return-widget__point__title"},AE=Tu(()=>r.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),FE=["innerHTML"],zE=ve({__name:"ReturnWidget",props:{totalReturn:{type:Number,default:0},win:{type:Number,default:0},lose:{type:Number,default:0},returnPeriod:{type:Number,default:0},profitFactor:{type:Number,default:0},daily:{type:Number,default:0},changeRate:{type:Number,default:0},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e,o=t,a=r.computed(()=>`${44+(String(at(o.returnPeriod,2)).length-1)*16}px`),i=r.reactive({returnPeriod:0,changeRate:0}),s=r.computed(()=>[{title:"Average return per trade",value:o.totalReturn,options:{isPlus:!0,isFixed:!0},class:o.totalReturn===0?"":o.totalReturn>0?"-win":"-loss"},{title:"Daily return",value:o.daily,options:{isPlus:!0,isFixed:!0},class:o.daily===0?"":o.daily>0?"-win":"-loss"},{title:"Return on winners",value:o.win,class:"-win"},{title:"Return on losers",value:o.lose,class:"-loss"}]),l=r.computed(()=>o.returnPeriod>0),d=r.computed(()=>o.returnPeriod<0),c=r.computed(()=>o.profitFactor>1?"-positive":"-negative"),u=r.computed(()=>o.profitFactor>0?`Your profit factor is ${_e(o.isMask,at(o.profitFactor),{repeat:5})}. <br /> You earn ${_e(o.isMask,Ie(o.profitFactor),{repeat:5,prefix:"$"})} on every ${_e(o.isMask,"$1",{repeat:5,prefix:"$"})} loss.`:`Your profit factor is ${_e(o.isMask,at(o.profitFactor),{repeat:5})}. <br/> You loss ${_e(o.isMask,Ie(Math.abs(o.profitFactor)),{repeat:5,prefix:"$"})} on every ${_e(o.isMask,"$1",{repeat:5,prefix:"$"})} earn. `);return r.watch(()=>o.returnPeriod,h=>{$o.to(i,{duration:1.5,returnPeriod:h,changeRate:o.changeRate})},{immediate:!0}),(h,p)=>(r.openBlock(),r.createElementBlock("div",ME,[r.createElementVNode("div",SE,[r.createElementVNode("div",LE,[r.createElementVNode("div",$E,[DE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("This widget displays an increase in NET profit in dollars and percentage relative to the deposit for the specified period you have chosen. ")]),_:1})])]),r.createElementVNode("div",VE,[r.createElementVNode("div",EE,[TE,r.createElementVNode("div",OE,[r.createElementVNode("div",{class:r.normalizeClass(["return-widget__total-wrapper__value",{"-positive":l.value,"-negative":d.value}]),style:r.normalizeStyle({minWidth:a.value})},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(i.returnPeriod,{isPlus:!0,isFixed:!0}),{repeat:5})),7),o.changeRate?(r.openBlock(),r.createBlock(r.unref(Yd),{key:0,percentage:"",class:"return-widget__total-wrapper__chips",isHidden:t.isMask,delta:i.changeRate},null,8,["isHidden","delta"])):r.createCommentVNode("",!0)])]),r.createElementVNode("div",BE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock("div",PE,[r.createElementVNode("div",NE,r.toDisplayString(f.title),1),AE,r.createElementVNode("div",{class:r.normalizeClass(["return-widget__point__value",f.class?f.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(f.value,f.options),{repeat:5,prefix:"$"})),3)]))),256))])])]),t.profitFactor?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["return-widget__profit",c.value])},[r.createVNode(r.unref(Le),{icon:"tip",class:"return-widget__profit__icon"}),r.createElementVNode("div",{class:"return-widget__profit__text",innerHTML:u.value},null,8,FE)],2)):r.createCommentVNode("",!0),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:1,onRefresh:p[0]||(p[0]=f=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-174618cb"]]),B6=t=>(r.pushScopeId("data-v-fca156a0"),t=t(),r.popScopeId(),t),RE={class:"top-positions-widget"},HE={class:"top-positions-widget__top"},IE={class:"top-positions-widget__title-wrapper"},jE=B6(()=>r.createElementVNode("div",{class:"top-positions-widget__title"},"Top Positions",-1)),ZE={key:0,class:"top-positions-widget__returns"},YE=["onClick"],WE={class:"top-positions-widget__return__left"},UE=B6(()=>r.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),qE={class:"top-positions-widget__return__pair"},GE={class:"top-positions-widget__return__right"},XE={class:"top-positions-widget__return__pnl"},KE=ve({__name:"TopPositionsWidget",props:{topPositions:{type:Array,default:[]},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh","onPairClick"],setup(t,{emit:e}){r.ref("week");const n=e;return(o,a)=>(r.openBlock(),r.createElementBlock("div",RE,[r.createElementVNode("div",HE,[r.createElementVNode("div",IE,[jE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Helps you find the top profitable positions. We calculate only net PNL, taking into account commission and funding. ")]),_:1})])]),t.topPositions&&t.topPositions.length?(r.openBlock(),r.createElementBlock("div",ZE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.topPositions,i=>(r.openBlock(),r.createElementBlock("div",{class:"top-positions-widget__return",onClick:s=>n("onPairClick",i)},[r.createElementVNode("div",WE,[UE,r.createElementVNode("div",qE,[r.createTextVNode(r.toDisplayString(r.unref(cr)(i.pair))+" ",1),r.createVNode(r.unref(Le),{icon:"chevron-right-small"})])]),r.createElementVNode("div",GE,[r.createElementVNode("div",XE,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(i.pnl,{isFixed:!0,isPlus:!0},{repeat:5}))),1),r.createElementVNode("div",{class:r.normalizeClass(["top-positions-widget__return__roi",i.roi<0?"-negative":"-positive"])},[r.createVNode(r.unref(Le),{icon:"bxs_up-arrow"}),r.createElementVNode("span",null,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(i.roi,{isPercentage:!0,isFixed:!0},{repeat:2}))),1)],2)])],8,YE))),256))])):(r.openBlock(),r.createBlock(r.unref(ko),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:a[0]||(a[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-fca156a0"]]),Ou=t=>(r.pushScopeId("data-v-a3559196"),t=t(),r.popScopeId(),t),QE={class:"trade-widget"},JE={class:"trade-widget__content"},eT={class:"trade-widget__top"},tT={class:"trade-widget__title-wrapper"},nT=Ou(()=>r.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),oT={class:"trade-widget__info"},aT={class:"trade-widget__total-wrapper"},rT=Ou(()=>r.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),iT={class:"trade-widget__total-wrapper__total"},sT={class:"trade-widget__total-wrapper__value"},lT={class:"trade-widget__points"},dT={class:"trade-widget__point"},cT={class:"trade-widget__point__title"},uT=Ou(()=>r.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),hT=ve({__name:"TradePerformanceWidget",props:{totalTrades:Number,minDate:Date,tradePoints:Array,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=r.reactive({totalTrades:0}),o=e,a=t;return r.watch(()=>a.totalTrades,i=>{$o.to(n,{duration:1.5,totalTrades:i})},{immediate:!0}),(i,s)=>(r.openBlock(),r.createElementBlock("div",QE,[r.createElementVNode("div",JE,[r.createElementVNode("div",eT,[r.createElementVNode("div",tT,[nT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("It displays the number of profitable and unprofitable positions. This widget is very useful for understanding your trading opportunities. ")]),_:1})])]),r.createElementVNode("div",oT,[r.createElementVNode("div",aT,[rT,r.createElementVNode("div",iT,[r.createElementVNode("div",sT,r.toDisplayString(r.unref(_e)(t.isMask,Math.floor(n.totalTrades),{repeat:5})),1)])]),r.createElementVNode("div",lT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tradePoints,l=>(r.openBlock(),r.createElementBlock("div",dT,[r.createElementVNode("div",cT,r.toDisplayString(l.title),1),uT,r.createElementVNode("div",{class:r.normalizeClass(["trade-widget__point__value",l.class?l.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,l.value,{repeat:5})),3)]))),256))])])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:s[0]||(s[0]=l=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-a3559196"]]),Bu=t=>(r.pushScopeId("data-v-6e6e0081"),t=t(),r.popScopeId(),t),pT={class:"winrate-widget"},fT={class:"winrate-widget__winrate"},mT={class:"winrate-widget__title-wrapper"},_T=Bu(()=>r.createElementVNode("div",{class:"winrate-widget__title"},"Winrate",-1)),gT={class:"winrate-widget__chart"},bT={class:"winrate-widget__data"},yT={class:"winrate-widget__data_value"},wT=Bu(()=>r.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),vT={class:"winrate-widget__average-rr"},xT={class:"winrate-widget__title-wrapper"},kT=Bu(()=>r.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),CT=ve({__name:"WinrateWidget",props:{winrate:{type:Number,default:0},minRR:{type:Number,default:0},averageRR:{type:Number,default:0},maxRR:{type:Number,default:0},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e;return(o,a)=>(r.openBlock(),r.createElementBlock("div",pT,[r.createElementVNode("div",fT,[r.createElementVNode("div",mT,[_T,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Displays the percentage of your successful positions. ")]),_:1})]),r.createElementVNode("div",gT,[r.renderSlot(o.$slots,"roundSlider",{},void 0,!0),r.createElementVNode("div",bT,[r.createElementVNode("div",yT,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(at)(t.winrate,2)))+"% ",1),wT])])]),r.createElementVNode("div",vT,[r.createElementVNode("div",xT,[kT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Risk Reward, defines the ratio of potential profit to loss you can get. ")]),_:1})]),r.createVNode(r.unref(y_),{avg:t.averageRR,min:t.minRR,max:t.maxRR,isMask:t.isMask},null,8,["avg","min","max","isMask"])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:a[0]||(a[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-6e6e0081"]]),P6=t=>(r.pushScopeId("data-v-c120856a"),t=t(),r.popScopeId(),t),MT={class:"oh-widget"},ST={class:"oh-widget__top"},LT={class:"oh-widget__title-wrapper"},$T=P6(()=>r.createElementVNode("div",{class:"oh-widget__title"},"Result by Open Hour",-1)),DT={key:0},VT={key:1,class:"oh-widget__table-wrapper"},ET={class:"oh-widget__list"},TT=P6(()=>r.createElementVNode("thead",{class:"oh-widget__list__header"},[r.createElementVNode("th",null,"Time"),r.createElementVNode("th",null,"Trades"),r.createElementVNode("th",null,"Result")],-1)),OT={class:"oh-widget__list__body"},BT={class:"oh-widget__list__point"},PT={class:"oh-widget__list__subpoint"},NT={class:"oh-widget__list__subpoint"},AT=ve({__name:"OpenHourWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=[{id:0,name:"Asia",key:"asia_session"},{id:1,name:"London",key:"london_session"},{id:2,name:"NY",key:"new_york_session"}],o=t,a=e,i=r.ref(!1),s=r.ref({id:0,name:"Asia",key:"asia_session"}),l=r.computed(()=>o.results?o.results[s.value.key]:{}),d=r.computed(()=>{const p=Object.values(l.value).slice(0,10).map(_=>_.net_pnl_total*dr()),f=Object.values(l.value).slice(0,10).map(_=>_.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(l.value).slice(0,10).map(_=>c(_)),datasets:[{data:p,backgroundColor:f,borderRadius:4}]}}),c=p=>{const[f,_]=p.split(":").map(Number),g=`${f}:59`;return`${p} - ${g}`},u=()=>{i.value=!i.value},h=(p,f)=>f[p];return(p,f)=>(r.openBlock(),r.createElementBlock("div",MT,[r.createElementVNode("div",ST,[r.createElementVNode("div",LT,[$T,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Analyze your trading performance based on the hour of the day and trading session. Switch between different time zones to track results by market. ")]),_:1})]),i.value?(r.openBlock(),r.createBlock(r.unref(Cn),{key:0,class:"oh-widget__btn",view:"secondary",icon:"list",size:"sm",onClick:u})):(r.openBlock(),r.createBlock(r.unref(Cn),{key:1,class:"oh-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:u}))]),r.createElementVNode("div",{class:r.normalizeClass(["oh-widget__content",{"-chart-active":i.value}])},[r.createVNode(r.unref(Pc),{class:"oh-widget__switcher",modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=_=>s.value=_),options:n},null,8,["modelValue"]),l.value&&Object.values(l.value).length?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.value?(r.openBlock(),r.createElementBlock("div",DT,[r.createVNode(td,{class:"oh-widget__bar",data:d.value,"ticks-callback":h,"y-ticks-callback":r.unref(si),"is-mask":t.isMask,"data-type":"oh"},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",VT,[r.createElementVNode("table",ET,[TT,r.createElementVNode("tbody",OT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(_,m,g)=>(r.openBlock(),r.createElementBlock("tr",BT,[r.createElementVNode("td",PT,r.toDisplayString(c(m)),1),r.createElementVNode("td",NT,r.toDisplayString(r.unref(_e)(t.isMask,_.trades_count,{repeat:3})),1),r.createElementVNode("td",{class:r.normalizeClass(["oh-widget__list__subpoint",{"-positive":_.net_pnl_total>0,"-negative":_.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(_.net_pnl_total,{isPlus:!0,isFixed:!0}),{repeat:3})),3)]))),256))])])]))],64)):(r.openBlock(),r.createBlock(ko,{key:1,absolute:""}))],2),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:f[1]||(f[1]=_=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-c120856a"]]),N6=t=>(r.pushScopeId("data-v-397d63e3"),t=t(),r.popScopeId(),t),FT={class:"duration-widget"},zT={class:"duration-widget__top"},RT={class:"duration-widget__title-wrapper"},HT=N6(()=>r.createElementVNode("div",{class:"duration-widget__title"},"Result by time duration",-1)),IT={key:0},jT={key:1,class:"duration-widget__list"},ZT=N6(()=>r.createElementVNode("thead",{class:"duration-widget__list__header"},[r.createElementVNode("th",null,"Time"),r.createElementVNode("th",null,"Trades"),r.createElementVNode("th",null,"Result")],-1)),YT={class:"duration-widget__list__body"},WT={class:"duration-widget__list__point"},UT={class:"duration-widget__list__subpoint"},qT={class:"duration-widget__list__subpoint"},GT=ve({__name:"DurationWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=t,o=e,a=r.ref(!1),i=r.computed(()=>{const c=Object.values(n.results).slice(0,10).map(h=>h.net_pnl_total*dr()),u=Object.values(n.results).slice(0,10).map(h=>h.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(n.results).slice(0,10).map(h=>s(Number(h))),datasets:[{data:c,backgroundColor:u,borderRadius:4}]}});function s(c){const u=[{min:0,max:30,label:"0-30m"},{min:30,max:60,label:"30m - 1h"},{min:60,max:240,label:"1-4h"},{min:240,max:480,label:"4-12h"},{min:480,max:1440,label:"12-24h"},{min:1440,max:4320,label:"1-3d"},{min:4320,max:10080,label:"3-7d"},{min:10080,max:1/0,label:"7d+"}];for(const h of u)if(c>=h.min&&c<h.max)return h.label;return"Invalid input"}const l=()=>{a.value=!a.value},d=(c,u)=>u[c];return(c,u)=>(r.openBlock(),r.createElementBlock("div",FT,[r.createElementVNode("div",zT,[r.createElementVNode("div",RT,[HT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("See how your trades perform based on their duration. Filter by time intervals to identify patterns in short or long-term trades. ")]),_:1})]),a.value?(r.openBlock(),r.createBlock(r.unref(Cn),{key:0,class:"duration-widget__btn",view:"secondary",icon:"list",size:"sm",onClick:l})):(r.openBlock(),r.createBlock(r.unref(Cn),{key:1,class:"duration-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:l}))]),t.results&&Object.values(t.results).length?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["duration-widget__content",{"-chart-active":a.value}])},[a.value?(r.openBlock(),r.createElementBlock("div",IT,[r.createVNode(td,{class:"duration-widget__bar",data:i.value,"ticks-callback":d,"y-ticks-callback":r.unref(si),"data-type":"duration","is-mask":t.isMask},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("table",jT,[ZT,r.createElementVNode("tbody",YT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.results,(h,p,f)=>(r.openBlock(),r.createElementBlock("tr",WT,[r.createElementVNode("td",UT,r.toDisplayString(s(Number(p))),1),r.createElementVNode("td",qT,r.toDisplayString(r.unref(_e)(t.isMask,h.trades_count,{repeat:3})),1),r.createElementVNode("td",{class:r.normalizeClass(["duration-widget__list__subpoint",{"-positive":h.net_pnl_total>0,"-negative":h.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(h.net_pnl_total,{isPlus:!0,isFixed:!0}),{repeat:3})),3)]))),256))])]))],2)):(r.openBlock(),r.createBlock(ko,{key:1,absolute:""})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:u[0]||(u[0]=h=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-397d63e3"]]);class rr extends Error{}class XT extends rr{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class KT extends rr{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class QT extends rr{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ur extends rr{}class A6 extends rr{constructor(e){super(`Invalid unit ${e}`)}}class jt extends rr{}class ma extends rr{constructor(){super("Zone is an abstract class")}}const le="numeric",Wn="short",vn="long",nd={year:le,month:le,day:le},F6={year:le,month:Wn,day:le},JT={year:le,month:Wn,day:le,weekday:Wn},z6={year:le,month:vn,day:le},R6={year:le,month:vn,day:le,weekday:vn},H6={hour:le,minute:le},I6={hour:le,minute:le,second:le},j6={hour:le,minute:le,second:le,timeZoneName:Wn},Z6={hour:le,minute:le,second:le,timeZoneName:vn},Y6={hour:le,minute:le,hourCycle:"h23"},W6={hour:le,minute:le,second:le,hourCycle:"h23"},U6={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:Wn},q6={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:vn},G6={year:le,month:le,day:le,hour:le,minute:le},X6={year:le,month:le,day:le,hour:le,minute:le,second:le},K6={year:le,month:Wn,day:le,hour:le,minute:le},Q6={year:le,month:Wn,day:le,hour:le,minute:le,second:le},eO={year:le,month:Wn,day:le,weekday:Wn,hour:le,minute:le},J6={year:le,month:vn,day:le,hour:le,minute:le,timeZoneName:Wn},em={year:le,month:vn,day:le,hour:le,minute:le,second:le,timeZoneName:Wn},tm={year:le,month:vn,day:le,weekday:vn,hour:le,minute:le,timeZoneName:vn},nm={year:le,month:vn,day:le,weekday:vn,hour:le,minute:le,second:le,timeZoneName:vn};class ms{get type(){throw new ma}get name(){throw new ma}get ianaName(){return this.name}get isUniversal(){throw new ma}offsetName(e,n){throw new ma}formatOffset(e,n){throw new ma}offset(e){throw new ma}equals(e){throw new ma}get isValid(){throw new ma}}let Pu=null;class od extends ms{static get instance(){return Pu===null&&(Pu=new od),Pu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:o}){return Lm(e,n,o)}formatOffset(e,n){return ys(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ad={};function tO(t){return ad[t]||(ad[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ad[t]}const nO={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function oO(t,e){const n=t.format(e).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,i,s,l,d,c,u]=o;return[s,a,i,l,d,c,u]}function aO(t,e){const n=t.formatToParts(e),o=[];for(let a=0;a<n.length;a++){const{type:i,value:s}=n[a],l=nO[i];i==="era"?o[l]=s:we(l)||(o[l]=parseInt(s,10))}return o}let rd={};class No extends ms{static create(e){return rd[e]||(rd[e]=new No(e)),rd[e]}static resetCache(){rd={},ad={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=No.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:o}){return Lm(e,n,o,this.name)}formatOffset(e,n){return ys(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const o=tO(this.name);let[a,i,s,l,d,c,u]=o.formatToParts?aO(o,n):oO(o,n);l==="BC"&&(a=-Math.abs(a)+1);const p=cd({year:a,month:i,day:s,hour:d===24?0:d,minute:c,second:u,millisecond:0});let f=+n;const _=f%1e3;return f-=_>=0?_:1e3+_,(p-f)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let om={};function rO(t,e={}){const n=JSON.stringify([t,e]);let o=om[n];return o||(o=new Intl.ListFormat(t,e),om[n]=o),o}let Nu={};function Au(t,e={}){const n=JSON.stringify([t,e]);let o=Nu[n];return o||(o=new Intl.DateTimeFormat(t,e),Nu[n]=o),o}let Fu={};function iO(t,e={}){const n=JSON.stringify([t,e]);let o=Fu[n];return o||(o=new Intl.NumberFormat(t,e),Fu[n]=o),o}let zu={};function sO(t,e={}){const{base:n,...o}=e,a=JSON.stringify([t,o]);let i=zu[a];return i||(i=new Intl.RelativeTimeFormat(t,e),zu[a]=i),i}let _s=null;function lO(){return _s||(_s=new Intl.DateTimeFormat().resolvedOptions().locale,_s)}let am={};function dO(t){let e=am[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,am[t]=e}return e}function cO(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let o,a;try{o=Au(t).resolvedOptions(),a=t}catch{const d=t.substring(0,n);o=Au(d).resolvedOptions(),a=d}const{numberingSystem:i,calendar:s}=o;return[a,i,s]}}function uO(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function hO(t){const e=[];for(let n=1;n<=12;n++){const o=be.utc(2009,n,1);e.push(t(o))}return e}function pO(t){const e=[];for(let n=1;n<=7;n++){const o=be.utc(2016,11,13+n);e.push(t(o))}return e}function id(t,e,n,o){const a=t.listingMode();return a==="error"?null:a==="en"?n(e):o(e)}function fO(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class mO{constructor(e,n,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;const{padTo:a,floor:i,...s}=o;if(!n||Object.keys(s).length>0){const l={useGrouping:!1,...o};o.padTo>0&&(l.minimumIntegerDigits=o.padTo),this.inf=iO(e,l)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):Uu(e,3);return St(n,this.padTo)}}}class _O{constructor(e,n,o){this.opts=o,this.originalZone=void 0;let a;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const s=-1*(e.offset/60),l=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&No.create(l).valid?(a=l,this.dt=e):(a="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,a=e.zone.name):(a="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||a,this.dtf=Au(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:o}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class gO{constructor(e,n,o){this.opts={style:"long",...o},!n&&km()&&(this.rtf=sO(e,o))}format(e,n){return this.rtf?this.rtf.format(e,n):RO(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const bO={firstDay:1,minimalDays:4,weekend:[6,7]};let Ke=class Is{static fromOpts(e){return Is.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,o,a,i=!1){const s=e||ft.defaultLocale,l=s||(i?"en-US":lO()),d=n||ft.defaultNumberingSystem,c=o||ft.defaultOutputCalendar,u=Yu(a)||ft.defaultWeekSettings;return new Is(l,d,c,u,s)}static resetCache(){_s=null,Nu={},Fu={},zu={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:o,weekSettings:a}={}){return Is.create(e,n,o,a)}constructor(e,n,o,a,i){const[s,l,d]=cO(e);this.locale=s,this.numberingSystem=n||l||null,this.outputCalendar=o||d||null,this.weekSettings=a,this.intl=uO(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=fO(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Is.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Yu(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return id(this,e,Vm,()=>{const o=n?{month:e,day:"numeric"}:{month:e},a=n?"format":"standalone";return this.monthsCache[a][e]||(this.monthsCache[a][e]=hO(i=>this.extract(i,o,"month"))),this.monthsCache[a][e]})}weekdays(e,n=!1){return id(this,e,Om,()=>{const o=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},a=n?"format":"standalone";return this.weekdaysCache[a][e]||(this.weekdaysCache[a][e]=pO(i=>this.extract(i,o,"weekday"))),this.weekdaysCache[a][e]})}meridiems(){return id(this,void 0,()=>Bm,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[be.utc(2016,11,13,9),be.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return id(this,e,Pm,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[be.utc(-40,1,1),be.utc(2017,1,1)].map(o=>this.extract(o,n,"era"))),this.eraCache[e]})}extract(e,n,o){const a=this.dtFormatter(e,n),i=a.formatToParts(),s=i.find(l=>l.type.toLowerCase()===o);return s?s.value:null}numberFormatter(e={}){return new mO(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new _O(e,this.intl,n)}relFormatter(e={}){return new gO(this.intl,this.isEnglish(),e)}listFormatter(e={}){return rO(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Cm()?dO(this.locale):bO}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Ru=null;class Kt extends ms{static get utcInstance(){return Ru===null&&(Ru=new Kt(0)),Ru}static instance(e){return e===0?Kt.utcInstance:new Kt(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Kt(ud(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ys(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ys(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return ys(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class yO extends ms{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function _a(t,e){if(we(t)||t===null)return e;if(t instanceof ms)return t;if(MO(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?od.instance:n==="utc"||n==="gmt"?Kt.utcInstance:Kt.parseSpecifier(n)||No.create(t)}else return ga(t)?Kt.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new yO(t)}const Hu={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},rm={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},wO=Hu.hanidec.replace(/[\[|\]]/g,"").split("");function vO(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(t[n].search(Hu.hanidec)!==-1)e+=wO.indexOf(t[n]);else for(const a in rm){const[i,s]=rm[a];o>=i&&o<=s&&(e+=o-i)}}return parseInt(e,10)}else return e}let qr={};function xO(){qr={}}function Un({numberingSystem:t},e=""){const n=t||"latn";return qr[n]||(qr[n]={}),qr[n][e]||(qr[n][e]=new RegExp(`${Hu[n]}${e}`)),qr[n][e]}let im=()=>Date.now(),sm="system",lm=null,dm=null,cm=null,um=60,hm,pm=null;class ft{static get now(){return im}static set now(e){im=e}static set defaultZone(e){sm=e}static get defaultZone(){return _a(sm,od.instance)}static get defaultLocale(){return lm}static set defaultLocale(e){lm=e}static get defaultNumberingSystem(){return dm}static set defaultNumberingSystem(e){dm=e}static get defaultOutputCalendar(){return cm}static set defaultOutputCalendar(e){cm=e}static get defaultWeekSettings(){return pm}static set defaultWeekSettings(e){pm=Yu(e)}static get twoDigitCutoffYear(){return um}static set twoDigitCutoffYear(e){um=e%100}static get throwOnInvalid(){return hm}static set throwOnInvalid(e){hm=e}static resetCaches(){Ke.resetCache(),No.resetCache(),be.resetCache(),xO()}}class qn{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const fm=[0,31,59,90,120,151,181,212,243,273,304,334],mm=[0,31,60,91,121,152,182,213,244,274,305,335];function En(t,e){return new qn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Iu(t,e,n){const o=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&o.setUTCFullYear(o.getUTCFullYear()-1900);const a=o.getUTCDay();return a===0?7:a}function _m(t,e,n){return n+(gs(t)?mm:fm)[e-1]}function gm(t,e){const n=gs(t)?mm:fm,o=n.findIndex(i=>i<e),a=e-n[o];return{month:o+1,day:a}}function ju(t,e){return(t-e+7)%7+1}function sd(t,e=4,n=1){const{year:o,month:a,day:i}=t,s=_m(o,a,i),l=ju(Iu(o,a,i),n);let d=Math.floor((s-l+14-e)/7),c;return d<1?(c=o-1,d=bs(c,e,n)):d>bs(o,e,n)?(c=o+1,d=1):c=o,{weekYear:c,weekNumber:d,weekday:l,...pd(t)}}function bm(t,e=4,n=1){const{weekYear:o,weekNumber:a,weekday:i}=t,s=ju(Iu(o,1,e),n),l=Xr(o);let d=a*7+i-s-7+e,c;d<1?(c=o-1,d+=Xr(c)):d>l?(c=o+1,d-=Xr(o)):c=o;const{month:u,day:h}=gm(c,d);return{year:c,month:u,day:h,...pd(t)}}function Zu(t){const{year:e,month:n,day:o}=t,a=_m(e,n,o);return{year:e,ordinal:a,...pd(t)}}function ym(t){const{year:e,ordinal:n}=t,{month:o,day:a}=gm(e,n);return{year:e,month:o,day:a,...pd(t)}}function wm(t,e){if(!we(t.localWeekday)||!we(t.localWeekNumber)||!we(t.localWeekYear)){if(!we(t.weekday)||!we(t.weekNumber)||!we(t.weekYear))throw new Ur("Cannot mix locale-based week fields with ISO-based week fields");return we(t.localWeekday)||(t.weekday=t.localWeekday),we(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),we(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function kO(t,e=4,n=1){const o=ld(t.weekYear),a=Tn(t.weekNumber,1,bs(t.weekYear,e,n)),i=Tn(t.weekday,1,7);return o?a?i?!1:En("weekday",t.weekday):En("week",t.weekNumber):En("weekYear",t.weekYear)}function CO(t){const e=ld(t.year),n=Tn(t.ordinal,1,Xr(t.year));return e?n?!1:En("ordinal",t.ordinal):En("year",t.year)}function vm(t){const e=ld(t.year),n=Tn(t.month,1,12),o=Tn(t.day,1,dd(t.year,t.month));return e?n?o?!1:En("day",t.day):En("month",t.month):En("year",t.year)}function xm(t){const{hour:e,minute:n,second:o,millisecond:a}=t,i=Tn(e,0,23)||e===24&&n===0&&o===0&&a===0,s=Tn(n,0,59),l=Tn(o,0,59),d=Tn(a,0,999);return i?s?l?d?!1:En("millisecond",a):En("second",o):En("minute",n):En("hour",e)}function we(t){return typeof t>"u"}function ga(t){return typeof t=="number"}function ld(t){return typeof t=="number"&&t%1===0}function MO(t){return typeof t=="string"}function SO(t){return Object.prototype.toString.call(t)==="[object Date]"}function km(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Cm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function LO(t){return Array.isArray(t)?t:[t]}function Mm(t,e,n){if(t.length!==0)return t.reduce((o,a)=>{const i=[e(a),a];return o&&n(o[0],i[0])===o[0]?o:i},null)[1]}function $O(t,e){return e.reduce((n,o)=>(n[o]=t[o],n),{})}function Gr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Yu(t){if(t==null)return null;if(typeof t!="object")throw new jt("Week settings must be an object");if(!Tn(t.firstDay,1,7)||!Tn(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Tn(e,1,7)))throw new jt("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Tn(t,e,n){return ld(t)&&t>=e&&t<=n}function DO(t,e){return t-e*Math.floor(t/e)}function St(t,e=2){const n=t<0;let o;return n?o="-"+(""+-t).padStart(e,"0"):o=(""+t).padStart(e,"0"),o}function ba(t){if(!(we(t)||t===null||t===""))return parseInt(t,10)}function ir(t){if(!(we(t)||t===null||t===""))return parseFloat(t)}function Wu(t){if(!(we(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Uu(t,e,n=!1){const o=10**e;return(n?Math.trunc:Math.round)(t*o)/o}function gs(t){return t%4===0&&(t%100!==0||t%400===0)}function Xr(t){return gs(t)?366:365}function dd(t,e){const n=DO(e-1,12)+1,o=t+(e-n)/12;return n===2?gs(o)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function cd(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Sm(t,e,n){return-ju(Iu(t,1,e),n)+e-1}function bs(t,e=4,n=1){const o=Sm(t,e,n),a=Sm(t+1,e,n);return(Xr(t)-o+a)/7}function qu(t){return t>99?t:t>ft.twoDigitCutoffYear?1900+t:2e3+t}function Lm(t,e,n,o=null){const a=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(i.timeZone=o);const s={timeZoneName:e,...i},l=new Intl.DateTimeFormat(n,s).formatToParts(a).find(d=>d.type.toLowerCase()==="timezonename");return l?l.value:null}function ud(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const o=parseInt(e,10)||0,a=n<0||Object.is(n,-0)?-o:o;return n*60+a}function $m(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new jt(`Invalid unit value ${t}`);return e}function hd(t,e){const n={};for(const o in t)if(Gr(t,o)){const a=t[o];if(a==null)continue;n[e(o)]=$m(a)}return n}function ys(t,e){const n=Math.trunc(Math.abs(t/60)),o=Math.trunc(Math.abs(t%60)),a=t>=0?"+":"-";switch(e){case"short":return`${a}${St(n,2)}:${St(o,2)}`;case"narrow":return`${a}${n}${o>0?`:${o}`:""}`;case"techie":return`${a}${St(n,2)}${St(o,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function pd(t){return $O(t,["hour","minute","second","millisecond"])}const VO=["January","February","March","April","May","June","July","August","September","October","November","December"],Dm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],EO=["J","F","M","A","M","J","J","A","S","O","N","D"];function Vm(t){switch(t){case"narrow":return[...EO];case"short":return[...Dm];case"long":return[...VO];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Em=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Tm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],TO=["M","T","W","T","F","S","S"];function Om(t){switch(t){case"narrow":return[...TO];case"short":return[...Tm];case"long":return[...Em];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Bm=["AM","PM"],OO=["Before Christ","Anno Domini"],BO=["BC","AD"],PO=["B","A"];function Pm(t){switch(t){case"narrow":return[...PO];case"short":return[...BO];case"long":return[...OO];default:return null}}function NO(t){return Bm[t.hour<12?0:1]}function AO(t,e){return Om(e)[t.weekday-1]}function FO(t,e){return Vm(e)[t.month-1]}function zO(t,e){return Pm(e)[t.year<0?0:1]}function RO(t,e,n="always",o=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&i){const h=t==="days";switch(e){case 1:return h?"tomorrow":`next ${a[t][0]}`;case-1:return h?"yesterday":`last ${a[t][0]}`;case 0:return h?"today":`this ${a[t][0]}`}}const s=Object.is(e,-0)||e<0,l=Math.abs(e),d=l===1,c=a[t],u=o?d?c[1]:c[2]||c[1]:d?a[t][0]:t;return s?`${l} ${u} ago`:`in ${l} ${u}`}function Nm(t,e){let n="";for(const o of t)o.literal?n+=o.val:n+=e(o.val);return n}const HO={D:nd,DD:F6,DDD:z6,DDDD:R6,t:H6,tt:I6,ttt:j6,tttt:Z6,T:Y6,TT:W6,TTT:U6,TTTT:q6,f:G6,ff:K6,fff:J6,ffff:tm,F:X6,FF:Q6,FFF:em,FFFF:nm};class Zt{static create(e,n={}){return new Zt(e,n)}static parseFormat(e){let n=null,o="",a=!1;const i=[];for(let s=0;s<e.length;s++){const l=e.charAt(s);l==="'"?(o.length>0&&i.push({literal:a||/^\s+$/.test(o),val:o}),n=null,o="",a=!a):a||l===n?o+=l:(o.length>0&&i.push({literal:/^\s+$/.test(o),val:o}),o=l,n=l)}return o.length>0&&i.push({literal:a||/^\s+$/.test(o),val:o}),i}static macroTokenToFormatOpts(e){return HO[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return St(e,n);const o={...this.opts};return n>0&&(o.padTo=n),this.loc.numberFormatter(o).format(e)}formatDateTimeFromString(e,n){const o=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(f,_)=>this.loc.extract(e,f,_),s=f=>e.isOffsetFixed&&e.offset===0&&f.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,f.format):"",l=()=>o?NO(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),d=(f,_)=>o?FO(e,f):i(_?{month:f}:{month:f,day:"numeric"},"month"),c=(f,_)=>o?AO(e,f):i(_?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),u=f=>{const _=Zt.macroTokenToFormatOpts(f);return _?this.formatWithSystemDefault(e,_):f},h=f=>o?zO(e,f):i({era:f},"era"),p=f=>{switch(f){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return a?i({day:"numeric"},"day"):this.num(e.day);case"dd":return a?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return a?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return a?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return d("short",!0);case"LLLL":return d("long",!0);case"LLLLL":return d("narrow",!0);case"M":return a?i({month:"numeric"},"month"):this.num(e.month);case"MM":return a?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return d("short",!1);case"MMMM":return d("long",!1);case"MMMMM":return d("narrow",!1);case"y":return a?i({year:"numeric"},"year"):this.num(e.year);case"yy":return a?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return a?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return a?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(f)}};return Nm(Zt.parseFormat(n),p)}formatDurationFromString(e,n){const o=d=>{switch(d[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},a=d=>c=>{const u=o(c);return u?this.num(d.get(u),c.length):c},i=Zt.parseFormat(n),s=i.reduce((d,{literal:c,val:u})=>c?d:d.concat(u),[]),l=e.shiftTo(...s.map(o).filter(d=>d));return Nm(i,a(l))}}const Am=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Kr(...t){const e=t.reduce((n,o)=>n+o.source,"");return RegExp(`^${e}$`)}function Qr(...t){return e=>t.reduce(([n,o,a],i)=>{const[s,l,d]=i(e,a);return[{...n,...s},l||o,d]},[{},null,1]).slice(0,2)}function Jr(t,...e){if(t==null)return[null,null];for(const[n,o]of e){const a=n.exec(t);if(a)return o(a)}return[null,null]}function Fm(...t){return(e,n)=>{const o={};let a;for(a=0;a<t.length;a++)o[t[a]]=ba(e[n+a]);return[o,null,n+a]}}const zm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,IO=`(?:${zm.source}?(?:\\[(${Am.source})\\])?)?`,Gu=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Rm=RegExp(`${Gu.source}${IO}`),Xu=RegExp(`(?:T${Rm.source})?`),jO=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ZO=/(\d{4})-?W(\d\d)(?:-?(\d))?/,YO=/(\d{4})-?(\d{3})/,WO=Fm("weekYear","weekNumber","weekDay"),UO=Fm("year","ordinal"),qO=/(\d{4})-(\d\d)-(\d\d)/,Hm=RegExp(`${Gu.source} ?(?:${zm.source}|(${Am.source}))?`),GO=RegExp(`(?: ${Hm.source})?`);function ei(t,e,n){const o=t[e];return we(o)?n:ba(o)}function XO(t,e){return[{year:ei(t,e),month:ei(t,e+1,1),day:ei(t,e+2,1)},null,e+3]}function ti(t,e){return[{hours:ei(t,e,0),minutes:ei(t,e+1,0),seconds:ei(t,e+2,0),milliseconds:Wu(t[e+3])},null,e+4]}function ws(t,e){const n=!t[e]&&!t[e+1],o=ud(t[e+1],t[e+2]),a=n?null:Kt.instance(o);return[{},a,e+3]}function vs(t,e){const n=t[e]?No.create(t[e]):null;return[{},n,e+1]}const KO=RegExp(`^T?${Gu.source}$`),QO=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function JO(t){const[e,n,o,a,i,s,l,d,c]=t,u=e[0]==="-",h=d&&d[0]==="-",p=(f,_=!1)=>f!==void 0&&(_||f&&u)?-f:f;return[{years:p(ir(n)),months:p(ir(o)),weeks:p(ir(a)),days:p(ir(i)),hours:p(ir(s)),minutes:p(ir(l)),seconds:p(ir(d),d==="-0"),milliseconds:p(Wu(c),h)}]}const eB={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ku(t,e,n,o,a,i,s){const l={year:e.length===2?qu(ba(e)):ba(e),month:Dm.indexOf(n)+1,day:ba(o),hour:ba(a),minute:ba(i)};return s&&(l.second=ba(s)),t&&(l.weekday=t.length>3?Em.indexOf(t)+1:Tm.indexOf(t)+1),l}const tB=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function nB(t){const[,e,n,o,a,i,s,l,d,c,u,h]=t,p=Ku(e,a,o,n,i,s,l);let f;return d?f=eB[d]:c?f=0:f=ud(u,h),[p,new Kt(f)]}function oB(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const aB=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rB=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,iB=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Im(t){const[,e,n,o,a,i,s,l]=t;return[Ku(e,a,o,n,i,s,l),Kt.utcInstance]}function sB(t){const[,e,n,o,a,i,s,l]=t;return[Ku(e,l,n,o,a,i,s),Kt.utcInstance]}const lB=Kr(jO,Xu),dB=Kr(ZO,Xu),cB=Kr(YO,Xu),uB=Kr(Rm),jm=Qr(XO,ti,ws,vs),hB=Qr(WO,ti,ws,vs),pB=Qr(UO,ti,ws,vs),fB=Qr(ti,ws,vs);function mB(t){return Jr(t,[lB,jm],[dB,hB],[cB,pB],[uB,fB])}function _B(t){return Jr(oB(t),[tB,nB])}function gB(t){return Jr(t,[aB,Im],[rB,Im],[iB,sB])}function bB(t){return Jr(t,[QO,JO])}const yB=Qr(ti);function wB(t){return Jr(t,[KO,yB])}const vB=Kr(qO,GO),xB=Kr(Hm),kB=Qr(ti,ws,vs);function CB(t){return Jr(t,[vB,jm],[xB,kB])}const Zm="Invalid Duration",Ym={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},MB={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Ym},On=146097/400,ni=146097/4800,SB={years:{quarters:4,months:12,weeks:On/7,days:On,hours:On*24,minutes:On*24*60,seconds:On*24*60*60,milliseconds:On*24*60*60*1e3},quarters:{months:3,weeks:On/28,days:On/4,hours:On*24/4,minutes:On*24*60/4,seconds:On*24*60*60/4,milliseconds:On*24*60*60*1e3/4},months:{weeks:ni/7,days:ni,hours:ni*24,minutes:ni*24*60,seconds:ni*24*60*60,milliseconds:ni*24*60*60*1e3},...Ym},sr=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],LB=sr.slice(0).reverse();function ya(t,e,n=!1){const o={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Yt(o)}function Wm(t,e){let n=e.milliseconds??0;for(const o of LB.slice(1))e[o]&&(n+=e[o]*t[o].milliseconds);return n}function Um(t,e){const n=Wm(t,e)<0?-1:1;sr.reduceRight((o,a)=>{if(we(e[a]))return o;if(o){const i=e[o]*n,s=t[a][o],l=Math.floor(i/s);e[a]+=l*n,e[o]-=l*s*n}return a},null),sr.reduce((o,a)=>{if(we(e[a]))return o;if(o){const i=e[o]%1;e[o]-=i,e[a]+=i*t[o][a]}return a},null)}function $B(t){const e={};for(const[n,o]of Object.entries(t))o!==0&&(e[n]=o);return e}let Yt=class Bt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let o=n?SB:MB;e.matrix&&(o=e.matrix),this.values=e.values,this.loc=e.loc||Ke.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(e,n){return Bt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new jt(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Bt({values:hd(e,Bt.normalizeUnit),loc:Ke.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(ga(e))return Bt.fromMillis(e);if(Bt.isDuration(e))return e;if(typeof e=="object")return Bt.fromObject(e);throw new jt(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[o]=bB(e);return o?Bt.fromObject(o,n):Bt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[o]=wB(e);return o?Bt.fromObject(o,n):Bt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the Duration is invalid");const o=e instanceof qn?e:new qn(e,n);if(ft.throwOnInvalid)throw new QT(o);return new Bt({invalid:o})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new A6(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const o={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Zt.create(this.loc,o).formatDurationFromString(this,e):Zm}toHuman(e={}){if(!this.isValid)return Zm;const n=sr.map(o=>{const a=this.values[o];return we(a)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:o.slice(0,-1)}).format(a)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Uu(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},be.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Wm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=Bt.fromDurationLike(e),o={};for(const a of sr)(Gr(n.values,a)||Gr(this.values,a))&&(o[a]=n.get(a)+this.get(a));return ya(this,{values:o},!0)}minus(e){if(!this.isValid)return this;const n=Bt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const o of Object.keys(this.values))n[o]=$m(e(this.values[o],o));return ya(this,{values:n},!0)}get(e){return this[Bt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...hd(e,Bt.normalizeUnit)};return ya(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:o,matrix:a}={}){const s={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:a,conversionAccuracy:o};return ya(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Um(this.matrix,e),ya(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=$B(this.normalize().shiftToAll().toObject());return ya(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>Bt.normalizeUnit(s));const n={},o={},a=this.toObject();let i;for(const s of sr)if(e.indexOf(s)>=0){i=s;let l=0;for(const c in o)l+=this.matrix[c][s]*o[c],o[c]=0;ga(a[s])&&(l+=a[s]);const d=Math.trunc(l);n[s]=d,o[s]=(l*1e3-d*1e3)/1e3}else ga(a[s])&&(o[s]=a[s]);for(const s in o)o[s]!==0&&(n[i]+=s===i?o[s]:o[s]/this.matrix[i][s]);return Um(this.matrix,n),ya(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return ya(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(o,a){return o===void 0||o===0?a===void 0||a===0:o===a}for(const o of sr)if(!n(this.values[o],e.values[o]))return!1;return!0}};const oi="Invalid Interval";function DB(t,e){return!t||!t.isValid?mt.invalid("missing or invalid start"):!e||!e.isValid?mt.invalid("missing or invalid end"):e<t?mt.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class mt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the Interval is invalid");const o=e instanceof qn?e:new qn(e,n);if(ft.throwOnInvalid)throw new KT(o);return new mt({invalid:o})}static fromDateTimes(e,n){const o=ks(e),a=ks(n),i=DB(o,a);return i??new mt({start:o,end:a})}static after(e,n){const o=Yt.fromDurationLike(n),a=ks(e);return mt.fromDateTimes(a,a.plus(o))}static before(e,n){const o=Yt.fromDurationLike(n),a=ks(e);return mt.fromDateTimes(a.minus(o),a)}static fromISO(e,n){const[o,a]=(e||"").split("/",2);if(o&&a){let i,s;try{i=be.fromISO(o,n),s=i.isValid}catch{s=!1}let l,d;try{l=be.fromISO(a,n),d=l.isValid}catch{d=!1}if(s&&d)return mt.fromDateTimes(i,l);if(s){const c=Yt.fromISO(a,n);if(c.isValid)return mt.after(i,c)}else if(d){const c=Yt.fromISO(o,n);if(c.isValid)return mt.before(l,c)}}return mt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const o=this.start.startOf(e,n);let a;return n?.useLocaleWeeks?a=this.end.reconfigure({locale:o.locale}):a=this.end,a=a.startOf(e,n),Math.floor(a.diff(o,e).get(e))+(a.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?mt.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(ks).filter(s=>this.contains(s)).sort((s,l)=>s.toMillis()-l.toMillis()),o=[];let{s:a}=this,i=0;for(;a<this.e;){const s=n[i]||this.e,l=+s>+this.e?this.e:s;o.push(mt.fromDateTimes(a,l)),a=l,i+=1}return o}splitBy(e){const n=Yt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:o}=this,a=1,i;const s=[];for(;o<this.e;){const l=this.start.plus(n.mapUnits(d=>d*a));i=+l>+this.e?this.e:l,s.push(mt.fromDateTimes(o,i)),o=i,a+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,o=this.e<e.e?this.e:e.e;return n>=o?null:mt.fromDateTimes(n,o)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,o=this.e>e.e?this.e:e.e;return mt.fromDateTimes(n,o)}static merge(e){const[n,o]=e.sort((a,i)=>a.s-i.s).reduce(([a,i],s)=>i?i.overlaps(s)||i.abutsStart(s)?[a,i.union(s)]:[a.concat([i]),s]:[a,s],[[],null]);return o&&n.push(o),n}static xor(e){let n=null,o=0;const a=[],i=e.map(d=>[{time:d.s,type:"s"},{time:d.e,type:"e"}]),s=Array.prototype.concat(...i),l=s.sort((d,c)=>d.time-c.time);for(const d of l)o+=d.type==="s"?1:-1,o===1?n=d.time:(n&&+n!=+d.time&&a.push(mt.fromDateTimes(n,d.time)),n=null);return mt.merge(a)}difference(...e){return mt.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:oi}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=nd,n={}){return this.isValid?Zt.create(this.s.loc.clone(n),e).formatInterval(this):oi}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:oi}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:oi}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:oi}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:oi}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):Yt.invalid(this.invalidReason)}mapEndpoints(e){return mt.fromDateTimes(e(this.s),e(this.e))}}class fd{static hasDST(e=ft.defaultZone){const n=be.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return No.isValidZone(e)}static normalizeZone(e){return _a(e,ft.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:o=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||Ke.create(n,o,i)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:o=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||Ke.create(n,o,i)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:o=null,locObj:a=null}={}){return(a||Ke.create(n,o,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:o=null,locObj:a=null}={}){return(a||Ke.create(n,o,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ke.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Ke.create(n,null,"gregory").eras(e)}static features(){return{relative:km(),localeWeek:Cm()}}}function qm(t,e){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),o=n(e)-n(t);return Math.floor(Yt.fromMillis(o).as("days"))}function VB(t,e,n){const o=[["years",(d,c)=>c.year-d.year],["quarters",(d,c)=>c.quarter-d.quarter+(c.year-d.year)*4],["months",(d,c)=>c.month-d.month+(c.year-d.year)*12],["weeks",(d,c)=>{const u=qm(d,c);return(u-u%7)/7}],["days",qm]],a={},i=t;let s,l;for(const[d,c]of o)n.indexOf(d)>=0&&(s=d,a[d]=c(t,e),l=i.plus(a),l>e?(a[d]--,t=i.plus(a),t>e&&(l=t,a[d]--,t=i.plus(a))):t=l);return[t,a,l,s]}function EB(t,e,n,o){let[a,i,s,l]=VB(t,e,n);const d=e-a,c=n.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);c.length===0&&(s<e&&(s=a.plus({[l]:1})),s!==a&&(i[l]=(i[l]||0)+d/(s-a)));const u=Yt.fromObject(i,o);return c.length>0?Yt.fromMillis(d,o).shiftTo(...c).plus(u):u}const TB="missing Intl.DateTimeFormat.formatToParts support";function Fe(t,e=n=>n){return{regex:t,deser:([n])=>e(vO(n))}}const Gm="[  ]",Xm=new RegExp(Gm,"g");function OB(t){return t.replace(/\./g,"\\.?").replace(Xm,Gm)}function Km(t){return t.replace(/\./g,"").replace(Xm," ").toLowerCase()}function Gn(t,e){return t===null?null:{regex:RegExp(t.map(OB).join("|")),deser:([n])=>t.findIndex(o=>Km(n)===Km(o))+e}}function Qm(t,e){return{regex:t,deser:([,n,o])=>ud(n,o),groups:e}}function md(t){return{regex:t,deser:([e])=>e}}function BB(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function PB(t,e){const n=Un(e),o=Un(e,"{2}"),a=Un(e,"{3}"),i=Un(e,"{4}"),s=Un(e,"{6}"),l=Un(e,"{1,2}"),d=Un(e,"{1,3}"),c=Un(e,"{1,6}"),u=Un(e,"{1,9}"),h=Un(e,"{2,4}"),p=Un(e,"{4,6}"),f=g=>({regex:RegExp(BB(g.val)),deser:([b])=>b,literal:!0}),m=(g=>{if(t.literal)return f(g);switch(g.val){case"G":return Gn(e.eras("short"),0);case"GG":return Gn(e.eras("long"),0);case"y":return Fe(c);case"yy":return Fe(h,qu);case"yyyy":return Fe(i);case"yyyyy":return Fe(p);case"yyyyyy":return Fe(s);case"M":return Fe(l);case"MM":return Fe(o);case"MMM":return Gn(e.months("short",!0),1);case"MMMM":return Gn(e.months("long",!0),1);case"L":return Fe(l);case"LL":return Fe(o);case"LLL":return Gn(e.months("short",!1),1);case"LLLL":return Gn(e.months("long",!1),1);case"d":return Fe(l);case"dd":return Fe(o);case"o":return Fe(d);case"ooo":return Fe(a);case"HH":return Fe(o);case"H":return Fe(l);case"hh":return Fe(o);case"h":return Fe(l);case"mm":return Fe(o);case"m":return Fe(l);case"q":return Fe(l);case"qq":return Fe(o);case"s":return Fe(l);case"ss":return Fe(o);case"S":return Fe(d);case"SSS":return Fe(a);case"u":return md(u);case"uu":return md(l);case"uuu":return Fe(n);case"a":return Gn(e.meridiems(),0);case"kkkk":return Fe(i);case"kk":return Fe(h,qu);case"W":return Fe(l);case"WW":return Fe(o);case"E":case"c":return Fe(n);case"EEE":return Gn(e.weekdays("short",!1),1);case"EEEE":return Gn(e.weekdays("long",!1),1);case"ccc":return Gn(e.weekdays("short",!0),1);case"cccc":return Gn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Qm(new RegExp(`([+-]${l.source})(?::(${o.source}))?`),2);case"ZZZ":return Qm(new RegExp(`([+-]${l.source})(${o.source})?`),2);case"z":return md(/[a-z_+-/]{1,256}?/i);case" ":return md(/[^\S\n\r]/);default:return f(g)}})(t)||{invalidReason:TB};return m.token=t,m}const NB={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function AB(t,e,n){const{type:o,value:a}=t;if(o==="literal"){const d=/^\s+$/.test(a);return{literal:!d,val:d?" ":a}}const i=e[o];let s=o;o==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=n.hour12?"hour12":"hour24");let l=NB[s];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function FB(t){return[`^${t.map(n=>n.regex).reduce((n,o)=>`${n}(${o.source})`,"")}$`,t]}function zB(t,e,n){const o=t.match(e);if(o){const a={};let i=1;for(const s in n)if(Gr(n,s)){const l=n[s],d=l.groups?l.groups+1:1;!l.literal&&l.token&&(a[l.token.val[0]]=l.deser(o.slice(i,i+d))),i+=d}return[o,a]}else return[o,{}]}function RB(t){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,o;return we(t.z)||(n=No.create(t.z)),we(t.Z)||(n||(n=new Kt(t.Z)),o=t.Z),we(t.q)||(t.M=(t.q-1)*3+1),we(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),we(t.u)||(t.S=Wu(t.u)),[Object.keys(t).reduce((i,s)=>{const l=e(s);return l&&(i[l]=t[s]),i},{}),n,o]}let Qu=null;function HB(){return Qu||(Qu=be.fromMillis(1555555555555)),Qu}function IB(t,e){if(t.literal)return t;const n=Zt.macroTokenToFormatOpts(t.val),o=n_(n,e);return o==null||o.includes(void 0)?t:o}function Jm(t,e){return Array.prototype.concat(...t.map(n=>IB(n,e)))}class e_{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=Jm(Zt.parseFormat(n),e),this.units=this.tokens.map(o=>PB(o,e)),this.disqualifyingUnit=this.units.find(o=>o.invalidReason),!this.disqualifyingUnit){const[o,a]=FB(this.units);this.regex=RegExp(o,"i"),this.handlers=a}}explainFromTokens(e){if(this.isValid){const[n,o]=zB(e,this.regex,this.handlers),[a,i,s]=o?RB(o):[null,null,void 0];if(Gr(o,"a")&&Gr(o,"H"))throw new Ur("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:o,result:a,zone:i,specificOffset:s}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function t_(t,e,n){return new e_(t,n).explainFromTokens(e)}function jB(t,e,n){const{result:o,zone:a,specificOffset:i,invalidReason:s}=t_(t,e,n);return[o,a,i,s]}function n_(t,e){if(!t)return null;const o=Zt.create(e,t).dtFormatter(HB()),a=o.formatToParts(),i=o.resolvedOptions();return a.map(s=>AB(s,t,i))}const Ju="Invalid DateTime",o_=864e13;function xs(t){return new qn("unsupported zone",`the zone "${t.name}" is not supported`)}function e0(t){return t.weekData===null&&(t.weekData=sd(t.c)),t.weekData}function t0(t){return t.localWeekData===null&&(t.localWeekData=sd(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function lr(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new be({...n,...e,old:n})}function a_(t,e,n){let o=t-e*60*1e3;const a=n.offset(o);if(e===a)return[o,e];o-=(a-e)*60*1e3;const i=n.offset(o);return a===i?[o,a]:[t-Math.min(a,i)*60*1e3,Math.max(a,i)]}function _d(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function gd(t,e,n){return a_(cd(t),e,n)}function r_(t,e){const n=t.o,o=t.c.year+Math.trunc(e.years),a=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...t.c,year:o,month:a,day:Math.min(t.c.day,dd(o,a))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=Yt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=cd(i);let[d,c]=a_(l,n,t.zone);return s!==0&&(d+=s,c=t.zone.offset(d)),{ts:d,o:c}}function ai(t,e,n,o,a,i){const{setZone:s,zone:l}=n;if(t&&Object.keys(t).length!==0||e){const d=e||l,c=be.fromObject(t,{...n,zone:d,specificOffset:i});return s?c:c.setZone(l)}else return be.invalid(new qn("unparsable",`the input "${a}" can't be parsed as ${o}`))}function bd(t,e,n=!0){return t.isValid?Zt.create(Ke.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function n0(t,e){const n=t.c.year>9999||t.c.year<0;let o="";return n&&t.c.year>=0&&(o+="+"),o+=St(t.c.year,n?6:4),e?(o+="-",o+=St(t.c.month),o+="-",o+=St(t.c.day)):(o+=St(t.c.month),o+=St(t.c.day)),o}function i_(t,e,n,o,a,i){let s=St(t.c.hour);return e?(s+=":",s+=St(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=":")):s+=St(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=St(t.c.second),(t.c.millisecond!==0||!o)&&(s+=".",s+=St(t.c.millisecond,3))),a&&(t.isOffsetFixed&&t.offset===0&&!i?s+="Z":t.o<0?(s+="-",s+=St(Math.trunc(-t.o/60)),s+=":",s+=St(Math.trunc(-t.o%60))):(s+="+",s+=St(Math.trunc(t.o/60)),s+=":",s+=St(Math.trunc(t.o%60)))),i&&(s+="["+t.zone.ianaName+"]"),s}const s_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ZB={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},YB={ordinal:1,hour:0,minute:0,second:0,millisecond:0},l_=["year","month","day","hour","minute","second","millisecond"],WB=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],UB=["year","ordinal","hour","minute","second","millisecond"];function qB(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new A6(t);return e}function d_(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return qB(t)}}function GB(t){return wd[t]||(yd===void 0&&(yd=ft.now()),wd[t]=t.offset(yd)),wd[t]}function c_(t,e){const n=_a(e.zone,ft.defaultZone);if(!n.isValid)return be.invalid(xs(n));const o=Ke.fromObject(e);let a,i;if(we(t.year))a=ft.now();else{for(const d of l_)we(t[d])&&(t[d]=s_[d]);const s=vm(t)||xm(t);if(s)return be.invalid(s);const l=GB(n);[a,i]=gd(t,l,n)}return new be({ts:a,zone:n,loc:o,o:i})}function u_(t,e,n){const o=we(n.round)?!0:n.round,a=(s,l)=>(s=Uu(s,o||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(s,l)),i=s=>n.calendary?e.hasSame(t,s)?0:e.startOf(s).diff(t.startOf(s),s).get(s):e.diff(t,s).get(s);if(n.unit)return a(i(n.unit),n.unit);for(const s of n.units){const l=i(s);if(Math.abs(l)>=1)return a(l,s)}return a(t>e?-0:0,n.units[n.units.length-1])}function h_(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}let yd,wd={};class be{constructor(e){const n=e.zone||ft.defaultZone;let o=e.invalid||(Number.isNaN(e.ts)?new qn("invalid input"):null)||(n.isValid?null:xs(n));this.ts=we(e.ts)?ft.now():e.ts;let a=null,i=null;if(!o)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[a,i]=[e.old.c,e.old.o];else{const l=ga(e.o)&&!e.old?e.o:n.offset(this.ts);a=_d(this.ts,l),o=Number.isNaN(a.year)?new qn("invalid input"):null,a=o?null:a,i=o?null:l}this._zone=n,this.loc=e.loc||Ke.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=a,this.o=i,this.isLuxonDateTime=!0}static now(){return new be({})}static local(){const[e,n]=h_(arguments),[o,a,i,s,l,d,c]=n;return c_({year:o,month:a,day:i,hour:s,minute:l,second:d,millisecond:c},e)}static utc(){const[e,n]=h_(arguments),[o,a,i,s,l,d,c]=n;return e.zone=Kt.utcInstance,c_({year:o,month:a,day:i,hour:s,minute:l,second:d,millisecond:c},e)}static fromJSDate(e,n={}){const o=SO(e)?e.valueOf():NaN;if(Number.isNaN(o))return be.invalid("invalid input");const a=_a(n.zone,ft.defaultZone);return a.isValid?new be({ts:o,zone:a,loc:Ke.fromObject(n)}):be.invalid(xs(a))}static fromMillis(e,n={}){if(ga(e))return e<-o_||e>o_?be.invalid("Timestamp out of range"):new be({ts:e,zone:_a(n.zone,ft.defaultZone),loc:Ke.fromObject(n)});throw new jt(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(ga(e))return new be({ts:e*1e3,zone:_a(n.zone,ft.defaultZone),loc:Ke.fromObject(n)});throw new jt("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const o=_a(n.zone,ft.defaultZone);if(!o.isValid)return be.invalid(xs(o));const a=Ke.fromObject(n),i=hd(e,d_),{minDaysInFirstWeek:s,startOfWeek:l}=wm(i,a),d=ft.now(),c=we(n.specificOffset)?o.offset(d):n.specificOffset,u=!we(i.ordinal),h=!we(i.year),p=!we(i.month)||!we(i.day),f=h||p,_=i.weekYear||i.weekNumber;if((f||u)&&_)throw new Ur("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&u)throw new Ur("Can't mix ordinal dates with month/day");const m=_||i.weekday&&!f;let g,b,w=_d(d,c);m?(g=WB,b=ZB,w=sd(w,s,l)):u?(g=UB,b=YB,w=Zu(w)):(g=l_,b=s_);let y=!1;for(const E of g){const R=i[E];we(R)?y?i[E]=b[E]:i[E]=w[E]:y=!0}const x=m?kO(i,s,l):u?CO(i):vm(i),v=x||xm(i);if(v)return be.invalid(v);const M=m?bm(i,s,l):u?ym(i):i,[C,$]=gd(M,c,o),S=new be({ts:C,zone:o,o:$,loc:a});return i.weekday&&f&&e.weekday!==S.weekday?be.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${S.toISO()}`):S.isValid?S:be.invalid(S.invalid)}static fromISO(e,n={}){const[o,a]=mB(e);return ai(o,a,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[o,a]=_B(e);return ai(o,a,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[o,a]=gB(e);return ai(o,a,n,"HTTP",n)}static fromFormat(e,n,o={}){if(we(e)||we(n))throw new jt("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:i=null}=o,s=Ke.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0}),[l,d,c,u]=jB(s,e,n);return u?be.invalid(u):ai(l,d,o,`format ${n}`,e,c)}static fromString(e,n,o={}){return be.fromFormat(e,n,o)}static fromSQL(e,n={}){const[o,a]=CB(e);return ai(o,a,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the DateTime is invalid");const o=e instanceof qn?e:new qn(e,n);if(ft.throwOnInvalid)throw new XT(o);return new be({invalid:o})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const o=n_(e,Ke.fromObject(n));return o?o.map(a=>a?a.val:null).join(""):null}static expandFormat(e,n={}){return Jm(Zt.parseFormat(e),Ke.fromObject(n)).map(a=>a.val).join("")}static resetCache(){yd=void 0,wd={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?e0(this).weekYear:NaN}get weekNumber(){return this.isValid?e0(this).weekNumber:NaN}get weekday(){return this.isValid?e0(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?t0(this).weekday:NaN}get localWeekNumber(){return this.isValid?t0(this).weekNumber:NaN}get localWeekYear(){return this.isValid?t0(this).weekYear:NaN}get ordinal(){return this.isValid?Zu(this.c).ordinal:NaN}get monthShort(){return this.isValid?fd.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?fd.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?fd.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?fd.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,o=cd(this.c),a=this.zone.offset(o-e),i=this.zone.offset(o+e),s=this.zone.offset(o-a*n),l=this.zone.offset(o-i*n);if(s===l)return[this];const d=o-s*n,c=o-l*n,u=_d(d,s),h=_d(c,l);return u.hour===h.hour&&u.minute===h.minute&&u.second===h.second&&u.millisecond===h.millisecond?[lr(this,{ts:d}),lr(this,{ts:c})]:[this]}get isInLeapYear(){return gs(this.year)}get daysInMonth(){return dd(this.year,this.month)}get daysInYear(){return this.isValid?Xr(this.year):NaN}get weeksInWeekYear(){return this.isValid?bs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?bs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:o,calendar:a}=Zt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:o,outputCalendar:a}}toUTC(e=0,n={}){return this.setZone(Kt.instance(e),n)}toLocal(){return this.setZone(ft.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:o=!1}={}){if(e=_a(e,ft.defaultZone),e.equals(this.zone))return this;if(e.isValid){let a=this.ts;if(n||o){const i=e.offset(this.ts),s=this.toObject();[a]=gd(s,i,e)}return lr(this,{ts:a,zone:e})}else return be.invalid(xs(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:o}={}){const a=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:o});return lr(this,{loc:a})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=hd(e,d_),{minDaysInFirstWeek:o,startOfWeek:a}=wm(n,this.loc),i=!we(n.weekYear)||!we(n.weekNumber)||!we(n.weekday),s=!we(n.ordinal),l=!we(n.year),d=!we(n.month)||!we(n.day),c=l||d,u=n.weekYear||n.weekNumber;if((c||s)&&u)throw new Ur("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&s)throw new Ur("Can't mix ordinal dates with month/day");let h;i?h=bm({...sd(this.c,o,a),...n},o,a):we(n.ordinal)?(h={...this.toObject(),...n},we(n.day)&&(h.day=Math.min(dd(h.year,h.month),h.day))):h=ym({...Zu(this.c),...n});const[p,f]=gd(h,this.o,this.zone);return lr(this,{ts:p,o:f})}plus(e){if(!this.isValid)return this;const n=Yt.fromDurationLike(e);return lr(this,r_(this,n))}minus(e){if(!this.isValid)return this;const n=Yt.fromDurationLike(e).negate();return lr(this,r_(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const o={},a=Yt.normalizeUnit(e);switch(a){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(a==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:s}=this;s<i&&(o.weekNumber=this.weekNumber-1),o.weekday=i}else o.weekday=1;if(a==="quarters"){const i=Math.ceil(this.month/3);o.month=(i-1)*3+1}return this.set(o)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?Zt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):Ju}toLocaleString(e=nd,n={}){return this.isValid?Zt.create(this.loc.clone(n),e).formatDateTime(this):Ju}toLocaleParts(e={}){return this.isValid?Zt.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:o=!1,includeOffset:a=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const s=e==="extended";let l=n0(this,s);return l+="T",l+=i_(this,s,n,o,a,i),l}toISODate({format:e="extended"}={}){return this.isValid?n0(this,e==="extended"):null}toISOWeekDate(){return bd(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:o=!0,includePrefix:a=!1,extendedZone:i=!1,format:s="extended"}={}){return this.isValid?(a?"T":"")+i_(this,s==="extended",n,e,o,i):null}toRFC2822(){return bd(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return bd(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?n0(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:o=!0}={}){let a="HH:mm:ss.SSS";return(n||e)&&(o&&(a+=" "),n?a+="z":e&&(a+="ZZ")),bd(this,a,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Ju}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",o={}){if(!this.isValid||!e.isValid)return Yt.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...o},i=LO(n).map(Yt.normalizeUnit),s=e.valueOf()>this.valueOf(),l=s?this:e,d=s?e:this,c=EB(l,d,i,a);return s?c.negate():c}diffNow(e="milliseconds",n={}){return this.diff(be.now(),e,n)}until(e){return this.isValid?mt.fromDateTimes(this,e):this}hasSame(e,n,o){if(!this.isValid)return!1;const a=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,o)<=a&&a<=i.endOf(n,o)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||be.fromObject({},{zone:this.zone}),o=e.padding?this<n?-e.padding:e.padding:0;let a=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(a=e.unit,i=void 0),u_(n,this.plus(o),{...e,numeric:"always",units:a,unit:i})}toRelativeCalendar(e={}){return this.isValid?u_(e.base||be.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(be.isDateTime))throw new jt("min requires all arguments be DateTimes");return Mm(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(be.isDateTime))throw new jt("max requires all arguments be DateTimes");return Mm(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,o={}){const{locale:a=null,numberingSystem:i=null}=o,s=Ke.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});return t_(s,e,n)}static fromStringExplain(e,n,o={}){return be.fromFormatExplain(e,n,o)}static buildFormatParser(e,n={}){const{locale:o=null,numberingSystem:a=null}=n,i=Ke.fromOpts({locale:o,numberingSystem:a,defaultToEN:!0});return new e_(i,e)}static fromFormatParser(e,n,o={}){if(we(e)||we(n))throw new jt("fromFormatParser requires an input string and a format parser");const{locale:a=null,numberingSystem:i=null}=o,s=Ke.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});if(!s.equals(n.locale))throw new jt(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${n.locale}`);const{result:l,zone:d,specificOffset:c,invalidReason:u}=n.explainFromTokens(e);return u?be.invalid(u):ai(l,d,o,`format ${n.format}`,e,c)}static get DATE_SHORT(){return nd}static get DATE_MED(){return F6}static get DATE_MED_WITH_WEEKDAY(){return JT}static get DATE_FULL(){return z6}static get DATE_HUGE(){return R6}static get TIME_SIMPLE(){return H6}static get TIME_WITH_SECONDS(){return I6}static get TIME_WITH_SHORT_OFFSET(){return j6}static get TIME_WITH_LONG_OFFSET(){return Z6}static get TIME_24_SIMPLE(){return Y6}static get TIME_24_WITH_SECONDS(){return W6}static get TIME_24_WITH_SHORT_OFFSET(){return U6}static get TIME_24_WITH_LONG_OFFSET(){return q6}static get DATETIME_SHORT(){return G6}static get DATETIME_SHORT_WITH_SECONDS(){return X6}static get DATETIME_MED(){return K6}static get DATETIME_MED_WITH_SECONDS(){return Q6}static get DATETIME_MED_WITH_WEEKDAY(){return eO}static get DATETIME_FULL(){return J6}static get DATETIME_FULL_WITH_SECONDS(){return em}static get DATETIME_HUGE(){return tm}static get DATETIME_HUGE_WITH_SECONDS(){return nm}}function ks(t){if(be.isDateTime(t))return t;if(t&&t.valueOf&&ga(t.valueOf()))return be.fromJSDate(t);if(t&&typeof t=="object")return be.fromObject(t);throw new jt(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const o0=[{name:"Sydney",open:"22:00",close:"7:00"},{name:"Tokyo",open:"0:00",close:"9:00"},{name:"London",open:"8:00",close:"17:00"},{name:"New-York",open:"13:00",close:"22:00"}];function at(t,e=2){return isNaN(+t)?0:Math.round(+t*10**e)/10**e}function a0(t){if(t){const e=t.toString();if(/\B(?=(\d{3})+(?!\d))/g.test(e))if(e.includes(".")){let o=e.split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),o.join(".")}else return e.replace(/\B(?=(\d{3})+(?!\d))/g," ");else return e}else return t}function XB(t,e,n){const o=parseFloat(t.entry_price),a=t.amount,i=t.pair.toLowerCase(),s=t.side,d=(h=>h.endsWith("jpy")?1e3:h.startsWith("xau")||h.endsWith("f.t")||h.endsWith(".b")?100:h==="cocoa"||h==="coffee"?1:h==="brent"?100:1e5)(i);let c=0,u=0;return s==="LONG"?(c=(e.bid-o)*a*d,u=c/(a*o*d/n)):s==="SHORT"&&(c=(o-e.ask)*a*d,u=c/(a*o*d/n)),{pnl:c,pnl_roi:u}}function KB(t,e){const n=parseFloat(t.entry_price),o=t.amount,a=t.multiplier,i=t.side;let s=0,l=0;return i==="SHORT"?(s=(n-e)*Math.abs(o),l=(n-e)*o*a/(n*Math.abs(o))*100):i==="LONG"&&(s=(e-n)*Math.abs(o),l=(e-n)*o*a/(n*Math.abs(o))*100),{pnl:s,pnlToBalanceRatio:l}}function QB(t){if(isNaN(+t))return 0;const e=parseFloat(String(t));if(Number.isInteger(e))return e;const n=e.toString(),o=n.indexOf(".");if(o===-1)return e;const i=n.slice(o+1).search(/[^0]/);if(i===-1)return e;const l=10**(i+4);return Math.round(e*l)/l}function vd(t){let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}function _e(t,e,n={}){const{repeat:o=4,mask:a="*",prefix:i="",suffix:s=""}=n;let l,d;return t?(l=i==="$"?ii():i,d=s==="$"?ii():s,l+a.repeat(o)+d):e}function JB(t){return t.reduce((e,n,o)=>o===0?`key=${encodeURIComponent(n.id)}`:e+`&key=${encodeURIComponent(n.id)}`,"")}function ri(){function t(a){return Number(a)===a&&a%1!==0}function e(a){let i=String(a);return i.includes(".75")?i.replace(".75",":45"):i.includes(".25")?i.replace(".25",":15"):i.replace(".5",":30")}const n=Number(ao.getItem("scope360::timezone"))||0,o=t(n)?e(n):n;return`UTC${n>=0?"+":""}${o}`}function eP(t){return new Date(t).getFullYear()}function tP(t,e=!0){const n=e?ri():"UTC+0";return be.fromISO(t,{setZone:!0}).setZone(n).toFormat("dd LLLL, y, TT")}function r0(t,e="dd/LL/y",n=!0){const o=n?ri():"UTC+0";return be.fromISO(t,{setZone:!0}).setZone(o).toFormat(e)}function nP(t){return t.toISOString().split("T")[0]}function oP(t){return["January","February","March","April","May","June","July","August","September","October","November","December"][new Date(t).getMonth()]}function aP(t){return new Date(t).getDate()}function p_(t){return be.fromISO(t,{setZone:!0}).toFormat("cccc")}function rP(t){const e=new Date(t),o=new Date-e;return Math.floor(o/(1e3*3600*24))}function ii(){const t={USD:"$",EUR:"€",JPY:"¥",GBP:"£",CHF:"Fr.",CAD:"$",AUD:"$",NOK:"kr",SEK:"kr",DKK:"kr"},e=f_();return e&&t[e?.split("::")[0]]?t[e?.split("::")[0]]:t.USD}function f_(){let t=!1;return(window.location.hostname.includes("fx")||window.location.host==="localhost:5173")&&(t=!0),t?ao.getItem("scope360::currency_fx"):ao.getItem("scope360::currency")}function dr(){const t=f_();return t&&t?.split("::")[1]?+t?.split("::")[1]:1}const Ie=(t,e={isPercentage:!1,isFixed:!0,isPlus:!1})=>{let n;t>=0?n=e.isPlus&&t!==0?"+":"":n="-";let o=Math.abs(t);return e.isFixed&&(o=at(o)),e.isPercentage?a0(`${n}${o}%`):a0(`${n}${ii()}${at(o*dr())}`)};function iP(t,e){const n=+new Date(e)-+new Date(t);return g_(n)}function m_(){function t(s){const[l,d]=s.split(":").map(Number);return l+d/60}function e(s){const l=Math.floor(s),d=s%1*60;return`${String(l).padStart(2,"0")}:${String(d).padStart(2,"0")}`}function n(s){const l=s.match(/([+-]?)(\d+):?(\d+)?/);if(!l)return 0;const d=l[1]==="-"?-1:1,c=parseInt(l[2],10),u=l[3]?parseInt(l[3],10):0;return d*(c+u/60)}const o=ri(),a=n(o);return o0.map(s=>{const l=t(s.open),d=t(s.close),c=(l+a+24)%24,u=(d+a+24)%24;return{name:s.name,open:e(c),close:e(u)}})}function __(){const t=new Date,e=t.getUTCHours(),n=t.getUTCMinutes(),o=t.getUTCSeconds(),a=e*3600+n*60+o,i=o0.filter(({open:s,close:l})=>{const[d,c]=s.split(":").map(Number),[u,h]=l.split(":").map(Number),p=d*3600+c*60,f=u*3600+h*60;return p<f?a>=p&&a<f:a>=p||a<f});if(i.length>1){const l=Math.min(...i.map(({close:d})=>{const[c,u]=d.split(":").map(Number);return c*3600+u*60}))-a;return{activeMarkets:i.map(({name:d})=>d),overlapTime:l>0?Math.floor(l/60):0}}else{if(i.length===1)return{activeMarkets:i.map(({name:s})=>s),overlapTime:0};{const l=o0.map(({name:d,open:c})=>{const[u,h]=c.split(":").map(Number),p=u*3600+h*60,f=p>=a?p-a:86400-a+p;return{name:d,timeUntilOpenInSeconds:f}}).reduce((d,c)=>d.timeUntilOpenInSeconds<c.timeUntilOpenInSeconds?d:c);return{activeMarkets:[],nextMarket:l.name,timeUntilNextOpen:Math.floor(l.timeUntilOpenInSeconds/60),timeUntilNextOpenInSeconds:l.timeUntilOpenInSeconds}}}}function si(t,e){return t>=1e3||t<=-1e3?_e(e,at(t/1e3,2)+"k",{repeat:3}):_e(e,at(t,2),{repeat:3})}function g_(t){const e=Math.floor(t/864e5),n=Math.floor(t%(1e3*60*60*24)/(1e3*60*60)),o=Math.floor(t%(1e3*60*60)/(1e3*60)),a=Math.floor(t%(1e3*60)/1e3),i=[];return e>0&&i.push(`${e}D`),n>0&&i.push(`${n}H`),o>0&&i.push(`${o}M`),a>0&&i.push(`${a}S`),i.join(" ")}function sP(t){const e=/^(.*?)(BTC|ETH|USDT|USD|USDC)$/,n=t.match(e);if(n){const o=n[1],a=n[2];return o===""||a===""?t:`${o}/${a}`}else return t}function cr(t){const e=["BTC","ETH","USDT","USD","EUR","GBP","JPY","CAD","CHF","USDC","CNH"];for(let n=1;n<t.length;n++){const o=t.substring(0,n),a=t.substring(n);if(e.includes(o)||e.includes(a))return`${o}/${a}`}return t}function Cs(t,e){const o=cr(t).split("/")[e];if(o)return o.toLowerCase()}function lP(t,e){let n=[],o=new Date(e,t,1),a=new Date(e,t+1,0),i=a.getDate(),s=1,l;for(o.getDay()===1?l=7:o.getDay()===0?(s=new Date(e,t,0).getDate()-6+1,l=1):(s=new Date(e,t,0).getDate()+1-o.getDay()+1,l=7-o.getDay()+1,n.push({start:s,end:l}),s=l+1,l=l+7);s<=i;)if(n.push({start:s,end:l}),s=l+1,l=l+7,l=s===1&&l===8?1:l,l>i&&s<=i){l=l-i,n.push({start:s,end:l});break}return n.map(({start:d,end:c},u)=>{const h=+(d>c&&u===0);return Array.from({length:7},(p,f)=>{const _=new Date(e,t-h,d+f);return{date:_.getDate(),month:_.getMonth(),day:_.toLocaleString("en",{weekday:"long"})}})})}function dP(t,e,n){let o=new Date(t),a=new Date(e);o>a&&([o,a]=[a,o]);let i=[],s=new Date(o.getFullYear(),o.getMonth(),1),l=0;for(;s<=a;){let d=s.toLocaleString("en",{month:"long",year:"numeric"});n?i.push({month:s.getMonth(),year:s.getFullYear(),name:d,id:l}):i.push(d),l=l+1,s.setMonth(s.getMonth()+1)}return i}function cP(t,e,n){let o=new Date(t),a=new Date(e);o>a&&([o,a]=[a,o]);let i=[],s=o.getFullYear(),l=a.getFullYear(),d=0;for(let c=s;c<=l;c++)n?i.push({value:c,name:c.toString(),id:d}):i.push(c.toString()),d=d+1;return i}function uP(t,e){let a=new Date(t).getTime()-e*24*60*60*1e3;return new Date(a).toISOString().split(".")[0]+"Z"}function hP(t){function e(o,a){let i=[],s=new Date(a,o,1),l=new Date(a,o+1,0),d=l.getDate(),c=1,u;for(s.getDay()===1?u=7:s.getDay()===0?(c=new Date(a,o,0).getDate()-6+1,u=1):(c=new Date(a,o,0).getDate()+1-s.getDay()+1,u=7-s.getDay()+1,i.push({start:c,end:u}),c=u+1,u=u+7);c<=d;)if(i.push({start:c,end:u}),c=u+1,u=u+7,u=c===1&&u===8?1:u,u>d&&c<=d){u=u-d,i.push({start:c,end:u});break}return i.map(({start:h,end:p},f)=>{const _=+(h>p&&f===0);return Array.from({length:7},(m,g)=>{const b=new Date(a,o-_,h+g);return{date:b.getMonth()===o?b.getDate():0,day:b.toLocaleString("en",{weekday:"long"})}})})}let n=[];for(let o=0;o<12;o++)n.push(e(o,t));return n}function pP(t){const e=t.map(o=>new Date(o));return new Date(Math.min(...e.map(o=>o.getTime())))}const fP={class:"doughnut-wrapper"},mP={class:"doughnut-wrapper__total"},_P={class:"doughnut-wrapper__total__value"},gP=r.createElementVNode("div",{class:"doughnut-wrapper__total__label"},"Total positions",-1),bP={__name:"DoughnutChart",props:{total:{type:Number,required:!0},data:{type:Object,required:!0},dataType:{type:String,required:!1},borderColor:{type:String,default:"transparent"},isMask:{type:Boolean,default:!1}},setup(t){or.register(o$,Cu,l6);const e=r.ref(0),n=t,o=r.ref({cutout:75,spacing:2,responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},plugins:{tooltip:{enabled:!1,position:"nearest",external:i},legend:!1}});function a(s,l){let d=document.querySelector(`#${s}-${n.dataType}`);return d||(d=document.createElement("div"),d.classList.add(s),d.setAttribute("id",`${s}-${n.dataType}`),l.canvas.parentNode.appendChild(d)),d}function i(s){const{chart:l,tooltip:d}=s,c=a("chart-tooltip",l);if(d.opacity===0){c.style.opacity="0";return}if(d.body){const g=d.title||[],b=d.body.map($=>$.lines),w=g[0],y=b[0],x=n.data.labels.findIndex($=>$===w),v=n.data.datasets[0].backgroundColor[x],M=n.data.totals[x],C=document.createElement("div");for(C.classList.add("chart-tooltip-info"),C.innerHTML=`<div class="chart-tooltip-info__top">
43
+ additionally showing the growth/fall of your balance.`},showBTC:{type:Boolean,default:!0},BTC:{type:Number,default:0},USDT:{type:Number,default:0},delta:{type:Number,default:0},balanceChartData:{type:Array,default:[]},currentProfit:{type:Number,default:0},profit:{type:Number,default:0},drawdown:{type:Number,default:0},isPercentage:Boolean,isShare:{type:Boolean,default:!1},isHidden:{type:Boolean,default:!1},isMaskBalance:{type:Boolean,default:!1},isMaskPersonalTarget:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["switchModal","switchVisibility","refresh"],setup(t,{emit:e}){const n=e,o=t,a=r.reactive({USDT:0,BTC:0,delta:0}),i=r.reactive({currentProfit:0}),s=r.ref(0),l=r.ref(!1),d=r.ref(!1),c=()=>{n("switchVisibility")},u=()=>{l.value=!0},h=()=>{l.value=!1},p=()=>{d.value=!0},f=()=>{d.value=!1},_=r.computed(()=>({currentProfit:o.currentProfit,profit:o.profit,drawdown:o.drawdown})),m=r.computed(()=>`${44+(String(at(o.USDT,2)).length-1)*16}px`);return r.watch(()=>o.USDT,g=>{$o.to(a,{duration:1.5,USDT:Number(g)||0,BTC:o.BTC,delta:o.delta})},{immediate:!0}),r.watch(()=>o.delta,g=>{$o.to(a,{delta:Number(g)||0})},{deep:!0}),r.watch(()=>_,g=>{s.value=$o.to(i,{duration:1.5,currentProfit:o.currentProfit})},{immediate:!0,deep:!0}),(g,b)=>(r.openBlock(),r.createElementBlock("div",zD,[r.createElementVNode("div",RD,[r.createElementVNode("div",HD,[r.createElementVNode("div",ID,[jD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.tooltip),1)]),_:1})]),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"balance-part__visibility-switcher",onClick:c,onMouseover:u,onMouseleave:h},[r.withDirectives(r.createVNode(r.unref(Le),{icon:"eye"},null,512),[[r.vShow,t.isHidden]]),r.withDirectives(r.createVNode(r.unref(Le),{icon:"eye-slash"},null,512),[[r.vShow,!t.isHidden]]),l.value?(r.openBlock(),r.createElementBlock("div",ZD," Enable or disable Private Mode for a more secure experience. ")):r.createCommentVNode("",!0)],32))]),r.createElementVNode("div",YD,[r.createElementVNode("div",WD,[r.createElementVNode("div",{class:"balance-part__content__count",style:r.normalizeStyle({minWidth:m.value})},r.toDisplayString(r.unref(_e)(t.isMaskBalance,r.unref(Ie)(a.USDT),{prefix:"$"})),5),t.delta?(r.openBlock(),r.createBlock(r.unref(Yd),{key:0,class:"balance-part__content__chips","is-hidden":t.isMaskBalance,percentage:"",delta:a.delta},null,8,["is-hidden","delta"])):r.createCommentVNode("",!0)]),t.showBTC?(r.openBlock(),r.createElementBlock("div",UD," = "+r.toDisplayString(r.unref(_e)(t.isMaskBalance,a.BTC))+" BTC ",1)):r.createCommentVNode("",!0)]),t.isShare?(r.openBlock(),r.createBlock(r.unref(Vu),{key:0,class:"balance-part__chart balance-part__chart--share",data:t.balanceChartData,gradient:{height:500,startColor:"rgba(86, 182, 131, 0.1)",endColor:"rgba(86, 182, 131, 0)"}},null,8,["data"])):(r.openBlock(),r.createBlock(r.unref(Vu),{key:1,class:"balance-part__chart",data:t.balanceChartData},null,8,["data"]))]),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",qD)),t.isShare?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",GD,[r.createElementVNode("div",XD,[r.createElementVNode("div",KD,[QD,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode(" In this widget, set your desired balance growth target in $ or % for a specific period. It will display your PNL relative to the goal, helping you know when to stop or pay closer attention. ")]),_:1})]),r.createElementVNode("div",{class:"balance-part__modal-switcher",onClick:b[0]||(b[0]=w=>n("switchModal")),onMouseover:p,onMouseleave:f},[r.createVNode(r.unref(Le),{icon:"settings"}),d.value?(r.openBlock(),r.createElementBlock("div",JD," Click to configure goals in the Personal Target widget. ")):r.createCommentVNode("",!0)],32)]),r.createElementVNode("div",eV,[r.createElementVNode("div",tV,r.toDisplayString(r.unref(_e)(t.isMaskPersonalTarget,r.unref(Ie)(i.currentProfit,{isPercentage:t.isPercentage,isFixed:!0}),{prefix:"$",repeat:5})),1),r.createElementVNode("div",nV," / "+r.toDisplayString(r.unref(_e)(t.isMaskPersonalTarget,r.unref(Ie)(t.profit,{isPercentage:t.isPercentage,isFixed:!0}))),1)]),(r.openBlock(),r.createBlock(r.unref(S5),{key:s.value,"current-profit":t.currentProfit,"is-hidden":t.isMaskPersonalTarget,drawdown:t.drawdown,profit:t.profit,"is-percentage":t.isPercentage},null,8,["current-profit","is-hidden","drawdown","profit","is-percentage"]))])),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:b[1]||(b[1]=w=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-35320c46"]]),ed=t=>(r.pushScopeId("data-v-9786b83c"),t=t(),r.popScopeId(),t),aV={class:"calendar-widget"},rV={class:"calendar-widget__calendar"},iV={class:"calendar-widget__top"},sV={class:"calendar-widget__title-wrapper"},lV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),dV={class:"stat-calendar"},cV={class:"stat-calendar__week-days"},uV={key:0,class:"stat-calendar__row-wrapper"},hV={class:"stat-calendar__row"},pV=["onClick"],fV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),mV={key:0,class:"calendar-widget__day"},_V={class:"calendar-widget__day__title-wrapper"},gV={class:"calendar-widget__day__title"},bV={class:"calendar-widget__day__content"},yV={class:"calendar-widget__point"},wV={class:"calendar-widget__point__title"},vV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),xV={class:"calendar-widget__day__trades"},kV={class:"calendar-widget__point"},CV={class:"calendar-widget__point__title"},MV=ed(()=>r.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),SV={__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,minDate:Date,currentDate:{type:Date,default:new Date},maxDate:{type:Date,default:Date()},isCurrentDate:Function,isCurrentDay:Function,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["setNewDate","chooseMonth","refresh","getDetails"],setup(t,{emit:e}){const n=["Mo","Tu","We","Th","Fr","Sa","Su"],o=r.ref(null),a=r.ref(null),i=e,s=t,l=u=>{o.value=u.year,a.value=u.month,i("chooseMonth",u)};r.nextTick(()=>{const u=new Date;o.value=u.getFullYear(),a.value=u.getMonth()});const d=r.computed(()=>[{title:"Total trades",value:s.dailyStatData&&s.dailyStatData.trades_total_count||0},{title:"Winrate",value:Ie(s.dailyStatData&&s.dailyStatData.win_rate||0,{isPercentage:!0,isFixed:!0}),class:s.dailyStatData&&s.dailyStatData.win_rate>=50?"-win":"-loss"},{title:"Return",value:Ie(s.dailyStatData&&s.dailyStatData.return_total||0),class:s.dailyStatData&&s.dailyStatData.return_total>=0?"-win":"-loss"},{title:"Return on winners",value:Ie(s.dailyStatData&&s.dailyStatData.return_win||0)},{title:"Return on losers",value:Ie(s.dailyStatData&&s.dailyStatData.return_lose||0)},{title:"Commission",value:Ie(s.dailyStatData&&s.dailyStatData.commission||0)}]),c=r.computed(()=>[{title:"Win trades",value:s.dailyStatData&&s.dailyStatData.trades_win_count||0,isPositive:!0},{title:"Loss trades",value:-(s.dailyStatData&&s.dailyStatData.trades_lose_count)||0,isNegative:!1}]);return(u,h)=>(r.openBlock(),r.createElementBlock("div",aV,[r.createElementVNode("div",rV,[r.createElementVNode("div",iV,[r.createElementVNode("div",sV,[lV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("A widget that displays the performance of your trades in a calendar format. Here you can see profitable and unprofitable days with detailed statistics for each day. ")]),_:1})]),t.currentDate&&t.minDate?(r.openBlock(),r.createBlock(r.unref(C5),{key:0,"current-date":t.currentDate||new Date,"min-date":t.minDate,"max-date":t.maxDate,onOnChange:l,year:o.value,"onUpdate:year":h[0]||(h[0]=p=>o.value=p),month:a.value,"onUpdate:month":h[1]||(h[1]=p=>a.value=p)},null,8,["current-date","min-date","max-date","year","month"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",dV,[r.createElementVNode("div",cV,[(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(n,(p,f)=>r.createElementVNode("div",{class:r.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(f)}])},r.toDisplayString(p),3)),64))]),t.rows?(r.openBlock(),r.createElementBlock("div",uV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.rows,p=>(r.openBlock(),r.createElementBlock("div",hV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,f=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["stat-calendar__day",{"-unavailable":f.unavailable,"-empty":!f.date,"-current":t.isCurrentDate(f.date),"-positive":f.win,"-negative":f.win===!1}]),onClick:_=>i("setNewDate",f.date)},r.toDisplayString(f.date?f.date:""),11,pV))),256))]))),256))])):r.createCommentVNode("",!0)])]),fV,t.dailyStatData&&!t.dailyStatData.isNull?(r.openBlock(),r.createElementBlock("div",mV,[r.createElementVNode("div",_V,[r.createElementVNode("div",gV,r.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),r.createVNode(Le,{icon:"preview",onClick:h[2]||(h[2]=p=>i("getDetails"))})]),r.createElementVNode("div",bV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.value,p=>(r.openBlock(),r.createElementBlock("div",yV,[r.createElementVNode("div",wV,r.toDisplayString(p.title),1),vV,r.createElementVNode("div",{class:r.normalizeClass(["calendar-widget__point__value",p.class?p.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,p.value,{repeat:5})),3)]))),256)),r.createVNode(r.unref(h2),{isHidden:t.isMask,long:t.dailyStatData?.long_count,short:t.dailyStatData?.short_count},null,8,["isHidden","long","short"]),r.createElementVNode("div",xV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,p=>(r.openBlock(),r.createElementBlock("div",kV,[r.createElementVNode("div",CV,r.toDisplayString(p.title),1),MV,r.createVNode(r.unref(Yd),{isHidden:t.isMask,"is-positive":p.isPositive,"is-negative":p.isNegative,delta:p.value},null,8,["isHidden","is-positive","is-negative","delta"])]))),256))])])])):(r.openBlock(),r.createBlock(r.unref(ko),{key:1,class:"-empty"})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:h[3]||(h[3]=p=>i("refresh"))})):r.createCommentVNode("",!0)]))}},LV=ve(SV,[["__scopeId","data-v-9786b83c"]]),Eu=t=>(r.pushScopeId("data-v-f0601396"),t=t(),r.popScopeId(),t),$V={class:"commission-widget"},DV={class:"commission-widget__content"},VV={class:"commission-widget__top"},EV={class:"commission-widget__title-wrapper"},TV=Eu(()=>r.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),OV={class:"commission-widget__info"},BV={class:"commission-widget__total-wrapper"},PV=Eu(()=>r.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),NV={class:"commission-widget__total-wrapper__total"},AV={class:"commission-widget__total-wrapper__value"},FV={class:"commission-widget__points"},zV={class:"commission-widget__point"},RV={class:"commission-widget__point__title"},HV=Eu(()=>r.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),IV=ve({__name:"CommissionsFeesWidget",props:{commissionData:Object,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e,o=t,a=r.reactive({commission:0}),i=r.computed(()=>o.commissionData&&o.commissionData.commission||0),s=r.computed(()=>o.commissionData&&o.commissionData.pnl||0),l=r.computed(()=>[{title:"AVG fees per trade",value:`${Ie(o.commissionData&&o.commissionData.fees_per_trade||0)}`},{title:"PNL / Commission",value:s.value&&i.value?`${Ie(s.value)}/${Ie(i.value)}`:`${Ie(0)}`},{title:"AVG fees per day",value:`${Ie(o.commissionData&&o.commissionData.fees_per_day||0)}`},{title:"Funding",value:`${Ie(o.commissionData&&o.commissionData.funding||0)}`}]);return r.watch(i,d=>{$o.to(a,{duration:1.5,commission:d})},{immediate:!0}),(d,c)=>(r.openBlock(),r.createElementBlock("div",$V,[r.createElementVNode("div",DV,[r.createElementVNode("div",VV,[r.createElementVNode("div",EV,[TV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("This widget helps traders finally understand how much money they spent on commissions and funding. ")]),_:1})])]),r.createElementVNode("div",OV,[r.createElementVNode("div",BV,[PV,r.createElementVNode("div",NV,[r.createElementVNode("div",AV,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(a.commission),{repeat:5})),1)])]),r.createElementVNode("div",FV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(u,h)=>(r.openBlock(),r.createElementBlock("div",zV,[r.createElementVNode("div",RV,r.toDisplayString(u.title),1),HV,r.createElementVNode("div",{class:r.normalizeClass(["commission-widget__point__value",u.class?u.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,u.value,{repeat:5})),3)]))),256))])])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:c[0]||(c[0]=u=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-f0601396"]]),jV={class:"chart-wrapper"},ZV=["id","onMouseover","onMouseleave"],td={__name:"BarChart",props:{data:{type:Object,required:!0},dataType:{type:String,required:!1},borderColor:{type:String,default:"#56B683"},ticksCallback:{type:Function,default:t=>t},yTicksCallback:{type:Function,default:t=>t},altLabels:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1}},setup(t){or.register(Mu,Su,b$,Z$,Cu,l6);const e=r.inject("darkMode"),n=r.ref(0);r.ref(!1);const o=r.ref(null),a=t,i=r.ref(null),s=r.ref([]),l=f=>{o.value=f},d=f=>{o.value=null},c=r.ref({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},interaction:{mode:"index",intersect:!1},elements:{line:{tension:.05,borderWidth:3,borderColor:a.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}},plugins:{tooltip:{enabled:!1,position:"nearest",external:p},legend:!1},scales:{x:{grid:{display:!1},ticks:{callback:function(f){return a.ticksCallback(f,a.data.labels)}}},y:{ticks:{callback:function(f){return a.yTicksCallback(f,a.isMask)}},grid:{color:e?.value?"#2D2D2D":"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}}}),u=()=>{const f=i.value?.chart;if(!f)return;const _=f.scales.x;_&&(s.value=a.data.labels.map((m,g)=>{const b=_.getPixelForTick(g),w=document.getElementById(`label-${g}`),y=w?w.clientWidth:0;return b-y/2}))};function h(f,_){let m=document.querySelector(`#${f}-${a.dataType}`);return m||(m=document.createElement("div"),m.classList.add(f),m.setAttribute("id",`${f}-${a.dataType}`),_.canvas.parentNode.appendChild(m)),m}function p(f){const{chart:_,tooltip:m}=f,g=h("chart-tooltip",_);if(m.opacity===0){g.style.opacity="0";return}if(m.body){m.title,m.body.map($=>$.lines);const C=document.createElement("div");for(C.classList.add("chart-tooltip-middle"),C.innerHTML=`${_e(a.isMask,vd(`${m.dataPoints[0].raw>0?"":"-"}${ii()}${Math.abs(at(m.dataPoints[0].raw))}`),{repeat:3})}`;g.firstChild;)g.firstChild.remove();g.appendChild(C)}const{offsetLeft:b,offsetTop:w,clientWidth:y}=_.canvas;let x=b+m.caretX;const v=w+m.caretY,M=g.clientWidth;x+M>y&&(x-=M),g.style.opacity="1",g.style.left=x+"px",g.style.top=v+"px"}return r.watch(()=>a.isMask,()=>{n.value+=1},{immediate:!0}),r.watch(()=>a.data,()=>{a.altLabels&&setTimeout(()=>{u()},0)},{deep:!0}),r.onMounted(()=>{a.altLabels&&r.nextTick(()=>{u(),window.addEventListener("resize",u)})}),r.onUnmounted(()=>{a.altLabels&&window.removeEventListener("resize",u)}),(f,_)=>(r.openBlock(),r.createElementBlock("div",jV,[(r.openBlock(),r.createBlock(r.unref(SD),{ref_key:"barChart",ref:i,class:"chart-container",key:n.value,data:t.data,options:c.value},null,8,["data","options"])),t.altLabels?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(t.data.labels,(m,g)=>(r.openBlock(),r.createElementBlock("div",{class:"chart-wrapper__labels",id:`label-${g}`,style:r.normalizeStyle({left:`${s.value[g]}px`}),onMouseover:b=>l(g),onMouseleave:b=>d()},[r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(Cs)(m,0)}`)},null,2),r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(Cs)(m,1)}`)},null,2)],44,ZV))),256)):r.createCommentVNode("",!0),o.value!==null?(r.openBlock(),r.createElementBlock("div",{key:1,class:"chart-wrapper__label-tooltip",style:r.normalizeStyle(t.data.labels.length===o.value+1?{right:"0px"}:{left:`${s.value[o.value]-25}px`})},r.toDisplayString(r.unref(cr)(a.data.labels[o.value])),5)):r.createCommentVNode("",!0)]))}},YV=t=>(r.pushScopeId("data-v-3d420a57"),t=t(),r.popScopeId(),t),WV={class:"instrument-widget"},UV={class:"instrument-widget__top"},qV={class:"instrument-widget__title-wrapper"},GV=YV(()=>r.createElementVNode("div",{class:"instrument-widget__title"},"Results by Instrument",-1)),XV={key:0,class:""},KV={key:1,class:"instrument-widget__grid-wrapper"},QV={class:"instrument-widget__grid"},JV={class:"instrument-widget__card"},eE={class:"instrument-widget__card__top"},tE={class:"instrument-widget__card__pair"},nE={class:"instrument-widget__card__pair__icons"},oE={class:"instrument-widget__card__pair__title"},aE={class:"instrument-widget__card__trades"},rE=ve({__name:"InstrumentWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=[{id:0,name:"Overall"},{id:1,name:"Long"},{id:2,name:"Short"}],o=t,a=e,i=r.ref(!1),s=r.ref({id:0,name:"Overall"}),l=r.computed(()=>o.results&&Object.values(o.results).length?c(o.results[s.value.name.toLowerCase()]):[]),d=r.computed(()=>{const p=Object.values(l.value).slice(0,10).map(_=>_.net_pnl_total*dr()),f=Object.values(l.value).slice(0,10).map(_=>_.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(l.value).slice(0,10),datasets:[{data:p,backgroundColor:f,borderRadius:4}]}}),c=p=>Object.fromEntries(Object.entries(p).sort(([,f],[,_])=>_.net_pnl_total-f.net_pnl_total)),u=(p,f)=>"",h=()=>{i.value=!i.value};return(p,f)=>(r.openBlock(),r.createElementBlock("div",WV,[r.createElementVNode("div",UV,[r.createElementVNode("div",qV,[GV,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Check your performance across different trading instruments. Use the Overall, Long, or Short filters to view detailed results. ")]),_:1})]),i.value?(r.openBlock(),r.createBlock(r.unref(Cn),{key:0,class:"instrument-widget__btn",view:"secondary",icon:"list",size:"sm",onClick:h})):(r.openBlock(),r.createBlock(r.unref(Cn),{key:1,class:"instrument-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:h}))]),r.createElementVNode("div",{class:r.normalizeClass(["instrument-widget__content",{"-chart-active":i.value}])},[r.createVNode(r.unref(Pc),{class:"instrument-widget__switcher",modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=_=>s.value=_),options:n},null,8,["modelValue"]),l.value&&Object.values(l.value).length?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.value?(r.openBlock(),r.createElementBlock("div",XV,[r.createVNode(td,{class:"instrument-widget__bar",data:d.value,ticksCallback:u,"y-ticks-callback":r.unref(si),"is-mask":t.isMask,"data-type":"instrument","alt-labels":""},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",KV,[r.createElementVNode("div",QV,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(_,m,g)=>(r.openBlock(),r.createElementBlock("div",JV,[r.createElementVNode("div",eE,[r.createElementVNode("div",tE,[r.createElementVNode("div",nE,[r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(Cs)(m,0)}`)},null,2),r.createElementVNode("div",{class:r.normalizeClass(`currency-flag currency-flag-${r.unref(Cs)(m,1)}`)},null,2)]),r.createElementVNode("div",oE,r.toDisplayString(r.unref(cr)(m)),1)]),r.createElementVNode("div",aE,r.toDisplayString(r.unref(_e)(t.isMask,_.trades_count,{repeat:3})),1)]),r.createElementVNode("div",{class:r.normalizeClass(["instrument-widget__card__net-pnl",{"-positive":_.net_pnl_total>0,"-negative":_.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(_.net_pnl_total,{isFixed:!0,isPlus:!0}),{repeat:3})),3)]))),256))])]))],64)):(r.openBlock(),r.createBlock(ko,{key:1,absolute:""}))],2),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:f[1]||(f[1]=_=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-3d420a57"]]),iE=t=>(r.pushScopeId("data-v-e7e7b192"),t=t(),r.popScopeId(),t),sE={class:"size-widget"},lE={class:"size-widget__top"},dE={class:"size-widget__title-wrapper"},cE=iE(()=>r.createElementVNode("div",{class:"size-widget__title"},"Result by position size",-1)),uE={key:0},hE={key:1,class:"size-widget__grid"},pE={class:"size-widget__card"},fE={class:"size-widget__card__top"},mE={class:"size-widget__card__title"},_E={class:"size-widget__card__trades"},gE={class:"size-widget__card__bottom"},bE=ve({__name:"SizeWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=t,o=e,a=r.ref(!1),i=r.computed(()=>{const d=n.results.slice(0,10).map(h=>h.net_pnl*dr()),c=n.results.slice(0,10).map(h=>h.net_pnl>0?"#56B683":"#F18169");return{labels:n.results.slice(0,10).map(h=>h.amount),datasets:[{data:d,backgroundColor:c,borderRadius:4}]}}),s=(d,c)=>c[d],l=()=>{a.value=!a.value};return(d,c)=>(r.openBlock(),r.createElementBlock("div",sE,[r.createElementVNode("div",lE,[r.createElementVNode("div",dE,[cE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Compare your profits or losses based on the size of your positions. Understand how position size influences your trading outcomes. ")]),_:1})]),a.value?(r.openBlock(),r.createBlock(r.unref(Cn),{key:0,class:"size-widget__btn",view:"secondary",icon:"list",size:"sm",onClick:l})):(r.openBlock(),r.createBlock(r.unref(Cn),{key:1,class:"size-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:l}))]),t.results&&t.results.length?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["size-widget__content",{"-chart-active":a.value}])},[a.value?(r.openBlock(),r.createElementBlock("div",uE,[r.createVNode(td,{class:"size-widget__bar",data:i.value,"ticks-callback":s,"y-ticks-callback":r.unref(si),"is-mask":t.isMask,"data-type":"size"},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",hE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.results,u=>(r.openBlock(),r.createElementBlock("div",pE,[r.createElementVNode("div",fE,[r.createElementVNode("div",mE,r.toDisplayString(u.amount)+" lots",1),r.createElementVNode("div",_E,r.toDisplayString(r.unref(_e)(t.isMask,u.total_count,{repeat:3}))+" trades ",1)]),r.createElementVNode("div",gE,[r.createElementVNode("div",{class:r.normalizeClass(["size-widget__card__net-pnl",{"-positive":u.net_pnl>0,"-negative":u.net_pnl<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(u.net_pnl,{isPlus:!0,isFixed:!0}),{repeat:3})),3)])]))),256))]))],2)):(r.openBlock(),r.createBlock(ko,{key:1,absolute:""})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:c[0]||(c[0]=u=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-e7e7b192"]]),yE=t=>(r.pushScopeId("data-v-98670dfc"),t=t(),r.popScopeId(),t),wE={class:"performance-widget"},vE={class:"performance-widget__top"},xE={class:"performance-widget__title-wrapper"},kE=yE(()=>r.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),CE=ve({__name:"PerformanceWidget",props:{performanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){r.ref("week");const n=t,o=e,a=i=>_e(n.isMask,at(i,2)+"%",{repeat:3});return(i,s)=>(r.openBlock(),r.createElementBlock("div",wE,[r.createElementVNode("div",vE,[r.createElementVNode("div",xE,[kE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("The linear graphics widget displays the profit as a percentage of the deposit. ")]),_:1})])]),r.createVNode(r.unref(Du),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":a,isMask:t.isMask},null,8,["data","isMask"]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:s[0]||(s[0]=l=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-98670dfc"]]),Tu=t=>(r.pushScopeId("data-v-174618cb"),t=t(),r.popScopeId(),t),ME={class:"return-widget"},SE={class:"return-widget__content"},LE={class:"return-widget__top"},$E={class:"return-widget__title-wrapper"},DE=Tu(()=>r.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),VE={class:"return-widget__info"},EE={class:"return-widget__total-wrapper"},TE=Tu(()=>r.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),OE={class:"return-widget__total-wrapper__total"},BE={class:"return-widget__points"},PE={class:"return-widget__point"},NE={class:"return-widget__point__title"},AE=Tu(()=>r.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),FE=["innerHTML"],zE=ve({__name:"ReturnWidget",props:{totalReturn:{type:Number,default:0},win:{type:Number,default:0},lose:{type:Number,default:0},returnPeriod:{type:Number,default:0},profitFactor:{type:Number,default:0},daily:{type:Number,default:0},changeRate:{type:Number,default:0},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e,o=t,a=r.computed(()=>`${44+(String(at(o.returnPeriod,2)).length-1)*16}px`),i=r.reactive({returnPeriod:0,changeRate:0}),s=r.computed(()=>[{title:"Average return per trade",value:o.totalReturn,options:{isPlus:!0,isFixed:!0},class:o.totalReturn===0?"":o.totalReturn>0?"-win":"-loss"},{title:"Daily return",value:o.daily,options:{isPlus:!0,isFixed:!0},class:o.daily===0?"":o.daily>0?"-win":"-loss"},{title:"Return on winners",value:o.win,class:"-win"},{title:"Return on losers",value:o.lose,class:"-loss"}]),l=r.computed(()=>o.returnPeriod>0),d=r.computed(()=>o.returnPeriod<0),c=r.computed(()=>o.profitFactor>1?"-positive":"-negative"),u=r.computed(()=>o.profitFactor>0?`Your profit factor is ${_e(o.isMask,at(o.profitFactor),{repeat:5})}. <br /> You earn ${_e(o.isMask,Ie(o.profitFactor),{repeat:5,prefix:"$"})} on every ${_e(o.isMask,"$1",{repeat:5,prefix:"$"})} loss.`:`Your profit factor is ${_e(o.isMask,at(o.profitFactor),{repeat:5})}. <br/> You loss ${_e(o.isMask,Ie(Math.abs(o.profitFactor)),{repeat:5,prefix:"$"})} on every ${_e(o.isMask,"$1",{repeat:5,prefix:"$"})} earn. `);return r.watch(()=>o.returnPeriod,h=>{$o.to(i,{duration:1.5,returnPeriod:h,changeRate:o.changeRate})},{immediate:!0}),(h,p)=>(r.openBlock(),r.createElementBlock("div",ME,[r.createElementVNode("div",SE,[r.createElementVNode("div",LE,[r.createElementVNode("div",$E,[DE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("This widget displays an increase in NET profit in dollars and percentage relative to the deposit for the specified period you have chosen. ")]),_:1})])]),r.createElementVNode("div",VE,[r.createElementVNode("div",EE,[TE,r.createElementVNode("div",OE,[r.createElementVNode("div",{class:r.normalizeClass(["return-widget__total-wrapper__value",{"-positive":l.value,"-negative":d.value}]),style:r.normalizeStyle({minWidth:a.value})},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(i.returnPeriod,{isPlus:!0,isFixed:!0}),{repeat:5})),7),o.changeRate?(r.openBlock(),r.createBlock(r.unref(Yd),{key:0,percentage:"",class:"return-widget__total-wrapper__chips",isHidden:t.isMask,delta:i.changeRate},null,8,["isHidden","delta"])):r.createCommentVNode("",!0)])]),r.createElementVNode("div",BE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,f=>(r.openBlock(),r.createElementBlock("div",PE,[r.createElementVNode("div",NE,r.toDisplayString(f.title),1),AE,r.createElementVNode("div",{class:r.normalizeClass(["return-widget__point__value",f.class?f.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(f.value,f.options),{repeat:5,prefix:"$"})),3)]))),256))])])]),t.profitFactor?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["return-widget__profit",c.value])},[r.createVNode(r.unref(Le),{icon:"tip",class:"return-widget__profit__icon"}),r.createElementVNode("div",{class:"return-widget__profit__text",innerHTML:u.value},null,8,FE)],2)):r.createCommentVNode("",!0),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:1,onRefresh:p[0]||(p[0]=f=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-174618cb"]]),B6=t=>(r.pushScopeId("data-v-fca156a0"),t=t(),r.popScopeId(),t),RE={class:"top-positions-widget"},HE={class:"top-positions-widget__top"},IE={class:"top-positions-widget__title-wrapper"},jE=B6(()=>r.createElementVNode("div",{class:"top-positions-widget__title"},"Top Positions",-1)),ZE={key:0,class:"top-positions-widget__returns"},YE=["onClick"],WE={class:"top-positions-widget__return__left"},UE=B6(()=>r.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),qE={class:"top-positions-widget__return__pair"},GE={class:"top-positions-widget__return__right"},XE={class:"top-positions-widget__return__pnl"},KE=ve({__name:"TopPositionsWidget",props:{topPositions:{type:Array,default:[]},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh","onPairClick"],setup(t,{emit:e}){r.ref("week");const n=e;return(o,a)=>(r.openBlock(),r.createElementBlock("div",RE,[r.createElementVNode("div",HE,[r.createElementVNode("div",IE,[jE,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Helps you find the top profitable positions. We calculate only net PNL, taking into account commission and funding. ")]),_:1})])]),t.topPositions&&t.topPositions.length?(r.openBlock(),r.createElementBlock("div",ZE,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.topPositions,i=>(r.openBlock(),r.createElementBlock("div",{class:"top-positions-widget__return",onClick:s=>n("onPairClick",i)},[r.createElementVNode("div",WE,[UE,r.createElementVNode("div",qE,[r.createTextVNode(r.toDisplayString(r.unref(cr)(i.pair))+" ",1),r.createVNode(r.unref(Le),{icon:"chevron-right-small"})])]),r.createElementVNode("div",GE,[r.createElementVNode("div",XE,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(i.pnl,{isFixed:!0,isPlus:!0},{repeat:5}))),1),r.createElementVNode("div",{class:r.normalizeClass(["top-positions-widget__return__roi",i.roi<0?"-negative":"-positive"])},[r.createVNode(r.unref(Le),{icon:"bxs_up-arrow"}),r.createElementVNode("span",null,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(i.roi,{isPercentage:!0,isFixed:!0},{repeat:2}))),1)],2)])],8,YE))),256))])):(r.openBlock(),r.createBlock(r.unref(ko),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:a[0]||(a[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-fca156a0"]]),Ou=t=>(r.pushScopeId("data-v-a3559196"),t=t(),r.popScopeId(),t),QE={class:"trade-widget"},JE={class:"trade-widget__content"},eT={class:"trade-widget__top"},tT={class:"trade-widget__title-wrapper"},nT=Ou(()=>r.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),oT={class:"trade-widget__info"},aT={class:"trade-widget__total-wrapper"},rT=Ou(()=>r.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),iT={class:"trade-widget__total-wrapper__total"},sT={class:"trade-widget__total-wrapper__value"},lT={class:"trade-widget__points"},dT={class:"trade-widget__point"},cT={class:"trade-widget__point__title"},uT=Ou(()=>r.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),hT=ve({__name:"TradePerformanceWidget",props:{totalTrades:Number,minDate:Date,tradePoints:Array,isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=r.reactive({totalTrades:0}),o=e,a=t;return r.watch(()=>a.totalTrades,i=>{$o.to(n,{duration:1.5,totalTrades:i})},{immediate:!0}),(i,s)=>(r.openBlock(),r.createElementBlock("div",QE,[r.createElementVNode("div",JE,[r.createElementVNode("div",eT,[r.createElementVNode("div",tT,[nT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("It displays the number of profitable and unprofitable positions. This widget is very useful for understanding your trading opportunities. ")]),_:1})])]),r.createElementVNode("div",oT,[r.createElementVNode("div",aT,[rT,r.createElementVNode("div",iT,[r.createElementVNode("div",sT,r.toDisplayString(r.unref(_e)(t.isMask,Math.floor(n.totalTrades),{repeat:5})),1)])]),r.createElementVNode("div",lT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tradePoints,l=>(r.openBlock(),r.createElementBlock("div",dT,[r.createElementVNode("div",cT,r.toDisplayString(l.title),1),uT,r.createElementVNode("div",{class:r.normalizeClass(["trade-widget__point__value",l.class?l.class:""])},r.toDisplayString(r.unref(_e)(t.isMask,l.value,{repeat:5})),3)]))),256))])])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:s[0]||(s[0]=l=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-a3559196"]]),Bu=t=>(r.pushScopeId("data-v-6e6e0081"),t=t(),r.popScopeId(),t),pT={class:"winrate-widget"},fT={class:"winrate-widget__winrate"},mT={class:"winrate-widget__title-wrapper"},_T=Bu(()=>r.createElementVNode("div",{class:"winrate-widget__title"},"Winrate",-1)),gT={class:"winrate-widget__chart"},bT={class:"winrate-widget__data"},yT={class:"winrate-widget__data_value"},wT=Bu(()=>r.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),vT={class:"winrate-widget__average-rr"},xT={class:"winrate-widget__title-wrapper"},kT=Bu(()=>r.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),CT=ve({__name:"WinrateWidget",props:{winrate:{type:Number,default:0},minRR:{type:Number,default:0},averageRR:{type:Number,default:0},maxRR:{type:Number,default:0},isMask:{type:Boolean,default:!1},requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=e;return(o,a)=>(r.openBlock(),r.createElementBlock("div",pT,[r.createElementVNode("div",fT,[r.createElementVNode("div",mT,[_T,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Displays the percentage of your successful positions. ")]),_:1})]),r.createElementVNode("div",gT,[r.renderSlot(o.$slots,"roundSlider",{},void 0,!0),r.createElementVNode("div",bT,[r.createElementVNode("div",yT,r.toDisplayString(r.unref(_e)(t.isMask,r.unref(at)(t.winrate,2)))+"% ",1),wT])])]),r.createElementVNode("div",vT,[r.createElementVNode("div",xT,[kT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Risk Reward, defines the ratio of potential profit to loss you can get. ")]),_:1})]),r.createVNode(r.unref(y_),{avg:t.averageRR,min:t.minRR,max:t.maxRR,isMask:t.isMask},null,8,["avg","min","max","isMask"])]),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:a[0]||(a[0]=i=>n("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-6e6e0081"]]),P6=t=>(r.pushScopeId("data-v-c120856a"),t=t(),r.popScopeId(),t),MT={class:"oh-widget"},ST={class:"oh-widget__top"},LT={class:"oh-widget__title-wrapper"},$T=P6(()=>r.createElementVNode("div",{class:"oh-widget__title"},"Result by Open Hour",-1)),DT={key:0},VT={key:1,class:"oh-widget__table-wrapper"},ET={class:"oh-widget__list"},TT=P6(()=>r.createElementVNode("thead",{class:"oh-widget__list__header"},[r.createElementVNode("th",null,"Time"),r.createElementVNode("th",null,"Trades"),r.createElementVNode("th",null,"Result")],-1)),OT={class:"oh-widget__list__body"},BT={class:"oh-widget__list__point"},PT={class:"oh-widget__list__subpoint"},NT={class:"oh-widget__list__subpoint"},AT=ve({__name:"OpenHourWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=[{id:0,name:"Asia",key:"asia_session"},{id:1,name:"London",key:"london_session"},{id:2,name:"NY",key:"new_york_session"}],o=t,a=e,i=r.ref(!1),s=r.ref({id:0,name:"Asia",key:"asia_session"}),l=r.computed(()=>o.results?o.results[s.value.key]:{}),d=r.computed(()=>{const p=Object.values(l.value).slice(0,10).map(_=>_.net_pnl_total*dr()),f=Object.values(l.value).slice(0,10).map(_=>_.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(l.value).slice(0,10).map(_=>c(_)),datasets:[{data:p,backgroundColor:f,borderRadius:4}]}}),c=p=>{const[f,_]=p.split(":").map(Number),g=`${f}:59`;return`${p} - ${g}`},u=()=>{i.value=!i.value},h=(p,f)=>f[p];return(p,f)=>(r.openBlock(),r.createElementBlock("div",MT,[r.createElementVNode("div",ST,[r.createElementVNode("div",LT,[$T,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("Analyze your trading performance based on the hour of the day and trading session. Switch between different time zones to track results by market. ")]),_:1})]),i.value?(r.openBlock(),r.createBlock(r.unref(Cn),{key:0,class:"oh-widget__btn",view:"secondary",icon:"list",size:"sm",onClick:u})):(r.openBlock(),r.createBlock(r.unref(Cn),{key:1,class:"oh-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:u}))]),r.createElementVNode("div",{class:r.normalizeClass(["oh-widget__content",{"-chart-active":i.value}])},[r.createVNode(r.unref(Pc),{class:"oh-widget__switcher",modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=_=>s.value=_),options:n},null,8,["modelValue"]),l.value&&Object.values(l.value).length?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.value?(r.openBlock(),r.createElementBlock("div",DT,[r.createVNode(td,{class:"oh-widget__bar",data:d.value,"ticks-callback":h,"y-ticks-callback":r.unref(si),"is-mask":t.isMask,"data-type":"oh"},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("div",VT,[r.createElementVNode("table",ET,[TT,r.createElementVNode("tbody",OT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value,(_,m,g)=>(r.openBlock(),r.createElementBlock("tr",BT,[r.createElementVNode("td",PT,r.toDisplayString(c(m)),1),r.createElementVNode("td",NT,r.toDisplayString(r.unref(_e)(t.isMask,_.trades_count,{repeat:3})),1),r.createElementVNode("td",{class:r.normalizeClass(["oh-widget__list__subpoint",{"-positive":_.net_pnl_total>0,"-negative":_.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(_.net_pnl_total,{isPlus:!0,isFixed:!0}),{repeat:3})),3)]))),256))])])]))],64)):(r.openBlock(),r.createBlock(ko,{key:1,absolute:""}))],2),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:0,onRefresh:f[1]||(f[1]=_=>a("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-c120856a"]]),N6=t=>(r.pushScopeId("data-v-397d63e3"),t=t(),r.popScopeId(),t),FT={class:"duration-widget"},zT={class:"duration-widget__top"},RT={class:"duration-widget__title-wrapper"},HT=N6(()=>r.createElementVNode("div",{class:"duration-widget__title"},"Result by time duration",-1)),IT={key:0},jT={key:1,class:"duration-widget__list"},ZT=N6(()=>r.createElementVNode("thead",{class:"duration-widget__list__header"},[r.createElementVNode("th",null,"Time"),r.createElementVNode("th",null,"Trades"),r.createElementVNode("th",null,"Result")],-1)),YT={class:"duration-widget__list__body"},WT={class:"duration-widget__list__point"},UT={class:"duration-widget__list__subpoint"},qT={class:"duration-widget__list__subpoint"},GT=ve({__name:"DurationWidget",props:{results:Object,isMask:Boolean,requiredUpdate:{type:Boolean,default:!1}},emits:["refresh"],setup(t,{emit:e}){const n=t,o=e,a=r.ref(!1),i=r.computed(()=>{const c=Object.values(n.results).slice(0,10).map(h=>h.net_pnl_total*dr()),u=Object.values(n.results).slice(0,10).map(h=>h.net_pnl_total>0?"#56B683":"#F18169");return{labels:Object.keys(n.results).slice(0,10).map(h=>s(Number(h))),datasets:[{data:c,backgroundColor:u,borderRadius:4}]}});function s(c){const u=[{min:0,max:30,label:"0-30m"},{min:30,max:60,label:"30m - 1h"},{min:60,max:240,label:"1-4h"},{min:240,max:480,label:"4-12h"},{min:480,max:1440,label:"12-24h"},{min:1440,max:4320,label:"1-3d"},{min:4320,max:10080,label:"3-7d"},{min:10080,max:1/0,label:"7d+"}];for(const h of u)if(c>=h.min&&c<h.max)return h.label;return"Invalid input"}const l=()=>{a.value=!a.value},d=(c,u)=>u[c];return(c,u)=>(r.openBlock(),r.createElementBlock("div",FT,[r.createElementVNode("div",zT,[r.createElementVNode("div",RT,[HT,r.createVNode(r.unref(Ct),{alternative:""},{default:r.withCtx(()=>[r.createTextVNode("See how your trades perform based on their duration. Filter by time intervals to identify patterns in short or long-term trades. ")]),_:1})]),a.value?(r.openBlock(),r.createBlock(r.unref(Cn),{key:0,class:"duration-widget__btn",view:"secondary",icon:"list",size:"sm",onClick:l})):(r.openBlock(),r.createBlock(r.unref(Cn),{key:1,class:"duration-widget__btn",view:"secondary",icon:"pie-chart",size:"sm",onClick:l}))]),t.results&&Object.values(t.results).length?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["duration-widget__content",{"-chart-active":a.value}])},[a.value?(r.openBlock(),r.createElementBlock("div",IT,[r.createVNode(td,{class:"duration-widget__bar",data:i.value,"ticks-callback":d,"y-ticks-callback":r.unref(si),"data-type":"duration","is-mask":t.isMask},null,8,["data","y-ticks-callback","is-mask"])])):(r.openBlock(),r.createElementBlock("table",jT,[ZT,r.createElementVNode("tbody",YT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.results,(h,p,f)=>(r.openBlock(),r.createElementBlock("tr",WT,[r.createElementVNode("td",UT,r.toDisplayString(s(Number(p))),1),r.createElementVNode("td",qT,r.toDisplayString(r.unref(_e)(t.isMask,h.trades_count,{repeat:3})),1),r.createElementVNode("td",{class:r.normalizeClass(["duration-widget__list__subpoint",{"-positive":h.net_pnl_total>0,"-negative":h.net_pnl_total<0}])},r.toDisplayString(r.unref(_e)(t.isMask,r.unref(Ie)(h.net_pnl_total,{isPlus:!0,isFixed:!0}),{repeat:3})),3)]))),256))])]))],2)):(r.openBlock(),r.createBlock(ko,{key:1,absolute:""})),t.requiredUpdate?(r.openBlock(),r.createBlock(dn,{key:2,onRefresh:u[0]||(u[0]=h=>o("refresh"))})):r.createCommentVNode("",!0)]))}},[["__scopeId","data-v-397d63e3"]]);class rr extends Error{}class XT extends rr{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class KT extends rr{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class QT extends rr{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ur extends rr{}class A6 extends rr{constructor(e){super(`Invalid unit ${e}`)}}class jt extends rr{}class ma extends rr{constructor(){super("Zone is an abstract class")}}const le="numeric",Wn="short",vn="long",nd={year:le,month:le,day:le},F6={year:le,month:Wn,day:le},JT={year:le,month:Wn,day:le,weekday:Wn},z6={year:le,month:vn,day:le},R6={year:le,month:vn,day:le,weekday:vn},H6={hour:le,minute:le},I6={hour:le,minute:le,second:le},j6={hour:le,minute:le,second:le,timeZoneName:Wn},Z6={hour:le,minute:le,second:le,timeZoneName:vn},Y6={hour:le,minute:le,hourCycle:"h23"},W6={hour:le,minute:le,second:le,hourCycle:"h23"},U6={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:Wn},q6={hour:le,minute:le,second:le,hourCycle:"h23",timeZoneName:vn},G6={year:le,month:le,day:le,hour:le,minute:le},X6={year:le,month:le,day:le,hour:le,minute:le,second:le},K6={year:le,month:Wn,day:le,hour:le,minute:le},Q6={year:le,month:Wn,day:le,hour:le,minute:le,second:le},eO={year:le,month:Wn,day:le,weekday:Wn,hour:le,minute:le},J6={year:le,month:vn,day:le,hour:le,minute:le,timeZoneName:Wn},em={year:le,month:vn,day:le,hour:le,minute:le,second:le,timeZoneName:Wn},tm={year:le,month:vn,day:le,weekday:vn,hour:le,minute:le,timeZoneName:vn},nm={year:le,month:vn,day:le,weekday:vn,hour:le,minute:le,second:le,timeZoneName:vn};class ms{get type(){throw new ma}get name(){throw new ma}get ianaName(){return this.name}get isUniversal(){throw new ma}offsetName(e,n){throw new ma}formatOffset(e,n){throw new ma}offset(e){throw new ma}equals(e){throw new ma}get isValid(){throw new ma}}let Pu=null;class od extends ms{static get instance(){return Pu===null&&(Pu=new od),Pu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:o}){return Lm(e,n,o)}formatOffset(e,n){return ys(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ad={};function tO(t){return ad[t]||(ad[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ad[t]}const nO={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function oO(t,e){const n=t.format(e).replace(/\u200E/g,""),o=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,i,s,l,d,c,u]=o;return[s,a,i,l,d,c,u]}function aO(t,e){const n=t.formatToParts(e),o=[];for(let a=0;a<n.length;a++){const{type:i,value:s}=n[a],l=nO[i];i==="era"?o[l]=s:we(l)||(o[l]=parseInt(s,10))}return o}let rd={};class No extends ms{static create(e){return rd[e]||(rd[e]=new No(e)),rd[e]}static resetCache(){rd={},ad={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=No.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:o}){return Lm(e,n,o,this.name)}formatOffset(e,n){return ys(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const o=tO(this.name);let[a,i,s,l,d,c,u]=o.formatToParts?aO(o,n):oO(o,n);l==="BC"&&(a=-Math.abs(a)+1);const p=cd({year:a,month:i,day:s,hour:d===24?0:d,minute:c,second:u,millisecond:0});let f=+n;const _=f%1e3;return f-=_>=0?_:1e3+_,(p-f)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let om={};function rO(t,e={}){const n=JSON.stringify([t,e]);let o=om[n];return o||(o=new Intl.ListFormat(t,e),om[n]=o),o}let Nu={};function Au(t,e={}){const n=JSON.stringify([t,e]);let o=Nu[n];return o||(o=new Intl.DateTimeFormat(t,e),Nu[n]=o),o}let Fu={};function iO(t,e={}){const n=JSON.stringify([t,e]);let o=Fu[n];return o||(o=new Intl.NumberFormat(t,e),Fu[n]=o),o}let zu={};function sO(t,e={}){const{base:n,...o}=e,a=JSON.stringify([t,o]);let i=zu[a];return i||(i=new Intl.RelativeTimeFormat(t,e),zu[a]=i),i}let _s=null;function lO(){return _s||(_s=new Intl.DateTimeFormat().resolvedOptions().locale,_s)}let am={};function dO(t){let e=am[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,am[t]=e}return e}function cO(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let o,a;try{o=Au(t).resolvedOptions(),a=t}catch{const d=t.substring(0,n);o=Au(d).resolvedOptions(),a=d}const{numberingSystem:i,calendar:s}=o;return[a,i,s]}}function uO(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function hO(t){const e=[];for(let n=1;n<=12;n++){const o=be.utc(2009,n,1);e.push(t(o))}return e}function pO(t){const e=[];for(let n=1;n<=7;n++){const o=be.utc(2016,11,13+n);e.push(t(o))}return e}function id(t,e,n,o){const a=t.listingMode();return a==="error"?null:a==="en"?n(e):o(e)}function fO(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class mO{constructor(e,n,o){this.padTo=o.padTo||0,this.floor=o.floor||!1;const{padTo:a,floor:i,...s}=o;if(!n||Object.keys(s).length>0){const l={useGrouping:!1,...o};o.padTo>0&&(l.minimumIntegerDigits=o.padTo),this.inf=iO(e,l)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):Uu(e,3);return St(n,this.padTo)}}}class _O{constructor(e,n,o){this.opts=o,this.originalZone=void 0;let a;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const s=-1*(e.offset/60),l=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;e.offset!==0&&No.create(l).valid?(a=l,this.dt=e):(a="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,a=e.zone.name):(a="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||a,this.dtf=Au(n,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const o=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:o}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class gO{constructor(e,n,o){this.opts={style:"long",...o},!n&&km()&&(this.rtf=sO(e,o))}format(e,n){return this.rtf?this.rtf.format(e,n):RO(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const bO={firstDay:1,minimalDays:4,weekend:[6,7]};let Ke=class Is{static fromOpts(e){return Is.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,o,a,i=!1){const s=e||ft.defaultLocale,l=s||(i?"en-US":lO()),d=n||ft.defaultNumberingSystem,c=o||ft.defaultOutputCalendar,u=Yu(a)||ft.defaultWeekSettings;return new Is(l,d,c,u,s)}static resetCache(){_s=null,Nu={},Fu={},zu={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:o,weekSettings:a}={}){return Is.create(e,n,o,a)}constructor(e,n,o,a,i){const[s,l,d]=cO(e);this.locale=s,this.numberingSystem=n||l||null,this.outputCalendar=o||d||null,this.weekSettings=a,this.intl=uO(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=fO(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Is.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Yu(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return id(this,e,Vm,()=>{const o=n?{month:e,day:"numeric"}:{month:e},a=n?"format":"standalone";return this.monthsCache[a][e]||(this.monthsCache[a][e]=hO(i=>this.extract(i,o,"month"))),this.monthsCache[a][e]})}weekdays(e,n=!1){return id(this,e,Om,()=>{const o=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},a=n?"format":"standalone";return this.weekdaysCache[a][e]||(this.weekdaysCache[a][e]=pO(i=>this.extract(i,o,"weekday"))),this.weekdaysCache[a][e]})}meridiems(){return id(this,void 0,()=>Bm,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[be.utc(2016,11,13,9),be.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return id(this,e,Pm,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[be.utc(-40,1,1),be.utc(2017,1,1)].map(o=>this.extract(o,n,"era"))),this.eraCache[e]})}extract(e,n,o){const a=this.dtFormatter(e,n),i=a.formatToParts(),s=i.find(l=>l.type.toLowerCase()===o);return s?s.value:null}numberFormatter(e={}){return new mO(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new _O(e,this.intl,n)}relFormatter(e={}){return new gO(this.intl,this.isEnglish(),e)}listFormatter(e={}){return rO(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Cm()?dO(this.locale):bO}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Ru=null;class Kt extends ms{static get utcInstance(){return Ru===null&&(Ru=new Kt(0)),Ru}static instance(e){return e===0?Kt.utcInstance:new Kt(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Kt(ud(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ys(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ys(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return ys(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class yO extends ms{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function _a(t,e){if(we(t)||t===null)return e;if(t instanceof ms)return t;if(MO(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?od.instance:n==="utc"||n==="gmt"?Kt.utcInstance:Kt.parseSpecifier(n)||No.create(t)}else return ga(t)?Kt.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new yO(t)}const Hu={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},rm={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},wO=Hu.hanidec.replace(/[\[|\]]/g,"").split("");function vO(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(t[n].search(Hu.hanidec)!==-1)e+=wO.indexOf(t[n]);else for(const a in rm){const[i,s]=rm[a];o>=i&&o<=s&&(e+=o-i)}}return parseInt(e,10)}else return e}let qr={};function xO(){qr={}}function Un({numberingSystem:t},e=""){const n=t||"latn";return qr[n]||(qr[n]={}),qr[n][e]||(qr[n][e]=new RegExp(`${Hu[n]}${e}`)),qr[n][e]}let im=()=>Date.now(),sm="system",lm=null,dm=null,cm=null,um=60,hm,pm=null;class ft{static get now(){return im}static set now(e){im=e}static set defaultZone(e){sm=e}static get defaultZone(){return _a(sm,od.instance)}static get defaultLocale(){return lm}static set defaultLocale(e){lm=e}static get defaultNumberingSystem(){return dm}static set defaultNumberingSystem(e){dm=e}static get defaultOutputCalendar(){return cm}static set defaultOutputCalendar(e){cm=e}static get defaultWeekSettings(){return pm}static set defaultWeekSettings(e){pm=Yu(e)}static get twoDigitCutoffYear(){return um}static set twoDigitCutoffYear(e){um=e%100}static get throwOnInvalid(){return hm}static set throwOnInvalid(e){hm=e}static resetCaches(){Ke.resetCache(),No.resetCache(),be.resetCache(),xO()}}class qn{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const fm=[0,31,59,90,120,151,181,212,243,273,304,334],mm=[0,31,60,91,121,152,182,213,244,274,305,335];function En(t,e){return new qn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Iu(t,e,n){const o=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&o.setUTCFullYear(o.getUTCFullYear()-1900);const a=o.getUTCDay();return a===0?7:a}function _m(t,e,n){return n+(gs(t)?mm:fm)[e-1]}function gm(t,e){const n=gs(t)?mm:fm,o=n.findIndex(i=>i<e),a=e-n[o];return{month:o+1,day:a}}function ju(t,e){return(t-e+7)%7+1}function sd(t,e=4,n=1){const{year:o,month:a,day:i}=t,s=_m(o,a,i),l=ju(Iu(o,a,i),n);let d=Math.floor((s-l+14-e)/7),c;return d<1?(c=o-1,d=bs(c,e,n)):d>bs(o,e,n)?(c=o+1,d=1):c=o,{weekYear:c,weekNumber:d,weekday:l,...pd(t)}}function bm(t,e=4,n=1){const{weekYear:o,weekNumber:a,weekday:i}=t,s=ju(Iu(o,1,e),n),l=Xr(o);let d=a*7+i-s-7+e,c;d<1?(c=o-1,d+=Xr(c)):d>l?(c=o+1,d-=Xr(o)):c=o;const{month:u,day:h}=gm(c,d);return{year:c,month:u,day:h,...pd(t)}}function Zu(t){const{year:e,month:n,day:o}=t,a=_m(e,n,o);return{year:e,ordinal:a,...pd(t)}}function ym(t){const{year:e,ordinal:n}=t,{month:o,day:a}=gm(e,n);return{year:e,month:o,day:a,...pd(t)}}function wm(t,e){if(!we(t.localWeekday)||!we(t.localWeekNumber)||!we(t.localWeekYear)){if(!we(t.weekday)||!we(t.weekNumber)||!we(t.weekYear))throw new Ur("Cannot mix locale-based week fields with ISO-based week fields");return we(t.localWeekday)||(t.weekday=t.localWeekday),we(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),we(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function kO(t,e=4,n=1){const o=ld(t.weekYear),a=Tn(t.weekNumber,1,bs(t.weekYear,e,n)),i=Tn(t.weekday,1,7);return o?a?i?!1:En("weekday",t.weekday):En("week",t.weekNumber):En("weekYear",t.weekYear)}function CO(t){const e=ld(t.year),n=Tn(t.ordinal,1,Xr(t.year));return e?n?!1:En("ordinal",t.ordinal):En("year",t.year)}function vm(t){const e=ld(t.year),n=Tn(t.month,1,12),o=Tn(t.day,1,dd(t.year,t.month));return e?n?o?!1:En("day",t.day):En("month",t.month):En("year",t.year)}function xm(t){const{hour:e,minute:n,second:o,millisecond:a}=t,i=Tn(e,0,23)||e===24&&n===0&&o===0&&a===0,s=Tn(n,0,59),l=Tn(o,0,59),d=Tn(a,0,999);return i?s?l?d?!1:En("millisecond",a):En("second",o):En("minute",n):En("hour",e)}function we(t){return typeof t>"u"}function ga(t){return typeof t=="number"}function ld(t){return typeof t=="number"&&t%1===0}function MO(t){return typeof t=="string"}function SO(t){return Object.prototype.toString.call(t)==="[object Date]"}function km(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Cm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function LO(t){return Array.isArray(t)?t:[t]}function Mm(t,e,n){if(t.length!==0)return t.reduce((o,a)=>{const i=[e(a),a];return o&&n(o[0],i[0])===o[0]?o:i},null)[1]}function $O(t,e){return e.reduce((n,o)=>(n[o]=t[o],n),{})}function Gr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Yu(t){if(t==null)return null;if(typeof t!="object")throw new jt("Week settings must be an object");if(!Tn(t.firstDay,1,7)||!Tn(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Tn(e,1,7)))throw new jt("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Tn(t,e,n){return ld(t)&&t>=e&&t<=n}function DO(t,e){return t-e*Math.floor(t/e)}function St(t,e=2){const n=t<0;let o;return n?o="-"+(""+-t).padStart(e,"0"):o=(""+t).padStart(e,"0"),o}function ba(t){if(!(we(t)||t===null||t===""))return parseInt(t,10)}function ir(t){if(!(we(t)||t===null||t===""))return parseFloat(t)}function Wu(t){if(!(we(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function Uu(t,e,n=!1){const o=10**e;return(n?Math.trunc:Math.round)(t*o)/o}function gs(t){return t%4===0&&(t%100!==0||t%400===0)}function Xr(t){return gs(t)?366:365}function dd(t,e){const n=DO(e-1,12)+1,o=t+(e-n)/12;return n===2?gs(o)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function cd(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Sm(t,e,n){return-ju(Iu(t,1,e),n)+e-1}function bs(t,e=4,n=1){const o=Sm(t,e,n),a=Sm(t+1,e,n);return(Xr(t)-o+a)/7}function qu(t){return t>99?t:t>ft.twoDigitCutoffYear?1900+t:2e3+t}function Lm(t,e,n,o=null){const a=new Date(t),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};o&&(i.timeZone=o);const s={timeZoneName:e,...i},l=new Intl.DateTimeFormat(n,s).formatToParts(a).find(d=>d.type.toLowerCase()==="timezonename");return l?l.value:null}function ud(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const o=parseInt(e,10)||0,a=n<0||Object.is(n,-0)?-o:o;return n*60+a}function $m(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new jt(`Invalid unit value ${t}`);return e}function hd(t,e){const n={};for(const o in t)if(Gr(t,o)){const a=t[o];if(a==null)continue;n[e(o)]=$m(a)}return n}function ys(t,e){const n=Math.trunc(Math.abs(t/60)),o=Math.trunc(Math.abs(t%60)),a=t>=0?"+":"-";switch(e){case"short":return`${a}${St(n,2)}:${St(o,2)}`;case"narrow":return`${a}${n}${o>0?`:${o}`:""}`;case"techie":return`${a}${St(n,2)}${St(o,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function pd(t){return $O(t,["hour","minute","second","millisecond"])}const VO=["January","February","March","April","May","June","July","August","September","October","November","December"],Dm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],EO=["J","F","M","A","M","J","J","A","S","O","N","D"];function Vm(t){switch(t){case"narrow":return[...EO];case"short":return[...Dm];case"long":return[...VO];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Em=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Tm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],TO=["M","T","W","T","F","S","S"];function Om(t){switch(t){case"narrow":return[...TO];case"short":return[...Tm];case"long":return[...Em];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Bm=["AM","PM"],OO=["Before Christ","Anno Domini"],BO=["BC","AD"],PO=["B","A"];function Pm(t){switch(t){case"narrow":return[...PO];case"short":return[...BO];case"long":return[...OO];default:return null}}function NO(t){return Bm[t.hour<12?0:1]}function AO(t,e){return Om(e)[t.weekday-1]}function FO(t,e){return Vm(e)[t.month-1]}function zO(t,e){return Pm(e)[t.year<0?0:1]}function RO(t,e,n="always",o=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&i){const h=t==="days";switch(e){case 1:return h?"tomorrow":`next ${a[t][0]}`;case-1:return h?"yesterday":`last ${a[t][0]}`;case 0:return h?"today":`this ${a[t][0]}`}}const s=Object.is(e,-0)||e<0,l=Math.abs(e),d=l===1,c=a[t],u=o?d?c[1]:c[2]||c[1]:d?a[t][0]:t;return s?`${l} ${u} ago`:`in ${l} ${u}`}function Nm(t,e){let n="";for(const o of t)o.literal?n+=o.val:n+=e(o.val);return n}const HO={D:nd,DD:F6,DDD:z6,DDDD:R6,t:H6,tt:I6,ttt:j6,tttt:Z6,T:Y6,TT:W6,TTT:U6,TTTT:q6,f:G6,ff:K6,fff:J6,ffff:tm,F:X6,FF:Q6,FFF:em,FFFF:nm};class Zt{static create(e,n={}){return new Zt(e,n)}static parseFormat(e){let n=null,o="",a=!1;const i=[];for(let s=0;s<e.length;s++){const l=e.charAt(s);l==="'"?(o.length>0&&i.push({literal:a||/^\s+$/.test(o),val:o}),n=null,o="",a=!a):a||l===n?o+=l:(o.length>0&&i.push({literal:/^\s+$/.test(o),val:o}),o=l,n=l)}return o.length>0&&i.push({literal:a||/^\s+$/.test(o),val:o}),i}static macroTokenToFormatOpts(e){return HO[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return St(e,n);const o={...this.opts};return n>0&&(o.padTo=n),this.loc.numberFormatter(o).format(e)}formatDateTimeFromString(e,n){const o=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",i=(f,_)=>this.loc.extract(e,f,_),s=f=>e.isOffsetFixed&&e.offset===0&&f.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,f.format):"",l=()=>o?NO(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),d=(f,_)=>o?FO(e,f):i(_?{month:f}:{month:f,day:"numeric"},"month"),c=(f,_)=>o?AO(e,f):i(_?{weekday:f}:{weekday:f,month:"long",day:"numeric"},"weekday"),u=f=>{const _=Zt.macroTokenToFormatOpts(f);return _?this.formatWithSystemDefault(e,_):f},h=f=>o?zO(e,f):i({era:f},"era"),p=f=>{switch(f){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return a?i({day:"numeric"},"day"):this.num(e.day);case"dd":return a?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return a?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return a?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return d("short",!0);case"LLLL":return d("long",!0);case"LLLLL":return d("narrow",!0);case"M":return a?i({month:"numeric"},"month"):this.num(e.month);case"MM":return a?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return d("short",!1);case"MMMM":return d("long",!1);case"MMMMM":return d("narrow",!1);case"y":return a?i({year:"numeric"},"year"):this.num(e.year);case"yy":return a?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return a?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return a?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(f)}};return Nm(Zt.parseFormat(n),p)}formatDurationFromString(e,n){const o=d=>{switch(d[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},a=d=>c=>{const u=o(c);return u?this.num(d.get(u),c.length):c},i=Zt.parseFormat(n),s=i.reduce((d,{literal:c,val:u})=>c?d:d.concat(u),[]),l=e.shiftTo(...s.map(o).filter(d=>d));return Nm(i,a(l))}}const Am=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Kr(...t){const e=t.reduce((n,o)=>n+o.source,"");return RegExp(`^${e}$`)}function Qr(...t){return e=>t.reduce(([n,o,a],i)=>{const[s,l,d]=i(e,a);return[{...n,...s},l||o,d]},[{},null,1]).slice(0,2)}function Jr(t,...e){if(t==null)return[null,null];for(const[n,o]of e){const a=n.exec(t);if(a)return o(a)}return[null,null]}function Fm(...t){return(e,n)=>{const o={};let a;for(a=0;a<t.length;a++)o[t[a]]=ba(e[n+a]);return[o,null,n+a]}}const zm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,IO=`(?:${zm.source}?(?:\\[(${Am.source})\\])?)?`,Gu=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Rm=RegExp(`${Gu.source}${IO}`),Xu=RegExp(`(?:T${Rm.source})?`),jO=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ZO=/(\d{4})-?W(\d\d)(?:-?(\d))?/,YO=/(\d{4})-?(\d{3})/,WO=Fm("weekYear","weekNumber","weekDay"),UO=Fm("year","ordinal"),qO=/(\d{4})-(\d\d)-(\d\d)/,Hm=RegExp(`${Gu.source} ?(?:${zm.source}|(${Am.source}))?`),GO=RegExp(`(?: ${Hm.source})?`);function ei(t,e,n){const o=t[e];return we(o)?n:ba(o)}function XO(t,e){return[{year:ei(t,e),month:ei(t,e+1,1),day:ei(t,e+2,1)},null,e+3]}function ti(t,e){return[{hours:ei(t,e,0),minutes:ei(t,e+1,0),seconds:ei(t,e+2,0),milliseconds:Wu(t[e+3])},null,e+4]}function ws(t,e){const n=!t[e]&&!t[e+1],o=ud(t[e+1],t[e+2]),a=n?null:Kt.instance(o);return[{},a,e+3]}function vs(t,e){const n=t[e]?No.create(t[e]):null;return[{},n,e+1]}const KO=RegExp(`^T?${Gu.source}$`),QO=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function JO(t){const[e,n,o,a,i,s,l,d,c]=t,u=e[0]==="-",h=d&&d[0]==="-",p=(f,_=!1)=>f!==void 0&&(_||f&&u)?-f:f;return[{years:p(ir(n)),months:p(ir(o)),weeks:p(ir(a)),days:p(ir(i)),hours:p(ir(s)),minutes:p(ir(l)),seconds:p(ir(d),d==="-0"),milliseconds:p(Wu(c),h)}]}const eB={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ku(t,e,n,o,a,i,s){const l={year:e.length===2?qu(ba(e)):ba(e),month:Dm.indexOf(n)+1,day:ba(o),hour:ba(a),minute:ba(i)};return s&&(l.second=ba(s)),t&&(l.weekday=t.length>3?Em.indexOf(t)+1:Tm.indexOf(t)+1),l}const tB=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function nB(t){const[,e,n,o,a,i,s,l,d,c,u,h]=t,p=Ku(e,a,o,n,i,s,l);let f;return d?f=eB[d]:c?f=0:f=ud(u,h),[p,new Kt(f)]}function oB(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const aB=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,rB=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,iB=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Im(t){const[,e,n,o,a,i,s,l]=t;return[Ku(e,a,o,n,i,s,l),Kt.utcInstance]}function sB(t){const[,e,n,o,a,i,s,l]=t;return[Ku(e,l,n,o,a,i,s),Kt.utcInstance]}const lB=Kr(jO,Xu),dB=Kr(ZO,Xu),cB=Kr(YO,Xu),uB=Kr(Rm),jm=Qr(XO,ti,ws,vs),hB=Qr(WO,ti,ws,vs),pB=Qr(UO,ti,ws,vs),fB=Qr(ti,ws,vs);function mB(t){return Jr(t,[lB,jm],[dB,hB],[cB,pB],[uB,fB])}function _B(t){return Jr(oB(t),[tB,nB])}function gB(t){return Jr(t,[aB,Im],[rB,Im],[iB,sB])}function bB(t){return Jr(t,[QO,JO])}const yB=Qr(ti);function wB(t){return Jr(t,[KO,yB])}const vB=Kr(qO,GO),xB=Kr(Hm),kB=Qr(ti,ws,vs);function CB(t){return Jr(t,[vB,jm],[xB,kB])}const Zm="Invalid Duration",Ym={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},MB={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Ym},On=146097/400,ni=146097/4800,SB={years:{quarters:4,months:12,weeks:On/7,days:On,hours:On*24,minutes:On*24*60,seconds:On*24*60*60,milliseconds:On*24*60*60*1e3},quarters:{months:3,weeks:On/28,days:On/4,hours:On*24/4,minutes:On*24*60/4,seconds:On*24*60*60/4,milliseconds:On*24*60*60*1e3/4},months:{weeks:ni/7,days:ni,hours:ni*24,minutes:ni*24*60,seconds:ni*24*60*60,milliseconds:ni*24*60*60*1e3},...Ym},sr=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],LB=sr.slice(0).reverse();function ya(t,e,n=!1){const o={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new Yt(o)}function Wm(t,e){let n=e.milliseconds??0;for(const o of LB.slice(1))e[o]&&(n+=e[o]*t[o].milliseconds);return n}function Um(t,e){const n=Wm(t,e)<0?-1:1;sr.reduceRight((o,a)=>{if(we(e[a]))return o;if(o){const i=e[o]*n,s=t[a][o],l=Math.floor(i/s);e[a]+=l*n,e[o]-=l*s*n}return a},null),sr.reduce((o,a)=>{if(we(e[a]))return o;if(o){const i=e[o]%1;e[o]-=i,e[a]+=i*t[o][a]}return a},null)}function $B(t){const e={};for(const[n,o]of Object.entries(t))o!==0&&(e[n]=o);return e}let Yt=class Bt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let o=n?SB:MB;e.matrix&&(o=e.matrix),this.values=e.values,this.loc=e.loc||Ke.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=o,this.isLuxonDuration=!0}static fromMillis(e,n){return Bt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new jt(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new Bt({values:hd(e,Bt.normalizeUnit),loc:Ke.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(ga(e))return Bt.fromMillis(e);if(Bt.isDuration(e))return e;if(typeof e=="object")return Bt.fromObject(e);throw new jt(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[o]=bB(e);return o?Bt.fromObject(o,n):Bt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[o]=wB(e);return o?Bt.fromObject(o,n):Bt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the Duration is invalid");const o=e instanceof qn?e:new qn(e,n);if(ft.throwOnInvalid)throw new QT(o);return new Bt({invalid:o})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new A6(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const o={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Zt.create(this.loc,o).formatDurationFromString(this,e):Zm}toHuman(e={}){if(!this.isValid)return Zm;const n=sr.map(o=>{const a=this.values[o];return we(a)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:o.slice(0,-1)}).format(a)}).filter(o=>o);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Uu(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},be.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Wm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=Bt.fromDurationLike(e),o={};for(const a of sr)(Gr(n.values,a)||Gr(this.values,a))&&(o[a]=n.get(a)+this.get(a));return ya(this,{values:o},!0)}minus(e){if(!this.isValid)return this;const n=Bt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const o of Object.keys(this.values))n[o]=$m(e(this.values[o],o));return ya(this,{values:n},!0)}get(e){return this[Bt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...hd(e,Bt.normalizeUnit)};return ya(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:o,matrix:a}={}){const s={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:a,conversionAccuracy:o};return ya(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Um(this.matrix,e),ya(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=$B(this.normalize().shiftToAll().toObject());return ya(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(s=>Bt.normalizeUnit(s));const n={},o={},a=this.toObject();let i;for(const s of sr)if(e.indexOf(s)>=0){i=s;let l=0;for(const c in o)l+=this.matrix[c][s]*o[c],o[c]=0;ga(a[s])&&(l+=a[s]);const d=Math.trunc(l);n[s]=d,o[s]=(l*1e3-d*1e3)/1e3}else ga(a[s])&&(o[s]=a[s]);for(const s in o)o[s]!==0&&(n[i]+=s===i?o[s]:o[s]/this.matrix[i][s]);return Um(this.matrix,n),ya(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return ya(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(o,a){return o===void 0||o===0?a===void 0||a===0:o===a}for(const o of sr)if(!n(this.values[o],e.values[o]))return!1;return!0}};const oi="Invalid Interval";function DB(t,e){return!t||!t.isValid?mt.invalid("missing or invalid start"):!e||!e.isValid?mt.invalid("missing or invalid end"):e<t?mt.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class mt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the Interval is invalid");const o=e instanceof qn?e:new qn(e,n);if(ft.throwOnInvalid)throw new KT(o);return new mt({invalid:o})}static fromDateTimes(e,n){const o=ks(e),a=ks(n),i=DB(o,a);return i??new mt({start:o,end:a})}static after(e,n){const o=Yt.fromDurationLike(n),a=ks(e);return mt.fromDateTimes(a,a.plus(o))}static before(e,n){const o=Yt.fromDurationLike(n),a=ks(e);return mt.fromDateTimes(a.minus(o),a)}static fromISO(e,n){const[o,a]=(e||"").split("/",2);if(o&&a){let i,s;try{i=be.fromISO(o,n),s=i.isValid}catch{s=!1}let l,d;try{l=be.fromISO(a,n),d=l.isValid}catch{d=!1}if(s&&d)return mt.fromDateTimes(i,l);if(s){const c=Yt.fromISO(a,n);if(c.isValid)return mt.after(i,c)}else if(d){const c=Yt.fromISO(o,n);if(c.isValid)return mt.before(l,c)}}return mt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const o=this.start.startOf(e,n);let a;return n?.useLocaleWeeks?a=this.end.reconfigure({locale:o.locale}):a=this.end,a=a.startOf(e,n),Math.floor(a.diff(o,e).get(e))+(a.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?mt.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(ks).filter(s=>this.contains(s)).sort((s,l)=>s.toMillis()-l.toMillis()),o=[];let{s:a}=this,i=0;for(;a<this.e;){const s=n[i]||this.e,l=+s>+this.e?this.e:s;o.push(mt.fromDateTimes(a,l)),a=l,i+=1}return o}splitBy(e){const n=Yt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:o}=this,a=1,i;const s=[];for(;o<this.e;){const l=this.start.plus(n.mapUnits(d=>d*a));i=+l>+this.e?this.e:l,s.push(mt.fromDateTimes(o,i)),o=i,a+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,o=this.e<e.e?this.e:e.e;return n>=o?null:mt.fromDateTimes(n,o)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,o=this.e>e.e?this.e:e.e;return mt.fromDateTimes(n,o)}static merge(e){const[n,o]=e.sort((a,i)=>a.s-i.s).reduce(([a,i],s)=>i?i.overlaps(s)||i.abutsStart(s)?[a,i.union(s)]:[a.concat([i]),s]:[a,s],[[],null]);return o&&n.push(o),n}static xor(e){let n=null,o=0;const a=[],i=e.map(d=>[{time:d.s,type:"s"},{time:d.e,type:"e"}]),s=Array.prototype.concat(...i),l=s.sort((d,c)=>d.time-c.time);for(const d of l)o+=d.type==="s"?1:-1,o===1?n=d.time:(n&&+n!=+d.time&&a.push(mt.fromDateTimes(n,d.time)),n=null);return mt.merge(a)}difference(...e){return mt.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:oi}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=nd,n={}){return this.isValid?Zt.create(this.s.loc.clone(n),e).formatInterval(this):oi}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:oi}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:oi}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:oi}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:oi}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):Yt.invalid(this.invalidReason)}mapEndpoints(e){return mt.fromDateTimes(e(this.s),e(this.e))}}class fd{static hasDST(e=ft.defaultZone){const n=be.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return No.isValidZone(e)}static normalizeZone(e){return _a(e,ft.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||Ke.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:o=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||Ke.create(n,o,i)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:o=null,locObj:a=null,outputCalendar:i="gregory"}={}){return(a||Ke.create(n,o,i)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:o=null,locObj:a=null}={}){return(a||Ke.create(n,o,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:o=null,locObj:a=null}={}){return(a||Ke.create(n,o,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ke.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return Ke.create(n,null,"gregory").eras(e)}static features(){return{relative:km(),localeWeek:Cm()}}}function qm(t,e){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),o=n(e)-n(t);return Math.floor(Yt.fromMillis(o).as("days"))}function VB(t,e,n){const o=[["years",(d,c)=>c.year-d.year],["quarters",(d,c)=>c.quarter-d.quarter+(c.year-d.year)*4],["months",(d,c)=>c.month-d.month+(c.year-d.year)*12],["weeks",(d,c)=>{const u=qm(d,c);return(u-u%7)/7}],["days",qm]],a={},i=t;let s,l;for(const[d,c]of o)n.indexOf(d)>=0&&(s=d,a[d]=c(t,e),l=i.plus(a),l>e?(a[d]--,t=i.plus(a),t>e&&(l=t,a[d]--,t=i.plus(a))):t=l);return[t,a,l,s]}function EB(t,e,n,o){let[a,i,s,l]=VB(t,e,n);const d=e-a,c=n.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);c.length===0&&(s<e&&(s=a.plus({[l]:1})),s!==a&&(i[l]=(i[l]||0)+d/(s-a)));const u=Yt.fromObject(i,o);return c.length>0?Yt.fromMillis(d,o).shiftTo(...c).plus(u):u}const TB="missing Intl.DateTimeFormat.formatToParts support";function Fe(t,e=n=>n){return{regex:t,deser:([n])=>e(vO(n))}}const Gm="[  ]",Xm=new RegExp(Gm,"g");function OB(t){return t.replace(/\./g,"\\.?").replace(Xm,Gm)}function Km(t){return t.replace(/\./g,"").replace(Xm," ").toLowerCase()}function Gn(t,e){return t===null?null:{regex:RegExp(t.map(OB).join("|")),deser:([n])=>t.findIndex(o=>Km(n)===Km(o))+e}}function Qm(t,e){return{regex:t,deser:([,n,o])=>ud(n,o),groups:e}}function md(t){return{regex:t,deser:([e])=>e}}function BB(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function PB(t,e){const n=Un(e),o=Un(e,"{2}"),a=Un(e,"{3}"),i=Un(e,"{4}"),s=Un(e,"{6}"),l=Un(e,"{1,2}"),d=Un(e,"{1,3}"),c=Un(e,"{1,6}"),u=Un(e,"{1,9}"),h=Un(e,"{2,4}"),p=Un(e,"{4,6}"),f=g=>({regex:RegExp(BB(g.val)),deser:([b])=>b,literal:!0}),m=(g=>{if(t.literal)return f(g);switch(g.val){case"G":return Gn(e.eras("short"),0);case"GG":return Gn(e.eras("long"),0);case"y":return Fe(c);case"yy":return Fe(h,qu);case"yyyy":return Fe(i);case"yyyyy":return Fe(p);case"yyyyyy":return Fe(s);case"M":return Fe(l);case"MM":return Fe(o);case"MMM":return Gn(e.months("short",!0),1);case"MMMM":return Gn(e.months("long",!0),1);case"L":return Fe(l);case"LL":return Fe(o);case"LLL":return Gn(e.months("short",!1),1);case"LLLL":return Gn(e.months("long",!1),1);case"d":return Fe(l);case"dd":return Fe(o);case"o":return Fe(d);case"ooo":return Fe(a);case"HH":return Fe(o);case"H":return Fe(l);case"hh":return Fe(o);case"h":return Fe(l);case"mm":return Fe(o);case"m":return Fe(l);case"q":return Fe(l);case"qq":return Fe(o);case"s":return Fe(l);case"ss":return Fe(o);case"S":return Fe(d);case"SSS":return Fe(a);case"u":return md(u);case"uu":return md(l);case"uuu":return Fe(n);case"a":return Gn(e.meridiems(),0);case"kkkk":return Fe(i);case"kk":return Fe(h,qu);case"W":return Fe(l);case"WW":return Fe(o);case"E":case"c":return Fe(n);case"EEE":return Gn(e.weekdays("short",!1),1);case"EEEE":return Gn(e.weekdays("long",!1),1);case"ccc":return Gn(e.weekdays("short",!0),1);case"cccc":return Gn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Qm(new RegExp(`([+-]${l.source})(?::(${o.source}))?`),2);case"ZZZ":return Qm(new RegExp(`([+-]${l.source})(${o.source})?`),2);case"z":return md(/[a-z_+-/]{1,256}?/i);case" ":return md(/[^\S\n\r]/);default:return f(g)}})(t)||{invalidReason:TB};return m.token=t,m}const NB={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function AB(t,e,n){const{type:o,value:a}=t;if(o==="literal"){const d=/^\s+$/.test(a);return{literal:!d,val:d?" ":a}}const i=e[o];let s=o;o==="hour"&&(e.hour12!=null?s=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?s="hour12":s="hour24":s=n.hour12?"hour12":"hour24");let l=NB[s];if(typeof l=="object"&&(l=l[i]),l)return{literal:!1,val:l}}function FB(t){return[`^${t.map(n=>n.regex).reduce((n,o)=>`${n}(${o.source})`,"")}$`,t]}function zB(t,e,n){const o=t.match(e);if(o){const a={};let i=1;for(const s in n)if(Gr(n,s)){const l=n[s],d=l.groups?l.groups+1:1;!l.literal&&l.token&&(a[l.token.val[0]]=l.deser(o.slice(i,i+d))),i+=d}return[o,a]}else return[o,{}]}function RB(t){const e=i=>{switch(i){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,o;return we(t.z)||(n=No.create(t.z)),we(t.Z)||(n||(n=new Kt(t.Z)),o=t.Z),we(t.q)||(t.M=(t.q-1)*3+1),we(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),we(t.u)||(t.S=Wu(t.u)),[Object.keys(t).reduce((i,s)=>{const l=e(s);return l&&(i[l]=t[s]),i},{}),n,o]}let Qu=null;function HB(){return Qu||(Qu=be.fromMillis(1555555555555)),Qu}function IB(t,e){if(t.literal)return t;const n=Zt.macroTokenToFormatOpts(t.val),o=n_(n,e);return o==null||o.includes(void 0)?t:o}function Jm(t,e){return Array.prototype.concat(...t.map(n=>IB(n,e)))}class e_{constructor(e,n){if(this.locale=e,this.format=n,this.tokens=Jm(Zt.parseFormat(n),e),this.units=this.tokens.map(o=>PB(o,e)),this.disqualifyingUnit=this.units.find(o=>o.invalidReason),!this.disqualifyingUnit){const[o,a]=FB(this.units);this.regex=RegExp(o,"i"),this.handlers=a}}explainFromTokens(e){if(this.isValid){const[n,o]=zB(e,this.regex,this.handlers),[a,i,s]=o?RB(o):[null,null,void 0];if(Gr(o,"a")&&Gr(o,"H"))throw new Ur("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:o,result:a,zone:i,specificOffset:s}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function t_(t,e,n){return new e_(t,n).explainFromTokens(e)}function jB(t,e,n){const{result:o,zone:a,specificOffset:i,invalidReason:s}=t_(t,e,n);return[o,a,i,s]}function n_(t,e){if(!t)return null;const o=Zt.create(e,t).dtFormatter(HB()),a=o.formatToParts(),i=o.resolvedOptions();return a.map(s=>AB(s,t,i))}const Ju="Invalid DateTime",o_=864e13;function xs(t){return new qn("unsupported zone",`the zone "${t.name}" is not supported`)}function e0(t){return t.weekData===null&&(t.weekData=sd(t.c)),t.weekData}function t0(t){return t.localWeekData===null&&(t.localWeekData=sd(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function lr(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new be({...n,...e,old:n})}function a_(t,e,n){let o=t-e*60*1e3;const a=n.offset(o);if(e===a)return[o,e];o-=(a-e)*60*1e3;const i=n.offset(o);return a===i?[o,a]:[t-Math.min(a,i)*60*1e3,Math.max(a,i)]}function _d(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function gd(t,e,n){return a_(cd(t),e,n)}function r_(t,e){const n=t.o,o=t.c.year+Math.trunc(e.years),a=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,i={...t.c,year:o,month:a,day:Math.min(t.c.day,dd(o,a))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},s=Yt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=cd(i);let[d,c]=a_(l,n,t.zone);return s!==0&&(d+=s,c=t.zone.offset(d)),{ts:d,o:c}}function ai(t,e,n,o,a,i){const{setZone:s,zone:l}=n;if(t&&Object.keys(t).length!==0||e){const d=e||l,c=be.fromObject(t,{...n,zone:d,specificOffset:i});return s?c:c.setZone(l)}else return be.invalid(new qn("unparsable",`the input "${a}" can't be parsed as ${o}`))}function bd(t,e,n=!0){return t.isValid?Zt.create(Ke.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function n0(t,e){const n=t.c.year>9999||t.c.year<0;let o="";return n&&t.c.year>=0&&(o+="+"),o+=St(t.c.year,n?6:4),e?(o+="-",o+=St(t.c.month),o+="-",o+=St(t.c.day)):(o+=St(t.c.month),o+=St(t.c.day)),o}function i_(t,e,n,o,a,i){let s=St(t.c.hour);return e?(s+=":",s+=St(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=":")):s+=St(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(s+=St(t.c.second),(t.c.millisecond!==0||!o)&&(s+=".",s+=St(t.c.millisecond,3))),a&&(t.isOffsetFixed&&t.offset===0&&!i?s+="Z":t.o<0?(s+="-",s+=St(Math.trunc(-t.o/60)),s+=":",s+=St(Math.trunc(-t.o%60))):(s+="+",s+=St(Math.trunc(t.o/60)),s+=":",s+=St(Math.trunc(t.o%60)))),i&&(s+="["+t.zone.ianaName+"]"),s}const s_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ZB={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},YB={ordinal:1,hour:0,minute:0,second:0,millisecond:0},l_=["year","month","day","hour","minute","second","millisecond"],WB=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],UB=["year","ordinal","hour","minute","second","millisecond"];function qB(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new A6(t);return e}function d_(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return qB(t)}}function GB(t){return wd[t]||(yd===void 0&&(yd=ft.now()),wd[t]=t.offset(yd)),wd[t]}function c_(t,e){const n=_a(e.zone,ft.defaultZone);if(!n.isValid)return be.invalid(xs(n));const o=Ke.fromObject(e);let a,i;if(we(t.year))a=ft.now();else{for(const d of l_)we(t[d])&&(t[d]=s_[d]);const s=vm(t)||xm(t);if(s)return be.invalid(s);const l=GB(n);[a,i]=gd(t,l,n)}return new be({ts:a,zone:n,loc:o,o:i})}function u_(t,e,n){const o=we(n.round)?!0:n.round,a=(s,l)=>(s=Uu(s,o||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(s,l)),i=s=>n.calendary?e.hasSame(t,s)?0:e.startOf(s).diff(t.startOf(s),s).get(s):e.diff(t,s).get(s);if(n.unit)return a(i(n.unit),n.unit);for(const s of n.units){const l=i(s);if(Math.abs(l)>=1)return a(l,s)}return a(t>e?-0:0,n.units[n.units.length-1])}function h_(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}let yd,wd={};class be{constructor(e){const n=e.zone||ft.defaultZone;let o=e.invalid||(Number.isNaN(e.ts)?new qn("invalid input"):null)||(n.isValid?null:xs(n));this.ts=we(e.ts)?ft.now():e.ts;let a=null,i=null;if(!o)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[a,i]=[e.old.c,e.old.o];else{const l=ga(e.o)&&!e.old?e.o:n.offset(this.ts);a=_d(this.ts,l),o=Number.isNaN(a.year)?new qn("invalid input"):null,a=o?null:a,i=o?null:l}this._zone=n,this.loc=e.loc||Ke.create(),this.invalid=o,this.weekData=null,this.localWeekData=null,this.c=a,this.o=i,this.isLuxonDateTime=!0}static now(){return new be({})}static local(){const[e,n]=h_(arguments),[o,a,i,s,l,d,c]=n;return c_({year:o,month:a,day:i,hour:s,minute:l,second:d,millisecond:c},e)}static utc(){const[e,n]=h_(arguments),[o,a,i,s,l,d,c]=n;return e.zone=Kt.utcInstance,c_({year:o,month:a,day:i,hour:s,minute:l,second:d,millisecond:c},e)}static fromJSDate(e,n={}){const o=SO(e)?e.valueOf():NaN;if(Number.isNaN(o))return be.invalid("invalid input");const a=_a(n.zone,ft.defaultZone);return a.isValid?new be({ts:o,zone:a,loc:Ke.fromObject(n)}):be.invalid(xs(a))}static fromMillis(e,n={}){if(ga(e))return e<-o_||e>o_?be.invalid("Timestamp out of range"):new be({ts:e,zone:_a(n.zone,ft.defaultZone),loc:Ke.fromObject(n)});throw new jt(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(ga(e))return new be({ts:e*1e3,zone:_a(n.zone,ft.defaultZone),loc:Ke.fromObject(n)});throw new jt("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const o=_a(n.zone,ft.defaultZone);if(!o.isValid)return be.invalid(xs(o));const a=Ke.fromObject(n),i=hd(e,d_),{minDaysInFirstWeek:s,startOfWeek:l}=wm(i,a),d=ft.now(),c=we(n.specificOffset)?o.offset(d):n.specificOffset,u=!we(i.ordinal),h=!we(i.year),p=!we(i.month)||!we(i.day),f=h||p,_=i.weekYear||i.weekNumber;if((f||u)&&_)throw new Ur("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&u)throw new Ur("Can't mix ordinal dates with month/day");const m=_||i.weekday&&!f;let g,b,w=_d(d,c);m?(g=WB,b=ZB,w=sd(w,s,l)):u?(g=UB,b=YB,w=Zu(w)):(g=l_,b=s_);let y=!1;for(const E of g){const R=i[E];we(R)?y?i[E]=b[E]:i[E]=w[E]:y=!0}const x=m?kO(i,s,l):u?CO(i):vm(i),v=x||xm(i);if(v)return be.invalid(v);const M=m?bm(i,s,l):u?ym(i):i,[C,$]=gd(M,c,o),S=new be({ts:C,zone:o,o:$,loc:a});return i.weekday&&f&&e.weekday!==S.weekday?be.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${S.toISO()}`):S.isValid?S:be.invalid(S.invalid)}static fromISO(e,n={}){const[o,a]=mB(e);return ai(o,a,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[o,a]=_B(e);return ai(o,a,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[o,a]=gB(e);return ai(o,a,n,"HTTP",n)}static fromFormat(e,n,o={}){if(we(e)||we(n))throw new jt("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:i=null}=o,s=Ke.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0}),[l,d,c,u]=jB(s,e,n);return u?be.invalid(u):ai(l,d,o,`format ${n}`,e,c)}static fromString(e,n,o={}){return be.fromFormat(e,n,o)}static fromSQL(e,n={}){const[o,a]=CB(e);return ai(o,a,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new jt("need to specify a reason the DateTime is invalid");const o=e instanceof qn?e:new qn(e,n);if(ft.throwOnInvalid)throw new XT(o);return new be({invalid:o})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const o=n_(e,Ke.fromObject(n));return o?o.map(a=>a?a.val:null).join(""):null}static expandFormat(e,n={}){return Jm(Zt.parseFormat(e),Ke.fromObject(n)).map(a=>a.val).join("")}static resetCache(){yd=void 0,wd={}}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?e0(this).weekYear:NaN}get weekNumber(){return this.isValid?e0(this).weekNumber:NaN}get weekday(){return this.isValid?e0(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?t0(this).weekday:NaN}get localWeekNumber(){return this.isValid?t0(this).weekNumber:NaN}get localWeekYear(){return this.isValid?t0(this).weekYear:NaN}get ordinal(){return this.isValid?Zu(this.c).ordinal:NaN}get monthShort(){return this.isValid?fd.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?fd.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?fd.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?fd.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,o=cd(this.c),a=this.zone.offset(o-e),i=this.zone.offset(o+e),s=this.zone.offset(o-a*n),l=this.zone.offset(o-i*n);if(s===l)return[this];const d=o-s*n,c=o-l*n,u=_d(d,s),h=_d(c,l);return u.hour===h.hour&&u.minute===h.minute&&u.second===h.second&&u.millisecond===h.millisecond?[lr(this,{ts:d}),lr(this,{ts:c})]:[this]}get isInLeapYear(){return gs(this.year)}get daysInMonth(){return dd(this.year,this.month)}get daysInYear(){return this.isValid?Xr(this.year):NaN}get weeksInWeekYear(){return this.isValid?bs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?bs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:o,calendar:a}=Zt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:o,outputCalendar:a}}toUTC(e=0,n={}){return this.setZone(Kt.instance(e),n)}toLocal(){return this.setZone(ft.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:o=!1}={}){if(e=_a(e,ft.defaultZone),e.equals(this.zone))return this;if(e.isValid){let a=this.ts;if(n||o){const i=e.offset(this.ts),s=this.toObject();[a]=gd(s,i,e)}return lr(this,{ts:a,zone:e})}else return be.invalid(xs(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:o}={}){const a=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:o});return lr(this,{loc:a})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=hd(e,d_),{minDaysInFirstWeek:o,startOfWeek:a}=wm(n,this.loc),i=!we(n.weekYear)||!we(n.weekNumber)||!we(n.weekday),s=!we(n.ordinal),l=!we(n.year),d=!we(n.month)||!we(n.day),c=l||d,u=n.weekYear||n.weekNumber;if((c||s)&&u)throw new Ur("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&s)throw new Ur("Can't mix ordinal dates with month/day");let h;i?h=bm({...sd(this.c,o,a),...n},o,a):we(n.ordinal)?(h={...this.toObject(),...n},we(n.day)&&(h.day=Math.min(dd(h.year,h.month),h.day))):h=ym({...Zu(this.c),...n});const[p,f]=gd(h,this.o,this.zone);return lr(this,{ts:p,o:f})}plus(e){if(!this.isValid)return this;const n=Yt.fromDurationLike(e);return lr(this,r_(this,n))}minus(e){if(!this.isValid)return this;const n=Yt.fromDurationLike(e).negate();return lr(this,r_(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const o={},a=Yt.normalizeUnit(e);switch(a){case"years":o.month=1;case"quarters":case"months":o.day=1;case"weeks":case"days":o.hour=0;case"hours":o.minute=0;case"minutes":o.second=0;case"seconds":o.millisecond=0;break}if(a==="weeks")if(n){const i=this.loc.getStartOfWeek(),{weekday:s}=this;s<i&&(o.weekNumber=this.weekNumber-1),o.weekday=i}else o.weekday=1;if(a==="quarters"){const i=Math.ceil(this.month/3);o.month=(i-1)*3+1}return this.set(o)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?Zt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):Ju}toLocaleString(e=nd,n={}){return this.isValid?Zt.create(this.loc.clone(n),e).formatDateTime(this):Ju}toLocaleParts(e={}){return this.isValid?Zt.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:o=!1,includeOffset:a=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const s=e==="extended";let l=n0(this,s);return l+="T",l+=i_(this,s,n,o,a,i),l}toISODate({format:e="extended"}={}){return this.isValid?n0(this,e==="extended"):null}toISOWeekDate(){return bd(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:o=!0,includePrefix:a=!1,extendedZone:i=!1,format:s="extended"}={}){return this.isValid?(a?"T":"")+i_(this,s==="extended",n,e,o,i):null}toRFC2822(){return bd(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return bd(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?n0(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:o=!0}={}){let a="HH:mm:ss.SSS";return(n||e)&&(o&&(a+=" "),n?a+="z":e&&(a+="ZZ")),bd(this,a,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Ju}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",o={}){if(!this.isValid||!e.isValid)return Yt.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...o},i=LO(n).map(Yt.normalizeUnit),s=e.valueOf()>this.valueOf(),l=s?this:e,d=s?e:this,c=EB(l,d,i,a);return s?c.negate():c}diffNow(e="milliseconds",n={}){return this.diff(be.now(),e,n)}until(e){return this.isValid?mt.fromDateTimes(this,e):this}hasSame(e,n,o){if(!this.isValid)return!1;const a=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n,o)<=a&&a<=i.endOf(n,o)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||be.fromObject({},{zone:this.zone}),o=e.padding?this<n?-e.padding:e.padding:0;let a=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(a=e.unit,i=void 0),u_(n,this.plus(o),{...e,numeric:"always",units:a,unit:i})}toRelativeCalendar(e={}){return this.isValid?u_(e.base||be.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(be.isDateTime))throw new jt("min requires all arguments be DateTimes");return Mm(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(be.isDateTime))throw new jt("max requires all arguments be DateTimes");return Mm(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,o={}){const{locale:a=null,numberingSystem:i=null}=o,s=Ke.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});return t_(s,e,n)}static fromStringExplain(e,n,o={}){return be.fromFormatExplain(e,n,o)}static buildFormatParser(e,n={}){const{locale:o=null,numberingSystem:a=null}=n,i=Ke.fromOpts({locale:o,numberingSystem:a,defaultToEN:!0});return new e_(i,e)}static fromFormatParser(e,n,o={}){if(we(e)||we(n))throw new jt("fromFormatParser requires an input string and a format parser");const{locale:a=null,numberingSystem:i=null}=o,s=Ke.fromOpts({locale:a,numberingSystem:i,defaultToEN:!0});if(!s.equals(n.locale))throw new jt(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${n.locale}`);const{result:l,zone:d,specificOffset:c,invalidReason:u}=n.explainFromTokens(e);return u?be.invalid(u):ai(l,d,o,`format ${n.format}`,e,c)}static get DATE_SHORT(){return nd}static get DATE_MED(){return F6}static get DATE_MED_WITH_WEEKDAY(){return JT}static get DATE_FULL(){return z6}static get DATE_HUGE(){return R6}static get TIME_SIMPLE(){return H6}static get TIME_WITH_SECONDS(){return I6}static get TIME_WITH_SHORT_OFFSET(){return j6}static get TIME_WITH_LONG_OFFSET(){return Z6}static get TIME_24_SIMPLE(){return Y6}static get TIME_24_WITH_SECONDS(){return W6}static get TIME_24_WITH_SHORT_OFFSET(){return U6}static get TIME_24_WITH_LONG_OFFSET(){return q6}static get DATETIME_SHORT(){return G6}static get DATETIME_SHORT_WITH_SECONDS(){return X6}static get DATETIME_MED(){return K6}static get DATETIME_MED_WITH_SECONDS(){return Q6}static get DATETIME_MED_WITH_WEEKDAY(){return eO}static get DATETIME_FULL(){return J6}static get DATETIME_FULL_WITH_SECONDS(){return em}static get DATETIME_HUGE(){return tm}static get DATETIME_HUGE_WITH_SECONDS(){return nm}}function ks(t){if(be.isDateTime(t))return t;if(t&&t.valueOf&&ga(t.valueOf()))return be.fromJSDate(t);if(t&&typeof t=="object")return be.fromObject(t);throw new jt(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const o0=[{name:"Sydney",open:"22:00",close:"7:00"},{name:"Tokyo",open:"0:00",close:"9:00"},{name:"London",open:"8:00",close:"17:00"},{name:"New-York",open:"13:00",close:"22:00"}];function at(t,e=2){return isNaN(+t)?0:Math.round(+t*10**e)/10**e}function a0(t){if(t){const e=t.toString();if(/\B(?=(\d{3})+(?!\d))/g.test(e))if(e.includes(".")){let o=e.split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g," "),o.join(".")}else return e.replace(/\B(?=(\d{3})+(?!\d))/g," ");else return e}else return t}function XB(t,e,n){const o=parseFloat(t.entry_price),a=t.amount,i=t.pair.toLowerCase(),s=t.side,d=(h=>h.endsWith("jpy")?1e3:h.startsWith("xau")||h.endsWith("f.t")||h.endsWith(".b")||h.endsWith("sek")||h.endsWith("mxn")||h.endsWith("xpd")||h.endsWith("xag")||h.endsWith("xbr")||h.endsWith("xng")||h.endsWith("xpt")||h.endsWith("xti")?100:h==="cocoa"||h==="coffee"?1:h==="brent"?100:1e5)(i);let c=0,u=0;return s==="LONG"?(c=(e.bid-o)*a*d,u=c/(a*o*d/n)):s==="SHORT"&&(c=(o-e.ask)*a*d,u=c/(a*o*d/n)),{pnl:c,pnl_roi:u}}function KB(t,e){const n=parseFloat(t.entry_price),o=t.amount,a=t.multiplier,i=t.side;let s=0,l=0;return i==="SHORT"?(s=(n-e)*Math.abs(o),l=(n-e)*o*a/(n*Math.abs(o))*100):i==="LONG"&&(s=(e-n)*Math.abs(o),l=(e-n)*o*a/(n*Math.abs(o))*100),{pnl:s,pnlToBalanceRatio:l}}function QB(t){if(isNaN(+t))return 0;const e=parseFloat(String(t));if(Number.isInteger(e))return e;const n=e.toString(),o=n.indexOf(".");if(o===-1)return e;const i=n.slice(o+1).search(/[^0]/);if(i===-1)return e;const l=10**(i+4);return Math.round(e*l)/l}function vd(t){let e=t.toString().split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}function _e(t,e,n={}){const{repeat:o=4,mask:a="*",prefix:i="",suffix:s=""}=n;let l,d;return t?(l=i==="$"?ii():i,d=s==="$"?ii():s,l+a.repeat(o)+d):e}function JB(t){return t.reduce((e,n,o)=>o===0?`key=${encodeURIComponent(n.id)}`:e+`&key=${encodeURIComponent(n.id)}`,"")}function ri(){function t(a){return Number(a)===a&&a%1!==0}function e(a){let i=String(a);return i.includes(".75")?i.replace(".75",":45"):i.includes(".25")?i.replace(".25",":15"):i.replace(".5",":30")}const n=Number(ao.getItem("scope360::timezone"))||0,o=t(n)?e(n):n;return`UTC${n>=0?"+":""}${o}`}function eP(t){return new Date(t).getFullYear()}function tP(t,e=!0){const n=e?ri():"UTC+0";return be.fromISO(t,{setZone:!0}).setZone(n).toFormat("dd LLLL, y, TT")}function r0(t,e="dd/LL/y",n=!0){const o=n?ri():"UTC+0";return be.fromISO(t,{setZone:!0}).setZone(o).toFormat(e)}function nP(t){return t.toISOString().split("T")[0]}function oP(t){return["January","February","March","April","May","June","July","August","September","October","November","December"][new Date(t).getMonth()]}function aP(t){return new Date(t).getDate()}function p_(t){return be.fromISO(t,{setZone:!0}).toFormat("cccc")}function rP(t){const e=new Date(t),o=new Date-e;return Math.floor(o/(1e3*3600*24))}function ii(){const t={USD:"$",EUR:"€",JPY:"¥",GBP:"£",CHF:"Fr.",CAD:"$",AUD:"$",NOK:"kr",SEK:"kr",DKK:"kr"},e=f_();return e&&t[e?.split("::")[0]]?t[e?.split("::")[0]]:t.USD}function f_(){let t=!1;return(window.location.hostname.includes("fx")||window.location.host==="localhost:5173")&&(t=!0),t?ao.getItem("scope360::currency_fx"):ao.getItem("scope360::currency")}function dr(){const t=f_();return t&&t?.split("::")[1]?+t?.split("::")[1]:1}const Ie=(t,e={isPercentage:!1,isFixed:!0,isPlus:!1})=>{let n;t>=0?n=e.isPlus&&t!==0?"+":"":n="-";let o=Math.abs(t);return e.isFixed&&(o=at(o)),e.isPercentage?a0(`${n}${o}%`):a0(`${n}${ii()}${at(o*dr())}`)};function iP(t,e){const n=+new Date(e)-+new Date(t);return g_(n)}function m_(){function t(s){const[l,d]=s.split(":").map(Number);return l+d/60}function e(s){const l=Math.floor(s),d=s%1*60;return`${String(l).padStart(2,"0")}:${String(d).padStart(2,"0")}`}function n(s){const l=s.match(/([+-]?)(\d+):?(\d+)?/);if(!l)return 0;const d=l[1]==="-"?-1:1,c=parseInt(l[2],10),u=l[3]?parseInt(l[3],10):0;return d*(c+u/60)}const o=ri(),a=n(o);return o0.map(s=>{const l=t(s.open),d=t(s.close),c=(l+a+24)%24,u=(d+a+24)%24;return{name:s.name,open:e(c),close:e(u)}})}function __(){const t=new Date,e=t.getUTCHours(),n=t.getUTCMinutes(),o=t.getUTCSeconds(),a=e*3600+n*60+o,i=o0.filter(({open:s,close:l})=>{const[d,c]=s.split(":").map(Number),[u,h]=l.split(":").map(Number),p=d*3600+c*60,f=u*3600+h*60;return p<f?a>=p&&a<f:a>=p||a<f});if(i.length>1){const l=Math.min(...i.map(({close:d})=>{const[c,u]=d.split(":").map(Number);return c*3600+u*60}))-a;return{activeMarkets:i.map(({name:d})=>d),overlapTime:l>0?Math.floor(l/60):0}}else{if(i.length===1)return{activeMarkets:i.map(({name:s})=>s),overlapTime:0};{const l=o0.map(({name:d,open:c})=>{const[u,h]=c.split(":").map(Number),p=u*3600+h*60,f=p>=a?p-a:86400-a+p;return{name:d,timeUntilOpenInSeconds:f}}).reduce((d,c)=>d.timeUntilOpenInSeconds<c.timeUntilOpenInSeconds?d:c);return{activeMarkets:[],nextMarket:l.name,timeUntilNextOpen:Math.floor(l.timeUntilOpenInSeconds/60),timeUntilNextOpenInSeconds:l.timeUntilOpenInSeconds}}}}function si(t,e){return t>=1e3||t<=-1e3?_e(e,at(t/1e3,2)+"k",{repeat:3}):_e(e,at(t,2),{repeat:3})}function g_(t){const e=Math.floor(t/864e5),n=Math.floor(t%(1e3*60*60*24)/(1e3*60*60)),o=Math.floor(t%(1e3*60*60)/(1e3*60)),a=Math.floor(t%(1e3*60)/1e3),i=[];return e>0&&i.push(`${e}D`),n>0&&i.push(`${n}H`),o>0&&i.push(`${o}M`),a>0&&i.push(`${a}S`),i.join(" ")}function sP(t){const e=/^(.*?)(BTC|ETH|USDT|USD|USDC)$/,n=t.match(e);if(n){const o=n[1],a=n[2];return o===""||a===""?t:`${o}/${a}`}else return t}function cr(t){const e=["BTC","ETH","USDT","USD","EUR","GBP","JPY","CAD","CHF","USDC","CNH"];for(let n=1;n<t.length;n++){const o=t.substring(0,n),a=t.substring(n);if(e.includes(o)||e.includes(a))return`${o}/${a}`}return t}function Cs(t,e){const o=cr(t).split("/")[e];if(o)return o.toLowerCase()}function lP(t,e){let n=[],o=new Date(e,t,1),a=new Date(e,t+1,0),i=a.getDate(),s=1,l;for(o.getDay()===1?l=7:o.getDay()===0?(s=new Date(e,t,0).getDate()-6+1,l=1):(s=new Date(e,t,0).getDate()+1-o.getDay()+1,l=7-o.getDay()+1,n.push({start:s,end:l}),s=l+1,l=l+7);s<=i;)if(n.push({start:s,end:l}),s=l+1,l=l+7,l=s===1&&l===8?1:l,l>i&&s<=i){l=l-i,n.push({start:s,end:l});break}return n.map(({start:d,end:c},u)=>{const h=+(d>c&&u===0);return Array.from({length:7},(p,f)=>{const _=new Date(e,t-h,d+f);return{date:_.getDate(),month:_.getMonth(),day:_.toLocaleString("en",{weekday:"long"})}})})}function dP(t,e,n){let o=new Date(t),a=new Date(e);o>a&&([o,a]=[a,o]);let i=[],s=new Date(o.getFullYear(),o.getMonth(),1),l=0;for(;s<=a;){let d=s.toLocaleString("en",{month:"long",year:"numeric"});n?i.push({month:s.getMonth(),year:s.getFullYear(),name:d,id:l}):i.push(d),l=l+1,s.setMonth(s.getMonth()+1)}return i}function cP(t,e,n){let o=new Date(t),a=new Date(e);o>a&&([o,a]=[a,o]);let i=[],s=o.getFullYear(),l=a.getFullYear(),d=0;for(let c=s;c<=l;c++)n?i.push({value:c,name:c.toString(),id:d}):i.push(c.toString()),d=d+1;return i}function uP(t,e){let a=new Date(t).getTime()-e*24*60*60*1e3;return new Date(a).toISOString().split(".")[0]+"Z"}function hP(t){function e(o,a){let i=[],s=new Date(a,o,1),l=new Date(a,o+1,0),d=l.getDate(),c=1,u;for(s.getDay()===1?u=7:s.getDay()===0?(c=new Date(a,o,0).getDate()-6+1,u=1):(c=new Date(a,o,0).getDate()+1-s.getDay()+1,u=7-s.getDay()+1,i.push({start:c,end:u}),c=u+1,u=u+7);c<=d;)if(i.push({start:c,end:u}),c=u+1,u=u+7,u=c===1&&u===8?1:u,u>d&&c<=d){u=u-d,i.push({start:c,end:u});break}return i.map(({start:h,end:p},f)=>{const _=+(h>p&&f===0);return Array.from({length:7},(m,g)=>{const b=new Date(a,o-_,h+g);return{date:b.getMonth()===o?b.getDate():0,day:b.toLocaleString("en",{weekday:"long"})}})})}let n=[];for(let o=0;o<12;o++)n.push(e(o,t));return n}function pP(t){const e=t.map(o=>new Date(o));return new Date(Math.min(...e.map(o=>o.getTime())))}const fP={class:"doughnut-wrapper"},mP={class:"doughnut-wrapper__total"},_P={class:"doughnut-wrapper__total__value"},gP=r.createElementVNode("div",{class:"doughnut-wrapper__total__label"},"Total positions",-1),bP={__name:"DoughnutChart",props:{total:{type:Number,required:!0},data:{type:Object,required:!0},dataType:{type:String,required:!1},borderColor:{type:String,default:"transparent"},isMask:{type:Boolean,default:!1}},setup(t){or.register(o$,Cu,l6);const e=r.ref(0),n=t,o=r.ref({cutout:75,spacing:2,responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},plugins:{tooltip:{enabled:!1,position:"nearest",external:i},legend:!1}});function a(s,l){let d=document.querySelector(`#${s}-${n.dataType}`);return d||(d=document.createElement("div"),d.classList.add(s),d.setAttribute("id",`${s}-${n.dataType}`),l.canvas.parentNode.appendChild(d)),d}function i(s){const{chart:l,tooltip:d}=s,c=a("chart-tooltip",l);if(d.opacity===0){c.style.opacity="0";return}if(d.body){const g=d.title||[],b=d.body.map($=>$.lines),w=g[0],y=b[0],x=n.data.labels.findIndex($=>$===w),v=n.data.datasets[0].backgroundColor[x],M=n.data.totals[x],C=document.createElement("div");for(C.classList.add("chart-tooltip-info"),C.innerHTML=`<div class="chart-tooltip-info__top">
44
44
  <div class="chart-tooltip-info__dot" style="background-color: ${v}"></div>
45
45
  <div class="chart-tooltip-info__pair">${w}</div>
46
46
  </div>