scope360-core 0.0.238 → 0.0.240

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.
@@ -38,7 +38,7 @@
38
38
  `)>-1?t.split(`
39
39
  `):t}function BS(t,e){const{element:n,datasetIndex:r,index:s}=e,i=t.getDatasetMeta(r).controller,{label:a,value:l}=i.getLabelAndValue(s);return{chart:t,label:a,parsed:i.getParsed(s),raw:t.data.datasets[r].data[s],formattedValue:l,dataset:i.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function a2(t,e){const n=t.chart.ctx,{body:r,footer:s,title:i}=t,{boxWidth:a,boxHeight:l}=e,c=an(e.bodyFont),d=an(e.titleFont),u=an(e.footerFont),h=i.length,f=s.length,m=r.length,g=yn(e.padding);let p=g.height,_=0,y=r.reduce((v,M)=>v+M.before.length+M.lines.length+M.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,h&&(p+=h*d.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),y){const v=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;p+=m*v+(y-m)*c.lineHeight+(y-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let C=0;const k=function(v){_=Math.max(_,n.measureText(v).width+C)};return n.save(),n.font=d.string,Re(t.title,k),n.font=c.string,Re(t.beforeBody.concat(t.afterBody),k),C=e.displayColors?a+2+e.boxPadding:0,Re(r,v=>{Re(v.before,k),Re(v.lines,k),Re(v.after,k)}),C=0,n.font=u.string,Re(t.footer,k),n.restore(),_+=g.width,{width:_,height:p}}function AS(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function FS(t,e,n,r){const{x:s,width:i}=r,a=n.caretSize+n.caretPadding;if(t==="left"&&s+i+a>e.width||t==="right"&&s-i-a<0)return!0}function RS(t,e,n,r){const{x:s,width:i}=n,{width:a,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=s<=(l+c)/2?"left":"right":s<=i/2?d="left":s>=a-i/2&&(d="right"),FS(d,t,e,n)&&(d="center"),d}function l2(t,e,n){const r=n.yAlign||e.yAlign||AS(t,n);return{xAlign:n.xAlign||e.xAlign||RS(t,e,n,r),yAlign:r}}function IS(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function HS(t,e,n){let{y:r,height:s}=t;return e==="top"?r+=n:e==="bottom"?r-=s+n:r-=s/2,r}function c2(t,e,n,r){const{caretSize:s,caretPadding:i,cornerRadius:a}=t,{xAlign:l,yAlign:c}=n,d=s+i,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=Po(a);let g=IS(e,l);const p=HS(e,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,f)+s:l==="right"&&(g+=Math.max(h,m)+s),{x:_n(g,0,r.width-e.width),y:_n(p,0,r.height-e.height)}}function vl(t,e,n){const r=yn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function d2(t){return tr([],br(t))}function zS(t,e,n){return ts(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function u2(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const h2={beforeTitle:gr,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:gr,beforeBody:gr,beforeLabel:gr,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 Ue(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:gr,afterBody:gr,beforeFooter:gr,footer:gr,afterFooter:gr};function jt(t,e,n,r){const s=t[e].call(n,r);return typeof s>"u"?h2[e].call(n,r):s}class Qu extends As{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,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,i=new mp(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=zS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,s=jt(r,"beforeTitle",this,e),i=jt(r,"title",this,e),a=jt(r,"afterTitle",this,e);let l=[];return l=tr(l,br(s)),l=tr(l,br(i)),l=tr(l,br(a)),l}getBeforeBody(e,n){return d2(jt(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,s=[];return Re(e,i=>{const a={before:[],lines:[],after:[]},l=u2(r,i);tr(a.before,br(jt(l,"beforeLabel",this,i))),tr(a.lines,jt(l,"label",this,i)),tr(a.after,br(jt(l,"afterLabel",this,i))),s.push(a)}),s}getAfterBody(e,n){return d2(jt(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,s=jt(r,"beforeFooter",this,e),i=jt(r,"footer",this,e),a=jt(r,"afterFooter",this,e);let l=[];return l=tr(l,br(s)),l=tr(l,br(i)),l=tr(l,br(a)),l}_createItems(e){const n=this._active,r=this.chart.data,s=[],i=[],a=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(BS(this.chart,n[c]));return e.filter&&(l=l.filter((u,h,f)=>e.filter(u,h,f,r))),e.itemSort&&(l=l.sort((u,h)=>e.itemSort(u,h,r))),Re(l,u=>{const h=u2(e.callbacks,u);s.push(jt(h,"labelColor",this,u)),i.push(jt(h,"labelPointStyle",this,u)),a.push(jt(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=l,l}update(e,n){const r=this.options.setContext(this.getContext()),s=this._active;let i,a=[];if(!s.length)this.opacity!==0&&(i={opacity:0});else{const l=Wo[r.position].call(this,s,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const c=this._size=a2(this,r),d=Object.assign({},l,c),u=l2(this.chart,r,d),h=c2(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,r,s){const i=this.getCaretPosition(e,r,s);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(e,n,r){const{xAlign:s,yAlign:i}=this,{caretSize:a,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:h}=Po(l),{x:f,y:m}=e,{width:g,height:p}=n;let _,y,C,k,v,M;return i==="center"?(v=m+p/2,s==="left"?(_=f,y=_-a,k=v+a,M=v-a):(_=f+g,y=_+a,k=v-a,M=v+a),C=_):(s==="left"?y=f+Math.max(c,u)+a:s==="right"?y=f+g-Math.max(d,h)-a:y=this.caretX,i==="top"?(k=m,v=k-a,_=y-a,C=y+a):(k=m+p,v=k+a,_=y+a,C=y-a),M=k),{x1:_,x2:y,x3:C,y1:k,y2:v,y3:M}}drawTitle(e,n,r){const s=this.title,i=s.length;let a,l,c;if(i){const d=Iu(r.rtl,this.x,this.width);for(e.x=vl(this,r.titleAlign,r),n.textAlign=d.textAlign(r.titleAlign),n.textBaseline="middle",a=an(r.titleFont),l=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,c=0;c<i;++c)n.fillText(s[c],d.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,c+1===i&&(e.y+=r.titleMarginBottom-l)}}_drawColorBox(e,n,r,s,i){const a=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=i,u=an(i.bodyFont),h=vl(this,"left",i),f=s.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=n.y+m;if(i.usePointStyle){const p={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},_=s.leftForLtr(f,d)+d/2,y=g+c/2;e.strokeStyle=i.multiKeyBackground,e.fillStyle=i.multiKeyBackground,$u(e,p,_,y),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,$u(e,p,_,y)}else{e.lineWidth=Te(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const p=s.leftForLtr(f,d),_=s.leftForLtr(s.xPlus(f,1),d-2),y=Po(a.borderRadius);Object.values(y).some(C=>C!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,Vu(e,{x:p,y:g,w:d,h:c,radius:y}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),Vu(e,{x:_,y:g+1,w:d-2,h:c-2,radius:y}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(p,g,d,c),e.strokeRect(p,g,d,c),e.fillStyle=a.backgroundColor,e.fillRect(_,g+1,d-2,c-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,n,r){const{body:s}=this,{bodySpacing:i,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,h=an(r.bodyFont);let f=h.lineHeight,m=0;const g=Iu(r.rtl,this.x,this.width),p=function(O){n.fillText(O,g.x(e.x+m),e.y+f/2),e.y+=f+i},_=g.textAlign(a);let y,C,k,v,M,T,S;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,e.x=vl(this,_,r),n.fillStyle=r.bodyColor,Re(this.beforeBody,p),m=l&&_!=="right"?a==="center"?d/2+u:d+2+u:0,v=0,T=s.length;v<T;++v){for(y=s[v],C=this.labelTextColors[v],n.fillStyle=C,Re(y.before,p),k=y.lines,l&&k.length&&(this._drawColorBox(n,e,v,g,r),f=Math.max(h.lineHeight,c)),M=0,S=k.length;M<S;++M)p(k[M]),f=h.lineHeight;Re(y.after,p)}m=0,f=h.lineHeight,Re(this.afterBody,p),e.y-=i}drawFooter(e,n,r){const s=this.footer,i=s.length;let a,l;if(i){const c=Iu(r.rtl,this.x,this.width);for(e.x=vl(this,r.footerAlign,r),e.y+=r.footerMarginTop,n.textAlign=c.textAlign(r.footerAlign),n.textBaseline="middle",a=an(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,l=0;l<i;++l)n.fillText(s[l],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+r.footerSpacing}}drawBackground(e,n,r,s){const{xAlign:i,yAlign:a}=this,{x:l,y:c}=e,{width:d,height:u}=r,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=Po(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(l+h,c),a==="top"&&this.drawCaret(e,n,r,s),n.lineTo(l+d-f,c),n.quadraticCurveTo(l+d,c,l+d,c+f),a==="center"&&i==="right"&&this.drawCaret(e,n,r,s),n.lineTo(l+d,c+u-g),n.quadraticCurveTo(l+d,c+u,l+d-g,c+u),a==="bottom"&&this.drawCaret(e,n,r,s),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),a==="center"&&i==="left"&&this.drawCaret(e,n,r,s),n.lineTo(l,c+h),n.quadraticCurveTo(l,c,l+h,c),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,r=this.$animations,s=r&&r.x,i=r&&r.y;if(s||i){const a=Wo[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=a2(this,e),c=Object.assign({},a,this._size),d=l2(n,e,c),u=c2(e,c,d,n);(s._to!==u.x||i._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=yn(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=r,this.drawBackground(i,e,s,n),Ex(e,n.textDirection),i.y+=a.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),$x(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const r=this._active,s=e.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),i=!nl(r,s),a=this._positionChanged(s,n);(i||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,i=this._active||[],a=this._getActiveElements(e,i,n,r),l=this._positionChanged(a,e),c=n||!nl(a,i)||l;return c&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,r,s){const i=this.options;if(e.type==="mouseout")return[];if(!s)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,i.mode,i,r);return i.reverse&&a.reverse(),a}_positionChanged(e,n){const{caretX:r,caretY:s,options:i}=this,a=Wo[i.position].call(this,e,n);return a!==!1&&(r!==a.x||s!==a.y)}}W(Qu,"positioners",Wo);var YS={id:"tooltip",_element:Qu,positioners:Wo,afterInit(t,e,n){n&&(t.tooltip=new Qu({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:h2},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 WS=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function jS(t,e,n,r){const s=t.indexOf(e);if(s===-1)return WS(t,e,n,r);const i=t.lastIndexOf(e);return s!==i?n:s}const ZS=(t,e)=>t===null?null:_n(Math.round(t),0,e);function f2(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Tl extends Fs{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:i}of n)r[s]===i&&r.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Ue(e))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===e?n:jS(r,e,Fe(n,e),this._addedLabels),ZS(n,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const e=this.min,n=this.max,r=this.options.offset,s=[];let i=this.getLabels();i=e===0&&n===i.length-1?i:i.slice(e,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=e;a<=n;a++)s.push({value:a});return s}getLabelForValue(e){return f2.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}}W(Tl,"id","category"),W(Tl,"defaults",{ticks:{callback:f2}});function US(t,e){const n=[],{bounds:s,step:i,min:a,max:l,precision:c,count:d,maxTicks:u,maxDigits:h,includeBounds:f}=t,m=i||1,g=u-1,{min:p,max:_}=e,y=!Ue(a),C=!Ue(l),k=!Ue(d),v=(_-p)/(h+1);let M=Nm((_-p)/g/m)*m,T,S,O,E;if(M<1e-14&&!y&&!C)return[{value:p},{value:_}];E=Math.ceil(_/M)-Math.floor(p/M),E>g&&(M=Nm(E*M/g/m)*m),Ue(c)||(T=Math.pow(10,c),M=Math.ceil(M*T)/T),s==="ticks"?(S=Math.floor(p/M)*M,O=Math.ceil(_/M)*M):(S=p,O=_),y&&C&&i&&xC((l-a)/i,M/1e3)?(E=Math.round(Math.min((l-a)/M,u)),M=(l-a)/E,S=a,O=l):k?(S=y?a:S,O=C?l:O,E=d-1,M=(O-S)/E):(E=(O-S)/M,Do(E,Math.round(E),M/1e3)?E=Math.round(E):E=Math.ceil(E));const I=Math.max(Am(M),Am(S));T=Math.pow(10,Ue(c)?I:c),S=Math.round(S*T)/T,O=Math.round(O*T)/T;let j=0;for(y&&(f&&S!==a?(n.push({value:a}),S<a&&j++,Do(Math.round((S+j*M)*T)/T,a,m2(a,v,t))&&j++):S<a&&j++);j<E;++j){const $=Math.round((S+j*M)*T)/T;if(C&&$>l)break;n.push({value:$})}return C&&f&&O!==l?n.length&&Do(n[n.length-1].value,l,m2(l,v,t))?n[n.length-1].value=l:n.push({value:l}):(!C||O===l)&&n.push({value:O}),n}function m2(t,e,{horizontal:n,minRotation:r}){const s=es(r),i=(n?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+t).length;return Math.min(e/i,a)}class Dl extends Fs{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 Ue(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:i}=this;const a=c=>s=n?s:c,l=c=>i=r?i:c;if(e){const c=xi(s),d=xi(i);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(s===i){let c=i===0?1:Math.abs(i*.05);l(i+c),e||a(s-c)}this.min=s,this.max=i}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=e,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,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,a=US(s,i);return e.bounds==="ticks"&&Bm(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const s=(r-n)/Math.max(e.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(e){return Du(e,this.chart.options.locale,this.options.ticks.format)}}class Ol extends Dl{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=lt(e)?e:0,this.max=lt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=es(this.options.ticks.minRotation),s=(e?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}W(Ol,"id","linear"),W(Ol,"defaults",{ticks:{callback:ll.formatters.numeric}});const jo=t=>Math.floor(Qr(t)),Rs=(t,e)=>Math.pow(10,jo(t)+e);function p2(t){return t/Math.pow(10,jo(t))===1}function g2(t,e,n){const r=Math.pow(10,n),s=Math.floor(t/r);return Math.ceil(e/r)-s}function qS(t,e){const n=e-t;let r=jo(n);for(;g2(t,e,r)>10;)r++;for(;g2(t,e,r)<10;)r--;return Math.min(r,jo(t))}function GS(t,{min:e,max:n}){e=nn(t.min,e);const r=[],s=jo(e);let i=qS(e,n),a=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),c=s>i?Math.pow(10,s):0,d=Math.round((e-c)*a)/a,u=Math.floor((e-c)/l/10)*l*10;let h=Math.floor((d-u)/Math.pow(10,i)),f=nn(t.min,Math.round((c+u+h*Math.pow(10,i))*a)/a);for(;f<n;)r.push({value:f,major:p2(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(i++,h=2,a=i>=0?1:a),f=Math.round((c+u+h*Math.pow(10,i))*a)/a;const m=nn(t.max,f);return r.push({value:m,major:p2(m),significand:h}),r}class _2 extends Fs{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const r=Dl.prototype.parse.apply(this,[e,n]);if(r===0){this._zero=!0;return}return lt(r)&&r>0?r:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=lt(e)?Math.max(0,e):null,this.max=lt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!lt(this._userMin)&&(this.min=e===Rs(this.min,0)?Rs(this.min,-1):Rs(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let r=this.min,s=this.max;const i=l=>r=e?r:l,a=l=>s=n?s:l;r===s&&(r<=0?(i(1),a(10)):(i(Rs(r,-1)),a(Rs(s,1)))),r<=0&&i(Rs(s,-1)),s<=0&&a(Rs(r,1)),this.min=r,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},r=GS(n,this);return e.bounds==="ticks"&&Bm(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(e){return e===void 0?"0":Du(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Qr(e),this._valueRange=Qr(this.max)-Qr(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Qr(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}W(_2,"id","logarithmic"),W(_2,"defaults",{ticks:{callback:ll.formatters.logarithmic,major:{enabled:!0}}});function e1(t){const e=t.ticks;if(e.display&&t.display){const n=yn(e.backdropPadding);return Fe(e.font&&e.font.size,gt.font.size)+n.height}return 0}function KS(t,e,n){return n=st(n)?n:[n],{w:WC(t,e.string,n),h:n.length*e.lineHeight}}function y2(t,e,n,r,s){return t===r||t===s?{start:e-n/2,end:e+n/2}:t<r||t>s?{start:e-n,end:e}:{start:e,end:e+n}}function XS(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),r=[],s=[],i=t._pointLabels.length,a=t.options.pointLabels,l=a.centerPointLabels?Dt/i:0;for(let c=0;c<i;c++){const d=a.setContext(t.getPointLabelContext(c));s[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+s[c],l),h=an(d.font),f=KS(t.ctx,h,t._pointLabels[c]);r[c]=f;const m=on(t.getIndexAngle(c)+l),g=Math.round(xu(m)),p=y2(g,u.x,f.w,0,180),_=y2(g,u.y,f.h,90,270);JS(n,e,m,p,_)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=tv(t,r,s)}function JS(t,e,n,r,s){const i=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let l=0,c=0;r.start<e.l?(l=(e.l-r.start)/i,t.l=Math.min(t.l,e.l-l)):r.end>e.r&&(l=(r.end-e.r)/i,t.r=Math.max(t.r,e.r+l)),s.start<e.t?(c=(e.t-s.start)/a,t.t=Math.min(t.t,e.t-c)):s.end>e.b&&(c=(s.end-e.b)/a,t.b=Math.max(t.b,e.b+c))}function QS(t,e,n){const r=t.drawingArea,{extra:s,additionalAngle:i,padding:a,size:l}=n,c=t.getPointPosition(e,r+s+a,i),d=Math.round(xu(on(c.angle+sn))),u=sv(c.y,l.h,d),h=nv(d),f=rv(c.x,l.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+l.w,bottom:u+l.h}}function ev(t,e){if(!e)return!0;const{left:n,top:r,right:s,bottom:i}=t;return!(_r({x:n,y:r},e)||_r({x:n,y:i},e)||_r({x:s,y:r},e)||_r({x:s,y:i},e))}function tv(t,e,n){const r=[],s=t._pointLabels.length,i=t.options,{centerPointLabels:a,display:l}=i.pointLabels,c={extra:e1(i)/2,additionalAngle:a?Dt/s:0};let d;for(let u=0;u<s;u++){c.padding=n[u],c.size=e[u];const h=QS(t,u,c);r.push(h),l==="auto"&&(h.visible=ev(h,d),h.visible&&(d=h))}return r}function nv(t){return t===0||t===180?"center":t<180?"left":"right"}function rv(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function sv(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function iv(t,e,n){const{left:r,top:s,right:i,bottom:a}=n,{backdropColor:l}=e;if(!Ue(l)){const c=Po(e.borderRadius),d=yn(e.backdropPadding);t.fillStyle=l;const u=r-d.left,h=s-d.top,f=i-r+d.width,m=a-s+d.height;Object.values(c).some(g=>g!==0)?(t.beginPath(),Vu(t,{x:u,y:h,w:f,h:m,radius:c}),t.fill()):t.fillRect(u,h,f,m)}}function ov(t,e){const{ctx:n,options:{pointLabels:r}}=t;for(let s=e-1;s>=0;s--){const i=t._pointLabelItems[s];if(!i.visible)continue;const a=r.setContext(t.getPointLabelContext(s));iv(n,a,i);const l=an(a.font),{x:c,y:d,textAlign:u}=i;dl(n,t._pointLabels[s],c,d+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function w2(t,e,n,r){const{ctx:s}=t;if(n)s.arc(t.xCenter,t.yCenter,e,0,rn);else{let i=t.getPointPosition(0,e);s.moveTo(i.x,i.y);for(let a=1;a<r;a++)i=t.getPointPosition(a,e),s.lineTo(i.x,i.y)}}function av(t,e,n,r,s){const i=t.ctx,a=e.circular,{color:l,lineWidth:c}=e;!a&&!r||!l||!c||n<0||(i.save(),i.strokeStyle=l,i.lineWidth=c,i.setLineDash(s.dash),i.lineDashOffset=s.dashOffset,i.beginPath(),w2(t,n,a,r),i.closePath(),i.stroke(),i.restore())}function lv(t,e,n){return ts(t,{label:n,index:e,type:"pointLabel"})}class El extends Dl{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=yn(e1(this.options)/2),n=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=lt(e)&&!isNaN(e)?e:0,this.max=lt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/e1(this.options))}generateTickLabels(e){Dl.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,r)=>{const s=ct(this.options.pointLabels.callback,[n,r],this);return s||s===0?s:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const e=this.options;e.display&&e.pointLabels.display?XS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,r,s){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((r-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,r,s))}getIndexAngle(e){const n=rn/(this._pointLabels.length||1),r=this.options.startAngle||0;return on(e*n+es(r))}getDistanceFromCenterForValue(e){if(Ue(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(Ue(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 r=n[e];return lv(this.getContext(),e,r)}}getPointPosition(e,n,r=0){const s=this.getIndexAngle(e)-sn+r;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}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:r,right:s,bottom:i}=this._pointLabelItems[e];return{left:n,top:r,right:s,bottom:i}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const r=this.ctx;r.save(),r.beginPath(),w2(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:r,grid:s,border:i}=n,a=this._pointLabels.length;let l,c,d;if(n.pointLabels.display&&ov(this,a),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=i.setContext(f);av(this,m,c,a,g)}}),r.display){for(e.save(),l=a-1;l>=0;l--){const u=r.setContext(this.getPointLabelContext(l)),{color:h,lineWidth:f}=u;!f||!h||(e.lineWidth=f,e.strokeStyle=h,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),d=this.getPointPosition(l,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const s=this.getIndexAngle(0);let i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const d=r.setContext(this.getContext(c)),u=an(d.font);if(i=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=d.backdropColor;const h=yn(d.backdropPadding);e.fillRect(-a/2-h.left,-i-u.size/2-h.top,a+h.width,u.size+h.height)}dl(e,l.label,0,-i,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}W(El,"id","radialLinear"),W(El,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ll.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),W(El,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),W(El,"descriptors",{angleLines:{_fallback:"grid"}});const $l={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}},Zt=Object.keys($l);function b2(t,e){return t-e}function k2(t,e){if(Ue(e))return null;const n=t._adapter,{parser:r,round:s,isoWeekday:i}=t._parseOpts;let a=e;return typeof r=="function"&&(a=r(a)),lt(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(Oo(i)||i===!0)?n.startOf(a,"isoWeek",i):n.startOf(a,s)),+a)}function C2(t,e,n,r){const s=Zt.length;for(let i=Zt.indexOf(t);i<s-1;++i){const a=$l[Zt[i]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(l*a.size))<=r)return Zt[i]}return Zt[s-1]}function cv(t,e,n,r,s){for(let i=Zt.length-1;i>=Zt.indexOf(n);i--){const a=Zt[i];if($l[a].common&&t._adapter.diff(s,r,a)>=e-1)return a}return Zt[n?Zt.indexOf(n):0]}function dv(t){for(let e=Zt.indexOf(t)+1,n=Zt.length;e<n;++e)if($l[Zt[e]].common)return Zt[e]}function x2(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:s}=Su(n,e),i=n[r]>=e?n[r]:n[s];t[i]=!0}}function uv(t,e,n,r){const s=t._adapter,i=+s.startOf(e[0].value,r),a=e[e.length-1].value;let l,c;for(l=i;l<=a;l=+s.add(l,1,r))c=n[l],c>=0&&(e[c].major=!0);return e}function M2(t,e,n){const r=[],s={},i=e.length;let a,l;for(a=0;a<i;++a)l=e[a],s[l]=a,r.push({value:l,major:!1});return i===0||!n?r:uv(t,r,s,n)}class Pl extends Fs{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 r=e.time||(e.time={}),s=this._adapter=new Jx._date(e.adapters.date);s.init(n),To(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:k2(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,r=e.time.unit||"day";let{min:s,max:i,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!l&&!isNaN(d.max)&&(i=Math.max(i,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=lt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),i=lt(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,i-1),this.max=Math.max(s+1,i)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],r=e[e.length-1]),{min:n,max:r}}buildTicks(){const e=this.options,n=e.time,r=e.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const i=this.min,a=this.max,l=DC(s,i,a);return this._unit=n.unit||(r.autoSkip?C2(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):cv(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:dv(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),M2(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,r=0,s,i;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?n=1-s:n=(this.getDecimalForValue(e[1])-s)/2,i=this.getDecimalForValue(e[e.length-1]),e.length===1?r=i:r=(i-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;n=_n(n,0,a),r=_n(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const e=this._adapter,n=this.min,r=this.max,s=this.options,i=s.time,a=i.unit||C2(i.minUnit,n,r,this._getLabelCapacity(n)),l=Fe(s.ticks.stepSize,1),c=a==="week"?i.isoWeekday:!1,d=Oo(c)||c===!0,u={};let h=n,f,m;if(d&&(h=+e.startOf(h,"isoWeek",c)),h=+e.startOf(h,d?"day":a),e.diff(r,n,a)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<r;f=+e.add(f,l,a),m++)x2(u,f,g);return(f===r||s.bounds==="ticks"||m===1)&&x2(u,f,g),Object.keys(u).sort(b2).map(p=>+p)}getLabelForValue(e){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(e,r.tooltipFormat):n.format(e,r.displayFormats.datetime)}format(e,n){const s=this.options.time.displayFormats,i=this._unit,a=n||s[i];return this._adapter.format(e,a)}_tickFormatFunction(e,n,r,s){const i=this.options,a=i.ticks.callback;if(a)return ct(a,[e,n,r],this);const l=i.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],h=d&&l[d],f=r[n],m=d&&h&&f&&f.major;return this._adapter.format(e,s||(m?h:u))}generateTickLabels(e){let n,r,s;for(n=0,r=e.length;n<r;++n)s=e[n],s.label=this._tickFormatFunction(s.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,r=this.ctx.measureText(e).width,s=es(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(s),a=Math.sin(s),l=this._resolveTickFontOptions(0).size;return{w:r*i+l*a,h:r*a+l*i}}_getLabelCapacity(e){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,i=this._tickFormatFunction(e,0,M2(this,[e],this._majorUnit),s),a=this._getLabelSize(i),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],n,r;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)e=e.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,r;if(e.length)return e;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)e.push(k2(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return EC(e.sort(b2))}}W(Pl,"id","time"),W(Pl,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ll(t,e,n){let r=0,s=t.length-1,i,a,l,c;n?(e>=t[r].pos&&e<=t[s].pos&&({lo:r,hi:s}=Es(t,"pos",e)),{pos:i,time:l}=t[r],{pos:a,time:c}=t[s]):(e>=t[r].time&&e<=t[s].time&&({lo:r,hi:s}=Es(t,"time",e)),{time:i,pos:l}=t[r],{time:a,pos:c}=t[s]);const d=a-i;return d?l+(c-l)*(e-i)/d:l}class S2 extends Pl{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=Ll(n,this.min),this._tableRange=Ll(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:r}=this,s=[],i=[];let a,l,c,d,u;for(a=0,l=e.length;a<l;++a)d=e[a],d>=n&&d<=r&&s.push(d);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,l=s.length;a<l;++a)u=s[a+1],c=s[a-1],d=s[a],Math.round((u+c)/2)!==d&&i.push({time:d,pos:a/(l-1)});return i}_generate(){const e=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,i)=>s-i)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?e=this.normalize(n.concat(r)):e=n.length?n:r,e=this._cache.all=e,e}getDecimalForValue(e){return(Ll(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return Ll(this._table,r*this._tableRange+this._minPos,!0)}}W(S2,"id","timeseries"),W(S2,"defaults",Pl.defaults);const v2={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},hv={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...v2,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},fv=o.version[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function vi(t){return o.isProxy(t)?o.toRaw(t):t}function mv(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return o.isProxy(e)?new Proxy(t,{}):t}function pv(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function T2(t,e){t.labels=e}function D2(t,e,n){const r=[];t.datasets=e.map(s=>{const i=t.datasets.find(a=>a[n]===s[n]);return!i||!s.data||r.includes(i)?{...s}:(r.push(i),Object.assign(i,s),i)})}function gv(t,e){const n={labels:[],datasets:[]};return T2(n,t.labels),D2(n,t.datasets,e),n}const _v=o.defineComponent({props:hv,setup(t,e){let{expose:n,slots:r}=e;const s=o.ref(null),i=o.shallowRef(null);n({chart:i});const a=()=>{if(!s.value)return;const{type:d,data:u,options:h,plugins:f,datasetIdKey:m}=t,g=gv(u,m),p=mv(g,u);i.value=new zo(s.value,{type:d,data:p,options:{...h},plugins:f})},l=()=>{const d=o.toRaw(i.value);d&&(t.destroyDelay>0?setTimeout(()=>{d.destroy(),i.value=null},t.destroyDelay):(d.destroy(),i.value=null))},c=d=>{d.update(t.updateMode)};return o.onMounted(a),o.onUnmounted(l),o.watch([()=>t.options,()=>t.data],(d,u)=>{let[h,f]=d,[m,g]=u;const p=o.toRaw(i.value);if(!p)return;let _=!1;if(h){const y=vi(h),C=vi(m);y&&y!==C&&(pv(p,y),_=!0)}if(f){const y=vi(f.labels),C=vi(g.labels),k=vi(f.datasets),v=vi(g.datasets);y!==C&&(T2(p.config.data,y),_=!0),k&&k!==v&&(D2(p.config.data,k,t.datasetIdKey),_=!0)}_&&o.nextTick(()=>{c(p)})},{deep:!0}),()=>o.h("canvas",{role:"img",ariaLabel:t.ariaLabel,ariaDescribedby:t.ariaDescribedby,ref:s},[o.h("p",{},[r.default?r.default():""])])}});function yv(t,e){return zo.register(e),o.defineComponent({props:v2,setup(n,r){let{expose:s}=r;const i=o.shallowRef(null),a=l=>{i.value=l==null?void 0:l.chart};return s({chart:i}),()=>o.h(_v,fv({ref:a},{type:t,...n}))}})}const O2=yv("line",gl),wv={class:"chart-container"},t1={__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){zo.register(Tl,Ol,Yo,wr,YS,o2);const e=t,n=o.ref(0);let r=o.reactive({isEmpty:!0});const s=h=>{const f=new Set,m=[];let g=[];switch(e.dataType){case"balanceChartData":h.length===0?g=[0,0]:g=h.map(_=>(f.add(_.date),Et(_.balance*Mc(),2)));break;case"performanceChartData":h.length===0?g=[0,0]:g=h.reduce((_,y,C)=>{f.add(y.date);const k=C?_[C-1]:0,v=Et(k+y.pnl_to_deposit,2);return _.push(v),_},[]);break}m.push({data:g});const p=Array.from(f);return p.length===1?(p.push(...p),m.forEach(_=>{_.data.push(..._.data)}),r.isEmpty=!1):p.length===0?(r.isEmpty=!0,p.push(0,0)):r.isEmpty=!1,{labels:p,datasets:m}},i=o.computed(()=>s(e.data)),a=h=>{const m=h.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return m.addColorStop(0,e.gradient.startColor),m.addColorStop(1,e.gradient.endColor),m},l=(h,f)=>{let m=document.querySelector(`#${h}-${e.dataType}`);return m||(m=document.createElement("div"),m.classList.add(h),m.setAttribute("id",`${h}-${e.dataType}`),f.canvas.parentNode.appendChild(m)),m},c=h=>{if(!r.isEmpty){const{chart:f,tooltip:m}=h,g=l("chart-tooltip",f);if(m.opacity===0){g.style.opacity="0";return}if(m.body){const M=m.title||[],T=m.body.map(O=>O.lines),S=document.createElement("div");for(S.classList.add("chart-tooltip-middle"),S.innerHTML=`<div class="chart-tooltip-content">
40
40
  ${e.dataType==="balanceChartData"?`${pa()}${Me(e.isMask,dh(T[0]),{repeat:6})}`:`${Me(e.isMask,dh(T[0]),{repeat:3})}%`}
41
- <span> | ${uh(M[0])}, ${p6(M[0])}</span></div>`;g.firstChild;)g.firstChild.remove();g.appendChild(S)}const{offsetLeft:p,offsetTop:_,clientWidth:y}=f.canvas;let C=p+m.caretX;const k=_+m.caretY,v=g.clientWidth;C+v>y&&(C-=v),g.style.opacity="1",g.style.left=C+"px",g.style.top=k+"px"}},d=h=>{const{chart:f}=h,m=l("chart-line",f),g=f.chartArea;f.canvas.addEventListener("mousemove",function(p){const _=f.canvas.getBoundingClientRect(),y=p.clientX-_.left,C=p.clientY-_.top;y>=g.left&&y<=g.right&&C>=g.top&&C<=g.bottom?(m.style.left=y+"px",m.style.top=g.top+"px",m.style.height=g.bottom-g.top+"px",m.style.display="flex"):m.style.display="none"}),f.canvas.addEventListener("mouseout",function(){m.style.display="none"})},u=o.computed(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},scales:{x:{ticks:{display:!r.isEmpty,callback:function(h){return uh(this.getLabelForValue(h)).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:"#EDEDED"}},y:{ticks:{display:!r.isEmpty,callback:function(h){return e.ticksCallback(h)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15},grid:{color:"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}},plugins:{tooltip:{enabled:!1,position:"nearest",external:c},legend:!1},elements:{line:{backgroundColor:h=>a(h),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:d}));return o.watch(()=>e.isMask,()=>{n.value+=1},{immediate:!0}),(h,f)=>(o.openBlock(),o.createElementBlock("div",wv,[(o.openBlock(),o.createBlock(o.unref(O2),{key:n.value,data:i.value,options:u.value},null,8,["data","options"]))]))}},n1={__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){zo.register(Tl,Ol,Yo,wr,o2);const e=t,n=a=>{const l=new Set,c=[],d=a.map(h=>(l.add(h.date),h.balance));return c.push({data:d}),{labels:Array.from(l),datasets:c}},r=o.computed(()=>n(e.data)),s=a=>{const c=a.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return c.addColorStop(0,e.gradient.startColor),c.addColorStop(1,e.gradient.endColor),c},i=o.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:a=>s(a),tension:.3,borderWidth:4,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}}});return(a,l)=>(o.openBlock(),o.createBlock(o.unref(O2),{data:r.value,options:i.value},null,8,["data","options"]))}},bv=t=>(o.pushScopeId("data-v-af1e1a1d"),t=t(),o.popScopeId(),t),kv={class:"account-balance-widget"},Cv={class:"account-balance-widget__top"},xv={class:"account-balance-widget__title-wrapper"},Mv=bv(()=>o.createElementVNode("div",{class:"account-balance-widget__title"},"Account Balance",-1)),Sv=Oe({__name:"AccountBalanceWidget",props:{balanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1}},setup(t){const e=o.ref("week"),n=s=>{const i=s*Mc();return i>=1e3||i<=-1e3?Me(r.isMask,Et(i/1e3,2)+"k",{repeat:3}):Et(i,2)},r=t;return(s,i)=>(o.openBlock(),o.createElementBlock("div",kv,[o.createElementVNode("div",Cv,[o.createElementVNode("div",xv,[Mv,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("This graphic widget displays changes to your deposit over a specific time period. ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ws),{key:0,modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=a=>e.value=a),onOnChange:i[1]||(i[1]=a=>s.$emit("onChange",e.value))},null,8,["modelValue"]))]),o.createVNode(o.unref(t1),{data:t.balanceChartData,"data-type":"balanceChartData","ticks-callback":n,isMask:t.isMask},null,8,["data","isMask"])]))}},[["__scopeId","data-v-af1e1a1d"]]),E2=t=>(o.pushScopeId("data-v-313ab42e"),t=t(),o.popScopeId(),t),vv={class:"balance-widget"},Tv={class:"balance-part"},Dv={class:"balance-part__top"},Ov={class:"balance-part__title-wrapper"},Ev=E2(()=>o.createElementVNode("div",{class:"balance-part__title"},"Balance",-1)),$v={class:"balance-part__content"},Pv={class:"balance-part__content__wrapper"},Lv={class:"balance-part__content__count"},Vv={class:"balance-part__content__bitcoin"},Nv={key:0,class:"devider"},Bv={key:1,class:"personal-target-part"},Av={class:"personal-target-part__top"},Fv={class:"personal-target-part__title-wrapper"},Rv=E2(()=>o.createElementVNode("div",{class:"personal-target-part__title"},"Personal target",-1)),Iv={class:"personal-target-part__content"},Hv={class:"personal-target-part__content__current"},zv={class:"personal-target-part__content__from"},Yv=Oe({__name:"BalanceWidget",props:{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}},emits:["switchModal","switchVisibility"],setup(t,{emit:e}){const n=e,r=()=>{n("switchVisibility")};return(s,i)=>(o.openBlock(),o.createElementBlock("div",vv,[o.createElementVNode("div",Tv,[o.createElementVNode("div",Dv,[o.createElementVNode("div",Ov,[Ev,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays the balance of your deposit in USD and BTC equivalent, additionally showing the growth/fall of your balance.")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"balance-part__visibility-switcher",onClick:r},[o.withDirectives(o.createVNode(o.unref(Le),{icon:"eye"},null,512),[[o.vShow,t.isHidden]]),o.withDirectives(o.createVNode(o.unref(Le),{icon:"eye-slash"},null,512),[[o.vShow,!t.isHidden]])]))]),o.createElementVNode("div",$v,[o.createElementVNode("div",Pv,[o.createElementVNode("div",Lv,o.toDisplayString(o.unref(Me)(t.isMaskBalance,o.unref(Ke)(t.USDT),{prefix:"$"})),1),t.delta?(o.openBlock(),o.createBlock(o.unref(sc),{key:0,"is-hidden":t.isMaskBalance,percentage:"",delta:t.delta},null,8,["is-hidden","delta"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Vv,"= "+o.toDisplayString(o.unref(Me)(t.isMaskBalance,t.BTC))+" BTC",1)]),t.isShare?(o.openBlock(),o.createBlock(o.unref(n1),{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","gradient"])):(o.openBlock(),o.createBlock(o.unref(n1),{key:1,class:"balance-part__chart",data:t.balanceChartData},null,8,["data"]))]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Nv)),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Bv,[o.createElementVNode("div",Av,[o.createElementVNode("div",Fv,[Rv,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.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})]),o.createElementVNode("div",{class:"balance-part__modal-switcher",onClick:i[0]||(i[0]=a=>n("switchModal"))},[o.createVNode(o.unref(Le),{icon:"settings"})])]),o.createElementVNode("div",Iv,[o.createElementVNode("div",Hv,o.toDisplayString(o.unref(Me)(t.isMaskPersonalTarget,o.unref(Ke)(t.currentProfit,{isPercentage:t.isPercentage,isFixed:!0}),{prefix:"$",repeat:5})),1),o.createElementVNode("div",zv,"/ "+o.toDisplayString(o.unref(Me)(t.isMaskPersonalTarget,o.unref(Ke)(t.profit,{isPercentage:t.isPercentage,isFixed:!0}))),1)]),o.createVNode(o.unref(R3),{"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"])]))]))}},[["__scopeId","data-v-313ab42e"]]),Vl=t=>(o.pushScopeId("data-v-105f730b"),t=t(),o.popScopeId(),t),Wv={class:"calendar-widget"},jv={class:"calendar-widget__calendar"},Zv={class:"calendar-widget__top"},Uv={class:"calendar-widget__title-wrapper"},qv=Vl(()=>o.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),Gv={class:"stat-calendar"},Kv={class:"stat-calendar__week-days"},Xv={key:0,class:"stat-calendar__row-wrapper"},Jv={class:"stat-calendar__row"},Qv=["onClick"],eT=Vl(()=>o.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),tT={key:0,class:"calendar-widget__day"},nT={class:"calendar-widget__day__title"},rT={class:"calendar-widget__day__content"},sT={class:"calendar-widget__point"},iT={class:"calendar-widget__point__title"},oT=Vl(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),aT={class:"calendar-widget__day__trades"},lT={class:"calendar-widget__point"},cT={class:"calendar-widget__point__title"},dT=Vl(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),uT=Oe({__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,currentDate:Date,isCurrentDate:Function,isCurrentDay:Function,isMask:{type:Boolean,default:!1}},emits:["setNewDate","chooseMonth"],setup(t,{emit:e}){const n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=o.ref(null),s=o.ref(null),i=e,a=t,l=u=>{r.value=u.year,s.value=u.month,i("chooseMonth",u)};o.nextTick(()=>{const u=new Date;r.value=u.getFullYear(),s.value=u.getMonth()});const c=o.computed(()=>[{title:"Total trades",value:a.dailyStatData&&a.dailyStatData.trades_total_count||0},{title:"Winrate",value:Ke(a.dailyStatData&&a.dailyStatData.win_rate||0,{isPercentage:!0,isFixed:!0}),class:a.dailyStatData&&a.dailyStatData.win_rate>=50?"-win":"-loss"},{title:"Return",value:Ke(a.dailyStatData&&a.dailyStatData.return_total||0),class:a.dailyStatData&&a.dailyStatData.return_total>=0?"-win":"-loss"},{title:"Return on winners",value:Ke(a.dailyStatData&&a.dailyStatData.return_win||0)},{title:"Return on losers",value:Ke(a.dailyStatData&&a.dailyStatData.return_lose||0)},{title:"Commission",value:Ke(a.dailyStatData&&a.dailyStatData.commission||0)}]),d=o.computed(()=>[{title:"Win trades",value:a.dailyStatData&&a.dailyStatData.trades_win_count||0,isPositive:!0},{title:"Loss trades",value:-(a.dailyStatData&&a.dailyStatData.trades_lose_count)||0,isNegative:!1}]);return(u,h)=>{var f,m;return o.openBlock(),o.createElementBlock("div",Wv,[o.createElementVNode("div",jv,[o.createElementVNode("div",Zv,[o.createElementVNode("div",Uv,[qv,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.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?(o.openBlock(),o.createBlock(o.unref(F3),{key:0,"current-date":t.currentDate,onOnChange:l,year:r.value,"onUpdate:year":h[0]||(h[0]=g=>r.value=g),month:s.value,"onUpdate:month":h[1]||(h[1]=g=>s.value=g)},null,8,["current-date","year","month"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Gv,[o.createElementVNode("div",Kv,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(n,(g,p)=>o.createElementVNode("div",{class:o.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(p)}])},o.toDisplayString(g),3)),64))]),t.rows?(o.openBlock(),o.createElementBlock("div",Xv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rows,g=>(o.openBlock(),o.createElementBlock("div",Jv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g,p=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["stat-calendar__day",{"-empty":!p.date,"-current":t.isCurrentDate(p.date),"-positive":p.win,"-negative":p.win===!1}]),onClick:_=>i("setNewDate",p.date)},o.toDisplayString(p.date?p.date:""),11,Qv))),256))]))),256))])):o.createCommentVNode("",!0)])]),eT,t.dailyStatData&&!t.dailyStatData.isNull?(o.openBlock(),o.createElementBlock("div",tT,[o.createElementVNode("div",nT,o.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),o.createElementVNode("div",rT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,g=>(o.openBlock(),o.createElementBlock("div",sT,[o.createElementVNode("div",iT,o.toDisplayString(g.title),1),oT,o.createElementVNode("div",{class:o.normalizeClass(["calendar-widget__point__value",g.class?g.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,g.value,{repeat:5})),3)]))),256)),o.createVNode(o.unref(xm),{isHidden:t.isMask,long:(f=t.dailyStatData)==null?void 0:f.long_count,short:(m=t.dailyStatData)==null?void 0:m.short_count},null,8,["isHidden","long","short"]),o.createElementVNode("div",aT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,g=>(o.openBlock(),o.createElementBlock("div",lT,[o.createElementVNode("div",cT,o.toDisplayString(g.title),1),dT,o.createVNode(o.unref(sc),{isHidden:t.isMask,"is-positive":g.isPositive,"is-negative":g.isNegative,delta:g.value},null,8,["isHidden","is-positive","is-negative","delta"])]))),256))])])])):(o.openBlock(),o.createBlock(o.unref(gu),{key:1,class:"-empty"}))])}}},[["__scopeId","data-v-105f730b"]]),r1=t=>(o.pushScopeId("data-v-4ce47bda"),t=t(),o.popScopeId(),t),hT={class:"commission-widget"},fT={class:"commission-widget__content"},mT={class:"commission-widget__top"},pT={class:"commission-widget__title-wrapper"},gT=r1(()=>o.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),_T={class:"commission-widget__info"},yT={class:"commission-widget__total-wrapper"},wT=r1(()=>o.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),bT={class:"commission-widget__total-wrapper__total"},kT={class:"commission-widget__total-wrapper__value"},CT={class:"commission-widget__points"},xT={class:"commission-widget__point"},MT={class:"commission-widget__point__title"},ST=r1(()=>o.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),vT=Oe({__name:"CommissionsFeesWidget",props:{commission:Number,commissionData:Object,isMask:{type:Boolean,default:!1}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e,s=t,i=o.computed(()=>s.commissionData&&s.commissionData.commission||0),a=o.computed(()=>s.commissionData&&s.commissionData.pnl||0),l=o.computed(()=>[{title:"AVG fees per trade",value:`${Ke(s.commissionData&&s.commissionData.fees_per_trade||0)}`},{title:"PNL / Commission",value:a.value&&i.value?`${Ke(a.value)}/${Ke(i.value)}`:`${Ke(0)}`},{title:"AVG fees per day",value:`${Ke(s.commissionData&&s.commissionData.fees_per_day||0)}`},{title:"Funding",value:`${Ke(s.commissionData&&s.commissionData.funding||0)}`}]);return(c,d)=>(o.openBlock(),o.createElementBlock("div",hT,[o.createElementVNode("div",fT,[o.createElementVNode("div",mT,[o.createElementVNode("div",pT,[gT,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("This widget helps traders finally understand how much money they spent on commissions and funding. ")]),_:1})]),o.createVNode(o.unref(Ws),{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=u=>n.value=u),onOnChange:d[1]||(d[1]=u=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",_T,[o.createElementVNode("div",yT,[wT,o.createElementVNode("div",bT,[o.createElementVNode("div",kT,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(i.value),{repeat:5})),1)])]),o.createElementVNode("div",CT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,(u,h)=>(o.openBlock(),o.createElementBlock("div",xT,[o.createElementVNode("div",MT,o.toDisplayString(u.title),1),ST,o.createElementVNode("div",{class:o.normalizeClass(["commission-widget__point__value",u.class?u.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,u.value,{repeat:5})),3)]))),256))])])])]))}},[["__scopeId","data-v-4ce47bda"]]),TT=t=>(o.pushScopeId("data-v-7187c939"),t=t(),o.popScopeId(),t),DT={class:"performance-widget"},OT={class:"performance-widget__top"},ET={class:"performance-widget__title-wrapper"},$T=TT(()=>o.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),PT=Oe({__name:"PerformanceWidget",props:{performanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1}},setup(t){const e=o.ref("week"),n=t,r=s=>Me(n.isMask,Et(s,2)+"%",{repeat:3});return(s,i)=>(o.openBlock(),o.createElementBlock("div",DT,[o.createElementVNode("div",OT,[o.createElementVNode("div",ET,[$T,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The linear graphics widget displays the profit as a percentage of the deposit. ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ws),{key:0,modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=a=>e.value=a),onOnChange:i[1]||(i[1]=a=>s.$emit("onChange",e.value))},null,8,["modelValue"]))]),o.createVNode(o.unref(t1),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":r,isMask:t.isMask},null,8,["data","isMask"])]))}},[["__scopeId","data-v-7187c939"]]),s1=t=>(o.pushScopeId("data-v-20b275a1"),t=t(),o.popScopeId(),t),LT={class:"return-widget"},VT={class:"return-widget__content"},NT={class:"return-widget__top"},BT={class:"return-widget__title-wrapper"},AT=s1(()=>o.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),FT={class:"return-widget__info"},RT={class:"return-widget__total-wrapper"},IT=s1(()=>o.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),HT={class:"return-widget__total-wrapper__total"},zT={class:"return-widget__points"},YT={class:"return-widget__point"},WT={class:"return-widget__point__title"},jT=s1(()=>o.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),ZT=["innerHTML"],UT=Oe({__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}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e,s=t,i=o.computed(()=>[{title:"Average return per trade",value:s.totalReturn,options:{isPlus:!0,isFixed:!0},class:s.totalReturn===0?"":s.totalReturn>0?"-win":"-loss"},{title:"Daily return",value:s.daily,options:{isPlus:!0,isFixed:!0},class:s.daily===0?"":s.daily>0?"-win":"-loss"},{title:"Return on winners",value:s.win,class:"-win"},{title:"Return on losers",value:s.lose,class:"-loss"}]),a=o.computed(()=>s.returnPeriod>0),l=o.computed(()=>s.returnPeriod<0),c=o.computed(()=>s.profitFactor>1?"-positive":"-negative"),d=o.computed(()=>s.profitFactor>0?`Your profit factor is ${Me(s.isMask,Et(s.profitFactor),{repeat:5})}. <br /> You earn ${Me(s.isMask,Ke(s.profitFactor),{repeat:5,prefix:"$"})} on every ${Me(s.isMask,"$1",{repeat:5,prefix:"$"})} loss.`:`Your profit factor is ${Me(s.isMask,Et(s.profitFactor),{repeat:5})}. <br/> You loss ${Me(s.isMask,Ke(Math.abs(s.profitFactor)),{repeat:5,prefix:"$"})} on every ${Me(s.isMask,"$1",{repeat:5,prefix:"$"})} earn. `);return(u,h)=>(o.openBlock(),o.createElementBlock("div",LT,[o.createElementVNode("div",VT,[o.createElementVNode("div",NT,[o.createElementVNode("div",BT,[AT,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.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})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ws),{key:0,modelValue:n.value,"onUpdate:modelValue":h[0]||(h[0]=f=>n.value=f),onOnChange:h[1]||(h[1]=f=>r("onChange",n.value))},null,8,["modelValue"]))]),o.createElementVNode("div",FT,[o.createElementVNode("div",RT,[IT,o.createElementVNode("div",HT,[o.createElementVNode("div",{class:o.normalizeClass(["return-widget__total-wrapper__value",{"-positive":a.value,"-negative":l.value}])},o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(t.returnPeriod,{isPlus:!0,isFixed:!0}),{repeat:5})),3),s.changeRate?(o.openBlock(),o.createBlock(o.unref(sc),{key:0,percentage:"",isHidden:t.isMask,delta:s.changeRate},null,8,["isHidden","delta"])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",zT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,f=>(o.openBlock(),o.createElementBlock("div",YT,[o.createElementVNode("div",WT,o.toDisplayString(f.title),1),jT,o.createElementVNode("div",{class:o.normalizeClass(["return-widget__point__value",f.class?f.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(f.value,f.options),{repeat:5,prefix:"$"})),3)]))),256))])])]),t.profitFactor?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["return-widget__profit",c.value])},[o.createVNode(o.unref(Le),{icon:"tip",class:"return-widget__profit__icon"}),o.createElementVNode("div",{class:"return-widget__profit__text",innerHTML:d.value},null,8,ZT)],2)):o.createCommentVNode("",!0)]))}},[["__scopeId","data-v-20b275a1"]]),$2=t=>(o.pushScopeId("data-v-d9b5a9e6"),t=t(),o.popScopeId(),t),qT={class:"top-positions-widget"},GT={class:"top-positions-widget__top"},KT={class:"top-positions-widget__title-wrapper"},XT=$2(()=>o.createElementVNode("div",{class:"top-positions-widget__title"},"Top Positions",-1)),JT={key:0,class:"top-positions-widget__returns"},QT={class:"top-positions-widget__return"},eD={class:"top-positions-widget__return__left"},tD=$2(()=>o.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),nD={class:"top-positions-widget__return__pair"},rD={class:"top-positions-widget__return__right"},sD={class:"top-positions-widget__return__pnl"},iD=Oe({__name:"TopPositionsWidget",props:{topPositions:{type:Array,default:[]},isMask:{type:Boolean,default:!1}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",qT,[o.createElementVNode("div",GT,[o.createElementVNode("div",KT,[XT,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Helps you find the top profitable positions. We calculate only net PNL, taking into account commission and funding. ")]),_:1})]),o.createVNode(o.unref(Ws),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),t.topPositions&&t.topPositions.length?(o.openBlock(),o.createElementBlock("div",JT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.topPositions,a=>(o.openBlock(),o.createElementBlock("div",QT,[o.createElementVNode("div",eD,[tD,o.createElementVNode("div",nD,o.toDisplayString(o.unref(g6)(a.pair)),1)]),o.createElementVNode("div",rD,[o.createElementVNode("div",sD,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(a.pnl,{isFixed:!0,isPlus:!0},{repeat:5}))),1),o.createElementVNode("div",{class:o.normalizeClass(["top-positions-widget__return__roi",a.roi<0?"-negative":"-positive"])},[o.createVNode(o.unref(Le),{icon:"bxs_up-arrow"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(a.roi,{isPercentage:!0,isFixed:!0},{repeat:2}))),1)],2)])]))),256))])):(o.openBlock(),o.createBlock(o.unref(gu),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"}))]))}},[["__scopeId","data-v-d9b5a9e6"]]),i1=t=>(o.pushScopeId("data-v-139cca32"),t=t(),o.popScopeId(),t),oD={class:"trade-widget"},aD={class:"trade-widget__content"},lD={class:"trade-widget__top"},cD={class:"trade-widget__title-wrapper"},dD=i1(()=>o.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),uD={class:"trade-widget__info"},hD={class:"trade-widget__total-wrapper"},fD=i1(()=>o.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),mD={class:"trade-widget__total-wrapper__total"},pD={class:"trade-widget__total-wrapper__value"},gD={class:"trade-widget__points"},_D={class:"trade-widget__point"},yD={class:"trade-widget__point__title"},wD=i1(()=>o.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),bD=Oe({__name:"TradePerformanceWidget",props:{totalTrades:Number,tradePoints:Array,isMask:{type:Boolean,default:!1}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",oD,[o.createElementVNode("div",aD,[o.createElementVNode("div",lD,[o.createElementVNode("div",cD,[dD,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("It displays the number of profitable and unprofitable positions. This widget is very useful for understanding your trading opportunities. ")]),_:1})]),o.createVNode(o.unref(Ws),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",uD,[o.createElementVNode("div",hD,[fD,o.createElementVNode("div",mD,[o.createElementVNode("div",pD,o.toDisplayString(o.unref(Me)(t.isMask,t.totalTrades,{repeat:5})),1)])]),o.createElementVNode("div",gD,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.tradePoints,a=>(o.openBlock(),o.createElementBlock("div",_D,[o.createElementVNode("div",yD,o.toDisplayString(a.title),1),wD,o.createElementVNode("div",{class:o.normalizeClass(["trade-widget__point__value",a.class?a.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,a.value,{repeat:5})),3)]))),256))])])])]))}},[["__scopeId","data-v-139cca32"]]),o1=t=>(o.pushScopeId("data-v-ac0909db"),t=t(),o.popScopeId(),t),kD={class:"winrate-widget"},CD={class:"winrate-widget__winrate"},xD={class:"winrate-widget__title-wrapper"},MD=o1(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Daily Winrate",-1)),SD={class:"winrate-widget__chart"},vD={class:"winrate-widget__data"},TD={class:"winrate-widget__data_value"},DD=o1(()=>o.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),OD={class:"winrate-widget__average-rr"},ED={class:"winrate-widget__title-wrapper"},$D=o1(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),PD=Oe({__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}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",kD,[o.createElementVNode("div",CD,[o.createElementVNode("div",xD,[MD,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays the percentage of your successful positions. ")]),_:1})]),o.createElementVNode("div",SD,[o.renderSlot(e.$slots,"roundSlider",{},void 0,!0),o.createElementVNode("div",vD,[o.createElementVNode("div",TD,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Et)(t.winrate,2)))+"%",1),DD])])]),o.createElementVNode("div",OD,[o.createElementVNode("div",ED,[$D,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Risk Reward, defines the ratio of potential profit to loss you can get. ")]),_:1})]),o.createVNode(o.unref(P2),{avg:t.averageRR,min:t.minRR,max:t.maxRR,isMask:t.isMask},null,8,["avg","min","max","isMask"])])]))}},[["__scopeId","data-v-ac0909db"]]),LD=t=>(o.pushScopeId("data-v-e6d713b2"),t=t(),o.popScopeId(),t),VD={class:"average-rr-line-container"},ND={class:"average-rr-line"},BD={key:0,class:"average-rr-line__progress"},AD=[LD(()=>o.createElementVNode("div",{class:"average-rr-line__dot"},null,-1))],FD={class:"coefficients"},RD={class:"coefficients__value -min"},ID={class:"coefficients__value -avg"},HD={class:"coefficients__value -max"},P2=Oe({__name:"AverageRRLine",props:{min:{type:Number,default:0},avg:{type:Number,default:0},max:{type:Number,default:0},isMask:{type:Boolean,default:!1}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",VD,[o.createElementVNode("div",ND,[t.avg&&t.max?(o.openBlock(),o.createElementBlock("div",BD,AD)):o.createCommentVNode("",!0)]),o.createElementVNode("div",FD,[o.createElementVNode("div",RD,o.toDisplayString(o.unref(Me)(t.isMask,t.min,{repeat:3})),1),o.createElementVNode("div",ID,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Et)(t.avg))),1),o.createElementVNode("div",HD,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Et)(t.max),{repeat:3})),1)])]))}},[["__scopeId","data-v-e6d713b2"]]);function L2(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Zo(t){return typeof t=="function"?t():o.unref(t)}const V2=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const zD=Object.prototype.toString,YD=t=>zD.call(t)==="[object Object]",Uo=()=>{},a1=WD();function WD(){var t,e;return V2&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}const N2={mounted:"mounted",updated:"updated",unmounted:"unmounted"};function jD(...t){if(t.length!==1)return o.toRef(...t);const e=t[0];return typeof e=="function"?o.readonly(o.customRef(()=>({get:e,set:Uo}))):o.ref(e)}function qo(t){var e;const n=Zo(t);return(e=n==null?void 0:n.$el)!=null?e:n}const B2=V2?window:void 0;function Nl(...t){let e,n,r,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,s]=t,e=B2):[e,n,r,s]=t,!e)return Uo;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],a=()=>{i.forEach(u=>u()),i.length=0},l=(u,h,f,m)=>(u.addEventListener(h,f,m),()=>u.removeEventListener(h,f,m)),c=o.watch(()=>[qo(e),Zo(s)],([u,h])=>{if(a(),!u)return;const f=YD(h)?{...h}:h;i.push(...n.flatMap(m=>r.map(g=>l(u,m,g,f))))},{immediate:!0,flush:"post"}),d=()=>{c(),a()};return L2(d),d}let A2=!1;function F2(t,e,n={}){const{window:r=B2,ignore:s=[],capture:i=!0,detectIframe:a=!1}=n;if(!r)return Uo;a1&&!A2&&(A2=!0,Array.from(r.document.body.children).forEach(f=>f.addEventListener("click",Uo)),r.document.documentElement.addEventListener("click",Uo));let l=!0;const c=f=>s.some(m=>{if(typeof m=="string")return Array.from(r.document.querySelectorAll(m)).some(g=>g===f.target||f.composedPath().includes(g));{const g=qo(m);return g&&(f.target===g||f.composedPath().includes(g))}}),u=[Nl(r,"click",f=>{const m=qo(t);if(!(!m||m===f.target||f.composedPath().includes(m))){if(f.detail===0&&(l=!c(f)),!l){l=!0;return}e(f)}},{passive:!0,capture:i}),Nl(r,"pointerdown",f=>{const m=qo(t);l=!c(f)&&!!(m&&!f.composedPath().includes(m))},{passive:!0}),a&&Nl(r,"blur",f=>{setTimeout(()=>{var m;const g=qo(t);((m=r.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!(g!=null&&g.contains(r.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>u.forEach(f=>f())}const R2={[N2.mounted](t,e){const n=!e.modifiers.bubble;if(typeof e.value=="function")t.__onClickOutside_stop=F2(t,e.value,{capture:n});else{const[r,s]=e.value;t.__onClickOutside_stop=F2(t,r,Object.assign({capture:n},s))}},[N2.unmounted](t){t.__onClickOutside_stop()}};function l1(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function I2(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:I2(n)}}function ZD(t){const e=t||window.event,n=e.target;return I2(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Bl=new WeakMap;function UD(t,e=!1){const n=o.ref(e);let r=null;o.watch(jD(t),a=>{const l=l1(Zo(a));if(l){const c=l;Bl.get(c)||Bl.set(c,c.style.overflow),n.value&&(c.style.overflow="hidden")}},{immediate:!0});const s=()=>{const a=l1(Zo(t));!a||n.value||(a1&&(r=Nl(a,"touchmove",l=>{ZD(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},i=()=>{var a;const l=l1(Zo(t));!l||!n.value||(a1&&(r==null||r()),l.style.overflow=(a=Bl.get(l))!=null?a:"",Bl.delete(l),n.value=!1)};return L2(i),o.computed({get(){return n.value},set(a){a?s():i()}})}function qD(){let t=!1;const e=o.ref(!1);return(n,r)=>{if(e.value=r.value,t)return;t=!0;const s=UD(n,r.value);o.watch(e,i=>s.value=i)}}qD();//! moment.js
41
+ <span> | ${uh(M[0])}, ${p6(M[0])}</span></div>`;g.firstChild;)g.firstChild.remove();g.appendChild(S)}const{offsetLeft:p,offsetTop:_,clientWidth:y}=f.canvas;let C=p+m.caretX;const k=_+m.caretY,v=g.clientWidth;C+v>y&&(C-=v),g.style.opacity="1",g.style.left=C+"px",g.style.top=k+"px"}},d=h=>{const{chart:f}=h,m=l("chart-line",f),g=f.chartArea;f.canvas.addEventListener("mousemove",function(p){const _=f.canvas.getBoundingClientRect(),y=p.clientX-_.left,C=p.clientY-_.top;y>=g.left&&y<=g.right&&C>=g.top&&C<=g.bottom?(m.style.left=y+"px",m.style.top=g.top+"px",m.style.height=g.bottom-g.top+"px",m.style.display="flex"):m.style.display="none"}),f.canvas.addEventListener("mouseout",function(){m.style.display="none"})},u=o.computed(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},scales:{x:{ticks:{display:!r.isEmpty,callback:function(h){return uh(this.getLabelForValue(h)).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:"#EDEDED"}},y:{ticks:{display:!r.isEmpty,callback:function(h){return e.ticksCallback(h)},color:"#8E8E93",font:{size:14,weight:400,family:"'SF Pro Display', sans-serif"},padding:15},grid:{color:"#EDEDED",drawTicks:!1},border:{display:!1,dash:[4,4],dashOffset:1}}},plugins:{tooltip:{enabled:!1,position:"nearest",external:c},legend:!1},elements:{line:{backgroundColor:h=>a(h),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:d}));return o.watch(()=>e.isMask,()=>{n.value+=1},{immediate:!0}),(h,f)=>(o.openBlock(),o.createElementBlock("div",wv,[(o.openBlock(),o.createBlock(o.unref(O2),{key:n.value,data:i.value,options:u.value},null,8,["data","options"]))]))}},n1={__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){zo.register(Tl,Ol,Yo,wr,o2);const e=t,n=a=>{const l=new Set,c=[],d=a.map(h=>(l.add(h.date),h.balance));return c.push({data:d}),{labels:Array.from(l),datasets:c}},r=o.computed(()=>n(e.data)),s=a=>{const c=a.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return c.addColorStop(0,e.gradient.startColor),c.addColorStop(1,e.gradient.endColor),c},i=o.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:a=>s(a),tension:.3,borderWidth:4,borderColor:e.borderColor,fill:"start",spanGaps:!0},point:{pointStyle:!1}}});return(a,l)=>(o.openBlock(),o.createBlock(o.unref(O2),{data:r.value,options:i.value},null,8,["data","options"]))}},bv=t=>(o.pushScopeId("data-v-96946db8"),t=t(),o.popScopeId(),t),kv={class:"account-balance-widget"},Cv={class:"account-balance-widget__top"},xv={class:"account-balance-widget__title-wrapper"},Mv=bv(()=>o.createElementVNode("div",{class:"account-balance-widget__title"},"Account Balance",-1)),Sv=Oe({__name:"AccountBalanceWidget",props:{balanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1}},setup(t){const e=o.ref("week");o.computed({get(r){console.log(r,"value");const s=r*Mc();return s>=1e3||s<=-1e3?Me(n.isMask,Et(s/1e3,2)+"k",{repeat:3}):Et(s,2)},set(){}});const n=t;return(r,s)=>(o.openBlock(),o.createElementBlock("div",kv,[o.createElementVNode("div",Cv,[o.createElementVNode("div",xv,[Mv,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("This graphic widget displays changes to your deposit over a specific time period. ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ws),{key:0,modelValue:e.value,"onUpdate:modelValue":s[0]||(s[0]=i=>e.value=i),onOnChange:s[1]||(s[1]=i=>r.$emit("onChange",e.value))},null,8,["modelValue"]))]),o.createVNode(o.unref(t1),{data:t.balanceChartData,"data-type":"balanceChartData","ticks-callback":r.ticksCallback,isMask:t.isMask},null,8,["data","ticks-callback","isMask"])]))}},[["__scopeId","data-v-96946db8"]]),E2=t=>(o.pushScopeId("data-v-313ab42e"),t=t(),o.popScopeId(),t),vv={class:"balance-widget"},Tv={class:"balance-part"},Dv={class:"balance-part__top"},Ov={class:"balance-part__title-wrapper"},Ev=E2(()=>o.createElementVNode("div",{class:"balance-part__title"},"Balance",-1)),$v={class:"balance-part__content"},Pv={class:"balance-part__content__wrapper"},Lv={class:"balance-part__content__count"},Vv={class:"balance-part__content__bitcoin"},Nv={key:0,class:"devider"},Bv={key:1,class:"personal-target-part"},Av={class:"personal-target-part__top"},Fv={class:"personal-target-part__title-wrapper"},Rv=E2(()=>o.createElementVNode("div",{class:"personal-target-part__title"},"Personal target",-1)),Iv={class:"personal-target-part__content"},Hv={class:"personal-target-part__content__current"},zv={class:"personal-target-part__content__from"},Yv=Oe({__name:"BalanceWidget",props:{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}},emits:["switchModal","switchVisibility"],setup(t,{emit:e}){const n=e,r=()=>{n("switchVisibility")};return(s,i)=>(o.openBlock(),o.createElementBlock("div",vv,[o.createElementVNode("div",Tv,[o.createElementVNode("div",Dv,[o.createElementVNode("div",Ov,[Ev,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays the balance of your deposit in USD and BTC equivalent, additionally showing the growth/fall of your balance.")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"balance-part__visibility-switcher",onClick:r},[o.withDirectives(o.createVNode(o.unref(Le),{icon:"eye"},null,512),[[o.vShow,t.isHidden]]),o.withDirectives(o.createVNode(o.unref(Le),{icon:"eye-slash"},null,512),[[o.vShow,!t.isHidden]])]))]),o.createElementVNode("div",$v,[o.createElementVNode("div",Pv,[o.createElementVNode("div",Lv,o.toDisplayString(o.unref(Me)(t.isMaskBalance,o.unref(Ke)(t.USDT),{prefix:"$"})),1),t.delta?(o.openBlock(),o.createBlock(o.unref(sc),{key:0,"is-hidden":t.isMaskBalance,percentage:"",delta:t.delta},null,8,["is-hidden","delta"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Vv,"= "+o.toDisplayString(o.unref(Me)(t.isMaskBalance,t.BTC))+" BTC",1)]),t.isShare?(o.openBlock(),o.createBlock(o.unref(n1),{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","gradient"])):(o.openBlock(),o.createBlock(o.unref(n1),{key:1,class:"balance-part__chart",data:t.balanceChartData},null,8,["data"]))]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Nv)),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Bv,[o.createElementVNode("div",Av,[o.createElementVNode("div",Fv,[Rv,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.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})]),o.createElementVNode("div",{class:"balance-part__modal-switcher",onClick:i[0]||(i[0]=a=>n("switchModal"))},[o.createVNode(o.unref(Le),{icon:"settings"})])]),o.createElementVNode("div",Iv,[o.createElementVNode("div",Hv,o.toDisplayString(o.unref(Me)(t.isMaskPersonalTarget,o.unref(Ke)(t.currentProfit,{isPercentage:t.isPercentage,isFixed:!0}),{prefix:"$",repeat:5})),1),o.createElementVNode("div",zv,"/ "+o.toDisplayString(o.unref(Me)(t.isMaskPersonalTarget,o.unref(Ke)(t.profit,{isPercentage:t.isPercentage,isFixed:!0}))),1)]),o.createVNode(o.unref(R3),{"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"])]))]))}},[["__scopeId","data-v-313ab42e"]]),Vl=t=>(o.pushScopeId("data-v-105f730b"),t=t(),o.popScopeId(),t),Wv={class:"calendar-widget"},jv={class:"calendar-widget__calendar"},Zv={class:"calendar-widget__top"},Uv={class:"calendar-widget__title-wrapper"},qv=Vl(()=>o.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),Gv={class:"stat-calendar"},Kv={class:"stat-calendar__week-days"},Xv={key:0,class:"stat-calendar__row-wrapper"},Jv={class:"stat-calendar__row"},Qv=["onClick"],eT=Vl(()=>o.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),tT={key:0,class:"calendar-widget__day"},nT={class:"calendar-widget__day__title"},rT={class:"calendar-widget__day__content"},sT={class:"calendar-widget__point"},iT={class:"calendar-widget__point__title"},oT=Vl(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),aT={class:"calendar-widget__day__trades"},lT={class:"calendar-widget__point"},cT={class:"calendar-widget__point__title"},dT=Vl(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),uT=Oe({__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,currentDate:Date,isCurrentDate:Function,isCurrentDay:Function,isMask:{type:Boolean,default:!1}},emits:["setNewDate","chooseMonth"],setup(t,{emit:e}){const n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=o.ref(null),s=o.ref(null),i=e,a=t,l=u=>{r.value=u.year,s.value=u.month,i("chooseMonth",u)};o.nextTick(()=>{const u=new Date;r.value=u.getFullYear(),s.value=u.getMonth()});const c=o.computed(()=>[{title:"Total trades",value:a.dailyStatData&&a.dailyStatData.trades_total_count||0},{title:"Winrate",value:Ke(a.dailyStatData&&a.dailyStatData.win_rate||0,{isPercentage:!0,isFixed:!0}),class:a.dailyStatData&&a.dailyStatData.win_rate>=50?"-win":"-loss"},{title:"Return",value:Ke(a.dailyStatData&&a.dailyStatData.return_total||0),class:a.dailyStatData&&a.dailyStatData.return_total>=0?"-win":"-loss"},{title:"Return on winners",value:Ke(a.dailyStatData&&a.dailyStatData.return_win||0)},{title:"Return on losers",value:Ke(a.dailyStatData&&a.dailyStatData.return_lose||0)},{title:"Commission",value:Ke(a.dailyStatData&&a.dailyStatData.commission||0)}]),d=o.computed(()=>[{title:"Win trades",value:a.dailyStatData&&a.dailyStatData.trades_win_count||0,isPositive:!0},{title:"Loss trades",value:-(a.dailyStatData&&a.dailyStatData.trades_lose_count)||0,isNegative:!1}]);return(u,h)=>{var f,m;return o.openBlock(),o.createElementBlock("div",Wv,[o.createElementVNode("div",jv,[o.createElementVNode("div",Zv,[o.createElementVNode("div",Uv,[qv,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.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?(o.openBlock(),o.createBlock(o.unref(F3),{key:0,"current-date":t.currentDate,onOnChange:l,year:r.value,"onUpdate:year":h[0]||(h[0]=g=>r.value=g),month:s.value,"onUpdate:month":h[1]||(h[1]=g=>s.value=g)},null,8,["current-date","year","month"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Gv,[o.createElementVNode("div",Kv,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(n,(g,p)=>o.createElementVNode("div",{class:o.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(p)}])},o.toDisplayString(g),3)),64))]),t.rows?(o.openBlock(),o.createElementBlock("div",Xv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rows,g=>(o.openBlock(),o.createElementBlock("div",Jv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g,p=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["stat-calendar__day",{"-empty":!p.date,"-current":t.isCurrentDate(p.date),"-positive":p.win,"-negative":p.win===!1}]),onClick:_=>i("setNewDate",p.date)},o.toDisplayString(p.date?p.date:""),11,Qv))),256))]))),256))])):o.createCommentVNode("",!0)])]),eT,t.dailyStatData&&!t.dailyStatData.isNull?(o.openBlock(),o.createElementBlock("div",tT,[o.createElementVNode("div",nT,o.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),o.createElementVNode("div",rT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,g=>(o.openBlock(),o.createElementBlock("div",sT,[o.createElementVNode("div",iT,o.toDisplayString(g.title),1),oT,o.createElementVNode("div",{class:o.normalizeClass(["calendar-widget__point__value",g.class?g.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,g.value,{repeat:5})),3)]))),256)),o.createVNode(o.unref(xm),{isHidden:t.isMask,long:(f=t.dailyStatData)==null?void 0:f.long_count,short:(m=t.dailyStatData)==null?void 0:m.short_count},null,8,["isHidden","long","short"]),o.createElementVNode("div",aT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,g=>(o.openBlock(),o.createElementBlock("div",lT,[o.createElementVNode("div",cT,o.toDisplayString(g.title),1),dT,o.createVNode(o.unref(sc),{isHidden:t.isMask,"is-positive":g.isPositive,"is-negative":g.isNegative,delta:g.value},null,8,["isHidden","is-positive","is-negative","delta"])]))),256))])])])):(o.openBlock(),o.createBlock(o.unref(gu),{key:1,class:"-empty"}))])}}},[["__scopeId","data-v-105f730b"]]),r1=t=>(o.pushScopeId("data-v-4ce47bda"),t=t(),o.popScopeId(),t),hT={class:"commission-widget"},fT={class:"commission-widget__content"},mT={class:"commission-widget__top"},pT={class:"commission-widget__title-wrapper"},gT=r1(()=>o.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),_T={class:"commission-widget__info"},yT={class:"commission-widget__total-wrapper"},wT=r1(()=>o.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),bT={class:"commission-widget__total-wrapper__total"},kT={class:"commission-widget__total-wrapper__value"},CT={class:"commission-widget__points"},xT={class:"commission-widget__point"},MT={class:"commission-widget__point__title"},ST=r1(()=>o.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),vT=Oe({__name:"CommissionsFeesWidget",props:{commission:Number,commissionData:Object,isMask:{type:Boolean,default:!1}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e,s=t,i=o.computed(()=>s.commissionData&&s.commissionData.commission||0),a=o.computed(()=>s.commissionData&&s.commissionData.pnl||0),l=o.computed(()=>[{title:"AVG fees per trade",value:`${Ke(s.commissionData&&s.commissionData.fees_per_trade||0)}`},{title:"PNL / Commission",value:a.value&&i.value?`${Ke(a.value)}/${Ke(i.value)}`:`${Ke(0)}`},{title:"AVG fees per day",value:`${Ke(s.commissionData&&s.commissionData.fees_per_day||0)}`},{title:"Funding",value:`${Ke(s.commissionData&&s.commissionData.funding||0)}`}]);return(c,d)=>(o.openBlock(),o.createElementBlock("div",hT,[o.createElementVNode("div",fT,[o.createElementVNode("div",mT,[o.createElementVNode("div",pT,[gT,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("This widget helps traders finally understand how much money they spent on commissions and funding. ")]),_:1})]),o.createVNode(o.unref(Ws),{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=u=>n.value=u),onOnChange:d[1]||(d[1]=u=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",_T,[o.createElementVNode("div",yT,[wT,o.createElementVNode("div",bT,[o.createElementVNode("div",kT,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(i.value),{repeat:5})),1)])]),o.createElementVNode("div",CT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,(u,h)=>(o.openBlock(),o.createElementBlock("div",xT,[o.createElementVNode("div",MT,o.toDisplayString(u.title),1),ST,o.createElementVNode("div",{class:o.normalizeClass(["commission-widget__point__value",u.class?u.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,u.value,{repeat:5})),3)]))),256))])])])]))}},[["__scopeId","data-v-4ce47bda"]]),TT=t=>(o.pushScopeId("data-v-7187c939"),t=t(),o.popScopeId(),t),DT={class:"performance-widget"},OT={class:"performance-widget__top"},ET={class:"performance-widget__title-wrapper"},$T=TT(()=>o.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),PT=Oe({__name:"PerformanceWidget",props:{performanceChartData:{type:Array,default:[]},isShare:{type:Boolean,default:!1},isMask:{type:Boolean,default:!1}},setup(t){const e=o.ref("week"),n=t,r=s=>Me(n.isMask,Et(s,2)+"%",{repeat:3});return(s,i)=>(o.openBlock(),o.createElementBlock("div",DT,[o.createElementVNode("div",OT,[o.createElementVNode("div",ET,[$T,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("The linear graphics widget displays the profit as a percentage of the deposit. ")]),_:1})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ws),{key:0,modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=a=>e.value=a),onOnChange:i[1]||(i[1]=a=>s.$emit("onChange",e.value))},null,8,["modelValue"]))]),o.createVNode(o.unref(t1),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":r,isMask:t.isMask},null,8,["data","isMask"])]))}},[["__scopeId","data-v-7187c939"]]),s1=t=>(o.pushScopeId("data-v-20b275a1"),t=t(),o.popScopeId(),t),LT={class:"return-widget"},VT={class:"return-widget__content"},NT={class:"return-widget__top"},BT={class:"return-widget__title-wrapper"},AT=s1(()=>o.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),FT={class:"return-widget__info"},RT={class:"return-widget__total-wrapper"},IT=s1(()=>o.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),HT={class:"return-widget__total-wrapper__total"},zT={class:"return-widget__points"},YT={class:"return-widget__point"},WT={class:"return-widget__point__title"},jT=s1(()=>o.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),ZT=["innerHTML"],UT=Oe({__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}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e,s=t,i=o.computed(()=>[{title:"Average return per trade",value:s.totalReturn,options:{isPlus:!0,isFixed:!0},class:s.totalReturn===0?"":s.totalReturn>0?"-win":"-loss"},{title:"Daily return",value:s.daily,options:{isPlus:!0,isFixed:!0},class:s.daily===0?"":s.daily>0?"-win":"-loss"},{title:"Return on winners",value:s.win,class:"-win"},{title:"Return on losers",value:s.lose,class:"-loss"}]),a=o.computed(()=>s.returnPeriod>0),l=o.computed(()=>s.returnPeriod<0),c=o.computed(()=>s.profitFactor>1?"-positive":"-negative"),d=o.computed(()=>s.profitFactor>0?`Your profit factor is ${Me(s.isMask,Et(s.profitFactor),{repeat:5})}. <br /> You earn ${Me(s.isMask,Ke(s.profitFactor),{repeat:5,prefix:"$"})} on every ${Me(s.isMask,"$1",{repeat:5,prefix:"$"})} loss.`:`Your profit factor is ${Me(s.isMask,Et(s.profitFactor),{repeat:5})}. <br/> You loss ${Me(s.isMask,Ke(Math.abs(s.profitFactor)),{repeat:5,prefix:"$"})} on every ${Me(s.isMask,"$1",{repeat:5,prefix:"$"})} earn. `);return(u,h)=>(o.openBlock(),o.createElementBlock("div",LT,[o.createElementVNode("div",VT,[o.createElementVNode("div",NT,[o.createElementVNode("div",BT,[AT,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.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})]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(Ws),{key:0,modelValue:n.value,"onUpdate:modelValue":h[0]||(h[0]=f=>n.value=f),onOnChange:h[1]||(h[1]=f=>r("onChange",n.value))},null,8,["modelValue"]))]),o.createElementVNode("div",FT,[o.createElementVNode("div",RT,[IT,o.createElementVNode("div",HT,[o.createElementVNode("div",{class:o.normalizeClass(["return-widget__total-wrapper__value",{"-positive":a.value,"-negative":l.value}])},o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(t.returnPeriod,{isPlus:!0,isFixed:!0}),{repeat:5})),3),s.changeRate?(o.openBlock(),o.createBlock(o.unref(sc),{key:0,percentage:"",isHidden:t.isMask,delta:s.changeRate},null,8,["isHidden","delta"])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",zT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,f=>(o.openBlock(),o.createElementBlock("div",YT,[o.createElementVNode("div",WT,o.toDisplayString(f.title),1),jT,o.createElementVNode("div",{class:o.normalizeClass(["return-widget__point__value",f.class?f.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(f.value,f.options),{repeat:5,prefix:"$"})),3)]))),256))])])]),t.profitFactor?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["return-widget__profit",c.value])},[o.createVNode(o.unref(Le),{icon:"tip",class:"return-widget__profit__icon"}),o.createElementVNode("div",{class:"return-widget__profit__text",innerHTML:d.value},null,8,ZT)],2)):o.createCommentVNode("",!0)]))}},[["__scopeId","data-v-20b275a1"]]),$2=t=>(o.pushScopeId("data-v-d9b5a9e6"),t=t(),o.popScopeId(),t),qT={class:"top-positions-widget"},GT={class:"top-positions-widget__top"},KT={class:"top-positions-widget__title-wrapper"},XT=$2(()=>o.createElementVNode("div",{class:"top-positions-widget__title"},"Top Positions",-1)),JT={key:0,class:"top-positions-widget__returns"},QT={class:"top-positions-widget__return"},eD={class:"top-positions-widget__return__left"},tD=$2(()=>o.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),nD={class:"top-positions-widget__return__pair"},rD={class:"top-positions-widget__return__right"},sD={class:"top-positions-widget__return__pnl"},iD=Oe({__name:"TopPositionsWidget",props:{topPositions:{type:Array,default:[]},isMask:{type:Boolean,default:!1}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",qT,[o.createElementVNode("div",GT,[o.createElementVNode("div",KT,[XT,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Helps you find the top profitable positions. We calculate only net PNL, taking into account commission and funding. ")]),_:1})]),o.createVNode(o.unref(Ws),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),t.topPositions&&t.topPositions.length?(o.openBlock(),o.createElementBlock("div",JT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.topPositions,a=>(o.openBlock(),o.createElementBlock("div",QT,[o.createElementVNode("div",eD,[tD,o.createElementVNode("div",nD,o.toDisplayString(o.unref(g6)(a.pair)),1)]),o.createElementVNode("div",rD,[o.createElementVNode("div",sD,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(a.pnl,{isFixed:!0,isPlus:!0},{repeat:5}))),1),o.createElementVNode("div",{class:o.normalizeClass(["top-positions-widget__return__roi",a.roi<0?"-negative":"-positive"])},[o.createVNode(o.unref(Le),{icon:"bxs_up-arrow"}),o.createElementVNode("span",null,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ke)(a.roi,{isPercentage:!0,isFixed:!0},{repeat:2}))),1)],2)])]))),256))])):(o.openBlock(),o.createBlock(o.unref(gu),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"}))]))}},[["__scopeId","data-v-d9b5a9e6"]]),i1=t=>(o.pushScopeId("data-v-139cca32"),t=t(),o.popScopeId(),t),oD={class:"trade-widget"},aD={class:"trade-widget__content"},lD={class:"trade-widget__top"},cD={class:"trade-widget__title-wrapper"},dD=i1(()=>o.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),uD={class:"trade-widget__info"},hD={class:"trade-widget__total-wrapper"},fD=i1(()=>o.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),mD={class:"trade-widget__total-wrapper__total"},pD={class:"trade-widget__total-wrapper__value"},gD={class:"trade-widget__points"},_D={class:"trade-widget__point"},yD={class:"trade-widget__point__title"},wD=i1(()=>o.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),bD=Oe({__name:"TradePerformanceWidget",props:{totalTrades:Number,tradePoints:Array,isMask:{type:Boolean,default:!1}},emits:["onChange"],setup(t,{emit:e}){const n=o.ref("week"),r=e;return(s,i)=>(o.openBlock(),o.createElementBlock("div",oD,[o.createElementVNode("div",aD,[o.createElementVNode("div",lD,[o.createElementVNode("div",cD,[dD,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("It displays the number of profitable and unprofitable positions. This widget is very useful for understanding your trading opportunities. ")]),_:1})]),o.createVNode(o.unref(Ws),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",uD,[o.createElementVNode("div",hD,[fD,o.createElementVNode("div",mD,[o.createElementVNode("div",pD,o.toDisplayString(o.unref(Me)(t.isMask,t.totalTrades,{repeat:5})),1)])]),o.createElementVNode("div",gD,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.tradePoints,a=>(o.openBlock(),o.createElementBlock("div",_D,[o.createElementVNode("div",yD,o.toDisplayString(a.title),1),wD,o.createElementVNode("div",{class:o.normalizeClass(["trade-widget__point__value",a.class?a.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,a.value,{repeat:5})),3)]))),256))])])])]))}},[["__scopeId","data-v-139cca32"]]),o1=t=>(o.pushScopeId("data-v-ac0909db"),t=t(),o.popScopeId(),t),kD={class:"winrate-widget"},CD={class:"winrate-widget__winrate"},xD={class:"winrate-widget__title-wrapper"},MD=o1(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Daily Winrate",-1)),SD={class:"winrate-widget__chart"},vD={class:"winrate-widget__data"},TD={class:"winrate-widget__data_value"},DD=o1(()=>o.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),OD={class:"winrate-widget__average-rr"},ED={class:"winrate-widget__title-wrapper"},$D=o1(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),PD=Oe({__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}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",kD,[o.createElementVNode("div",CD,[o.createElementVNode("div",xD,[MD,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays the percentage of your successful positions. ")]),_:1})]),o.createElementVNode("div",SD,[o.renderSlot(e.$slots,"roundSlider",{},void 0,!0),o.createElementVNode("div",vD,[o.createElementVNode("div",TD,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Et)(t.winrate,2)))+"%",1),DD])])]),o.createElementVNode("div",OD,[o.createElementVNode("div",ED,[$D,o.createVNode(o.unref(pn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Risk Reward, defines the ratio of potential profit to loss you can get. ")]),_:1})]),o.createVNode(o.unref(P2),{avg:t.averageRR,min:t.minRR,max:t.maxRR,isMask:t.isMask},null,8,["avg","min","max","isMask"])])]))}},[["__scopeId","data-v-ac0909db"]]),LD=t=>(o.pushScopeId("data-v-e6d713b2"),t=t(),o.popScopeId(),t),VD={class:"average-rr-line-container"},ND={class:"average-rr-line"},BD={key:0,class:"average-rr-line__progress"},AD=[LD(()=>o.createElementVNode("div",{class:"average-rr-line__dot"},null,-1))],FD={class:"coefficients"},RD={class:"coefficients__value -min"},ID={class:"coefficients__value -avg"},HD={class:"coefficients__value -max"},P2=Oe({__name:"AverageRRLine",props:{min:{type:Number,default:0},avg:{type:Number,default:0},max:{type:Number,default:0},isMask:{type:Boolean,default:!1}},setup(t){return(e,n)=>(o.openBlock(),o.createElementBlock("div",VD,[o.createElementVNode("div",ND,[t.avg&&t.max?(o.openBlock(),o.createElementBlock("div",BD,AD)):o.createCommentVNode("",!0)]),o.createElementVNode("div",FD,[o.createElementVNode("div",RD,o.toDisplayString(o.unref(Me)(t.isMask,t.min,{repeat:3})),1),o.createElementVNode("div",ID,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Et)(t.avg))),1),o.createElementVNode("div",HD,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Et)(t.max),{repeat:3})),1)])]))}},[["__scopeId","data-v-e6d713b2"]]);function L2(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Zo(t){return typeof t=="function"?t():o.unref(t)}const V2=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const zD=Object.prototype.toString,YD=t=>zD.call(t)==="[object Object]",Uo=()=>{},a1=WD();function WD(){var t,e;return V2&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}const N2={mounted:"mounted",updated:"updated",unmounted:"unmounted"};function jD(...t){if(t.length!==1)return o.toRef(...t);const e=t[0];return typeof e=="function"?o.readonly(o.customRef(()=>({get:e,set:Uo}))):o.ref(e)}function qo(t){var e;const n=Zo(t);return(e=n==null?void 0:n.$el)!=null?e:n}const B2=V2?window:void 0;function Nl(...t){let e,n,r,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,s]=t,e=B2):[e,n,r,s]=t,!e)return Uo;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const i=[],a=()=>{i.forEach(u=>u()),i.length=0},l=(u,h,f,m)=>(u.addEventListener(h,f,m),()=>u.removeEventListener(h,f,m)),c=o.watch(()=>[qo(e),Zo(s)],([u,h])=>{if(a(),!u)return;const f=YD(h)?{...h}:h;i.push(...n.flatMap(m=>r.map(g=>l(u,m,g,f))))},{immediate:!0,flush:"post"}),d=()=>{c(),a()};return L2(d),d}let A2=!1;function F2(t,e,n={}){const{window:r=B2,ignore:s=[],capture:i=!0,detectIframe:a=!1}=n;if(!r)return Uo;a1&&!A2&&(A2=!0,Array.from(r.document.body.children).forEach(f=>f.addEventListener("click",Uo)),r.document.documentElement.addEventListener("click",Uo));let l=!0;const c=f=>s.some(m=>{if(typeof m=="string")return Array.from(r.document.querySelectorAll(m)).some(g=>g===f.target||f.composedPath().includes(g));{const g=qo(m);return g&&(f.target===g||f.composedPath().includes(g))}}),u=[Nl(r,"click",f=>{const m=qo(t);if(!(!m||m===f.target||f.composedPath().includes(m))){if(f.detail===0&&(l=!c(f)),!l){l=!0;return}e(f)}},{passive:!0,capture:i}),Nl(r,"pointerdown",f=>{const m=qo(t);l=!c(f)&&!!(m&&!f.composedPath().includes(m))},{passive:!0}),a&&Nl(r,"blur",f=>{setTimeout(()=>{var m;const g=qo(t);((m=r.document.activeElement)==null?void 0:m.tagName)==="IFRAME"&&!(g!=null&&g.contains(r.document.activeElement))&&e(f)},0)})].filter(Boolean);return()=>u.forEach(f=>f())}const R2={[N2.mounted](t,e){const n=!e.modifiers.bubble;if(typeof e.value=="function")t.__onClickOutside_stop=F2(t,e.value,{capture:n});else{const[r,s]=e.value;t.__onClickOutside_stop=F2(t,r,Object.assign({capture:n},s))}},[N2.unmounted](t){t.__onClickOutside_stop()}};function l1(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function I2(t){const e=window.getComputedStyle(t);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&t.clientWidth<t.scrollWidth||e.overflowY==="auto"&&t.clientHeight<t.scrollHeight)return!0;{const n=t.parentNode;return!n||n.tagName==="BODY"?!1:I2(n)}}function ZD(t){const e=t||window.event,n=e.target;return I2(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Bl=new WeakMap;function UD(t,e=!1){const n=o.ref(e);let r=null;o.watch(jD(t),a=>{const l=l1(Zo(a));if(l){const c=l;Bl.get(c)||Bl.set(c,c.style.overflow),n.value&&(c.style.overflow="hidden")}},{immediate:!0});const s=()=>{const a=l1(Zo(t));!a||n.value||(a1&&(r=Nl(a,"touchmove",l=>{ZD(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},i=()=>{var a;const l=l1(Zo(t));!l||!n.value||(a1&&(r==null||r()),l.style.overflow=(a=Bl.get(l))!=null?a:"",Bl.delete(l),n.value=!1)};return L2(i),o.computed({get(){return n.value},set(a){a?s():i()}})}function qD(){let t=!1;const e=o.ref(!1);return(n,r)=>{if(e.value=r.value,t)return;t=!0;const s=UD(n,r.value);o.watch(e,i=>s.value=i)}}qD();//! moment.js
42
42
  //! version : 2.30.1
43
43
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
44
44
  //! license : MIT