@kong-ui-public/analytics-chart 6.2.3 → 6.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@
15
15
  * Released under the MIT License
16
16
  */class Xp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=pc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var nn=new Xp;const $c="transparent",Gp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=wc(n||$c),s=i.valid&&wc(t||$c);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Kp{constructor(t,e,i,s){const r=e[i];s=Zi([t.to,s,r,t.from]);const o=Zi([t.from,r,s]);this._active=!0,this._fn=t.fn||Gp[t.type||typeof o],this._easing=Ui[t.easing]||Ui.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Zi([t.to,e,s,t.from]),this._from=Zi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Ho{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!lt(t))return;const e=Object.keys(Pt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!lt(r))return;const o={};for(const a of e)o[a]=r[a];(_t(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=Qp(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Zp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const h=i.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}r[c]=d=new Kp(h,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return nn.add(this._chart,i),!0}}function Zp(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Qp(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Uc(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function Jp(n,t,e){if(e===!1)return!1;const i=Uc(n,e),s=Uc(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function tm(n){let t,e,i,s;return lt(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function qc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function Xc(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(i.all)continue;break}c=n.values[l],Et(c)&&(r||t===0||je(t)===je(c))&&(t+=c)}return t}}function em(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function Wo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function nm(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function im(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function sm(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Gc(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function Kc(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=nm(r,o,i),d=t.length;let h;for(let g=0;g<d;++g){const p=t[g],{[l]:b,[c]:w}=p,v=p._stacks||(p._stacks={});h=v[c]=sm(s,u,b),h[a]=w,h._top=Gc(h,o,!0,i.type),h._bottom=Gc(h,o,!1,i.type);const S=h._visualValues||(h._visualValues={});S[a]=w}}function Yo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function rm(n,t){return xn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function om(n,t,e){return xn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Qi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const jo=n=>n==="reset"||n==="none",Zc=(n,t)=>t?n:Object.assign({},n),am=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:qc(e,!0),values:null};class Ne{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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=Wo(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&&Qi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,h,g,p)=>d==="x"?h:d==="r"?p:g,r=e.xAxisID=it(i.xAxisID,Yo(t,"x")),o=e.yAxisID=it(i.yAxisID,Yo(t,"y")),a=e.rAxisID=it(i.rAxisID,Yo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.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 e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&fc(this._data,this),t._stacked&&Qi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(lt(e)){const s=this._cachedMeta;this._data=em(e,s)}else if(i!==e){if(i){fc(i,this);const s=this._cachedMeta;Qi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Ug(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=Wo(e.vScale,e),e.stack!==i.stack&&(s=!0,Qi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(Kc(this,e._parsed),e._stacked=Wo(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{_t(s[t])?h=this.parseArrayData(i,s,t,e):lt(s[t])?h=this.parseObjectData(i,s,t,e):h=this.parsePrimitiveData(i,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=d=h[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&Kc(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(s);let h,g,p;for(h=0,g=s;h<g;++h)p=h+i,d[h]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,h,g;for(u=0,d=s;u<d;++u)h=u+i,g=e[h],c[u]={x:r.parse(mn(g,a),h),y:o.parse(mn(g,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:qc(s,!0),values:e._stacks[t.axis]._visualValues};return Xc(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=Xc(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=am(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=im(a);let h,g;function p(){g=s[h];const b=g[a.axis];return!Et(g[t.axis])||u>b||d<b}for(h=0;h<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++h);if(r){for(h=o-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],Et(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=tm(it(this.options.clip,Jp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=s[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=om(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=rm(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&he(i);if(a)return Zc(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Pt.elements[t]),p=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(h,g,p,d);return b.$shared&&(b.$shared=l,r[o]=Object.freeze(Zc(b,l))),b}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new Ho(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||jo(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){jo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!jo(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"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 e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Qi(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(Ne,"defaults",{}),P(Ne,"datasetElementType",null),P(Ne,"dataElementType",null);function lm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=gc(i.sort((s,r)=>s-r))}return n._cache.$bar}function cm(n){const t=n.iScale,e=lm(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(he(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function um(n,t,e,i){const s=e.barThickness;let r,o;return st(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function dm(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function hm(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function Qc(n,t,e,i){return _t(n)?hm(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Jc(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(Qc(h,d,r,c));return l}function Vo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function fm(n,t,e){return n!==0?je(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function gm(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function pm(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=gm(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[tu(u,o,a,l)]=!0,s=c)),r[tu(s,o,a,l)]=!0,n.borderSkipped=r}function tu(n,t,e,i){return i?(n=mm(n,t,e),n=eu(n,e,t)):n=eu(n,t,e),n}function mm(n,t,e){return n===t?e:n===e?t:n}function eu(n,t,e){return n==="start"?t:n==="end"?e:n}function ym(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ji extends Ne{parsePrimitiveData(t,e,i,s){return Jc(t,e,i,s)}parseArrayData(t,e,i,s){return Jc(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let h,g,p,b;for(h=i,g=i+s;h<g;++h)b=e[h],p={},p[r.axis]=r.parse(mn(b,c),h),d.push(Qc(mn(b,u),p,o,h));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Vo(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),b=r||st(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),w=this._calculateBarIndexPixels(g,u),v=(p._stacks||{})[a.axis],S={horizontal:c,base:b.base,enableBorderRadius:!v||Vo(p._custom)||o===v._top||o===v._bottom,x:c?b.head:w.center,y:c?w.center:b.head,height:c?w.size:Math.abs(b.size),width:c?Math.abs(b.size):w.size};h&&(S.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const D=S.options||t[g].options;pm(S,D,v,o),ym(S,D,u.ratio),this.updateElement(t[g],g,S,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=u=>{const d=u._parsed.find(g=>g[i.axis]===l),h=d&&d[u.vScale.axis];if(st(h)||isNaN(h))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||o.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||cm(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Vo(c);let d=l[e.axis],h=0,g=i?this.applyStack(e,l,i):d,p,b;g!==d&&(h=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&je(d)!==je(c.barEnd)&&(h=0),h+=d);const w=!st(r)&&!u?r:h;let v=e.getPixelForValue(w);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(h+g):p=v,b=p-v,Math.abs(b)<o){b=fm(b,e,a)*o,d===a&&(v-=b/2);const S=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),k=Math.min(S,D),C=Math.max(S,D);v=Math.max(Math.min(v,C),k),p=v+b,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(a)){const S=je(b)*e.getLineWidthForValue(a)/2;v+=S,b-=S}return{size:b,base:v,head:p,center:p+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=it(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?dm(t,e,s,c):um(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}P(Ji,"id","bar"),P(Ji,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(Ji,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ar extends Ne{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=it(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=it(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,d=a.axis;for(let h=e;h<e+i;h++){const g=t[h],p=!r&&this.getParsed(h),b={},w=b[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),v=b[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);b.skip=isNaN(w)||isNaN(v),c&&(b.options=l||this.resolveDataElementOptions(h,g.active?"active":s),r&&(b.options.radius=0)),this.updateElement(g,h,b,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=it(i&&i._custom,r),s}}P(ar,"id","bubble"),P(ar,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(ar,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function bm(n,t,e){let i=1,s=1,r=0,o=0;if(t<kt){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),g=(D,k,C)=>$i(D,a,l,!0)?1:Math.max(k,k*e,C,C*e),p=(D,k,C)=>$i(D,a,l,!0)?-1:Math.min(k,k*e,C,C*e),b=g(0,c,d),w=g(Ot,u,h),v=p(dt,c,d),S=p(dt+Ot,u,h);i=(b-v)/2,s=(w-S)/2,r=-(b+v)/2,o=-(w+S)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class sn extends Ne{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(lt(i[t])){const{key:l="value"}=this._parsing;r=c=>+mn(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Yt(this.options.rotation-90)}_getCircumference(){return Yt(this.options.circumference)}_getRotationExtents(){let t=kt,e=-kt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(Rg(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:g,offsetX:p,offsetY:b}=bm(d,u,l),w=(i.width-o)/h,v=(i.height-o)/g,S=Math.max(Math.min(w,v)/2,0),D=rc(this.options.radius,S),k=Math.max(D*l,0),C=(D-k)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=b*D,s.total=this.calculateTotal(),this.outerRadius=D-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/kt)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,h=r&&c.animateScale,g=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:b,includeOptions:w}=this._getSharedOptions(e,s);let v=this._getRotation(),S;for(S=0;S<e;++S)v+=this._circumference(S,r);for(S=e;S<e+i;++S){const D=this._circumference(S,r),k=t[S],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:p,innerRadius:g};w&&(C.options=b||this.resolveDataElementOptions(S,k.active?"active":s)),v+=D,this.updateElement(k,S,C,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?kt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=qi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(it(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(sn,"id","doughnut"),P(sn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),P(sn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(sn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ts extends Ne{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=yc(e,s,o);this._drawStart=a,this._drawCount=l,bc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),h=o.axis,g=a.axis,{spanGaps:p,segment:b}=this.options,w=bn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",S=e+i,D=t.length;let k=e>0&&this.getParsed(e-1);for(let C=0;C<D;++C){const R=t[C],E=v?R:{};if(C<e||C>=S){E.skip=!0;continue}const m=this.getParsed(C),_=st(m[g]),T=E[h]=o.getPixelForValue(m[h],C),A=E[g]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,m,l):m[g],C);E.skip=isNaN(T)||isNaN(A)||_,E.stop=C>0&&Math.abs(m[h]-k[h])>w,b&&(E.parsed=m,E.raw=c.data[C]),d&&(E.options=u||this.resolveDataElementOptions(C,R.active?"active":s)),v||this.updateElement(R,C,E,s),k=m}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(ts,"id","line"),P(ts,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(ts,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class es extends Ne{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=qi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return Rc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*dt;let g=h,p;const b=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,b);for(p=e;p<e+i;p++){const w=t[p];let v=g,S=g+this._computeAngle(p,s,b),D=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=S,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=S=h));const k={x:u,y:d,innerRadius:0,outerRadius:D,startAngle:v,endAngle:S,options:this.resolveDataElementOptions(p,w.active?"active":s)};this.updateElement(w,p,k,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Yt(this.resolveDataElementOptions(t,e).angle||i):0}}P(es,"id","polarArea"),P(es,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(es,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class $o extends sn{}P($o,"id","pie"),P($o,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class lr extends Ne{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Rc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,h=o?r.yCenter:u.y,g={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,a,g,s)}}}P(lr,"id","radar"),P(lr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(lr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class cr extends Ne{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=yc(e,i,s);if(this._drawStart=r,this._drawCount=o,bc(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),h=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:b,segment:w}=this.options,v=bn(b)?b:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let k=e;k<e+i;++k){const C=t[k],R=this.getParsed(k),E=S?C:{},m=st(R[p]),_=E[g]=o.getPixelForValue(R[g],k),T=E[p]=r||m?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,R,l):R[p],k);E.skip=isNaN(_)||isNaN(T)||m,E.stop=k>0&&Math.abs(R[g]-D[g])>v,w&&(E.parsed=R,E.raw=c.data[k]),h&&(E.options=d||this.resolveDataElementOptions(k,C.active?"active":s)),S||this.updateElement(C,k,E,s),D=R}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}P(cr,"id","scatter"),P(cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var _m=Object.freeze({__proto__:null,BarController:Ji,BubbleController:ar,DoughnutController:sn,LineController:ts,PieController:$o,PolarAreaController:es,RadarController:lr,ScatterController:cr});function $n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Uo{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(Uo.prototype,t)}init(){}formats(){return $n()}parse(){return $n()}format(){return $n()}add(){return $n()}diff(){return $n()}startOf(){return $n()}endOf(){return $n()}}var nu={_date:Uo};function xm(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Vg:tn;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),h=l(r,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function ns(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:h}=xm(r[a],t,o,s);for(let g=d;g<=h;++g){const p=u[g];p.skip||i(p,c,g)}}}function wm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function qo(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||ns(n,e,t,function(a,l,c){!s&&!en(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function vm(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=Js(o,{x:t.x,y:t.y});$i(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return ns(n,e,t,r),s}function Mm(n,t,e,i,s,r){let o=[];const a=wm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const w=a(t,p);w<l?(o=[{element:u,datasetIndex:d,index:h}],l=w):w===l&&o.push({element:u,datasetIndex:d,index:h})}return ns(n,e,t,c),o}function Xo(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?vm(n,t,e,s):Mm(n,t,e,i,s,r)}function iu(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return ns(n,e,t,(l,c,u)=>{l[o]&&l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Go={evaluateInteractionItems:ns,modes:{index(n,t,e,i){const s=wn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?qo(n,s,r,i,o):Xo(n,s,r,!1,i,o),l=[];return a.length?(n.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(n,t,e,i){const s=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?qo(n,s,r,i,o):Xo(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return qo(n,s,r,i,o)},nearest(n,t,e,i){const s=wn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Xo(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=wn(t,n);return iu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=wn(t,n);return iu(n,s,"y",e.intersect,i)}}};const su=["left","top","right","bottom"];function is(n,t){return n.filter(e=>e.pos===t)}function ru(n,t){return n.filter(e=>su.indexOf(e.pos)===-1&&e.box.axis===t)}function ss(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function Sm(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function km(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!su.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Dm(n,t){const e=km(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function Tm(n){const t=Sm(n),e=ss(t.filter(c=>c.box.fullSize),!0),i=ss(is(t,"left"),!0),s=ss(is(t,"right")),r=ss(is(t,"top"),!0),o=ss(is(t,"bottom")),a=ru(t,"x"),l=ru(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:is(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function ou(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function au(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Cm(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!lt(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&au(o,r.getPadding());const a=Math.max(0,t.outerWidth-ou(o,n,"left","right")),l=Math.max(0,t.outerHeight-ou(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Om(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Pm(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function rs(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Pm(a.horizontal,t));const{same:d,other:h}=Cm(t,e,a,i);c|=d&&s.length,u=u||h,l.fullSize||s.push(a)}return c&&rs(s,t,e,i)||u}function ur(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function lu(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,h=c.size||l.height;he(c.start)&&(o=c.start),l.fullSize?ur(l,s.left,o,e.outerWidth-s.right-s.left,h):ur(l,t.left+c.placed,o,d,h),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,h=c.size||l.width;he(c.start)&&(r=c.start),l.fullSize?ur(l,r,s.top,h,e.outerHeight-s.bottom-s.top):ur(l,r,t.top+c.placed,h,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var ne={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=jt(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Tm(n.boxes),l=a.vertical,c=a.horizontal;wt(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,w)=>w.box.options&&w.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),h=Object.assign({},s);au(h,jt(i));const g=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=Dm(l.concat(c),d);rs(a.fullSize,g,d,p),rs(l,g,d,p),rs(c,g,d,p)&&rs(l,g,d,p),Om(g),lu(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,lu(a.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},wt(a.chartArea,b=>{const w=b.box;Object.assign(w,n.chartArea),w.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class cu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Em extends cu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const dr="$chartjs",Am={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},uu=n=>n===null||n==="";function Rm(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[dr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",uu(s)){const r=Nc(n,"width");r!==void 0&&(n.width=r)}if(uu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=Nc(n,"height");r!==void 0&&(n.height=r)}return n}const du=Fp?{passive:!0}:!1;function Lm(n,t,e){n&&n.addEventListener(t,e,du)}function Im(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,du)}function Nm(n,t){const e=Am[n.type]||n.type,{x:i,y:s}=wn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function hr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Fm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||hr(a.addedNodes,i),o=o&&!hr(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function zm(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||hr(a.removedNodes,i),o=o&&!hr(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const os=new Map;let hu=0;function fu(){const n=window.devicePixelRatio;n!==hu&&(hu=n,os.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Bm(n,t){os.size||window.addEventListener("resize",fu),os.set(n,t)}function Hm(n){os.delete(n),os.size||window.removeEventListener("resize",fu)}function Wm(n,t,e){const i=n.canvas,s=i&&Bo(i);if(!s)return;const r=mc((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),Bm(n,r),o}function Ko(n,t,e){e&&e.disconnect(),t==="resize"&&Hm(n)}function Ym(n,t,e){const i=n.canvas,s=mc(r=>{n.ctx!==null&&e(Nm(r,n))},n);return Lm(i,t,s),s}class jm extends cu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Rm(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[dr])return!1;const i=e[dr].initial;["height","width"].forEach(r=>{const o=i[r];st(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[dr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Fm,detach:zm,resize:Wm}[e]||Ym;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Ko,detach:Ko,resize:Ko}[e]||Im)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Np(t,e,i,s)}isAttached(t){const e=t&&Bo(t);return!!(e&&e.isConnected)}}function Vm(n){return!zo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Em:jm}class Gt{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return bn(this.x)&&bn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}P(Gt,"defaults",{}),P(Gt,"defaultRoutes");function $m(n,t){const e=n.options.ticks,i=Um(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Xm(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return Gm(t,c,r,o/s),c;const u=qm(r,t,s);if(o>0){let d,h;const g=o>1?Math.round((l-a)/(o-1)):null;for(fr(t,c,u,st(g)?0:a-g,a),d=0,h=o-1;d<h;d++)fr(t,c,u,r[d],r[d+1]);return fr(t,c,u,l,st(g)?t.length:l+g),c}return fr(t,c,u),c}function Um(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function qm(n,t,e){const i=Km(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Hg(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function Xm(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Gm(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function fr(n,t,e,i,s){const r=it(i,0),o=Math.min(it(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function Km(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const Zm=n=>n==="left"?"right":n==="right"?"left":n,gu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,pu=(n,t)=>Math.min(t||n,n);function mu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function Qm(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function Jm(n,t){wt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function as(n){return n.drawTicks?n.tickLength:0}function yu(n,t){if(!n.display)return 0;const e=At(n.font,t),i=jt(n.padding);return(_t(n.text)?n.text.length:1)*e.lineHeight+i.height}function ty(n,t){return xn(n,{scale:t,type:"scale"})}function ey(n,t,e){return xn(n,{tick:e,index:t,type:"tick"})}function ny(n,t,e){let i=Co(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Zm(i)),i}function iy(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,g,p;const b=o-s,w=a-r;if(n.isHorizontal()){if(g=ee(i,r,a),lt(e)){const v=Object.keys(e)[0],S=e[v];p=u[v].getPixelForValue(S)+b-t}else e==="center"?p=(c.bottom+c.top)/2+b-t:p=gu(n,e,t);h=a-r}else{if(lt(e)){const v=Object.keys(e)[0],S=e[v];g=u[v].getPixelForValue(S)-w+t}else e==="center"?g=(c.left+c.right)/2-w+t:g=gu(n,e,t);p=ee(i,o,s),d=e==="left"?-Ot:Ot}return{titleX:g,titleY:p,maxWidth:h,rotation:d}}class Un extends Gt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=ke(t,Number.POSITIVE_INFINITY),e=ke(e,Number.NEGATIVE_INFINITY),i=ke(i,Number.POSITIVE_INFINITY),s=ke(s,Number.NEGATIVE_INFINITY),{min:ke(t,i),max:ke(e,s),minDefined:Et(t),maxDefined:Et(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:ke(e,ke(i,e)),max:ke(i,ke(e,i))}}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(){xt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gp(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?mu(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=$m(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){xt(this.options.afterUpdate,[this])}beforeSetDimensions(){xt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){xt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),xt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){xt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=xt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){xt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){xt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=pu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,g=Xt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-as(t.grid)-e.padding-yu(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=Qs(Math.min(Math.asin(Xt((u.highest.height+6)/a,-1,1)),Math.asin(Xt(l/c,-1,1))-Math.asin(Xt(h/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){xt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){xt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=yu(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=as(r)+l):(t.height=this.maxHeight,t.width=as(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=i.padding*2,p=Yt(this.labelRotation),b=Math.cos(p),w=Math.sin(p);if(a){const v=i.mirror?0:w*d.width+b*h.height;t.height=Math.min(this.maxHeight,t.height+v+g)}else{const v=i.mirror?0:b*d.width+w*h.height;t.width=Math.min(this.maxWidth,t.width+v+g)}this._calculatePadding(c,u,w,b)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},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=s*t.width,g=i*e.height):(h=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,g=e.width/2),this.paddingLeft=Math.max((h-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+o)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_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(){xt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)st(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=mu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/pu(e,i));let c=0,u=0,d,h,g,p,b,w,v,S,D,k,C;for(d=0;d<e;d+=l){if(p=t[d].label,b=this._resolveTickFontOptions(d),s.font=w=b.string,v=r[w]=r[w]||{data:{},gc:[]},S=b.lineHeight,D=k=0,!st(p)&&!_t(p))D=nr(s,v.data,v.gc,D,p),k=S;else if(_t(p))for(h=0,g=p.length;h<g;++h)C=p[h],!st(C)&&!_t(C)&&(D=nr(s,v.data,v.gc,D,C),k+=S);o.push(D),a.push(k),c=Math.max(D,c),u=Math.max(k,u)}Jm(r,e);const R=o.indexOf(c),E=a.indexOf(u),m=_=>({width:o[_]||0,height:a[_]||0});return{first:m(0),last:m(e-1),widest:m(R),highest:m(E),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return jg(this._alignToPixels?Wn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=ey(this.getContext(),t,i))}return this.$context||(this.$context=ty(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Yt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=as(r),g=[],p=a.setContext(this.getContext()),b=p.display?p.width:0,w=b/2,v=function(U){return Wn(i,U,b)};let S,D,k,C,R,E,m,_,T,A,L,N;if(o==="top")S=v(this.bottom),E=this.bottom-h,_=S-w,A=v(t.top)+w,N=t.bottom;else if(o==="bottom")S=v(this.top),A=t.top,N=v(t.bottom)-w,E=S+w,_=this.top+h;else if(o==="left")S=v(this.right),R=this.right-h,m=S-w,T=v(t.left)+w,L=t.right;else if(o==="right")S=v(this.left),T=t.left,L=v(t.right)-w,R=S+w,m=this.left+h;else if(e==="x"){if(o==="center")S=v((t.top+t.bottom)/2+.5);else if(lt(o)){const U=Object.keys(o)[0],H=o[U];S=v(this.chart.scales[U].getPixelForValue(H))}A=t.top,N=t.bottom,E=S+w,_=E+h}else if(e==="y"){if(o==="center")S=v((t.left+t.right)/2);else if(lt(o)){const U=Object.keys(o)[0],H=o[U];S=v(this.chart.scales[U].getPixelForValue(H))}R=S-w,m=R-h,T=t.left,L=t.right}const B=it(s.ticks.maxTicksLimit,d),G=Math.max(1,Math.ceil(d/B));for(D=0;D<d;D+=G){const U=this.getContext(D),H=r.setContext(U),ut=a.setContext(U),Y=H.lineWidth,et=H.color,Dt=ut.dash||[],$=ut.dashOffset,z=H.tickWidth,j=H.tickColor,X=H.tickBorderDash||[],Z=H.tickBorderDashOffset;k=Qm(this,D,l),k!==void 0&&(C=Wn(i,k,Y),c?R=m=T=L=C:E=_=A=N=C,g.push({tx1:R,ty1:E,tx2:m,ty2:_,x1:T,y1:A,x2:L,y2:N,width:Y,color:et,borderDash:Dt,borderDashOffset:$,tickWidth:z,tickColor:j,tickBorderDash:X,tickBorderDashOffset:Z}))}return this._ticksLength=d,this._borderValue=S,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,h=as(i.grid),g=h+u,p=d?-u:g,b=-Yt(this.labelRotation),w=[];let v,S,D,k,C,R,E,m,_,T,A,L,N="middle";if(s==="top")R=this.bottom-p,E=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+p,E=this._getXAxisLabelAlignment();else if(s==="left"){const G=this._getYAxisLabelAlignment(h);E=G.textAlign,C=G.x}else if(s==="right"){const G=this._getYAxisLabelAlignment(h);E=G.textAlign,C=G.x}else if(e==="x"){if(s==="center")R=(t.top+t.bottom)/2+g;else if(lt(s)){const G=Object.keys(s)[0],U=s[G];R=this.chart.scales[G].getPixelForValue(U)+g}E=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")C=(t.left+t.right)/2-g;else if(lt(s)){const G=Object.keys(s)[0],U=s[G];C=this.chart.scales[G].getPixelForValue(U)}E=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const B=this._getLabelSizes();for(v=0,S=a.length;v<S;++v){D=a[v],k=D.label;const G=r.setContext(this.getContext(v));m=this.getPixelForTick(v)+r.labelOffset,_=this._resolveTickFontOptions(v),T=_.lineHeight,A=_t(k)?k.length:1;const U=A/2,H=G.color,ut=G.textStrokeColor,Y=G.textStrokeWidth;let et=E;o?(C=m,E==="inner"&&(v===S-1?et=this.options.reverse?"left":"right":v===0?et=this.options.reverse?"right":"left":et="center"),s==="top"?c==="near"||b!==0?L=-A*T+T/2:c==="center"?L=-B.highest.height/2-U*T+T:L=-B.highest.height+T/2:c==="near"||b!==0?L=T/2:c==="center"?L=B.highest.height/2-U*T:L=B.highest.height-A*T,d&&(L*=-1),b!==0&&!G.showLabelBackdrop&&(C+=T/2*Math.sin(b))):(R=m,L=(1-A)*T/2);let Dt;if(G.showLabelBackdrop){const $=jt(G.backdropPadding),z=B.heights[v],j=B.widths[v];let X=L-$.top,Z=0-$.left;switch(N){case"middle":X-=z/2;break;case"bottom":X-=z;break}switch(E){case"center":Z-=j/2;break;case"right":Z-=j;break;case"inner":v===S-1?Z-=j:v>0&&(Z-=j/2);break}Dt={left:Z,top:X,width:j+$.width,height:z+$.height,color:G.backdropColor}}w.push({label:k,font:_,textOffset:L,options:{rotation:b,color:H,strokeColor:ut,strokeWidth:Y,textAlign:et,textBaseline:N,translation:[C,R],backdrop:Dt}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Yt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="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,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=Wn(t,this.left,o)-o/2,u=Wn(t,this.right,a)+a/2,d=h=l):(d=Wn(t,this.top,o)-o/2,h=Wn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&Gi(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;Yn(i,c,0,u,l,a)}s&&Ki(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=At(i.font),o=jt(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||lt(e)?(l+=o.bottom,_t(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=iy(this,l,e,a);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:h,textAlign:ny(a,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=it(t.grid&&t.grid.z,-1),s=it(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Un.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return At(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class gr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;oy(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,sy(t,o,i),this.override&&Pt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Pt[s]&&(delete Pt[s][i],this.override&&delete Hn[i])}}function sy(n,t,e){const i=Yi(Object.create(null),[e?Pt.get(e):{},Pt.get(t),n.defaults]);Pt.set(t,i),n.defaultRoutes&&ry(t,n.defaultRoutes),n.descriptors&&Pt.describe(t,n.descriptors)}function ry(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");Pt.route(r,s,l,a)})}function oy(n){return"id"in n&&"defaults"in n}class ay{constructor(){this.controllers=new gr(Ne,"datasets",!0),this.elements=new gr(Gt,"elements"),this.plugins=new gr(Object,"plugins"),this.scales=new gr(Un,"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,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):wt(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=ko(t);xt(i["before"+s],[],i),e[t](i),xt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ve=new ay;class ly{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(xt(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){st(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=it(i.options&&i.options.plugins,{}),r=cy(i);return s===!1&&!e?[]:dy(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function cy(n){const t={},e=[],i=Object.keys(Ve.plugins.items);for(let r=0;r<i.length;r++)e.push(Ve.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function uy(n,t){return!t&&n===!1?null:n===!0?{}:n}function dy(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=uy(i[l],s);c!==null&&r.push({plugin:a,options:hy(n.config,{plugin:a,local:e[l]},c,o)})}return r}function hy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zo(n,t){const e=Pt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function fy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function gy(n,t){return n===t?"_index_":"_value_"}function bu(n){if(n==="x"||n==="y"||n==="r")return n}function py(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Qo(n,...t){if(bu(n))return n;for(const e of t){const i=e.axis||py(e.position)||n.length>1&&bu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function _u(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function my(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return _u(n,"x",e[0])||_u(n,"y",e[0])}return{}}function yy(n,t){const e=Hn[n.type]||{scales:{}},i=t.scales||{},s=Zo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!lt(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Qo(o,a,my(o,n),Pt.scales[a.type]),c=gy(l,s),u=e.scales||{};r[o]=ji(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||Zo(a,t),u=(Hn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=fy(d,l),g=o[h+"AxisID"]||h;r[g]=r[g]||Object.create(null),ji(r[g],[{axis:h},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ji(a,[Pt.scales[a.type],Pt.scale])}),r}function xu(n){const t=n.options||(n.options={});t.plugins=it(t.plugins,{}),t.scales=yy(n,t)}function wu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function by(n){return n=n||{},n.data=wu(n.data),xu(n),n}const vu=new Map,Mu=new Set;function pr(n,t){let e=vu.get(n);return e||(e=t(),vu.set(n,e),Mu.add(e)),e}const ls=(n,t,e)=>{const i=mn(t,e);i!==void 0&&n.add(i)};class _y{constructor(t){this._config=by(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=wu(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(),xu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return pr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return pr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return pr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>ls(l,t,d))),u.forEach(d=>ls(l,s,d)),u.forEach(d=>ls(l,Hn[r]||{},d)),u.forEach(d=>ls(l,Pt,d)),u.forEach(d=>ls(l,Eo,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Mu.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Hn[e]||{},Pt.datasets[e]||{},{type:e},Pt,Eo]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=Su(this._resolverCache,t,s);let l=o;if(wy(o,e)){r.$shared=!1,i=fe(i)?i():i;const c=this.createResolver(t,i,a);l=di(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Su(this._resolverCache,t,i);return lt(e)?di(r,e,void 0,s):r}}function Su(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:Io(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const xy=n=>lt(n)&&Object.getOwnPropertyNames(n).some(t=>fe(n[t]));function wy(n,t){const{isScriptable:e,isIndexable:i}=Tc(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(fe(a)||xy(a))||o&&_t(a))return!0}return!1}var vy="4.4.5";const My=["top","bottom","left","right","chartArea"];function ku(n,t){return n==="top"||n==="bottom"||My.indexOf(n)===-1&&t==="x"}function Du(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Tu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),xt(e&&e.onComplete,[n],t)}function Sy(n){const t=n.chart,e=t.options.animation;xt(e&&e.onProgress,[n],t)}function Cu(n){return zo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const mr={},Ou=n=>{const t=Cu(n);return Object.values(mr).filter(e=>e.canvas===t).pop()};function ky(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function Dy(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function yr(n,t,e){return n.options.clip?n[e]:t[e]}function Ty(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:yr(e,t,"left"),right:yr(e,t,"right"),top:yr(i,t,"top"),bottom:yr(i,t,"bottom")}:t}let Pe=(Pn=class{static register(...t){Ve.add(...t),Pu()}static unregister(...t){Ve.remove(...t),Pu()}constructor(t,e){const i=this.config=new _y(e),s=Cu(t),r=Ou(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Vm(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Ag(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,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 ly,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qg(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],mr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nn.listen(this,"complete",Tu),nn.listen(this,"progress",Sy),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return st(t)?e&&r?r:s?i/s: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 Ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ic(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Sc(this.canvas,this.ctx),this}stop(){return nn.stop(this),this}resize(t,e){nn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ic(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),xt(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};wt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Qo(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),wt(r,o=>{const a=o.options,l=a.id,c=Qo(l,a),u=it(a.type,o.dtype);(a.position===void 0||ku(a.position,c)!==ku(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=Ve.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),wt(s,(o,a)=>{o||delete i[a]}),wt(i,o=>{ne.configure(this,o,o.options),ne.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Du("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Zo(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=Ve.getController(a),{datasetElementType:c,dataElementType:u}=Pt.datasets[a];Object.assign(l,{dataElementType:Ve.getElement(u),datasetElementType:c&&Ve.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){wt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(h),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||wt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Du("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){wt(this.scales,t=>{ne.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!lc(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;ky(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!lc(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ne.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],wt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,fe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(nn.has(this)?this.attached&&!nn.running(this)&&nn.start(this):(this.draw(),Tu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=Ty(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Gi(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&Ki(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Go.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=xn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);he(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),nn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Sc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete mr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};wt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){wt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},wt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Xs(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=zg(t),c=Dy(t,this._lastEvent,i,l);i&&(this._lastEvent=null,xt(r.onHover,[t,a,this],this),l&&xt(r.onClick,[t,a,this],this));const u=!Xs(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},P(Pn,"defaults",Pt),P(Pn,"instances",mr),P(Pn,"overrides",Hn),P(Pn,"registry",Ve),P(Pn,"version",vy),P(Pn,"getChart",Ou),Pn);function Pu(){return wt(Pe.instances,n=>n._plugins.invalidate())}function Cy(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+Ot,i-Ot),n.closePath(),n.clip()}function Oy(n){return Lo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Py(n,t,e,i){const s=Oy(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return Xt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Xt(s.innerStart,0,o),innerEnd:Xt(s.innerEnd,0,o)}}function gi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function br(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),h=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const G=u>0?u-i:0,U=d>0?d-i:0,H=(G+U)/2,ut=H!==0?p*H/(H+i):p;g=(p-ut)/2}const b=Math.max(.001,p*d-e/dt)/d,w=(p-b)/2,v=l+w+g,S=s-w-g,{outerStart:D,outerEnd:k,innerStart:C,innerEnd:R}=Py(t,h,d,S-v),E=d-D,m=d-k,_=v+D/E,T=S-k/m,A=h+C,L=h+R,N=v+C/A,B=S-R/L;if(n.beginPath(),r){const G=(_+T)/2;if(n.arc(o,a,d,_,G),n.arc(o,a,d,G,T),k>0){const Y=gi(m,T,o,a);n.arc(Y.x,Y.y,k,T,S+Ot)}const U=gi(L,S,o,a);if(n.lineTo(U.x,U.y),R>0){const Y=gi(L,B,o,a);n.arc(Y.x,Y.y,R,S+Ot,B+Math.PI)}const H=(S-R/h+(v+C/h))/2;if(n.arc(o,a,h,S-R/h,H,!0),n.arc(o,a,h,H,v+C/h,!0),C>0){const Y=gi(A,N,o,a);n.arc(Y.x,Y.y,C,N+Math.PI,v-Ot)}const ut=gi(E,v,o,a);if(n.lineTo(ut.x,ut.y),D>0){const Y=gi(E,_,o,a);n.arc(Y.x,Y.y,D,v-Ot,_)}}else{n.moveTo(o,a);const G=Math.cos(_)*d+o,U=Math.sin(_)*d+a;n.lineTo(G,U);const H=Math.cos(T)*d+o,ut=Math.sin(T)*d+a;n.lineTo(H,ut)}n.closePath()}function Ey(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){br(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%kt||kt))}return br(n,t,e,i,l,s),n.fill(),l}function Ay(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){br(n,t,e,i,p,s);for(let b=0;b<r;++b)n.stroke();isNaN(a)||(p=o+(a%kt||kt))}g&&Cy(n,t,p),r||(br(n,t,e,i,p,s),n.stroke())}class cs extends Gt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=Js(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=it(h,c-l),b=$i(o,l,c)&&l!==c,w=p>=kt||b,v=Je(a,u+g,d+g);return w&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+o)/2,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>kt?Math.floor(s/kt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(dt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Ey(e,this,u,o,a),Ay(e,this,u,o,a),e.restore()}}P(cs,"id","arc"),P(cs,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(cs,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(cs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Eu(n,t,e=t){n.lineCap=it(e.borderCapStyle,t.borderCapStyle),n.setLineDash(it(e.borderDash,t.borderDash)),n.lineDashOffset=it(e.borderDashOffset,t.borderDashOffset),n.lineJoin=it(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=it(e.borderWidth,t.borderWidth),n.strokeStyle=it(e.borderColor,t.borderColor)}function Ry(n,t,e){n.lineTo(e.x,e.y)}function Ly(n){return n.stepped?rp:n.tension||n.cubicInterpolationMode==="monotone"?op:Ry}function Au(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Iy(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Au(s,e,i),u=Ly(r);let{move:d=!0,reverse:h}=i||{},g,p,b;for(g=0;g<=c;++g)p=s[(a+(h?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,b,p,h,r.stepped),b=p);return l&&(p=s[(a+(h?c:0))%o],u(n,b,p,h,r.stepped)),!!l}function Ny(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Au(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,g,p,b,w,v;const S=k=>(o+(c?a-k:k))%r,D=()=>{b!==w&&(n.lineTo(u,w),n.lineTo(u,b),n.lineTo(u,v))};for(l&&(g=s[S(0)],n.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=s[S(h)],g.skip)continue;const k=g.x,C=g.y,R=k|0;R===p?(C<b?b=C:C>w&&(w=C),u=(d*u+k)/++d):(D(),n.lineTo(k,C),p=R,d=0,b=w=C),v=C}D()}function Jo(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ny:Iy}function Fy(n){return n.stepped?zp:n.tension||n.cubicInterpolationMode==="monotone"?Bp:Vn}function zy(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Eu(n,t.options),n.stroke(s)}function By(n,t,e,i){const{segments:s,options:r}=t,o=Jo(t);for(const a of s)Eu(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Hy=typeof Path2D=="function";function Wy(n,t,e,i){Hy&&!t.options.segment?zy(n,t,e,i):By(n,t,e,i)}class vn extends Gt{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,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Pp(this._points,i,t,s,e),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=$p(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=Yc(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Fy(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:h}=o[c],g=r[d],p=r[h];if(g===p){a.push(g);continue}const b=Math.abs((s-g[e])/(p[e]-g[e])),w=l(g,p,b,i.stepped);w[e]=t[e],a.push(w)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Jo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Jo(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Wy(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(vn,"id","line"),P(vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(vn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ru(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class _r extends Gt{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return Ru(this,e,"x",i)}inYRange(e,i){return Ru(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!en(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Ro(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(_r,"id","point"),P(_r,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(_r,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Lu(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return n.horizontal?(d=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,a=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function Mn(n,t,e,i){return n?0:Xt(t,e,i)}function Yy(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Dc(i);return{t:Mn(s.top,r.top,0,e),r:Mn(s.right,r.right,0,t),b:Mn(s.bottom,r.bottom,0,e),l:Mn(s.left,r.left,0,t)}}function jy(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=_n(s),o=Math.min(t,e),a=n.borderSkipped,l=i||lt(s);return{topLeft:Mn(!l||a.top||a.left,r.topLeft,0,o),topRight:Mn(!l||a.top||a.right,r.topRight,0,o),bottomLeft:Mn(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:Mn(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Vy(n){const t=Lu(n),e=t.right-t.left,i=t.bottom-t.top,s=Yy(n,e/2,i/2),r=jy(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function ta(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&Lu(n,i);return a&&(s||Je(t,a.left,a.right))&&(r||Je(e,a.top,a.bottom))}function $y(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Uy(n,t){n.rect(t.x,t.y,t.w,t.h)}function ea(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class xr extends Gt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=Vy(this),a=$y(o.radius)?ui:Uy;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,ea(o,e,r)),t.clip(),a(t,ea(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ea(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ta(this,t,e,i)}inXRange(t,e){return ta(this,t,null,e)}inYRange(t,e){return ta(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(xr,"id","bar"),P(xr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var qy=Object.freeze({__proto__:null,ArcElement:cs,BarElement:xr,LineElement:vn,PointElement:_r});const na=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Iu=na.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Nu(n){return na[n%na.length]}function Fu(n){return Iu[n%Iu.length]}function Xy(n,t){return n.borderColor=Nu(t),n.backgroundColor=Fu(t),++t}function Gy(n,t){return n.backgroundColor=n.data.map(()=>Nu(t++)),t}function Ky(n,t){return n.backgroundColor=n.data.map(()=>Fu(t++)),t}function Zy(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof sn?t=Gy(e,t):s instanceof es?t=Ky(e,t):s&&(t=Xy(e,t))}}function zu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Qy(n){return n&&(n.borderColor||n.backgroundColor)}function Jy(){return Pt.borderColor!=="rgba(0,0,0,0.1)"||Pt.backgroundColor!=="rgba(0,0,0,0.1)"}var tb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,o=zu(i)||Qy(s)||r&&zu(r)||Jy();if(!e.forceOverride&&o)return;const a=Zy(n);i.forEach(a)}};function eb(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,h,g,p,b;for(o[l++]=n[u],d=0;d<r-2;d++){let w=0,v=0,S;const D=Math.floor((d+1)*a)+1+t,k=Math.min(Math.floor((d+2)*a)+1,e)+t,C=k-D;for(S=D;S<k;S++)w+=n[S].x,v+=n[S].y;w/=C,v/=C;const R=Math.floor(d*a)+1+t,E=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:m,y:_}=n[u];for(g=p=-1,S=R;S<E;S++)p=.5*Math.abs((m-w)*(n[S].y-_)-(m-n[S].x)*(v-_)),p>g&&(g=p,h=n[S],b=S);o[l++]=h,u=b}return o[l++]=n[c],o}function nb(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,h,g,p,b;const w=[],v=t+e-1,S=n[t].x,k=n[v].x-S;for(o=t;o<t+e;++o){a=n[o],l=(a.x-S)/k*i,c=a.y;const C=l|0;if(C===u)c<p?(p=c,d=o):c>b&&(b=c,h=o),s=(r*s+a.x)/++r;else{const R=o-1;if(!st(d)&&!st(h)){const E=Math.min(d,h),m=Math.max(d,h);E!==g&&E!==R&&w.push({...n[E],x:s}),m!==g&&m!==R&&w.push({...n[m],x:s})}o>0&&R!==g&&w.push(n[R]),w.push(a),u=C,r=0,p=b=c,d=h=g=o}}return w}function Bu(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Hu(n){n.data.datasets.forEach(t=>{Bu(t)})}function ib(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Xt(tn(t,r.axis,o).lo,0,e-1)),c?s=Xt(tn(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var sb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Hu(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(Zi([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:h}=ib(l,c);const g=e.threshold||4*i;if(h<=g){Bu(s);return}st(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let p;switch(e.algorithm){case"lttb":p=eb(c,d,h,i,e);break;case"min-max":p=nb(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Hu(n)}};function rb(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=sa(l,c,s);const u=ia(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=Yc(t,u);for(const h of d){const g=ia(e,r[h.start],r[h.end],h.loop),p=Wc(a,s,g);for(const b of p)o.push({source:b,target:h,start:{[e]:Wu(u,g,"start",Math.max)},end:{[e]:Wu(u,g,"end",Math.min)}})}}return o}function ia(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=De(s),r=De(r)),{property:n,start:s,end:r}}function ob(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=sa(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function sa(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Wu(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Yu(n,t){let e=[],i=!1;return _t(n)?(i=!0,e=n):e=ob(n,t),e.length?new vn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function ju(n){return n&&n.fill!==!1}function ab(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!Et(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function lb(n,t,e){const i=hb(n);if(lt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Et(s)&&Math.floor(s)===s?cb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function cb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function ub(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:lt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function db(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:lt(n)?i=n.value:i=t.getBaseValue(),i}function hb(n){const t=n.options,e=t.fill;let i=it(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function fb(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=gb(t,e);a.push(Yu({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)pb(s,o[u],a)}return new vn({points:s,options:{}})}function gb(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function pb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=mb(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function mb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][e],h=o[u.end][e];if(Je(s,d,h)){a=s===d,l=s===h;break}}return{first:a,last:l,point:i}}class Vu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:kt},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function yb(n){const{chart:t,fill:e,line:i}=n;if(Et(e))return bb(t,e);if(e==="stack")return fb(n);if(e==="shape")return!0;const s=_b(n);return s instanceof Vu?s:Yu(s,i)}function bb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function _b(n){return(n.scale||{}).getPointPositionForValue?wb(n):xb(n)}function xb(n){const{scale:t={},fill:e}=n,i=ub(e,t);if(Et(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function wb(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=db(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new Vu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function ra(n,t,e){const i=yb(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(Gi(n,e),vb(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),Ki(n))}function vb(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&($u(n,i,o.top),Uu(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),$u(n,i,o.bottom)),Uu(n,{line:e,target:i,color:r,scale:a,property:l}),n.restore()}function $u(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[sa(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Uu(n,t){const{line:e,target:i,property:s,color:r,scale:o}=t,a=rb(e,i,s);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:h=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=h,Mb(n,o,g&&ia(s,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let b;if(g){p?n.closePath():qu(n,i,d,s);const w=!!i.pathSegment(n,c,{move:p,reverse:!0});b=p&&w,b||qu(n,i,u,s)}n.closePath(),n.fill(b?"evenodd":"nonzero"),n.restore()}}function Mb(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(n.beginPath(),n.rect(o,i,a-o,s-i),n.clip())}function qu(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Sb={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof vn&&(l={visible:n.isDatasetVisible(o),index:o,fill:lb(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=ab(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&ra(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;ju(r)&&ra(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!ju(i)||e.drawTime!=="beforeDatasetDraw"||ra(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Xu=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},kb=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Gu extends Gt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=xt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=At(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Xu(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let h=-1,g=-u;return this.legendItems.forEach((p,b)=>{const w=i+e/2+r.measureText(p.text).width;(b===0||c[c.length-1]+w+2*a>o)&&(d+=u,c[c.length-(b>0?0:1)]=0,g+=u,h++),l[b]={left:0,top:g,row:h,width:w,height:s},c[c.length-1]+=w+a}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,h=0,g=0,p=0,b=0;return this.legendItems.forEach((w,v)=>{const{itemWidth:S,itemHeight:D}=Db(i,e,r,w,s);v>0&&g+D+2*a>u&&(d+=h+a,c.push({width:h,height:g}),p+=h+a,b++,h=g=0),l[v]={left:p,top:g,col:b,width:S,height:D},h=Math.max(h,S),g+=D+a}),d+=h,c.push({width:h,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=fi(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=ee(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ee(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=ee(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ee(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Gi(t,this),this._draw(),Ki(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=Pt.color,l=fi(t.rtl,this.left,this.width),c=At(o.font),{padding:u}=o,d=c.size,h=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:b,itemHeight:w}=Xu(o,d),v=function(R,E,m){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;s.save();const _=it(m.lineWidth,1);if(s.fillStyle=it(m.fillStyle,a),s.lineCap=it(m.lineCap,"butt"),s.lineDashOffset=it(m.lineDashOffset,0),s.lineJoin=it(m.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=it(m.strokeStyle,a),s.setLineDash(it(m.lineDash,[])),o.usePointStyle){const T={radius:b*Math.SQRT2/2,pointStyle:m.pointStyle,rotation:m.rotation,borderWidth:_},A=l.xPlus(R,p/2),L=E+h;kc(s,T,A,L,o.pointStyleWidth&&p)}else{const T=E+Math.max((d-b)/2,0),A=l.leftForLtr(R,p),L=_n(m.borderRadius);s.beginPath(),Object.values(L).some(N=>N!==0)?ui(s,{x:A,y:T,w:p,h:b,radius:L}):s.rect(A,T,p,b),s.fill(),_!==0&&s.stroke()}s.restore()},S=function(R,E,m){Yn(s,m.text,R,E+w/2,c,{strikethrough:m.hidden,textAlign:l.textAlign(m.textAlign)})},D=this.isHorizontal(),k=this._computeTitleHeight();D?g={x:ee(r,this.left+u,this.right-i[0]),y:this.top+u+k,line:0}:g={x:this.left+u,y:ee(r,this.top+k+u,this.bottom-e[0].height),line:0},Fc(this.ctx,t.textDirection);const C=w+u;this.legendItems.forEach((R,E)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;const m=s.measureText(R.text).width,_=l.textAlign(R.textAlign||(R.textAlign=o.textAlign)),T=p+h+m;let A=g.x,L=g.y;l.setWidth(this.width),D?E>0&&A+T+u>this.right&&(L=g.y+=C,g.line++,A=g.x=ee(r,this.left+u,this.right-i[g.line])):E>0&&L+C>this.bottom&&(A=g.x=A+e[g.line].width+u,g.line++,L=g.y=ee(r,this.top+k+u,this.bottom-e[g.line].height));const N=l.x(A);if(v(N,L,R),A=Xg(_,A+p+h,D?A+T:this.right,t.rtl),S(l.x(A),L,R),D)g.x+=T+u;else if(typeof R.text!="string"){const B=c.lineHeight;g.y+=Ku(R,B)+u}else g.y+=C}),zc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=At(e.font),s=jt(e.padding);if(!e.display)return;const r=fi(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=ee(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((b,w)=>Math.max(b,w.height),0);u=c+ee(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=ee(a,d,d+h);o.textAlign=r.textAlign(Co(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,Yn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=At(t.font),i=jt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Je(t,this.left,this.right)&&Je(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Je(t,s.left,s.left+s.width)&&Je(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Ob(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=kb(s,i);s&&!r&&xt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&xt(e.onHover,[t,i,this],this)}else i&&xt(e.onClick,[t,i,this],this)}}function Db(n,t,e,i,s){const r=Tb(i,n,t,e),o=Cb(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Tb(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function Cb(n,t,e){let i=n;return typeof t.text!="string"&&(i=Ku(t,e)),i}function Ku(n,t){const e=n.text?n.text.length:0;return t*e}function Ob(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Pb={id:"legend",_element:Gu,start(n,t,e){const i=n.legend=new Gu({ctx:n.ctx,options:e,chart:n});ne.configure(n,i,e),ne.addBox(n,i)},stop(n){ne.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;ne.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=jt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class oa extends Gt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=_t(i.text)?i.text.length:1;this._padding=jt(i.padding);const r=s*At(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=ee(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=ee(a,s,e),l=dt*-.5):(u=r-t,d=ee(a,e,s),l=dt*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=At(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Co(e.align),textBaseline:"middle",translation:[o,a]})}}function Eb(n,t){const e=new oa({ctx:n.ctx,options:t,chart:n});ne.configure(n,e,t),ne.addBox(n,e),n.titleBlock=e}var Ab={id:"title",_element:oa,start(n,t,e){Eb(n,e)},stop(n){const t=n.titleBlock;ne.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;ne.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const wr=new WeakMap;var Rb={id:"subtitle",start(n,t,e){const i=new oa({ctx:n.ctx,options:e,chart:n});ne.configure(n,i,e),ne.addBox(n,i),wr.set(n,i)},stop(n){ne.removeBox(n,wr.get(n)),wr.delete(n)},beforeUpdate(n,t,e){const i=wr.get(n);ne.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const us={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=ci(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function $e(n,t){return t&&(_t(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function rn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function Lb(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Zu(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=At(t.bodyFont),c=At(t.titleFont),u=At(t.footerFont),d=r.length,h=s.length,g=i.length,p=jt(t.padding);let b=p.height,w=0,v=i.reduce((k,C)=>k+C.before.length+C.lines.length+C.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*k+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let S=0;const D=function(k){w=Math.max(w,e.measureText(k).width+S)};return e.save(),e.font=c.string,wt(n.title,D),e.font=l.string,wt(n.beforeBody.concat(n.afterBody),D),S=t.displayColors?o+2+t.boxPadding:0,wt(i,k=>{wt(k.before,D),wt(k.lines,D),wt(k.after,D)}),S=0,e.font=u.string,wt(n.footer,D),e.restore(),w+=p.width,{width:w,height:b}}function Ib(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Nb(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function Fb(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Nb(c,n,t,e)&&(c="center"),c}function Qu(n,t,e){const i=e.yAlign||t.yAlign||Ib(n,e);return{xAlign:e.xAlign||t.xAlign||Fb(n,t,e,i),yAlign:i}}function zb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Bb(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Ju(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=_n(o);let p=zb(t,a);const b=Bb(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Xt(p,0,i.width-t.width),y:Xt(b,0,i.height-t.height)}}function vr(n,t,e){const i=jt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function td(n){return $e([],rn(n))}function Hb(n,t,e){return xn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ed(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const nd={beforeTitle:Qe,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Qe,beforeBody:Qe,beforeLabel:Qe,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return st(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function ge(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?nd[t].call(e,i):s}class aa extends Gt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Ho(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Hb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ge(i,"beforeTitle",this,t),r=ge(i,"title",this,t),o=ge(i,"afterTitle",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(o)),a}getBeforeBody(t,e){return td(ge(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return wt(t,r=>{const o={before:[],lines:[],after:[]},a=ed(i,r);$e(o.before,rn(ge(a,"beforeLabel",this,r))),$e(o.lines,ge(a,"label",this,r)),$e(o.after,rn(ge(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return td(ge(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ge(i,"beforeFooter",this,t),r=ge(i,"footer",this,t),o=ge(i,"afterFooter",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Lb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),wt(a,u=>{const d=ed(t.callbacks,u);s.push(ge(d,"labelColor",this,u)),r.push(ge(d,"labelPointStyle",this,u)),o.push(ge(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=us[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=Zu(this,i),c=Object.assign({},a,l),u=Qu(this.chart,i,c),d=Ju(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=_n(a),{x:h,y:g}=t,{width:p,height:b}=e;let w,v,S,D,k,C;return r==="center"?(k=g+b/2,s==="left"?(w=h,v=w-o,D=k+o,C=k-o):(w=h+p,v=w+o,D=k-o,C=k+o),S=w):(s==="left"?v=h+Math.max(l,u)+o:s==="right"?v=h+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,k=D-o,w=v-o,S=v+o):(D=g+b,k=D+o,w=v+o,S=v-o),C=D),{x1:w,x2:v,x3:S,y1:D,y2:k,y3:C}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=At(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=At(r.bodyFont),d=vr(this,"left",r),h=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=s.leftForLtr(h,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Ro(t,b,w,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Ro(t,b,w,v)}else{t.lineWidth=lt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(h,c),w=s.leftForLtr(s.xPlus(h,1),c-2),v=_n(o.borderRadius);Object.values(v).some(S=>S!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ui(t,{x:b,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ui(t,{x:w,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(w,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=At(i.bodyFont);let h=d.lineHeight,g=0;const p=fi(i.rtl,this.x,this.width),b=function(m){e.fillText(m,p.x(t.x+g),t.y+h/2),t.y+=h+r},w=p.textAlign(o);let v,S,D,k,C,R,E;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=vr(this,w,i),e.fillStyle=i.bodyColor,wt(this.beforeBody,b),g=a&&w!=="right"?o==="center"?c/2+u:c+2+u:0,k=0,R=s.length;k<R;++k){for(v=s[k],S=this.labelTextColors[k],e.fillStyle=S,wt(v.before,b),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,k,p,i),h=Math.max(d.lineHeight,l)),C=0,E=D.length;C<E;++C)b(D[C]),h=d.lineHeight;wt(v.after,b)}g=0,h=d.lineHeight,wt(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=At(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:g,bottomRight:p}=_n(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-h,l),e.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=us[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Zu(this,t),l=Object.assign({},o,this._size),c=Qu(e,t,l),u=Ju(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=jt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),Fc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),zc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Xs(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Xs(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=us[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}P(aa,"positioners",us);var Mr={id:"tooltip",_element:aa,positioners:us,afterInit(n,t,e){e&&(n.tooltip=new aa({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:nd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Wb=Object.freeze({__proto__:null,Colors:tb,Decimation:sb,Filler:Sb,Legend:Pb,SubTitle:Rb,Title:Ab,Tooltip:Mr});const Yb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function jb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Yb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Vb=(n,t)=>n===null?null:Xt(Math.round(n),0,t);function id(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class la extends Un{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:jb(i,t,it(e,t),this._addedLabels),Vb(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return id.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(la,"id","category"),P(la,"defaults",{ticks:{callback:id}});function $b(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,p=u-1,{min:b,max:w}=t,v=!st(o),S=!st(a),D=!st(c),k=(w-b)/(d+1);let C=cc((w-b)/p/g)*g,R,E,m,_;if(C<1e-14&&!v&&!S)return[{value:b},{value:w}];_=Math.ceil(w/C)-Math.floor(b/C),_>p&&(C=cc(_*C/p/g)*g),st(l)||(R=Math.pow(10,l),C=Math.ceil(C*R)/R),s==="ticks"?(E=Math.floor(b/C)*C,m=Math.ceil(w/C)*C):(E=b,m=w),v&&S&&r&&Wg((a-o)/r,C/1e3)?(_=Math.round(Math.min((a-o)/C,u)),C=(a-o)/_,E=o,m=a):D?(E=v?o:E,m=S?a:m,_=c-1,C=(m-E)/_):(_=(m-E)/C,Vi(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(dc(C),dc(E));R=Math.pow(10,st(l)?T:l),E=Math.round(E*R)/R,m=Math.round(m*R)/R;let A=0;for(v&&(h&&E!==o?(e.push({value:o}),E<o&&A++,Vi(Math.round((E+A*C)*R)/R,o,sd(o,k,n))&&A++):E<o&&A++);A<_;++A){const L=Math.round((E+A*C)*R)/R;if(S&&L>a)break;e.push({value:L})}return S&&h&&m!==a?e.length&&Vi(e[e.length-1].value,a,sd(a,k,n))?e[e.length-1].value=a:e.push({value:a}):(!S||m===a)&&e.push({value:m}),e}function sd(n,t,{horizontal:e,minRotation:i}){const s=Yt(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Sr extends Un{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,e){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=je(s),c=je(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=$b(s,r);return t.bounds==="ticks"&&uc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return qi(t,this.chart.options.locale,this.options.ticks.format)}}class ca extends Sr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Et(t)?t:0,this.max=Et(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(ca,"id","linear"),P(ca,"defaults",{ticks:{callback:er.formatters.numeric}});const ds=n=>Math.floor(yn(n)),qn=(n,t)=>Math.pow(10,ds(n)+t);function rd(n){return n/Math.pow(10,ds(n))===1}function od(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Ub(n,t){const e=t-n;let i=ds(e);for(;od(n,t,i)>10;)i++;for(;od(n,t,i)<10;)i--;return Math.min(i,ds(n))}function qb(n,{min:t,max:e}){t=ke(n.min,t);const i=[],s=ds(t);let r=Ub(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=ke(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h<e;)i.push({value:h,major:rd(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=ke(n.max,h);return i.push({value:g,major:rd(g),significand:d}),i}class ua extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Sr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Et(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Et(t)?Math.max(0,t):null,this.max=Et(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Et(this._userMin)&&(this.min=t===qn(this.min,0)?qn(this.min,-1):qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(qn(i,-1)),o(qn(s,1)))),i<=0&&r(qn(s,-1)),s<=0&&o(qn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=qb(e,this);return t.bounds==="ticks"&&uc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=yn(t),this._valueRange=yn(this.max)-yn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(yn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(ua,"id","logarithmic"),P(ua,"defaults",{ticks:{callback:er.formatters.logarithmic,major:{enabled:!0}}});function da(n){const t=n.ticks;if(t.display&&n.display){const e=jt(t.backdropPadding);return it(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function Xb(n,t,e){return e=_t(e)?e:[e],{w:sp(n,t.string,e),h:e.length*t.lineHeight}}function ad(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Gb(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?dt/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=At(c.font),h=Xb(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=De(n.getIndexAngle(l)+a),p=Math.round(Qs(g)),b=ad(p,u.x,h.w,0,180),w=ad(p,u.y,h.h,90,270);Kb(e,t,g,b,w)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Jb(n,i,s)}function Kb(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function Zb(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(Qs(De(l.angle+Ot))),u=n0(l.y,a.h,c),d=t0(c),h=e0(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 Qb(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function Jb(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:da(r)/2,additionalAngle:o?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=Zb(n,u,l);i.push(d),a==="auto"&&(d.visible=Qb(d,c),d.visible&&(c=d))}return i}function t0(n){return n===0||n===180?"center":n<180?"left":"right"}function e0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function n0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function i0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=_n(t.borderRadius),c=jt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),ui(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function s0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));i0(e,o,r);const a=At(o.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function ld(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,kt);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function r0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),ld(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function o0(n,t,e){return xn(n,{label:e,index:t,type:"pointLabel"})}class hs extends Sr{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=jt(da(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Et(t)&&!isNaN(t)?t:0,this.max=Et(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/da(this.options))}generateTickLabels(t){Sr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=xt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Gb(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return De(t*e+Yt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(st(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return o0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),ld(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&s0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),p=r.setContext(h);r0(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.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(e.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,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=At(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=jt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Yn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(hs,"id","radialLinear"),P(hs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:er.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(hs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(hs,"descriptors",{angleLines:{_fallback:"grid"}});const kr={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}},pe=Object.keys(kr);function cd(n,t){return n-t}function ud(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Et(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(bn(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function dd(n,t,e,i){const s=pe.length;for(let r=pe.indexOf(n);r<s-1;++r){const o=kr[pe[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return pe[r]}return pe[s-1]}function a0(n,t,e,i,s){for(let r=pe.length-1;r>=pe.indexOf(e);r--){const o=pe[r];if(kr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return pe[e?pe.indexOf(e):0]}function l0(n){for(let t=pe.indexOf(n)+1,e=pe.length;t<e;++t)if(kr[pe[t]].common)return pe[t]}function hd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=To(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function c0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function fd(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:c0(n,i,s,e)}class fs extends Un{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new nu._date(t.adapters.date);s.init(e),ji(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ud(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Et(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Et(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=$g(s,r,o);return this._unit=e.unit||(i.autoSkip?dd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):a0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:l0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),fd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Xt(e,0,o),i=Xt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||dd(r.minUnit,e,i,this._getLabelCapacity(e)),a=it(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=bn(l)||l===!0,u={};let d=e,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h<i;h=+t.add(h,a,o),g++)hd(u,h,p);return(h===i||s.bounds==="ticks"||g===1)&&hd(u,h,p),Object.keys(u).sort(cd).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return xt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[e],g=c&&d&&h&&h.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Yt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,fd(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(ud(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gc(t.sort(cd))}}P(fs,"id","time"),P(fs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Dr(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=tn(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=tn(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class ha extends fs{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Dr(e,this.min),this._tableRange=Dr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Dr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Dr(this._table,i*this._tableRange+this._minPos,!0)}}P(ha,"id","timeseries"),P(ha,"defaults",fs.defaults);var u0=Object.freeze({__proto__:null,CategoryScale:la,LinearScale:ca,LogarithmicScale:ua,RadialLinearScale:hs,TimeScale:fs,TimeSeriesScale:ha});const d0=[_m,qy,Wb,u0],h0=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],f0=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],g0=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],p0=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],gd=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function fa(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?p0:g0:t.binary?f0:h0,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),n<1){const u=gd(n,t.locale,o);return r+u+i+e[0]}const a=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**a,o||(n=n.toPrecision(3));const l=gd(Number(n),t.locale,o),c=e[a];return r+l+i+c}const pd=6048e5,m0=864e5,gs=6e4,pi=36e5,y0=1e3,md=Symbol.for("constructDateFrom");function Nt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&md in n?n[md](t):n instanceof Date?new n.constructor(t):new Date(t)}function rt(n,t){return Nt(t||n,n)}function Tr(n,t,e){const i=rt(n,e==null?void 0:e.in);return isNaN(t)?Nt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ga(n,t,e){const i=rt(n,e==null?void 0:e.in);if(isNaN(t))return Nt(n,NaN);if(!t)return i;const s=i.getDate(),r=Nt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function pa(n,t,e){return Nt(n,+rt(n)+t)}function b0(n,t,e){return pa(n,t*pi)}let _0={};function Xn(){return _0}function Ue(n,t){var a,l,c,u;const e=Xn(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=rt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function mi(n,t){return Ue(n,{...t,weekStartsOn:1})}function yd(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Nt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=mi(s),o=Nt(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=mi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Cr(n){const t=rt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Gn(n,...t){const e=Nt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ma(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function bd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ma(i),o=ma(s),a=+r-Cr(r),l=+o-Cr(o);return Math.round((a-l)/m0)}function x0(n,t){const e=yd(n,t),i=Nt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),mi(i)}function w0(n,t,e){const i=rt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*gs),i}function v0(n,t,e){return ga(n,t*3,e)}function M0(n,t,e){return pa(n,t*1e3)}function S0(n,t,e){return Tr(n,t*7,e)}function k0(n,t,e){return ga(n,t*12,e)}function ps(n,t){const e=+rt(n)-+rt(t);return e<0?-1:e>0?1:e}function D0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ya(n){return!(!D0(n)&&typeof n!="number"||isNaN(+rt(n)))}function T0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function C0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function _d(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=xd(i,s),o=Math.abs(bd(i,s));i.setDate(i.getDate()-r*o);const a=+(xd(i,s)===-r),l=r*(o-a);return l===0?0:l}function xd(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function ms(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function O0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/pi;return ms(e==null?void 0:e.roundingMethod)(r)}function ba(n,t){return+rt(n)-+rt(t)}function P0(n,t,e){const i=ba(n,t)/gs;return ms(e==null?void 0:e.roundingMethod)(i)}function wd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function vd(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function E0(n,t){const e=rt(n,t==null?void 0:t.in);return+wd(e,t)==+vd(e,t)}function Md(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),o=ps(s,r),a=Math.abs(T0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ps(s,r)===-o;E0(i)&&a===1&&ps(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function A0(n,t,e){const i=Md(n,t,e)/3;return ms(e==null?void 0:e.roundingMethod)(i)}function R0(n,t,e){const i=ba(n,t)/1e3;return ms(e==null?void 0:e.roundingMethod)(i)}function L0(n,t,e){const i=_d(n,t,e)/7;return ms(e==null?void 0:e.roundingMethod)(i)}function I0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ps(i,s),o=Math.abs(C0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-r,l=r*(o-+a);return l===0?0:l}function N0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function F0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function z0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Sd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function B0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function H0(n,t){var a,l;const e=Xn(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=rt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function W0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Y0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function j0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const V0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$0=(n,t,e)=>{let i;const s=V0[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function _a(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const U0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},q0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},X0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},G0={date:_a({formats:U0,defaultWidth:"full"}),time:_a({formats:q0,defaultWidth:"full"}),dateTime:_a({formats:X0,defaultWidth:"full"})},K0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Z0=(n,t,e,i)=>K0[n];function ys(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Q0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},J0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},t_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},e_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},n_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},i_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},s_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:ys({values:Q0,defaultWidth:"wide"}),quarter:ys({values:J0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ys({values:t_,defaultWidth:"wide"}),day:ys({values:e_,defaultWidth:"wide"}),dayPeriod:ys({values:n_,defaultWidth:"wide",formattingValues:i_,defaultFormattingWidth:"wide"})};function bs(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?o_(a,d=>d.test(o)):r_(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function r_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function o_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function a_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const l_=/^(\d+)(th|st|nd|rd)?/i,c_=/\d+/i,u_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},d_={any:[/^b/i,/^(a|c)/i]},h_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},f_={any:[/1/i,/2/i,/3/i,/4/i]},g_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},p_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},m_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},y_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},b_={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},__={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},x_={ordinalNumber:a_({matchPattern:l_,parsePattern:c_,valueCallback:n=>parseInt(n,10)}),era:bs({matchPatterns:u_,defaultMatchWidth:"wide",parsePatterns:d_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:h_,defaultMatchWidth:"wide",parsePatterns:f_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bs({matchPatterns:g_,defaultMatchWidth:"wide",parsePatterns:p_,defaultParseWidth:"any"}),day:bs({matchPatterns:m_,defaultMatchWidth:"wide",parsePatterns:y_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:b_,defaultMatchWidth:"any",parsePatterns:__,defaultParseWidth:"any"})},kd={code:"en-US",formatDistance:$0,formatLong:G0,formatRelative:Z0,localize:s_,match:x_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function w_(n,t){const e=rt(n,t==null?void 0:t.in);return bd(e,Sd(e))+1}function Dd(n,t){const e=rt(n,t==null?void 0:t.in),i=+mi(e)-+x0(e);return Math.round(i/pd)+1}function xa(n,t){var u,d,h,g;const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=Nt((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ue(o,t),l=Nt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ue(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function v_(n,t){var a,l,c,u;const e=Xn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=xa(n,t),r=Nt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ue(r,t)}function Td(n,t){const e=rt(n,t==null?void 0:t.in),i=+Ue(e,t)-+v_(e,t);return Math.round(i/pd)+1}function vt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Sn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return vt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):vt(e+1,2)},d(n,t){return vt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return vt(n.getHours()%12||12,t.length)},H(n,t){return vt(n.getHours(),t.length)},m(n,t){return vt(n.getMinutes(),t.length)},s(n,t){return vt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return vt(s,t.length)}},yi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cd={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Sn.y(n,t)},Y:function(n,t,e,i){const s=xa(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return vt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):vt(r,t.length)},R:function(n,t){const e=yd(n);return vt(e,t.length)},u:function(n,t){const e=n.getFullYear();return vt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return vt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return vt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Sn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return vt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Td(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):vt(s,t.length)},I:function(n,t,e){const i=Dd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):vt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Sn.d(n,t)},D:function(n,t,e){const i=w_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):vt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return vt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return vt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return vt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=yi.noon:i===0?s=yi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=yi.evening:i>=12?s=yi.afternoon:i>=4?s=yi.morning:s=yi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Sn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Sn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Sn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Sn.s(n,t)},S:function(n,t){return Sn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Pd(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Pd(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Od(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Od(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return vt(i,t.length)},T:function(n,t,e){return vt(+n,t.length)}};function Od(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+vt(r,2)}function Pd(n,t){return n%60===0?(n>0?"-":"+")+vt(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=vt(Math.trunc(i/60),2),r=vt(i%60,2);return e+s+t+r}const Ed=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ad=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},wa={p:Ad,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ed(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Ed(i,t)).replace("{{time}}",Ad(s,t))}},M_=/^D+$/,S_=/^Y+$/,k_=["D","DD","YY","YYYY"];function Rd(n){return M_.test(n)}function Ld(n){return S_.test(n)}function va(n,t,e){const i=D_(n,t,e);if(console.warn(i),k_.includes(n))throw new RangeError(i)}function D_(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const T_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,C_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,O_=/^'([^]*?)'?$/,P_=/''/g,E_=/[a-zA-Z]/;function Id(n,t,e){var u,d,h,g,p,b,w,v;const i=Xn(),s=(e==null?void 0:e.locale)??i.locale??kd,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(h=i.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((v=(w=i.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??0,a=rt(n,e==null?void 0:e.in);if(!ya(a))throw new RangeError("Invalid time value");let l=t.match(C_).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=wa[D];return k(S,s.formatLong)}return S}).join("").match(T_).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:A_(S)};if(Cd[D])return{isToken:!0,value:S};if(D.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Ld(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Rd(D))&&va(D,t,String(n));const k=Cd[D[0]];return k(a,D,s.localize,c)}).join("")}function A_(n){const t=n.match(O_);return t?t[1].replace(P_,"'"):n}function Nd(){return Object.assign({},Xn())}function R_(n,t){const e=rt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function L_(n,t){const e=I_(t)?new t(0):Nt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function I_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const N_=10;class Fd{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class F_ extends Fd{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class z_ extends Fd{constructor(e,i){super();P(this,"priority",N_);P(this,"subPriority",-1);this.context=e||(s=>Nt(i,s))}set(e,i){return i.timestampIsSet?e:Nt(e,L_(e,this.context))}}class mt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new F_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class B_ extends mt{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Ht={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},qe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Wt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Xe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*pi+r*gs+o*y0),rest:t.slice(e[0].length)}}function zd(n){return Lt(Ht.anyDigitsSigned,n)}function Ft(n,t){switch(n){case 1:return Lt(Ht.singleDigit,t);case 2:return Lt(Ht.twoDigits,t);case 3:return Lt(Ht.threeDigits,t);case 4:return Lt(Ht.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Or(n,t){switch(n){case 1:return Lt(Ht.singleDigitSigned,t);case 2:return Lt(Ht.twoDigitsSigned,t);case 3:return Lt(Ht.threeDigitsSigned,t);case 4:return Lt(Ht.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ma(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Bd(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function Hd(n){return n%400===0||n%4===0&&n%100!==0}class H_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return Wt(Ft(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=Bd(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class W_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Wt(Ft(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=xa(e,r);if(s.isTwoDigitYear){const l=Bd(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}}class Y_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Or(i==="R"?4:i.length,e)}set(e,i,s){const r=Nt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),mi(r)}}class j_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Or(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class V_ extends mt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Ft(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class $_ extends mt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Ft(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class U_ extends mt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Wt(Lt(Ht.month,e),r);case"MM":return Wt(Ft(2,e),r);case"Mo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class q_ extends mt{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return Wt(Lt(Ht.month,e),r);case"LL":return Wt(Ft(2,e),r);case"Lo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function X_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Td(i,e)-t;return i.setDate(i.getDate()-s*7),rt(i,e==null?void 0:e.in)}class G_ extends mt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ue(X_(e,s,r),r)}}function K_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Dd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Z_ extends mt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return mi(K_(e,s))}}const Q_=[31,28,31,30,31,30,31,31,30,31,30,31],J_=[31,29,31,30,31,30,31,31,30,31,30,31];class tx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Hd(s),o=e.getMonth();return r?i>=1&&i<=J_[o]:i>=1&&i<=Q_[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class ex extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear();return Hd(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Sa(n,t,e){var d,h,g,p;const i=Xn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=rt(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Tr(r,u,e)}class nx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}class ix extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Wt(Ft(i.length,e),o);case"eo":return Wt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}class sx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Wt(Ft(i.length,e),o);case"co":return Wt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}function rx(n,t,e){const i=rt(n,e==null?void 0:e.in),s=R_(i,e),r=t-s;return Tr(i,r,e)}class ox extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return Ft(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Wt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Wt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Wt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Wt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=rx(e,s),e.setHours(0,0,0,0),e}}class ax extends mt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class lx extends mt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class cx extends mt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class ux extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class dx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class hx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class fx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class gx extends mt{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class px extends mt{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class mx extends mt{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Ft(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class yx extends mt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Xe(qe.basicOptionalMinutes,e);case"XX":return Xe(qe.basic,e);case"XXXX":return Xe(qe.basicOptionalSeconds,e);case"XXXXX":return Xe(qe.extendedOptionalSeconds,e);case"XXX":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class bx extends mt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Xe(qe.basicOptionalMinutes,e);case"xx":return Xe(qe.basic,e);case"xxxx":return Xe(qe.basicOptionalSeconds,e);case"xxxxx":return Xe(qe.extendedOptionalSeconds,e);case"xxx":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class _x extends mt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s*1e3),{timestampIsSet:!0}]}}class xx extends mt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s),{timestampIsSet:!0}]}}const wx={G:new B_,y:new H_,Y:new W_,R:new Y_,u:new j_,Q:new V_,q:new $_,M:new U_,L:new q_,w:new G_,I:new Z_,d:new tx,D:new ex,E:new nx,e:new ix,c:new sx,i:new ox,a:new ax,b:new lx,B:new cx,h:new ux,H:new dx,K:new hx,k:new fx,m:new gx,s:new px,S:new mx,X:new yx,x:new bx,t:new _x,T:new xx},vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sx=/^'([^]*?)'?$/,kx=/''/g,Dx=/\S/,Tx=/[a-zA-Z]/;function Cx(n,t,e,i){var w,v,S,D,k,C,R,E;const s=()=>Nt((i==null?void 0:i.in)||e,NaN),r=Nd(),o=(i==null?void 0:i.locale)??r.locale??kd,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(w=i==null?void 0:i.locale)==null?void 0:w.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(S=r.locale)==null?void 0:S.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((C=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:C.weekStartsOn)??r.weekStartsOn??((E=(R=r.locale)==null?void 0:R.options)==null?void 0:E.weekStartsOn)??0;if(!t)return n?s():rt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new z_(i==null?void 0:i.in,e)],d=t.match(Mx).map(m=>{const _=m[0];if(_ in wa){const T=wa[_];return T(m,o.formatLong)}return m}).join("").match(vx),h=[];for(let m of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Ld(m)&&va(m,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Rd(m)&&va(m,t,n);const _=m[0],T=wx[_];if(T){const{incompatibleTokens:A}=T;if(Array.isArray(A)){const N=h.find(B=>A.includes(B.token)||B.token===_);if(N)throw new RangeError(`The format string mustn't contain \`${N.fullToken}\` and \`${m}\` at the same time`)}else if(T.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${m}\` and any other token at the same time`);h.push({token:_,fullToken:m});const L=T.run(n,m,o.match,c);if(!L)return s();u.push(L.setter),n=L.rest}else{if(_.match(Tx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(m==="''"?m="'":_==="'"&&(m=Ox(m)),n.indexOf(m)===0)n=n.slice(m.length);else return s()}}if(n.length>0&&Dx.test(n))return s();const g=u.map(m=>m.priority).sort((m,_)=>_-m).filter((m,_,T)=>T.indexOf(m)===_).map(m=>u.filter(_=>_.priority===m).sort((_,T)=>T.subPriority-_.subPriority)).map(m=>m[0]);let p=rt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const m of g){if(!m.validate(p,c))return s();const _=m.set(p,b,c);Array.isArray(_)?(p=_[0],Object.assign(b,_[1])):p=_}return p}function Ox(n){return n.match(Sx)[1].replace(kx,"'")}function Px(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ex(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Ax(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Rx(n){const t=n/pi;return Math.trunc(t)}function Wd(n,t){const e=()=>Nt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Fx(n);let r;if(s.date){const c=zx(s.date,i);r=Bx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Hx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Wx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=rt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return rt(o+a+l,t==null?void 0:t.in)}const Pr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Lx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ix=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Fx(n){const t={},e=n.split(Pr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Pr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Pr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Pr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function zx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Bx(n,t){if(t===null)return new Date(NaN);const e=n.match(Lx);if(!e)return new Date(NaN);const i=!!e[4],s=_s(e[1]),r=_s(e[2])-1,o=_s(e[3]),a=_s(e[4]),l=_s(e[5])-1;if(i)return Ux(t,a,l)?Yx(t,a,l):new Date(NaN);{const c=new Date(0);return!Vx(t,r,o)||!$x(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function _s(n){return n?parseInt(n):1}function Hx(n){const t=n.match(Ix);if(!t)return NaN;const e=ka(t[1]),i=ka(t[2]),s=ka(t[3]);return qx(e,i,s)?e*pi+i*gs+s*1e3:NaN}function ka(n){return n&&parseFloat(n.replace(",","."))||0}function Wx(n){if(n==="Z")return 0;const t=n.match(Nx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Xx(i,s)?e*(i*pi+s*gs):NaN}function Yx(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const jx=[31,null,31,30,31,30,31,31,30,31,30,31];function Yd(n){return n%400===0||n%4===0&&n%100!==0}function Vx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(jx[t]||(Yd(n)?29:28))}function $x(n,t){return t>=1&&t<=(Yd(n)?366:365)}function Ux(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function qx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Xx(n,t){return t>=0&&t<=59}const Da=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!n.locked){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["horizontal_bar","vertical_bar"].includes(n.chartType),c=["gauge","doughnut"].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const h=c?u.parsed:u.parsed[a];let g;if(n.units==="bytes")g=isNaN(h)?h:fa(h);else{const b=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?Er.format(h):Er.format(Number(h.toFixed($d)))} ${b}`}let p;return l&&u.dataset.label!==u.label?p=u.dataset.label:c?p=u.dataset.labels[u.dataIndex]:p=u.dataset.label,{backgroundColor:o[d].backgroundColor,borderColor:o[d].borderColor,label:p,value:g,rawValue:h,isSegmentEmpty:u.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Gx=n=>n&&n.datasets&&n.datasets.length,Kx=n=>Gx(n)&&n.datasets.some(t=>t.data.length),Zx=n=>n.datasets.some(t=>t.data[0]&&ya(t.data[0].x)),Qx=n=>!!Kx(n)&&n.datasets.some(t=>t.data.length==1),Jx=n=>Zx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Ta=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},tw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function jd(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Vd=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},$d=2,Ud=10,qd=12,Er=new Intl.NumberFormat(((og=document==null?void 0:document.documentElement)==null?void 0:og.lang)||"en-US"),Ar=10,Xd={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Rr=(n,t)=>(t||on)[n%on.length],Gd=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},Kd="#6f7787",Zd={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},ew=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Zd[t])==null?void 0:e.background)||"#fafafa"},nw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},iw={"4XX":"#FFBA81","5XX":"#FF8484"},sw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},rw="#dad4c7",Qd="#afb7c5",ow=n=>{const t=Object.entries(Xd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Xd.standard},Ca=(n,t,e,i)=>{let s;return e?s=Qd:Array.isArray(i)?s=Rr(n,i):s=i[t],s||Rr(n)},aw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},lw=2,cw=0,Oa=new Map,Pa=(n,t)=>t==="bytes"?fa(n):t==="count/minute"?n.toFixed(2):Er.format(n),Jd=n=>{const e=document.createElement("canvas").getContext("2d"),i=At({});return e.font=i.string,e.measureText(n).width},uw=()=>{const n="label_height";if(!Oa.has(n)){const t=At({});Oa.set(n,t.lineHeight)}return Oa.get(n)},dw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),th=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),eh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ea="#e0e4ea",hw={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},xs=(n,t)=>{let e=1;const i=hw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},nh=new Map([[100,xs("100",[100,101,102,103])],[200,xs("200",[200,201,202,203,204,205,206,207,208,226])],[300,xs("300",[300,301,302,303,304,305,307,308])],[400,xs("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,xs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Aa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=nh.get(e);return i===void 0?Ea:i.get(t)??i.get(-1)??Ea},fw=n=>{const t=Aa(n);return{solid:t,light:t}},Lr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Aa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function ih(n,t,e){const i=Nd(),s=mw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?gw(s,t):pw(s,t)}function gw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function pw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function mw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function yw(n,t){const e=vw(t);return"formatToParts"in e?_w(e,n):xw(e,n)}const bw={year:0,month:1,day:2,hour:3,minute:4,second:5};function _w(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=bw[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function xw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Ra={},sh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),ww=sh==="06/25/2014, 00:00:00"||sh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function vw(n){return Ra[n]||(Ra[n]=ww?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ra[n]}function rh(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const oh=36e5,Mw=6e4,La={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ia(n,t,e){if(!n)return 0;let i=La.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=La.timezoneHH.exec(n),i)return s=parseInt(i[1],10),ah(s)?-(s*oh):NaN;if(i=La.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return ah(s,o)?(r=Math.abs(s)*oh+o*Mw,i[1]==="+"?-r:r):NaN}if(Dw(n)){t=new Date(t||Date.now());const o=e?t:Sw(t),a=Na(o,n);return-(e?a:kw(t,a,n))}return NaN}function Sw(n){return rh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Na(n,t){const e=yw(n,t),i=rh(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function kw(n,t,e){let s=n.getTime()-t;const r=Na(new Date(s),e);if(t===r)return t;s-=r-t;const o=Na(new Date(s),e);return r===o?r:Math.max(r,o)}function ah(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const lh={};function Dw(n){if(lh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),lh[n]=!0,!0}catch{return!1}}const Tw=60*1e3,Cw={X:function(n,t,e){const i=Fa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return ch(i);case"XXXX":case"XX":return bi(i);case"XXXXX":case"XXX":default:return bi(i,":")}},x:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"x":return ch(i);case"xxxx":case"xx":return bi(i);case"xxxxx":case"xxx":default:return bi(i,":")}},O:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ow(i,":");case"OOOO":default:return"GMT"+bi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ih("short",n,e);case"zzzz":default:return ih("long",n,e)}}};function Fa(n,t){const e=n?Ia(n,t,!0)/Tw:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ir(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function bi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ir(Math.floor(i/60),2),r=Ir(Math.floor(i%60),2);return e+s+t+r}function ch(n,t){return n%60===0?(n>0?"-":"+")+Ir(Math.abs(n)/60,2):bi(n,t)}function Ow(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ir(r,2)}function uh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Pw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,za=36e5,dh=6e4,Ew=2,le={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Pw};function hh(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Ew:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Aw(n),{year:s,restDateString:r}=Rw(i.date,e),o=Lw(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Iw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ia(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=uh(new Date(a+l)),c=uh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Aw(n){const t={};let e=le.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=le.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=le.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Rw(n,t){if(n){const e=le.YYY[t],i=le.YYYYY[t];let s=le.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=le.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Lw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=le.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,ph(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=le.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return zw(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=le.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return ph(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=le.Www.exec(n),r)return s=parseInt(r[1],10)-1,mh(s)?fh(t,s):new Date(NaN);if(r=le.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return mh(s,o)?fh(t,s,o):new Date(NaN)}return null}function Iw(n){let t,e,i=le.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ba(t)?t%24*za:NaN;if(i=le.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ba(t,e)?t%24*za+e*dh:NaN;if(i=le.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ba(t,e,s)?t%24*za+e*dh+s*1e3:NaN}return null}function fh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Nw=[31,28,31,30,31,30,31,31,30,31,30,31],Fw=[31,29,31,30,31,30,31,31,30,31,30,31];function gh(n){return n%400===0||n%4===0&&n%100!==0}function ph(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gh(n);if(i&&e>Fw[t]||!i&&e>Nw[t])return!1}return!0}function zw(n,t){if(t<1)return!1;const e=gh(n);return!(e&&t>366||!e&&t>365)}function mh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ba(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ha(n,t,e={}){t=String(t);const i=t.match(Bw);if(i){const s=hh(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Cw[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Id(n,t,e)}function Hw(n,t,e){n=hh(n,e);const i=Ia(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Zn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Ha(Hw(n,t,{timeZone:i.timeZone}),e,i)}const Ww=Intl.DateTimeFormat().resolvedOptions().timeZone,yh=(n,t,e,i=Ww)=>["secondly","tenSecondly","thirtySecondly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a"):["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm a":"h:mm a"):t==="twelveHourly"?Zn(n,i,"yyyy-MM-dd h:mm a"):t==="daily"?Zn(n,i,"yyyy-MM-dd"):t==="weekly"?`${Zn(n,i,"yyyy")} W${Zn(n,i,"II")}`:Zn(n,i,"yyyy-MM-dd h:mm:ss a");function Yw(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Mr.positioners.barChartTooltipPosition=function(o,a){if(!o.length)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=l.width/2,d=Ta(a,c,u),h=a.y,g=a.x<u?"left":"center";return{x:d-n.tooltipState.offsetX,y:h-n.tooltipState.offsetY,xAlign:g}},Go.modes.customInteractionMode=function(o,a){const l=wn(a,o),c=[];return Go.evaluateInteractionItems(o,o.options.indexAxis||"x",l,(u,d,h)=>{o.options.indexAxis==="y"&&u.inYRange(l.y,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h}),o.options.indexAxis==="x"&&u.inXRange(l.x,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h})}),c};const e=n.numLabels.value>25?Ud:qd,i=({chart:o,index:a})=>{var c;const l=o.data;return{size:e,style:(c=l==null?void 0:l.isLabelEmpty)!=null&&c[a]?"italic":"normal"}},s=(o,a,l)=>o.chart.options.indexAxis===o.axis?(a=o.getLabelForValue(l),a&&a.length>Ar?a.slice(0,Ar)+"...":a):o.getLabelForValue(Number(a));return f.computed(()=>{var o,a,l,c,u,d,h,g;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:i,callback:function(p,b){return s(this,p,b)}},title:{display:n.indexAxis==="y"?!st((o=n.metricAxesTitle)==null?void 0:o.value):!st((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(l=n.metricAxesTitle)==null?void 0:l.value:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:i,callback:function(p,b){return s(this,p,b)}},title:{display:n.indexAxis==="x"?!st((u=n.metricAxesTitle)==null?void 0:u.value):!st((d=n.dimensionAxesTitle)==null?void 0:d.value),text:n.indexAxis==="x"?(h=n.metricAxesTitle)==null?void 0:h.value:(g=n.dimensionAxesTitle)==null?void 0:g.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:p=>{Da(n.tooltipState,p)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Pe.register(...d0);const jw=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function Vw(n,t,e,i,s){const r=f.shallowRef(null),o=(a,l)=>{if(t.value)return new Pe(t.value,{type:n,data:a,plugins:i,options:l})};return f.onMounted(()=>{r.value=o(e.value,s.value)}),f.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),f.watch(e,(a,l)=>{if(jw(l,a)&&!st(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=o(a,s.value)}),f.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),f.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(st(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,b){b&&b%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var d;u=u||{};var h=c<0;h&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<o?d=e(c,r,u)+"m":c<a?d=t(e(c,o,u),u)+"b":d=t(e(c,a,u),u)+"t",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(bh);var $w=bh.exports;const ws=Wa($w);function Uw(n,t,e){const{i18n:i}=yt.useI18n(),{translateUnit:s}=yt.useTranslatedUnits();return{legendValues:f.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":fa(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var qw=Object.defineProperty,Xw=(n,t,e)=>t in n?qw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ee=(n,t,e)=>Xw(n,typeof t!="symbol"?t+"":t,e),ct=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(ct||{});const Gw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],vs=n=>n.filter(t=>t!=="time"),_h=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Kw=vs(_h),Zw=[..._h,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version"],Qw=vs(Zw),Jw=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],t1=vs(Jw);vs(["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),vs(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Kw),new Set(Qw),new Set(t1);const xh=6048e5,e1=864e5,n1=60,i1=3600,wh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wh in n?n[wh](t):n instanceof Date?new n.constructor(t):new Date(t)}function ce(n,t){return Ae(t||n,n)}function vh(n,t,e){const i=ce(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function s1(n,t,e){const i=ce(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let r1={};function Ms(){return r1}function an(n,t){var e,i,s,r;const o=Ms(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=ce(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Nr(n,t){return an(n,{...t,weekStartsOn:1})}function Mh(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Nr(s),o=Ae(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=Nr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Sh(n){const t=ce(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function o1(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Fr(n,t){const e=ce(n,void 0);return e.setHours(0,0,0,0),e}function a1(n,t,e){const[i,s]=o1(void 0,n,t),r=Fr(i),o=Fr(s),a=+r-Sh(r),l=+o-Sh(o);return Math.round((a-l)/e1)}function l1(n,t){const e=Mh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Nr(i)}function c1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function u1(n){return!(!c1(n)&&typeof n!="number"||isNaN(+ce(n)))}function _i(n,t){const e=ce(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function d1(n,t){const e=ce(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const h1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},f1=(n,t,e)=>{let i;const s=h1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ya(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const g1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},p1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},m1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y1={date:Ya({formats:g1,defaultWidth:"full"}),time:Ya({formats:p1,defaultWidth:"full"}),dateTime:Ya({formats:m1,defaultWidth:"full"})},b1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_1=(n,t,e,i)=>b1[n];function Ss(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const x1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},w1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},v1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},M1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},S1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},k1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},D1=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},T1={ordinalNumber:D1,era:Ss({values:x1,defaultWidth:"wide"}),quarter:Ss({values:w1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:v1,defaultWidth:"wide"}),day:Ss({values:M1,defaultWidth:"wide"}),dayPeriod:Ss({values:S1,defaultWidth:"wide",formattingValues:k1,defaultFormattingWidth:"wide"})};function ks(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?O1(a,d=>d.test(o)):C1(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function C1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function O1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function P1(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const E1=/^(\d+)(th|st|nd|rd)?/i,A1=/\d+/i,R1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},L1={any:[/^b/i,/^(a|c)/i]},I1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},N1={any:[/1/i,/2/i,/3/i,/4/i]},F1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},z1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},B1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},H1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},W1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Y1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},j1={ordinalNumber:P1({matchPattern:E1,parsePattern:A1,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:L1,defaultParseWidth:"any"}),quarter:ks({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:N1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:F1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),day:ks({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:H1,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:W1,defaultMatchWidth:"any",parsePatterns:Y1,defaultParseWidth:"any"})},V1={code:"en-US",formatDistance:f1,formatLong:y1,formatRelative:_1,localize:T1,match:j1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $1(n,t){const e=ce(n,void 0);return a1(e,d1(e))+1}function U1(n,t){const e=ce(n,void 0),i=+Nr(e)-+l1(e);return Math.round(i/xh)+1}function kh(n,t){var e,i,s,r;const o=ce(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ms(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=an(u,t),h=Ae((t==null?void 0:t.in)||n,0);h.setFullYear(a,0,c),h.setHours(0,0,0,0);const g=an(h,t);return+o>=+d?a+1:+o>=+g?a:a-1}function q1(n,t){var e,i,s,r;const o=Ms(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=kh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),an(c,t)}function X1(n,t){const e=ce(n,t==null?void 0:t.in),i=+an(e,t)-+q1(e,t);return Math.round(i/xh)+1}function Mt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const kn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Mt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Mt(e+1,2)},d(n,t){return Mt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Mt(n.getHours()%12||12,t.length)},H(n,t){return Mt(n.getHours(),t.length)},m(n,t){return Mt(n.getMinutes(),t.length)},s(n,t){return Mt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Mt(s,t.length)}},xi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return kn.y(n,t)},Y:function(n,t,e,i){const s=kh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Mt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Mt(r,t.length)},R:function(n,t){const e=Mh(n);return Mt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Mt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Mt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Mt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return kn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Mt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=X1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Mt(s,t.length)},I:function(n,t,e){const i=U1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Mt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):kn.d(n,t)},D:function(n,t,e){const i=$1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Mt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Mt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Mt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Mt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=xi.noon:i===0?s=xi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=xi.evening:i>=12?s=xi.afternoon:i>=4?s=xi.morning:s=xi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return kn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):kn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Mt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Mt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):kn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):kn.s(n,t)},S:function(n,t){return kn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ch(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ch(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Th(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Th(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Mt(i,t.length)},T:function(n,t,e){return Mt(+n,t.length)}};function Th(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Mt(r,2)}function Ch(n,t){return n%60===0?(n>0?"-":"+")+Mt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Mt(Math.trunc(i/60),2),r=Mt(i%60,2);return e+s+t+r}const Oh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ph=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},G1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Oh(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Oh(i,t)).replace("{{time}}",Ph(s,t))},K1={p:Ph,P:G1},Z1=/^D+$/,Q1=/^Y+$/,J1=["D","DD","YY","YYYY"];function tv(n){return Z1.test(n)}function ev(n){return Q1.test(n)}function nv(n,t,e){const i=iv(n,t,e);if(console.warn(i),J1.includes(n))throw new RangeError(i)}function iv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const sv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ov=/^'([^]*?)'?$/,av=/''/g,lv=/[a-zA-Z]/;function cv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ms(),h=(e==null?void 0:e.locale)??d.locale??V1,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,b=ce(n,e==null?void 0:e.in);if(!u1(b))throw new RangeError("Invalid time value");let w=t.match(rv).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=K1[D];return k(S,h.formatLong)}return S}).join("").match(sv).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:uv(S)};if(Dh[D])return{isToken:!0,value:S};if(D.match(lv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});h.localize.preprocessor&&(w=h.localize.preprocessor(b,w));const v={firstWeekContainsDate:g,weekStartsOn:p,locale:h};return w.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ev(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&tv(D))&&nv(D,t,String(n));const k=Dh[D[0]];return k(b,D,h.localize,v)}).join("")}function uv(n){const t=n.match(ov);return t?t[1].replace(av,"'"):n}function dv(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function hv(){return Object.assign({},Ms())}function fv(n){return Math.trunc(n*i1)}function gv(n){const t=n/n1;return Math.trunc(t)}function Eh(n,t,e){return s1(n,-t)}function Ah(n,t,e){const i=hv(),s=yv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?pv(s,t):mv(s,t)}function pv(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function mv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function yv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function bv(n,t){const e=Mv(t);return"formatToParts"in e?xv(e,n):wv(e,n)}const _v={year:0,month:1,day:2,hour:3,minute:4,second:5};function xv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=_v[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function wv(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ja={},Rh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),vv=Rh==="06/25/2014, 00:00:00"||Rh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Mv(n){return ja[n]||(ja[n]=vv?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ja[n]}function Va(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const Lh=36e5,Sv=6e4,$a={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ds(n,t,e){if(!n)return 0;let i=$a.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=$a.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ih(s)?-(s*Lh):NaN;if(i=$a.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Ih(s,o)?(r=Math.abs(s)*Lh+o*Sv,i[1]==="+"?-r:r):NaN}if(Tv(n)){t=new Date(t||Date.now());const o=e?t:kv(t),a=Ua(o,n);return-(e?a:Dv(t,a,n))}return NaN}function kv(n){return Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=bv(n,t),i=Va(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Dv(n,t,e){let i=n.getTime()-t;const s=Ua(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ua(new Date(i),e);return s===r?s:Math.max(s,r)}function Ih(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Nh={};function Tv(n){if(Nh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Nh[n]=!0,!0}catch{return!1}}const Cv=60*1e3,Ov={X:function(n,t,e){const i=qa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return wi(i);case"XXXXX":case"XXX":default:return wi(i,":")}},x:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"x":return Fh(i);case"xxxx":case"xx":return wi(i);case"xxxxx":case"xxx":default:return wi(i,":")}},O:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Pv(i,":");case"OOOO":default:return"GMT"+wi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ah("short",n,e);case"zzzz":default:return Ah("long",n,e)}}};function qa(n,t){const e=n?Ds(n,t,!0)/Cv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function zr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function wi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=zr(Math.floor(i/60),2),r=zr(Math.floor(i%60),2);return e+s+t+r}function Fh(n,t){return n%60===0?(n>0?"-":"+")+zr(Math.abs(n)/60,2):wi(n,t)}function Pv(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+zr(r,2)}function zh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Bh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Xa=36e5,Hh=6e4,Ev=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Bh};function Br(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Ev:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Av(n),{year:s,restDateString:r}=Rv(i.date,e),o=Lv(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Iv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ds(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=zh(new Date(a+l)),c=zh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Av(n){const t={};let e=ue.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ue.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Rv(n,t){if(n){const e=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ue.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Lv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ue.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,jh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ue.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return zv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ue.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return jh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ue.Www.exec(n),r)return s=parseInt(r[1],10)-1,Vh(s)?Wh(t,s):new Date(NaN);if(r=ue.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Vh(s,o)?Wh(t,s,o):new Date(NaN)}return null}function Iv(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*Xa:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*Xa+e*Hh:NaN;if(i=ue.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,e,s)?t%24*Xa+e*Hh+s*1e3:NaN}return null}function Wh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Nv=[31,28,31,30,31,30,31,31,30,31,30,31],Fv=[31,29,31,30,31,30,31,31,30,31,30,31];function Yh(n){return n%400===0||n%4===0&&n%100!==0}function jh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Yh(n);if(i&&e>Fv[t]||!i&&e>Nv[t])return!1}return!0}function zv(n,t){if(t<1)return!1;const e=Yh(n);return!(e&&t>366||!e&&t>365)}function Vh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ga(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Hv(n,t,e={}){t=String(t);const i=t.match(Bv);if(i){const s=Br(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ov[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return cv(n,t,e)}function $h(n,t,e){n=Br(n,e);const i=Ds(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Wv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Hv($h(n,t,{timeZone:i.timeZone}),e,i)}function Yv(n,t,e){if(typeof n=="string"&&!n.match(Bh))return Br(n,{...e,timeZone:t});n=Br(n,e);const i=Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ds(t,new Date(i));return new Date(i+s)}function jv(n,t){return-Ds(n,t)}function Uh(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Wv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Vv={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Ka(n){return n&&Gw.find(t=>n<=Vv[t])||null}var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wr={exports:{}};Wr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",h="[object Map]",g="[object Number]",p="[object Object]",b="[object Promise]",w="[object RegExp]",v="[object Set]",S="[object String]",D="[object Symbol]",k="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",E="[object Float32Array]",m="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",A="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",B="[object Uint16Array]",G="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,H=/\w*$/,ut=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,et={};et[r]=et[o]=et[C]=et[R]=et[a]=et[l]=et[E]=et[m]=et[_]=et[T]=et[A]=et[h]=et[g]=et[p]=et[w]=et[v]=et[S]=et[D]=et[L]=et[N]=et[B]=et[G]=!0,et[c]=et[u]=et[k]=!1;var Dt=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,$=typeof self=="object"&&self&&self.Object===Object&&self,z=Dt||$||Function("return this")(),j=t&&!t.nodeType&&t,X=j&&!0&&n&&!n.nodeType&&n,Z=X&&X.exports===j;function tt(x,O){return x.set(O[0],O[1]),x}function q(x,O){return x.add(O),x}function V(x,O){for(var F=-1,K=x?x.length:0;++F<K&&O(x[F],F,x)!==!1;);return x}function ot(x,O){for(var F=-1,K=O.length,Vt=x.length;++F<K;)x[Vt+F]=O[F];return x}function J(x,O,F,K){for(var Vt=-1,Qt=x?x.length:0;++Vt<Qt;)F=O(F,x[Vt],Vt,x);return F}function Ct(x,O){for(var F=-1,K=Array(x);++F<x;)K[F]=O(F);return K}function pt(x,O){return x==null?void 0:x[O]}function Rt(x){var O=!1;if(x!=null&&typeof x.toString!="function")try{O=!!(x+"")}catch{}return O}function bt(x){var O=-1,F=Array(x.size);return x.forEach(function(K,Vt){F[++O]=[Vt,K]}),F}function ft(x,O){return function(F){return x(O(F))}}function $t(x){var O=-1,F=Array(x.size);return x.forEach(function(K){F[++O]=K}),F}var ie=Array.prototype,ye=Function.prototype,se=Object.prototype,Kt=z["__core-js_shared__"],St=function(){var x=/[^.]+$/.exec(Kt&&Kt.keys&&Kt.keys.IE_PROTO||"");return x?"Symbol(src)_1."+x:""}(),Tt=ye.toString,Zt=se.hasOwnProperty,gt=se.toString,Ge=RegExp("^"+Tt.call(Zt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Z?z.Buffer:void 0,Re=z.Symbol,re=z.Uint8Array,_e=ft(Object.getPrototypeOf,Object),Te=Object.create,te=se.propertyIsEnumerable,oe=ie.splice,zt=Object.getOwnPropertySymbols,Ci=be?be.isBuffer:void 0,En=ft(Object.keys,Object),Oi=Ln(z,"DataView"),si=Ln(z,"Map"),Ls=Ln(z,"Promise"),Is=Ln(z,"Set"),ri=Ln(z,"WeakMap"),ze=Ln(Object,"create"),Ns=we(Oi),Fs=we(si),zs=we(Ls),oi=we(Is),bl=we(ri),Jr=Re?Re.prototype:void 0,to=Jr?Jr.valueOf:void 0;function un(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function _l(){this.__data__=ze?ze(null):{}}function Pi(x){return this.has(x)&&delete this.__data__[x]}function Bs(x){var O=this.__data__;if(ze){var F=O[x];return F===i?void 0:F}return Zt.call(O,x)?O[x]:void 0}function eo(x){var O=this.__data__;return ze?O[x]!==void 0:Zt.call(O,x)}function dn(x,O){var F=this.__data__;return F[x]=ze&&O===void 0?i:O,this}un.prototype.clear=_l,un.prototype.delete=Pi,un.prototype.get=Bs,un.prototype.has=eo,un.prototype.set=dn;function Be(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function xl(){this.__data__=[]}function wl(x){var O=this.__data__,F=xe(O,x);if(F<0)return!1;var K=O.length-1;return F==K?O.pop():oe.call(O,F,1),!0}function vl(x){var O=this.__data__,F=xe(O,x);return F<0?void 0:O[F][1]}function Ml(x){return xe(this.__data__,x)>-1}function He(x,O){var F=this.__data__,K=xe(F,x);return K<0?F.push([x,O]):F[K][1]=O,this}Be.prototype.clear=xl,Be.prototype.delete=wl,Be.prototype.get=vl,Be.prototype.has=Ml,Be.prototype.set=He;function An(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function Sl(){this.__data__={hash:new un,map:new(si||Be),string:new un}}function kl(x){return Ri(this,x).delete(x)}function Dl(x){return Ri(this,x).get(x)}function Tl(x){return Ri(this,x).has(x)}function We(x,O){return Ri(this,x).set(x,O),this}An.prototype.clear=Sl,An.prototype.delete=kl,An.prototype.get=Dl,An.prototype.has=Tl,An.prototype.set=We;function Rn(x){this.__data__=new Be(x)}function Cl(){this.__data__=new Be}function Ol(x){return this.__data__.delete(x)}function Pl(x){return this.__data__.get(x)}function El(x){return this.__data__.has(x)}function Ei(x,O){var F=this.__data__;if(F instanceof Be){var K=F.__data__;if(!si||K.length<e-1)return K.push([x,O]),this;F=this.__data__=new An(K)}return F.set(x,O),this}Rn.prototype.clear=Cl,Rn.prototype.delete=Ol,Rn.prototype.get=Pl,Rn.prototype.has=El,Rn.prototype.set=Ei;function Al(x,O){var F=In(x)||uo(x)?Ct(x.length,String):[],K=F.length,Vt=!!K;for(var Qt in x)Zt.call(x,Qt)&&!(Vt&&(Qt=="length"||ql(Qt,K)))&&F.push(Qt);return F}function no(x,O,F){var K=x[O];(!(Zt.call(x,O)&&co(K,F))||F===void 0&&!(O in x))&&(x[O]=F)}function xe(x,O){for(var F=x.length;F--;)if(co(x[F][0],O))return F;return-1}function Rl(x,O){return x&&so(O,Ye(O),x)}function Hs(x,O,F,K,Vt,Qt,ve){var Ut;if(K&&(Ut=Qt?K(x,Vt,Qt,ve):K(x)),Ut!==void 0)return Ut;if(!Ii(x))return x;var Fi=In(x);if(Fi){if(Ut=oo(x),!O)return jl(x,Ut)}else{var Nn=hn(x),po=Nn==u||Nn==d;if(Kl(x))return zl(x,O);if(Nn==p||Nn==r||po&&!Qt){if(Rt(x))return Qt?x:{};if(Ut=Ul(po?{}:x),!O)return Vl(x,Rl(Ut,x))}else{if(!et[Nn])return Qt?x:{};Ut=ao(x,Nn,Hs,O)}}ve||(ve=new Rn);var mo=ve.get(x);if(mo)return mo;if(ve.set(x,Ut),!Fi)var yo=F?$l(x):Ye(x);return V(yo||x,function(Fn,zi){yo&&(zi=Fn,Fn=x[zi]),no(Ut,zi,Hs(Fn,O,F,K,zi,x,ve))}),Ut}function Ll(x){return Ii(x)?Te(x):{}}function Il(x,O,F){var K=O(x);return In(x)?K:ot(K,F(x))}function Nl(x){return gt.call(x)}function Fl(x){if(!Ii(x)||Li(x))return!1;var O=js(x)||Rt(x)?Ge:ut;return O.test(we(x))}function Ai(x){if(!lo(x))return En(x);var O=[];for(var F in Object(x))Zt.call(x,F)&&F!="constructor"&&O.push(F);return O}function zl(x,O){if(O)return x.slice();var F=new x.constructor(x.length);return x.copy(F),F}function Ws(x){var O=new x.constructor(x.byteLength);return new re(O).set(new re(x)),O}function io(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.byteLength)}function Bl(x,O,F){var K=O?F(bt(x),!0):bt(x);return J(K,tt,new x.constructor)}function Hl(x){var O=new x.constructor(x.source,H.exec(x));return O.lastIndex=x.lastIndex,O}function Ys(x,O,F){var K=O?F($t(x),!0):$t(x);return J(K,q,new x.constructor)}function Wl(x){return to?Object(to.call(x)):{}}function Yl(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.length)}function jl(x,O){var F=-1,K=x.length;for(O||(O=Array(K));++F<K;)O[F]=x[F];return O}function so(x,O,F,K){F||(F={});for(var Vt=-1,Qt=O.length;++Vt<Qt;){var ve=O[Vt],Ut=void 0;no(F,ve,Ut===void 0?x[ve]:Ut)}return F}function Vl(x,O){return so(x,ro(x),O)}function $l(x){return Il(x,Ye,ro)}function Ri(x,O){var F=x.__data__;return Xl(O)?F[typeof O=="string"?"string":"hash"]:F.map}function Ln(x,O){var F=pt(x,O);return Fl(F)?F:void 0}var ro=zt?ft(zt,Object):Vs,hn=Nl;(Oi&&hn(new Oi(new ArrayBuffer(1)))!=R||si&&hn(new si)!=h||Ls&&hn(Ls.resolve())!=b||Is&&hn(new Is)!=v||ri&&hn(new ri)!=k)&&(hn=function(x){var O=gt.call(x),F=O==p?x.constructor:void 0,K=F?we(F):void 0;if(K)switch(K){case Ns:return R;case Fs:return h;case zs:return b;case oi:return v;case bl:return k}return O});function oo(x){var O=x.length,F=x.constructor(O);return O&&typeof x[0]=="string"&&Zt.call(x,"index")&&(F.index=x.index,F.input=x.input),F}function Ul(x){return typeof x.constructor=="function"&&!lo(x)?Ll(_e(x)):{}}function ao(x,O,F,K){var Vt=x.constructor;switch(O){case C:return Ws(x);case a:case l:return new Vt(+x);case R:return io(x,K);case E:case m:case _:case T:case A:case L:case N:case B:case G:return Yl(x,K);case h:return Bl(x,K,F);case g:case S:return new Vt(x);case w:return Hl(x);case v:return Ys(x,K,F);case D:return Wl(x)}}function ql(x,O){return O=O??s,!!O&&(typeof x=="number"||Y.test(x))&&x>-1&&x%1==0&&x<O}function Xl(x){var O=typeof x;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?x!=="__proto__":x===null}function Li(x){return!!St&&St in x}function lo(x){var O=x&&x.constructor,F=typeof O=="function"&&O.prototype||se;return x===F}function we(x){if(x!=null){try{return Tt.call(x)}catch{}try{return x+""}catch{}}return""}function Ke(x){return Hs(x,!0,!0)}function co(x,O){return x===O||x!==x&&O!==O}function uo(x){return Gl(x)&&Zt.call(x,"callee")&&(!te.call(x,"callee")||gt.call(x)==r)}var In=Array.isArray;function ho(x){return x!=null&&fo(x.length)&&!js(x)}function Gl(x){return Ni(x)&&ho(x)}var Kl=Ci||go;function js(x){var O=Ii(x)?gt.call(x):"";return O==u||O==d}function fo(x){return typeof x=="number"&&x>-1&&x%1==0&&x<=s}function Ii(x){var O=typeof x;return!!x&&(O=="object"||O=="function")}function Ni(x){return!!x&&typeof x=="object"}function Ye(x){return ho(x)?Al(x):Ai(x)}function Vs(){return[]}function go(){return!1}n.exports=Ke}(Wr,Wr.exports),Wr.exports;const vi=(n,t)=>new Date(n.getTime()-jv(t,n));class Fe{constructor(t){Ee(this,"timeframeText"),Ee(this,"key"),Ee(this,"display"),Ee(this,"timeframeLength"),Ee(this,"allowedTiers"),Ee(this,"defaultResponseGranularity"),Ee(this,"dataGranularity"),Ee(this,"isRelative"),Ee(this,"fineGrainedDefaultGranularity"),Ee(this,"_startCustom"),Ee(this,"_endCustom"),Ee(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=Yv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return $h(e,t)}}class $v extends Fe{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Uv extends Fe{rawStart(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class qv extends Fe{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=vi(i,t)),i}}class Xv extends Fe{rawEnd(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}rawStart(t){let e=_i(Eh(this.tzAdjustedDate(t),1));return t&&(e=vi(e,t)),e}}ct.FIFTEEN_MIN,new Fe({key:ct.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),ct.ONE_HOUR,new Fe({key:ct.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),ct.SIX_HOUR,new Fe({key:ct.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ct.TWELVE_HOUR,new Fe({key:ct.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ct.ONE_DAY,new Fe({key:ct.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ct.SEVEN_DAY,new Fe({key:ct.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ct.THIRTY_DAY,new Fe({key:ct.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),ct.CURRENT_WEEK,new $v({key:ct.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ct.CURRENT_MONTH,new Uv({key:ct.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=_i(new Date);return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ct.PREVIOUS_WEEK,new qv({key:ct.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ct.PREVIOUS_MONTH,new Xv({key:ct.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=_i(new Date),e=_i(Eh(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Gv(t,e)),60*60*24*dv(new Date().setMonth(new Date().getMonth()-1))+fv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Gv(n,t){return gv(n.getTimezoneOffset()-t.getTimezoneOffset())}ct.FIFTEEN_MIN,ct.ONE_HOUR,ct.SIX_HOUR,ct.TWELVE_HOUR,ct.ONE_DAY,ct.SEVEN_DAY,ct.FIFTEEN_MIN,ct.ONE_HOUR,ct.SIX_HOUR,ct.TWELVE_HOUR,ct.ONE_DAY,ct.SEVEN_DAY,ct.THIRTY_DAY,ct.CURRENT_WEEK,ct.CURRENT_MONTH,ct.PREVIOUS_WEEK,ct.PREVIOUS_MONTH;function Kv(n){return f.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Uh(e)} - ${Uh(i,{includeTZ:!0})}`:""})}function Zv(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Mr.positioners.doughnutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,a=r.width/2,l=Ta(s,o,a),c=s.y,u=s.x<a?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Da(n.tooltipState,i)}}}}))}}function Qv(n){const t=f.computed(()=>{var o,a;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return yh(c,n.granularity.value,s.value)}},title:{display:!st((o=n.dimensionAxesTitle)==null?void 0:o.value),text:(a=n.dimensionAxesTitle)==null?void 0:a.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=f.computed(()=>{var o,a;return{title:{display:!st((o=n.metricAxesTitle)==null?void 0:o.value),text:(a=n.metricAxesTitle)==null?void 0:a.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),i={enabled:!1,position:"lineChartTooltipPosition"};Mr.positioners.lineChartTooltipPosition=function(o,a){if(!o.length||n.tooltipState.locked)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=n.tooltipState.height||this.height,d=l.width/2,h=l.height/2,g=Ta(a,c,d);let p=tw(a,u,h);const b=a.y<h?"top":"bottom",w=a.x<d?"left":"center";return u>l.height&&(p=0),{x:g,y:p,xAlign:w,yAlign:b}};const s=f.computed(()=>{const o=Number(n.timeRangeMs.value),a=new Date,l=new Date(a.getTime()-o);return Rx(o)>24||l.getDate()!==a.getDate()});return{options:f.computed(()=>{var o;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(o=n.pointsWithoutHover)!=null&&o.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:a=>{Da(n.tooltipState,a)}}},interaction:{mode:"index",intersect:!1}}})}}function Jv(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=yt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Rr(i.indexOf(u),on),data:o.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h=Ca(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:h,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function tM(n,t){const{i18n:e}=yt.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0;if(!s.length||!o)return{datasets:[],labels:[]};const u=c&&a||o,d=u[0],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(m=>o.map((_,T)=>{const A=m.event[d],L=c?`${A},${_}`:`${T},${_}`,N=m.event[_];return[L,N]})):s.map(m=>{const _=c?`${m.event[d]},${m.event[h]}`:`${d},${h}`,T=m.event[o[0]];return[_,T]})),p=Object.keys(g).reduce((m,_)=>{const[T]=_.split(","),A=g[_];return m[T]?m[T]+=A:m[T]=A,m},{}),b=Object.entries(p).sort(([,m],[,_])=>Number(_)-Number(m)).map(([m])=>m),w=r[d],v=r[h],S=c&&w&&Object.entries(w).map(([m,_])=>({id:m,name:_.name}))||o.map(m=>({id:m,name:m})),D=c&&v&&Object.entries(v).map(([m,_])=>({id:m,name:_.name}))||o.map(m=>({id:m,name:m}));if(d!=="status_code"&&d!=="status_code_grouped"&&(S.sort((m,_)=>b.indexOf(m.id)-b.indexOf(_.id)),D.sort((m,_)=>b.indexOf(m.id)-b.indexOf(_.id))),!S||!D)return{labels:[],datasets:[]};const k=Jv({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:u,barSegmentLabels:D,pivotRecords:g,rowLabels:S,colorPalette:n.colorPalette||on}),C=c?S.map(m=>e&&e.te(`chartLabels.${m.name}`)&&e.t(`chartLabels.${m.name}`)||m.name):o.map(m=>e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m),R=S.map(m=>m.id==="empty");return{labels:C,datasets:k,isLabelEmpty:R}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const eM="#6c7489",nM="#6c7489",iM="#995c00",sM="20px",qh="24px",rM="40px",oM="48px",aM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),lM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Wd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},cM=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return aM(a,l,e)};function uM(n,t){const{i18n:e}=yt.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],d=r[u],h=r&&d&&Object.keys(d).map(k=>({id:k,name:d[k].name}))||o.map(k=>({id:k,name:k})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=lM(a),b=cM(a,l,g,p,s),w=new Set,v=s!=null&&s.length?s.reduce((k,C)=>{const R=new Date(C.timestamp).valueOf(),E=C.event;for(const m of o)w.add(m),R in k||(k[R]={}),m in k[R]||(k[R][m]={});for(const m of o)h.forEach(_=>{E[u]===_.id||m===_.id?(k[R][m]||(k[R][m]={}),k[R][m][_.name]=Math.round(Number(E[m])*1e3)/1e3):c.length||(k[R][m]||(k[R][m]={}),k[R][m][_.name]=Math.round(Number(E[_.id])*1e3)/1e3)});return k},{}):{},D=[...o.length===1?o.flatMap(k=>h.map(C=>[k,C.name,C.id==="empty"])):h.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,C,R],E)=>{const m=b.map(L=>L in v&&k in v[L]?{x:L,y:v[L][k][C]||0}:{x:L,y:0});let{colorPalette:_,fill:T}=n;st(_)&&(_=on);const A=Ca(E,C,R,_);return{rawDimension:C,rawMetric:k,label:e&&e.te(`chartLabels.${C}`)&&e.t(`chartLabels.${C}`)||C,borderColor:A,backgroundColor:A,data:m,total:m.reduce((L,{y:N})=>L+Number(N),0),...aw,fill:T,borderWidth:T?cw:lw,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((k,C)=>(k.label??"")<(C.label??"")?-1:1):D.sort((k,C)=>Number(k.total)<Number(C.total)?-1:1),n.threshold)for(const k of Object.keys(n.threshold)){const C=n.threshold[k];C&&D.push({type:"line",rawMetric:k,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:eM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:b.map(R=>({x:R,y:C}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const dM=(n,t)=>{f.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function hM(){const{i18n:n}=yt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const fM="analytics-query-provider";function gM(){const n=f.inject(fM);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}const yt={useBarChartOptions:Yw,useChartJSCommon:Vw,useChartLegendValues:Uw,useChartSelectedRange:Kv,useExploreResultToDatasets:tM,useExploreResultToTimeDataset:uM,useDoughnutChartOptions:Zv,useLinechartOptions:Qv,useI18n:cg,useReportChartDataForSynthetics:dM,useTranslatedUnits:hM,useEvaluateFeatureFlag:gM};var It=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(It||{});/*!
18
+ `):n}function Lb(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Zu(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=At(t.bodyFont),c=At(t.titleFont),u=At(t.footerFont),d=r.length,h=s.length,g=i.length,p=jt(t.padding);let b=p.height,w=0,v=i.reduce((k,C)=>k+C.before.length+C.lines.length+C.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){const k=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*k+(v-g)*l.lineHeight+(v-1)*t.bodySpacing}h&&(b+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let S=0;const D=function(k){w=Math.max(w,e.measureText(k).width+S)};return e.save(),e.font=c.string,wt(n.title,D),e.font=l.string,wt(n.beforeBody.concat(n.afterBody),D),S=t.displayColors?o+2+t.boxPadding:0,wt(i,k=>{wt(k.before,D),wt(k.lines,D),wt(k.after,D)}),S=0,e.font=u.string,wt(n.footer,D),e.restore(),w+=p.width,{width:w,height:b}}function Ib(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Nb(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function Fb(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Nb(c,n,t,e)&&(c="center"),c}function Qu(n,t,e){const i=e.yAlign||t.yAlign||Ib(n,e);return{xAlign:e.xAlign||t.xAlign||Fb(n,t,e,i),yAlign:i}}function zb(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Bb(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Ju(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:g}=_n(o);let p=zb(t,a);const b=Bb(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Xt(p,0,i.width-t.width),y:Xt(b,0,i.height-t.height)}}function vr(n,t,e){const i=jt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function td(n){return $e([],rn(n))}function Hb(n,t,e){return xn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ed(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const nd={beforeTitle:Qe,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Qe,beforeBody:Qe,beforeLabel:Qe,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return st(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function ge(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?nd[t].call(e,i):s}class aa extends Gt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Ho(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Hb(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ge(i,"beforeTitle",this,t),r=ge(i,"title",this,t),o=ge(i,"afterTitle",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(o)),a}getBeforeBody(t,e){return td(ge(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return wt(t,r=>{const o={before:[],lines:[],after:[]},a=ed(i,r);$e(o.before,rn(ge(a,"beforeLabel",this,r))),$e(o.lines,ge(a,"label",this,r)),$e(o.after,rn(ge(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return td(ge(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ge(i,"beforeFooter",this,t),r=ge(i,"footer",this,t),o=ge(i,"afterFooter",this,t);let a=[];return a=$e(a,rn(s)),a=$e(a,rn(r)),a=$e(a,rn(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Lb(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),wt(a,u=>{const d=ed(t.callbacks,u);s.push(ge(d,"labelColor",this,u)),r.push(ge(d,"labelPointStyle",this,u)),o.push(ge(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=us[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=Zu(this,i),c=Object.assign({},a,l),u=Qu(this.chart,i,c),d=Ju(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=_n(a),{x:h,y:g}=t,{width:p,height:b}=e;let w,v,S,D,k,C;return r==="center"?(k=g+b/2,s==="left"?(w=h,v=w-o,D=k+o,C=k-o):(w=h+p,v=w+o,D=k-o,C=k+o),S=w):(s==="left"?v=h+Math.max(l,u)+o:s==="right"?v=h+p-Math.max(c,d)-o:v=this.caretX,r==="top"?(D=g,k=D-o,w=v-o,S=v+o):(D=g+b,k=D+o,w=v+o,S=v-o),C=D),{x1:w,x2:v,x3:S,y1:D,y2:k,y3:C}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=At(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=At(r.bodyFont),d=vr(this,"left",r),h=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=s.leftForLtr(h,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Ro(t,b,w,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Ro(t,b,w,v)}else{t.lineWidth=lt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(h,c),w=s.leftForLtr(s.xPlus(h,1),c-2),v=_n(o.borderRadius);Object.values(v).some(S=>S!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,ui(t,{x:b,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),ui(t,{x:w,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(w,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=At(i.bodyFont);let h=d.lineHeight,g=0;const p=fi(i.rtl,this.x,this.width),b=function(m){e.fillText(m,p.x(t.x+g),t.y+h/2),t.y+=h+r},w=p.textAlign(o);let v,S,D,k,C,R,E;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=vr(this,w,i),e.fillStyle=i.bodyColor,wt(this.beforeBody,b),g=a&&w!=="right"?o==="center"?c/2+u:c+2+u:0,k=0,R=s.length;k<R;++k){for(v=s[k],S=this.labelTextColors[k],e.fillStyle=S,wt(v.before,b),D=v.lines,a&&D.length&&(this._drawColorBox(e,t,k,p,i),h=Math.max(d.lineHeight,l)),C=0,E=D.length;C<E;++C)b(D[C]),h=d.lineHeight;wt(v.after,b)}g=0,h=d.lineHeight,wt(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=fi(i.rtl,this.x,this.width);for(t.x=vr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=At(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:g,bottomRight:p}=_n(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-h,l),e.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=us[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Zu(this,t),l=Object.assign({},o,this._size),c=Qu(e,t,l),u=Ju(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=jt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),Fc(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),zc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Xs(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Xs(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=us[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}P(aa,"positioners",us);var Mr={id:"tooltip",_element:aa,positioners:us,afterInit(n,t,e){e&&(n.tooltip=new aa({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:nd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Wb=Object.freeze({__proto__:null,Colors:tb,Decimation:sb,Filler:Sb,Legend:Pb,SubTitle:Rb,Title:Ab,Tooltip:Mr});const Yb=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function jb(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Yb(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Vb=(n,t)=>n===null?null:Xt(Math.round(n),0,t);function id(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class la extends Un{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:jb(i,t,it(e,t),this._addedLabels),Vb(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return id.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(la,"id","category"),P(la,"defaults",{ticks:{callback:id}});function $b(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,p=u-1,{min:b,max:w}=t,v=!st(o),S=!st(a),D=!st(c),k=(w-b)/(d+1);let C=cc((w-b)/p/g)*g,R,E,m,_;if(C<1e-14&&!v&&!S)return[{value:b},{value:w}];_=Math.ceil(w/C)-Math.floor(b/C),_>p&&(C=cc(_*C/p/g)*g),st(l)||(R=Math.pow(10,l),C=Math.ceil(C*R)/R),s==="ticks"?(E=Math.floor(b/C)*C,m=Math.ceil(w/C)*C):(E=b,m=w),v&&S&&r&&Wg((a-o)/r,C/1e3)?(_=Math.round(Math.min((a-o)/C,u)),C=(a-o)/_,E=o,m=a):D?(E=v?o:E,m=S?a:m,_=c-1,C=(m-E)/_):(_=(m-E)/C,Vi(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(dc(C),dc(E));R=Math.pow(10,st(l)?T:l),E=Math.round(E*R)/R,m=Math.round(m*R)/R;let A=0;for(v&&(h&&E!==o?(e.push({value:o}),E<o&&A++,Vi(Math.round((E+A*C)*R)/R,o,sd(o,k,n))&&A++):E<o&&A++);A<_;++A){const L=Math.round((E+A*C)*R)/R;if(S&&L>a)break;e.push({value:L})}return S&&h&&m!==a?e.length&&Vi(e[e.length-1].value,a,sd(a,k,n))?e[e.length-1].value=a:e.push({value:a}):(!S||m===a)&&e.push({value:m}),e}function sd(n,t,{horizontal:e,minRotation:i}){const s=Yt(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Sr extends Un{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,e){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=je(s),c=je(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=$b(s,r);return t.bounds==="ticks"&&uc(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return qi(t,this.chart.options.locale,this.options.ticks.format)}}class ca extends Sr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Et(t)?t:0,this.max=Et(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(ca,"id","linear"),P(ca,"defaults",{ticks:{callback:er.formatters.numeric}});const ds=n=>Math.floor(yn(n)),qn=(n,t)=>Math.pow(10,ds(n)+t);function rd(n){return n/Math.pow(10,ds(n))===1}function od(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Ub(n,t){const e=t-n;let i=ds(e);for(;od(n,t,i)>10;)i++;for(;od(n,t,i)<10;)i--;return Math.min(i,ds(n))}function qb(n,{min:t,max:e}){t=ke(n.min,t);const i=[],s=ds(t);let r=Ub(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),h=ke(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h<e;)i.push({value:h,major:rd(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=ke(n.max,h);return i.push({value:g,major:rd(g),significand:d}),i}class ua extends Un{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Sr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Et(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Et(t)?Math.max(0,t):null,this.max=Et(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Et(this._userMin)&&(this.min=t===qn(this.min,0)?qn(this.min,-1):qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(qn(i,-1)),o(qn(s,1)))),i<=0&&r(qn(s,-1)),s<=0&&o(qn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=qb(e,this);return t.bounds==="ticks"&&uc(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":qi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=yn(t),this._valueRange=yn(this.max)-yn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(yn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(ua,"id","logarithmic"),P(ua,"defaults",{ticks:{callback:er.formatters.logarithmic,major:{enabled:!0}}});function da(n){const t=n.ticks;if(t.display&&n.display){const e=jt(t.backdropPadding);return it(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function Xb(n,t,e){return e=_t(e)?e:[e],{w:sp(n,t.string,e),h:e.length*t.lineHeight}}function ad(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Gb(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?dt/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=At(c.font),h=Xb(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=De(n.getIndexAngle(l)+a),p=Math.round(Qs(g)),b=ad(p,u.x,h.w,0,180),w=ad(p,u.y,h.h,90,270);Kb(e,t,g,b,w)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Jb(n,i,s)}function Kb(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function Zb(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(Qs(De(l.angle+Ot))),u=n0(l.y,a.h,c),d=t0(c),h=e0(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 Qb(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function Jb(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:da(r)/2,additionalAngle:o?dt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=Zb(n,u,l);i.push(d),a==="auto"&&(d.visible=Qb(d,c),d.visible&&(c=d))}return i}function t0(n){return n===0||n===180?"center":n<180?"left":"right"}function e0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function n0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function i0(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!st(a)){const l=_n(t.borderRadius),c=jt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),ui(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function s0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));i0(e,o,r);const a=At(o.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function ld(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,kt);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function r0(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),ld(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function o0(n,t,e){return xn(n,{label:e,index:t,type:"pointLabel"})}class hs extends Sr{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=jt(da(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Et(t)&&!isNaN(t)?t:0,this.max=Et(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/da(this.options))}generateTickLabels(t){Sr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=xt(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Gb(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return De(t*e+Yt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(st(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return o0(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),ld(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&s0(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),p=r.setContext(h);r0(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.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(e.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,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=At(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=jt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}Yn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}P(hs,"id","radialLinear"),P(hs,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:er.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(hs,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(hs,"descriptors",{angleLines:{_fallback:"grid"}});const kr={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}},pe=Object.keys(kr);function cd(n,t){return n-t}function ud(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),Et(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(bn(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function dd(n,t,e,i){const s=pe.length;for(let r=pe.indexOf(n);r<s-1;++r){const o=kr[pe[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return pe[r]}return pe[s-1]}function a0(n,t,e,i,s){for(let r=pe.length-1;r>=pe.indexOf(e);r--){const o=pe[r];if(kr[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return pe[e?pe.indexOf(e):0]}function l0(n){for(let t=pe.indexOf(n)+1,e=pe.length;t<e;++t)if(kr[pe[t]].common)return pe[t]}function hd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=To(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function c0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function fd(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:c0(n,i,s,e)}class fs extends Un{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new nu._date(t.adapters.date);s.init(e),ji(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:ud(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Et(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Et(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=$g(s,r,o);return this._unit=e.unit||(i.autoSkip?dd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):a0(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:l0(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),fd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=Xt(e,0,o),i=Xt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||dd(r.minUnit,e,i,this._getLabelCapacity(e)),a=it(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=bn(l)||l===!0,u={};let d=e,h,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(h=d,g=0;h<i;h=+t.add(h,a,o),g++)hd(u,h,p);return(h===i||s.bounds==="ticks"||g===1)&&hd(u,h,p),Object.keys(u).sort(cd).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return xt(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],h=i[e],g=c&&d&&h&&h.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Yt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,fd(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(ud(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gc(t.sort(cd))}}P(fs,"id","time"),P(fs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Dr(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=tn(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=tn(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class ha extends fs{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Dr(e,this.min),this._tableRange=Dr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Dr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Dr(this._table,i*this._tableRange+this._minPos,!0)}}P(ha,"id","timeseries"),P(ha,"defaults",fs.defaults);var u0=Object.freeze({__proto__:null,CategoryScale:la,LinearScale:ca,LogarithmicScale:ua,RadialLinearScale:hs,TimeScale:fs,TimeSeriesScale:ha});const d0=[_m,qy,Wb,u0],h0=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],f0=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],g0=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],p0=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],gd=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function fa(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?p0:g0:t.binary?f0:h0,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),n<1){const u=gd(n,t.locale,o);return r+u+i+e[0]}const a=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**a,o||(n=n.toPrecision(3));const l=gd(Number(n),t.locale,o),c=e[a];return r+l+i+c}const pd=6048e5,m0=864e5,gs=6e4,pi=36e5,y0=1e3,md=Symbol.for("constructDateFrom");function Nt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&md in n?n[md](t):n instanceof Date?new n.constructor(t):new Date(t)}function rt(n,t){return Nt(t||n,n)}function Tr(n,t,e){const i=rt(n,e==null?void 0:e.in);return isNaN(t)?Nt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function ga(n,t,e){const i=rt(n,e==null?void 0:e.in);if(isNaN(t))return Nt(n,NaN);if(!t)return i;const s=i.getDate(),r=Nt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function pa(n,t,e){return Nt(n,+rt(n)+t)}function b0(n,t,e){return pa(n,t*pi)}let _0={};function Xn(){return _0}function Ue(n,t){var a,l,c,u;const e=Xn(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=rt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function mi(n,t){return Ue(n,{...t,weekStartsOn:1})}function yd(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Nt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=mi(s),o=Nt(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=mi(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Cr(n){const t=rt(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Gn(n,...t){const e=Nt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ma(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function bd(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ma(i),o=ma(s),a=+r-Cr(r),l=+o-Cr(o);return Math.round((a-l)/m0)}function x0(n,t){const e=yd(n,t),i=Nt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),mi(i)}function w0(n,t,e){const i=rt(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*gs),i}function v0(n,t,e){return ga(n,t*3,e)}function M0(n,t,e){return pa(n,t*1e3)}function S0(n,t,e){return Tr(n,t*7,e)}function k0(n,t,e){return ga(n,t*12,e)}function ps(n,t){const e=+rt(n)-+rt(t);return e<0?-1:e>0?1:e}function D0(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ya(n){return!(!D0(n)&&typeof n!="number"||isNaN(+rt(n)))}function T0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),o=i.getMonth()-s.getMonth();return r*12+o}function C0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function _d(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=xd(i,s),o=Math.abs(bd(i,s));i.setDate(i.getDate()-r*o);const a=+(xd(i,s)===-r),l=r*(o-a);return l===0?0:l}function xd(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function ms(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function O0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=(+i-+s)/pi;return ms(e==null?void 0:e.roundingMethod)(r)}function ba(n,t){return+rt(n)-+rt(t)}function P0(n,t,e){const i=ba(n,t)/gs;return ms(e==null?void 0:e.roundingMethod)(i)}function wd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function vd(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function E0(n,t){const e=rt(n,t==null?void 0:t.in);return+wd(e,t)==+vd(e,t)}function Md(n,t,e){const[i,s,r]=Gn(e==null?void 0:e.in,n,n,t),o=ps(s,r),a=Math.abs(T0(s,r));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-o*a);let l=ps(s,r)===-o;E0(i)&&a===1&&ps(i,r)===1&&(l=!1);const c=o*(a-+l);return c===0?0:c}function A0(n,t,e){const i=Md(n,t,e)/3;return ms(e==null?void 0:e.roundingMethod)(i)}function R0(n,t,e){const i=ba(n,t)/1e3;return ms(e==null?void 0:e.roundingMethod)(i)}function L0(n,t,e){const i=_d(n,t,e)/7;return ms(e==null?void 0:e.roundingMethod)(i)}function I0(n,t,e){const[i,s]=Gn(e==null?void 0:e.in,n,t),r=ps(i,s),o=Math.abs(C0(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ps(i,s)===-r,l=r*(o-+a);return l===0?0:l}function N0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function F0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function z0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Sd(n,t){const e=rt(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function B0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function H0(n,t){var a,l;const e=Xn(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=rt(n,t==null?void 0:t.in),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function W0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Y0(n,t){const e=rt(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function j0(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const V0={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$0=(n,t,e)=>{let i;const s=V0[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function _a(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const U0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},q0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},X0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},G0={date:_a({formats:U0,defaultWidth:"full"}),time:_a({formats:q0,defaultWidth:"full"}),dateTime:_a({formats:X0,defaultWidth:"full"})},K0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Z0=(n,t,e,i)=>K0[n];function ys(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Q0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},J0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},t_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},e_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},n_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},i_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},s_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:ys({values:Q0,defaultWidth:"wide"}),quarter:ys({values:J0,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ys({values:t_,defaultWidth:"wide"}),day:ys({values:e_,defaultWidth:"wide"}),dayPeriod:ys({values:n_,defaultWidth:"wide",formattingValues:i_,defaultFormattingWidth:"wide"})};function bs(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?o_(a,d=>d.test(o)):r_(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function r_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function o_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function a_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const l_=/^(\d+)(th|st|nd|rd)?/i,c_=/\d+/i,u_={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},d_={any:[/^b/i,/^(a|c)/i]},h_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},f_={any:[/1/i,/2/i,/3/i,/4/i]},g_={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},p_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},m_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},y_={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},b_={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},__={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},x_={ordinalNumber:a_({matchPattern:l_,parsePattern:c_,valueCallback:n=>parseInt(n,10)}),era:bs({matchPatterns:u_,defaultMatchWidth:"wide",parsePatterns:d_,defaultParseWidth:"any"}),quarter:bs({matchPatterns:h_,defaultMatchWidth:"wide",parsePatterns:f_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bs({matchPatterns:g_,defaultMatchWidth:"wide",parsePatterns:p_,defaultParseWidth:"any"}),day:bs({matchPatterns:m_,defaultMatchWidth:"wide",parsePatterns:y_,defaultParseWidth:"any"}),dayPeriod:bs({matchPatterns:b_,defaultMatchWidth:"any",parsePatterns:__,defaultParseWidth:"any"})},kd={code:"en-US",formatDistance:$0,formatLong:G0,formatRelative:Z0,localize:s_,match:x_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function w_(n,t){const e=rt(n,t==null?void 0:t.in);return bd(e,Sd(e))+1}function Dd(n,t){const e=rt(n,t==null?void 0:t.in),i=+mi(e)-+x0(e);return Math.round(i/pd)+1}function xa(n,t){var u,d,h,g;const e=rt(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=Nt((t==null?void 0:t.in)||n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Ue(o,t),l=Nt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Ue(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function v_(n,t){var a,l,c,u;const e=Xn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=xa(n,t),r=Nt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Ue(r,t)}function Td(n,t){const e=rt(n,t==null?void 0:t.in),i=+Ue(e,t)-+v_(e,t);return Math.round(i/pd)+1}function vt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Sn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return vt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):vt(e+1,2)},d(n,t){return vt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return vt(n.getHours()%12||12,t.length)},H(n,t){return vt(n.getHours(),t.length)},m(n,t){return vt(n.getMinutes(),t.length)},s(n,t){return vt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return vt(s,t.length)}},yi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Cd={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Sn.y(n,t)},Y:function(n,t,e,i){const s=xa(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return vt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):vt(r,t.length)},R:function(n,t){const e=yd(n);return vt(e,t.length)},u:function(n,t){const e=n.getFullYear();return vt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return vt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return vt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Sn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return vt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Td(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):vt(s,t.length)},I:function(n,t,e){const i=Dd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):vt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Sn.d(n,t)},D:function(n,t,e){const i=w_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):vt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return vt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return vt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return vt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=yi.noon:i===0?s=yi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=yi.evening:i>=12?s=yi.afternoon:i>=4?s=yi.morning:s=yi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Sn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Sn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):vt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Sn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Sn.s(n,t)},S:function(n,t){return Sn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Pd(i);case"XXXX":case"XX":return Kn(i);case"XXXXX":case"XXX":default:return Kn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Pd(i);case"xxxx":case"xx":return Kn(i);case"xxxxx":case"xxx":default:return Kn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Od(i,":");case"OOOO":default:return"GMT"+Kn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Od(i,":");case"zzzz":default:return"GMT"+Kn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return vt(i,t.length)},T:function(n,t,e){return vt(+n,t.length)}};function Od(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+vt(r,2)}function Pd(n,t){return n%60===0?(n>0?"-":"+")+vt(Math.abs(n)/60,2):Kn(n,t)}function Kn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=vt(Math.trunc(i/60),2),r=vt(i%60,2);return e+s+t+r}const Ed=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ad=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},wa={p:Ad,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ed(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Ed(i,t)).replace("{{time}}",Ad(s,t))}},M_=/^D+$/,S_=/^Y+$/,k_=["D","DD","YY","YYYY"];function Rd(n){return M_.test(n)}function Ld(n){return S_.test(n)}function va(n,t,e){const i=D_(n,t,e);if(console.warn(i),k_.includes(n))throw new RangeError(i)}function D_(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const T_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,C_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,O_=/^'([^]*?)'?$/,P_=/''/g,E_=/[a-zA-Z]/;function Id(n,t,e){var u,d,h,g,p,b,w,v;const i=Xn(),s=(e==null?void 0:e.locale)??i.locale??kd,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(h=i.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((v=(w=i.locale)==null?void 0:w.options)==null?void 0:v.weekStartsOn)??0,a=rt(n,e==null?void 0:e.in);if(!ya(a))throw new RangeError("Invalid time value");let l=t.match(C_).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=wa[D];return k(S,s.formatLong)}return S}).join("").match(T_).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:A_(S)};if(Cd[D])return{isToken:!0,value:S};if(D.match(E_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Ld(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Rd(D))&&va(D,t,String(n));const k=Cd[D[0]];return k(a,D,s.localize,c)}).join("")}function A_(n){const t=n.match(O_);return t?t[1].replace(P_,"'"):n}function Nd(){return Object.assign({},Xn())}function R_(n,t){const e=rt(n,t==null?void 0:t.in).getDay();return e===0?7:e}function L_(n,t){const e=I_(t)?new t(0):Nt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function I_(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const N_=10;class Fd{constructor(){P(this,"subPriority",0)}validate(t,e){return!0}}class F_ extends Fd{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class z_ extends Fd{constructor(e,i){super();P(this,"priority",N_);P(this,"subPriority",-1);this.context=e||(s=>Nt(i,s))}set(e,i){return i.timestampIsSet?e:Nt(e,L_(e,this.context))}}class mt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new F_(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class B_ extends mt{constructor(){super(...arguments);P(this,"priority",140);P(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Ht={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},qe={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Wt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Lt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Xe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*pi+r*gs+o*y0),rest:t.slice(e[0].length)}}function zd(n){return Lt(Ht.anyDigitsSigned,n)}function Ft(n,t){switch(n){case 1:return Lt(Ht.singleDigit,t);case 2:return Lt(Ht.twoDigits,t);case 3:return Lt(Ht.threeDigits,t);case 4:return Lt(Ht.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+n+"}"),t)}}function Or(n,t){switch(n){case 1:return Lt(Ht.singleDigitSigned,t);case 2:return Lt(Ht.twoDigitsSigned,t);case 3:return Lt(Ht.threeDigitsSigned,t);case 4:return Lt(Ht.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Ma(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Bd(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function Hd(n){return n%400===0||n%4===0&&n%100!==0}class H_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return Wt(Ft(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=Bd(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class W_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Wt(Ft(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Ft(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=xa(e,r);if(s.isTwoDigitYear){const l=Bd(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Ue(e,r)}}class Y_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Or(i==="R"?4:i.length,e)}set(e,i,s){const r=Nt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),mi(r)}}class j_ extends mt{constructor(){super(...arguments);P(this,"priority",130);P(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Or(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class V_ extends mt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Ft(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class $_ extends mt{constructor(){super(...arguments);P(this,"priority",120);P(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Ft(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class U_ extends mt{constructor(){super(...arguments);P(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);P(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return Wt(Lt(Ht.month,e),r);case"MM":return Wt(Ft(2,e),r);case"Mo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class q_ extends mt{constructor(){super(...arguments);P(this,"priority",110);P(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return Wt(Lt(Ht.month,e),r);case"LL":return Wt(Ft(2,e),r);case"Lo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function X_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Td(i,e)-t;return i.setDate(i.getDate()-s*7),rt(i,e==null?void 0:e.in)}class G_ extends mt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Lt(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Ue(X_(e,s,r),r)}}function K_(n,t,e){const i=rt(n,e==null?void 0:e.in),s=Dd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Z_ extends mt{constructor(){super(...arguments);P(this,"priority",100);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Lt(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return mi(K_(e,s))}}const Q_=[31,28,31,30,31,30,31,31,30,31,30,31],J_=[31,29,31,30,31,30,31,31,30,31,30,31];class tx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subPriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Lt(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=Hd(s),o=e.getMonth();return r?i>=1&&i<=J_[o]:i>=1&&i<=Q_[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class ex extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"subpriority",1);P(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Lt(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Ft(i.length,e)}}validate(e,i){const s=e.getFullYear();return Hd(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Sa(n,t,e){var d,h,g,p;const i=Xn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=rt(n,e==null?void 0:e.in),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Tr(r,u,e)}class nx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}class ix extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Wt(Ft(i.length,e),o);case"eo":return Wt(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}class sx extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Wt(Ft(i.length,e),o);case"co":return Wt(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Sa(e,s,r),e.setHours(0,0,0,0),e}}function rx(n,t,e){const i=rt(n,e==null?void 0:e.in),s=R_(i,e),r=t-s;return Tr(i,r,e)}class ox extends mt{constructor(){super(...arguments);P(this,"priority",90);P(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return Ft(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Wt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Wt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Wt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Wt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=rx(e,s),e.setHours(0,0,0,0),e}}class ax extends mt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class lx extends mt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class cx extends mt{constructor(){super(...arguments);P(this,"priority",80);P(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Ma(s),0,0,0),e}}class ux extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Lt(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class dx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Lt(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class hx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Lt(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class fx extends mt{constructor(){super(...arguments);P(this,"priority",70);P(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Lt(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Ft(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class gx extends mt{constructor(){super(...arguments);P(this,"priority",60);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Lt(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class px extends mt{constructor(){super(...arguments);P(this,"priority",50);P(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Lt(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Ft(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class mx extends mt{constructor(){super(...arguments);P(this,"priority",30);P(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Ft(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class yx extends mt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Xe(qe.basicOptionalMinutes,e);case"XX":return Xe(qe.basic,e);case"XXXX":return Xe(qe.basicOptionalSeconds,e);case"XXXXX":return Xe(qe.extendedOptionalSeconds,e);case"XXX":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class bx extends mt{constructor(){super(...arguments);P(this,"priority",10);P(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Xe(qe.basicOptionalMinutes,e);case"xx":return Xe(qe.basic,e);case"xxxx":return Xe(qe.basicOptionalSeconds,e);case"xxxxx":return Xe(qe.extendedOptionalSeconds,e);case"xxx":default:return Xe(qe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Nt(e,e.getTime()-Cr(e)-s)}}class _x extends mt{constructor(){super(...arguments);P(this,"priority",40);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s*1e3),{timestampIsSet:!0}]}}class xx extends mt{constructor(){super(...arguments);P(this,"priority",20);P(this,"incompatibleTokens","*")}parse(e){return zd(e)}set(e,i,s){return[Nt(e,s),{timestampIsSet:!0}]}}const wx={G:new B_,y:new H_,Y:new W_,R:new Y_,u:new j_,Q:new V_,q:new $_,M:new U_,L:new q_,w:new G_,I:new Z_,d:new tx,D:new ex,E:new nx,e:new ix,c:new sx,i:new ox,a:new ax,b:new lx,B:new cx,h:new ux,H:new dx,K:new hx,k:new fx,m:new gx,s:new px,S:new mx,X:new yx,x:new bx,t:new _x,T:new xx},vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Mx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sx=/^'([^]*?)'?$/,kx=/''/g,Dx=/\S/,Tx=/[a-zA-Z]/;function Cx(n,t,e,i){var w,v,S,D,k,C,R,E;const s=()=>Nt((i==null?void 0:i.in)||e,NaN),r=Nd(),o=(i==null?void 0:i.locale)??r.locale??kd,a=(i==null?void 0:i.firstWeekContainsDate)??((v=(w=i==null?void 0:i.locale)==null?void 0:w.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(S=r.locale)==null?void 0:S.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((C=(k=i==null?void 0:i.locale)==null?void 0:k.options)==null?void 0:C.weekStartsOn)??r.weekStartsOn??((E=(R=r.locale)==null?void 0:R.options)==null?void 0:E.weekStartsOn)??0;if(!t)return n?s():rt(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:o},u=[new z_(i==null?void 0:i.in,e)],d=t.match(Mx).map(m=>{const _=m[0];if(_ in wa){const T=wa[_];return T(m,o.formatLong)}return m}).join("").match(vx),h=[];for(let m of d){!(i!=null&&i.useAdditionalWeekYearTokens)&&Ld(m)&&va(m,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Rd(m)&&va(m,t,n);const _=m[0],T=wx[_];if(T){const{incompatibleTokens:A}=T;if(Array.isArray(A)){const N=h.find(B=>A.includes(B.token)||B.token===_);if(N)throw new RangeError(`The format string mustn't contain \`${N.fullToken}\` and \`${m}\` at the same time`)}else if(T.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${m}\` and any other token at the same time`);h.push({token:_,fullToken:m});const L=T.run(n,m,o.match,c);if(!L)return s();u.push(L.setter),n=L.rest}else{if(_.match(Tx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(m==="''"?m="'":_==="'"&&(m=Ox(m)),n.indexOf(m)===0)n=n.slice(m.length);else return s()}}if(n.length>0&&Dx.test(n))return s();const g=u.map(m=>m.priority).sort((m,_)=>_-m).filter((m,_,T)=>T.indexOf(m)===_).map(m=>u.filter(_=>_.priority===m).sort((_,T)=>T.subPriority-_.subPriority)).map(m=>m[0]);let p=rt(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const m of g){if(!m.validate(p,c))return s();const _=m.set(p,b,c);Array.isArray(_)?(p=_[0],Object.assign(b,_[1])):p=_}return p}function Ox(n){return n.match(Sx)[1].replace(kx,"'")}function Px(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ex(n,t){const e=rt(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Ax(n,t){const e=rt(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Rx(n){const t=n/pi;return Math.trunc(t)}function Wd(n,t){const e=()=>Nt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Fx(n);let r;if(s.date){const c=zx(s.date,i);r=Bx(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const o=+r;let a=0,l;if(s.time&&(a=Hx(s.time),isNaN(a)))return e();if(s.timezone){if(l=Wx(s.timezone),isNaN(l))return e()}else{const c=new Date(o+a),u=rt(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return rt(o+a+l,t==null?void 0:t.in)}const Pr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Lx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ix=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Nx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Fx(n){const t={},e=n.split(Pr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Pr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Pr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Pr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function zx(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Bx(n,t){if(t===null)return new Date(NaN);const e=n.match(Lx);if(!e)return new Date(NaN);const i=!!e[4],s=_s(e[1]),r=_s(e[2])-1,o=_s(e[3]),a=_s(e[4]),l=_s(e[5])-1;if(i)return Ux(t,a,l)?Yx(t,a,l):new Date(NaN);{const c=new Date(0);return!Vx(t,r,o)||!$x(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function _s(n){return n?parseInt(n):1}function Hx(n){const t=n.match(Ix);if(!t)return NaN;const e=ka(t[1]),i=ka(t[2]),s=ka(t[3]);return qx(e,i,s)?e*pi+i*gs+s*1e3:NaN}function ka(n){return n&&parseFloat(n.replace(",","."))||0}function Wx(n){if(n==="Z")return 0;const t=n.match(Nx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Xx(i,s)?e*(i*pi+s*gs):NaN}function Yx(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const jx=[31,null,31,30,31,30,31,31,30,31,30,31];function Yd(n){return n%400===0||n%4===0&&n%100!==0}function Vx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(jx[t]||(Yd(n)?29:28))}function $x(n,t){return t>=1&&t<=(Yd(n)?366:365)}function Ux(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function qx(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Xx(n,t){return t>=0&&t<=59}const Da=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!n.locked){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=["horizontal_bar","vertical_bar"].includes(n.chartType),c=["gauge","doughnut"].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const h=c?u.parsed:u.parsed[a];let g;if(n.units==="bytes")g=isNaN(h)?h:fa(h);else{const b=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?Er.format(h):Er.format(Number(h.toFixed($d)))} ${b}`}let p;return l&&u.dataset.label!==u.label?p=u.dataset.label:c?p=u.dataset.labels[u.dataIndex]:p=u.dataset.label,{backgroundColor:o[d].backgroundColor,borderColor:o[d].borderColor,label:p,value:g,rawValue:h,isSegmentEmpty:u.dataset.isSegmentEmpty}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Gx=n=>n&&n.datasets&&n.datasets.length,Kx=n=>Gx(n)&&n.datasets.some(t=>t.data.length),Zx=n=>n.datasets.some(t=>t.data[0]&&ya(t.data[0].x)),Qx=n=>!!Kx(n)&&n.datasets.some(t=>t.data.length==1),Jx=n=>Zx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Ta=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},tw=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function jd(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const Vd=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},$d=2,Ud=10,qd=12,Er=new Intl.NumberFormat(((og=document==null?void 0:document.documentElement)==null?void 0:og.lang)||"en-US"),Ar=10,Xd={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Rr=(n,t)=>(t||on)[n%on.length],Gd=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},Kd="#6f7787",Zd={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},ew=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Zd[t])==null?void 0:e.background)||"#fafafa"},nw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},iw={"4XX":"#FFBA81","5XX":"#FF8484"},sw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},rw="#dad4c7",Qd="#afb7c5",ow=n=>{const t=Object.entries(Xd).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Xd.standard},Ca=(n,t,e,i)=>{let s;return e?s=Qd:Array.isArray(i)?s=Rr(n,i):s=i[t],s||Rr(n)},aw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},lw=2,cw=0,Oa=new Map,Pa=(n,t)=>t==="bytes"?fa(n):t==="count/minute"?n.toFixed(2):Er.format(n),Jd=n=>{const e=document.createElement("canvas").getContext("2d"),i=At({});return e.font=i.string,e.measureText(n).width},uw=()=>{const n="label_height";if(!Oa.has(n)){const t=At({});Oa.set(n,t.lineHeight)}return Oa.get(n)},dw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),th=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),eh=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ea="#e0e4ea",hw={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},xs=(n,t)=>{let e=1;const i=hw[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},nh=new Map([[100,xs("100",[100,101,102,103])],[200,xs("200",[200,201,202,203,204,205,206,207,208,226])],[300,xs("300",[300,301,302,303,304,305,307,308])],[400,xs("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,xs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Aa=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=nh.get(e);return i===void 0?Ea:i.get(t)??i.get(-1)??Ea},fw=n=>{const t=Aa(n);return{solid:t,light:t}},Lr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Aa(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function ih(n,t,e){const i=Nd(),s=mw(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?gw(s,t):pw(s,t)}function gw(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function pw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function mw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function yw(n,t){const e=vw(t);return"formatToParts"in e?_w(e,n):xw(e,n)}const bw={year:0,month:1,day:2,hour:3,minute:4,second:5};function _w(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=bw[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function xw(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Ra={},sh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),ww=sh==="06/25/2014, 00:00:00"||sh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function vw(n){return Ra[n]||(Ra[n]=ww?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ra[n]}function rh(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const oh=36e5,Mw=6e4,La={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ia(n,t,e){if(!n)return 0;let i=La.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=La.timezoneHH.exec(n),i)return s=parseInt(i[1],10),ah(s)?-(s*oh):NaN;if(i=La.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return ah(s,o)?(r=Math.abs(s)*oh+o*Mw,i[1]==="+"?-r:r):NaN}if(Dw(n)){t=new Date(t||Date.now());const o=e?t:Sw(t),a=Na(o,n);return-(e?a:kw(t,a,n))}return NaN}function Sw(n){return rh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Na(n,t){const e=yw(n,t),i=rh(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function kw(n,t,e){let s=n.getTime()-t;const r=Na(new Date(s),e);if(t===r)return t;s-=r-t;const o=Na(new Date(s),e);return r===o?r:Math.max(r,o)}function ah(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const lh={};function Dw(n){if(lh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),lh[n]=!0,!0}catch{return!1}}const Tw=60*1e3,Cw={X:function(n,t,e){const i=Fa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return ch(i);case"XXXX":case"XX":return bi(i);case"XXXXX":case"XXX":default:return bi(i,":")}},x:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"x":return ch(i);case"xxxx":case"xx":return bi(i);case"xxxxx":case"xxx":default:return bi(i,":")}},O:function(n,t,e){const i=Fa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Ow(i,":");case"OOOO":default:return"GMT"+bi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return ih("short",n,e);case"zzzz":default:return ih("long",n,e)}}};function Fa(n,t){const e=n?Ia(n,t,!0)/Tw:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ir(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function bi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ir(Math.floor(i/60),2),r=Ir(Math.floor(i%60),2);return e+s+t+r}function ch(n,t){return n%60===0?(n>0?"-":"+")+Ir(Math.abs(n)/60,2):bi(n,t)}function Ow(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ir(r,2)}function uh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Pw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,za=36e5,dh=6e4,Ew=2,le={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Pw};function hh(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Ew:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Aw(n),{year:s,restDateString:r}=Rw(i.date,e),o=Lw(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Iw(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ia(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=uh(new Date(a+l)),c=uh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Aw(n){const t={};let e=le.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=le.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=le.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Rw(n,t){if(n){const e=le.YYY[t],i=le.YYYYY[t];let s=le.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=le.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Lw(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=le.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,ph(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=le.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return zw(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=le.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return ph(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=le.Www.exec(n),r)return s=parseInt(r[1],10)-1,mh(s)?fh(t,s):new Date(NaN);if(r=le.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return mh(s,o)?fh(t,s,o):new Date(NaN)}return null}function Iw(n){let t,e,i=le.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ba(t)?t%24*za:NaN;if(i=le.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ba(t,e)?t%24*za+e*dh:NaN;if(i=le.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ba(t,e,s)?t%24*za+e*dh+s*1e3:NaN}return null}function fh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Nw=[31,28,31,30,31,30,31,31,30,31,30,31],Fw=[31,29,31,30,31,30,31,31,30,31,30,31];function gh(n){return n%400===0||n%4===0&&n%100!==0}function ph(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gh(n);if(i&&e>Fw[t]||!i&&e>Nw[t])return!1}return!0}function zw(n,t){if(t<1)return!1;const e=gh(n);return!(e&&t>366||!e&&t>365)}function mh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ba(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Ha(n,t,e={}){t=String(t);const i=t.match(Bw);if(i){const s=hh(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Cw[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return Id(n,t,e)}function Hw(n,t,e){n=hh(n,e);const i=Ia(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Zn(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Ha(Hw(n,t,{timeZone:i.timeZone}),e,i)}const Ww=Intl.DateTimeFormat().resolvedOptions().timeZone,yh=(n,t,e,i=Ww)=>["secondly","tenSecondly","thirtySecondly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm:ss a":"h:mm:ss a"):["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly"].includes(t)?Zn(n,i,e?"yyyy-MM-dd h:mm a":"h:mm a"):t==="twelveHourly"?Zn(n,i,"yyyy-MM-dd h:mm a"):t==="daily"?Zn(n,i,"yyyy-MM-dd"):t==="weekly"?`${Zn(n,i,"yyyy")} W${Zn(n,i,"II")}`:Zn(n,i,"yyyy-MM-dd h:mm:ss a");function Yw(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Mr.positioners.barChartTooltipPosition=function(o,a){if(!o.length)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=l.width/2,d=Ta(a,c,u),h=a.y,g=a.x<u?"left":"center";return{x:d-n.tooltipState.offsetX,y:h-n.tooltipState.offsetY,xAlign:g}},Go.modes.customInteractionMode=function(o,a){const l=wn(a,o),c=[];return Go.evaluateInteractionItems(o,o.options.indexAxis||"x",l,(u,d,h)=>{o.options.indexAxis==="y"&&u.inYRange(l.y,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h}),o.options.indexAxis==="x"&&u.inXRange(l.x,!0)&&o.data.datasets[d].data[h]&&c.push({element:u,datasetIndex:d,index:h})}),c};const e=n.numLabels.value>25?Ud:qd,i=({chart:o,index:a})=>{var c;const l=o.data;return{size:e,style:(c=l==null?void 0:l.isLabelEmpty)!=null&&c[a]?"italic":"normal"}},s=(o,a,l)=>o.chart.options.indexAxis===o.axis?(a=o.getLabelForValue(l),a&&a.length>Ar?a.slice(0,Ar)+"...":a):o.getLabelForValue(Number(a));return f.computed(()=>{var o,a,l,c,u,d,h,g;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:i,callback:function(p,b){return s(this,p,b)}},title:{display:n.indexAxis==="y"?!st((o=n.metricAxesTitle)==null?void 0:o.value):!st((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(l=n.metricAxesTitle)==null?void 0:l.value:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:i,callback:function(p,b){return s(this,p,b)}},title:{display:n.indexAxis==="x"?!st((u=n.metricAxesTitle)==null?void 0:u.value):!st((d=n.dimensionAxesTitle)==null?void 0:d.value),text:n.indexAxis==="x"?(h=n.metricAxesTitle)==null?void 0:h.value:(g=n.dimensionAxesTitle)==null?void 0:g.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:p=>{Da(n.tooltipState,p)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Pe.register(...d0);const jw=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function Vw(n,t,e,i,s){const r=f.shallowRef(null),o=(a,l)=>{if(t.value)return new Pe(t.value,{type:n,data:a,plugins:i,options:l})};return f.onMounted(()=>{r.value=o(e.value,s.value)}),f.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),f.watch(e,(a,l)=>{if(jw(l,a)&&!st(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=o(a,s.value)}),f.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),f.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(st(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var bh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,b){b&&b%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var d;u=u||{};var h=c<0;h&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<o?d=e(c,r,u)+"m":c<a?d=t(e(c,o,u),u)+"b":d=t(e(c,a,u),u)+"t",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(bh);var $w=bh.exports;const ws=Wa($w);function Uw(n,t,e){const{i18n:i}=yt.useI18n(),{translateUnit:s}=yt.useTranslatedUnits();return{legendValues:f.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":fa(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${ws(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c,isThreshold:a.isThreshold}}},{}))}}var qw=Object.defineProperty,Xw=(n,t,e)=>t in n?qw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ee=(n,t,e)=>Xw(n,typeof t!="symbol"?t+"":t,e),ct=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(ct||{});const Gw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],vs=n=>n.filter(t=>t!=="time"),_h=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Kw=vs(_h),Zw=[..._h,"application","consumer","country_code","iso_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","regional_consumer"],Qw=vs(Zw),Jw=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],t1=vs(Jw);vs(["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),vs(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Kw),new Set(Qw),new Set(t1);const xh=6048e5,e1=864e5,n1=60,i1=3600,wh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wh in n?n[wh](t):n instanceof Date?new n.constructor(t):new Date(t)}function ce(n,t){return Ae(t||n,n)}function vh(n,t,e){const i=ce(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function s1(n,t,e){const i=ce(n,void 0);if(isNaN(t))return Ae(n,NaN);const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const o=r.getDate();return s>=o?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}let r1={};function Ms(){return r1}function an(n,t){var e,i,s,r;const o=Ms(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=ce(n,t==null?void 0:t.in),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Nr(n,t){return an(n,{...t,weekStartsOn:1})}function Mh(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Nr(s),o=Ae(e,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const a=Nr(o);return e.getTime()>=r.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Sh(n){const t=ce(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function o1(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Fr(n,t){const e=ce(n,void 0);return e.setHours(0,0,0,0),e}function a1(n,t,e){const[i,s]=o1(void 0,n,t),r=Fr(i),o=Fr(s),a=+r-Sh(r),l=+o-Sh(o);return Math.round((a-l)/e1)}function l1(n,t){const e=Mh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Nr(i)}function c1(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function u1(n){return!(!c1(n)&&typeof n!="number"||isNaN(+ce(n)))}function _i(n,t){const e=ce(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function d1(n,t){const e=ce(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const h1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},f1=(n,t,e)=>{let i;const s=h1[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Ya(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const g1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},p1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},m1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},y1={date:Ya({formats:g1,defaultWidth:"full"}),time:Ya({formats:p1,defaultWidth:"full"}),dateTime:Ya({formats:m1,defaultWidth:"full"})},b1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_1=(n,t,e,i)=>b1[n];function Ss(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const x1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},w1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},v1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},M1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},S1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},k1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},D1=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},T1={ordinalNumber:D1,era:Ss({values:x1,defaultWidth:"wide"}),quarter:Ss({values:w1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ss({values:v1,defaultWidth:"wide"}),day:Ss({values:M1,defaultWidth:"wide"}),dayPeriod:Ss({values:S1,defaultWidth:"wide",formattingValues:k1,defaultFormattingWidth:"wide"})};function ks(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?O1(a,d=>d.test(o)):C1(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function C1(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function O1(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function P1(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const E1=/^(\d+)(th|st|nd|rd)?/i,A1=/\d+/i,R1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},L1={any:[/^b/i,/^(a|c)/i]},I1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},N1={any:[/1/i,/2/i,/3/i,/4/i]},F1={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},z1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},B1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},H1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},W1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Y1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},j1={ordinalNumber:P1({matchPattern:E1,parsePattern:A1,valueCallback:n=>parseInt(n,10)}),era:ks({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:L1,defaultParseWidth:"any"}),quarter:ks({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:N1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ks({matchPatterns:F1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),day:ks({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:H1,defaultParseWidth:"any"}),dayPeriod:ks({matchPatterns:W1,defaultMatchWidth:"any",parsePatterns:Y1,defaultParseWidth:"any"})},V1={code:"en-US",formatDistance:f1,formatLong:y1,formatRelative:_1,localize:T1,match:j1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $1(n,t){const e=ce(n,void 0);return a1(e,d1(e))+1}function U1(n,t){const e=ce(n,void 0),i=+Nr(e)-+l1(e);return Math.round(i/xh)+1}function kh(n,t){var e,i,s,r;const o=ce(n,t==null?void 0:t.in),a=o.getFullYear(),l=Ms(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=an(u,t),h=Ae((t==null?void 0:t.in)||n,0);h.setFullYear(a,0,c),h.setHours(0,0,0,0);const g=an(h,t);return+o>=+d?a+1:+o>=+g?a:a-1}function q1(n,t){var e,i,s,r;const o=Ms(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=kh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),an(c,t)}function X1(n,t){const e=ce(n,t==null?void 0:t.in),i=+an(e,t)-+q1(e,t);return Math.round(i/xh)+1}function Mt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const kn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Mt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Mt(e+1,2)},d(n,t){return Mt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Mt(n.getHours()%12||12,t.length)},H(n,t){return Mt(n.getHours(),t.length)},m(n,t){return Mt(n.getMinutes(),t.length)},s(n,t){return Mt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Mt(s,t.length)}},xi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Dh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return kn.y(n,t)},Y:function(n,t,e,i){const s=kh(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return Mt(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Mt(r,t.length)},R:function(n,t){const e=Mh(n);return Mt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Mt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Mt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Mt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return kn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Mt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=X1(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Mt(s,t.length)},I:function(n,t,e){const i=U1(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Mt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):kn.d(n,t)},D:function(n,t,e){const i=$1(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Mt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Mt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Mt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Mt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=xi.noon:i===0?s=xi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=xi.evening:i>=12?s=xi.afternoon:i>=4?s=xi.morning:s=xi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return kn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):kn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Mt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Mt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):kn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):kn.s(n,t)},S:function(n,t){return kn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ch(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ch(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Th(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Th(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Mt(i,t.length)},T:function(n,t,e){return Mt(+n,t.length)}};function Th(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Mt(r,2)}function Ch(n,t){return n%60===0?(n>0?"-":"+")+Mt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Mt(Math.trunc(i/60),2),r=Mt(i%60,2);return e+s+t+r}const Oh=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Ph=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},G1=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Oh(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Oh(i,t)).replace("{{time}}",Ph(s,t))},K1={p:Ph,P:G1},Z1=/^D+$/,Q1=/^Y+$/,J1=["D","DD","YY","YYYY"];function tv(n){return Z1.test(n)}function ev(n){return Q1.test(n)}function nv(n,t,e){const i=iv(n,t,e);if(console.warn(i),J1.includes(n))throw new RangeError(i)}function iv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const sv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ov=/^'([^]*?)'?$/,av=/''/g,lv=/[a-zA-Z]/;function cv(n,t,e){var i,s,r,o,a,l,c,u;const d=Ms(),h=(e==null?void 0:e.locale)??d.locale??V1,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,b=ce(n,e==null?void 0:e.in);if(!u1(b))throw new RangeError("Invalid time value");let w=t.match(rv).map(S=>{const D=S[0];if(D==="p"||D==="P"){const k=K1[D];return k(S,h.formatLong)}return S}).join("").match(sv).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:uv(S)};if(Dh[D])return{isToken:!0,value:S};if(D.match(lv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});h.localize.preprocessor&&(w=h.localize.preprocessor(b,w));const v={firstWeekContainsDate:g,weekStartsOn:p,locale:h};return w.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ev(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&tv(D))&&nv(D,t,String(n));const k=Dh[D[0]];return k(b,D,h.localize,v)}).join("")}function uv(n){const t=n.match(ov);return t?t[1].replace(av,"'"):n}function dv(n,t){const e=ce(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function hv(){return Object.assign({},Ms())}function fv(n){return Math.trunc(n*i1)}function gv(n){const t=n/n1;return Math.trunc(t)}function Eh(n,t,e){return s1(n,-t)}function Ah(n,t,e){const i=hv(),s=yv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?pv(s,t):mv(s,t)}function pv(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function mv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function yv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function bv(n,t){const e=Mv(t);return"formatToParts"in e?xv(e,n):wv(e,n)}const _v={year:0,month:1,day:2,hour:3,minute:4,second:5};function xv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=_v[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function wv(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ja={},Rh=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),vv=Rh==="06/25/2014, 00:00:00"||Rh==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Mv(n){return ja[n]||(ja[n]=vv?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ja[n]}function Va(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const Lh=36e5,Sv=6e4,$a={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ds(n,t,e){if(!n)return 0;let i=$a.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=$a.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ih(s)?-(s*Lh):NaN;if(i=$a.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Ih(s,o)?(r=Math.abs(s)*Lh+o*Sv,i[1]==="+"?-r:r):NaN}if(Tv(n)){t=new Date(t||Date.now());const o=e?t:kv(t),a=Ua(o,n);return-(e?a:Dv(t,a,n))}return NaN}function kv(n){return Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ua(n,t){const e=bv(n,t),i=Va(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function Dv(n,t,e){let i=n.getTime()-t;const s=Ua(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ua(new Date(i),e);return s===r?s:Math.max(s,r)}function Ih(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Nh={};function Tv(n){if(Nh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Nh[n]=!0,!0}catch{return!1}}const Cv=60*1e3,Ov={X:function(n,t,e){const i=qa(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Fh(i);case"XXXX":case"XX":return wi(i);case"XXXXX":case"XXX":default:return wi(i,":")}},x:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"x":return Fh(i);case"xxxx":case"xx":return wi(i);case"xxxxx":case"xxx":default:return wi(i,":")}},O:function(n,t,e){const i=qa(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Pv(i,":");case"OOOO":default:return"GMT"+wi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ah("short",n,e);case"zzzz":default:return Ah("long",n,e)}}};function qa(n,t){const e=n?Ds(n,t,!0)/Cv:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function zr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function wi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=zr(Math.floor(i/60),2),r=zr(Math.floor(i%60),2);return e+s+t+r}function Fh(n,t){return n%60===0?(n>0?"-":"+")+zr(Math.abs(n)/60,2):wi(n,t)}function Pv(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+zr(r,2)}function zh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Bh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Xa=36e5,Hh=6e4,Ev=2,ue={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Bh};function Br(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?Ev:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Av(n),{year:s,restDateString:r}=Rv(i.date,e),o=Lv(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=Iv(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ds(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=zh(new Date(a+l)),c=zh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Av(n){const t={};let e=ue.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=ue.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=ue.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Rv(n,t){if(n){const e=ue.YYY[t],i=ue.YYYYY[t];let s=ue.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=ue.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function Lv(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=ue.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,jh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=ue.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return zv(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=ue.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return jh(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=ue.Www.exec(n),r)return s=parseInt(r[1],10)-1,Vh(s)?Wh(t,s):new Date(NaN);if(r=ue.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Vh(s,o)?Wh(t,s,o):new Date(NaN)}return null}function Iv(n){let t,e,i=ue.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*Xa:NaN;if(i=ue.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Ga(t,e)?t%24*Xa+e*Hh:NaN;if(i=ue.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,e,s)?t%24*Xa+e*Hh+s*1e3:NaN}return null}function Wh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Nv=[31,28,31,30,31,30,31,31,30,31,30,31],Fv=[31,29,31,30,31,30,31,31,30,31,30,31];function Yh(n){return n%400===0||n%4===0&&n%100!==0}function jh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Yh(n);if(i&&e>Fv[t]||!i&&e>Nv[t])return!1}return!0}function zv(n,t){if(t<1)return!1;const e=Yh(n);return!(e&&t>366||!e&&t>365)}function Vh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Ga(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Bv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Hv(n,t,e={}){t=String(t);const i=t.match(Bv);if(i){const s=Br(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+Ov[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return cv(n,t,e)}function $h(n,t,e){n=Br(n,e);const i=Ds(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Wv(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Hv($h(n,t,{timeZone:i.timeZone}),e,i)}function Yv(n,t,e){if(typeof n=="string"&&!n.match(Bh))return Br(n,{...e,timeZone:t});n=Br(n,e);const i=Va(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ds(t,new Date(i));return new Date(i+s)}function jv(n,t){return-Ds(n,t)}function Uh(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Wv(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Vv={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Ka(n){return n&&Gw.find(t=>n<=Vv[t])||null}var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wr={exports:{}};Wr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",o="[object Array]",a="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",d="[object GeneratorFunction]",h="[object Map]",g="[object Number]",p="[object Object]",b="[object Promise]",w="[object RegExp]",v="[object Set]",S="[object String]",D="[object Symbol]",k="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",E="[object Float32Array]",m="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",A="[object Int32Array]",L="[object Uint8Array]",N="[object Uint8ClampedArray]",B="[object Uint16Array]",G="[object Uint32Array]",U=/[\\^$.*+?()[\]{}|]/g,H=/\w*$/,ut=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,et={};et[r]=et[o]=et[C]=et[R]=et[a]=et[l]=et[E]=et[m]=et[_]=et[T]=et[A]=et[h]=et[g]=et[p]=et[w]=et[v]=et[S]=et[D]=et[L]=et[N]=et[B]=et[G]=!0,et[c]=et[u]=et[k]=!1;var Dt=typeof Hr=="object"&&Hr&&Hr.Object===Object&&Hr,$=typeof self=="object"&&self&&self.Object===Object&&self,z=Dt||$||Function("return this")(),j=t&&!t.nodeType&&t,X=j&&!0&&n&&!n.nodeType&&n,Z=X&&X.exports===j;function tt(x,O){return x.set(O[0],O[1]),x}function q(x,O){return x.add(O),x}function V(x,O){for(var F=-1,K=x?x.length:0;++F<K&&O(x[F],F,x)!==!1;);return x}function ot(x,O){for(var F=-1,K=O.length,Vt=x.length;++F<K;)x[Vt+F]=O[F];return x}function J(x,O,F,K){for(var Vt=-1,Qt=x?x.length:0;++Vt<Qt;)F=O(F,x[Vt],Vt,x);return F}function Ct(x,O){for(var F=-1,K=Array(x);++F<x;)K[F]=O(F);return K}function pt(x,O){return x==null?void 0:x[O]}function Rt(x){var O=!1;if(x!=null&&typeof x.toString!="function")try{O=!!(x+"")}catch{}return O}function bt(x){var O=-1,F=Array(x.size);return x.forEach(function(K,Vt){F[++O]=[Vt,K]}),F}function ft(x,O){return function(F){return x(O(F))}}function $t(x){var O=-1,F=Array(x.size);return x.forEach(function(K){F[++O]=K}),F}var ie=Array.prototype,ye=Function.prototype,se=Object.prototype,Kt=z["__core-js_shared__"],St=function(){var x=/[^.]+$/.exec(Kt&&Kt.keys&&Kt.keys.IE_PROTO||"");return x?"Symbol(src)_1."+x:""}(),Tt=ye.toString,Zt=se.hasOwnProperty,gt=se.toString,Ge=RegExp("^"+Tt.call(Zt).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Z?z.Buffer:void 0,Re=z.Symbol,re=z.Uint8Array,_e=ft(Object.getPrototypeOf,Object),Te=Object.create,te=se.propertyIsEnumerable,oe=ie.splice,zt=Object.getOwnPropertySymbols,Ci=be?be.isBuffer:void 0,En=ft(Object.keys,Object),Oi=Ln(z,"DataView"),si=Ln(z,"Map"),Ls=Ln(z,"Promise"),Is=Ln(z,"Set"),ri=Ln(z,"WeakMap"),ze=Ln(Object,"create"),Ns=we(Oi),Fs=we(si),zs=we(Ls),oi=we(Is),bl=we(ri),Jr=Re?Re.prototype:void 0,to=Jr?Jr.valueOf:void 0;function un(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function _l(){this.__data__=ze?ze(null):{}}function Pi(x){return this.has(x)&&delete this.__data__[x]}function Bs(x){var O=this.__data__;if(ze){var F=O[x];return F===i?void 0:F}return Zt.call(O,x)?O[x]:void 0}function eo(x){var O=this.__data__;return ze?O[x]!==void 0:Zt.call(O,x)}function dn(x,O){var F=this.__data__;return F[x]=ze&&O===void 0?i:O,this}un.prototype.clear=_l,un.prototype.delete=Pi,un.prototype.get=Bs,un.prototype.has=eo,un.prototype.set=dn;function Be(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function xl(){this.__data__=[]}function wl(x){var O=this.__data__,F=xe(O,x);if(F<0)return!1;var K=O.length-1;return F==K?O.pop():oe.call(O,F,1),!0}function vl(x){var O=this.__data__,F=xe(O,x);return F<0?void 0:O[F][1]}function Ml(x){return xe(this.__data__,x)>-1}function He(x,O){var F=this.__data__,K=xe(F,x);return K<0?F.push([x,O]):F[K][1]=O,this}Be.prototype.clear=xl,Be.prototype.delete=wl,Be.prototype.get=vl,Be.prototype.has=Ml,Be.prototype.set=He;function An(x){var O=-1,F=x?x.length:0;for(this.clear();++O<F;){var K=x[O];this.set(K[0],K[1])}}function Sl(){this.__data__={hash:new un,map:new(si||Be),string:new un}}function kl(x){return Ri(this,x).delete(x)}function Dl(x){return Ri(this,x).get(x)}function Tl(x){return Ri(this,x).has(x)}function We(x,O){return Ri(this,x).set(x,O),this}An.prototype.clear=Sl,An.prototype.delete=kl,An.prototype.get=Dl,An.prototype.has=Tl,An.prototype.set=We;function Rn(x){this.__data__=new Be(x)}function Cl(){this.__data__=new Be}function Ol(x){return this.__data__.delete(x)}function Pl(x){return this.__data__.get(x)}function El(x){return this.__data__.has(x)}function Ei(x,O){var F=this.__data__;if(F instanceof Be){var K=F.__data__;if(!si||K.length<e-1)return K.push([x,O]),this;F=this.__data__=new An(K)}return F.set(x,O),this}Rn.prototype.clear=Cl,Rn.prototype.delete=Ol,Rn.prototype.get=Pl,Rn.prototype.has=El,Rn.prototype.set=Ei;function Al(x,O){var F=In(x)||uo(x)?Ct(x.length,String):[],K=F.length,Vt=!!K;for(var Qt in x)Zt.call(x,Qt)&&!(Vt&&(Qt=="length"||ql(Qt,K)))&&F.push(Qt);return F}function no(x,O,F){var K=x[O];(!(Zt.call(x,O)&&co(K,F))||F===void 0&&!(O in x))&&(x[O]=F)}function xe(x,O){for(var F=x.length;F--;)if(co(x[F][0],O))return F;return-1}function Rl(x,O){return x&&so(O,Ye(O),x)}function Hs(x,O,F,K,Vt,Qt,ve){var Ut;if(K&&(Ut=Qt?K(x,Vt,Qt,ve):K(x)),Ut!==void 0)return Ut;if(!Ii(x))return x;var Fi=In(x);if(Fi){if(Ut=oo(x),!O)return jl(x,Ut)}else{var Nn=hn(x),po=Nn==u||Nn==d;if(Kl(x))return zl(x,O);if(Nn==p||Nn==r||po&&!Qt){if(Rt(x))return Qt?x:{};if(Ut=Ul(po?{}:x),!O)return Vl(x,Rl(Ut,x))}else{if(!et[Nn])return Qt?x:{};Ut=ao(x,Nn,Hs,O)}}ve||(ve=new Rn);var mo=ve.get(x);if(mo)return mo;if(ve.set(x,Ut),!Fi)var yo=F?$l(x):Ye(x);return V(yo||x,function(Fn,zi){yo&&(zi=Fn,Fn=x[zi]),no(Ut,zi,Hs(Fn,O,F,K,zi,x,ve))}),Ut}function Ll(x){return Ii(x)?Te(x):{}}function Il(x,O,F){var K=O(x);return In(x)?K:ot(K,F(x))}function Nl(x){return gt.call(x)}function Fl(x){if(!Ii(x)||Li(x))return!1;var O=js(x)||Rt(x)?Ge:ut;return O.test(we(x))}function Ai(x){if(!lo(x))return En(x);var O=[];for(var F in Object(x))Zt.call(x,F)&&F!="constructor"&&O.push(F);return O}function zl(x,O){if(O)return x.slice();var F=new x.constructor(x.length);return x.copy(F),F}function Ws(x){var O=new x.constructor(x.byteLength);return new re(O).set(new re(x)),O}function io(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.byteLength)}function Bl(x,O,F){var K=O?F(bt(x),!0):bt(x);return J(K,tt,new x.constructor)}function Hl(x){var O=new x.constructor(x.source,H.exec(x));return O.lastIndex=x.lastIndex,O}function Ys(x,O,F){var K=O?F($t(x),!0):$t(x);return J(K,q,new x.constructor)}function Wl(x){return to?Object(to.call(x)):{}}function Yl(x,O){var F=O?Ws(x.buffer):x.buffer;return new x.constructor(F,x.byteOffset,x.length)}function jl(x,O){var F=-1,K=x.length;for(O||(O=Array(K));++F<K;)O[F]=x[F];return O}function so(x,O,F,K){F||(F={});for(var Vt=-1,Qt=O.length;++Vt<Qt;){var ve=O[Vt],Ut=void 0;no(F,ve,Ut===void 0?x[ve]:Ut)}return F}function Vl(x,O){return so(x,ro(x),O)}function $l(x){return Il(x,Ye,ro)}function Ri(x,O){var F=x.__data__;return Xl(O)?F[typeof O=="string"?"string":"hash"]:F.map}function Ln(x,O){var F=pt(x,O);return Fl(F)?F:void 0}var ro=zt?ft(zt,Object):Vs,hn=Nl;(Oi&&hn(new Oi(new ArrayBuffer(1)))!=R||si&&hn(new si)!=h||Ls&&hn(Ls.resolve())!=b||Is&&hn(new Is)!=v||ri&&hn(new ri)!=k)&&(hn=function(x){var O=gt.call(x),F=O==p?x.constructor:void 0,K=F?we(F):void 0;if(K)switch(K){case Ns:return R;case Fs:return h;case zs:return b;case oi:return v;case bl:return k}return O});function oo(x){var O=x.length,F=x.constructor(O);return O&&typeof x[0]=="string"&&Zt.call(x,"index")&&(F.index=x.index,F.input=x.input),F}function Ul(x){return typeof x.constructor=="function"&&!lo(x)?Ll(_e(x)):{}}function ao(x,O,F,K){var Vt=x.constructor;switch(O){case C:return Ws(x);case a:case l:return new Vt(+x);case R:return io(x,K);case E:case m:case _:case T:case A:case L:case N:case B:case G:return Yl(x,K);case h:return Bl(x,K,F);case g:case S:return new Vt(x);case w:return Hl(x);case v:return Ys(x,K,F);case D:return Wl(x)}}function ql(x,O){return O=O??s,!!O&&(typeof x=="number"||Y.test(x))&&x>-1&&x%1==0&&x<O}function Xl(x){var O=typeof x;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?x!=="__proto__":x===null}function Li(x){return!!St&&St in x}function lo(x){var O=x&&x.constructor,F=typeof O=="function"&&O.prototype||se;return x===F}function we(x){if(x!=null){try{return Tt.call(x)}catch{}try{return x+""}catch{}}return""}function Ke(x){return Hs(x,!0,!0)}function co(x,O){return x===O||x!==x&&O!==O}function uo(x){return Gl(x)&&Zt.call(x,"callee")&&(!te.call(x,"callee")||gt.call(x)==r)}var In=Array.isArray;function ho(x){return x!=null&&fo(x.length)&&!js(x)}function Gl(x){return Ni(x)&&ho(x)}var Kl=Ci||go;function js(x){var O=Ii(x)?gt.call(x):"";return O==u||O==d}function fo(x){return typeof x=="number"&&x>-1&&x%1==0&&x<=s}function Ii(x){var O=typeof x;return!!x&&(O=="object"||O=="function")}function Ni(x){return!!x&&typeof x=="object"}function Ye(x){return ho(x)?Al(x):Ai(x)}function Vs(){return[]}function go(){return!1}n.exports=Ke}(Wr,Wr.exports),Wr.exports;const vi=(n,t)=>new Date(n.getTime()-jv(t,n));class Fe{constructor(t){Ee(this,"timeframeText"),Ee(this,"key"),Ee(this,"display"),Ee(this,"timeframeLength"),Ee(this,"allowedTiers"),Ee(this,"defaultResponseGranularity"),Ee(this,"dataGranularity"),Ee(this,"isRelative"),Ee(this,"fineGrainedDefaultGranularity"),Ee(this,"_startCustom"),Ee(this,"_endCustom"),Ee(this,"_allowedGranularitiesOverride"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=Yv(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return $h(e,t)}}class $v extends Fe{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Uv extends Fe{rawStart(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class qv extends Fe{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=vi(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=vi(i,t)),i}}class Xv extends Fe{rawEnd(t){let e=_i(this.tzAdjustedDate(t));return t&&(e=vi(e,t)),e}rawStart(t){let e=_i(Eh(this.tzAdjustedDate(t),1));return t&&(e=vi(e,t)),e}}ct.FIFTEEN_MIN,new Fe({key:ct.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),ct.ONE_HOUR,new Fe({key:ct.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),ct.SIX_HOUR,new Fe({key:ct.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ct.TWELVE_HOUR,new Fe({key:ct.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ct.ONE_DAY,new Fe({key:ct.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),ct.SEVEN_DAY,new Fe({key:ct.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ct.THIRTY_DAY,new Fe({key:ct.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),ct.CURRENT_WEEK,new $v({key:ct.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ct.CURRENT_MONTH,new Uv({key:ct.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=_i(new Date);return(Fr(vh(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),ct.PREVIOUS_WEEK,new qv({key:ct.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),ct.PREVIOUS_MONTH,new Xv({key:ct.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=_i(new Date),e=_i(Eh(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Gv(t,e)),60*60*24*dv(new Date().setMonth(new Date().getMonth()-1))+fv(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Gv(n,t){return gv(n.getTimezoneOffset()-t.getTimezoneOffset())}ct.FIFTEEN_MIN,ct.ONE_HOUR,ct.SIX_HOUR,ct.TWELVE_HOUR,ct.ONE_DAY,ct.SEVEN_DAY,ct.FIFTEEN_MIN,ct.ONE_HOUR,ct.SIX_HOUR,ct.TWELVE_HOUR,ct.ONE_DAY,ct.SEVEN_DAY,ct.THIRTY_DAY,ct.CURRENT_WEEK,ct.CURRENT_MONTH,ct.PREVIOUS_WEEK,ct.PREVIOUS_MONTH;function Kv(n){return f.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Uh(e)} - ${Uh(i,{includeTZ:!0})}`:""})}function Zv(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Mr.positioners.doughnutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,a=r.width/2,l=Ta(s,o,a),c=s.y,u=s.x<a?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Da(n.tooltipState,i)}}}}))}}function Qv(n){const t=f.computed(()=>{var o,a;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:l=>{const c=new Date(l);return yh(c,n.granularity.value,s.value)}},title:{display:!st((o=n.dimensionAxesTitle)==null?void 0:o.value),text:(a=n.dimensionAxesTitle)==null?void 0:a.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=f.computed(()=>{var o,a;return{title:{display:!st((o=n.metricAxesTitle)==null?void 0:o.value),text:(a=n.metricAxesTitle)==null?void 0:a.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),i={enabled:!1,position:"lineChartTooltipPosition"};Mr.positioners.lineChartTooltipPosition=function(o,a){if(!o.length||n.tooltipState.locked)return!1;const l=this.chart.canvas.getBoundingClientRect(),c=n.tooltipState.width||this.width,u=n.tooltipState.height||this.height,d=l.width/2,h=l.height/2,g=Ta(a,c,d);let p=tw(a,u,h);const b=a.y<h?"top":"bottom",w=a.x<d?"left":"center";return u>l.height&&(p=0),{x:g,y:p,xAlign:w,yAlign:b}};const s=f.computed(()=>{const o=Number(n.timeRangeMs.value),a=new Date,l=new Date(a.getTime()-o);return Rx(o)>24||l.getDate()!==a.getDate()});return{options:f.computed(()=>{var o;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(o=n.pointsWithoutHover)!=null&&o.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:a=>{Da(n.tooltipState,a)}}},interaction:{mode:"index",intersect:!1}}})}}function Jv(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=yt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Rr(i.indexOf(u),on),data:o.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h=Ca(d,u.name,u.id==="empty",a);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:h,data:o.map(g=>r[`${g.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function tM(n,t){const{i18n:e}=yt.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0;if(!s.length||!o)return{datasets:[],labels:[]};const u=c&&a||o,d=u[0],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(m=>o.map((_,T)=>{const A=m.event[d],L=c?`${A},${_}`:`${T},${_}`,N=m.event[_];return[L,N]})):s.map(m=>{const _=c?`${m.event[d]},${m.event[h]}`:`${d},${h}`,T=m.event[o[0]];return[_,T]})),p=Object.keys(g).reduce((m,_)=>{const[T]=_.split(","),A=g[_];return m[T]?m[T]+=A:m[T]=A,m},{}),b=Object.entries(p).sort(([,m],[,_])=>Number(_)-Number(m)).map(([m])=>m),w=r[d],v=r[h],S=c&&w&&Object.entries(w).map(([m,_])=>({id:m,name:_.name}))||o.map(m=>({id:m,name:m})),D=c&&v&&Object.entries(v).map(([m,_])=>({id:m,name:_.name}))||o.map(m=>({id:m,name:m}));if(d!=="status_code"&&d!=="status_code_grouped"&&(S.sort((m,_)=>b.indexOf(m.id)-b.indexOf(_.id)),D.sort((m,_)=>b.indexOf(m.id)-b.indexOf(_.id))),!S||!D)return{labels:[],datasets:[]};const k=Jv({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:u,barSegmentLabels:D,pivotRecords:g,rowLabels:S,colorPalette:n.colorPalette||on}),C=c?S.map(m=>e&&e.te(`chartLabels.${m.name}`)&&e.t(`chartLabels.${m.name}`)||m.name):o.map(m=>e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m),R=S.map(m=>m.id==="empty");return{labels:C,datasets:k,isLabelEmpty:R}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const eM="#6c7489",nM="#6c7489",iM="#995c00",sM="20px",qh="24px",rM="40px",oM="48px",aM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),lM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Wd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},cM=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return aM(a,l,e)};function uM(n,t){const{i18n:e}=yt.useI18n();return f.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],d=r[u],h=r&&d&&Object.keys(d).map(k=>({id:k,name:d[k].name}))||o.map(k=>({id:k,name:k})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=lM(a),b=cM(a,l,g,p,s),w=new Set,v=s!=null&&s.length?s.reduce((k,C)=>{const R=new Date(C.timestamp).valueOf(),E=C.event;for(const m of o)w.add(m),R in k||(k[R]={}),m in k[R]||(k[R][m]={});for(const m of o)h.forEach(_=>{E[u]===_.id||m===_.id?(k[R][m]||(k[R][m]={}),k[R][m][_.name]=Math.round(Number(E[m])*1e3)/1e3):c.length||(k[R][m]||(k[R][m]={}),k[R][m][_.name]=Math.round(Number(E[_.id])*1e3)/1e3)});return k},{}):{},D=[...o.length===1?o.flatMap(k=>h.map(C=>[k,C.name,C.id==="empty"])):h.map(k=>[k.name,k.name,k.id==="empty"])].map(([k,C,R],E)=>{const m=b.map(L=>L in v&&k in v[L]?{x:L,y:v[L][k][C]||0}:{x:L,y:0});let{colorPalette:_,fill:T}=n;st(_)&&(_=on);const A=Ca(E,C,R,_);return{rawDimension:C,rawMetric:k,label:e&&e.te(`chartLabels.${C}`)&&e.t(`chartLabels.${C}`)||C,borderColor:A,backgroundColor:A,data:m,total:m.reduce((L,{y:N})=>L+Number(N),0),...aw,fill:T,borderWidth:T?cw:lw,isSegmentEmpty:R}});if(u==="status_code"||u==="status_code_grouped"?D.sort((k,C)=>(k.label??"")<(C.label??"")?-1:1):D.sort((k,C)=>Number(k.total)<Number(C.total)?-1:1),n.threshold)for(const k of Object.keys(n.threshold)){const C=n.threshold[k];C&&D.push({type:"line",rawMetric:k,isThreshold:!0,label:e.t("chartLabels.threshold"),borderColor:eM,borderWidth:1.25,borderDash:[12,8],fill:!1,order:-1,stack:"custom",data:b.map(R=>({x:R,y:C}))})}return{datasets:D}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const dM=(n,t)=>{f.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function hM(){const{i18n:n}=yt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const fM="analytics-query-provider";function gM(){const n=f.inject(fM);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}const yt={useBarChartOptions:Yw,useChartJSCommon:Vw,useChartLegendValues:Uw,useChartSelectedRange:Kv,useExploreResultToDatasets:tM,useExploreResultToTimeDataset:uM,useDoughnutChartOptions:Zv,useLinechartOptions:Qv,useI18n:cg,useReportChartDataForSynthetics:dM,useTranslatedUnits:hM,useEvaluateFeatureFlag:gM};var It=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(It||{});/*!
19
19
  * chartjs-plugin-annotation v3.1.0
20
20
  * https://www.chartjs.org/chartjs-plugin-annotation/index
21
21
  * (c) 2024 chartjs-plugin-annotation Contributors