scope360-core 0.0.192 → 0.0.193
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.
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
`)>-1?t.split(`
|
|
34
34
|
`):t}function MM(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 Op(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=_n(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,Fe(t.title,k),n.font=c.string,Fe(t.beforeBody.concat(t.afterBody),k),C=e.displayColors?a+2+e.boxPadding:0,Fe(r,v=>{Fe(v.before,k),Fe(v.lines,k),Fe(v.after,k)}),C=0,n.font=u.string,Fe(t.footer,k),n.restore(),_+=g.width,{width:_,height:p}}function SM(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function vM(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 TM(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"),vM(d,t,e,n)&&(d="center"),d}function Dp(t,e,n){const r=n.yAlign||e.yAlign||SM(t,n);return{xAlign:n.xAlign||e.xAlign||TM(t,e,n,r),yAlign:r}}function OM(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function DM(t,e,n){let{y:r,height:s}=t;return e==="top"?r+=n:e==="bottom"?r-=s+n:r-=s/2,r}function Ep(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}=To(a);let g=OM(e,l);const p=DM(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:gn(g,0,r.width-e.width),y:gn(p,0,r.height-e.height)}}function pl(t,e,n){const r=_n(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function $p(t){return Qn([],wr(t))}function EM(t,e,n){return es(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function Pp(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const Lp={beforeTitle:pr,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:pr,beforeBody:pr,beforeLabel:pr,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:pr,afterBody:pr,beforeFooter:pr,footer:pr,afterFooter:pr};function Wt(t,e,n,r){const s=t[e].call(n,r);return typeof s>"u"?Lp[e].call(n,r):s}class Bu 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 Nm(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=EM(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,s=Wt(r,"beforeTitle",this,e),i=Wt(r,"title",this,e),a=Wt(r,"afterTitle",this,e);let l=[];return l=Qn(l,wr(s)),l=Qn(l,wr(i)),l=Qn(l,wr(a)),l}getBeforeBody(e,n){return $p(Wt(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:r}=n,s=[];return Fe(e,i=>{const a={before:[],lines:[],after:[]},l=Pp(r,i);Qn(a.before,wr(Wt(l,"beforeLabel",this,i))),Qn(a.lines,Wt(l,"label",this,i)),Qn(a.after,wr(Wt(l,"afterLabel",this,i))),s.push(a)}),s}getAfterBody(e,n){return $p(Wt(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:r}=n,s=Wt(r,"beforeFooter",this,e),i=Wt(r,"footer",this,e),a=Wt(r,"afterFooter",this,e);let l=[];return l=Qn(l,wr(s)),l=Qn(l,wr(i)),l=Qn(l,wr(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(MM(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))),Fe(l,u=>{const h=Pp(e.callbacks,u);s.push(Wt(h,"labelColor",this,u)),i.push(Wt(h,"labelPointStyle",this,u)),a.push(Wt(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=Fo[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=Op(this,r),d=Object.assign({},l,c),u=Dp(this.chart,r,d),h=Ep(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}=To(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=xu(r.rtl,this.x,this.width);for(e.x=pl(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=pl(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,mu(e,p,_,y),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,mu(e,p,_,y)}else{e.lineWidth=ve(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=To(a.borderRadius);Object.values(y).some(C=>C!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,_u(e,{x:p,y:g,w:d,h:c,radius:y}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),_u(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=xu(r.rtl,this.x,this.width),p=function(D){n.fillText(D,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=pl(this,_,r),n.fillStyle=r.bodyColor,Fe(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,Fe(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;Fe(y.after,p)}m=0,f=h.lineHeight,Fe(this.afterBody,p),e.y-=i}drawFooter(e,n,r){const s=this.footer,i=s.length;let a,l;if(i){const c=xu(r.rtl,this.x,this.width);for(e.x=pl(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}=To(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=Fo[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Op(this,e),c=Object.assign({},a,this._size),d=Dp(n,e,c),u=Ep(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=_n(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),yC(e,n.textDirection),i.y+=a.top,this.drawTitle(i,e,n),this.drawBody(i,e,n),this.drawFooter(i,e,n),wC(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=!ja(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||!ja(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=Fo[i.position].call(this,e,n);return a!==!1&&(r!==a.x||s!==a.y)}}W(Bu,"positioners",Fo);var $M={id:"tooltip",_element:Bu,positioners:Fo,afterInit(t,e,n){n&&(t.tooltip=new Bu({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:Lp},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 PM=(t,e,n,r)=>(typeof e=="string"?(n=t.push(e)-1,r.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function LM(t,e,n,r){const s=t.indexOf(e);if(s===-1)return PM(t,e,n,r);const i=t.lastIndexOf(e);return s!==i?n:s}const VM=(t,e)=>t===null?null:gn(Math.round(t),0,e);function Vp(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class gl extends Rs{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:LM(r,e,Re(n,e),this._addedLabels),VM(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 Vp.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(gl,"id","category"),W(gl,"defaults",{ticks:{callback:Vp}});function NM(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,D,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,D=Math.ceil(_/M)*M):(S=p,D=_),y&&C&&i&&uk((l-a)/i,M/1e3)?(E=Math.round(Math.min((l-a)/M,u)),M=(l-a)/E,S=a,D=l):k?(S=y?a:S,D=C?l:D,E=d-1,M=(D-S)/E):(E=(D-S)/M,xo(E,Math.round(E),M/1e3)?E=Math.round(E):E=Math.ceil(E));const I=Math.max(sm(M),sm(S));T=Math.pow(10,Ue(c)?I:c),S=Math.round(S*T)/T,D=Math.round(D*T)/T;let j=0;for(y&&(f&&S!==a?(n.push({value:a}),S<a&&j++,xo(Math.round((S+j*M)*T)/T,a,Np(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&&D!==l?n.length&&xo(n[n.length-1].value,l,Np(l,v,t))?n[n.length-1].value=l:n.push({value:l}):(!C||D===l)&&n.push({value:D}),n}function Np(t,e,{horizontal:n,minRotation:r}){const s=Qr(r),i=(n?Math.sin(s):Math.cos(s))||.001,a=.75*e*(""+t).length;return Math.min(e/i,a)}class _l extends Rs{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=bi(s),d=bi(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=NM(s,i);return e.bounds==="ticks"&&rm(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 uu(e,this.chart.options.locale,this.options.ticks.format)}}class yl extends _l{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ot(e)?e:0,this.max=ot(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,r=Qr(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(yl,"id","linear"),W(yl,"defaults",{ticks:{callback:Xa.formatters.numeric}});const Io=t=>Math.floor(Jr(t)),Fs=(t,e)=>Math.pow(10,Io(t)+e);function Bp(t){return t/Math.pow(10,Io(t))===1}function Ap(t,e,n){const r=Math.pow(10,n),s=Math.floor(t/r);return Math.ceil(e/r)-s}function BM(t,e){const n=e-t;let r=Io(n);for(;Ap(t,e,r)>10;)r++;for(;Ap(t,e,r)<10;)r--;return Math.min(r,Io(t))}function AM(t,{min:e,max:n}){e=nn(t.min,e);const r=[],s=Io(e);let i=BM(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:Bp(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:Bp(m),significand:h}),r}class Rp extends Rs{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const r=_l.prototype.parse.apply(this,[e,n]);if(r===0){this._zero=!0;return}return ot(r)&&r>0?r:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=ot(e)?Math.max(0,e):null,this.max=ot(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ot(this._userMin)&&(this.min=e===Fs(this.min,0)?Fs(this.min,-1):Fs(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(Fs(r,-1)),a(Fs(s,1)))),r<=0&&i(Fs(s,-1)),s<=0&&a(Fs(r,1)),this.min=r,this.max=s}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},r=AM(n,this);return e.bounds==="ticks"&&rm(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":uu(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Jr(e),this._valueRange=Jr(this.max)-Jr(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Jr(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}W(Rp,"id","logarithmic"),W(Rp,"defaults",{ticks:{callback:Xa.formatters.logarithmic,major:{enabled:!0}}});function Au(t){const e=t.ticks;if(e.display&&t.display){const n=_n(e.backdropPadding);return Re(e.font&&e.font.size,pt.font.size)+n.height}return 0}function RM(t,e,n){return n=nt(n)?n:[n],{w:Pk(t,e.string,n),h:n.length*e.lineHeight}}function Fp(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 FM(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?vt/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=RM(t.ctx,h,t._pointLabels[c]);r[c]=f;const m=on(t.getIndexAngle(c)+l),g=Math.round(ou(m)),p=Fp(g,u.x,f.w,0,180),_=Fp(g,u.y,f.h,90,270);IM(n,e,m,p,_)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=YM(t,r,s)}function IM(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 HM(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(ou(on(c.angle+sn))),u=ZM(c.y,l.h,d),h=WM(d),f=jM(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 zM(t,e){if(!e)return!0;const{left:n,top:r,right:s,bottom:i}=t;return!(gr({x:n,y:r},e)||gr({x:n,y:i},e)||gr({x:s,y:r},e)||gr({x:s,y:i},e))}function YM(t,e,n){const r=[],s=t._pointLabels.length,i=t.options,{centerPointLabels:a,display:l}=i.pointLabels,c={extra:Au(i)/2,additionalAngle:a?vt/s:0};let d;for(let u=0;u<s;u++){c.padding=n[u],c.size=e[u];const h=HM(t,u,c);r.push(h),l==="auto"&&(h.visible=zM(h,d),h.visible&&(d=h))}return r}function WM(t){return t===0||t===180?"center":t<180?"left":"right"}function jM(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function ZM(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function UM(t,e,n){const{left:r,top:s,right:i,bottom:a}=n,{backdropColor:l}=e;if(!Ue(l)){const c=To(e.borderRadius),d=_n(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(),_u(t,{x:u,y:h,w:f,h:m,radius:c}),t.fill()):t.fillRect(u,h,f,m)}}function qM(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));UM(n,a,i);const l=an(a.font),{x:c,y:d,textAlign:u}=i;Qa(n,t._pointLabels[s],c,d+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Ip(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 GM(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(),Ip(t,n,a,r),i.closePath(),i.stroke(),i.restore())}function KM(t,e,n){return es(t,{label:n,index:e,type:"pointLabel"})}class wl extends _l{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=_n(Au(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=ot(e)&&!isNaN(e)?e:0,this.max=ot(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Au(this.options))}generateTickLabels(e){_l.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,r)=>{const s=at(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?FM(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+Qr(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 KM(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(),Ip(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&&qM(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);GM(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=_n(d.backdropPadding);e.fillRect(-a/2-h.left,-i-u.size/2-h.top,a+h.width,u.size+h.height)}Qa(e,l.label,0,-i,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}W(wl,"id","radialLinear"),W(wl,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Xa.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),W(wl,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),W(wl,"descriptors",{angleLines:{_fallback:"grid"}});const bl={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}},jt=Object.keys(bl);function Hp(t,e){return t-e}function zp(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)),ot(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(Mo(i)||i===!0)?n.startOf(a,"isoWeek",i):n.startOf(a,s)),+a)}function Yp(t,e,n,r){const s=jt.length;for(let i=jt.indexOf(t);i<s-1;++i){const a=bl[jt[i]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(l*a.size))<=r)return jt[i]}return jt[s-1]}function XM(t,e,n,r,s){for(let i=jt.length-1;i>=jt.indexOf(n);i--){const a=jt[i];if(bl[a].common&&t._adapter.diff(s,r,a)>=e-1)return a}return jt[n?jt.indexOf(n):0]}function JM(t){for(let e=jt.indexOf(t)+1,n=jt.length;e<n;++e)if(bl[jt[e]].common)return jt[e]}function Wp(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:r,hi:s}=lu(n,e),i=n[r]>=e?n[r]:n[s];t[i]=!0}}function QM(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 jp(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:QM(t,r,s,n)}class kl extends Rs{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 IC._date(e.adapters.date);s.init(n),Co(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:zp(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=ot(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),i=ot(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=gk(s,i,a);return this._unit=n.unit||(r.autoSkip?Yp(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):XM(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:JM(this._unit),this.initOffsets(s),e.reverse&&l.reverse(),jp(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=gn(n,0,a),r=gn(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||Yp(i.minUnit,n,r,this._getLabelCapacity(n)),l=Re(s.ticks.stepSize,1),c=a==="week"?i.isoWeekday:!1,d=Mo(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++)Wp(u,f,g);return(f===r||s.bounds==="ticks"||m===1)&&Wp(u,f,g),Object.keys(u).sort(Hp).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 at(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=Qr(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,jp(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(zp(this,s[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return yk(e.sort(Hp))}}W(kl,"id","time"),W(kl,"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 Cl(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 Zp extends kl{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=Cl(n,this.min),this._tableRange=Cl(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(Cl(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,r=this.getDecimalForPixel(e)/n.factor-n.end;return Cl(this._table,r*this._tableRange+this._minPos,!0)}}W(Zp,"id","timeseries"),W(Zp,"defaults",kl.defaults);const Up={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},eS={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Up,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},tS=o.version[0]==="2"?(t,e)=>Object.assign(t,{attrs:e}):(t,e)=>Object.assign(t,e);function xi(t){return o.isProxy(t)?o.toRaw(t):t}function nS(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return o.isProxy(e)?new Proxy(t,{}):t}function rS(t,e){const n=t.options;n&&e&&Object.assign(n,e)}function qp(t,e){t.labels=e}function Gp(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 sS(t,e){const n={labels:[],datasets:[]};return qp(n,t.labels),Gp(n,t.datasets,e),n}const iS=o.defineComponent({props:eS,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=sS(u,m),p=nS(g,u);i.value=new Ao(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=xi(h),C=xi(m);y&&y!==C&&(rS(p,y),_=!0)}if(f){const y=xi(f.labels),C=xi(g.labels),k=xi(f.datasets),v=xi(g.datasets);y!==C&&(qp(p.config.data,y),_=!0),k&&k!==v&&(Gp(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 oS(t,e){return Ao.register(e),o.defineComponent({props:Up,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(iS,tS({ref:a},{type:t,...n}))}})}const Kp=oS("line",il),aS={class:"chart-container"},Ru={__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){Ao.register(gl,yl,Ro,yr,$M,Tp);const e=t;let n=o.reactive({isEmpty:!0});const r=u=>{const h=new Set,f=[];let m=[];switch(e.dataType){case"balanceChartData":m=u.length!==0?u.map(p=>(h.add(p.date),Ot(p.balance*xc(),2))):[0,0];break;case"performanceChartData":m=u.length!==0?u.map(p=>(h.add(p.date),Ot(p.pnl_to_deposit,2))):[0,0];break}f.push({data:m});const g=Array.from(h);return g.length===1?(g.push(...g),f.forEach(p=>{p.data.push(...p.data)}),n.isEmpty=!1):g.length===0?(n.isEmpty=!0,g.push(0,0)):n.isEmpty=!1,{labels:g,datasets:f}},s=o.computed(()=>r(e.data)),i=u=>{const f=u.chart.ctx.createLinearGradient(0,0,0,e.gradient.height);return f.addColorStop(0,e.gradient.startColor),f.addColorStop(1,e.gradient.endColor),f},a=(u,h)=>{let f=document.querySelector(`#${u}-${e.dataType}`);return f||(f=document.createElement("div"),f.classList.add(u),f.setAttribute("id",`${u}-${e.dataType}`),h.canvas.parentNode.appendChild(f)),f},l=u=>{if(!n.isEmpty){const{chart:h,tooltip:f}=u,m=a("chart-tooltip",h);if(f.opacity===0){m.style.opacity="0";return}if(f.body){const v=f.title||[],M=f.body.map(S=>S.lines),T=document.createElement("div");for(T.classList.add("chart-tooltip-middle"),T.innerHTML=`<div class="chart-tooltip-content">
|
|
35
35
|
${e.dataType==="balanceChartData"?`${ma()}${Me(e.isMask,ch(M[0]),{repeat:6})}`:`${Me(e.isMask,ch(M[0]),{repeat:3})}%`}
|
|
36
|
-
<span> | ${dh(v[0])}, ${m6(v[0])}</span></div>`;m.firstChild;)m.firstChild.remove();m.appendChild(T)}const{offsetLeft:g,offsetTop:p,clientWidth:_}=h.canvas;let y=g+f.caretX;const C=p+f.caretY,k=m.clientWidth;y+k>_&&(y-=k),m.style.opacity="1",m.style.left=y+"px",m.style.top=C+"px"}},c=u=>{const{chart:h}=u,f=a("chart-line",h),m=h.chartArea;h.canvas.addEventListener("mousemove",function(g){const p=h.canvas.getBoundingClientRect(),_=g.clientX-p.left,y=g.clientY-p.top;_>=m.left&&_<=m.right&&y>=m.top&&y<=m.bottom?(f.style.left=_+"px",f.style.top=m.top+"px",f.style.height=m.bottom-m.top+"px",f.style.display="flex"):f.style.display="none"}),h.canvas.addEventListener("mouseout",function(){f.style.display="none"})},d=o.computed(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},scales:{x:{ticks:{display:!n.isEmpty,callback:function(u){return dh(this.getLabelForValue(u)).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:!n.isEmpty,callback:function(u){return e.ticksCallback(u)},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:l},legend:!1},elements:{line:{backgroundColor:u=>i(u),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:c}));return(u,h)=>(o.openBlock(),o.createElementBlock("div",aS,[o.createVNode(o.unref(Kp),{data:s.value,options:d.value},null,8,["data","options"])]))}},Fu={__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){Ao.register(gl,yl,Ro,yr,Tp);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(Kp),{data:r.value,options:i.value},null,8,["data","options"]))}},lS=t=>(o.pushScopeId("data-v-af1e1a1d"),t=t(),o.popScopeId(),t),cS={class:"account-balance-widget"},dS={class:"account-balance-widget__top"},uS={class:"account-balance-widget__title-wrapper"},hS=lS(()=>o.createElementVNode("div",{class:"account-balance-widget__title"},"Account Balance",-1)),fS=De({__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*xc();return i>=1e3||i<=-1e3?Me(r.isMask,Ot(i/1e3,2)+"k",{repeat:3}):Ot(i,2)},r=t;return(s,i)=>(o.openBlock(),o.createElementBlock("div",cS,[o.createElementVNode("div",dS,[o.createElementVNode("div",uS,[hS,o.createVNode(o.unref(mn),{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(Ru),{data:t.balanceChartData,"data-type":"balanceChartData","ticks-callback":n,isMask:t.isMask},null,8,["data","isMask"])]))}},[["__scopeId","data-v-af1e1a1d"]]),Xp=t=>(o.pushScopeId("data-v-d57099e1"),t=t(),o.popScopeId(),t),mS={class:"balance-widget"},pS={class:"balance-part"},gS={class:"balance-part__top"},_S={class:"balance-part__title-wrapper"},yS=Xp(()=>o.createElementVNode("div",{class:"balance-part__title"},"Balance",-1)),wS={class:"balance-part__content"},bS={class:"balance-part__content__wrapper"},kS={class:"balance-part__content__count"},CS={class:"balance-part__content__bitcoin"},xS={key:0,class:"devider"},MS={key:1,class:"personal-target-part"},SS={class:"personal-target-part__top"},vS={class:"personal-target-part__title-wrapper"},TS=Xp(()=>o.createElementVNode("div",{class:"personal-target-part__title"},"Personal target",-1)),OS={class:"personal-target-part__content"},DS={class:"personal-target-part__content__current"},ES={class:"personal-target-part__content__from"},$S=De({__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",mS,[o.createElementVNode("div",pS,[o.createElementVNode("div",gS,[o.createElementVNode("div",_S,[yS,o.createVNode(o.unref(mn),{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",wS,[o.createElementVNode("div",bS,[o.createElementVNode("div",kS,o.toDisplayString(o.unref(Me)(t.isMaskBalance,o.unref(qt)(t.USDT),{prefix:"$"})),1),t.delta?(o.openBlock(),o.createBlock(o.unref(Ul),{key:0,"is-hidden":t.isMaskBalance,percentage:"",delta:t.delta},null,8,["is-hidden","delta"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",CS,"= "+o.toDisplayString(o.unref(Me)(t.isMaskBalance,t.BTC))+" BTC",1)]),t.isShare?(o.openBlock(),o.createBlock(o.unref(Fu),{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(Fu),{key:1,class:"balance-part__chart",data:t.balanceChartData},null,8,["data"]))]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",xS)),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",MS,[o.createElementVNode("div",SS,[o.createElementVNode("div",vS,[TS,o.createVNode(o.unref(mn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode(" In this widget you can set your profit goal to $ for a certain period. This will help you better understand where you should stop or be more attentive. ")]),_: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",OS,[o.createElementVNode("div",DS,o.toDisplayString(o.unref(Me)(t.isMaskPersonalTarget,o.unref(qt)(t.currentProfit,{isPercentage:t.isPercentage,isFixed:!0}),{prefix:"$",repeat:5})),1),o.createElementVNode("div",ES,"/ "+o.toDisplayString(o.unref(Me)(t.isMaskPersonalTarget,o.unref(qt)(t.profit,{isPercentage:t.isPercentage,isFixed:!0}))),1)]),o.createVNode(o.unref(o3),{"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-d57099e1"]]),xl=t=>(o.pushScopeId("data-v-dd62ea18"),t=t(),o.popScopeId(),t),PS={class:"calendar-widget"},LS={class:"calendar-widget__calendar"},VS={class:"calendar-widget__top"},NS={class:"calendar-widget__title-wrapper"},BS=xl(()=>o.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),AS={class:"stat-calendar"},RS={class:"stat-calendar__week-days"},FS={key:0,class:"stat-calendar__row-wrapper"},IS={class:"stat-calendar__row"},HS=["onClick"],zS=xl(()=>o.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),YS={key:0,class:"calendar-widget__day"},WS={class:"calendar-widget__day__title"},jS={class:"calendar-widget__day__content"},ZS={class:"calendar-widget__point"},US={class:"calendar-widget__point__title"},qS=xl(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),GS={class:"calendar-widget__day__trades"},KS={class:"calendar-widget__point"},XS={class:"calendar-widget__point__title"},JS=xl(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),QS=De({__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,currentDate:Date,calendarPointsTop:Array,calendarPointsBottom:Array,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=l=>{r.value=l.year,s.value=l.month,i("chooseMonth",l)};return o.nextTick(()=>{const l=new Date;r.value=l.getFullYear(),s.value=l.getMonth()}),(l,c)=>{var d,u;return o.openBlock(),o.createElementBlock("div",PS,[o.createElementVNode("div",LS,[o.createElementVNode("div",VS,[o.createElementVNode("div",NS,[BS,o.createVNode(o.unref(mn),{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(i3),{key:0,"current-date":t.currentDate,onOnChange:a,year:r.value,"onUpdate:year":c[0]||(c[0]=h=>r.value=h),month:s.value,"onUpdate:month":c[1]||(c[1]=h=>s.value=h)},null,8,["current-date","year","month"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",AS,[o.createElementVNode("div",RS,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(n,(h,f)=>o.createElementVNode("div",{class:o.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(f)}])},o.toDisplayString(h),3)),64))]),t.rows?(o.openBlock(),o.createElementBlock("div",FS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rows,h=>(o.openBlock(),o.createElementBlock("div",IS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h,f=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["stat-calendar__day",{"-empty":!f.date,"-current":t.isCurrentDate(f.date),"-positive":f.win,"-negative":f.win===!1}]),onClick:m=>i("setNewDate",f.date)},o.toDisplayString(f.date?f.date:""),11,HS))),256))]))),256))])):o.createCommentVNode("",!0)])]),zS,t.dailyStatData&&!t.dailyStatData.isNull?(o.openBlock(),o.createElementBlock("div",YS,[o.createElementVNode("div",WS,o.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),o.createElementVNode("div",jS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.calendarPointsTop,h=>(o.openBlock(),o.createElementBlock("div",ZS,[o.createElementVNode("div",US,o.toDisplayString(h.title),1),qS,o.createElementVNode("div",{class:o.normalizeClass(["calendar-widget__point__value",h.class?h.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,h.value,{repeat:5})),3)]))),256)),o.createVNode(o.unref(W0),{isHidden:t.isMask,long:(d=t.dailyStatData)==null?void 0:d.long_count,short:(u=t.dailyStatData)==null?void 0:u.short_count},null,8,["isHidden","long","short"]),o.createElementVNode("div",GS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.calendarPointsBottom,h=>(o.openBlock(),o.createElementBlock("div",KS,[o.createElementVNode("div",XS,o.toDisplayString(h.title),1),JS,o.createVNode(o.unref(Ul),{isHidden:t.isMask,"is-positive":h.isPositive,"is-negative":h.isNegative,delta:h.value},null,8,["isHidden","is-positive","is-negative","delta"])]))),256))])])])):(o.openBlock(),o.createBlock(o.unref(Qd),{key:1,class:"-empty"}))])}}},[["__scopeId","data-v-dd62ea18"]]),Iu=t=>(o.pushScopeId("data-v-7dadd642"),t=t(),o.popScopeId(),t),ev={class:"commission-widget"},tv={class:"commission-widget__content"},nv={class:"commission-widget__top"},rv={class:"commission-widget__title-wrapper"},sv=Iu(()=>o.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),iv={class:"commission-widget__info"},ov={class:"commission-widget__total-wrapper"},av=Iu(()=>o.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),lv={class:"commission-widget__total-wrapper__total"},cv={class:"commission-widget__total-wrapper__value"},dv={class:"commission-widget__points"},uv={class:"commission-widget__point"},hv={class:"commission-widget__point__title"},fv=Iu(()=>o.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),mv=De({__name:"CommissionsFeesWidget",props:{commission:Number,commissionPoints: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",ev,[o.createElementVNode("div",tv,[o.createElementVNode("div",nv,[o.createElementVNode("div",rv,[sv,o.createVNode(o.unref(mn),{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":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",iv,[o.createElementVNode("div",ov,[av,o.createElementVNode("div",lv,[o.createElementVNode("div",cv,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(qt)(t.commission),{repeat:5})),1)])]),o.createElementVNode("div",dv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.commissionPoints,(a,l)=>(o.openBlock(),o.createElementBlock("div",uv,[o.createElementVNode("div",hv,o.toDisplayString(a.title),1),fv,o.createElementVNode("div",{class:o.normalizeClass(["commission-widget__point__value",a.class?a.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,a.value,{repeat:5})),3)]))),256))])])])]))}},[["__scopeId","data-v-7dadd642"]]),pv=t=>(o.pushScopeId("data-v-7187c939"),t=t(),o.popScopeId(),t),gv={class:"performance-widget"},_v={class:"performance-widget__top"},yv={class:"performance-widget__title-wrapper"},wv=pv(()=>o.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),bv=De({__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,Ot(s,2)+"%",{repeat:3});return(s,i)=>(o.openBlock(),o.createElementBlock("div",gv,[o.createElementVNode("div",_v,[o.createElementVNode("div",yv,[wv,o.createVNode(o.unref(mn),{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(Ru),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":r,isMask:t.isMask},null,8,["data","isMask"])]))}},[["__scopeId","data-v-7187c939"]]),Hu=t=>(o.pushScopeId("data-v-20b275a1"),t=t(),o.popScopeId(),t),kv={class:"return-widget"},Cv={class:"return-widget__content"},xv={class:"return-widget__top"},Mv={class:"return-widget__title-wrapper"},Sv=Hu(()=>o.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),vv={class:"return-widget__info"},Tv={class:"return-widget__total-wrapper"},Ov=Hu(()=>o.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),Dv={class:"return-widget__total-wrapper__total"},Ev={class:"return-widget__points"},$v={class:"return-widget__point"},Pv={class:"return-widget__point__title"},Lv=Hu(()=>o.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),Vv=["innerHTML"],Nv=De({__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,Ot(s.profitFactor),{repeat:5})}. <br /> You earn ${Me(s.isMask,qt(s.profitFactor),{repeat:5,prefix:"$"})} on every ${Me(s.isMask,"$1",{repeat:5,prefix:"$"})} loss.`:`Your profit factor is ${Me(s.isMask,Ot(s.profitFactor),{repeat:5})}. <br/> You loss ${Me(s.isMask,qt(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",kv,[o.createElementVNode("div",Cv,[o.createElementVNode("div",xv,[o.createElementVNode("div",Mv,[Sv,o.createVNode(o.unref(mn),{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",vv,[o.createElementVNode("div",Tv,[Ov,o.createElementVNode("div",Dv,[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(qt)(t.returnPeriod,{isPlus:!0,isFixed:!0}),{repeat:5})),3),s.changeRate?(o.openBlock(),o.createBlock(o.unref(Ul),{key:0,percentage:"",isHidden:t.isMask,delta:s.changeRate},null,8,["isHidden","delta"])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",Ev,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,f=>(o.openBlock(),o.createElementBlock("div",$v,[o.createElementVNode("div",Pv,o.toDisplayString(f.title),1),Lv,o.createElementVNode("div",{class:o.normalizeClass(["return-widget__point__value",f.class?f.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,o.unref(qt)(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,Vv)],2)):o.createCommentVNode("",!0)]))}},[["__scopeId","data-v-20b275a1"]]),Jp=t=>(o.pushScopeId("data-v-9232fe43"),t=t(),o.popScopeId(),t),Bv={class:"top-positions-widget"},Av={class:"top-positions-widget__top"},Rv={class:"top-positions-widget__title-wrapper"},Fv=Jp(()=>o.createElementVNode("div",{class:"top-positions-widget__title"},"Top-3 Positions",-1)),Iv={key:0,class:"top-positions-widget__returns"},Hv={class:"top-positions-widget__return"},zv={class:"top-positions-widget__return__left"},Yv=Jp(()=>o.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),Wv={class:"top-positions-widget__return__pair"},jv={class:"top-positions-widget__return__right"},Zv={class:"top-positions-widget__return__pnl"},Uv=De({__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",Bv,[o.createElementVNode("div",Av,[o.createElementVNode("div",Rv,[Fv,o.createVNode(o.unref(mn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Helps you find the top 3 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",Iv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.topPositions,a=>(o.openBlock(),o.createElementBlock("div",Hv,[o.createElementVNode("div",zv,[Yv,o.createElementVNode("div",Wv,o.toDisplayString(o.unref(p6)(a.pair)),1)]),o.createElementVNode("div",jv,[o.createElementVNode("div",Zv,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(qt)(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(qt)(a.roi,{isPercentage:!0,isFixed:!0},{repeat:2}))),1)],2)])]))),256))])):(o.openBlock(),o.createBlock(o.unref(Qd),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"}))]))}},[["__scopeId","data-v-9232fe43"]]),zu=t=>(o.pushScopeId("data-v-139cca32"),t=t(),o.popScopeId(),t),qv={class:"trade-widget"},Gv={class:"trade-widget__content"},Kv={class:"trade-widget__top"},Xv={class:"trade-widget__title-wrapper"},Jv=zu(()=>o.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),Qv={class:"trade-widget__info"},eT={class:"trade-widget__total-wrapper"},tT=zu(()=>o.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),nT={class:"trade-widget__total-wrapper__total"},rT={class:"trade-widget__total-wrapper__value"},sT={class:"trade-widget__points"},iT={class:"trade-widget__point"},oT={class:"trade-widget__point__title"},aT=zu(()=>o.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),lT=De({__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",qv,[o.createElementVNode("div",Gv,[o.createElementVNode("div",Kv,[o.createElementVNode("div",Xv,[Jv,o.createVNode(o.unref(mn),{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",Qv,[o.createElementVNode("div",eT,[tT,o.createElementVNode("div",nT,[o.createElementVNode("div",rT,o.toDisplayString(o.unref(Me)(t.isMask,t.totalTrades,{repeat:5})),1)])]),o.createElementVNode("div",sT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.tradePoints,a=>(o.openBlock(),o.createElementBlock("div",iT,[o.createElementVNode("div",oT,o.toDisplayString(a.title),1),aT,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"]]),Yu=t=>(o.pushScopeId("data-v-7ee4ff51"),t=t(),o.popScopeId(),t),cT={class:"winrate-widget"},dT={class:"winrate-widget__winrate"},uT={class:"winrate-widget__title-wrapper"},hT=Yu(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Winrate",-1)),fT={class:"winrate-widget__chart"},mT={class:"winrate-widget__data"},pT={class:"winrate-widget__data_value"},gT=Yu(()=>o.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),_T={class:"winrate-widget__average-rr"},yT={class:"winrate-widget__title-wrapper"},wT=Yu(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),bT=De({__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",cT,[o.createElementVNode("div",dT,[o.createElementVNode("div",uT,[hT,o.createVNode(o.unref(mn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays the percentage of your successful positions. ")]),_:1})]),o.createElementVNode("div",fT,[o.renderSlot(e.$slots,"roundSlider",{},void 0,!0),o.createElementVNode("div",mT,[o.createElementVNode("div",pT,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ot)(t.winrate,2)))+"%",1),gT])])]),o.createElementVNode("div",_T,[o.createElementVNode("div",yT,[wT,o.createVNode(o.unref(mn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Risk Reward, defines the ratio of potential profit to loss you can get. ")]),_:1})]),o.createVNode(o.unref(Qp),{avg:t.averageRR,min:t.minRR,max:t.maxRR,isMask:t.isMask},null,8,["avg","min","max","isMask"])])]))}},[["__scopeId","data-v-7ee4ff51"]]),kT=t=>(o.pushScopeId("data-v-e6d713b2"),t=t(),o.popScopeId(),t),CT={class:"average-rr-line-container"},xT={class:"average-rr-line"},MT={key:0,class:"average-rr-line__progress"},ST=[kT(()=>o.createElementVNode("div",{class:"average-rr-line__dot"},null,-1))],vT={class:"coefficients"},TT={class:"coefficients__value -min"},OT={class:"coefficients__value -avg"},DT={class:"coefficients__value -max"},Qp=De({__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",CT,[o.createElementVNode("div",xT,[t.avg&&t.max?(o.openBlock(),o.createElementBlock("div",MT,ST)):o.createCommentVNode("",!0)]),o.createElementVNode("div",vT,[o.createElementVNode("div",TT,o.toDisplayString(o.unref(Me)(t.isMask,t.min,{repeat:3})),1),o.createElementVNode("div",OT,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ot)(t.avg))),1),o.createElementVNode("div",DT,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ot)(t.max),{repeat:3})),1)])]))}},[["__scopeId","data-v-e6d713b2"]]);function e2(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Ho(t){return typeof t=="function"?t():o.unref(t)}const t2=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ET=Object.prototype.toString,$T=t=>ET.call(t)==="[object Object]",zo=()=>{},Wu=PT();function PT(){var t,e;return t2&&((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 LT(...t){if(t.length!==1)return o.toRef(...t);const e=t[0];return typeof e=="function"?o.readonly(o.customRef(()=>({get:e,set:zo}))):o.ref(e)}function Yo(t){var e;const n=Ho(t);return(e=n==null?void 0:n.$el)!=null?e:n}const r2=t2?window:void 0;function Ml(...t){let e,n,r,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,s]=t,e=r2):[e,n,r,s]=t,!e)return zo;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(()=>[Yo(e),Ho(s)],([u,h])=>{if(a(),!u)return;const f=$T(h)?{...h}:h;i.push(...n.flatMap(m=>r.map(g=>l(u,m,g,f))))},{immediate:!0,flush:"post"}),d=()=>{c(),a()};return e2(d),d}let s2=!1;function i2(t,e,n={}){const{window:r=r2,ignore:s=[],capture:i=!0,detectIframe:a=!1}=n;if(!r)return zo;Wu&&!s2&&(s2=!0,Array.from(r.document.body.children).forEach(f=>f.addEventListener("click",zo)),r.document.documentElement.addEventListener("click",zo));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=Yo(m);return g&&(f.target===g||f.composedPath().includes(g))}}),u=[Ml(r,"click",f=>{const m=Yo(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}),Ml(r,"pointerdown",f=>{const m=Yo(t);l=!c(f)&&!!(m&&!f.composedPath().includes(m))},{passive:!0}),a&&Ml(r,"blur",f=>{setTimeout(()=>{var m;const g=Yo(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 o2={[n2.mounted](t,e){const n=!e.modifiers.bubble;if(typeof e.value=="function")t.__onClickOutside_stop=i2(t,e.value,{capture:n});else{const[r,s]=e.value;t.__onClickOutside_stop=i2(t,r,Object.assign({capture:n},s))}},[n2.unmounted](t){t.__onClickOutside_stop()}};function ju(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function a2(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:a2(n)}}function VT(t){const e=t||window.event,n=e.target;return a2(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Sl=new WeakMap;function NT(t,e=!1){const n=o.ref(e);let r=null;o.watch(LT(t),a=>{const l=ju(Ho(a));if(l){const c=l;Sl.get(c)||Sl.set(c,c.style.overflow),n.value&&(c.style.overflow="hidden")}},{immediate:!0});const s=()=>{const a=ju(Ho(t));!a||n.value||(Wu&&(r=Ml(a,"touchmove",l=>{VT(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},i=()=>{var a;const l=ju(Ho(t));!l||!n.value||(Wu&&(r==null||r()),l.style.overflow=(a=Sl.get(l))!=null?a:"",Sl.delete(l),n.value=!1)};return e2(i),o.computed({get(){return n.value},set(a){a?s():i()}})}function BT(){let t=!1;const e=o.ref(!1);return(n,r)=>{if(e.value=r.value,t)return;t=!0;const s=NT(n,r.value);o.watch(e,i=>s.value=i)}}BT();//! moment.js
|
|
36
|
+
<span> | ${dh(v[0])}, ${m6(v[0])}</span></div>`;m.firstChild;)m.firstChild.remove();m.appendChild(T)}const{offsetLeft:g,offsetTop:p,clientWidth:_}=h.canvas;let y=g+f.caretX;const C=p+f.caretY,k=m.clientWidth;y+k>_&&(y-=k),m.style.opacity="1",m.style.left=y+"px",m.style.top=C+"px"}},c=u=>{const{chart:h}=u,f=a("chart-line",h),m=h.chartArea;h.canvas.addEventListener("mousemove",function(g){const p=h.canvas.getBoundingClientRect(),_=g.clientX-p.left,y=g.clientY-p.top;_>=m.left&&_<=m.right&&y>=m.top&&y<=m.bottom?(f.style.left=_+"px",f.style.top=m.top+"px",f.style.height=m.bottom-m.top+"px",f.style.display="flex"):f.style.display="none"}),h.canvas.addEventListener("mouseout",function(){f.style.display="none"})},d=o.computed(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:1500},scales:{x:{ticks:{display:!n.isEmpty,callback:function(u){return dh(this.getLabelForValue(u)).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:!n.isEmpty,callback:function(u){return e.ticksCallback(u)},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:l},legend:!1},elements:{line:{backgroundColor:u=>i(u),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:c}));return(u,h)=>(o.openBlock(),o.createElementBlock("div",aS,[o.createVNode(o.unref(Kp),{data:s.value,options:d.value},null,8,["data","options"])]))}},Fu={__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){Ao.register(gl,yl,Ro,yr,Tp);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(Kp),{data:r.value,options:i.value},null,8,["data","options"]))}},lS=t=>(o.pushScopeId("data-v-af1e1a1d"),t=t(),o.popScopeId(),t),cS={class:"account-balance-widget"},dS={class:"account-balance-widget__top"},uS={class:"account-balance-widget__title-wrapper"},hS=lS(()=>o.createElementVNode("div",{class:"account-balance-widget__title"},"Account Balance",-1)),fS=De({__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*xc();return i>=1e3||i<=-1e3?Me(r.isMask,Ot(i/1e3,2)+"k",{repeat:3}):Ot(i,2)},r=t;return(s,i)=>(o.openBlock(),o.createElementBlock("div",cS,[o.createElementVNode("div",dS,[o.createElementVNode("div",uS,[hS,o.createVNode(o.unref(mn),{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(Ru),{data:t.balanceChartData,"data-type":"balanceChartData","ticks-callback":n,isMask:t.isMask},null,8,["data","isMask"])]))}},[["__scopeId","data-v-af1e1a1d"]]),Xp=t=>(o.pushScopeId("data-v-d57099e1"),t=t(),o.popScopeId(),t),mS={class:"balance-widget"},pS={class:"balance-part"},gS={class:"balance-part__top"},_S={class:"balance-part__title-wrapper"},yS=Xp(()=>o.createElementVNode("div",{class:"balance-part__title"},"Balance",-1)),wS={class:"balance-part__content"},bS={class:"balance-part__content__wrapper"},kS={class:"balance-part__content__count"},CS={class:"balance-part__content__bitcoin"},xS={key:0,class:"devider"},MS={key:1,class:"personal-target-part"},SS={class:"personal-target-part__top"},vS={class:"personal-target-part__title-wrapper"},TS=Xp(()=>o.createElementVNode("div",{class:"personal-target-part__title"},"Personal target",-1)),OS={class:"personal-target-part__content"},DS={class:"personal-target-part__content__current"},ES={class:"personal-target-part__content__from"},$S=De({__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",mS,[o.createElementVNode("div",pS,[o.createElementVNode("div",gS,[o.createElementVNode("div",_S,[yS,o.createVNode(o.unref(mn),{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",wS,[o.createElementVNode("div",bS,[o.createElementVNode("div",kS,o.toDisplayString(o.unref(Me)(t.isMaskBalance,o.unref(qt)(t.USDT),{prefix:"$"})),1),t.delta?(o.openBlock(),o.createBlock(o.unref(Ul),{key:0,"is-hidden":t.isMaskBalance,percentage:"",delta:t.delta},null,8,["is-hidden","delta"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",CS,"= "+o.toDisplayString(o.unref(Me)(t.isMaskBalance,t.BTC))+" BTC",1)]),t.isShare?(o.openBlock(),o.createBlock(o.unref(Fu),{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(Fu),{key:1,class:"balance-part__chart",data:t.balanceChartData},null,8,["data"]))]),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",xS)),t.isShare?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",MS,[o.createElementVNode("div",SS,[o.createElementVNode("div",vS,[TS,o.createVNode(o.unref(mn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode(" In this widget you can set your profit goal to $ for a certain period. This will help you better understand where you should stop or be more attentive. ")]),_: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",OS,[o.createElementVNode("div",DS,o.toDisplayString(o.unref(Me)(t.isMaskPersonalTarget,o.unref(qt)(t.currentProfit,{isPercentage:t.isPercentage,isFixed:!0}),{prefix:"$",repeat:5})),1),o.createElementVNode("div",ES,"/ "+o.toDisplayString(o.unref(Me)(t.isMaskPersonalTarget,o.unref(qt)(t.profit,{isPercentage:t.isPercentage,isFixed:!0}))),1)]),o.createVNode(o.unref(o3),{"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-d57099e1"]]),xl=t=>(o.pushScopeId("data-v-dd62ea18"),t=t(),o.popScopeId(),t),PS={class:"calendar-widget"},LS={class:"calendar-widget__calendar"},VS={class:"calendar-widget__top"},NS={class:"calendar-widget__title-wrapper"},BS=xl(()=>o.createElementVNode("div",{class:"calendar-widget__title"},"Calendar",-1)),AS={class:"stat-calendar"},RS={class:"stat-calendar__week-days"},FS={key:0,class:"stat-calendar__row-wrapper"},IS={class:"stat-calendar__row"},HS=["onClick"],zS=xl(()=>o.createElementVNode("div",{class:"calendar-widget__divider"},null,-1)),YS={key:0,class:"calendar-widget__day"},WS={class:"calendar-widget__day__title"},jS={class:"calendar-widget__day__content"},ZS={class:"calendar-widget__point"},US={class:"calendar-widget__point__title"},qS=xl(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),GS={class:"calendar-widget__day__trades"},KS={class:"calendar-widget__point"},XS={class:"calendar-widget__point__title"},JS=xl(()=>o.createElementVNode("div",{class:"calendar-widget__point__line"},null,-1)),QS=De({__name:"CalendarWidget",props:{rows:Array,dailyStatData:Object,currentDate:Date,calendarPointsTop:Array,calendarPointsBottom:Array,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=l=>{r.value=l.year,s.value=l.month,i("chooseMonth",l)};return o.nextTick(()=>{const l=new Date;r.value=l.getFullYear(),s.value=l.getMonth()}),(l,c)=>{var d,u;return o.openBlock(),o.createElementBlock("div",PS,[o.createElementVNode("div",LS,[o.createElementVNode("div",VS,[o.createElementVNode("div",NS,[BS,o.createVNode(o.unref(mn),{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(i3),{key:0,"current-date":t.currentDate,onOnChange:a,year:r.value,"onUpdate:year":c[0]||(c[0]=h=>r.value=h),month:s.value,"onUpdate:month":c[1]||(c[1]=h=>s.value=h)},null,8,["current-date","year","month"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",AS,[o.createElementVNode("div",RS,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(n,(h,f)=>o.createElementVNode("div",{class:o.normalizeClass(["stat-calendar__week-day",{"-current":t.isCurrentDay(f)}])},o.toDisplayString(h),3)),64))]),t.rows?(o.openBlock(),o.createElementBlock("div",FS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.rows,h=>(o.openBlock(),o.createElementBlock("div",IS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h,f=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["stat-calendar__day",{"-empty":!f.date,"-current":t.isCurrentDate(f.date),"-positive":f.win,"-negative":f.win===!1}]),onClick:m=>i("setNewDate",f.date)},o.toDisplayString(f.date?f.date:""),11,HS))),256))]))),256))])):o.createCommentVNode("",!0)])]),zS,t.dailyStatData&&!t.dailyStatData.isNull?(o.openBlock(),o.createElementBlock("div",YS,[o.createElementVNode("div",WS,o.toDisplayString(t.currentDate.getDate()+" "+t.currentDate.toLocaleString("en-us",{month:"long"})),1),o.createElementVNode("div",jS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.calendarPointsTop,h=>(o.openBlock(),o.createElementBlock("div",ZS,[o.createElementVNode("div",US,o.toDisplayString(h.title),1),qS,o.createElementVNode("div",{class:o.normalizeClass(["calendar-widget__point__value",h.class?h.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,h.value,{repeat:5})),3)]))),256)),o.createVNode(o.unref(W0),{isHidden:t.isMask,long:(d=t.dailyStatData)==null?void 0:d.long_count,short:(u=t.dailyStatData)==null?void 0:u.short_count},null,8,["isHidden","long","short"]),o.createElementVNode("div",GS,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.calendarPointsBottom,h=>(o.openBlock(),o.createElementBlock("div",KS,[o.createElementVNode("div",XS,o.toDisplayString(h.title),1),JS,o.createVNode(o.unref(Ul),{isHidden:t.isMask,"is-positive":h.isPositive,"is-negative":h.isNegative,delta:h.value},null,8,["isHidden","is-positive","is-negative","delta"])]))),256))])])])):(o.openBlock(),o.createBlock(o.unref(Qd),{key:1,class:"-empty"}))])}}},[["__scopeId","data-v-dd62ea18"]]),Iu=t=>(o.pushScopeId("data-v-7dadd642"),t=t(),o.popScopeId(),t),ev={class:"commission-widget"},tv={class:"commission-widget__content"},nv={class:"commission-widget__top"},rv={class:"commission-widget__title-wrapper"},sv=Iu(()=>o.createElementVNode("div",{class:"commission-widget__title"},"Commissions and Fees",-1)),iv={class:"commission-widget__info"},ov={class:"commission-widget__total-wrapper"},av=Iu(()=>o.createElementVNode("div",{class:"commission-widget__total-wrapper__title"},"Total",-1)),lv={class:"commission-widget__total-wrapper__total"},cv={class:"commission-widget__total-wrapper__value"},dv={class:"commission-widget__points"},uv={class:"commission-widget__point"},hv={class:"commission-widget__point__title"},fv=Iu(()=>o.createElementVNode("div",{class:"commission-widget__point__line"},null,-1)),mv=De({__name:"CommissionsFeesWidget",props:{commission:Number,commissionPoints: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",ev,[o.createElementVNode("div",tv,[o.createElementVNode("div",nv,[o.createElementVNode("div",rv,[sv,o.createVNode(o.unref(mn),{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":i[0]||(i[0]=a=>n.value=a),onOnChange:i[1]||(i[1]=a=>r("onChange",n.value))},null,8,["modelValue"])]),o.createElementVNode("div",iv,[o.createElementVNode("div",ov,[av,o.createElementVNode("div",lv,[o.createElementVNode("div",cv,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(qt)(t.commission),{repeat:5})),1)])]),o.createElementVNode("div",dv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.commissionPoints,(a,l)=>(o.openBlock(),o.createElementBlock("div",uv,[o.createElementVNode("div",hv,o.toDisplayString(a.title),1),fv,o.createElementVNode("div",{class:o.normalizeClass(["commission-widget__point__value",a.class?a.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,a.value,{repeat:5})),3)]))),256))])])])]))}},[["__scopeId","data-v-7dadd642"]]),pv=t=>(o.pushScopeId("data-v-7187c939"),t=t(),o.popScopeId(),t),gv={class:"performance-widget"},_v={class:"performance-widget__top"},yv={class:"performance-widget__title-wrapper"},wv=pv(()=>o.createElementVNode("div",{class:"performance-widget__title"},"Performance (cumulative)",-1)),bv=De({__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,Ot(s,2)+"%",{repeat:3});return(s,i)=>(o.openBlock(),o.createElementBlock("div",gv,[o.createElementVNode("div",_v,[o.createElementVNode("div",yv,[wv,o.createVNode(o.unref(mn),{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(Ru),{data:t.performanceChartData,"data-type":"performanceChartData","ticks-callback":r,isMask:t.isMask},null,8,["data","isMask"])]))}},[["__scopeId","data-v-7187c939"]]),Hu=t=>(o.pushScopeId("data-v-20b275a1"),t=t(),o.popScopeId(),t),kv={class:"return-widget"},Cv={class:"return-widget__content"},xv={class:"return-widget__top"},Mv={class:"return-widget__title-wrapper"},Sv=Hu(()=>o.createElementVNode("div",{class:"return-widget__title"},"Return",-1)),vv={class:"return-widget__info"},Tv={class:"return-widget__total-wrapper"},Ov=Hu(()=>o.createElementVNode("div",{class:"return-widget__total-wrapper__title"},"Total",-1)),Dv={class:"return-widget__total-wrapper__total"},Ev={class:"return-widget__points"},$v={class:"return-widget__point"},Pv={class:"return-widget__point__title"},Lv=Hu(()=>o.createElementVNode("div",{class:"return-widget__point__line"},null,-1)),Vv=["innerHTML"],Nv=De({__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,Ot(s.profitFactor),{repeat:5})}. <br /> You earn ${Me(s.isMask,qt(s.profitFactor),{repeat:5,prefix:"$"})} on every ${Me(s.isMask,"$1",{repeat:5,prefix:"$"})} loss.`:`Your profit factor is ${Me(s.isMask,Ot(s.profitFactor),{repeat:5})}. <br/> You loss ${Me(s.isMask,qt(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",kv,[o.createElementVNode("div",Cv,[o.createElementVNode("div",xv,[o.createElementVNode("div",Mv,[Sv,o.createVNode(o.unref(mn),{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",vv,[o.createElementVNode("div",Tv,[Ov,o.createElementVNode("div",Dv,[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(qt)(t.returnPeriod,{isPlus:!0,isFixed:!0}),{repeat:5})),3),s.changeRate?(o.openBlock(),o.createBlock(o.unref(Ul),{key:0,percentage:"",isHidden:t.isMask,delta:s.changeRate},null,8,["isHidden","delta"])):o.createCommentVNode("",!0)])]),o.createElementVNode("div",Ev,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,f=>(o.openBlock(),o.createElementBlock("div",$v,[o.createElementVNode("div",Pv,o.toDisplayString(f.title),1),Lv,o.createElementVNode("div",{class:o.normalizeClass(["return-widget__point__value",f.class?f.class:""])},o.toDisplayString(o.unref(Me)(t.isMask,o.unref(qt)(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,Vv)],2)):o.createCommentVNode("",!0)]))}},[["__scopeId","data-v-20b275a1"]]),Jp=t=>(o.pushScopeId("data-v-d9b5a9e6"),t=t(),o.popScopeId(),t),Bv={class:"top-positions-widget"},Av={class:"top-positions-widget__top"},Rv={class:"top-positions-widget__title-wrapper"},Fv=Jp(()=>o.createElementVNode("div",{class:"top-positions-widget__title"},"Top Positions",-1)),Iv={key:0,class:"top-positions-widget__returns"},Hv={class:"top-positions-widget__return"},zv={class:"top-positions-widget__return__left"},Yv=Jp(()=>o.createElementVNode("div",{class:"top-positions-widget__return__line"},null,-1)),Wv={class:"top-positions-widget__return__pair"},jv={class:"top-positions-widget__return__right"},Zv={class:"top-positions-widget__return__pnl"},Uv=De({__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",Bv,[o.createElementVNode("div",Av,[o.createElementVNode("div",Rv,[Fv,o.createVNode(o.unref(mn),{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",Iv,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.topPositions,a=>(o.openBlock(),o.createElementBlock("div",Hv,[o.createElementVNode("div",zv,[Yv,o.createElementVNode("div",Wv,o.toDisplayString(o.unref(p6)(a.pair)),1)]),o.createElementVNode("div",jv,[o.createElementVNode("div",Zv,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(qt)(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(qt)(a.roi,{isPercentage:!0,isFixed:!0},{repeat:2}))),1)],2)])]))),256))])):(o.openBlock(),o.createBlock(o.unref(Qd),{key:1,title:"No more pair",subtitle:"No data available for the specified period",icon:"coins-add"}))]))}},[["__scopeId","data-v-d9b5a9e6"]]),zu=t=>(o.pushScopeId("data-v-139cca32"),t=t(),o.popScopeId(),t),qv={class:"trade-widget"},Gv={class:"trade-widget__content"},Kv={class:"trade-widget__top"},Xv={class:"trade-widget__title-wrapper"},Jv=zu(()=>o.createElementVNode("div",{class:"trade-widget__title"},"Trades Performance",-1)),Qv={class:"trade-widget__info"},eT={class:"trade-widget__total-wrapper"},tT=zu(()=>o.createElementVNode("div",{class:"trade-widget__total-wrapper__title"},"Total",-1)),nT={class:"trade-widget__total-wrapper__total"},rT={class:"trade-widget__total-wrapper__value"},sT={class:"trade-widget__points"},iT={class:"trade-widget__point"},oT={class:"trade-widget__point__title"},aT=zu(()=>o.createElementVNode("div",{class:"trade-widget__point__line"},null,-1)),lT=De({__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",qv,[o.createElementVNode("div",Gv,[o.createElementVNode("div",Kv,[o.createElementVNode("div",Xv,[Jv,o.createVNode(o.unref(mn),{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",Qv,[o.createElementVNode("div",eT,[tT,o.createElementVNode("div",nT,[o.createElementVNode("div",rT,o.toDisplayString(o.unref(Me)(t.isMask,t.totalTrades,{repeat:5})),1)])]),o.createElementVNode("div",sT,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.tradePoints,a=>(o.openBlock(),o.createElementBlock("div",iT,[o.createElementVNode("div",oT,o.toDisplayString(a.title),1),aT,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"]]),Yu=t=>(o.pushScopeId("data-v-cbc80015"),t=t(),o.popScopeId(),t),cT={class:"winrate-widget"},dT={class:"winrate-widget__winrate"},uT={class:"winrate-widget__title-wrapper"},hT=Yu(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Daily Winrate",-1)),fT={class:"winrate-widget__chart"},mT={class:"winrate-widget__data"},pT={class:"winrate-widget__data_value"},gT=Yu(()=>o.createElementVNode("div",{class:"winrate-widget__data_title"},"Winrate",-1)),_T={class:"winrate-widget__average-rr"},yT={class:"winrate-widget__title-wrapper"},wT=Yu(()=>o.createElementVNode("div",{class:"winrate-widget__title"},"Average RR",-1)),bT=De({__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",cT,[o.createElementVNode("div",dT,[o.createElementVNode("div",uT,[hT,o.createVNode(o.unref(mn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Displays the percentage of your successful positions. ")]),_:1})]),o.createElementVNode("div",fT,[o.renderSlot(e.$slots,"roundSlider",{},void 0,!0),o.createElementVNode("div",mT,[o.createElementVNode("div",pT,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ot)(t.winrate,2)))+"%",1),gT])])]),o.createElementVNode("div",_T,[o.createElementVNode("div",yT,[wT,o.createVNode(o.unref(mn),{alternative:""},{default:o.withCtx(()=>[o.createTextVNode("Risk Reward, defines the ratio of potential profit to loss you can get. ")]),_:1})]),o.createVNode(o.unref(Qp),{avg:t.averageRR,min:t.minRR,max:t.maxRR,isMask:t.isMask},null,8,["avg","min","max","isMask"])])]))}},[["__scopeId","data-v-cbc80015"]]),kT=t=>(o.pushScopeId("data-v-e6d713b2"),t=t(),o.popScopeId(),t),CT={class:"average-rr-line-container"},xT={class:"average-rr-line"},MT={key:0,class:"average-rr-line__progress"},ST=[kT(()=>o.createElementVNode("div",{class:"average-rr-line__dot"},null,-1))],vT={class:"coefficients"},TT={class:"coefficients__value -min"},OT={class:"coefficients__value -avg"},DT={class:"coefficients__value -max"},Qp=De({__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",CT,[o.createElementVNode("div",xT,[t.avg&&t.max?(o.openBlock(),o.createElementBlock("div",MT,ST)):o.createCommentVNode("",!0)]),o.createElementVNode("div",vT,[o.createElementVNode("div",TT,o.toDisplayString(o.unref(Me)(t.isMask,t.min,{repeat:3})),1),o.createElementVNode("div",OT,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ot)(t.avg))),1),o.createElementVNode("div",DT,o.toDisplayString(o.unref(Me)(t.isMask,o.unref(Ot)(t.max),{repeat:3})),1)])]))}},[["__scopeId","data-v-e6d713b2"]]);function e2(t){return o.getCurrentScope()?(o.onScopeDispose(t),!0):!1}function Ho(t){return typeof t=="function"?t():o.unref(t)}const t2=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const ET=Object.prototype.toString,$T=t=>ET.call(t)==="[object Object]",zo=()=>{},Wu=PT();function PT(){var t,e;return t2&&((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 LT(...t){if(t.length!==1)return o.toRef(...t);const e=t[0];return typeof e=="function"?o.readonly(o.customRef(()=>({get:e,set:zo}))):o.ref(e)}function Yo(t){var e;const n=Ho(t);return(e=n==null?void 0:n.$el)!=null?e:n}const r2=t2?window:void 0;function Ml(...t){let e,n,r,s;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,s]=t,e=r2):[e,n,r,s]=t,!e)return zo;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(()=>[Yo(e),Ho(s)],([u,h])=>{if(a(),!u)return;const f=$T(h)?{...h}:h;i.push(...n.flatMap(m=>r.map(g=>l(u,m,g,f))))},{immediate:!0,flush:"post"}),d=()=>{c(),a()};return e2(d),d}let s2=!1;function i2(t,e,n={}){const{window:r=r2,ignore:s=[],capture:i=!0,detectIframe:a=!1}=n;if(!r)return zo;Wu&&!s2&&(s2=!0,Array.from(r.document.body.children).forEach(f=>f.addEventListener("click",zo)),r.document.documentElement.addEventListener("click",zo));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=Yo(m);return g&&(f.target===g||f.composedPath().includes(g))}}),u=[Ml(r,"click",f=>{const m=Yo(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}),Ml(r,"pointerdown",f=>{const m=Yo(t);l=!c(f)&&!!(m&&!f.composedPath().includes(m))},{passive:!0}),a&&Ml(r,"blur",f=>{setTimeout(()=>{var m;const g=Yo(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 o2={[n2.mounted](t,e){const n=!e.modifiers.bubble;if(typeof e.value=="function")t.__onClickOutside_stop=i2(t,e.value,{capture:n});else{const[r,s]=e.value;t.__onClickOutside_stop=i2(t,r,Object.assign({capture:n},s))}},[n2.unmounted](t){t.__onClickOutside_stop()}};function ju(t){return typeof Window<"u"&&t instanceof Window?t.document.documentElement:typeof Document<"u"&&t instanceof Document?t.documentElement:t}function a2(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:a2(n)}}function VT(t){const e=t||window.event,n=e.target;return a2(n)?!1:e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)}const Sl=new WeakMap;function NT(t,e=!1){const n=o.ref(e);let r=null;o.watch(LT(t),a=>{const l=ju(Ho(a));if(l){const c=l;Sl.get(c)||Sl.set(c,c.style.overflow),n.value&&(c.style.overflow="hidden")}},{immediate:!0});const s=()=>{const a=ju(Ho(t));!a||n.value||(Wu&&(r=Ml(a,"touchmove",l=>{VT(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},i=()=>{var a;const l=ju(Ho(t));!l||!n.value||(Wu&&(r==null||r()),l.style.overflow=(a=Sl.get(l))!=null?a:"",Sl.delete(l),n.value=!1)};return e2(i),o.computed({get(){return n.value},set(a){a?s():i()}})}function BT(){let t=!1;const e=o.ref(!1);return(n,r)=>{if(e.value=r.value,t)return;t=!0;const s=NT(n,r.value);o.watch(e,i=>s.value=i)}}BT();//! moment.js
|
|
37
37
|
//! version : 2.30.1
|
|
38
38
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
39
39
|
//! license : MIT
|