mirror of
https://github.com/bewcloud/bewcloud.git
synced 2026-03-11 08:54:49 +00:00
15 lines
163 KiB
JavaScript
15 lines
163 KiB
JavaScript
|
|
/* esm.sh - chart.js@4.5.1 */
|
||
|
|
import{r as ln,a as Wt,e as bi,c as xi,i as z,d as I,b as G,v as A,u as _i,l as hn,f as Ct,g as V,h as Yt,s as dt,j as kt,k as O,_ as As,t as et,m as cn,n as dn,T as U,o as ye,p as ce,H as Q,P as j,q as Cs,w as Os,x as Ot,y as Ls,z as xt,A as un,B as Ut,C as _t,D as Ts,E as Y,F as L,G as fn,I as Es,J as yi,K as gn,L as Rs,M as Is,N as pn,O as Z,Q as E,R as mn,S as X,U as gi,V as vi,W as bn,X as pt,Y as ve,Z as vt,$ as Me,a0 as B,a1 as pi,a2 as H,a3 as Lt,a4 as xn,a5 as _n,a6 as Mi,a7 as ke,a8 as ki,a9 as yn,aa as vn,ab as re,ac as Mn,ad as kn,ae as Si,af as wi,ag as Di,ah as zs,ai as de,aj as Sn,ak as ht,al as ut,am as wn,an as Dn,ao as Pn,ap as Fs,aq as An,ar as Cn,as as On,at as Ln,au as Tn,av as Ve,aw as Xt,ax as En,ay as yt,az as Rn,aA as At,aB as Vs,aC as In,aD as Bs,aE as zn,aF as Fn,aG as at,aH as Ns,aI as Pi,aJ as Vn,aK as De,aL as Ai,aM as mi,aN as Ht,aO as Bn,aP as Nn,aQ as Wn}from"./dist/chunks/helpers.dataset.mjs";import"/public/js/@kurkle/color@^0.3.0?target=denonext";var Be=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=ln.call(globalThis,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let o=i.items,a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},rt=new Be,Ci="transparent",Hn={boolean(n,t,e){return e>.5?t:n},color(n,t,e){let i=xi(n||Ci),s=i.valid&&xi(t||Ci);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}},Ne=class{constructor(t,e,i,s){let o=e[i];s=Wt([t.to,s,o,t.from]);let a=Wt([t.from,o,s]);this._active=!0,this._fn=t.fn||Hn[t.type||typeof a],this._easing=bi[t.easing]||bi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);let s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Wt([t.to,e,s,t.from]),this._from=Wt([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||e<i),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}},ue=class{constructor(t,e){this._chart=t,this._properties=new Map,this
|
||
|
|
`)>-1?n.split(`
|
||
|
|
`):n}function Sr(n,t){let{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:n,label:a,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function fs(n,t){let e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,l=B(t.bodyFont),h=B(t.titleFont),c=B(t.footerFont),d=o.length,u=s.length,f=i.length,g=Y(t.padding),p=g.height,b=0,m=i.reduce((y,_)=>y+_.before.length+_.lines.length+_.after.length,0);if(m+=n.beforeBody.length+n.afterBody.length,d&&(p+=d*h.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),m){let y=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=f*y+(m-f)*l.lineHeight+(m-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*c.lineHeight+(u-1)*t.footerSpacing);let x=0,v=function(y){b=Math.max(b,e.measureText(y).width+x)};return e.save(),e.font=h.string,L(n.title,v),e.font=l.string,L(n.beforeBody.concat(n.afterBody),v),x=t.displayColors?a+2+t.boxPadding:0,L(i,y=>{L(y.before,v),L(y.lines,v),L(y.after,v)}),x=0,e.font=c.string,L(n.footer,v),e.restore(),b+=g.width,{width:b,height:p}}function wr(n,t){let{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Dr(n,t,e,i){let{x:s,width:o}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+o+a>t.width||n==="right"&&s-o-a<0)return!0}function Pr(n,t,e,i){let{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=n,h="center";return i==="center"?h=s<=(r+l)/2?"left":"right":s<=o/2?h="left":s>=a-o/2&&(h="right"),Dr(h,n,t,e)&&(h="center"),h}function gs(n,t,e){let i=e.yAlign||t.yAlign||wr(n,e);return{xAlign:e.xAlign||t.xAlign||Pr(n,t,e,i),yAlign:i}}function Ar(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Cr(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function ps(n,t,e,i){let{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:l}=e,h=s+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=yt(a),g=Ar(t,r),p=Cr(t,l,h);return l==="center"?r==="left"?g+=h:r==="right"&&(g-=h):r==="left"?g-=Math.max(c,u)+s:r==="right"&&(g+=Math.max(d,f)+s),{x:X(g,0,i.width-t.width),y:X(p,0,i.height-t.height)}}function oe(n,t,e){let i=Y(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function ms(n){return st([],lt(n))}function Or(n,t,e){return kt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function bs(n,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}var an={beforeTitle:at,title(n){if(n.length>0){let t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:at,beforeBody:at,beforeLabel:at,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");let e=n.formattedValue;return O(e)||(t+=e),t},labelColor(n){let e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){let e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:at,afterBody:at,beforeFooter:at,footer:at,afterFooter:at};function K(n,t,e,i){let s=n[t].call(e,i);return typeof s>"u"?an[t].call(e,i):s}var _e=class extends it{static positioners=$t;constructor(t){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=t.chart,this.options=t.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.y
|
||
|
|
/*! Bundled license information:
|
||
|
|
|
||
|
|
chart.js/dist/chart.js:
|
||
|
|
(*!
|
||
|
|
* Chart.js v4.5.1
|
||
|
|
* https://www.chartjs.org
|
||
|
|
* (c) 2025 Chart.js Contributors
|
||
|
|
* Released under the MIT License
|
||
|
|
*)
|
||
|
|
*/
|
||
|
|
//chart.mjs.map
|