diff --git a/docs/assets/index-5s5jdt3E.js b/docs/assets/index-Bckhc7XZ.js similarity index 95% rename from docs/assets/index-5s5jdt3E.js rename to docs/assets/index-Bckhc7XZ.js index 5bf71f4..b6a0d6d 100644 --- a/docs/assets/index-5s5jdt3E.js +++ b/docs/assets/index-Bckhc7XZ.js @@ -1125,4 +1125,4 @@ pe.version="2.30.1";bP(qt);pe.fn=le;pe.min=cL;pe.max=uL;pe.now=fL;pe.utc=Di;pe.u * https://www.chartjs.org * (c) 2024 Chart.js Contributors * Released under the MIT License - */class gI{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=yx.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $i=new gI;const wy="transparent",mI={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=cy(e||wy),i=r.valid&&cy(t||wy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class vI{constructor(t,n,r,i){const o=n[r];i=Bu([t.to,i,o,t.from]);const s=Bu([t.from,o,i]);this._active=!0,this._fn=t.fn||mI[t.type||typeof s],this._easing=Xl[t.easing]||Xl.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Bu([t.to,n,i,t.from]),this._from=Bu([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i{const o=t[i];if(!Wt(o))return;const s={};for(const a of n)s[a]=o[a];(xn(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=xI(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&wI(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const h=r.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}o[c]=d=new vI(h,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return $i.add(this._chart,r),!0}}function wI(e,t){const n=[],r=Object.keys(t);for(let i=0;i0||!n&&o<0)return i.index}return null}function Sy(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,u=SI(o,s,r),d=t.length;let h;for(let g=0;gn[r].axis===t).shift()}function MI(e,t){return Ys(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function TI(e,t,n){return Ys(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function pl(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const M1=e=>e==="reset"||e==="none",ky=(e,t)=>t?e:Object.assign({},e),PI=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Lx(n,!0),values:null};class tc{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=_y(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&pl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,h,g,m)=>d==="x"?h:d==="r"?m:g,o=n.xAxisID=Ft(r.xAxisID,E1(t,"x")),s=n.yAxisID=Ft(r.yAxisID,E1(t,"y")),a=n.rAxisID=Ft(r.rAxisID,E1(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),u=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&sy(this._data,this),t._stacked&&pl(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Wt(n)){const i=this._cachedMeta;this._data=CI(n,i)}else if(r!==n){if(r){sy(r,this);const i=this._cachedMeta;pl(i),i._parsed=[]}n&&Object.isExtensible(n)&&sD(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=_y(n.vScale,n),n.stack!==r.stack&&(i=!0,pl(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&Sy(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{xn(i[t])?h=this.parseArrayData(r,i,t,n):Wt(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const g=()=>d[a]===null||c&&d[a]y||d=0;--h)if(!m()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i=0&&tthis.getContext(r,i,n),y=c.resolveNamedOptions(h,g,m,d);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(ky(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,r,n))}const c=new yI(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||M1(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){M1(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!M1(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a0&&this.getParsed(n-1);for(let E=0;E=v){T.skip=!0;continue}const P=this.getParsed(E),L=tn(P[g]),W=T[h]=s.getPixelForValue(P[h],E),I=T[g]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[g],E);T.skip=isNaN(W)||isNaN(I)||L,T.stop=E>0&&Math.abs(P[h]-M[h])>k,y&&(T.parsed=P,T.raw=c.data[E]),d&&(T.options=u||this.resolveDataElementOptions(E,O.active?"active":i)),C||this.updateElement(O,E,T,i),M=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Je(yf,"id","line"),Je(yf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Je(yf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function cs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vm{constructor(t){Je(this,"options");this.options=t||{}}static override(t){Object.assign(vm.prototype,t)}init(){}formats(){return cs()}parse(){return cs()}format(){return cs()}add(){return cs()}diff(){return cs()}startOf(){return cs()}endOf(){return cs()}}var AI={_date:vm};function LI(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?iD:bs;if(r){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(o,t,n-u),h=l(o,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function su(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var II={evaluateInteractionItems:su,modes:{index(e,t,n,r){const i=hs(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?T1(e,i,o,r,s):P1(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=hs(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?T1(e,i,o,r,s):P1(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function My(e,t){return e.filter(n=>Ox.indexOf(n.pos)===-1&&n.box.axis===t)}function ml(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function NI(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;nc.box.fullSize),!0),r=ml(gl(t,"left"),!0),i=ml(gl(t,"right")),o=ml(gl(t,"top"),!0),s=ml(gl(t,"bottom")),a=My(t,"x"),l=My(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:gl(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function Ty(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Rx(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function FI(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Wt(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&Rx(s,o.getPadding());const a=Math.max(0,t.outerWidth-Ty(s,e,"left","right")),l=Math.max(0,t.outerHeight-Ty(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function BI(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function jI(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function Al(e,t,n,r){const i=[];let o,s,a,l,c,u;for(o=0,s=e.length,c=0;o{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,k)=>k.box.options&&k.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},i);Rx(h,Li(r));const g=Object.assign({maxPadding:h,w:o,h:s,x:i.left,y:i.top},i),m=$I(l.concat(c),d);Al(a.fullSize,g,d,m),Al(l,g,d,m),Al(c,g,d,m)&&Al(l,g,d,m),BI(g),Py(a.leftAndTop,g,d,m),g.x+=g.w,g.y+=g.h,Py(a.rightAndBottom,g,d,m),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Qn(a.chartArea,y=>{const k=y.box;Object.assign(k,e.chartArea),k.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Dx{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class HI extends Dx{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const wf="$chartjs",zI={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ay=e=>e===null||e==="";function VI(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[wf]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ay(i)){const o=gy(e,"width");o!==void 0&&(e.width=o)}if(Ay(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=gy(e,"height");o!==void 0&&(e.height=o)}return e}const Ix=iI?{passive:!0}:!1;function YI(e,t,n){e&&e.addEventListener(t,n,Ix)}function KI(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Ix)}function qI(e,t){const n=zI[e.type]||e.type,{x:r,y:i}=hs(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Ed(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function GI(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Ed(a.addedNodes,r),s=s&&!Ed(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function ZI(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Ed(a.removedNodes,r),s=s&&!Ed(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Wc=new Map;let Ly=0;function Nx(){const e=window.devicePixelRatio;e!==Ly&&(Ly=e,Wc.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function QI(e,t){Wc.size||window.addEventListener("resize",Nx),Wc.set(e,t)}function JI(e){Wc.delete(e),Wc.size||window.removeEventListener("resize",Nx)}function XI(e,t,n){const r=e.canvas,i=r&&mm(r);if(!i)return;const o=wx((a,l)=>{const c=i.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return s.observe(i),QI(e,o),s}function A1(e,t,n){n&&n.disconnect(),t==="resize"&&JI(e)}function eN(e,t,n){const r=e.canvas,i=wx(o=>{e.ctx!==null&&n(qI(o,e))},e);return YI(r,t,i),i}class tN extends Dx{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(VI(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[wf])return!1;const r=n[wf].initial;["height","width"].forEach(o=>{const s=r[o];tn(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[wf],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:GI,detach:ZI,resize:XI}[n]||eN;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:A1,detach:A1,resize:A1}[n]||KI)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return rI(t,n,r,i)}isAttached(t){const n=t&&mm(t);return!!(n&&n.isConnected)}}function nN(e){return!gm()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?HI:tN}class Us{constructor(){Je(this,"x");Je(this,"y");Je(this,"active",!1);Je(this,"options");Je(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ic(this.x)&&Ic(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}}Je(Us,"defaults",{}),Je(Us,"defaultRoutes");function rN(e,t){const n=e.options.ticks,r=iN(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?sN(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return aN(t,c,o,s/i),c;const u=oN(o,t,i);if(s>0){let d,h;const g=s>1?Math.round((l-a)/(s-1)):null;for(Vu(t,c,u,tn(g)?0:a-g,a),d=0,h=s-1;di)return l}return Math.max(i,1)}function sN(e){const t=[];let n,r;for(n=0,r=e.length;ne==="left"?"right":e==="right"?"left":e,Oy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Ry=(e,t)=>Math.min(t||e,e);function Dy(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;os+a)))return l}function fN(e,t){Qn(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;or?r:n,r=i&&n>r?n:r,{min:Sr(n,Sr(r,n)),max:Sr(r,Sr(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){hn(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ID(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=_i(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),d+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-vl(t.grid)-n.padding-Iy(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),s=lm(Math.min(Math.asin(_i((u.highest.height+6)/a,-1,1)),Math.asin(_i(l/c,-1,1))-Math.asin(_i(h/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){hn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){hn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=Iy(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=vl(o)+l):(t.height=this.maxHeight,t.width=vl(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=r.padding*2,m=Ro(this.labelRotation),y=Math.cos(m),k=Math.sin(m);if(a){const C=r.mirror?0:k*d.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+C+g)}else{const C=r.mirror?0:y*d.width+k*h.height;t.width=Math.min(this.maxWidth,t.width+C+g)}this._calculatePadding(c,u,k,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,g=0;l?c?(h=i*t.width,g=r*n.height):(h=r*t.height,g=i*n.width):o==="start"?g=n.width:o==="end"?h=t.width:o!=="inner"&&(h=t.width/2,g=n.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){hn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n({width:s[L]||0,height:a[L]||0});return{first:P(0),last:P(n-1),widest:P(O),highest:P(T),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return nD(this._alignToPixels?ls(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&ta*i?a/r:l/i:l*i0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=vl(o),g=[],m=a.setContext(this.getContext()),y=m.display?m.width:0,k=y/2,C=function(fe){return ls(r,fe,y)};let v,w,M,E,O,T,P,L,W,I,R,G;if(s==="top")v=C(this.bottom),T=this.bottom-h,L=v-k,I=C(t.top)+k,G=t.bottom;else if(s==="bottom")v=C(this.top),I=t.top,G=C(t.bottom)-k,T=v+k,L=this.top+h;else if(s==="left")v=C(this.right),O=this.right-h,P=v-k,W=C(t.left)+k,R=t.right;else if(s==="right")v=C(this.left),W=t.left,R=C(t.right)-k,O=v+k,P=this.left+h;else if(n==="x"){if(s==="center")v=C((t.top+t.bottom)/2+.5);else if(Wt(s)){const fe=Object.keys(s)[0],Ce=s[fe];v=C(this.chart.scales[fe].getPixelForValue(Ce))}I=t.top,G=t.bottom,T=v+k,L=T+h}else if(n==="y"){if(s==="center")v=C((t.left+t.right)/2);else if(Wt(s)){const fe=Object.keys(s)[0],Ce=s[fe];v=C(this.chart.scales[fe].getPixelForValue(Ce))}O=v-k,P=O-h,W=t.left,R=t.right}const Z=Ft(i.ticks.maxTicksLimit,d),Y=Math.max(1,Math.ceil(d/Z));for(w=0;w0&&(tt-=ft/2);break}Ze={left:tt,top:Pe,width:ft+je.width,height:st+je.height,color:Y.backdropColor}}k.push({label:M,font:L,textOffset:R,options:{rotation:y,color:Ce,strokeColor:Q,strokeWidth:ue,textAlign:ge,textBaseline:G,translation:[E,O],backdrop:Ze}})}return k}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ro(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");bn.route(o,i,l,a)})}function yN(e){return"id"in e&&"defaults"in e}class wN{constructor(){this.controllers=new Yu(tc,"datasets",!0),this.elements=new Yu(Us,"elements"),this.plugins=new Yu(Object,"plugins"),this.scales=new Yu(Ks,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Qn(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=am(t);hn(r["before"+i],[],r),n[t](r),hn(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;no.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function bN(e){const t={},n=[],r=Object.keys(mi.plugins.items);for(let o=0;o1&&Ny(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Wy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function TN(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Wy(e,"x",n[0])||Wy(e,"y",n[0])}return{}}function PN(e,t){const n=$s[e.type]||{scales:{}},r=t.scales||{},i=np(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Wt(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=rp(s,a,TN(s,e),bn.scales[a.type]),c=EN(l,i),u=n.scales||{};o[s]=Zl(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||np(a,t),u=($s[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kN(d,l),g=s[h+"AxisID"]||h;o[g]=o[g]||Object.create(null),Zl(o[g],[{axis:h},r[g],u[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];Zl(a,[bn.scales[a.type],bn.scale])}),o}function Wx(e){const t=e.options||(e.options={});t.plugins=Ft(t.plugins,{}),t.scales=PN(e,t)}function $x(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function AN(e){return e=e||{},e.data=$x(e.data),Wx(e),e}const $y=new Map,Ux=new Set;function Ku(e,t){let n=$y.get(e);return n||(n=t(),$y.set(e,n),Ux.add(n)),n}const yl=(e,t,n)=>{const r=bd(t,n);r!==void 0&&e.add(r)};class LN{constructor(t){this._config=AN(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=$x(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Wx(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ku(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Ku(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Ku(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Ku(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>yl(l,t,d))),u.forEach(d=>yl(l,i,d)),u.forEach(d=>yl(l,$s[o]||{},d)),u.forEach(d=>yl(l,bn,d)),u.forEach(d=>yl(l,tp,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ux.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,$s[n]||{},bn.datasets[n]||{},{type:n},bn,tp]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=Uy(this._resolverCache,t,i);let l=s;if(RN(s,n)){o.$shared=!1,r=Jo(r)?r():r;const c=this.createResolver(t,r,a);l=Ba(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=Uy(this._resolverCache,t,r);return Wt(n)?Ba(o,n,void 0,i):o}}function Uy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:dm(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const ON=e=>Wt(e)&&Object.getOwnPropertyNames(e).some(t=>Jo(e[t]));function RN(e,t){const{isScriptable:n,isIndexable:r}=kx(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Jo(a)||ON(a))||s&&xn(a))return!0}return!1}var DN="4.4.3";const IN=["top","bottom","left","right","chartArea"];function Fy(e,t){return e==="top"||e==="bottom"||IN.indexOf(e)===-1&&t==="x"}function By(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function jy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),hn(n&&n.onComplete,[e],t)}function NN(e){const t=e.chart,n=t.options.animation;hn(n&&n.onProgress,[e],t)}function Fx(e){return gm()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xf={},Hy=e=>{const t=Fx(e);return Object.values(xf).filter(n=>n.canvas===t).pop()};function WN(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function $N(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function qu(e,t,n){return e.options.clip?e[n]:t[n]}function UN(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:qu(n,t,"left"),right:qu(n,t,"right"),top:qu(r,t,"top"),bottom:qu(r,t,"bottom")}:t}var wo;let kh=(wo=class{static register(...t){mi.add(...t),zy()}static unregister(...t){mi.remove(...t),zy()}constructor(t,n){const r=this.config=new LN(n),i=Fx(t),o=Hy(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||nN(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=HR(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xN,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=lD(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],xf[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$i.listen(this,"complete",jy),$i.listen(this,"progress",NN),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return tn(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return mi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():py(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fy(this.canvas,this.ctx),this}stop(){return $i.stop(this),this}resize(t,n){$i.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,py(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),hn(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qn(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=rp(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qn(o,s=>{const a=s.options,l=a.id,c=rp(l,a),u=Ft(a.type,s.dtype);(a.position===void 0||Fy(a.position,c)!==Fy(s.dposition))&&(a.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const h=mi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qn(i,(s,a)=>{s||delete r[a]}),Qn(r,s=>{Do.configure(this,s,s.options),Do.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;in.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(By("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qn(this.scales,t=>{Do.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ty(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;WN(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Do.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qn(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=UN(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&_x(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&Cx(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Zi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=II.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Ys(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);_d(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),$i.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Qn(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Qn(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qn(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Xv(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=GR(t),c=$N(t,this._lastEvent,r,l);r&&(this._lastEvent=null,hn(o.onHover,[t,a,this],this),l&&hn(o.onClick,[t,a,this],this));const u=!Xv(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}},Je(wo,"defaults",bn),Je(wo,"instances",xf),Je(wo,"overrides",$s),Je(wo,"registry",mi),Je(wo,"version",DN),Je(wo,"getChart",Hy),wo);function zy(){return Qn(kh.instances,e=>e._plugins.invalidate())}function Bx(e,t,n=t){e.lineCap=Ft(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ft(n.borderDash,t.borderDash)),e.lineDashOffset=Ft(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ft(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ft(n.borderWidth,t.borderWidth),e.strokeStyle=Ft(n.borderColor,t.borderColor)}function FN(e,t,n){e.lineTo(n.x,n.y)}function BN(e){return e.stepped?CD:e.tension||e.cubicInterpolationMode==="monotone"?SD:FN}function jx(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),u=ia&&o>a;return{count:r,start:l,loop:t.loop,ilen:c(s+(c?a-M:M))%o,w=()=>{y!==k&&(e.lineTo(u,k),e.lineTo(u,y),e.lineTo(u,C))};for(l&&(g=i[v(0)],e.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=i[v(h)],g.skip)continue;const M=g.x,E=g.y,O=M|0;O===m?(Ek&&(k=E),u=(d*u+M)/++d):(w(),e.lineTo(M,E),m=O,d=0,y=k=E),C=E}w()}function ip(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?HN:jN}function zN(e){return e.stepped?oI:e.tension||e.cubicInterpolationMode==="monotone"?sI:ps}function VN(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Bx(e,t.options),e.stroke(i)}function YN(e,t,n,r){const{segments:i,options:o}=t,s=ip(t);for(const a of i)Bx(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const KN=typeof Path2D=="function";function qN(e,t,n,r){KN&&!t.options.segment?VN(e,t,n,r):YN(e,t,n,r)}class Ll extends Us{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;QD(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=dI(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=cI(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=zN(r);let c,u;for(c=0,u=s.length;ct!=="borderDash"&&t!=="fill"});function Vy(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JN(e,t,n,r){const i=e.indexOf(t);if(i===-1)return QN(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const XN=(e,t)=>e===null?null:_i(Math.round(e),0,t);function Yy(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Je(op,"id","category"),Je(op,"defaults",{ticks:{callback:Yy}});function eW(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,g=o||1,m=u-1,{min:y,max:k}=t,C=!tn(s),v=!tn(a),w=!tn(c),M=(k-y)/(d+1);let E=ry((k-y)/m/g)*g,O,T,P,L;if(E<1e-14&&!C&&!v)return[{value:y},{value:k}];L=Math.ceil(k/E)-Math.floor(y/E),L>m&&(E=ry(L*E/m/g)*g),tn(l)||(O=Math.pow(10,l),E=Math.ceil(E*O)/O),i==="ticks"?(T=Math.floor(y/E)*E,P=Math.ceil(k/E)*E):(T=y,P=k),C&&v&&o&&XR((a-s)/o,E/1e3)?(L=Math.round(Math.min((a-s)/E,u)),E=(a-s)/L,T=s,P=a):w?(T=C?s:T,P=v?a:P,L=c-1,E=(P-T)/L):(L=(P-T)/E,Ql(L,Math.round(L),E/1e3)?L=Math.round(L):L=Math.ceil(L));const W=Math.max(iy(E),iy(T));O=Math.pow(10,tn(l)?W:l),T=Math.round(T*O)/O,P=Math.round(P*O)/O;let I=0;for(C&&(h&&T!==s?(n.push({value:s}),Ta)break;n.push({value:R})}return v&&h&&P!==a?n.length&&Ql(n[n.length-1].value,a,Ky(a,M,e))?n[n.length-1].value=a:n.push({value:a}):(!v||P===a)&&n.push({value:P}),n}function Ky(e,t,{horizontal:n,minRotation:r}){const i=Ro(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Md extends Ks{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return tn(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=Fa(i),c=Fa(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=eW(i,o);return t.bounds==="ticks"&&gx(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return fm(t,this.chart.options.locale,this.options.ticks.format)}}class sp extends Md{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?t:0,this.max=Nn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ro(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Je(sp,"id","linear"),Je(sp,"defaults",{ticks:{callback:Ch.formatters.numeric}});const $c=e=>Math.floor(Oo(e)),us=(e,t)=>Math.pow(10,$c(e)+t);function qy(e){return e/Math.pow(10,$c(e))===1}function Gy(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function tW(e,t){const n=t-e;let r=$c(n);for(;Gy(e,t,r)>10;)r++;for(;Gy(e,t,r)<10;)r--;return Math.min(r,$c(e))}function nW(e,{min:t,max:n}){t=Sr(e.min,t);const r=[],i=$c(t);let o=tW(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,o)),h=Sr(e.min,Math.round((l+u+d*Math.pow(10,o))*s)/s);for(;h=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),h=Math.round((l+u+d*Math.pow(10,o))*s)/s;const g=Sr(e.max,h);return r.push({value:g,major:qy(g),significand:d}),r}class Zy extends Ks{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Md.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Nn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?Math.max(0,t):null,this.max=Nn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nn(this._userMin)&&(this.min=t===us(this.min,0)?us(this.min,-1):us(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(us(r,-1)),s(us(i,1)))),r<=0&&o(us(i,-1)),i<=0&&s(us(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=nW(n,this);return t.bounds==="ticks"&&gx(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":fm(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oo(t),this._valueRange=Oo(this.max)-Oo(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oo(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Je(Zy,"id","logarithmic"),Je(Zy,"defaults",{ticks:{callback:Ch.formatters.logarithmic,major:{enabled:!0}}});function ap(e){const t=e.ticks;if(t.display&&e.display){const n=Li(t.backdropPadding);return Ft(t.font&&t.font.size,bn.font.size)+n.height}return 0}function rW(e,t,n){return n=xn(n)?n:[n],{w:xD(e,t.string,n),h:n.length*t.lineHeight}}function Qy(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function iW(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Sn/o:0;for(let l=0;lt.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.startt.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function sW(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(lm(ei(l.angle+Pr))),u=fW(l.y,a.h,c),d=cW(c),h=uW(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function aW(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(Zi({x:n,y:r},t)||Zi({x:n,y:o},t)||Zi({x:i,y:r},t)||Zi({x:i,y:o},t))}function lW(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:ap(o)/2,additionalAngle:s?Sn/i:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function dW(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!tn(a)){const l=DD(t.borderRadius),c=Li(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,h=o-r+c.width,g=s-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),TD(e,{x:u,y:d,w:h,h:g,radius:l}),e.fill()):e.fillRect(u,d,h,g)}}function hW(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));dW(n,s,o);const a=Xo(s.font),{x:l,y:c,textAlign:u}=o;Nc(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function zx(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ai);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s{const i=hn(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?iW(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ai/(this._pointLabels.length||1),r=this.options.startAngle||0;return ei(t*n+Ro(r))}getDistanceFromCenterForValue(t){if(tn(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(tn(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=i.setContext(h),m=o.setContext(h);pW(this,g,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Xo(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Li(c.backdropPadding);t.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}Nc(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Je(Gu,"id","radialLinear"),Je(Gu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ch.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Je(Gu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Je(Gu,"descriptors",{angleLines:{_fallback:"grid"}});const Eh={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}},vr=Object.keys(Eh);function Jy(e,t){return e-t}function Xy(e,t){if(tn(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Nn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(Ic(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function ew(e,t,n,r){const i=vr.length;for(let o=vr.indexOf(e);o=vr.indexOf(n);o--){const s=vr[o];if(Eh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return vr[n?vr.indexOf(n):0]}function vW(e){for(let t=vr.indexOf(e)+1,n=vr.length;t=t?n[r]:n[i];e[o]=!0}}function yW(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function nw(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=_i(n,0,s),r=_i(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||ew(o.minUnit,n,r,this._getLabelCapacity(n)),a=Ft(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=Ic(l)||l===!0,u={};let d=n,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return hn(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=r[n],g=c&&d&&h&&h.major;return this._adapter.format(t,i||(g?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bs(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bs(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class rw extends Td{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Zu(n,this.min),this._tableRange=Zu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,u;for(s=0,a=t.length;s=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;si-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Zu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Zu(this._table,r*this._tableRange+this._minPos,!0)}}Je(rw,"id","timeseries"),Je(rw,"defaults",Td.defaults);const Vx="label";function iw(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function wW(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Yx(e,t){e.labels=t}function Kx(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vx;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(s=>s[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function xW(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vx;const n={labels:[],datasets:[]};return Yx(n,e.labels),Kx(n,e.datasets,t),n}function bW(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:s,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...h}=e,g=rn.useRef(null),m=rn.useRef(),y=()=>{g.current&&(m.current=new kh(g.current,{type:s,data:xW(a,o),options:l&&{...l},plugins:c}),iw(t,m.current))},k=()=>{iw(t,null),m.current&&(m.current.destroy(),m.current=null)};return rn.useEffect(()=>{!i&&m.current&&l&&wW(m.current,l)},[i,l]),rn.useEffect(()=>{!i&&m.current&&Yx(m.current.config.data,a.labels)},[i,a.labels]),rn.useEffect(()=>{!i&&m.current&&a.datasets&&Kx(m.current.config.data,a.datasets,o)},[i,a.datasets]),rn.useEffect(()=>{m.current&&(i?(k(),setTimeout(y)):m.current.update(d))},[i,l,a.labels,a.datasets,d]),rn.useEffect(()=>{m.current&&(k(),setTimeout(y))},[s]),rn.useEffect(()=>(y(),()=>k()),[]),Ad.createElement("canvas",Object.assign({ref:g,role:"img",height:n,width:r},h),u)}const _W=rn.forwardRef(bW);function CW(e,t){return kh.register(t),rn.forwardRef((n,r)=>Ad.createElement(_W,Object.assign({},n,{ref:r,type:e})))}const SW=CW("line",yf);kh.register(op,sp,bf,Ll,ZN);const kW=()=>{const[e,t]=rn.useState({labels:[],datasets:[{label:"TON/USD",data:[],borderColor:"rgb(83, 91, 242)",tension:.1}]});rn.useEffect(()=>{(async()=>{const o=(await kn("https://api.coingecko.com/api/v3/coins/the-open-network/market_chart?vs_currency=usd&days=120")).data.prices,s=o.map(l=>pe(l[0]).format("DD/MM/YYYY")),a=o.map(l=>l[1]);t({labels:s,datasets:[{...e.datasets[0],data:a}]})})()},[e.datasets]);const n={responsive:!0,plugins:{legend:{},title:{display:!0,text:"TON/USD Exchange Rate (Last 120 Days)"}}};return gt.jsx(SW,{options:n,data:e})},EW=()=>gt.jsx("div",{children:gt.jsx("h2",{children:"$COO ⋅ 98M"})});function MW({avatar:e="./images/coobot_23.jpg",username:t="Coobot fund",gravity:n=0,profit:r="-",volume:i=0}){return gt.jsxs("div",{className:"holders-item",children:[gt.jsx("img",{src:e,alt:t,className:"avatar"}),gt.jsxs("div",{className:"info",children:[gt.jsxs("div",{className:"first_row",children:[gt.jsx("div",{className:"username",children:t}),gt.jsxs("div",{className:"volume",children:[i,"M $COO"]})]}),gt.jsxs("div",{className:"second_row",children:[gt.jsxs("div",{className:"profit",children:[r," USDT"]}),gt.jsxs("div",{className:"gravity",children:[n," %"]})]})]})]})}const Xs=[{avatar:"coobot_23.jpg",username:"Coobot fund",gravity:1,profit:"+23.78",volume:66.6,price:2e6},{avatar:"./yula_g.jpg",username:"Юлия Geraldina",gravity:1,profit:"+2.85",volume:8,price:2e6},{avatar:"./images/veronika.jpg",username:"Veronika Alex",gravity:1,profit:"+2.49",volume:7,price:2e6},{avatar:"images/theclash.jpg",username:"Pavel | theclash",gravity:1,profit:"+2.46",volume:6.9,price:2e6},{avatar:"./assets/rost.jpg",username:"Rost G.",gravity:1,profit:"+1.71",volume:4.8,price:2e6},{avatar:"/images/pep.png",username:"fOgTgc",gravity:1,profit:"+1.68",volume:4.7,price:2e6}];function TW(){let e=0;for(let t=0;tgt.jsx(MW,{...t},n))})]})}function PW(){return gt.jsx(jM,{manifestUrl:"https://rosticom.github.io/coobot-merkaba-tma/tonconnect-manifest.json",uiPreferences:{theme:Xt.DARK},walletsListConfiguration:{includeWallets:[{appName:"safepalwallet",name:"SafePal",imageUrl:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",aboutUrl:"https://www.safepal.com",universalLink:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",jsBridgeKey:"safepalwallet",bridgeUrl:"https://ton-bridge.safepal.com/tonbridge/v1/bridge",platforms:["ios","android","chrome","firefox"]},{appName:"bitgetTonWallet",name:"Bitget Wallet",imageUrl:"https://raw.githubusercontent.com/bitkeepwallet/download/main/logo/png/bitget%20wallet_logo_iOS.png",aboutUrl:"https://web3.bitget.com",deepLink:"bitkeep://",jsBridgeKey:"bitgetTonWallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["ios","android","chrome"],universalLink:"https://bkcode.vip/ton-connect"},{appName:"tonwallet",name:"TON Wallet",imageUrl:"https://wallet.ton.org/assets/ui/qr-logo.png",aboutUrl:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",universalLink:"https://wallet.ton.org/ton-connect",jsBridgeKey:"tonwallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["chrome","android"]}]},actionsConfiguration:{twaReturnUrl:"https://rosticom.github.io/coobot-merkaba-tma/"},children:gt.jsxs("div",{className:"app",children:[gt.jsx(KM,{}),gt.jsx("div",{children:gt.jsx("a",{href:"https://t.me/+JuO8mZMYOnRmN2Ux",children:gt.jsx("img",{src:qM,className:"logo",alt:"Coobot chat"})})}),gt.jsx(EW,{}),gt.jsx(TW,{}),gt.jsx("div",{className:"card",children:gt.jsx("p",{children:gt.jsx("a",{href:"https://t.me/gasPump_bot/app?startapp=eyJyZWZfdXNlcl9pZCI6NTY1ODY0MzE4LCJ0b2tlbl9hZGRyZXNzIjoiRVFEZGlyd3l5YXNST2tvUnc5bUJCekJkUUhjYUFjOUV5OFpoak1TdXRkdHJmU2M1In0",children:"Buy $COO and chill out. Dividend payout on September 1st, 2024."})})}),gt.jsx(kW,{}),gt.jsx(YM,{})]})})}var qx={},Mh={};(function(){var e={},t="";try{t=location.hash.toString()}catch{}var n=l(t),r=C("initParams");if(r)for(var i in r)typeof n[i]>"u"&&(n[i]=r[i]);k("initParams",n);var o=!1,s;try{if(o=window.parent!=null&&window!=window.parent,o){window.addEventListener("message",function(v){if(v.source===window.parent){try{var w=JSON.parse(v.data)}catch{return}if(!(!w||!w.eventType))if(w.eventType=="set_custom_style")v.origin==="https://web.telegram.org"&&(s.innerHTML=w.eventData);else if(w.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else h(w.eventType,w.eventData)}}),s=document.createElement("style"),document.head.appendChild(s);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function a(v){try{return v=v.replace(/\+/g,"%20"),decodeURIComponent(v)}catch{return v}}function l(v){v=v.replace(/^#/,"");var w={};if(!v.length)return w;if(v.indexOf("=")<0&&v.indexOf("?")<0)return w._path=a(v),w;var M=v.indexOf("?");if(M>=0){var E=v.substr(0,M);w._path=a(E),v=v.substr(M+1)}var O=c(v);for(var T in O)w[T]=O[T];return w}function c(v){var w={};if(!v.length)return w;var M=v.split("&"),E,O,T,P;for(E=0;E=0?v+"&"+w:E.length>0?v+"?"+w:v+w}function d(v,w,M){if(w||(w=function(){}),M===void 0&&(M=""),console.log("[Telegram.WebView] > postEvent",v,M),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(v,JSON.stringify(M)),w();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:v,eventData:M})),w();else if(o)try{var E="https://web.telegram.org";E="*",window.parent.postMessage(JSON.stringify({eventType:v,eventData:M}),E),w()}catch(O){w(O)}else w({notAvailable:!0})}function h(v,w){console.log("[Telegram.WebView] < receiveEvent",v,w),g(v,function(M){M(v,w)})}function g(v,w){var M=e[v];if(!(M===void 0||!M.length))for(var E=0;Evt?1:-1;return 0}function ie(D){return ne(c,D)>=0}function Te(D){if(window.Blob)try{return new Blob([D]).size}catch{}for(var N=D.length,F=D.length-1;F>=0;F--){var oe=D.charCodeAt(F);oe>127&&oe<=2047?N++:oe>2047&&oe<=65535&&(N+=2),oe>=56320&&oe<=57343&&F--}return N}var Ae=function(){var D=!1,N={};Object.defineProperty(N,"isVisible",{set:function(ze){at({is_visible:ze})},get:function(){return D},enumerable:!0});var F=null;t.onEvent("back_button_pressed",oe);function oe(){E("backButtonClicked")}function ye(){return{is_visible:D}}function vt(ze){return typeof ze>"u"&&(ze=ye()),JSON.stringify(ze)}function De(){return ie("6.1")?!0:(console.warn("[Telegram.WebApp] BackButton is not supported in version "+c),!1)}function cn(){var ze=ye(),Ht=vt(ze);F!==Ht&&(F=Ht,t.postEvent("web_app_setup_back_button",!1,ze))}function at(ze){return De()&&(typeof ze.is_visible<"u"&&(D=!!ze.is_visible),cn()),N}return N.onClick=function(ze){return De()&&O("backButtonClicked",ze),N},N.offClick=function(ze){return De()&&T("backButtonClicked",ze),N},N.show=function(){return at({is_visible:!0})},N.hide=function(){return at({is_visible:!1})},N}(),Xe=0,It=function(){var D=!1,N=!0,F=!1,oe="CONTINUE",ye=!1,vt=!1,De={};Object.defineProperty(De,"text",{set:function(p){De.setParams({text:p})},get:function(){return oe},enumerable:!0}),Object.defineProperty(De,"color",{set:function(p){De.setParams({color:p})},get:function(){return ye||a.button_color||"#2481cc"},enumerable:!0}),Object.defineProperty(De,"textColor",{set:function(p){De.setParams({text_color:p})},get:function(){return vt||a.button_text_color||"#ffffff"},enumerable:!0}),Object.defineProperty(De,"isVisible",{set:function(p){De.setParams({is_visible:p})},get:function(){return D},enumerable:!0}),Object.defineProperty(De,"isProgressVisible",{get:function(){return F},enumerable:!0}),Object.defineProperty(De,"isActive",{set:function(p){De.setParams({is_active:p})},get:function(){return N},enumerable:!0});var cn=null;t.onEvent("main_button_pressed",Wr);var at=null,ze={};if(n.tgWebAppDebug){at=document.createElement("tg-main-button"),ze={font:"600 14px/18px sans-serif",display:"none",width:"100%",height:"48px",borderRadius:"0",background:"no-repeat right center",position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"15px 20px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var Ht in ze)at.style[Ht]=ze[Ht];document.addEventListener("DOMContentLoaded",function p(x){document.removeEventListener("DOMContentLoaded",p),document.body.appendChild(at),at.addEventListener("click",Wr,!1)})}function Wr(){N&&E("mainButtonClicked")}function qs(){var p=De.color,x=De.textColor;return D?{is_visible:!0,is_active:N,is_progress_visible:F,text:oe,color:p,text_color:x}:{is_visible:!1}}function au(p){return typeof p>"u"&&(p=qs()),JSON.stringify(p)}function tl(){var p=qs(),x=au(p);cn!==x&&(cn=x,t.postEvent("web_app_setup_main_button",!1,p),n.tgWebAppDebug&&or(p))}function or(p){p.is_visible?(at.style.display="block",Xe=48,at.style.opacity=p.is_active?"1":"0.8",at.style.cursor=p.is_active?"pointer":"auto",at.disabled=!p.is_active,at.innerText=p.text,at.style.backgroundImage=p.is_progress_visible?"url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewport%3D%220%200%2048%2048%22%20width%3D%2248px%22%20height%3D%2248px%22%3E%3Ccircle%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222.25%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22%20stroke-dashoffset%3D%22106%22%20r%3D%229%22%20stroke-dasharray%3D%2256.52%22%20rotate%3D%22-90%22%3E%3Canimate%20attributeName%3D%22stroke-dashoffset%22%20attributeType%3D%22XML%22%20dur%3D%22360s%22%20from%3D%220%22%20to%3D%2212500%22%20repeatCount%3D%22indefinite%22%3E%3C%2Fanimate%3E%3CanimateTransform%20attributeName%3D%22transform%22%20attributeType%3D%22XML%22%20type%3D%22rotate%22%20dur%3D%221s%22%20from%3D%22-90%2024%2024%22%20to%3D%22630%2024%2024%22%20repeatCount%3D%22indefinite%22%3E%3C%2FanimateTransform%3E%3C%2Fcircle%3E%3C%2Fsvg%3E')":"none",at.style.backgroundColor=p.color,at.style.color=p.text_color):(at.style.display="none",Xe=0),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=Xe+"px"),Y()}function lu(p){if(typeof p.text<"u"){var x=M(p.text);if(!x.length)throw console.error("[Telegram.WebApp] Main button text is required",p.text),Error("WebAppMainButtonParamInvalid");if(x.length>64)throw console.error("[Telegram.WebApp] Main button text is too long",x),Error("WebAppMainButtonParamInvalid");oe=x}if(typeof p.color<"u")if(p.color===!1||p.color===null)ye=!1;else{var b=B(p.color);if(!b)throw console.error("[Telegram.WebApp] Main button color format is invalid",p.color),Error("WebAppMainButtonParamInvalid");ye=b}if(typeof p.text_color<"u")if(p.text_color===!1||p.text_color===null)vt=!1;else{var f=B(p.text_color);if(!f)throw console.error("[Telegram.WebApp] Main button text color format is invalid",p.text_color),Error("WebAppMainButtonParamInvalid");vt=f}if(typeof p.is_visible<"u"){if(p.is_visible&&!De.text.length)throw console.error("[Telegram.WebApp] Main button text is required"),Error("WebAppMainButtonParamInvalid");D=!!p.is_visible}return typeof p.is_active<"u"&&(N=!!p.is_active),tl(),De}return De.setText=function(p){return De.setParams({text:p})},De.onClick=function(p){return O("mainButtonClicked",p),De},De.offClick=function(p){return T("mainButtonClicked",p),De},De.show=function(){return De.setParams({is_visible:!0})},De.hide=function(){return De.setParams({is_visible:!1})},De.enable=function(){return De.setParams({is_active:!0})},De.disable=function(){return De.setParams({is_active:!1})},De.showProgress=function(p){return N=!!p,F=!0,tl(),De},De.hideProgress=function(){return De.isActive||(N=!0),F=!1,tl(),De},De.setParams=lu,De}(),We=function(){var D=!1,N={};Object.defineProperty(N,"isVisible",{set:function(ze){at({is_visible:ze})},get:function(){return D},enumerable:!0});var F=null;t.onEvent("settings_button_pressed",oe);function oe(){E("settingsButtonClicked")}function ye(){return{is_visible:D}}function vt(ze){return typeof ze>"u"&&(ze=ye()),JSON.stringify(ze)}function De(){return ie("6.10")?!0:(console.warn("[Telegram.WebApp] SettingsButton is not supported in version "+c),!1)}function cn(){var ze=ye(),Ht=vt(ze);F!==Ht&&(F=Ht,t.postEvent("web_app_setup_settings_button",!1,ze))}function at(ze){return De()&&(typeof ze.is_visible<"u"&&(D=!!ze.is_visible),cn()),N}return N.onClick=function(ze){return De()&&O("settingsButtonClicked",ze),N},N.offClick=function(ze){return De()&&T("settingsButtonClicked",ze),N},N.show=function(){return at({is_visible:!0})},N.hide=function(){return at({is_visible:!1})},N}(),Zt=function(){var D={};function N(F){if(!ie("6.1"))return console.warn("[Telegram.WebApp] HapticFeedback is not supported in version "+c),D;if(F.type=="impact"){if(F.impact_style!="light"&&F.impact_style!="medium"&&F.impact_style!="heavy"&&F.impact_style!="rigid"&&F.impact_style!="soft")throw console.error("[Telegram.WebApp] Haptic impact style is invalid",F.impact_style),Error("WebAppHapticImpactStyleInvalid")}else if(F.type=="notification"){if(F.notification_type!="error"&&F.notification_type!="success"&&F.notification_type!="warning")throw console.error("[Telegram.WebApp] Haptic notification type is invalid",F.notification_type),Error("WebAppHapticNotificationTypeInvalid")}else if(F.type!="selection_change")throw console.error("[Telegram.WebApp] Haptic feedback type is invalid",F.type),Error("WebAppHapticFeedbackTypeInvalid");return t.postEvent("web_app_trigger_haptic_feedback",!1,F),D}return D.impactOccurred=function(F){return N({type:"impact",impact_style:F})},D.notificationOccurred=function(F){return N({type:"notification",notification_type:F})},D.selectionChanged=function(){return N({type:"selection_change"})},D}(),ln=function(){var D={};function N(F,oe,ye){if(!ie("6.9"))throw console.error("[Telegram.WebApp] CloudStorage is not supported in version "+c),Error("WebAppMethodUnsupported");return Cr(F,oe,ye),D}return D.setItem=function(F,oe,ye){return N("saveStorageValue",{key:F,value:oe},ye)},D.getItem=function(F,oe){return D.getItems([F],oe?function(ye,vt){ye?oe(ye):oe(null,vt[F])}:null)},D.getItems=function(F,oe){return N("getStorageValues",{keys:F},oe)},D.removeItem=function(F,oe){return D.removeItems([F],oe)},D.removeItems=function(F,oe){return N("deleteStorageValues",{keys:F},oe)},D.getKeys=function(F){return N("getStorageKeys",{},F)},D}(),dr={};function _n(D,N){if(N.slug&&dr[N.slug]){var F=dr[N.slug];delete dr[N.slug],F.callback&&F.callback(N.status),E("invoiceClosed",{url:F.url,status:N.status})}}var En=!1;function ir(D,N){if(En){var F=En;En=!1;var oe=null;typeof N.button_id<"u"&&(oe=N.button_id),F.callback&&F.callback(oe),E("popupClosed",{button_id:oe})}}var Ue=!1;function wt(D,N){if(Ue){var F=Ue,oe=null;typeof N.data<"u"&&(oe=N.data),F.callback&&F.callback(oe)&&(Ue=!1,t.postEvent("web_app_close_scan_qr_popup",!1)),E("qrTextReceived",{data:oe})}}function He(D,N){Ue=!1}function At(D,N){if(N.req_id&&W[N.req_id]){var F=W[N.req_id];delete W[N.req_id];var oe=null;typeof N.data<"u"&&(oe=N.data),F.callback&&F.callback(oe),E("clipboardTextReceived",{data:oe})}}var Rn=!1;function hr(D,N){if(Rn){var F=Rn;Rn=!1,F.callback&&F.callback(N.status=="allowed"),E("writeAccessRequested",{status:N.status})}}function xt(D,N){var F,oe,ye=0,vt=function(){Cr("getRequestedContact",{},function(cn,at){at&&at.length?(clearTimeout(oe),D(at)):(ye+=50,F=setTimeout(vt,ye))})},De=function(){clearTimeout(F),D("")};oe=setTimeout(De,N),vt()}var Re=!1;function Fn(D,N){if(Re){var F=Re;Re=!1;var oe=N.status=="sent",ye={status:N.status};oe?xt(function(vt){if(vt&&vt.length){ye.response=vt,ye.responseUnsafe=e.urlParseQueryString(vt);for(var De in ye.responseUnsafe){var cn=ye.responseUnsafe[De];try{(cn.substr(0,1)=="{"&&cn.substr(-1)=="}"||cn.substr(0,1)=="["&&cn.substr(-1)=="]")&&(ye.responseUnsafe[De]=JSON.parse(cn))}catch{}}}F.callback&&F.callback(oe,ye),E("contactRequested",ye)},3e3):(F.callback&&F.callback(oe,ye),E("contactRequested",ye))}}function Zr(D,N){if(N.req_id&&W[N.req_id]){var F=W[N.req_id];delete W[N.req_id];var oe=null,ye=null;typeof N.result<"u"&&(oe=N.result),typeof N.error<"u"&&(ye=N.error),F.callback&&F.callback(ye,oe)}}function Cr(D,N,F){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method invokeCustomMethod is not supported in version "+c),Error("WebAppMethodUnsupported");var oe=I(16),ye={req_id:oe,method:D,params:N||{}};W[oe]={callback:F},t.postEvent("web_app_invoke_custom_method",!1,ye)}window.Telegram||(window.Telegram={}),Object.defineProperty(i,"initData",{get:function(){return o},enumerable:!0}),Object.defineProperty(i,"initDataUnsafe",{get:function(){return s},enumerable:!0}),Object.defineProperty(i,"version",{get:function(){return c},enumerable:!0}),Object.defineProperty(i,"platform",{get:function(){return u},enumerable:!0}),Object.defineProperty(i,"colorScheme",{get:function(){return l},enumerable:!0}),Object.defineProperty(i,"themeParams",{get:function(){return a},enumerable:!0}),Object.defineProperty(i,"isExpanded",{get:function(){return Z},enumerable:!0}),Object.defineProperty(i,"viewportHeight",{get:function(){return(R===!1?window.innerHeight:R)-Xe},enumerable:!0}),Object.defineProperty(i,"viewportStableHeight",{get:function(){return(G===!1?window.innerHeight:G)-Xe},enumerable:!0}),Object.defineProperty(i,"isClosingConfirmationEnabled",{set:function(D){Ce(D)},get:function(){return fe},enumerable:!0}),Object.defineProperty(i,"headerColor",{set:function(D){Ze(D)},get:function(){return ge()},enumerable:!0}),Object.defineProperty(i,"backgroundColor",{set:function(D){rr(D)},get:function(){return tt()},enumerable:!0}),Object.defineProperty(i,"BackButton",{value:Ae,enumerable:!0}),Object.defineProperty(i,"MainButton",{value:It,enumerable:!0}),Object.defineProperty(i,"SettingsButton",{value:We,enumerable:!0}),Object.defineProperty(i,"HapticFeedback",{value:Zt,enumerable:!0}),Object.defineProperty(i,"CloudStorage",{value:ln,enumerable:!0}),i.setHeaderColor=function(D){i.headerColor=D},i.setBackgroundColor=function(D){i.backgroundColor=D},i.enableClosingConfirmation=function(){i.isClosingConfirmationEnabled=!0},i.disableClosingConfirmation=function(){i.isClosingConfirmationEnabled=!1},i.isVersionAtLeast=function(D){return ie(D)},i.onEvent=function(D,N){O(D,N)},i.offEvent=function(D,N){T(D,N)},i.sendData=function(D){if(!D||!D.length)throw console.error("[Telegram.WebApp] Data is required",D),Error("WebAppDataInvalid");if(Te(D)>4096)throw console.error("[Telegram.WebApp] Data is too long",D),Error("WebAppDataInvalid");t.postEvent("web_app_data_send",!1,{data:D})},i.switchInlineQuery=function(D,N){if(!ie("6.6"))throw console.error("[Telegram.WebApp] Method switchInlineQuery is not supported in version "+c),Error("WebAppMethodUnsupported");if(!n.tgWebAppBotInline)throw console.error("[Telegram.WebApp] Inline mode is disabled for this bot. Read more about inline mode: https://core.telegram.org/bots/inline"),Error("WebAppInlineModeDisabled");if(D=D||"",D.length>256)throw console.error("[Telegram.WebApp] Inline query is too long",D),Error("WebAppInlineQueryInvalid");var F=[];if(N){if(!Array.isArray(N))throw console.error("[Telegram.WebApp] Choose chat types should be an array",N),Error("WebAppInlineChooseChatTypesInvalid");for(var oe={users:1,bots:1,groups:1,channels:1},ye=0;ye64)throw console.error("[Telegram.WebApp] Popup title is too long",F),Error("WebAppPopupParamInvalid");F.length>0&&(vt.title=F)}if(typeof D.message<"u"&&(oe=M(D.message)),!oe.length)throw console.error("[Telegram.WebApp] Popup message is required",D.message),Error("WebAppPopupParamInvalid");if(oe.length>256)throw console.error("[Telegram.WebApp] Popup message is too long",oe),Error("WebAppPopupParamInvalid");if(vt.message=oe,typeof D.buttons<"u"){if(!Array.isArray(D.buttons))throw console.error("[Telegram.WebApp] Popup buttons should be an array",D.buttons),Error("WebAppPopupParamInvalid");for(var De=0;De64))throw console.error("[Telegram.WebApp] Popup button id is too long",ze),Error("WebAppPopupParamInvalid");at.id=ze;var Ht=cn.type;if(typeof Ht>"u"&&(Ht="default"),at.type=Ht,!(Ht=="ok"||Ht=="close"||Ht=="cancel"))if(Ht=="default"||Ht=="destructive"){var Wr="";if(typeof cn.text<"u"&&(Wr=M(cn.text)),!Wr.length)throw console.error("[Telegram.WebApp] Popup button text is required for type "+Ht,cn.text),Error("WebAppPopupParamInvalid");if(Wr.length>64)throw console.error("[Telegram.WebApp] Popup button text is too long",Wr),Error("WebAppPopupParamInvalid");at.text=Wr}else throw console.error("[Telegram.WebApp] Popup button type is invalid",Ht),Error("WebAppPopupParamInvalid");ye.push(at)}}else ye.push({id:"",type:"close"});if(ye.length<1)throw console.error("[Telegram.WebApp] Popup should have at least one button"),Error("WebAppPopupParamInvalid");if(ye.length>3)throw console.error("[Telegram.WebApp] Popup should not have more than 3 buttons"),Error("WebAppPopupParamInvalid");vt.buttons=ye,En={callback:N},t.postEvent("web_app_open_popup",!1,vt)},i.showAlert=function(D,N){i.showPopup({message:D},N?function(){N()}:null)},i.showConfirm=function(D,N){i.showPopup({message:D,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},N?function(F){N(F=="ok")}:null)},i.showScanQrPopup=function(D,N){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method showScanQrPopup is not supported in version "+c),Error("WebAppMethodUnsupported");if(Ue)throw console.error("[Telegram.WebApp] Popup is already opened"),Error("WebAppScanQrPopupOpened");var F="",oe={};if(typeof D.text<"u"){if(F=M(D.text),F.length>64)throw console.error("[Telegram.WebApp] Scan QR popup text is too long",F),Error("WebAppScanQrPopupParamInvalid");F.length>0&&(oe.text=F)}Ue={callback:N},t.postEvent("web_app_open_scan_qr_popup",!1,oe)},i.closeScanQrPopup=function(){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method closeScanQrPopup is not supported in version "+c),Error("WebAppMethodUnsupported");Ue=!1,t.postEvent("web_app_close_scan_qr_popup",!1)},i.readTextFromClipboard=function(D){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method readTextFromClipboard is not supported in version "+c),Error("WebAppMethodUnsupported");var N=I(16),F={req_id:N};W[N]={callback:D},t.postEvent("web_app_read_text_from_clipboard",!1,F)},i.requestWriteAccess=function(D){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method requestWriteAccess is not supported in version "+c),Error("WebAppMethodUnsupported");if(Rn)throw console.error("[Telegram.WebApp] Write access is already requested"),Error("WebAppWriteAccessRequested");Rn={callback:D},t.postEvent("web_app_request_write_access")},i.requestContact=function(D){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method requestContact is not supported in version "+c),Error("WebAppMethodUnsupported");if(Re)throw console.error("[Telegram.WebApp] Contact is already requested"),Error("WebAppContactRequested");Re={callback:D},t.postEvent("web_app_request_phone")},i.invokeCustomMethod=function(D,N,F){Cr(D,N,F)},i.ready=function(){t.postEvent("web_app_ready")},i.expand=function(){t.postEvent("web_app_expand")},i.close=function(){t.postEvent("web_app_close")},window.Telegram.WebApp=i,ft(),q(),Y(),n.tgWebAppShowSettings&&We.show(),window.addEventListener("resize",v),r&&document.addEventListener("click",w),t.onEvent("theme_changed",y),t.onEvent("viewport_changed",C),t.onEvent("invoice_closed",_n),t.onEvent("popup_closed",ir),t.onEvent("qr_text_received",wt),t.onEvent("scan_qr_popup_closed",He),t.onEvent("clipboard_text_received",At),t.onEvent("write_access_requested",hr),t.onEvent("phone_requested",Fn),t.onEvent("custom_method_invoked",Zr),t.postEvent("web_app_request_theme"),t.postEvent("web_app_request_viewport")})();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.WebApp=void 0;var AW=window;Mh.WebApp=AW.Telegram.WebApp;Object.defineProperty(qx,"__esModule",{value:!0});var LW=Mh,OW=qx.default=LW.WebApp;OW.ready();L1.createRoot(document.getElementById("root")).render(gt.jsx(Ad.StrictMode,{children:gt.jsx(PW,{})})); + */class gI{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],s=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=yx.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $i=new gI;const wy="transparent",mI={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=cy(e||wy),i=r.valid&&cy(t||wy);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class vI{constructor(t,n,r,i){const o=n[r];i=Bu([t.to,i,o,t.from]);const s=Bu([t.from,o,i]);this._active=!0,this._fn=t.fn||mI[t.type||typeof s],this._easing=Xl[t.easing]||Xl.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Bu([t.to,n,i,t.from]),this._from=Bu([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||n1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i{const o=t[i];if(!Wt(o))return;const s={};for(const a of n)s[a]=o[a];(xn(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=xI(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&wI(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const h=r.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}o[c]=d=new vI(h,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return $i.add(this._chart,r),!0}}function wI(e,t){const n=[],r=Object.keys(t);for(let i=0;i0||!n&&o<0)return i.index}return null}function Sy(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,c=s.axis,u=SI(o,s,r),d=t.length;let h;for(let g=0;gn[r].axis===t).shift()}function MI(e,t){return Ys(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function TI(e,t,n){return Ys(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function pl(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const M1=e=>e==="reset"||e==="none",ky=(e,t)=>t?e:Object.assign({},e),PI=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Lx(n,!0),values:null};class tc{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=_y(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&pl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,h,g,m)=>d==="x"?h:d==="r"?m:g,o=n.xAxisID=Ft(r.xAxisID,E1(t,"x")),s=n.yAxisID=Ft(r.yAxisID,E1(t,"y")),a=n.rAxisID=Ft(r.rAxisID,E1(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,s,a),u=n.vAxisID=i(l,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&sy(this._data,this),t._stacked&&pl(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Wt(n)){const i=this._cachedMeta;this._data=CI(n,i)}else if(r!==n){if(r){sy(r,this);const i=this._cachedMeta;pl(i),i._parsed=[]}n&&Object.isExtensible(n)&&sD(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=_y(n.vScale,n),n.stack!==r.stack&&(i=!0,pl(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&Sy(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,h;if(this._parsing===!1)r._parsed=i,r._sorted=!0,h=i;else{xn(i[t])?h=this.parseArrayData(r,i,t,n):Wt(i[t])?h=this.parseObjectData(r,i,t,n):h=this.parsePrimitiveData(r,i,t,n);const g=()=>d[a]===null||c&&d[a]y||d=0;--h)if(!m()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i=0&&tthis.getContext(r,i,n),y=c.resolveNamedOptions(h,g,m,d);return y.$shared&&(y.$shared=l,o[s]=Object.freeze(ky(y,l))),y}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,r,n))}const c=new yI(i,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||M1(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){M1(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!M1(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(o),a=t;a0&&this.getParsed(n-1);for(let E=0;E=v){T.skip=!0;continue}const P=this.getParsed(E),L=tn(P[g]),W=T[h]=s.getPixelForValue(P[h],E),I=T[g]=o||L?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[g],E);T.skip=isNaN(W)||isNaN(I)||L,T.stop=E>0&&Math.abs(P[h]-M[h])>k,y&&(T.parsed=P,T.raw=c.data[E]),d&&(T.options=u||this.resolveDataElementOptions(E,O.active?"active":i)),C||this.updateElement(O,E,T,i),M=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Je(yf,"id","line"),Je(yf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Je(yf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function cs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vm{constructor(t){Je(this,"options");this.options=t||{}}static override(t){Object.assign(vm.prototype,t)}init(){}formats(){return cs()}parse(){return cs()}format(){return cs()}add(){return cs()}diff(){return cs()}startOf(){return cs()}endOf(){return cs()}}var AI={_date:vm};function LI(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const l=a._reversePixels?iD:bs;if(r){if(i._sharedOptions){const c=o[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(o,t,n-u),h=l(o,t,n+u);return{lo:d.lo,hi:h.hi}}}}else return l(o,t,n)}return{lo:0,hi:o.length-1}}function su(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=o.length;a{l[s](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:o}var II={evaluateInteractionItems:su,modes:{index(e,t,n,r){const i=hs(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?T1(e,i,o,r,s):P1(e,i,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=hs(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?T1(e,i,o,r,s):P1(e,i,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;un.pos===t)}function My(e,t){return e.filter(n=>Ox.indexOf(n.pos)===-1&&n.box.axis===t)}function ml(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function NI(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;nc.box.fullSize),!0),r=ml(gl(t,"left"),!0),i=ml(gl(t,"right")),o=ml(gl(t,"top"),!0),s=ml(gl(t,"bottom")),a=My(t,"x"),l=My(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(s).concat(a),chartArea:gl(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(s).concat(a)}}function Ty(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Rx(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function FI(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Wt(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&Rx(s,o.getPadding());const a=Math.max(0,t.outerWidth-Ty(s,e,"left","right")),l=Math.max(0,t.outerHeight-Ty(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function BI(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function jI(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function Al(e,t,n,r){const i=[];let o,s,a,l,c,u;for(o=0,s=e.length,c=0;o{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,k)=>k.box.options&&k.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},i);Rx(h,Li(r));const g=Object.assign({maxPadding:h,w:o,h:s,x:i.left,y:i.top},i),m=$I(l.concat(c),d);Al(a.fullSize,g,d,m),Al(l,g,d,m),Al(c,g,d,m)&&Al(l,g,d,m),BI(g),Py(a.leftAndTop,g,d,m),g.x+=g.w,g.y+=g.h,Py(a.rightAndBottom,g,d,m),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Qn(a.chartArea,y=>{const k=y.box;Object.assign(k,e.chartArea),k.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Dx{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class HI extends Dx{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const wf="$chartjs",zI={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ay=e=>e===null||e==="";function VI(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[wf]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ay(i)){const o=gy(e,"width");o!==void 0&&(e.width=o)}if(Ay(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=gy(e,"height");o!==void 0&&(e.height=o)}return e}const Ix=iI?{passive:!0}:!1;function YI(e,t,n){e&&e.addEventListener(t,n,Ix)}function KI(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Ix)}function qI(e,t){const n=zI[e.type]||e.type,{x:r,y:i}=hs(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Ed(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function GI(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Ed(a.addedNodes,r),s=s&&!Ed(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function ZI(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||Ed(a.removedNodes,r),s=s&&!Ed(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Wc=new Map;let Ly=0;function Nx(){const e=window.devicePixelRatio;e!==Ly&&(Ly=e,Wc.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function QI(e,t){Wc.size||window.addEventListener("resize",Nx),Wc.set(e,t)}function JI(e){Wc.delete(e),Wc.size||window.removeEventListener("resize",Nx)}function XI(e,t,n){const r=e.canvas,i=r&&mm(r);if(!i)return;const o=wx((a,l)=>{const c=i.clientWidth;n(a,l),c{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return s.observe(i),QI(e,o),s}function A1(e,t,n){n&&n.disconnect(),t==="resize"&&JI(e)}function eN(e,t,n){const r=e.canvas,i=wx(o=>{e.ctx!==null&&n(qI(o,e))},e);return YI(r,t,i),i}class tN extends Dx{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(VI(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[wf])return!1;const r=n[wf].initial;["height","width"].forEach(o=>{const s=r[o];tn(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[wf],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:GI,detach:ZI,resize:XI}[n]||eN;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:A1,detach:A1,resize:A1}[n]||KI)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return rI(t,n,r,i)}isAttached(t){const n=t&&mm(t);return!!(n&&n.isConnected)}}function nN(e){return!gm()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?HI:tN}class Us{constructor(){Je(this,"x");Je(this,"y");Je(this,"active",!1);Je(this,"options");Je(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Ic(this.x)&&Ic(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}}Je(Us,"defaults",{}),Je(Us,"defaultRoutes");function rN(e,t){const n=e.options.ticks,r=iN(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?sN(t):[],s=o.length,a=o[0],l=o[s-1],c=[];if(s>i)return aN(t,c,o,s/i),c;const u=oN(o,t,i);if(s>0){let d,h;const g=s>1?Math.round((l-a)/(s-1)):null;for(Vu(t,c,u,tn(g)?0:a-g,a),d=0,h=s-1;di)return l}return Math.max(i,1)}function sN(e){const t=[];let n,r;for(n=0,r=e.length;ne==="left"?"right":e==="right"?"left":e,Oy=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Ry=(e,t)=>Math.min(t||e,e);function Dy(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;os+a)))return l}function fN(e,t){Qn(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;or?r:n,r=i&&n>r?n:r,{min:Sr(n,Sr(r,n)),max:Sr(r,Sr(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){hn(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ID(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=_i(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),d+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-vl(t.grid)-n.padding-Iy(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),s=lm(Math.min(Math.asin(_i((u.highest.height+6)/a,-1,1)),Math.asin(_i(l/c,-1,1))-Math.asin(_i(h/c,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){hn(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){hn(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=Iy(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=vl(o)+l):(t.height=this.maxHeight,t.width=vl(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=r.padding*2,m=Ro(this.labelRotation),y=Math.cos(m),k=Math.sin(m);if(a){const C=r.mirror?0:k*d.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+C+g)}else{const C=r.mirror?0:y*d.width+k*h.height;t.width=Math.min(this.maxWidth,t.width+C+g)}this._calculatePadding(c,u,k,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,g=0;l?c?(h=i*t.width,g=r*n.height):(h=r*t.height,g=i*n.width):o==="start"?g=n.width:o==="end"?h=t.width:o!=="inner"&&(h=t.width/2,g=n.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){hn(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n({width:s[L]||0,height:a[L]||0});return{first:P(0),last:P(n-1),widest:P(O),highest:P(T),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return nD(this._alignToPixels?ls(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&ta*i?a/r:l/i:l*i0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=vl(o),g=[],m=a.setContext(this.getContext()),y=m.display?m.width:0,k=y/2,C=function(fe){return ls(r,fe,y)};let v,w,M,E,O,T,P,L,W,I,R,G;if(s==="top")v=C(this.bottom),T=this.bottom-h,L=v-k,I=C(t.top)+k,G=t.bottom;else if(s==="bottom")v=C(this.top),I=t.top,G=C(t.bottom)-k,T=v+k,L=this.top+h;else if(s==="left")v=C(this.right),O=this.right-h,P=v-k,W=C(t.left)+k,R=t.right;else if(s==="right")v=C(this.left),W=t.left,R=C(t.right)-k,O=v+k,P=this.left+h;else if(n==="x"){if(s==="center")v=C((t.top+t.bottom)/2+.5);else if(Wt(s)){const fe=Object.keys(s)[0],Ce=s[fe];v=C(this.chart.scales[fe].getPixelForValue(Ce))}I=t.top,G=t.bottom,T=v+k,L=T+h}else if(n==="y"){if(s==="center")v=C((t.left+t.right)/2);else if(Wt(s)){const fe=Object.keys(s)[0],Ce=s[fe];v=C(this.chart.scales[fe].getPixelForValue(Ce))}O=v-k,P=O-h,W=t.left,R=t.right}const Z=Ft(i.ticks.maxTicksLimit,d),Y=Math.max(1,Math.ceil(d/Z));for(w=0;w0&&(tt-=ft/2);break}Ze={left:tt,top:Pe,width:ft+je.width,height:st+je.height,color:Y.backdropColor}}k.push({label:M,font:L,textOffset:R,options:{rotation:y,color:Ce,strokeColor:Q,strokeWidth:ue,textAlign:ge,textBaseline:G,translation:[E,O],backdrop:Ze}})}return k}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ro(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");bn.route(o,i,l,a)})}function yN(e){return"id"in e&&"defaults"in e}class wN{constructor(){this.controllers=new Yu(tc,"datasets",!0),this.elements=new Yu(Us,"elements"),this.plugins=new Yu(Object,"plugins"),this.scales=new Yu(Ks,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Qn(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=am(t);hn(r["before"+i],[],r),n[t](r),hn(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;no.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function bN(e){const t={},n=[],r=Object.keys(mi.plugins.items);for(let o=0;o1&&Ny(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Wy(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function TN(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Wy(e,"x",n[0])||Wy(e,"y",n[0])}return{}}function PN(e,t){const n=$s[e.type]||{scales:{}},r=t.scales||{},i=np(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Wt(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=rp(s,a,TN(s,e),bn.scales[a.type]),c=EN(l,i),u=n.scales||{};o[s]=Zl(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||np(a,t),u=($s[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=kN(d,l),g=s[h+"AxisID"]||h;o[g]=o[g]||Object.create(null),Zl(o[g],[{axis:h},r[g],u[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];Zl(a,[bn.scales[a.type],bn.scale])}),o}function Wx(e){const t=e.options||(e.options={});t.plugins=Ft(t.plugins,{}),t.scales=PN(e,t)}function $x(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function AN(e){return e=e||{},e.data=$x(e.data),Wx(e),e}const $y=new Map,Ux=new Set;function Ku(e,t){let n=$y.get(e);return n||(n=t(),$y.set(e,n),Ux.add(n)),n}const yl=(e,t,n)=>{const r=bd(t,n);r!==void 0&&e.add(r)};class LN{constructor(t){this._config=AN(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=$x(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Wx(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ku(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Ku(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Ku(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Ku(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>yl(l,t,d))),u.forEach(d=>yl(l,i,d)),u.forEach(d=>yl(l,$s[o]||{},d)),u.forEach(d=>yl(l,bn,d)),u.forEach(d=>yl(l,tp,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ux.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,$s[n]||{},bn.datasets[n]||{},{type:n},bn,tp]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=Uy(this._resolverCache,t,i);let l=s;if(RN(s,n)){o.$shared=!1,r=Jo(r)?r():r;const c=this.createResolver(t,r,a);l=Ba(s,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=Uy(this._resolverCache,t,r);return Wt(n)?Ba(o,n,void 0,i):o}}function Uy(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:dm(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const ON=e=>Wt(e)&&Object.getOwnPropertyNames(e).some(t=>Jo(e[t]));function RN(e,t){const{isScriptable:n,isIndexable:r}=kx(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Jo(a)||ON(a))||s&&xn(a))return!0}return!1}var DN="4.4.3";const IN=["top","bottom","left","right","chartArea"];function Fy(e,t){return e==="top"||e==="bottom"||IN.indexOf(e)===-1&&t==="x"}function By(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function jy(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),hn(n&&n.onComplete,[e],t)}function NN(e){const t=e.chart,n=t.options.animation;hn(n&&n.onProgress,[e],t)}function Fx(e){return gm()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const xf={},Hy=e=>{const t=Fx(e);return Object.values(xf).filter(n=>n.canvas===t).pop()};function WN(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function $N(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function qu(e,t,n){return e.options.clip?e[n]:t[n]}function UN(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:qu(n,t,"left"),right:qu(n,t,"right"),top:qu(r,t,"top"),bottom:qu(r,t,"bottom")}:t}var wo;let kh=(wo=class{static register(...t){mi.add(...t),zy()}static unregister(...t){mi.remove(...t),zy()}constructor(t,n){const r=this.config=new LN(n),i=Fx(t),o=Hy(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||nN(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=HR(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new xN,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=lD(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],xf[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$i.listen(this,"complete",jy),$i.listen(this,"progress",NN),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return tn(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return mi}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():py(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return fy(this.canvas,this.ctx),this}stop(){return $i.stop(this),this}resize(t,n){$i.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,py(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),hn(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qn(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],l=rp(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qn(o,s=>{const a=s.options,l=a.id,c=rp(l,a),u=Ft(a.type,s.dtype);(a.position===void 0||Fy(a.position,c)!==Fy(s.dposition))&&(a.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const h=mi.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qn(i,(s,a)=>{s||delete r[a]}),Qn(r,s=>{Do.configure(this,s,s.options),Do.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;in.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(By("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qn(this.scales,t=>{Do.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ty(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;WN(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Do.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qn(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,i=!r.disabled,o=UN(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&_x(n,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),t.controller.draw(),i&&Cx(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Zi(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=II.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Ys(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);_d(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),$i.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Qn(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Qn(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qn(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Xv(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),l=GR(t),c=$N(t,this._lastEvent,r,l);r&&(this._lastEvent=null,hn(o.onHover,[t,a,this],this),l&&hn(o.onClick,[t,a,this],this));const u=!Xv(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}},Je(wo,"defaults",bn),Je(wo,"instances",xf),Je(wo,"overrides",$s),Je(wo,"registry",mi),Je(wo,"version",DN),Je(wo,"getChart",Hy),wo);function zy(){return Qn(kh.instances,e=>e._plugins.invalidate())}function Bx(e,t,n=t){e.lineCap=Ft(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ft(n.borderDash,t.borderDash)),e.lineDashOffset=Ft(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ft(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ft(n.borderWidth,t.borderWidth),e.strokeStyle=Ft(n.borderColor,t.borderColor)}function FN(e,t,n){e.lineTo(n.x,n.y)}function BN(e){return e.stepped?CD:e.tension||e.cubicInterpolationMode==="monotone"?SD:FN}function jx(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,l=Math.max(i,s),c=Math.min(o,a),u=ia&&o>a;return{count:r,start:l,loop:t.loop,ilen:c(s+(c?a-M:M))%o,w=()=>{y!==k&&(e.lineTo(u,k),e.lineTo(u,y),e.lineTo(u,C))};for(l&&(g=i[v(0)],e.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=i[v(h)],g.skip)continue;const M=g.x,E=g.y,O=M|0;O===m?(Ek&&(k=E),u=(d*u+M)/++d):(w(),e.lineTo(M,E),m=O,d=0,y=k=E),C=E}w()}function ip(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?HN:jN}function zN(e){return e.stepped?oI:e.tension||e.cubicInterpolationMode==="monotone"?sI:ps}function VN(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Bx(e,t.options),e.stroke(i)}function YN(e,t,n,r){const{segments:i,options:o}=t,s=ip(t);for(const a of i)Bx(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const KN=typeof Path2D=="function";function qN(e,t,n,r){KN&&!t.options.segment?VN(e,t,n,r):YN(e,t,n,r)}class Ll extends Us{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;QD(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=dI(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=cI(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],l=zN(r);let c,u;for(c=0,u=s.length;ct!=="borderDash"&&t!=="fill"});function Vy(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function JN(e,t,n,r){const i=e.indexOf(t);if(i===-1)return QN(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const XN=(e,t)=>e===null?null:_i(Math.round(e),0,t);function Yy(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Je(op,"id","category"),Je(op,"defaults",{ticks:{callback:Yy}});function eW(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=e,g=o||1,m=u-1,{min:y,max:k}=t,C=!tn(s),v=!tn(a),w=!tn(c),M=(k-y)/(d+1);let E=ry((k-y)/m/g)*g,O,T,P,L;if(E<1e-14&&!C&&!v)return[{value:y},{value:k}];L=Math.ceil(k/E)-Math.floor(y/E),L>m&&(E=ry(L*E/m/g)*g),tn(l)||(O=Math.pow(10,l),E=Math.ceil(E*O)/O),i==="ticks"?(T=Math.floor(y/E)*E,P=Math.ceil(k/E)*E):(T=y,P=k),C&&v&&o&&XR((a-s)/o,E/1e3)?(L=Math.round(Math.min((a-s)/E,u)),E=(a-s)/L,T=s,P=a):w?(T=C?s:T,P=v?a:P,L=c-1,E=(P-T)/L):(L=(P-T)/E,Ql(L,Math.round(L),E/1e3)?L=Math.round(L):L=Math.ceil(L));const W=Math.max(iy(E),iy(T));O=Math.pow(10,tn(l)?W:l),T=Math.round(T*O)/O,P=Math.round(P*O)/O;let I=0;for(C&&(h&&T!==s?(n.push({value:s}),Ta)break;n.push({value:R})}return v&&h&&P!==a?n.length&&Ql(n[n.length-1].value,a,Ky(a,M,e))?n[n.length-1].value=a:n.push({value:a}):(!v||P===a)&&n.push({value:P}),n}function Ky(e,t,{horizontal:n,minRotation:r}){const i=Ro(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Md extends Ks{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return tn(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=l=>i=n?i:l,a=l=>o=r?o:l;if(t){const l=Fa(i),c=Fa(o);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=eW(i,o);return t.bounds==="ticks"&&gx(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return fm(t,this.chart.options.locale,this.options.ticks.format)}}class sp extends Md{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?t:0,this.max=Nn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ro(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Je(sp,"id","linear"),Je(sp,"defaults",{ticks:{callback:Ch.formatters.numeric}});const $c=e=>Math.floor(Oo(e)),us=(e,t)=>Math.pow(10,$c(e)+t);function qy(e){return e/Math.pow(10,$c(e))===1}function Gy(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function tW(e,t){const n=t-e;let r=$c(n);for(;Gy(e,t,r)>10;)r++;for(;Gy(e,t,r)<10;)r--;return Math.min(r,$c(e))}function nW(e,{min:t,max:n}){t=Sr(e.min,t);const r=[],i=$c(t);let o=tW(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=i>o?Math.pow(10,i):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,o)),h=Sr(e.min,Math.round((l+u+d*Math.pow(10,o))*s)/s);for(;h=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),h=Math.round((l+u+d*Math.pow(10,o))*s)/s;const g=Sr(e.max,h);return r.push({value:g,major:qy(g),significand:d}),r}class Zy extends Ks{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Md.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Nn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?Math.max(0,t):null,this.max=Nn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nn(this._userMin)&&(this.min=t===us(this.min,0)?us(this.min,-1):us(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(us(r,-1)),s(us(i,1)))),r<=0&&o(us(i,-1)),i<=0&&s(us(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=nW(n,this);return t.bounds==="ticks"&&gx(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":fm(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Oo(t),this._valueRange=Oo(this.max)-Oo(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Oo(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Je(Zy,"id","logarithmic"),Je(Zy,"defaults",{ticks:{callback:Ch.formatters.logarithmic,major:{enabled:!0}}});function ap(e){const t=e.ticks;if(t.display&&e.display){const n=Li(t.backdropPadding);return Ft(t.font&&t.font.size,bn.font.size)+n.height}return 0}function rW(e,t,n){return n=xn(n)?n:[n],{w:xD(e,t.string,n),h:n.length*t.lineHeight}}function Qy(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function iW(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Sn/o:0;for(let l=0;lt.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.startt.b&&(l=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function sW(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,l=e.getPointPosition(t,r+i+s,o),c=Math.round(lm(ei(l.angle+Pr))),u=fW(l.y,a.h,c),d=cW(c),h=uW(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function aW(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(Zi({x:n,y:r},t)||Zi({x:n,y:o},t)||Zi({x:i,y:r},t)||Zi({x:i,y:o},t))}function lW(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:ap(o)/2,additionalAngle:s?Sn/i:0};let c;for(let u=0;u270||n<90)&&(e-=t),e}function dW(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!tn(a)){const l=DD(t.borderRadius),c=Li(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,h=o-r+c.width,g=s-i+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),TD(e,{x:u,y:d,w:h,h:g,radius:l}),e.fill()):e.fillRect(u,d,h,g)}}function hW(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));dW(n,s,o);const a=Xo(s.font),{x:l,y:c,textAlign:u}=o;Nc(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function zx(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ai);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s{const i=hn(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?iW(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ai/(this._pointLabels.length||1),r=this.options.startAngle||0;return ei(t*n+Ro(r))}getDistanceFromCenterForValue(t){if(tn(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(tn(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=i.setContext(h),m=o.setContext(h);pW(this,g,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Xo(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Li(c.backdropPadding);t.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}Nc(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Je(Gu,"id","radialLinear"),Je(Gu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ch.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Je(Gu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Je(Gu,"descriptors",{angleLines:{_fallback:"grid"}});const Eh={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}},vr=Object.keys(Eh);function Jy(e,t){return e-t}function Xy(e,t){if(tn(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),Nn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(Ic(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function ew(e,t,n,r){const i=vr.length;for(let o=vr.indexOf(e);o=vr.indexOf(n);o--){const s=vr[o];if(Eh[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return vr[n?vr.indexOf(n):0]}function vW(e){for(let t=vr.indexOf(e)+1,n=vr.length;t=t?n[r]:n[i];e[o]=!0}}function yW(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function nw(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=_i(n,0,s),r=_i(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||ew(o.minUnit,n,r,this._getLabelCapacity(n)),a=Ft(i.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,c=Ic(l)||l===!0,u={};let d=n,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return hn(s,[t,n,r],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=r[n],g=c&&d&&h&&h.major;return this._adapter.format(t,i||(g?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=bs(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=bs(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[i]);const c=s-o;return c?a+(l-a)*(t-o)/c:a}class rw extends Td{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Zu(n,this.min),this._tableRange=Zu(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,l,c,u;for(s=0,a=t.length;s=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;si-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Zu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Zu(this._table,r*this._tableRange+this._minPos,!0)}}Je(rw,"id","timeseries"),Je(rw,"defaults",Td.defaults);const Vx="label";function iw(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function wW(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Yx(e,t){e.labels=t}function Kx(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vx;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(s=>s[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function xW(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vx;const n={labels:[],datasets:[]};return Yx(n,e.labels),Kx(n,e.datasets,t),n}function bW(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:s,data:a,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...h}=e,g=rn.useRef(null),m=rn.useRef(),y=()=>{g.current&&(m.current=new kh(g.current,{type:s,data:xW(a,o),options:l&&{...l},plugins:c}),iw(t,m.current))},k=()=>{iw(t,null),m.current&&(m.current.destroy(),m.current=null)};return rn.useEffect(()=>{!i&&m.current&&l&&wW(m.current,l)},[i,l]),rn.useEffect(()=>{!i&&m.current&&Yx(m.current.config.data,a.labels)},[i,a.labels]),rn.useEffect(()=>{!i&&m.current&&a.datasets&&Kx(m.current.config.data,a.datasets,o)},[i,a.datasets]),rn.useEffect(()=>{m.current&&(i?(k(),setTimeout(y)):m.current.update(d))},[i,l,a.labels,a.datasets,d]),rn.useEffect(()=>{m.current&&(k(),setTimeout(y))},[s]),rn.useEffect(()=>(y(),()=>k()),[]),Ad.createElement("canvas",Object.assign({ref:g,role:"img",height:n,width:r},h),u)}const _W=rn.forwardRef(bW);function CW(e,t){return kh.register(t),rn.forwardRef((n,r)=>Ad.createElement(_W,Object.assign({},n,{ref:r,type:e})))}const SW=CW("line",yf);kh.register(op,sp,bf,Ll,ZN);const kW=()=>{const[e,t]=rn.useState({labels:[],datasets:[{label:"TON/USD",data:[],borderColor:"rgb(83, 91, 242)",tension:.1}]});rn.useEffect(()=>{(async()=>{const o=(await kn("https://api.coingecko.com/api/v3/coins/the-open-network/market_chart?vs_currency=usd&days=120")).data.prices,s=o.map(l=>pe(l[0]).format("DD/MM/YYYY")),a=o.map(l=>l[1]);t({labels:s,datasets:[{...e.datasets[0],data:a}]})})()},[e.datasets]);const n={responsive:!0,plugins:{legend:{},title:{display:!0,text:"TON/USD Exchange Rate (Last 120 Days)"}}};return gt.jsx(SW,{options:n,data:e})},EW=()=>gt.jsx("div",{children:gt.jsx("h2",{children:"$COO ⋅ 98M"})});function MW({avatar:e="./images/coobot_23.jpg",username:t="Coobot fund",gravity:n=0,profit:r="-",volume:i=0}){return gt.jsxs("div",{className:"holders-item",children:[gt.jsx("img",{src:e,alt:t,className:"avatar"}),gt.jsxs("div",{className:"info",children:[gt.jsxs("div",{className:"first_row",children:[gt.jsx("div",{className:"username",children:t}),gt.jsxs("div",{className:"volume",children:[i,"M $COO"]})]}),gt.jsxs("div",{className:"second_row",children:[gt.jsxs("div",{className:"profit",children:[r," USDT"]}),gt.jsxs("div",{className:"gravity",children:[n," %"]})]})]})]})}const Xs=[{avatar:"coobot_23.jpg",username:"Coobot fund",gravity:1,profit:"+23.78",volume:66.6,price:2e6},{avatar:"yula_g.jpg",username:"Юлия Geraldina",gravity:1,profit:"+2.85",volume:8,price:2e6},{avatar:"veronika.jpg",username:"Veronika Alex",gravity:1,profit:"+2.49",volume:7,price:2e6},{avatar:"theclash.jpg",username:"Pavel | theclash",gravity:1,profit:"+2.46",volume:6.9,price:2e6},{avatar:"rost.jpg",username:"Rost G.",gravity:1,profit:"+1.71",volume:4.8,price:2e6},{avatar:"pep.png",username:"fOgTgc",gravity:1,profit:"+1.68",volume:4.7,price:2e6}];function TW(){let e=0;for(let t=0;tgt.jsx(MW,{...t},n))})]})}function PW(){return gt.jsx(jM,{manifestUrl:"https://rosticom.github.io/coobot-merkaba-tma/tonconnect-manifest.json",uiPreferences:{theme:Xt.DARK},walletsListConfiguration:{includeWallets:[{appName:"safepalwallet",name:"SafePal",imageUrl:"https://s.pvcliping.com/web/public_image/SafePal_x288.png",tondns:"",aboutUrl:"https://www.safepal.com",universalLink:"https://link.safepal.io/ton-connect",deepLink:"safepal-tc://",jsBridgeKey:"safepalwallet",bridgeUrl:"https://ton-bridge.safepal.com/tonbridge/v1/bridge",platforms:["ios","android","chrome","firefox"]},{appName:"bitgetTonWallet",name:"Bitget Wallet",imageUrl:"https://raw.githubusercontent.com/bitkeepwallet/download/main/logo/png/bitget%20wallet_logo_iOS.png",aboutUrl:"https://web3.bitget.com",deepLink:"bitkeep://",jsBridgeKey:"bitgetTonWallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["ios","android","chrome"],universalLink:"https://bkcode.vip/ton-connect"},{appName:"tonwallet",name:"TON Wallet",imageUrl:"https://wallet.ton.org/assets/ui/qr-logo.png",aboutUrl:"https://chrome.google.com/webstore/detail/ton-wallet/nphplpgoakhhjchkkhmiggakijnkhfnd",universalLink:"https://wallet.ton.org/ton-connect",jsBridgeKey:"tonwallet",bridgeUrl:"https://bridge.tonapi.io/bridge",platforms:["chrome","android"]}]},actionsConfiguration:{twaReturnUrl:"https://rosticom.github.io/coobot-merkaba-tma/"},children:gt.jsxs("div",{className:"app",children:[gt.jsx(KM,{}),gt.jsx("div",{children:gt.jsx("a",{href:"https://t.me/+JuO8mZMYOnRmN2Ux",children:gt.jsx("img",{src:qM,className:"logo",alt:"Coobot chat"})})}),gt.jsx(EW,{}),gt.jsx(TW,{}),gt.jsx("div",{className:"card",children:gt.jsx("p",{children:gt.jsx("a",{href:"https://t.me/gasPump_bot/app?startapp=eyJyZWZfdXNlcl9pZCI6NTY1ODY0MzE4LCJ0b2tlbl9hZGRyZXNzIjoiRVFEZGlyd3l5YXNST2tvUnc5bUJCekJkUUhjYUFjOUV5OFpoak1TdXRkdHJmU2M1In0",children:"Buy $COO and chill out. Dividend payout on September 1st, 2024."})})}),gt.jsx(kW,{}),gt.jsx(YM,{})]})})}var qx={},Mh={};(function(){var e={},t="";try{t=location.hash.toString()}catch{}var n=l(t),r=C("initParams");if(r)for(var i in r)typeof n[i]>"u"&&(n[i]=r[i]);k("initParams",n);var o=!1,s;try{if(o=window.parent!=null&&window!=window.parent,o){window.addEventListener("message",function(v){if(v.source===window.parent){try{var w=JSON.parse(v.data)}catch{return}if(!(!w||!w.eventType))if(w.eventType=="set_custom_style")v.origin==="https://web.telegram.org"&&(s.innerHTML=w.eventData);else if(w.eventType=="reload_iframe"){try{window.parent.postMessage(JSON.stringify({eventType:"iframe_will_reload"}),"*")}catch{}location.reload()}else h(w.eventType,w.eventData)}}),s=document.createElement("style"),document.head.appendChild(s);try{window.parent.postMessage(JSON.stringify({eventType:"iframe_ready",eventData:{reload_supported:!0}}),"*")}catch{}}}catch{}function a(v){try{return v=v.replace(/\+/g,"%20"),decodeURIComponent(v)}catch{return v}}function l(v){v=v.replace(/^#/,"");var w={};if(!v.length)return w;if(v.indexOf("=")<0&&v.indexOf("?")<0)return w._path=a(v),w;var M=v.indexOf("?");if(M>=0){var E=v.substr(0,M);w._path=a(E),v=v.substr(M+1)}var O=c(v);for(var T in O)w[T]=O[T];return w}function c(v){var w={};if(!v.length)return w;var M=v.split("&"),E,O,T,P;for(E=0;E=0?v+"&"+w:E.length>0?v+"?"+w:v+w}function d(v,w,M){if(w||(w=function(){}),M===void 0&&(M=""),console.log("[Telegram.WebView] > postEvent",v,M),window.TelegramWebviewProxy!==void 0)TelegramWebviewProxy.postEvent(v,JSON.stringify(M)),w();else if(window.external&&"notify"in window.external)window.external.notify(JSON.stringify({eventType:v,eventData:M})),w();else if(o)try{var E="https://web.telegram.org";E="*",window.parent.postMessage(JSON.stringify({eventType:v,eventData:M}),E),w()}catch(O){w(O)}else w({notAvailable:!0})}function h(v,w){console.log("[Telegram.WebView] < receiveEvent",v,w),g(v,function(M){M(v,w)})}function g(v,w){var M=e[v];if(!(M===void 0||!M.length))for(var E=0;Evt?1:-1;return 0}function ie(D){return ne(c,D)>=0}function Te(D){if(window.Blob)try{return new Blob([D]).size}catch{}for(var N=D.length,F=D.length-1;F>=0;F--){var oe=D.charCodeAt(F);oe>127&&oe<=2047?N++:oe>2047&&oe<=65535&&(N+=2),oe>=56320&&oe<=57343&&F--}return N}var Ae=function(){var D=!1,N={};Object.defineProperty(N,"isVisible",{set:function(ze){at({is_visible:ze})},get:function(){return D},enumerable:!0});var F=null;t.onEvent("back_button_pressed",oe);function oe(){E("backButtonClicked")}function ye(){return{is_visible:D}}function vt(ze){return typeof ze>"u"&&(ze=ye()),JSON.stringify(ze)}function De(){return ie("6.1")?!0:(console.warn("[Telegram.WebApp] BackButton is not supported in version "+c),!1)}function cn(){var ze=ye(),Ht=vt(ze);F!==Ht&&(F=Ht,t.postEvent("web_app_setup_back_button",!1,ze))}function at(ze){return De()&&(typeof ze.is_visible<"u"&&(D=!!ze.is_visible),cn()),N}return N.onClick=function(ze){return De()&&O("backButtonClicked",ze),N},N.offClick=function(ze){return De()&&T("backButtonClicked",ze),N},N.show=function(){return at({is_visible:!0})},N.hide=function(){return at({is_visible:!1})},N}(),Xe=0,It=function(){var D=!1,N=!0,F=!1,oe="CONTINUE",ye=!1,vt=!1,De={};Object.defineProperty(De,"text",{set:function(p){De.setParams({text:p})},get:function(){return oe},enumerable:!0}),Object.defineProperty(De,"color",{set:function(p){De.setParams({color:p})},get:function(){return ye||a.button_color||"#2481cc"},enumerable:!0}),Object.defineProperty(De,"textColor",{set:function(p){De.setParams({text_color:p})},get:function(){return vt||a.button_text_color||"#ffffff"},enumerable:!0}),Object.defineProperty(De,"isVisible",{set:function(p){De.setParams({is_visible:p})},get:function(){return D},enumerable:!0}),Object.defineProperty(De,"isProgressVisible",{get:function(){return F},enumerable:!0}),Object.defineProperty(De,"isActive",{set:function(p){De.setParams({is_active:p})},get:function(){return N},enumerable:!0});var cn=null;t.onEvent("main_button_pressed",Wr);var at=null,ze={};if(n.tgWebAppDebug){at=document.createElement("tg-main-button"),ze={font:"600 14px/18px sans-serif",display:"none",width:"100%",height:"48px",borderRadius:"0",background:"no-repeat right center",position:"fixed",left:"0",right:"0",bottom:"0",margin:"0",padding:"15px 20px",textAlign:"center",boxSizing:"border-box",zIndex:"10000"};for(var Ht in ze)at.style[Ht]=ze[Ht];document.addEventListener("DOMContentLoaded",function p(x){document.removeEventListener("DOMContentLoaded",p),document.body.appendChild(at),at.addEventListener("click",Wr,!1)})}function Wr(){N&&E("mainButtonClicked")}function qs(){var p=De.color,x=De.textColor;return D?{is_visible:!0,is_active:N,is_progress_visible:F,text:oe,color:p,text_color:x}:{is_visible:!1}}function au(p){return typeof p>"u"&&(p=qs()),JSON.stringify(p)}function tl(){var p=qs(),x=au(p);cn!==x&&(cn=x,t.postEvent("web_app_setup_main_button",!1,p),n.tgWebAppDebug&&or(p))}function or(p){p.is_visible?(at.style.display="block",Xe=48,at.style.opacity=p.is_active?"1":"0.8",at.style.cursor=p.is_active?"pointer":"auto",at.disabled=!p.is_active,at.innerText=p.text,at.style.backgroundImage=p.is_progress_visible?"url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20viewport%3D%220%200%2048%2048%22%20width%3D%2248px%22%20height%3D%2248px%22%3E%3Ccircle%20cx%3D%2250%25%22%20cy%3D%2250%25%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222.25%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22%20stroke-dashoffset%3D%22106%22%20r%3D%229%22%20stroke-dasharray%3D%2256.52%22%20rotate%3D%22-90%22%3E%3Canimate%20attributeName%3D%22stroke-dashoffset%22%20attributeType%3D%22XML%22%20dur%3D%22360s%22%20from%3D%220%22%20to%3D%2212500%22%20repeatCount%3D%22indefinite%22%3E%3C%2Fanimate%3E%3CanimateTransform%20attributeName%3D%22transform%22%20attributeType%3D%22XML%22%20type%3D%22rotate%22%20dur%3D%221s%22%20from%3D%22-90%2024%2024%22%20to%3D%22630%2024%2024%22%20repeatCount%3D%22indefinite%22%3E%3C%2FanimateTransform%3E%3C%2Fcircle%3E%3C%2Fsvg%3E')":"none",at.style.backgroundColor=p.color,at.style.color=p.text_color):(at.style.display="none",Xe=0),document.documentElement&&(document.documentElement.style.boxSizing="border-box",document.documentElement.style.paddingBottom=Xe+"px"),Y()}function lu(p){if(typeof p.text<"u"){var x=M(p.text);if(!x.length)throw console.error("[Telegram.WebApp] Main button text is required",p.text),Error("WebAppMainButtonParamInvalid");if(x.length>64)throw console.error("[Telegram.WebApp] Main button text is too long",x),Error("WebAppMainButtonParamInvalid");oe=x}if(typeof p.color<"u")if(p.color===!1||p.color===null)ye=!1;else{var b=B(p.color);if(!b)throw console.error("[Telegram.WebApp] Main button color format is invalid",p.color),Error("WebAppMainButtonParamInvalid");ye=b}if(typeof p.text_color<"u")if(p.text_color===!1||p.text_color===null)vt=!1;else{var f=B(p.text_color);if(!f)throw console.error("[Telegram.WebApp] Main button text color format is invalid",p.text_color),Error("WebAppMainButtonParamInvalid");vt=f}if(typeof p.is_visible<"u"){if(p.is_visible&&!De.text.length)throw console.error("[Telegram.WebApp] Main button text is required"),Error("WebAppMainButtonParamInvalid");D=!!p.is_visible}return typeof p.is_active<"u"&&(N=!!p.is_active),tl(),De}return De.setText=function(p){return De.setParams({text:p})},De.onClick=function(p){return O("mainButtonClicked",p),De},De.offClick=function(p){return T("mainButtonClicked",p),De},De.show=function(){return De.setParams({is_visible:!0})},De.hide=function(){return De.setParams({is_visible:!1})},De.enable=function(){return De.setParams({is_active:!0})},De.disable=function(){return De.setParams({is_active:!1})},De.showProgress=function(p){return N=!!p,F=!0,tl(),De},De.hideProgress=function(){return De.isActive||(N=!0),F=!1,tl(),De},De.setParams=lu,De}(),We=function(){var D=!1,N={};Object.defineProperty(N,"isVisible",{set:function(ze){at({is_visible:ze})},get:function(){return D},enumerable:!0});var F=null;t.onEvent("settings_button_pressed",oe);function oe(){E("settingsButtonClicked")}function ye(){return{is_visible:D}}function vt(ze){return typeof ze>"u"&&(ze=ye()),JSON.stringify(ze)}function De(){return ie("6.10")?!0:(console.warn("[Telegram.WebApp] SettingsButton is not supported in version "+c),!1)}function cn(){var ze=ye(),Ht=vt(ze);F!==Ht&&(F=Ht,t.postEvent("web_app_setup_settings_button",!1,ze))}function at(ze){return De()&&(typeof ze.is_visible<"u"&&(D=!!ze.is_visible),cn()),N}return N.onClick=function(ze){return De()&&O("settingsButtonClicked",ze),N},N.offClick=function(ze){return De()&&T("settingsButtonClicked",ze),N},N.show=function(){return at({is_visible:!0})},N.hide=function(){return at({is_visible:!1})},N}(),Zt=function(){var D={};function N(F){if(!ie("6.1"))return console.warn("[Telegram.WebApp] HapticFeedback is not supported in version "+c),D;if(F.type=="impact"){if(F.impact_style!="light"&&F.impact_style!="medium"&&F.impact_style!="heavy"&&F.impact_style!="rigid"&&F.impact_style!="soft")throw console.error("[Telegram.WebApp] Haptic impact style is invalid",F.impact_style),Error("WebAppHapticImpactStyleInvalid")}else if(F.type=="notification"){if(F.notification_type!="error"&&F.notification_type!="success"&&F.notification_type!="warning")throw console.error("[Telegram.WebApp] Haptic notification type is invalid",F.notification_type),Error("WebAppHapticNotificationTypeInvalid")}else if(F.type!="selection_change")throw console.error("[Telegram.WebApp] Haptic feedback type is invalid",F.type),Error("WebAppHapticFeedbackTypeInvalid");return t.postEvent("web_app_trigger_haptic_feedback",!1,F),D}return D.impactOccurred=function(F){return N({type:"impact",impact_style:F})},D.notificationOccurred=function(F){return N({type:"notification",notification_type:F})},D.selectionChanged=function(){return N({type:"selection_change"})},D}(),ln=function(){var D={};function N(F,oe,ye){if(!ie("6.9"))throw console.error("[Telegram.WebApp] CloudStorage is not supported in version "+c),Error("WebAppMethodUnsupported");return Cr(F,oe,ye),D}return D.setItem=function(F,oe,ye){return N("saveStorageValue",{key:F,value:oe},ye)},D.getItem=function(F,oe){return D.getItems([F],oe?function(ye,vt){ye?oe(ye):oe(null,vt[F])}:null)},D.getItems=function(F,oe){return N("getStorageValues",{keys:F},oe)},D.removeItem=function(F,oe){return D.removeItems([F],oe)},D.removeItems=function(F,oe){return N("deleteStorageValues",{keys:F},oe)},D.getKeys=function(F){return N("getStorageKeys",{},F)},D}(),dr={};function _n(D,N){if(N.slug&&dr[N.slug]){var F=dr[N.slug];delete dr[N.slug],F.callback&&F.callback(N.status),E("invoiceClosed",{url:F.url,status:N.status})}}var En=!1;function ir(D,N){if(En){var F=En;En=!1;var oe=null;typeof N.button_id<"u"&&(oe=N.button_id),F.callback&&F.callback(oe),E("popupClosed",{button_id:oe})}}var Ue=!1;function wt(D,N){if(Ue){var F=Ue,oe=null;typeof N.data<"u"&&(oe=N.data),F.callback&&F.callback(oe)&&(Ue=!1,t.postEvent("web_app_close_scan_qr_popup",!1)),E("qrTextReceived",{data:oe})}}function He(D,N){Ue=!1}function At(D,N){if(N.req_id&&W[N.req_id]){var F=W[N.req_id];delete W[N.req_id];var oe=null;typeof N.data<"u"&&(oe=N.data),F.callback&&F.callback(oe),E("clipboardTextReceived",{data:oe})}}var Rn=!1;function hr(D,N){if(Rn){var F=Rn;Rn=!1,F.callback&&F.callback(N.status=="allowed"),E("writeAccessRequested",{status:N.status})}}function xt(D,N){var F,oe,ye=0,vt=function(){Cr("getRequestedContact",{},function(cn,at){at&&at.length?(clearTimeout(oe),D(at)):(ye+=50,F=setTimeout(vt,ye))})},De=function(){clearTimeout(F),D("")};oe=setTimeout(De,N),vt()}var Re=!1;function Fn(D,N){if(Re){var F=Re;Re=!1;var oe=N.status=="sent",ye={status:N.status};oe?xt(function(vt){if(vt&&vt.length){ye.response=vt,ye.responseUnsafe=e.urlParseQueryString(vt);for(var De in ye.responseUnsafe){var cn=ye.responseUnsafe[De];try{(cn.substr(0,1)=="{"&&cn.substr(-1)=="}"||cn.substr(0,1)=="["&&cn.substr(-1)=="]")&&(ye.responseUnsafe[De]=JSON.parse(cn))}catch{}}}F.callback&&F.callback(oe,ye),E("contactRequested",ye)},3e3):(F.callback&&F.callback(oe,ye),E("contactRequested",ye))}}function Zr(D,N){if(N.req_id&&W[N.req_id]){var F=W[N.req_id];delete W[N.req_id];var oe=null,ye=null;typeof N.result<"u"&&(oe=N.result),typeof N.error<"u"&&(ye=N.error),F.callback&&F.callback(ye,oe)}}function Cr(D,N,F){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method invokeCustomMethod is not supported in version "+c),Error("WebAppMethodUnsupported");var oe=I(16),ye={req_id:oe,method:D,params:N||{}};W[oe]={callback:F},t.postEvent("web_app_invoke_custom_method",!1,ye)}window.Telegram||(window.Telegram={}),Object.defineProperty(i,"initData",{get:function(){return o},enumerable:!0}),Object.defineProperty(i,"initDataUnsafe",{get:function(){return s},enumerable:!0}),Object.defineProperty(i,"version",{get:function(){return c},enumerable:!0}),Object.defineProperty(i,"platform",{get:function(){return u},enumerable:!0}),Object.defineProperty(i,"colorScheme",{get:function(){return l},enumerable:!0}),Object.defineProperty(i,"themeParams",{get:function(){return a},enumerable:!0}),Object.defineProperty(i,"isExpanded",{get:function(){return Z},enumerable:!0}),Object.defineProperty(i,"viewportHeight",{get:function(){return(R===!1?window.innerHeight:R)-Xe},enumerable:!0}),Object.defineProperty(i,"viewportStableHeight",{get:function(){return(G===!1?window.innerHeight:G)-Xe},enumerable:!0}),Object.defineProperty(i,"isClosingConfirmationEnabled",{set:function(D){Ce(D)},get:function(){return fe},enumerable:!0}),Object.defineProperty(i,"headerColor",{set:function(D){Ze(D)},get:function(){return ge()},enumerable:!0}),Object.defineProperty(i,"backgroundColor",{set:function(D){rr(D)},get:function(){return tt()},enumerable:!0}),Object.defineProperty(i,"BackButton",{value:Ae,enumerable:!0}),Object.defineProperty(i,"MainButton",{value:It,enumerable:!0}),Object.defineProperty(i,"SettingsButton",{value:We,enumerable:!0}),Object.defineProperty(i,"HapticFeedback",{value:Zt,enumerable:!0}),Object.defineProperty(i,"CloudStorage",{value:ln,enumerable:!0}),i.setHeaderColor=function(D){i.headerColor=D},i.setBackgroundColor=function(D){i.backgroundColor=D},i.enableClosingConfirmation=function(){i.isClosingConfirmationEnabled=!0},i.disableClosingConfirmation=function(){i.isClosingConfirmationEnabled=!1},i.isVersionAtLeast=function(D){return ie(D)},i.onEvent=function(D,N){O(D,N)},i.offEvent=function(D,N){T(D,N)},i.sendData=function(D){if(!D||!D.length)throw console.error("[Telegram.WebApp] Data is required",D),Error("WebAppDataInvalid");if(Te(D)>4096)throw console.error("[Telegram.WebApp] Data is too long",D),Error("WebAppDataInvalid");t.postEvent("web_app_data_send",!1,{data:D})},i.switchInlineQuery=function(D,N){if(!ie("6.6"))throw console.error("[Telegram.WebApp] Method switchInlineQuery is not supported in version "+c),Error("WebAppMethodUnsupported");if(!n.tgWebAppBotInline)throw console.error("[Telegram.WebApp] Inline mode is disabled for this bot. Read more about inline mode: https://core.telegram.org/bots/inline"),Error("WebAppInlineModeDisabled");if(D=D||"",D.length>256)throw console.error("[Telegram.WebApp] Inline query is too long",D),Error("WebAppInlineQueryInvalid");var F=[];if(N){if(!Array.isArray(N))throw console.error("[Telegram.WebApp] Choose chat types should be an array",N),Error("WebAppInlineChooseChatTypesInvalid");for(var oe={users:1,bots:1,groups:1,channels:1},ye=0;ye64)throw console.error("[Telegram.WebApp] Popup title is too long",F),Error("WebAppPopupParamInvalid");F.length>0&&(vt.title=F)}if(typeof D.message<"u"&&(oe=M(D.message)),!oe.length)throw console.error("[Telegram.WebApp] Popup message is required",D.message),Error("WebAppPopupParamInvalid");if(oe.length>256)throw console.error("[Telegram.WebApp] Popup message is too long",oe),Error("WebAppPopupParamInvalid");if(vt.message=oe,typeof D.buttons<"u"){if(!Array.isArray(D.buttons))throw console.error("[Telegram.WebApp] Popup buttons should be an array",D.buttons),Error("WebAppPopupParamInvalid");for(var De=0;De64))throw console.error("[Telegram.WebApp] Popup button id is too long",ze),Error("WebAppPopupParamInvalid");at.id=ze;var Ht=cn.type;if(typeof Ht>"u"&&(Ht="default"),at.type=Ht,!(Ht=="ok"||Ht=="close"||Ht=="cancel"))if(Ht=="default"||Ht=="destructive"){var Wr="";if(typeof cn.text<"u"&&(Wr=M(cn.text)),!Wr.length)throw console.error("[Telegram.WebApp] Popup button text is required for type "+Ht,cn.text),Error("WebAppPopupParamInvalid");if(Wr.length>64)throw console.error("[Telegram.WebApp] Popup button text is too long",Wr),Error("WebAppPopupParamInvalid");at.text=Wr}else throw console.error("[Telegram.WebApp] Popup button type is invalid",Ht),Error("WebAppPopupParamInvalid");ye.push(at)}}else ye.push({id:"",type:"close"});if(ye.length<1)throw console.error("[Telegram.WebApp] Popup should have at least one button"),Error("WebAppPopupParamInvalid");if(ye.length>3)throw console.error("[Telegram.WebApp] Popup should not have more than 3 buttons"),Error("WebAppPopupParamInvalid");vt.buttons=ye,En={callback:N},t.postEvent("web_app_open_popup",!1,vt)},i.showAlert=function(D,N){i.showPopup({message:D},N?function(){N()}:null)},i.showConfirm=function(D,N){i.showPopup({message:D,buttons:[{type:"ok",id:"ok"},{type:"cancel"}]},N?function(F){N(F=="ok")}:null)},i.showScanQrPopup=function(D,N){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method showScanQrPopup is not supported in version "+c),Error("WebAppMethodUnsupported");if(Ue)throw console.error("[Telegram.WebApp] Popup is already opened"),Error("WebAppScanQrPopupOpened");var F="",oe={};if(typeof D.text<"u"){if(F=M(D.text),F.length>64)throw console.error("[Telegram.WebApp] Scan QR popup text is too long",F),Error("WebAppScanQrPopupParamInvalid");F.length>0&&(oe.text=F)}Ue={callback:N},t.postEvent("web_app_open_scan_qr_popup",!1,oe)},i.closeScanQrPopup=function(){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method closeScanQrPopup is not supported in version "+c),Error("WebAppMethodUnsupported");Ue=!1,t.postEvent("web_app_close_scan_qr_popup",!1)},i.readTextFromClipboard=function(D){if(!ie("6.4"))throw console.error("[Telegram.WebApp] Method readTextFromClipboard is not supported in version "+c),Error("WebAppMethodUnsupported");var N=I(16),F={req_id:N};W[N]={callback:D},t.postEvent("web_app_read_text_from_clipboard",!1,F)},i.requestWriteAccess=function(D){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method requestWriteAccess is not supported in version "+c),Error("WebAppMethodUnsupported");if(Rn)throw console.error("[Telegram.WebApp] Write access is already requested"),Error("WebAppWriteAccessRequested");Rn={callback:D},t.postEvent("web_app_request_write_access")},i.requestContact=function(D){if(!ie("6.9"))throw console.error("[Telegram.WebApp] Method requestContact is not supported in version "+c),Error("WebAppMethodUnsupported");if(Re)throw console.error("[Telegram.WebApp] Contact is already requested"),Error("WebAppContactRequested");Re={callback:D},t.postEvent("web_app_request_phone")},i.invokeCustomMethod=function(D,N,F){Cr(D,N,F)},i.ready=function(){t.postEvent("web_app_ready")},i.expand=function(){t.postEvent("web_app_expand")},i.close=function(){t.postEvent("web_app_close")},window.Telegram.WebApp=i,ft(),q(),Y(),n.tgWebAppShowSettings&&We.show(),window.addEventListener("resize",v),r&&document.addEventListener("click",w),t.onEvent("theme_changed",y),t.onEvent("viewport_changed",C),t.onEvent("invoice_closed",_n),t.onEvent("popup_closed",ir),t.onEvent("qr_text_received",wt),t.onEvent("scan_qr_popup_closed",He),t.onEvent("clipboard_text_received",At),t.onEvent("write_access_requested",hr),t.onEvent("phone_requested",Fn),t.onEvent("custom_method_invoked",Zr),t.postEvent("web_app_request_theme"),t.postEvent("web_app_request_viewport")})();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.WebApp=void 0;var AW=window;Mh.WebApp=AW.Telegram.WebApp;Object.defineProperty(qx,"__esModule",{value:!0});var LW=Mh,OW=qx.default=LW.WebApp;OW.ready();L1.createRoot(document.getElementById("root")).render(gt.jsx(Ad.StrictMode,{children:gt.jsx(PW,{})})); diff --git a/docs/index.html b/docs/index.html index d9c4ff2..ae6bb11 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,7 +6,7 @@ Coobot - + diff --git a/assets/pep.png b/docs/pep.png similarity index 100% rename from assets/pep.png rename to docs/pep.png diff --git a/assets/rost.jpg b/docs/rost.jpg similarity index 100% rename from assets/rost.jpg rename to docs/rost.jpg diff --git a/assets/theclash.jpg b/docs/theclash.jpg similarity index 100% rename from assets/theclash.jpg rename to docs/theclash.jpg diff --git a/assets/veronika.jpg b/docs/veronika.jpg similarity index 100% rename from assets/veronika.jpg rename to docs/veronika.jpg diff --git a/assets/yula_g.jpg b/docs/yula_g.jpg similarity index 100% rename from assets/yula_g.jpg rename to docs/yula_g.jpg diff --git a/src/components/HoldersList/images/pep.png b/public/pep.png similarity index 100% rename from src/components/HoldersList/images/pep.png rename to public/pep.png diff --git a/src/components/HoldersList/images/rost.jpg b/public/rost.jpg similarity index 100% rename from src/components/HoldersList/images/rost.jpg rename to public/rost.jpg diff --git a/src/components/HoldersList/images/theclash.jpg b/public/theclash.jpg similarity index 100% rename from src/components/HoldersList/images/theclash.jpg rename to public/theclash.jpg diff --git a/src/components/HoldersList/images/veronika.jpg b/public/veronika.jpg similarity index 100% rename from src/components/HoldersList/images/veronika.jpg rename to public/veronika.jpg diff --git a/src/components/HoldersList/images/yula_g.jpg b/public/yula_g.jpg similarity index 100% rename from src/components/HoldersList/images/yula_g.jpg rename to public/yula_g.jpg diff --git a/src/components/HoldersList/HoldersList.tsx b/src/components/HoldersList/HoldersList.tsx index 4f84824..00c7056 100644 --- a/src/components/HoldersList/HoldersList.tsx +++ b/src/components/HoldersList/HoldersList.tsx @@ -11,7 +11,7 @@ const holdersData = [ price: 2000000 }, { - avatar: './yula_g.jpg', + avatar: 'yula_g.jpg', username: 'Юлия Geraldina', gravity: 1.00, profit: '+2.85', @@ -19,7 +19,7 @@ const holdersData = [ price: 2000000 }, { - avatar: './images/veronika.jpg', + avatar: 'veronika.jpg', username: 'Veronika Alex', gravity: 1.00, profit: '+2.49', @@ -27,7 +27,7 @@ const holdersData = [ price: 2000000 }, { - avatar: 'images/theclash.jpg', + avatar: 'theclash.jpg', username: 'Pavel | theclash', gravity: 1.00, profit: '+2.46', @@ -35,7 +35,7 @@ const holdersData = [ price: 2000000 }, { - avatar: './assets/rost.jpg', + avatar: 'rost.jpg', username: 'Rost G.', gravity: 1.00, profit: '+1.71', @@ -43,7 +43,7 @@ const holdersData = [ price: 2000000 }, { - avatar: '/images/pep.png', + avatar: 'pep.png', username: 'fOgTgc', gravity: 1.00, profit: '+1.68', diff --git a/src/components/HoldersList/images/coobot_23.jpg b/src/components/HoldersList/images/coobot_23.jpg deleted file mode 100644 index 3dd97e3..0000000 Binary files a/src/components/HoldersList/images/coobot_23.jpg and /dev/null differ diff --git a/src/components/HoldersList/images/merkaba_insta.jpeg b/src/components/HoldersList/images/merkaba_insta.jpeg deleted file mode 100644 index 9d4a586..0000000 Binary files a/src/components/HoldersList/images/merkaba_insta.jpeg and /dev/null differ diff --git a/src/components/HoldersList/images/merkaba_tv.jpg b/src/components/HoldersList/images/merkaba_tv.jpg deleted file mode 100644 index ed9c3a8..0000000 Binary files a/src/components/HoldersList/images/merkaba_tv.jpg and /dev/null differ diff --git a/src/components/HoldersList/images/pep copy.png b/src/components/HoldersList/images/pep copy.png deleted file mode 100644 index dc08dc9..0000000 Binary files a/src/components/HoldersList/images/pep copy.png and /dev/null differ