@kong-ui-public/analytics-chart 10.13.0 → 10.13.1

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 Dp{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],a=e.duration;r.forEach(o=>o({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Fc.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 a=r.length-1,o=!1,l;for(;a>=0;--a)l=r[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(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 en=new Dp;const mu="transparent",Cp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Vc(n||mu),s=i.valid&&Vc(t||mu);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Ep{constructor(t,e,i,s){const r=e[i];s=ss([t.to,s,r,t.from]);const a=ss([t.from,r,s]);this._active=!0,this._fn=t.fn||Cp[t.type||typeof a],this._easing=Ji[t.easing]||Ji.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ss([t.to,e,s,t.from]),this._from=ss([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,a=this._loop,o=this._to;let l;if(this._active=r!==o&&(a||e<i),!this._active){this._target[s]=o,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,o,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 Za{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ft(t))return;const e=Object.keys(Pt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ft(r))return;const a={};for(const o of e)a[o]=r[o];(wt(r.properties)&&r.properties||[s]).forEach(o=>{(o===s||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,e){const i=e.options,s=Pp(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Op(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let h=r[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,o);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=h=new Ep(f,t,c,u),s.push(h)}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 en.add(this._chart,i),!0}}function Op(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 Pp(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 gu(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 Ap(n,t,e){if(e===!1)return!1;const i=gu(n,e),s=gu(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Rp(n){let t,e,i,s;return ft(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 pu(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 yu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let a,o,l,c;if(t===null)return;let u=!1;for(a=0,o=s.length;a<o;++a){if(l=+s[a],l===e){if(u=!0,i.all)continue;break}c=n.values[l],At(c)&&(r||t===0||We(t)===We(c))&&(t+=c)}return!u&&!i.all?0:t}function Ip(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",a=Object.keys(n),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[s]:u,[r]:n[u]};return o}function Qa(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Lp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Np(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 Fp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function bu(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 _u(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:o}=i,l=r.axis,c=a.axis,u=Lp(r,a,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[l]:_,[c]:x}=g,v=g._stacks||(g._stacks={});f=v[c]=Fp(s,u,_),f[o]=x,f._top=bu(f,a,!0,i.type),f._bottom=bu(f,a,!1,i.type);const M=f._visualValues||(f._visualValues={});M[o]=x}}function Ja(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Bp(n,t){return Mn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function zp(n,t,e){return Mn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function rs(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 to=n=>n==="reset"||n==="none",xu=(n,t)=>t?n:Object.assign({},n),Hp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:pu(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=Qa(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&&rs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,r=e.xAxisID=rt(i.xAxisID,Ja(t,"x")),a=e.yAxisID=rt(i.yAxisID,Ja(t,"y")),o=e.rAxisID=rt(i.rAxisID,Ja(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,a,o),u=e.vAxisID=s(l,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),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&&Lc(this._data,this),t._stacked&&rs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ft(e)){const s=this._cachedMeta;this._data=Ip(e,s)}else if(i!==e){if(i){Lc(i,this);const s=this._cachedMeta;rs(s),s._parsed=[]}e&&Object.isExtensible(e)&&kg(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=Qa(e.vScale,e),e.stack!==i.stack&&(s=!0,rs(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(_u(this,e._parsed),e._stacked=Qa(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:a}=i,o=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{wt(s[t])?f=this.parseArrayData(i,s,t,e):ft(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[o]===null||c&&h[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&_u(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:a}=t,o=r.axis,l=a.axis,c=r.getLabels(),u=r===a,h=new Array(s);let f,m,g;for(f=0,m=s;f<m;++f)g=f+i,h[f]={[o]:u||r.parse(c[g],g),[l]:a.parse(e[g],g)};return h}parseArrayData(t,e,i,s){const{xScale:r,yScale:a}=t,o=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],o[l]={x:r.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,e,i,s){const{xScale:r,yScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=e[f],c[u]={x:r.parse(_n(m,o),f),y:a.parse(_n(m,l),f)};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,a=e[t.axis],o={keys:pu(s,!0),values:e._stacks[t.axis]._visualValues};return yu(o,a,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let a=r===null?NaN:r;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=yu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),l=Hp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Np(o);let f,m;function g(){m=s[f];const _=m[o.axis];return!At(m[t.axis])||u>_||h<_}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(c,t,m,l),r));++f);if(r){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,a;for(s=0,r=e.length;s<r;++s)a=e[s][t.axis],At(a)&&i.push(a);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=Rp(rt(this.options.clip,Ap(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,a=[],o=this._drawStart||0,l=this._drawCount||s.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,o,l),u=o;u<o+l;++u){const h=s[u];h.hidden||(h.active&&c?a.push(h):h.draw(t,r))}for(u=0;u<a.length;++u)a[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 a=this._cachedMeta.data[t];r=a.$context||(a.$context=zp(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Bp(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,a=t+"-"+e,o=r[a],l=this.enableOptionSharing&&ge(i);if(o)return xu(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Pt.elements[t]),g=()=>this.getContext(i,s,e),_=c.resolveNamedOptions(f,m,g,h);return _.$shared&&(_.$shared=l,r[a]=Object.freeze(xu(_,l))),_}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,o=r[a];if(o)return o;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Za(s,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||to(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,s){to(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!to(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[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const s=i.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),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,a=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=a;o--)c[o]=c[o-e]};for(l(r),o=t;o<a;++o)r[o]=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&&rs(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])}}A(Ne,"defaults",{}),A(Ne,"datasetElementType",null),A(Ne,"dataElementType",null);function Wp(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=Nc(i.sort((s,r)=>s-r))}return n._cache.$bar}function Yp(n){const t=n.iScale,e=Wp(t,n.type);let i=t._length,s,r,a,o;const l=()=>{a===32767||a===-32768||(ge(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(s=0,r=e.length;s<r;++s)a=t.getPixelForValue(e[s]),l();for(o=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return i}function Vp(n,t,e,i){const s=e.barThickness;let r,a;return st(s)?(r=t.min*e.categoryPercentage,a=e.barPercentage):(r=s*i,a=1),{chunk:r/i,ratio:a,start:t.pixels[n]-r/2}}function $p(n,t,e,i){const s=t.pixels,r=s[n];let a=n>0?s[n-1]:null,o=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=r-(o===null?t.end-t.start:o-r)),o===null&&(o=r+r-a);const c=r-(r-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:e.barPercentage,start:c}}function jp(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),a=Math.min(s,r),o=Math.max(s,r);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:a,max:o}}function wu(n,t,e,i){return wt(n)?jp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function vu(n,t,e,i){const s=n.iScale,r=n.vScale,a=s.getLabels(),o=s===r,l=[];let c,u,h,f;for(c=e,u=e+i;c<u;++c)f=t[c],h={},h[s.axis]=o||s.parse(a[c],c),l.push(wu(f,h,r,c));return l}function eo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Up(n,t,e){return n!==0?We(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function qp(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 Xp(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:a,end:o,reverse:l,top:c,bottom:u}=qp(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[Mu(u,a,o,l)]=!0,s=c)),r[Mu(s,a,o,l)]=!0,n.borderSkipped=r}function Mu(n,t,e,i){return i?(n=Gp(n,t,e),n=ku(n,e,t)):n=ku(n,t,e),n}function Gp(n,t,e){return n===t?e:n===e?t:n}function ku(n,t,e){return n==="start"?t:n==="end"?e:n}function Kp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class as extends Ne{parsePrimitiveData(t,e,i,s){return vu(t,e,i,s)}parseArrayData(t,e,i,s){return vu(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?o:l,u=a.axis==="x"?o:l,h=[];let f,m,g,_;for(f=i,m=i+s;f<m;++f)_=e[f],g={},g[r.axis]=r.parse(_n(_,c),f),h.push(wu(_n(_,u),g,a,f));return h}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),a=r._custom,o=eo(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}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:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s);for(let m=e;m<e+i;m++){const g=this.getParsed(m),_=r||st(g[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),v=(g._stacks||{})[o.axis],M={horizontal:c,base:_.base,enableBorderRadius:!v||eo(g._custom)||a===v._top||a===v._bottom,x:c?_.head:x.center,y:c?x.center:_.head,height:c?x.size:Math.abs(_.size),width:c?Math.abs(_.size):x.size};f&&(M.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const k=M.options||t[m].options;Xp(M,k,v,a),Kp(M,k,u.ratio),this.updateElement(t[m],m,M,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),l=o&&o[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(st(f)||isNaN(f))return!0};for(const u of s)if(!(e!==void 0&&c(u))&&((r===!1||a.indexOf(u.stack)===-1||r===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[rt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_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,a;for(r=0,a=e.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||Yp(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:a}}=this,o=r||0,l=this.getParsed(t),c=l._custom,u=eo(c);let h=l[e.axis],f=0,m=i?this.applyStack(e,l,i):h,g,_;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&We(h)!==We(c.barEnd)&&(f=0),f+=h);const x=!st(r)&&!u?r:f;let v=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+m):g=v,_=g-v,Math.abs(_)<a){_=Up(_,e,o)*a,h===o&&(v-=_/2);const M=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),T=Math.min(M,k),P=Math.max(M,k);v=Math.max(Math.min(v,P),T),g=v+_,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(v))}if(v===e.getPixelForValue(o)){const M=We(_)*e.getLineWidthForValue(o)/2;v+=M,_-=M}return{size:_,base:v,head:g,center:g+_/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,a=rt(s.maxBarThickness,1/0);let o,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?$p(t,e,s,u*c):Vp(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(rt(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+m;o=h.start+h.chunk*g+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,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)}}A(as,"id","bar"),A(as,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),A(as,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class br extends Ne{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=rt(o[2],this.resolveDataElementOptions(a+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=rt(o&&o.r&&+o.r,this.resolveDataElementOptions(a+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,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+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:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=a.axis,h=o.axis;for(let f=e;f<e+i;f++){const m=t[f],g=!r&&this.getParsed(f),_={},x=_[u]=r?a.getPixelForDecimal(.5):a.getPixelForValue(g[u]),v=_[h]=r?o.getBasePixel():o.getPixelForValue(g[h]);_.skip=isNaN(x)||isNaN(v),c&&(_.options=l||this.resolveDataElementOptions(f,m.active?"active":s),r&&(_.options.radius=0)),this.updateElement(m,f,_,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+=rt(i&&i._custom,r),s}}A(br,"id","bubble"),A(br,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),A(br,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Zp(n,t,e){let i=1,s=1,r=0,a=0;if(t<Ct){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),h=Math.cos(l),f=Math.sin(l),m=(k,T,P)=>Qi(k,o,l,!0)?1:Math.max(T,T*e,P,P*e),g=(k,T,P)=>Qi(k,o,l,!0)?-1:Math.min(T,T*e,P,P*e),_=m(0,c,h),x=m(Ot,u,f),v=g(ut,c,h),M=g(ut+Ot,u,f);i=(_-v)/2,s=(x-M)/2,r=-(_+v)/2,a=-(x+M)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:a}}class nn 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(ft(i[t])){const{key:l="value"}=this._parsing;r=c=>+_n(i[c],l)}let a,o;for(a=t,o=t+e;a<o;++a)s._parsed[a]=r(a)}}_getRotation(){return Vt(this.options.rotation-90)}_getCircumference(){return Vt(this.options.circumference)}_getRotationExtents(){let t=Ct,e=-Ct;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(),a=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(ug(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:_}=Zp(h,u,l),x=(i.width-a)/f,v=(i.height-a)/m,M=Math.max(Math.min(x,v)/2,0),k=Dc(this.options.radius,M),T=Math.max(k*l,0),P=(k-T)/this._getVisibleDatasetWeightTotal();this.offsetX=g*k,this.offsetY=_*k,s.total=this.calculateTotal(),this.outerRadius=k-P*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-P*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/Ct)}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=r&&c.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:_,includeOptions:x}=this._getSharedOptions(e,s);let v=this._getRotation(),M;for(M=0;M<e;++M)v+=this._circumference(M,r);for(M=e;M<e+i;++M){const k=this._circumference(M,r),T=t[M],P={x:u+this.offsetX,y:h+this.offsetY,startAngle:v,endAngle:v+k,circumference:k,outerRadius:g,innerRadius:m};x&&(P.options=_||this.resolveDataElementOptions(M,T.active?"active":s)),v+=k,this.updateElement(T,M,P,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)?Ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ts(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,a,o,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=o.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(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}A(nn,"id","doughnut"),A(nn,"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"}),A(nn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),A(nn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:r,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:a&&(o||h.borderRadius),index:c}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class os extends Ne{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:o,count:l}=zc(e,s,a);this._drawStart=o,this._drawCount=l,Hc(e)&&(o=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:!a,options:c},t),this.updateElements(s,o,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=a.axis,m=o.axis,{spanGaps:g,segment:_}=this.options,x=wn(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",M=e+i,k=t.length;let T=e>0&&this.getParsed(e-1);for(let P=0;P<k;++P){const O=t[P],C=v?O:{};if(P<e||P>=M){C.skip=!0;continue}const p=this.getParsed(P),b=st(p[m]),S=C[f]=a.getPixelForValue(p[f],P),E=C[m]=r||b?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,p,l):p[m],P);C.skip=isNaN(S)||isNaN(E)||b,C.stop=P>0&&Math.abs(p[f]-T[f])>x,_&&(C.parsed=p,C.raw=c.data[P]),h&&(C.options=u||this.resolveDataElementOptions(P,O.active?"active":s)),v||this.updateElement(O,P,C,s),T=p}}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)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}A(os,"id","line"),A(os,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),A(os,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ls 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=ts(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return eu.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),a=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),o=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*ut;let m=f,g;const _=360/this.countVisibleElements();for(g=0;g<e;++g)m+=this._computeAngle(g,s,_);for(g=e;g<e+i;g++){const x=t[g];let v=m,M=m+this._computeAngle(g,s,_),k=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=M,r&&(l.animateScale&&(k=0),l.animateRotate&&(v=M=f));const T={x:u,y:h,innerRadius:0,outerRadius:k,startAngle:v,endAngle:M,options:this.resolveDataElementOptions(g,x.active?"active":s)};this.updateElement(x,g,T,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)?Vt(this.resolveDataElementOptions(t,e).angle||i):0}}A(ls,"id","polarArea"),A(ls,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),A(ls,"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,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}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 no extends nn{}A(no,"id","pie"),A(no,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class _r 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 eu.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 a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":s),u=r.getPointPositionForValue(o,this.getParsed(o).r),h=a?r.xCenter:u.x,f=a?r.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,o,m,s)}}}A(_r,"id","radar"),A(_r,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),A(_r,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class xr extends Ne{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:a}=zc(e,i,s);if(this._drawStart=r,this._drawCount=a,Hc(e)&&(r=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,a,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:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=a.axis,g=o.axis,{spanGaps:_,segment:x}=this.options,v=wn(_)?_:Number.POSITIVE_INFINITY,M=this.chart._animationsDisabled||r||s==="none";let k=e>0&&this.getParsed(e-1);for(let T=e;T<e+i;++T){const P=t[T],O=this.getParsed(T),C=M?P:{},p=st(O[g]),b=C[m]=a.getPixelForValue(O[m],T),S=C[g]=r||p?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,O,l):O[g],T);C.skip=isNaN(b)||isNaN(S)||p,C.stop=T>0&&Math.abs(O[m]-k[m])>v,x&&(C.parsed=O,C.raw=c.data[T]),f&&(C.options=h||this.resolveDataElementOptions(T,P.active?"active":s)),M||this.updateElement(P,T,C,s),k=O}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}A(xr,"id","scatter"),A(xr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),A(xr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Qp=Object.freeze({__proto__:null,BarController:as,BubbleController:br,DoughnutController:nn,LineController:os,PieController:no,PolarAreaController:ls,RadarController:_r,ScatterController:xr});function Un(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class io{constructor(t){A(this,"options");this.options=t||{}}static override(t){Object.assign(io.prototype,t)}init(){}formats(){return Un()}parse(){return Un()}format(){return Un()}add(){return Un()}diff(){return Un()}startOf(){return Un()}endOf(){return Un()}}var Su={_date:io};function Jp(n,t,e,i){const{controller:s,data:r,_sorted:a}=n,o=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&r.length){const c=o._reversePixels?vg:Je;if(i){if(s._sharedOptions){const u=r[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(r,t,e-h),m=c(r,t,e+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=n,m=f.slice(0,u.lo+1).reverse().findIndex(_=>!st(_[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(_=>!st(_[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:r.length-1}}function cs(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),a=e[t];for(let o=0,l=r.length;o<l;++o){const{index:c,data:u}=r[o],{lo:h,hi:f}=Jp(r[o],t,a,s);for(let m=h;m<=f;++m){const g=u[m];g.skip||i(g,c,m)}}}function ty(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,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function so(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||cs(n,e,t,function(o,l,c){!s&&!tn(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&r.push({element:o,datasetIndex:l,index:c})},!0),r}function ey(n,t,e,i){let s=[];function r(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=ur(a,{x:t.x,y:t.y});Qi(h,c,u)&&s.push({element:a,datasetIndex:o,index:l})}return cs(n,e,t,r),s}function ny(n,t,e,i,s,r){let a=[];const o=ty(e);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const g=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(g))&&!m)return;const x=o(t,g);x<l?(a=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&a.push({element:u,datasetIndex:h,index:f})}return cs(n,e,t,c),a}function ro(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?ey(n,t,e,s):ny(n,t,e,i,s,r)}function Tu(n,t,e,i,s){const r=[],a=e==="x"?"inXRange":"inYRange";let o=!1;return cs(n,e,t,(l,c,u)=>{l[a]&&l[a](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,s))}),i&&!o?[]:r}var ao={evaluateInteractionItems:cs,modes:{index(n,t,e,i){const s=kn(t,n),r=e.axis||"x",a=e.includeInvisible||!1,o=e.intersect?so(n,s,r,i,a):ro(n,s,r,!1,i,a),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;let o=e.intersect?so(n,s,r,i,a):ro(n,s,r,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return so(n,s,r,i,a)},nearest(n,t,e,i){const s=kn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return ro(n,s,r,e.intersect,i,a)},x(n,t,e,i){const s=kn(t,n);return Tu(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=kn(t,n);return Tu(n,s,"y",e.intersect,i)}}};const Du=["left","top","right","bottom"];function us(n,t){return n.filter(e=>e.pos===t)}function Cu(n,t){return n.filter(e=>Du.indexOf(e.pos)===-1&&e.box.axis===t)}function ds(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 iy(n){const t=[];let e,i,s,r,a,o;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:a,stackWeight:o=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&r+a,stackWeight:o});return t}function sy(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Du.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function ry(n,t){const e=sy(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,a,o;for(r=0,a=n.length;r<a;++r){o=n[r];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=s):(o.width=i,o.height=u?u*s:l&&t.availableHeight)}return e}function ay(n){const t=iy(n),e=ds(t.filter(c=>c.box.fullSize),!0),i=ds(us(t,"left"),!0),s=ds(us(t,"right")),r=ds(us(t,"top"),!0),a=ds(us(t,"bottom")),o=Cu(t,"x"),l=Cu(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(a).concat(o),chartArea:us(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(a).concat(o)}}function Eu(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Ou(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 oy(n,t,e,i){const{pos:s,box:r}=e,a=n.maxPadding;if(!ft(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?r.height:r.width),e.size=h.size/h.count,n[s]+=e.size}r.getPadding&&Ou(a,r.getPadding());const o=Math.max(0,t.outerWidth-Eu(a,n,"left","right")),l=Math.max(0,t.outerHeight-Eu(a,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function ly(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 cy(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return i(n?["left","right"]:["top","bottom"])}function hs(n,t,e,i){const s=[];let r,a,o,l,c,u;for(r=0,a=n.length,c=0;r<a;++r){o=n[r],l=o.box,l.update(o.width||t.w,o.height||t.h,cy(o.horizontal,t));const{same:h,other:f}=oy(t,e,o,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(o)}return c&&hs(s,t,e,i)||u}function wr(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 Pu(n,t,e,i){const s=e.padding;let{x:r,y:a}=t;for(const o of n){const l=o.box,c=i[o.stack]||{placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const h=t.w*u,f=c.size||l.height;ge(c.start)&&(a=c.start),l.fullSize?wr(l,s.left,a,e.outerWidth-s.right-s.left,f):wr(l,t.left+c.placed,a,h,f),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*u,f=c.size||l.width;ge(c.start)&&(r=c.start),l.fullSize?wr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):wr(l,r,t.top+c.placed,f,h),c.start=r,c.placed+=h,r=l.right}}t.x=r,t.y=a}var re={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=$t(n.options.layout.padding),r=Math.max(t-s.width,0),a=Math.max(e-s.height,0),o=ay(n.boxes),l=o.vertical,c=o.horizontal;St(n.boxes,_=>{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=l.reduce((_,x)=>x.box.options&&x.box.options.display===!1?_:_+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},s);Ou(f,$t(i));const m=Object.assign({maxPadding:f,w:r,h:a,x:s.left,y:s.top},s),g=ry(l.concat(c),h);hs(o.fullSize,m,h,g),hs(l,m,h,g),hs(c,m,h,g)&&hs(l,m,h,g),ly(m),Pu(o.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Pu(o.rightAndBottom,m,h,g),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},St(o.chartArea,_=>{const x=_.box;Object.assign(x,n.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Au{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 uy extends Au{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const vr="$chartjs",dy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ru=n=>n===null||n==="";function hy(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[vr]={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",Ru(s)){const r=su(n,"width");r!==void 0&&(n.width=r)}if(Ru(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=su(n,"height");r!==void 0&&(n.height=r)}return n}const Iu=gp?{passive:!0}:!1;function fy(n,t,e){n&&n.addEventListener(t,e,Iu)}function my(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Iu)}function gy(n,t){const e=dy[n.type]||n.type,{x:i,y:s}=kn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Mr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function py(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Mr(o.addedNodes,i),a=a&&!Mr(o.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function yy(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Mr(o.removedNodes,i),a=a&&!Mr(o.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const fs=new Map;let Lu=0;function Nu(){const n=window.devicePixelRatio;n!==Lu&&(Lu=n,fs.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function by(n,t){fs.size||window.addEventListener("resize",Nu),fs.set(n,t)}function _y(n){fs.delete(n),fs.size||window.removeEventListener("resize",Nu)}function xy(n,t,e){const i=n.canvas,s=i&&Ka(i);if(!s)return;const r=Bc((o,l)=>{const c=s.clientWidth;e(o,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(s),by(n,r),a}function oo(n,t,e){e&&e.disconnect(),t==="resize"&&_y(n)}function wy(n,t,e){const i=n.canvas,s=Bc(r=>{n.ctx!==null&&e(gy(r,n))},n);return fy(i,t,s),s}class vy extends Au{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(hy(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[vr])return!1;const i=e[vr].initial;["height","width"].forEach(r=>{const a=i[r];st(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[vr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:py,detach:yy,resize:xy}[e]||wy;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:oo,detach:oo,resize:oo}[e]||my)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return mp(t,e,i,s)}isAttached(t){const e=t&&Ka(t);return!!(e&&e.isConnected)}}function My(n){return!Ga()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?uy:vy}class Zt{constructor(){A(this,"x");A(this,"y");A(this,"active",!1);A(this,"options");A(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return wn(this.x)&&wn(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}}A(Zt,"defaults",{}),A(Zt,"defaultRoutes");function ky(n,t){const e=n.options.ticks,i=Sy(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Dy(t):[],a=r.length,o=r[0],l=r[a-1],c=[];if(a>s)return Cy(t,c,r,a/s),c;const u=Ty(r,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-o)/(a-1)):null;for(kr(t,c,u,st(m)?0:o-m,o),h=0,f=a-1;h<f;h++)kr(t,c,u,r[h],r[h+1]);return kr(t,c,u,l,st(m)?t.length:l+m),c}return kr(t,c,u),c}function Sy(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 Ty(n,t,e){const i=Ey(n),s=t.length/e;if(!i)return Math.max(s,1);const r=yg(i);for(let a=0,o=r.length-1;a<o;a++){const l=r[a];if(l>s)return l}return Math.max(s,1)}function Dy(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Cy(n,t,e,i){let s=0,r=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===r&&(t.push(n[a]),s++,r=e[s*i])}function kr(n,t,e,i,s){const r=rt(i,0),a=Math.min(rt(s,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)o++,u=Math.round(r+o*e);for(c=Math.max(r,0);c<a;c++)c===u&&(t.push(n[c]),o++,u=Math.round(r+o*e))}function Ey(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 Oy=n=>n==="left"?"right":n==="right"?"left":n,Fu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Bu=(n,t)=>Math.min(t||n,n);function zu(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 Py(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,a=n._endPixel,o=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-o||l>a+o)))return l}function Ay(n,t){St(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 ms(n){return n.drawTicks?n.tickLength:0}function Hu(n,t){if(!n.display)return 0;const e=Rt(n.font,t),i=$t(n.padding);return(wt(n.text)?n.text.length:1)*e.lineHeight+i.height}function Ry(n,t){return Mn(n,{scale:t,type:"scale"})}function Iy(n,t,e){return Mn(n,{tick:e,index:t,type:"tick"})}function Ly(n,t,e){let i=za(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Oy(i)),i}function Ny(n,t,e,i){const{top:s,left:r,bottom:a,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,f,m,g;const _=a-s,x=o-r;if(n.isHorizontal()){if(m=se(i,r,o),ft(e)){const v=Object.keys(e)[0],M=e[v];g=u[v].getPixelForValue(M)+_-t}else e==="center"?g=(c.bottom+c.top)/2+_-t:g=Fu(n,e,t);f=o-r}else{if(ft(e)){const v=Object.keys(e)[0],M=e[v];m=u[v].getPixelForValue(M)-x+t}else e==="center"?m=(c.left+c.right)/2-x+t:m=Fu(n,e,t);g=se(i,a,s),h=e==="left"?-Ot:Ot}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class qn extends Zt{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=Te(t,Number.POSITIVE_INFINITY),e=Te(e,Number.NEGATIVE_INFINITY),i=Te(i,Number.POSITIVE_INFINITY),s=Te(s,Number.NEGATIVE_INFINITY),{min:Te(t,i),max:Te(e,s),minDefined:At(t),maxDefined:At(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),a;if(s&&r)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),r||(i=Math.max(i,a.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Te(e,Te(i,e)),max:Te(i,Te(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(){kt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:a}=this.options,o=a.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=Ug(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?zu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=ky(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(){kt(this.options.afterUpdate,[this])}beforeSetDimensions(){kt(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(){kt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),kt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){kt(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=kt(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){kt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){kt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Bu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let a=s,o,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Kt(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:m/(i-1),h+6>o&&(o=m/(i-(t.offset?.5:1)),l=this.maxHeight-ms(t.grid)-e.padding-Hu(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=cr(Math.min(Math.asin(Kt((u.highest.height+6)/o,-1,1)),Math.asin(Kt(l/c,-1,1))-Math.asin(Kt(f/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){kt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){kt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const l=Hu(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=ms(r)+l):(t.height=this.maxHeight,t.width=ms(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=Vt(this.labelRotation),_=Math.cos(g),x=Math.sin(g);if(o){const v=i.mirror?0:x*h.width+_*f.height;t.height=Math.min(this.maxHeight,t.height+v+m)}else{const v=i.mirror?0:_*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+m)}this._calculatePadding(c,u,x,_)}}this._handleMargins(),o?(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:a},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=s*t.width,m=i*e.height):(f=i*t.height,m=s*e.width):r==="start"?m=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,m=e.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let u=e.height/2,h=t.height/2;r==="start"?(u=0,h=t.height):r==="end"&&(u=e.height,h=0),this.paddingTop=u+a,this.paddingBottom=h+a}}_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(){kt(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=zu(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,a=[],o=[],l=Math.floor(e/Bu(e,i));let c=0,u=0,h,f,m,g,_,x,v,M,k,T,P;for(h=0;h<e;h+=l){if(g=t[h].label,_=this._resolveTickFontOptions(h),s.font=x=_.string,v=r[x]=r[x]||{data:{},gc:[]},M=_.lineHeight,k=T=0,!st(g)&&!wt(g))k=fr(s,v.data,v.gc,k,g),T=M;else if(wt(g))for(f=0,m=g.length;f<m;++f)P=g[f],!st(P)&&!wt(P)&&(k=fr(s,v.data,v.gc,k,P),T+=M);a.push(k),o.push(T),c=Math.max(k,c),u=Math.max(T,u)}Ay(r,e);const O=a.indexOf(c),C=o.indexOf(u),p=b=>({width:a[b]||0,height:o[b]||0});return{first:p(0),last:p(e-1),widest:p(O),highest:p(C),widths:a,heights:o}}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 wg(this._alignToPixels?Yn(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=Iy(this.getContext(),t,i))}return this.$context||(this.$context=Ry(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Vt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*i>o*s?o/i:l/s:l*s<o*i?l/i:o/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:a,border:o}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=ms(r),m=[],g=o.setContext(this.getContext()),_=g.display?g.width:0,x=_/2,v=function(Q){return Yn(i,Q,_)};let M,k,T,P,O,C,p,b,S,E,R,I;if(a==="top")M=v(this.bottom),C=this.bottom-f,b=M-x,E=v(t.top)+x,I=t.bottom;else if(a==="bottom")M=v(this.top),E=t.top,I=v(t.bottom)-x,C=M+x,b=this.top+f;else if(a==="left")M=v(this.right),O=this.right-f,p=M-x,S=v(t.left)+x,R=t.right;else if(a==="right")M=v(this.left),S=t.left,R=v(t.right)-x,O=M+x,p=this.left+f;else if(e==="x"){if(a==="center")M=v((t.top+t.bottom)/2+.5);else if(ft(a)){const Q=Object.keys(a)[0],V=a[Q];M=v(this.chart.scales[Q].getPixelForValue(V))}E=t.top,I=t.bottom,C=M+x,b=C+f}else if(e==="y"){if(a==="center")M=v((t.left+t.right)/2);else if(ft(a)){const Q=Object.keys(a)[0],V=a[Q];M=v(this.chart.scales[Q].getPixelForValue(V))}O=M-x,p=O-f,S=t.left,R=t.right}const B=rt(s.ticks.maxTicksLimit,h),j=Math.max(1,Math.ceil(h/B));for(k=0;k<h;k+=j){const Q=this.getContext(k),V=r.setContext(Q),lt=o.setContext(Q),U=V.lineWidth,z=V.color,q=lt.dash||[],J=lt.dashOffset,$=V.tickWidth,yt=V.tickColor,_t=V.tickBorderDash||[],Y=V.tickBorderDashOffset;T=Py(this,k,l),T!==void 0&&(P=Yn(i,T,U),c?O=p=S=R=P:C=b=E=I=P,m.push({tx1:O,ty1:C,tx2:p,ty2:b,x1:S,y1:E,x2:R,y2:I,width:U,color:z,borderDash:q,borderDashOffset:J,tickWidth:$,tickColor:yt,tickBorderDash:_t,tickBorderDashOffset:Y}))}return this._ticksLength=h,this._borderValue=M,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=r,f=ms(i.grid),m=f+u,g=h?-u:m,_=-Vt(this.labelRotation),x=[];let v,M,k,T,P,O,C,p,b,S,E,R,I="middle";if(s==="top")O=this.bottom-g,C=this._getXAxisLabelAlignment();else if(s==="bottom")O=this.top+g,C=this._getXAxisLabelAlignment();else if(s==="left"){const j=this._getYAxisLabelAlignment(f);C=j.textAlign,P=j.x}else if(s==="right"){const j=this._getYAxisLabelAlignment(f);C=j.textAlign,P=j.x}else if(e==="x"){if(s==="center")O=(t.top+t.bottom)/2+m;else if(ft(s)){const j=Object.keys(s)[0],Q=s[j];O=this.chart.scales[j].getPixelForValue(Q)+m}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")P=(t.left+t.right)/2-m;else if(ft(s)){const j=Object.keys(s)[0],Q=s[j];P=this.chart.scales[j].getPixelForValue(Q)}C=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?I="top":l==="end"&&(I="bottom"));const B=this._getLabelSizes();for(v=0,M=o.length;v<M;++v){k=o[v],T=k.label;const j=r.setContext(this.getContext(v));p=this.getPixelForTick(v)+r.labelOffset,b=this._resolveTickFontOptions(v),S=b.lineHeight,E=wt(T)?T.length:1;const Q=E/2,V=j.color,lt=j.textStrokeColor,U=j.textStrokeWidth;let z=C;a?(P=p,C==="inner"&&(v===M-1?z=this.options.reverse?"left":"right":v===0?z=this.options.reverse?"right":"left":z="center"),s==="top"?c==="near"||_!==0?R=-E*S+S/2:c==="center"?R=-B.highest.height/2-Q*S+S:R=-B.highest.height+S/2:c==="near"||_!==0?R=S/2:c==="center"?R=B.highest.height/2-Q*S:R=B.highest.height-E*S,h&&(R*=-1),_!==0&&!j.showLabelBackdrop&&(P+=S/2*Math.sin(_))):(O=p,R=(1-E)*S/2);let q;if(j.showLabelBackdrop){const J=$t(j.backdropPadding),$=B.heights[v],yt=B.widths[v];let _t=R-J.top,Y=0-J.left;switch(I){case"middle":_t-=$/2;break;case"bottom":_t-=$;break}switch(C){case"center":Y-=yt/2;break;case"right":Y-=yt;break;case"inner":v===M-1?Y-=yt:v>0&&(Y-=yt/2);break}q={left:Y,top:_t,width:yt+J.width,height:$+J.height,color:j.backdropColor}}x.push({label:T,font:b,textOffset:R,options:{rotation:_,color:V,strokeColor:lt,strokeWidth:U,textAlign:z,textBaseline:I,translation:[P,O],backdrop:q}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Vt(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,a=this._getLabelSizes(),o=t+r,l=a.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-o,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+o,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:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,a),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,a;const o=(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,a=s.length;r<a;++r){const l=s[r];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({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()),a=i.display?r.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Yn(t,this.left,a)-a/2,u=Yn(t,this.right,o)+o/2,h=f=l):(h=Yn(t,this.top,a)-a/2,f=Yn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ns(i,s);const r=this.getLabelItems(t);for(const a of r){const o=a.options,l=a.font,c=a.label,u=a.textOffset;Vn(i,c,0,u,l,o)}s&&is(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=Rt(i.font),a=$t(i.padding),o=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ft(e)?(l+=a.bottom,wt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Ny(this,l,e,o);Vn(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:f,textAlign:Ly(o,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=rt(t.grid&&t.grid.z,-1),s=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==qn.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,a;for(r=0,a=e.length;r<a;++r){const o=e[r];o[i]===this.id&&(!t||o.type===t)&&s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Rt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Sr{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;zy(e)&&(i=this.register(e));const s=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Fy(t,a,i),this.override&&Pt.override(t.id,t.overrides)),a}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 Wn[i])}}function Fy(n,t,e){const i=Gi(Object.create(null),[e?Pt.get(e):{},Pt.get(t),n.defaults]);Pt.set(t,i),n.defaultRoutes&&By(t,n.defaultRoutes),n.descriptors&&Pt.describe(t,n.descriptors)}function By(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),a=t[e].split("."),o=a.pop(),l=a.join(".");Pt.route(r,s,l,o)})}function zy(n){return"id"in n&&"defaults"in n}class Hy{constructor(){this.controllers=new Sr(Ne,"datasets",!0),this.elements=new Sr(Zt,"elements"),this.plugins=new Sr(Object,"plugins"),this.scales=new Sr(qn,"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):St(s,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,e,i){const s=Na(t);kt(i["before"+s],[],i),e[t](i),kt(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 Ye=new Hy;class Wy{constructor(){this._init=void 0}notify(t,e,i,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const r=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,s){s=s||{};for(const r of t){const a=r.plugin,o=a[i],l=[e,s,r.options];if(kt(o,l,a)===!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=rt(i.options&&i.options.plugins,{}),r=Yy(i);return s===!1&&!e?[]:$y(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,a)=>r.filter(o=>!a.some(l=>o.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Yy(n){const t={},e=[],i=Object.keys(Ye.plugins.items);for(let r=0;r<i.length;r++)e.push(Ye.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const a=s[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Vy(n,t){return!t&&n===!1?null:n===!0?{}:n}function $y(n,{plugins:t,localIds:e},i,s){const r=[],a=n.getContext();for(const o of t){const l=o.id,c=Vy(i[l],s);c!==null&&r.push({plugin:o,options:jy(n.config,{plugin:o,local:e[l]},c,a)})}return r}function jy(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),a=n.getOptionScopes(i,r);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function lo(n,t){const e=Pt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Uy(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function qy(n,t){return n===t?"_index_":"_value_"}function Wu(n){if(n==="x"||n==="y"||n==="r")return n}function Xy(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function co(n,...t){if(Wu(n))return n;for(const e of t){const i=e.axis||Xy(e.position)||n.length>1&&Wu(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Yu(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Gy(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 Yu(n,"x",e[0])||Yu(n,"y",e[0])}return{}}function Ky(n,t){const e=Wn[n.type]||{scales:{}},i=t.scales||{},s=lo(n.type,t),r=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!ft(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=co(a,o,Gy(a,n),Pt.scales[o.type]),c=qy(l,s),u=e.scales||{};r[a]=Ki(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(a=>{const o=a.type||n.type,l=a.indexAxis||lo(o,t),u=(Wn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Uy(h,l),m=a[f+"AxisID"]||f;r[m]=r[m]||Object.create(null),Ki(r[m],[{axis:f},i[m],u[h]])})}),Object.keys(r).forEach(a=>{const o=r[a];Ki(o,[Pt.scales[o.type],Pt.scale])}),r}function Vu(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=Ky(n,t)}function $u(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Zy(n){return n=n||{},n.data=$u(n.data),Vu(n),n}const ju=new Map,Uu=new Set;function Tr(n,t){let e=ju.get(n);return e||(e=t(),ju.set(n,e),Uu.add(e)),e}const gs=(n,t,e)=>{const i=_n(t,e);i!==void 0&&n.add(i)};class Qy{constructor(t){this._config=Zy(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=$u(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(),Vu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Tr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Tr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Tr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Tr(`${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,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>gs(l,t,h))),u.forEach(h=>gs(l,s,h)),u.forEach(h=>gs(l,Wn[r]||{},h)),u.forEach(h=>gs(l,Pt,h)),u.forEach(h=>gs(l,Ya,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Uu.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Wn[e]||{},Pt.datasets[e]||{},{type:e},Pt,Ya]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:o}=qu(this._resolverCache,t,s);let l=a;if(tb(a,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,o);l=pi(a,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=qu(this._resolverCache,t,i);return ft(e)?pi(r,e,void 0,s):r}}function qu(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:Ua(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(s,r)),r}const Jy=n=>ft(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function tb(n,t){const{isScriptable:e,isIndexable:i}=Gc(n);for(const s of t){const r=e(s),a=i(s),o=(a||r)&&n[s];if(r&&(pe(o)||Jy(o))||a&&wt(o))return!0}return!1}var eb="4.5.1";const nb=["top","bottom","left","right","chartArea"];function Xu(n,t){return n==="top"||n==="bottom"||nb.indexOf(n)===-1&&t==="x"}function Gu(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Ku(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),kt(e&&e.onComplete,[n],t)}function ib(n){const t=n.chart,e=t.options.animation;kt(e&&e.onProgress,[n],t)}function Zu(n){return Ga()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Dr={},Qu=n=>{const t=Zu(n);return Object.values(Dr).filter(e=>e.canvas===t).pop()};function sb(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const a=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=a)}}}function rb(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let ye=(In=class{static register(...t){Ye.add(...t),Ju()}static unregister(...t){Ye.remove(...t),Ju()}constructor(t,e){const i=this.config=new Qy(e),s=Zu(t),r=Qu(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 a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||My(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=cg(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=a,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 Wy,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Sg(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Dr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Ku),en.listen(this,"progress",ib),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 Ye}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():iu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Uc(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(t,e){en.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,a=this.platform.getMaximumSize(s,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,iu(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),kt(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};St(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const o=e[a],l=co(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),St(r,a=>{const o=a.options,l=o.id,c=co(l,o),u=rt(o.type,a.dtype);(o.position===void 0||Xu(o.position,c)!==Xu(a.dposition))&&(o.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ye.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),St(s,(a,o)=>{a||delete i[o]}),St(i,a=>{re.configure(this,a,a.options),re.addBox(this,a)})}_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(Gu("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 a=this.getDatasetMeta(i);const o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=r.indexAxis||lo(o,this.options),a.order=r.order||0,a.index=i,a.label=""+r.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=Ye.getController(o),{datasetElementType:c,dataElementType:u}=Pt.datasets[o];Object.assign(l,{dataElementType:Ye.getElement(u),datasetElementType:c&&Ye.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){St(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 a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&r.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||St(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gu("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){St(this.scales,t=>{re.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Oc(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 a=i==="_removeElements"?-r:r;sb(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(a=>a[0]===r).map((a,o)=>o+","+a.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Oc(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;re.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],St(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,pe(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&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Ku({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 a=e[s];(!t||a.visible)&&i.push(a)}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={meta:t,index:t.index,cancelable:!0},s=fu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&ns(e,s),t.controller.draw(),s&&is(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return tn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=ao.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=Mn(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),a=r.controller._resolveAnimations(void 0,s);ge(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(o=>o.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(),en.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(),Uc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Dr[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,a)=>{e.addEventListener(this,r,a),t[r]=a},s=(r,a,o)=>{r.offsetX=a,r.offsetY=o,this._eventHandler(r)};St(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 a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){St(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},St(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,a,o,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:a})=>{const o=this.getDatasetMeta(r);if(!o)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:o.data[a],index:a}});!rr(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(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.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,a=e,o=this._getActiveElements(t,s,i,a),l=gg(t),c=rb(t,this._lastEvent,i,l);i&&(this._lastEvent=null,kt(r.onHover,[t,o,this],this),l&&kt(r.onClick,[t,o,this],this));const u=!rr(o,s);return(u||e)&&(this._active=o,this._updateHoverStyles(o,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)}},A(In,"defaults",Pt),A(In,"instances",Dr),A(In,"overrides",Wn),A(In,"registry",Ye),A(In,"version",eb),A(In,"getChart",Qu),In);function Ju(){return St(ye.instances,n=>n._plugins.invalidate())}function ab(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:a,innerRadius:o,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/a,ie(i-e));if(n.beginPath(),n.arc(s,r,a-c/2,i+h/2,e-h/2),o>0){const f=Math.min(c/o,ie(i-e));n.arc(s,r,o+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*ie(i-e));if(u==="round")n.arc(s,r,f,e-ut/2,i+ut/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(e+ut/2)+s,_=-m*Math.sin(e+ut/2)+r,x=m*Math.cos(i+ut/2)+s,v=m*Math.sin(i+ut/2)+r;n.lineTo(g,_),n.lineTo(x,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function ob(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:a,outerRadius:o,innerRadius:l}=t;let c=s/o;n.beginPath(),n.arc(r,a,o,i-c,e+c),l>s?(c=s/l,n.arc(r,a,l,e+c,i-c,!0)):n.arc(r,a,s,e+Ot,i-Ot),n.closePath(),n.clip()}function lb(n){return ja(n,["outerStart","outerEnd","innerStart","innerEnd"])}function cb(n,t,e,i){const s=lb(n.options.borderRadius),r=(e-t)/2,a=Math.min(r,i*t/2),o=l=>{const c=(e-Math.min(r,l))*i/2;return Kt(l,0,Math.min(r,c))};return{outerStart:o(s.outerStart),outerEnd:o(s.outerEnd),innerStart:Kt(s.innerStart,0,a),innerEnd:Kt(s.innerEnd,0,a)}}function _i(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Cr(n,t,e,i,s,r){const{x:a,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let m=0;const g=s-l;if(i){const j=u>0?u-i:0,Q=h>0?h-i:0,V=(j+Q)/2,lt=V!==0?g*V/(V+i):g;m=(g-lt)/2}const _=Math.max(.001,g*h-e/ut)/h,x=(g-_)/2,v=l+x+m,M=s-x-m,{outerStart:k,outerEnd:T,innerStart:P,innerEnd:O}=cb(t,f,h,M-v),C=h-k,p=h-T,b=v+k/C,S=M-T/p,E=f+P,R=f+O,I=v+P/E,B=M-O/R;if(n.beginPath(),r){const j=(b+S)/2;if(n.arc(a,o,h,b,j),n.arc(a,o,h,j,S),T>0){const U=_i(p,S,a,o);n.arc(U.x,U.y,T,S,M+Ot)}const Q=_i(R,M,a,o);if(n.lineTo(Q.x,Q.y),O>0){const U=_i(R,B,a,o);n.arc(U.x,U.y,O,M+Ot,B+Math.PI)}const V=(M-O/f+(v+P/f))/2;if(n.arc(a,o,f,M-O/f,V,!0),n.arc(a,o,f,V,v+P/f,!0),P>0){const U=_i(E,I,a,o);n.arc(U.x,U.y,P,I+Math.PI,v-Ot)}const lt=_i(C,v,a,o);if(n.lineTo(lt.x,lt.y),k>0){const U=_i(C,b,a,o);n.arc(U.x,U.y,k,v-Ot,b)}}else{n.moveTo(a,o);const j=Math.cos(b)*h+a,Q=Math.sin(b)*h+o;n.lineTo(j,Q);const V=Math.cos(S)*h+a,lt=Math.sin(S)*h+o;n.lineTo(V,lt)}n.closePath()}function ub(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o}=t;let l=t.endAngle;if(r){Cr(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(o)||(l=a+(o%Ct||Ct))}return Cr(n,t,e,i,l,s),n.fill(),l}function db(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let _=t.endAngle;if(r){Cr(n,t,e,i,_,s);for(let x=0;x<r;++x)n.stroke();isNaN(o)||(_=a+(o%Ct||Ct))}g&&ob(n,t,_),l.selfJoin&&_-a>=ut&&m===0&&u!=="miter"&&ab(n,t,_),r||(Cr(n,t,e,i,_,s),n.stroke())}class ps extends Zt{constructor(e){super();A(this,"circumference");A(this,"endAngle");A(this,"fullCircles");A(this,"innerRadius");A(this,"outerRadius");A(this,"pixelMargin");A(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:a,distance:o}=ur(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,g=rt(f,c-l),_=Qi(a,l,c)&&l!==c,x=g>=Ct||_,v=Qe(o,u+m,h+m);return x&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(r+a)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ct?Math.floor(s/Ct):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(ut,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,ub(e,this,u,a,o),db(e,this,u,a,o),e.restore()}}A(ps,"id","arc"),A(ps,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),A(ps,"defaultRoutes",{backgroundColor:"backgroundColor"}),A(ps,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function td(n,t,e=t){n.lineCap=rt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(rt(e.borderDash,t.borderDash)),n.lineDashOffset=rt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=rt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=rt(e.borderWidth,t.borderWidth),n.strokeStyle=rt(e.borderColor,t.borderColor)}function hb(n,t,e){n.lineTo(e.x,e.y)}function fb(n){return n.stepped?Fg:n.tension||n.cubicInterpolationMode==="monotone"?Bg:hb}function ed(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:a,end:o}=t,l=Math.max(s,a),c=Math.min(r,o),u=s<a&&r<a||s>o&&r>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function mb(n,t,e,i){const{points:s,options:r}=t,{count:a,start:o,loop:l,ilen:c}=ed(s,e,i),u=fb(r);let{move:h=!0,reverse:f}=i||{},m,g,_;for(m=0;m<=c;++m)g=s[(o+(f?c-m:m))%a],!g.skip&&(h?(n.moveTo(g.x,g.y),h=!1):u(n,_,g,f,r.stepped),_=g);return l&&(g=s[(o+(f?c:0))%a],u(n,_,g,f,r.stepped)),!!l}function gb(n,t,e,i){const s=t.points,{count:r,start:a,ilen:o}=ed(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,g,_,x,v;const M=T=>(a+(c?o-T:T))%r,k=()=>{_!==x&&(n.lineTo(u,x),n.lineTo(u,_),n.lineTo(u,v))};for(l&&(m=s[M(0)],n.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=s[M(f)],m.skip)continue;const T=m.x,P=m.y,O=T|0;O===g?(P<_?_=P:P>x&&(x=P),u=(h*u+T)/++h):(k(),n.lineTo(T,P),g=O,h=0,_=x=P),v=P}k()}function uo(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?gb:mb}function pb(n){return n.stepped?pp:n.tension||n.cubicInterpolationMode==="monotone"?yp:jn}function yb(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),td(n,t.options),n.stroke(s)}function bb(n,t,e,i){const{segments:s,options:r}=t,a=uo(t);for(const o of s)td(n,r,o.style),n.beginPath(),a(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const _b=typeof Path2D=="function";function xb(n,t,e,i){_b&&!t.options.segment?yb(n,t,e,i):bb(n,t,e,i)}class Tn extends Zt{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;lp(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=Mp(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,a=uu(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],l=pb(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:h,end:f}=a[c],m=r[h],g=r[f];if(m===g){o.push(m);continue}const _=Math.abs((s-m[e])/(g[e]-m[e])),x=l(m,g,_,i.stepped);x[e]=t[e],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,e,i){return uo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=uo(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=r(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),xb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}A(Tn,"id","line"),A(Tn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),A(Tn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),A(Tn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function nd(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class Er extends Zt{constructor(e){super();A(this,"parsed");A(this,"skip");A(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:a,y:o}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return nd(this,e,"x",i)}inYRange(e,i){return nd(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||!tn(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,$a(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}A(Er,"id","point"),A(Er,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),A(Er,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function id(n,t){const{x:e,y:i,base:s,width:r,height:a}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,h;return n.horizontal?(h=a/2,o=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=r/2,o=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:o,top:c,right:l,bottom:u}}function Dn(n,t,e,i){return n?0:Kt(t,e,i)}function wb(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Xc(i);return{t:Dn(s.top,r.top,0,e),r:Dn(s.right,r.right,0,t),b:Dn(s.bottom,r.bottom,0,e),l:Dn(s.left,r.left,0,t)}}function vb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=vn(s),a=Math.min(t,e),o=n.borderSkipped,l=i||ft(s);return{topLeft:Dn(!l||o.top||o.left,r.topLeft,0,a),topRight:Dn(!l||o.top||o.right,r.topRight,0,a),bottomLeft:Dn(!l||o.bottom||o.left,r.bottomLeft,0,a),bottomRight:Dn(!l||o.bottom||o.right,r.bottomRight,0,a)}}function Mb(n){const t=id(n),e=t.right-t.left,i=t.bottom-t.top,s=wb(n,e/2,i/2),r=vb(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 ho(n,t,e,i){const s=t===null,r=e===null,o=n&&!(s&&r)&&id(n,i);return o&&(s||Qe(t,o.left,o.right))&&(r||Qe(e,o.top,o.bottom))}function kb(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Sb(n,t){n.rect(t.x,t.y,t.w,t.h)}function fo(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,a=(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+a,radius:n.radius}}class Or extends Zt{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:a}=Mb(this),o=kb(a.radius)?gi:Sb;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),o(t,fo(a,e,r)),t.clip(),o(t,fo(r,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,fo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ho(this,t,e,i)}inXRange(t,e){return ho(this,t,null,e)}inYRange(t,e){return ho(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}}A(Or,"id","bar"),A(Or,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),A(Or,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Tb=Object.freeze({__proto__:null,ArcElement:ps,BarElement:Or,LineElement:Tn,PointElement:Er});const mo=["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)"],sd=mo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function rd(n){return mo[n%mo.length]}function ad(n){return sd[n%sd.length]}function Db(n,t){return n.borderColor=rd(t),n.backgroundColor=ad(t),++t}function Cb(n,t){return n.backgroundColor=n.data.map(()=>rd(t++)),t}function Eb(n,t){return n.backgroundColor=n.data.map(()=>ad(t++)),t}function Ob(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof nn?t=Cb(e,t):s instanceof ls?t=Eb(e,t):s&&(t=Db(e,t))}}function od(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Pb(n){return n&&(n.borderColor||n.backgroundColor)}function Ab(){return Pt.borderColor!=="rgba(0,0,0,0.1)"||Pt.backgroundColor!=="rgba(0,0,0,0.1)"}var Rb={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,a=od(i)||Pb(s)||r&&od(r)||Ab();if(!e.forceOverride&&a)return;const o=Ob(n);i.forEach(o)}};function Ib(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const a=[],o=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,h,f,m,g,_;for(a[l++]=n[u],h=0;h<r-2;h++){let x=0,v=0,M;const k=Math.floor((h+1)*o)+1+t,T=Math.min(Math.floor((h+2)*o)+1,e)+t,P=T-k;for(M=k;M<T;M++)x+=n[M].x,v+=n[M].y;x/=P,v/=P;const O=Math.floor(h*o)+1+t,C=Math.min(Math.floor((h+1)*o)+1,e)+t,{x:p,y:b}=n[u];for(m=g=-1,M=O;M<C;M++)g=.5*Math.abs((p-x)*(n[M].y-b)-(p-n[M].x)*(v-b)),g>m&&(m=g,f=n[M],_=M);a[l++]=f,u=_}return a[l++]=n[c],a}function Lb(n,t,e,i){let s=0,r=0,a,o,l,c,u,h,f,m,g,_;const x=[],v=t+e-1,M=n[t].x,T=n[v].x-M;for(a=t;a<t+e;++a){o=n[a],l=(o.x-M)/T*i,c=o.y;const P=l|0;if(P===u)c<g?(g=c,h=a):c>_&&(_=c,f=a),s=(r*s+o.x)/++r;else{const O=a-1;if(!st(h)&&!st(f)){const C=Math.min(h,f),p=Math.max(h,f);C!==m&&C!==O&&x.push({...n[C],x:s}),p!==m&&p!==O&&x.push({...n[p],x:s})}a>0&&O!==m&&x.push(n[O]),x.push(o),u=P,r=0,g=_=c,h=f=m=a}}return x}function ld(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 cd(n){n.data.datasets.forEach(t=>{ld(t)})}function Nb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:a,max:o,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Kt(Je(t,r.axis,a).lo,0,e-1)),c?s=Kt(Je(t,r.axis,o).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Fb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){cd(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:o}=s,l=n.getDatasetMeta(r),c=a||s.data;if(ss([o,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:h,count:f}=Nb(l,c);const m=e.threshold||4*i;if(f<=m){ld(s);return}st(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(_){this._data=_}}));let g;switch(e.algorithm){case"lttb":g=Ib(c,h,f,i,e);break;case"min-max":g=Lb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(n){cd(n)}};function Bb(n,t,e){const i=n.segments,s=n.points,r=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=Pr(l,c,s);const u=go(e,s[l],s[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:s[l],end:s[c]});continue}const h=uu(t,u);for(const f of h){const m=go(e,r[f.start],r[f.end],f.loop),g=cu(o,s,m);for(const _ of g)a.push({source:_,target:f,start:{[e]:ud(u,m,"start",Math.max)},end:{[e]:ud(u,m,"end",Math.min)}})}}return a}function go(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=ie(s),r=ie(r)),{property:n,start:s,end:r}}function zb(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:a,end:o})=>{o=Pr(a,o,s);const l=s[a],c=s[o];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 Pr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function ud(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function dd(n,t){let e=[],i=!1;return wt(n)?(i=!0,e=n):e=zb(n,t),e.length?new Tn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function hd(n){return n&&n.fill!==!1}function Hb(n,t,e){let s=n[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!At(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function Wb(n,t,e){const i=jb(n);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return At(s)&&Math.floor(s)===s?Yb(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Yb(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Vb(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ft(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function $b(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ft(n)?i=n.value:i=t.getBaseValue(),i}function jb(n){const t=n.options,e=t.fill;let i=rt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Ub(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,a=i.points,o=qb(t,e);o.push(dd({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++)Xb(s,a[u],o)}return new Tn({points:s,options:{}})}function qb(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 Xb(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:a,last:o,point:l}=Gb(r,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function Gb(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,a=n.points;let o=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],h=a[u.start][e],f=a[u.end][e];if(Qe(s,h,f)){o=s===h,l=s===f;break}}return{first:o,last:l,point:i}}class fd{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:a}=this;return e=e||{start:0,end:Ct},t.arc(s,r,a,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 Kb(n){const{chart:t,fill:e,line:i}=n;if(At(e))return Zb(t,e);if(e==="stack")return Ub(n);if(e==="shape")return!0;const s=Qb(n);return s instanceof fd?s:dd(s,i)}function Zb(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Qb(n){return(n.scale||{}).getPointPositionForValue?t0(n):Jb(n)}function Jb(n){const{scale:t={},fill:e}=n,i=Vb(e,t);if(At(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function t0(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,a=$b(e,t,r),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new fd({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)o.push(t.getPointPositionForValue(l,a));return o}function po(n,t,e){const i=Kb(t),{chart:s,index:r,line:a,scale:o,axis:l}=t,c=a.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},g=s.getDatasetMeta(r),_=fu(s,g);i&&a.points.length&&(ns(n,e),e0(n,{line:a,target:i,above:f,below:m,area:e,scale:o,axis:l,clip:_}),is(n))}function e0(n,t){const{line:e,target:i,above:s,below:r,area:a,scale:o,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(md(n,i,a.top),yo(n,{line:e,target:i,color:s,scale:o,property:c,clip:l}),n.restore(),n.save(),md(n,i,a.bottom)):c==="y"&&(gd(n,i,a.left),yo(n,{line:e,target:i,color:r,scale:o,property:c,clip:l}),n.restore(),n.save(),gd(n,i,a.right),u=s)),yo(n,{line:e,target:i,color:u,scale:o,property:c,clip:l}),n.restore()}function md(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Pr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function gd(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Pr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function yo(n,t){const{line:e,target:i,property:s,color:r,scale:a,clip:o}=t,l=Bb(e,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=r}={}}=c,g=i!==!0;n.save(),n.fillStyle=m,n0(n,a,o,g&&go(s,h,f)),n.beginPath();const _=!!e.pathSegment(n,c);let x;if(g){_?n.closePath():pd(n,i,f,s);const v=!!i.pathSegment(n,u,{move:_,reverse:!0});x=_&&v,x||pd(n,i,h,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function n0(n,t,e,i){const s=t.chart.chartArea,{property:r,start:a,end:o}=i||{};if(r==="x"||r==="y"){let l,c,u,h;r==="x"?(l=a,c=s.top,u=o,h=s.bottom):(l=s.left,c=a,u=s.right,h=o),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),n.rect(l,c,u-l,h-c),n.clip()}}function pd(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var i0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,a,o,l;for(a=0;a<i;++a)r=n.getDatasetMeta(a),o=r.dataset,l=null,o&&o.options&&o instanceof Tn&&(l={visible:n.isDatasetVisible(a),index:a,fill:Wb(o,a,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=Hb(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let a=s.length-1;a>=0;--a){const o=s[a].$filler;o&&(o.line.updateControlPoints(r,o.axis),i&&o.fill&&po(n.ctx,o,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;hd(r)&&po(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!hd(i)||e.drawTime!=="beforeDatasetDraw"||po(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const yd=(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)}},s0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class bd extends Zt{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=kt(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=Rt(i.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=yd(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,r,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,s,o,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:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+o;let h=t;r.textAlign="left",r.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,_)=>{const x=i+e/2+r.measureText(g.text).width;(_===0||c[c.length-1]+x+2*o>a)&&(h+=u,c[c.length-(_>0?0:1)]=0,m+=u,f++),l[_]={left:0,top:m,row:f,width:x,height:s},c[c.length-1]+=x+o}),h}_fitCols(t,e,i,s){const{ctx:r,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,g=0,_=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:M,itemHeight:k}=r0(i,e,r,x,s);v>0&&m+k+2*o>u&&(h+=f+o,c.push({width:f,height:m}),g+=f+o,_++,f=m=0),l[v]={left:g,top:m,col:_,width:M,height:k},f=Math.max(f,M),m+=k+o}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,a=bi(r,this.left,this.width);if(this.isHorizontal()){let o=0,l=se(i,this.left+s,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=se(i,this.left+s,this.right-this.lineWidths[o])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let o=0,l=se(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=se(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.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;ns(t,this),this._draw(),is(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:a}=t,o=Pt.color,l=bi(t.rtl,this.left,this.width),c=Rt(a.font),{padding:u}=a,h=c.size,f=h/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:_,itemHeight:x}=yd(a,h),v=function(O,C,p){if(isNaN(g)||g<=0||isNaN(_)||_<0)return;s.save();const b=rt(p.lineWidth,1);if(s.fillStyle=rt(p.fillStyle,o),s.lineCap=rt(p.lineCap,"butt"),s.lineDashOffset=rt(p.lineDashOffset,0),s.lineJoin=rt(p.lineJoin,"miter"),s.lineWidth=b,s.strokeStyle=rt(p.strokeStyle,o),s.setLineDash(rt(p.lineDash,[])),a.usePointStyle){const S={radius:_*Math.SQRT2/2,pointStyle:p.pointStyle,rotation:p.rotation,borderWidth:b},E=l.xPlus(O,g/2),R=C+f;qc(s,S,E,R,a.pointStyleWidth&&g)}else{const S=C+Math.max((h-_)/2,0),E=l.leftForLtr(O,g),R=vn(p.borderRadius);s.beginPath(),Object.values(R).some(I=>I!==0)?gi(s,{x:E,y:S,w:g,h:_,radius:R}):s.rect(E,S,g,_),s.fill(),b!==0&&s.stroke()}s.restore()},M=function(O,C,p){Vn(s,p.text,O,C+x/2,c,{strikethrough:p.hidden,textAlign:l.textAlign(p.textAlign)})},k=this.isHorizontal(),T=this._computeTitleHeight();k?m={x:se(r,this.left+u,this.right-i[0]),y:this.top+u+T,line:0}:m={x:this.left+u,y:se(r,this.top+T+u,this.bottom-e[0].height),line:0},ru(this.ctx,t.textDirection);const P=x+u;this.legendItems.forEach((O,C)=>{s.strokeStyle=O.fontColor,s.fillStyle=O.fontColor;const p=s.measureText(O.text).width,b=l.textAlign(O.textAlign||(O.textAlign=a.textAlign)),S=g+f+p;let E=m.x,R=m.y;l.setWidth(this.width),k?C>0&&E+S+u>this.right&&(R=m.y+=P,m.line++,E=m.x=se(r,this.left+u,this.right-i[m.line])):C>0&&R+P>this.bottom&&(E=m.x=E+e[m.line].width+u,m.line++,R=m.y=se(r,this.top+T+u,this.bottom-e[m.line].height));const I=l.x(E);if(v(I,R,O),E=Tg(b,E+g+f,k?E+S:this.right,t.rtl),M(l.x(E),R,O),k)m.x+=S+u;else if(typeof O.text!="string"){const B=c.lineHeight;m.y+=_d(O,B)+u}else m.y+=P}),au(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Rt(e.font),s=$t(e.padding);if(!e.display)return;const r=bi(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=se(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((_,x)=>Math.max(_,x.height),0);u=c+se(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=se(o,h,h+f);a.textAlign=r.textAlign(za(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Vn(a,e.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,e=Rt(t.font),i=$t(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Qe(t,this.left,this.right)&&Qe(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Qe(t,s.left,s.left+s.width)&&Qe(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!l0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=s0(s,i);s&&!r&&kt(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&kt(e.onHover,[t,i,this],this)}else i&&kt(e.onClick,[t,i,this],this)}}function r0(n,t,e,i,s){const r=a0(i,n,t,e),a=o0(s,i,t.lineHeight);return{itemWidth:r,itemHeight:a}}function a0(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+i.measureText(s).width}function o0(n,t,e){let i=n;return typeof t.text!="string"&&(i=_d(t,e)),i}function _d(n,t){const e=n.text?n.text.length:0;return t*e}function l0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var c0={id:"legend",_element:bd,start(n,t,e){const i=n.legend=new bd({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i)},stop(n){re.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;re.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:a,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=$t(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:a&&(o||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 bo extends Zt{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=wt(i.text)?i.text.length:1;this._padding=$t(i.padding);const r=s*Rt(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:a}=this,o=a.align;let l=0,c,u,h;return this.isHorizontal()?(u=se(o,i,r),h=e+t,c=r-i):(a.position==="left"?(u=i+t,h=se(o,s,e),l=ut*-.5):(u=r-t,h=se(o,e,s),l=ut*.5),c=s-e),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Rt(e.font),r=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(r);Vn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:za(e.align),textBaseline:"middle",translation:[a,o]})}}function u0(n,t){const e=new bo({ctx:n.ctx,options:t,chart:n});re.configure(n,e,t),re.addBox(n,e),n.titleBlock=e}var d0={id:"title",_element:bo,start(n,t,e){u0(n,e)},stop(n){const t=n.titleBlock;re.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;re.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 Ar=new WeakMap;var h0={id:"subtitle",start(n,t,e){const i=new bo({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i),Ar.set(n,i)},stop(n){re.removeBox(n,Ar.get(n)),Ar.delete(n)},beforeUpdate(n,t,e){const i=Ar.get(n);re.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 ys={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 o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+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,a,o;for(r=0,a=n.length;r<a;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=mi(t,c);u<s&&(s=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ve(n,t){return t&&(wt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function sn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function f0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function xd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),u=Rt(t.footerFont),h=r.length,f=s.length,m=i.length,g=$t(t.padding);let _=g.height,x=0,v=i.reduce((T,P)=>T+P.before.length+P.lines.length+P.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,h&&(_+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){const T=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;_+=m*T+(v-m)*l.lineHeight+(v-1)*t.bodySpacing}f&&(_+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const k=function(T){x=Math.max(x,e.measureText(T).width+M)};return e.save(),e.font=c.string,St(n.title,k),e.font=l.string,St(n.beforeBody.concat(n.afterBody),k),M=t.displayColors?a+2+t.boxPadding:0,St(i,T=>{St(T.before,k),St(T.lines,k),St(T.after,k)}),M=0,e.font=u.string,St(n.footer,k),e.restore(),x+=g.width,{width:x,height:_}}function m0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function g0(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function p0(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),g0(c,n,t,e)&&(c="center"),c}function wd(n,t,e){const i=e.yAlign||t.yAlign||m0(n,e);return{xAlign:e.xAlign||t.xAlign||p0(n,t,e,i),yAlign:i}}function y0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function b0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function vd(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=vn(a);let g=y0(t,o);const _=b0(t,l,c);return l==="center"?o==="left"?g+=c:o==="right"&&(g-=c):o==="left"?g-=Math.max(u,f)+s:o==="right"&&(g+=Math.max(h,m)+s),{x:Kt(g,0,i.width-t.width),y:Kt(_,0,i.height-t.height)}}function Rr(n,t,e){const i=$t(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Md(n){return Ve([],sn(n))}function _0(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function kd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Sd={beforeTitle:Ze,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:Ze,beforeBody:Ze,beforeLabel:Ze,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:Ze,afterBody:Ze,beforeFooter:Ze,footer:Ze,afterFooter:Ze};function be(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Sd[t].call(e,i):s}class _o extends Zt{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 Za(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=_0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=be(i,"beforeTitle",this,t),r=be(i,"title",this,t),a=be(i,"afterTitle",this,t);let o=[];return o=Ve(o,sn(s)),o=Ve(o,sn(r)),o=Ve(o,sn(a)),o}getBeforeBody(t,e){return Md(be(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return St(t,r=>{const a={before:[],lines:[],after:[]},o=kd(i,r);Ve(a.before,sn(be(o,"beforeLabel",this,r))),Ve(a.lines,be(o,"label",this,r)),Ve(a.after,sn(be(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Md(be(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=be(i,"beforeFooter",this,t),r=be(i,"footer",this,t),a=be(i,"afterFooter",this,t);let o=[];return o=Ve(o,sn(s)),o=Ve(o,sn(r)),o=Ve(o,sn(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(f0(this.chart,e[l]));return t.filter&&(o=o.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(o=o.sort((u,h)=>t.itemSort(u,h,i))),St(o,u=>{const h=kd(t.callbacks,u);s.push(be(h,"labelColor",this,u)),r.push(be(h,"labelPointStyle",this,u)),a.push(be(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=ys[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=xd(this,i),c=Object.assign({},o,l),u=wd(this.chart,i,c),h=vd(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,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:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=vn(o),{x:f,y:m}=t,{width:g,height:_}=e;let x,v,M,k,T,P;return r==="center"?(T=m+_/2,s==="left"?(x=f,v=x-a,k=T+a,P=T-a):(x=f+g,v=x+a,k=T-a,P=T+a),M=x):(s==="left"?v=f+Math.max(l,u)+a:s==="right"?v=f+g-Math.max(c,h)-a:v=this.caretX,r==="top"?(k=m,T=k-a,x=v-a,M=v+a):(k=m+_,T=k+a,x=v+a,M=v-a),P=k),{x1:x,x2:v,x3:M,y1:k,y2:T,y3:P}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=bi(i.rtl,this.x,this.width);for(t.x=Rr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=Rt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=Rt(r.bodyFont),h=Rr(this,"left",r),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+m;if(r.usePointStyle){const _={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,$a(t,_,x,v),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,$a(t,_,x,v)}else{t.lineWidth=ft(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const _=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=vn(a.borderRadius);Object.values(v).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,gi(t,{x:_,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),gi(t,{x,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(_,g,c,l),t.strokeRect(_,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=Rt(i.bodyFont);let f=h.lineHeight,m=0;const g=bi(i.rtl,this.x,this.width),_=function(p){e.fillText(p,g.x(t.x+m),t.y+f/2),t.y+=f+r},x=g.textAlign(a);let v,M,k,T,P,O,C;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Rr(this,x,i),e.fillStyle=i.bodyColor,St(this.beforeBody,_),m=o&&x!=="right"?a==="center"?c/2+u:c+2+u:0,T=0,O=s.length;T<O;++T){for(v=s[T],M=this.labelTextColors[T],e.fillStyle=M,St(v.before,_),k=v.lines,o&&k.length&&(this._drawColorBox(e,t,T,g,i),f=Math.max(h.lineHeight,l)),P=0,C=k.length;P<C;++P)_(k[P]),f=h.lineHeight;St(v.after,_)}m=0,f=h.lineHeight,St(this.afterBody,_),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=bi(i.rtl,this.x,this.width);for(t.x=Rr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=Rt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+h,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-g),e.quadraticCurveTo(o+c,l+u,o+c-g,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+m,l+u),e.quadraticCurveTo(o,l+u,o,l+u-m),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+h),e.quadraticCurveTo(o,l,o+h,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 a=ys[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=xd(this,t),l=Object.assign({},a,this._size),c=wd(e,t,l),u=vd(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.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 a=$t(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),ru(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),au(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),r=!rr(i,s),a=this._positionChanged(s,e);(r||a)&&(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||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!rr(a,r)||o;return l&&(this._active=a,(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(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=ys[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}A(_o,"positioners",ys);var De={id:"tooltip",_element:_o,positioners:ys,afterInit(n,t,e){e&&(n.tooltip=new _o({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:Sd},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"]},x0=Object.freeze({__proto__:null,Colors:Rb,Decimation:Fb,Filler:i0,Legend:c0,SubTitle:h0,Title:d0,Tooltip:De});const w0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function v0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return w0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const M0=(n,t)=>n===null?null:Kt(Math.round(n),0,t);function Td(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class xo extends qn{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:v0(i,t,rt(e,t),this._addedLabels),M0(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 a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Td.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}}A(xo,"id","category"),A(xo,"defaults",{ticks:{callback:Td}});function k0(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,g=u-1,{min:_,max:x}=t,v=!st(a),M=!st(o),k=!st(c),T=(x-_)/(h+1);let P=Pc((x-_)/g/m)*m,O,C,p,b;if(P<1e-14&&!v&&!M)return[{value:_},{value:x}];b=Math.ceil(x/P)-Math.floor(_/P),b>g&&(P=Pc(b*P/g/m)*m),st(l)||(O=Math.pow(10,l),P=Math.ceil(P*O)/O),s==="ticks"?(C=Math.floor(_/P)*P,p=Math.ceil(x/P)*P):(C=_,p=x),v&&M&&r&&_g((o-a)/r,P/1e3)?(b=Math.round(Math.min((o-a)/P,u)),P=(o-a)/b,C=a,p=o):k?(C=v?a:C,p=M?o:p,b=c-1,P=(p-C)/b):(b=(p-C)/P,Zi(b,Math.round(b),P/1e3)?b=Math.round(b):b=Math.ceil(b));const S=Math.max(Rc(P),Rc(C));O=Math.pow(10,st(l)?S:l),C=Math.round(C*O)/O,p=Math.round(p*O)/O;let E=0;for(v&&(f&&C!==a?(e.push({value:a}),C<a&&E++,Zi(Math.round((C+E*P)*O)/O,a,Dd(a,T,n))&&E++):C<a&&E++);E<b;++E){const R=Math.round((C+E*P)*O)/O;if(M&&R>o)break;e.push({value:R})}return M&&f&&p!==o?e.length&&Zi(e[e.length-1].value,o,Dd(o,T,n))?e[e.length-1].value=o:e.push({value:o}):(!M||p===o)&&e.push({value:p}),e}function Dd(n,t,{horizontal:e,minRotation:i}){const s=Vt(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Ir extends qn{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 a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=We(s),c=We(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(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,a=k0(s,r);return t.bounds==="ticks"&&Ac(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}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 ts(t,this.chart.options.locale,this.options.ticks.format)}}class wo extends Ir{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Vt(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}}A(wo,"id","linear"),A(wo,"defaults",{ticks:{callback:hr.formatters.numeric}});const bs=n=>Math.floor(xn(n)),Xn=(n,t)=>Math.pow(10,bs(n)+t);function Cd(n){return n/Math.pow(10,bs(n))===1}function Ed(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function S0(n,t){const e=t-n;let i=bs(e);for(;Ed(n,t,i)>10;)i++;for(;Ed(n,t,i)<10;)i--;return Math.min(i,bs(n))}function T0(n,{min:t,max:e}){t=Te(n.min,t);const i=[],s=bs(t);let r=S0(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=Te(n.min,Math.round((l+u+h*Math.pow(10,r))*a)/a);for(;f<e;)i.push({value:f,major:Cd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,a=r>=0?1:a),f=Math.round((l+u+h*Math.pow(10,r))*a)/a;const m=Te(n.max,f);return i.push({value:m,major:Cd(m),significand:h}),i}class vo extends qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Ir.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(Xn(i,-1)),a(Xn(s,1)))),i<=0&&r(Xn(s,-1)),s<=0&&a(Xn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=T0(e,this);return t.bounds==="ticks"&&Ac(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":ts(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}A(vo,"id","logarithmic"),A(vo,"defaults",{ticks:{callback:hr.formatters.logarithmic,major:{enabled:!0}}});function Mo(n){const t=n.ticks;if(t.display&&n.display){const e=$t(t.backdropPadding);return rt(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function D0(n,t,e){return e=wt(e)?e:[e],{w:Ng(n,t.string,e),h:e.length*t.lineHeight}}function Od(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 C0(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,a=n.options.pointLabels,o=a.centerPointLabels?ut/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),h=Rt(c.font),f=D0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=ie(n.getIndexAngle(l)+o),g=Math.round(cr(m)),_=Od(g,u.x,f.w,0,180),x=Od(g,u.y,f.h,90,270);E0(e,t,m,_,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=A0(n,i,s)}function E0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function O0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(cr(ie(l.angle+Ot))),u=L0(l.y,o.h,c),h=R0(c),f=I0(l.x,o.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+o.w,bottom:u+o.h}}function P0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(tn({x:e,y:i},t)||tn({x:e,y:r},t)||tn({x:s,y:i},t)||tn({x:s,y:r},t))}function A0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:Mo(r)/2,additionalAngle:a?ut/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=O0(n,u,l);i.push(h),o==="auto"&&(h.visible=P0(h,c),h.visible&&(c=h))}return i}function R0(n){return n===0||n===180?"center":n<180?"left":"right"}function I0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function L0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function N0(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!st(o)){const l=vn(t.borderRadius),c=$t(t.backdropPadding);n.fillStyle=o;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=a-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),gi(n,{x:u,y:h,w:f,h:m,radius:l}),n.fill()):n.fillRect(u,h,f,m)}}function F0(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 a=i.setContext(n.getPointLabelContext(s));N0(e,a,r);const o=Rt(a.font),{x:l,y:c,textAlign:u}=r;Vn(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Pd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ct);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function B0(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Pd(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function z0(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class _s extends Ir{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=$t(Mo(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=At(t)&&!isNaN(t)?t:0,this.max=At(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Mo(this.options))}generateTickLabels(t){Ir.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=kt(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?C0(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=Ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return ie(t*e+Vt(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 z0(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(),Pd(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,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&F0(this,a),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=r.setContext(f);B0(this,m,l,a,g)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(o,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,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Rt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const h=$t(c.backdropPadding);t.fillRect(-a/2-h.left,-r-u.size/2-h.top,a+h.width,u.size+h.height)}Vn(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}A(_s,"id","radialLinear"),A(_s,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:hr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),A(_s,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),A(_s,"descriptors",{angleLines:{_fallback:"grid"}});const Lr={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}},_e=Object.keys(Lr);function Ad(n,t){return n-t}function Rd(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),At(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(wn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Id(n,t,e,i){const s=_e.length;for(let r=_e.indexOf(n);r<s-1;++r){const a=Lr[_e[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return _e[r]}return _e[s-1]}function H0(n,t,e,i,s){for(let r=_e.length-1;r>=_e.indexOf(e);r--){const a=_e[r];if(Lr[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return _e[e?_e.indexOf(e):0]}function W0(n){for(let t=_e.indexOf(n)+1,e=_e.length;t<e;++t)if(Lr[_e[t]].common)return _e[t]}function Ld(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Ba(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function Y0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Nd(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:Y0(n,i,s,e)}class xs extends qn{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 Su._date(t.adapters.date);s.init(e),Ki(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:Rd(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:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=At(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=At(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,a=this.max,o=Mg(s,r,a);return this._unit=e.unit||(i.autoSkip?Id(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):H0(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:W0(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),Nd(this,o,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 a=t.length<3?.5:.25;e=Kt(e,0,a),i=Kt(i,0,a),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,a=r.unit||Id(r.minUnit,e,i,this._getLabelCapacity(e)),o=rt(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)Ld(u,f,g);return(f===i||s.bounds==="ticks"||m===1)&&Ld(u,f,g),Object.keys(u).sort(Ad).map(_=>+_)}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,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return kt(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],h=c&&o[c],f=i[e],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h: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=Vt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Nd(this,[t],this._majorUnit),s),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o: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(Rd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Nc(t.sort(Ad))}}A(xs,"id","time"),A(xs,"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 Nr(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Je(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Je(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class ko extends xs{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=Nr(e,this.min),this._tableRange=Nr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-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(Nr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Nr(this._table,i*this._tableRange+this._minPos,!0)}}A(ko,"id","timeseries"),A(ko,"defaults",xs.defaults);var V0=Object.freeze({__proto__:null,CategoryScale:xo,LinearScale:wo,LogarithmicScale:vo,RadialLinearScale:_s,TimeScale:xs,TimeSeriesScale:ko});const $0=[Qp,Tb,x0,V0],Fd=6048e5,j0=864e5,ws=6e4,xi=36e5,U0=1e3,Bd=Symbol.for("constructDateFrom");function Lt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Bd in n?n[Bd](t):n instanceof Date?new n.constructor(t):new Date(t)}function ct(n,t){return Lt(t||n,n)}function Fr(n,t,e){const i=ct(n,e==null?void 0:e.in);return isNaN(t)?Lt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function So(n,t,e){const i=ct(n,e==null?void 0:e.in);if(isNaN(t))return Lt(n,NaN);if(!t)return i;const s=i.getDate(),r=Lt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function To(n,t,e){return Lt(n,+ct(n)+t)}function q0(n,t,e){return To(n,t*xi)}let X0={};function Gn(){return X0}function $e(n,t){var o,l,c,u;const e=Gn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function wi(n,t){return $e(n,{...t,weekStartsOn:1})}function zd(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Lt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=wi(s),a=Lt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=wi(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Br(n){const t=ct(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 Kn(n,...t){const e=Lt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Do(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Hd(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Do(i),a=Do(s),o=+r-Br(r),l=+a-Br(a);return Math.round((o-l)/j0)}function G0(n,t){const e=zd(n,t),i=Lt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),wi(i)}function K0(n,t,e){const i=ct(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ws),i}function Z0(n,t,e){return So(n,t*3,e)}function Q0(n,t,e){return To(n,t*1e3)}function J0(n,t,e){return Fr(n,t*7,e)}function t_(n,t,e){return So(n,t*12,e)}function vs(n,t){const e=+ct(n)-+ct(t);return e<0?-1:e>0?1:e}function e_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Co(n){return!(!e_(n)&&typeof n!="number"||isNaN(+ct(n)))}function n_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function i_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Wd(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Yd(i,s),a=Math.abs(Hd(i,s));i.setDate(i.getDate()-r*a);const o=+(Yd(i,s)===-r),l=r*(a-o);return l===0?0:l}function Yd(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 s_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=(+i-+s)/xi;return Ms(e==null?void 0:e.roundingMethod)(r)}function Eo(n,t){return+ct(n)-+ct(t)}function r_(n,t,e){const i=Eo(n,t)/ws;return Ms(e==null?void 0:e.roundingMethod)(i)}function Vd(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function $d(n,t){const e=ct(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 a_(n,t){const e=ct(n,t==null?void 0:t.in);return+Vd(e,t)==+$d(e,t)}function jd(n,t,e){const[i,s,r]=Kn(e==null?void 0:e.in,n,n,t),a=vs(s,r),o=Math.abs(n_(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=vs(s,r)===-a;a_(i)&&o===1&&vs(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function o_(n,t,e){const i=jd(n,t,e)/3;return Ms(e==null?void 0:e.roundingMethod)(i)}function l_(n,t,e){const i=Eo(n,t)/1e3;return Ms(e==null?void 0:e.roundingMethod)(i)}function c_(n,t,e){const i=Wd(n,t,e)/7;return Ms(e==null?void 0:e.roundingMethod)(i)}function u_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=vs(i,s),a=Math.abs(i_(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=vs(i,s)===-r,l=r*(a-+o);return l===0?0:l}function d_(n,t){const e=ct(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 h_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function f_(n,t){const e=ct(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 Ud(n,t){const e=ct(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function m_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function g_(n,t){var o,l;const e=Gn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function p_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function y_(n,t){const e=ct(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 b_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const __={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"}},x_=(n,t,e)=>{let i;const s=__[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 Oo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const w_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},v_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},M_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},k_={date:Oo({formats:w_,defaultWidth:"full"}),time:Oo({formats:v_,defaultWidth:"full"}),dateTime:Oo({formats:M_,defaultWidth:"full"})},S_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},T_=(n,t,e,i)=>S_[n];function ks(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const D_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},C_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},E_={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"]},O_={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"]},P_={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"}},A_={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"}},R_={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:ks({values:D_,defaultWidth:"wide"}),quarter:ks({values:C_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ks({values:E_,defaultWidth:"wide"}),day:ks({values:O_,defaultWidth:"wide"}),dayPeriod:ks({values:P_,defaultWidth:"wide",formattingValues:A_,defaultFormattingWidth:"wide"})};function Ss(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 a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?L_(o,h=>h.test(a)):I_(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function I_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function L_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function N_(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 a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const F_=/^(\d+)(th|st|nd|rd)?/i,B_=/\d+/i,z_={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},H_={any:[/^b/i,/^(a|c)/i]},W_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Y_={any:[/1/i,/2/i,/3/i,/4/i]},V_={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},$_={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]},j_={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},U_={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]},q_={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},X_={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}},G_={ordinalNumber:N_({matchPattern:F_,parsePattern:B_,valueCallback:n=>parseInt(n,10)}),era:Ss({matchPatterns:z_,defaultMatchWidth:"wide",parsePatterns:H_,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:W_,defaultMatchWidth:"wide",parsePatterns:Y_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ss({matchPatterns:V_,defaultMatchWidth:"wide",parsePatterns:$_,defaultParseWidth:"any"}),day:Ss({matchPatterns:j_,defaultMatchWidth:"wide",parsePatterns:U_,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:q_,defaultMatchWidth:"any",parsePatterns:X_,defaultParseWidth:"any"})},qd={code:"en-US",formatDistance:x_,formatLong:k_,formatRelative:T_,localize:R_,match:G_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function K_(n,t){const e=ct(n,t==null?void 0:t.in);return Hd(e,Ud(e))+1}function Xd(n,t){const e=ct(n,t==null?void 0:t.in),i=+wi(e)-+G0(e);return Math.round(i/Fd)+1}function Po(n,t){var u,h,f,m;const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Gn(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Lt((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=$e(a,t),l=Lt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=$e(l,t);return+e>=+o?i+1:+e>=+c?i:i-1}function Z_(n,t){var o,l,c,u;const e=Gn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Po(n,t),r=Lt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),$e(r,t)}function Gd(n,t){const e=ct(n,t==null?void 0:t.in),i=+$e(e,t)-+Z_(e,t);return Math.round(i/Fd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(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 Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},vi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kd={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 Cn.y(n,t)},Y:function(n,t,e,i){const s=Po(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Tt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=zd(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(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 Tt(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 Tt(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 Cn.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 Tt(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=Gd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Xd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Cn.d(n,t)},D:function(n,t,e){const i=K_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(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 Tt(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 Tt(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 Tt(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=vi.noon:i===0?s=vi.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=vi.evening:i>=12?s=vi.afternoon:i>=4?s=vi.morning:s=vi.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 Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Qd(i);case"XXXX":case"XX":return Zn(i);case"XXXXX":case"XXX":default:return Zn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Qd(i);case"xxxx":case"xx":return Zn(i);case"xxxxx":case"xxx":default:return Zn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zd(i,":");case"OOOO":default:return"GMT"+Zn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zd(i,":");case"zzzz":default:return"GMT"+Zn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Zd(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+Tt(r,2)}function Qd(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Zn(n,t)}function Zn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Jd=(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"})}},th=(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"})}},Ao={p:th,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Jd(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}}",Jd(i,t)).replace("{{time}}",th(s,t))}},Q_=/^D+$/,J_=/^Y+$/,tx=["D","DD","YY","YYYY"];function eh(n){return Q_.test(n)}function nh(n){return J_.test(n)}function Ro(n,t,e){const i=ex(n,t,e);if(console.warn(i),tx.includes(n))throw new RangeError(i)}function ex(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 nx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ix=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sx=/^'([^]*?)'?$/,rx=/''/g,ax=/[a-zA-Z]/;function zr(n,t,e){var u,h,f,m,g,_,x,v;const i=Gn(),s=(e==null?void 0:e.locale)??i.locale??qd,r=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=(e==null?void 0:e.weekStartsOn)??((_=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:_.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,o=ct(n,e==null?void 0:e.in);if(!Co(o))throw new RangeError("Invalid time value");let l=t.match(ix).map(M=>{const k=M[0];if(k==="p"||k==="P"){const T=Ao[k];return T(M,s.formatLong)}return M}).join("").match(nx).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const k=M[0];if(k==="'")return{isToken:!1,value:ox(M)};if(Kd[k])return{isToken:!0,value:M};if(k.match(ax))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const k=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&nh(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&eh(k))&&Ro(k,t,String(n));const T=Kd[k[0]];return T(o,k,s.localize,c)}).join("")}function ox(n){const t=n.match(sx);return t?t[1].replace(rx,"'"):n}function ih(){return Object.assign({},Gn())}function lx(n,t){const e=ct(n,t==null?void 0:t.in).getDay();return e===0?7:e}function cx(n,t){const e=ux(t)?new t(0):Lt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function ux(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const dx=10;class sh{constructor(){A(this,"subPriority",0)}validate(t,e){return!0}}class hx extends sh{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 fx extends sh{constructor(e,i){super();A(this,"priority",dx);A(this,"subPriority",-1);this.context=e||(s=>Lt(i,s))}set(e,i){return i.timestampIsSet?e:Lt(e,cx(e,this.context))}}class xt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new hx(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class mx extends xt{constructor(){super(...arguments);A(this,"priority",140);A(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}/},je={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 It(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(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,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*xi+r*ws+a*U0),rest:t.slice(e[0].length)}}function rh(n){return It(Ht.anyDigitsSigned,n)}function Nt(n,t){switch(n){case 1:return It(Ht.singleDigit,t);case 2:return It(Ht.twoDigits,t);case 3:return It(Ht.threeDigits,t);case 4:return It(Ht.fourDigits,t);default:return It(new RegExp("^\\d{1,"+n+"}"),t)}}function Hr(n,t){switch(n){case 1:return It(Ht.singleDigitSigned,t);case 2:return It(Ht.twoDigitsSigned,t);case 3:return It(Ht.threeDigitsSigned,t);case 4:return It(Ht.fourDigitsSigned,t);default:return It(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Io(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 ah(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function oh(n){return n%400===0||n%4===0&&n%100!==0}class gx extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Wt(Nt(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(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 o=ah(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class px extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Wt(Nt(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Po(e,r);if(s.isTwoDigitYear){const l=ah(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}}class yx extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Hr(i==="R"?4:i.length,e)}set(e,i,s){const r=Lt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),wi(r)}}class bx extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Hr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class _x extends xt{constructor(){super(...arguments);A(this,"priority",120);A(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 Nt(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 xx extends xt{constructor(){super(...arguments);A(this,"priority",120);A(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 Nt(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 wx extends xt{constructor(){super(...arguments);A(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);A(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return Wt(It(Ht.month,e),r);case"MM":return Wt(Nt(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 vx extends xt{constructor(){super(...arguments);A(this,"priority",110);A(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return Wt(It(Ht.month,e),r);case"LL":return Wt(Nt(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 Mx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Gd(i,e)-t;return i.setDate(i.getDate()-s*7),ct(i,e==null?void 0:e.in)}class kx extends xt{constructor(){super(...arguments);A(this,"priority",100);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return It(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return $e(Mx(e,s,r),r)}}function Sx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Xd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Tx extends xt{constructor(){super(...arguments);A(this,"priority",100);A(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 It(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return wi(Sx(e,s))}}const Dx=[31,28,31,30,31,30,31,31,30,31,30,31],Cx=[31,29,31,30,31,30,31,31,30,31,30,31];class Ex extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"subPriority",1);A(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return It(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=oh(s),a=e.getMonth();return r?i>=1&&i<=Cx[a]:i>=1&&i<=Dx[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Ox extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"subpriority",1);A(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 It(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear();return oh(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 Lo(n,t,e){var h,f,m,g;const i=Gn(),s=(e==null?void 0:e.weekStartsOn)??((f=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,r=ct(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Fr(r,u,e)}class Px extends xt{constructor(){super(...arguments);A(this,"priority",90);A(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=Lo(e,s,r),e.setHours(0,0,0,0),e}}class Ax extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Wt(Nt(i.length,e),a);case"eo":return Wt(s.ordinalNumber(e,{unit:"day"}),a);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=Lo(e,s,r),e.setHours(0,0,0,0),e}}class Rx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Wt(Nt(i.length,e),a);case"co":return Wt(s.ordinalNumber(e,{unit:"day"}),a);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=Lo(e,s,r),e.setHours(0,0,0,0),e}}function Ix(n,t,e){const i=ct(n,e==null?void 0:e.in),s=lx(i,e),r=t-s;return Fr(i,r,e)}class Lx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Nt(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=Ix(e,s),e.setHours(0,0,0,0),e}}class Nx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(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(Io(s),0,0,0),e}}class Fx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(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(Io(s),0,0,0),e}}class Bx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(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(Io(s),0,0,0),e}}class zx extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return It(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 Hx extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return It(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class Wx extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return It(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 Yx extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return It(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 Vx extends xt{constructor(){super(...arguments);A(this,"priority",60);A(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return It(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class $x extends xt{constructor(){super(...arguments);A(this,"priority",50);A(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return It(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class jx extends xt{constructor(){super(...arguments);A(this,"priority",30);A(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Nt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class Ux extends xt{constructor(){super(...arguments);A(this,"priority",10);A(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue(je.basicOptionalMinutes,e);case"XX":return Ue(je.basic,e);case"XXXX":return Ue(je.basicOptionalSeconds,e);case"XXXXX":return Ue(je.extendedOptionalSeconds,e);case"XXX":default:return Ue(je.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-Br(e)-s)}}class qx extends xt{constructor(){super(...arguments);A(this,"priority",10);A(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue(je.basicOptionalMinutes,e);case"xx":return Ue(je.basic,e);case"xxxx":return Ue(je.basicOptionalSeconds,e);case"xxxxx":return Ue(je.extendedOptionalSeconds,e);case"xxx":default:return Ue(je.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-Br(e)-s)}}class Xx extends xt{constructor(){super(...arguments);A(this,"priority",40);A(this,"incompatibleTokens","*")}parse(e){return rh(e)}set(e,i,s){return[Lt(e,s*1e3),{timestampIsSet:!0}]}}class Gx extends xt{constructor(){super(...arguments);A(this,"priority",20);A(this,"incompatibleTokens","*")}parse(e){return rh(e)}set(e,i,s){return[Lt(e,s),{timestampIsSet:!0}]}}const Kx={G:new mx,y:new gx,Y:new px,R:new yx,u:new bx,Q:new _x,q:new xx,M:new wx,L:new vx,w:new kx,I:new Tx,d:new Ex,D:new Ox,E:new Px,e:new Ax,c:new Rx,i:new Lx,a:new Nx,b:new Fx,B:new Bx,h:new zx,H:new Hx,K:new Wx,k:new Yx,m:new Vx,s:new $x,S:new jx,X:new Ux,x:new qx,t:new Xx,T:new Gx},Zx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jx=/^'([^]*?)'?$/,tw=/''/g,ew=/\S/,nw=/[a-zA-Z]/;function iw(n,t,e,i){var x,v,M,k,T,P,O,C;const s=()=>Lt((i==null?void 0:i.in)||e,NaN),r=ih(),a=(i==null?void 0:i.locale)??r.locale??qd,o=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((k=(M=r.locale)==null?void 0:M.options)==null?void 0:k.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((P=(T=i==null?void 0:i.locale)==null?void 0:T.options)==null?void 0:P.weekStartsOn)??r.weekStartsOn??((C=(O=r.locale)==null?void 0:O.options)==null?void 0:C.weekStartsOn)??0;if(!t)return n?s():ct(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new fx(i==null?void 0:i.in,e)],h=t.match(Qx).map(p=>{const b=p[0];if(b in Ao){const S=Ao[b];return S(p,a.formatLong)}return p}).join("").match(Zx),f=[];for(let p of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&nh(p)&&Ro(p,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&eh(p)&&Ro(p,t,n);const b=p[0],S=Kx[b];if(S){const{incompatibleTokens:E}=S;if(Array.isArray(E)){const I=f.find(B=>E.includes(B.token)||B.token===b);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${p}\` at the same time`)}else if(S.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${p}\` and any other token at the same time`);f.push({token:b,fullToken:p});const R=S.run(n,p,a.match,c);if(!R)return s();u.push(R.setter),n=R.rest}else{if(b.match(nw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(p==="''"?p="'":b==="'"&&(p=sw(p)),n.indexOf(p)===0)n=n.slice(p.length);else return s()}}if(n.length>0&&ew.test(n))return s();const m=u.map(p=>p.priority).sort((p,b)=>b-p).filter((p,b,S)=>S.indexOf(p)===b).map(p=>u.filter(b=>b.priority===p).sort((b,S)=>S.subPriority-b.subPriority)).map(p=>p[0]);let g=ct(e,i==null?void 0:i.in);if(isNaN(+g))return s();const _={};for(const p of m){if(!p.validate(g,c))return s();const b=p.set(g,_,c);Array.isArray(b)?(g=b[0],Object.assign(_,b[1])):g=b}return g}function sw(n){return n.match(Jx)[1].replace(tw,"'")}function rw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function aw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function ow(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function lw(n){const t=n/xi;return Math.trunc(t)}function lh(n,t){const e=()=>Lt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=hw(n);let r;if(s.date){const c=fw(s.date,i);r=mw(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=gw(s.time),isNaN(o)))return e();if(s.timezone){if(l=pw(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=ct(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 ct(a+o+l,t==null?void 0:t.in)}const Wr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},cw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,uw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function hw(n){const t={},e=n.split(Wr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Wr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Wr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Wr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function fw(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 mw(n,t){if(t===null)return new Date(NaN);const e=n.match(cw);if(!e)return new Date(NaN);const i=!!e[4],s=Ts(e[1]),r=Ts(e[2])-1,a=Ts(e[3]),o=Ts(e[4]),l=Ts(e[5])-1;if(i)return ww(t,o,l)?yw(t,o,l):new Date(NaN);{const c=new Date(0);return!_w(t,r,a)||!xw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function Ts(n){return n?parseInt(n):1}function gw(n){const t=n.match(uw);if(!t)return NaN;const e=No(t[1]),i=No(t[2]),s=No(t[3]);return vw(e,i,s)?e*xi+i*ws+s*1e3:NaN}function No(n){return n&&parseFloat(n.replace(",","."))||0}function pw(n){if(n==="Z")return 0;const t=n.match(dw);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Mw(i,s)?e*(i*xi+s*ws):NaN}function yw(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 bw=[31,null,31,30,31,30,31,31,30,31,30,31];function ch(n){return n%400===0||n%4===0&&n%100!==0}function _w(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(bw[t]||(ch(n)?29:28))}function xw(n,t){return t>=1&&t<=(ch(n)?366:365)}function ww(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function vw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Mw(n,t){return t>=0&&t<=59}var kw=Object.defineProperty,Sw=(n,t,e)=>t in n?kw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>Sw(n,typeof t!="symbol"?t+"":t,e);const Tw=1e3;var nt=(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.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(nt||{});const Dw=["in","not_in","selector"],Cw=["empty","not_empty"],Ew=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Ow=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ds=n=>n.filter(t=>t!=="time"),uh=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],dh=Ds(uh),Pw=[...uh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],hh=Ds(Pw),Aw=["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","realm","status_code","status_code_grouped","ai_plugin"],fh=Ds(Aw);Ds(["api","api_package","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","portal","realm","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"]),Ds(["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(dh),new Set(hh),new Set(fh);const mh=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];mh.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Dw},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Cw}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...hh,...dh,...fh])]);const Rw={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"}},Iw=(n,t,e)=>{let i;const s=Rw[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 Fo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Lw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Nw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Fw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bw={date:Fo({formats:Lw,defaultWidth:"full"}),time:Fo({formats:Nw,defaultWidth:"full"}),dateTime:Fo({formats:Fw,defaultWidth:"full"})},zw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hw=(n,t,e,i)=>zw[n];function Cs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Ww={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Vw={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"]},$w={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"]},jw={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"}},Uw={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"}},qw=(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"},Xw={ordinalNumber:qw,era:Cs({values:Ww,defaultWidth:"wide"}),quarter:Cs({values:Yw,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Cs({values:Vw,defaultWidth:"wide"}),day:Cs({values:$w,defaultWidth:"wide"}),dayPeriod:Cs({values:jw,defaultWidth:"wide",formattingValues:Uw,defaultFormattingWidth:"wide"})};function Es(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 a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Kw(o,h=>h.test(a)):Gw(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function Gw(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Kw(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Zw(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 a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const Qw=/^(\d+)(th|st|nd|rd)?/i,Jw=/\d+/i,tv={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},ev={any:[/^b/i,/^(a|c)/i]},nv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iv={any:[/1/i,/2/i,/3/i,/4/i]},sv={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},rv={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]},av={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},ov={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]},lv={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},cv={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}},uv={ordinalNumber:Zw({matchPattern:Qw,parsePattern:Jw,valueCallback:n=>parseInt(n,10)}),era:Es({matchPatterns:tv,defaultMatchWidth:"wide",parsePatterns:ev,defaultParseWidth:"any"}),quarter:Es({matchPatterns:nv,defaultMatchWidth:"wide",parsePatterns:iv,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Es({matchPatterns:sv,defaultMatchWidth:"wide",parsePatterns:rv,defaultParseWidth:"any"}),day:Es({matchPatterns:av,defaultMatchWidth:"wide",parsePatterns:ov,defaultParseWidth:"any"}),dayPeriod:Es({matchPatterns:lv,defaultMatchWidth:"any",parsePatterns:cv,defaultParseWidth:"any"})},dv={code:"en-US",formatDistance:Iw,formatLong:Bw,formatRelative:Hw,localize:Xw,match:uv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let hv={};function Os(){return hv}const gh=6048e5,fv=864e5,mv=60,gv=3600,ph=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&ph in n?n[ph](t):n instanceof Date?new n.constructor(t):new Date(t)}function ue(n,t){return Ae(t||n,n)}function yh(n){const t=ue(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 pv(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ps(n,t){const e=ue(n,void 0);return e.setHours(0,0,0,0),e}function yv(n,t,e){const[i,s]=pv(void 0,n,t),r=Ps(i),a=Ps(s),o=+r-yh(r),l=+a-yh(a);return Math.round((o-l)/fv)}function bv(n,t){const e=ue(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function _v(n,t){const e=ue(n,void 0);return yv(e,bv(e))+1}function rn(n,t){var e,i,s,r;const a=Os(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=ue(n,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Yr(n,t){return rn(n,{...t,weekStartsOn:1})}function bh(n,t){const e=ue(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Yr(s),a=Ae(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Yr(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function xv(n,t){const e=bh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Yr(i)}function wv(n,t){const e=ue(n,void 0),i=+Yr(e)-+xv(e);return Math.round(i/gh)+1}function _h(n,t){var e,i,s,r;const a=ue(n,t==null?void 0:t.in),o=a.getFullYear(),l=Os(),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(o+1,0,c),u.setHours(0,0,0,0);const h=rn(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(o,0,c),f.setHours(0,0,0,0);const m=rn(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function vv(n,t){var e,i,s,r;const a=Os(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=_h(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),rn(c,t)}function Mv(n,t){const e=ue(n,t==null?void 0:t.in),i=+rn(e,t)-+vv(e,t);return Math.round(i/gh)+1}function Dt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const En={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Dt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Dt(e+1,2)},d(n,t){return Dt(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 Dt(n.getHours()%12||12,t.length)},H(n,t){return Dt(n.getHours(),t.length)},m(n,t){return Dt(n.getMinutes(),t.length)},s(n,t){return Dt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Dt(s,t.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xh={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 En.y(n,t)},Y:function(n,t,e,i){const s=_h(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Dt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Dt(r,t.length)},R:function(n,t){const e=bh(n);return Dt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Dt(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 Dt(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 Dt(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 En.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 Dt(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=Mv(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Dt(s,t.length)},I:function(n,t,e){const i=wv(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Dt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):En.d(n,t)},D:function(n,t,e){const i=_v(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Dt(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 Dt(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 Dt(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 Dt(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=Mi.noon:i===0?s=Mi.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=Mi.evening:i>=12?s=Mi.afternoon:i>=4?s=Mi.morning:s=Mi.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 En.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):En.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):En.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):En.s(n,t)},S:function(n,t){return En.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return vh(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 vh(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"+wh(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"+wh(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Dt(i,t.length)},T:function(n,t,e){return Dt(+n,t.length)}};function wh(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+Dt(r,2)}function vh(n,t){return n%60===0?(n>0?"-":"+")+Dt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Dt(Math.trunc(i/60),2),r=Dt(i%60,2);return e+s+t+r}const Mh=(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"})}},kh=(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"})}},kv=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Mh(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}}",Mh(i,t)).replace("{{time}}",kh(s,t))},Sv={p:kh,P:kv},Tv=/^D+$/,Dv=/^Y+$/,Cv=["D","DD","YY","YYYY"];function Ev(n){return Tv.test(n)}function Ov(n){return Dv.test(n)}function Pv(n,t,e){const i=Av(n,t,e);if(console.warn(i),Cv.includes(n))throw new RangeError(i)}function Av(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`}function Rv(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Iv(n){return!(!Rv(n)&&typeof n!="number"||isNaN(+ue(n)))}const Lv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Fv=/^'([^]*?)'?$/,Bv=/''/g,zv=/[a-zA-Z]/;function Hv(n,t,e){var i,s,r,a,o,l,c,u;const h=Os(),f=(e==null?void 0:e.locale)??h.locale??dv,m=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(r=h.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,g=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((u=(c=h.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,_=ue(n,e==null?void 0:e.in);if(!Iv(_))throw new RangeError("Invalid time value");let x=t.match(Nv).map(M=>{const k=M[0];if(k==="p"||k==="P"){const T=Sv[k];return T(M,f.formatLong)}return M}).join("").match(Lv).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const k=M[0];if(k==="'")return{isToken:!1,value:Wv(M)};if(xh[k])return{isToken:!0,value:M};if(k.match(zv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(x=f.localize.preprocessor(_,x));const v={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(M=>{if(!M.isToken)return M.value;const k=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Ov(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Ev(k))&&Pv(k,t,String(n));const T=xh[k[0]];return T(_,k,f.localize,v)}).join("")}function Wv(n){const t=n.match(Fv);return t?t[1].replace(Bv,"'"):n}function Bo(n,t,e){const i=ue(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function Yv(n,t,e){const i=ue(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 a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ki(n,t){const e=ue(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function Vv(n,t){const e=ue(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 $v(){return Object.assign({},Os())}function Sh(n){return Math.trunc(n*gv)}function jv(n){const t=n/mv;return Math.trunc(t)}function Th(n,t,e){return Yv(n,-1)}function Dh(n,t,e){const i=$v(),s=Xv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Uv(s,t):qv(s,t)}function Uv(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 qv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Xv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Gv(n,t){const e=t1(t);return"formatToParts"in e?Zv(e,n):Qv(e,n)}const Kv={year:0,month:1,day:2,hour:3,minute:4,second:5};function Zv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Kv[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 Qv(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 zo={},Ch=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")),Jv=Ch==="06/25/2014, 00:00:00"||Ch==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function t1(n){return zo[n]||(zo[n]=Jv?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"})),zo[n]}function Ho(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Eh=36e5,e1=6e4,Wo={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function As(n,t,e){if(!n)return 0;let i=Wo.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Wo.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Oh(s)?-(s*Eh):NaN;if(i=Wo.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Oh(s,a)?(r=Math.abs(s)*Eh+a*e1,i[1]==="+"?-r:r):NaN}if(s1(n)){t=new Date(t||Date.now());const a=e?t:n1(t),o=Yo(a,n);return-(e?o:i1(t,o,n))}return NaN}function n1(n){return Ho(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Yo(n,t){const e=Gv(n,t),i=Ho(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 i1(n,t,e){let i=n.getTime()-t;const s=Yo(new Date(i),e);if(t===s)return t;i-=s-t;const r=Yo(new Date(i),e);return s===r?s:Math.max(s,r)}function Oh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Ph={};function s1(n){if(Ph[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Ph[n]=!0,!0}catch{return!1}}const r1=60*1e3,a1={X:function(n,t,e){const i=Vo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ah(i);case"XXXX":case"XX":return Si(i);case"XXXXX":case"XXX":default:return Si(i,":")}},x:function(n,t,e){const i=Vo(e.timeZone,n);switch(t){case"x":return Ah(i);case"xxxx":case"xx":return Si(i);case"xxxxx":case"xxx":default:return Si(i,":")}},O:function(n,t,e){const i=Vo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+o1(i,":");case"OOOO":default:return"GMT"+Si(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Dh("short",n,e);case"zzzz":default:return Dh("long",n,e)}}};function Vo(n,t){const e=n?As(n,t,!0)/r1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Vr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Si(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Vr(Math.floor(i/60),2),r=Vr(Math.floor(i%60),2);return e+s+t+r}function Ah(n,t){return n%60===0?(n>0?"-":"+")+Vr(Math.abs(n)/60,2):Si(n,t)}function o1(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+Vr(r,2)}function Rh(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 Ih=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,$o=36e5,Lh=6e4,l1=2,de={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:Ih};function $r(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?l1: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=c1(n),{year:s,restDateString:r}=u1(i.date,e),a=d1(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=h1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=As(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Rh(new Date(o+l)),c=Rh(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function c1(n){const t={};let e=de.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=de.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=de.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function u1(n,t){if(n){const e=de.YYY[t],i=de.YYYYY[t];let s=de.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=de.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 d1(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=de.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Bh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=de.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return g1(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=de.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return Bh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=de.Www.exec(n),r)return s=parseInt(r[1],10)-1,zh(s)?Nh(t,s):new Date(NaN);if(r=de.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return zh(s,a)?Nh(t,s,a):new Date(NaN)}return null}function h1(n){let t,e,i=de.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),jo(t)?t%24*$o:NaN;if(i=de.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),jo(t,e)?t%24*$o+e*Lh:NaN;if(i=de.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return jo(t,e,s)?t%24*$o+e*Lh+s*1e3:NaN}return null}function Nh(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 f1=[31,28,31,30,31,30,31,31,30,31,30,31],m1=[31,29,31,30,31,30,31,31,30,31,30,31];function Fh(n){return n%400===0||n%4===0&&n%100!==0}function Bh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Fh(n);if(i&&e>m1[t]||!i&&e>f1[t])return!1}return!0}function g1(n,t){if(t<1)return!1;const e=Fh(n);return!(e&&t>366||!e&&t>365)}function zh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function jo(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const p1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function y1(n,t,e={}){t=String(t);const i=t.match(p1);if(i){const s=$r(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+a1[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return Hv(n,t,e)}function Hh(n,t,e){n=$r(n,e);const i=As(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 b1(n,t,e,i){return i={...i,timeZone:t,originalDate:n},y1(Hh(n,t,{timeZone:i.timeZone}),e,i)}function _1(n,t,e){if(typeof n=="string"&&!n.match(Ih))return $r(n,{...e,timeZone:t});n=$r(n,e);const i=Ho(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=As(t,new Date(i));return new Date(i+s)}function x1(n,t){return-As(n,t)}function Uo(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 b1(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const w1={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 qo(n){return n&&Ow.find(t=>n<=w1[t])||null}var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function v1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ur={exports:{}};Ur.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",_="[object Promise]",x="[object RegExp]",v="[object Set]",M="[object String]",k="[object Symbol]",T="[object WeakMap]",P="[object ArrayBuffer]",O="[object DataView]",C="[object Float32Array]",p="[object Float64Array]",b="[object Int8Array]",S="[object Int16Array]",E="[object Int32Array]",R="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",j="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,lt=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,z={};z[r]=z[a]=z[P]=z[O]=z[o]=z[l]=z[C]=z[p]=z[b]=z[S]=z[E]=z[f]=z[m]=z[g]=z[x]=z[v]=z[M]=z[k]=z[R]=z[I]=z[B]=z[j]=!0,z[c]=z[u]=z[T]=!1;var q=typeof jr=="object"&&jr&&jr.Object===Object&&jr,J=typeof self=="object"&&self&&self.Object===Object&&self,$=q||J||Function("return this")(),yt=t&&!t.nodeType&&t,_t=yt&&!0&&n&&!n.nodeType&&n,Y=_t&&_t.exports===yt;function H(w,L){return w.set(L[0],L[1]),w}function X(w,L){return w.add(L),w}function K(w,L){for(var F=-1,tt=w?w.length:0;++F<tt&&L(w[F],F,w)!==!1;);return w}function Z(w,L){for(var F=-1,tt=L.length,Yt=w.length;++F<tt;)w[Yt+F]=L[F];return w}function G(w,L,F,tt){for(var Yt=-1,Xt=w?w.length:0;++Yt<Xt;)F=L(F,w[Yt],Yt,w);return F}function gt(w,L){for(var F=-1,tt=Array(w);++F<w;)tt[F]=L(F);return tt}function vt(w,L){return w==null?void 0:w[L]}function at(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function bt(w){var L=-1,F=Array(w.size);return w.forEach(function(tt,Yt){F[++L]=[Yt,tt]}),F}function dt(w,L){return function(F){return w(L(F))}}function jt(w){var L=-1,F=Array(w.size);return w.forEach(function(tt){F[++L]=tt}),F}var ot=Array.prototype,Mt=Function.prototype,te=Object.prototype,oe=$["__core-js_shared__"],Ut=function(){var w=/[^.]+$/.exec(oe&&oe.keys&&oe.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),qe=Mt.toString,Et=te.hasOwnProperty,ee=te.toString,Ft=RegExp("^"+qe.call(Et).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=Y?$.Buffer:void 0,ne=$.Symbol,Xe=$.Uint8Array,ri=dt(Object.getPrototypeOf,Object),Fe=Object.create,Bt=te.propertyIsEnumerable,ve=ot.splice,ai=Object.getOwnPropertySymbols,ma=qt?qt.isBuffer:void 0,ga=dt(Object.keys,Object),js=Fn($,"DataView"),oi=Fn($,"Map"),Us=Fn($,"Promise"),li=Fn($,"Set"),cn=Fn($,"WeakMap"),un=Fn(Object,"create"),qs=le(js),Xs=le(oi),ci=le(Us),Fl=le(li),Bl=le(cn),pa=ne?ne.prototype:void 0,ya=pa?pa.valueOf:void 0;function dn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function Li(){this.__data__=un?un(null):{}}function Gs(w){return this.has(w)&&delete this.__data__[w]}function ba(w){var L=this.__data__;if(un){var F=L[w];return F===i?void 0:F}return Et.call(L,w)?L[w]:void 0}function hn(w){var L=this.__data__;return un?L[w]!==void 0:Et.call(L,w)}function zl(w,L){var F=this.__data__;return F[w]=un&&L===void 0?i:L,this}dn.prototype.clear=Li,dn.prototype.delete=Gs,dn.prototype.get=ba,dn.prototype.has=hn,dn.prototype.set=zl;function Be(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function Hl(){this.__data__=[]}function Wl(w){var L=this.__data__,F=Fi(L,w);if(F<0)return!1;var tt=L.length-1;return F==tt?L.pop():ve.call(L,F,1),!0}function Yl(w){var L=this.__data__,F=Fi(L,w);return F<0?void 0:L[F][1]}function ze(w){return Fi(this.__data__,w)>-1}function Vl(w,L){var F=this.__data__,tt=Fi(F,w);return tt<0?F.push([w,L]):F[tt][1]=L,this}Be.prototype.clear=Hl,Be.prototype.delete=Wl,Be.prototype.get=Yl,Be.prototype.has=ze,Be.prototype.set=Vl;function Ln(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function $l(){this.__data__={hash:new dn,map:new(oi||Be),string:new dn}}function jl(w){return Hi(this,w).delete(w)}function Ul(w){return Hi(this,w).get(w)}function He(w){return Hi(this,w).has(w)}function ql(w,L){return Hi(this,w).set(w,L),this}Ln.prototype.clear=$l,Ln.prototype.delete=jl,Ln.prototype.get=Ul,Ln.prototype.has=He,Ln.prototype.set=ql;function Nn(w){this.__data__=new Be(w)}function Xl(){this.__data__=new Be}function Gl(w){return this.__data__.delete(w)}function Kl(w){return this.__data__.get(w)}function Ni(w){return this.__data__.has(w)}function Zl(w,L){var F=this.__data__;if(F instanceof Be){var tt=F.__data__;if(!oi||tt.length<e-1)return tt.push([w,L]),this;F=this.__data__=new Ln(tt)}return F.set(w,L),this}Nn.prototype.clear=Xl,Nn.prototype.delete=Gl,Nn.prototype.get=Kl,Nn.prototype.has=Ni,Nn.prototype.set=Zl;function Ql(w,L){var F=Js(w)||Yi(w)?gt(w.length,String):[],tt=F.length,Yt=!!tt;for(var Xt in w)Et.call(w,Xt)&&!(Yt&&(Xt=="length"||gc(Xt,tt)))&&F.push(Xt);return F}function Re(w,L,F){var tt=w[L];(!(Et.call(w,L)&&Qs(tt,F))||F===void 0&&!(L in w))&&(w[L]=F)}function Fi(w,L){for(var F=w.length;F--;)if(Qs(w[F][0],L))return F;return-1}function Jl(w,L){return w&&_a(L,ui(L),w)}function Ks(w,L,F,tt,Yt,Xt,Me){var Qt;if(tt&&(Qt=Xt?tt(w,Yt,Xt,Me):tt(w)),Qt!==void 0)return Qt;if(!mn(w))return w;var Ta=Js(w);if(Ta){if(Qt=fc(w),!L)return uc(w,Qt)}else{var Bn=Ge(w),Da=Bn==u||Bn==h;if(Ma(w))return sc(w,L);if(Bn==g||Bn==r||Da&&!Xt){if(at(w))return Xt?w:{};if(Qt=wa(Da?{}:w),!L)return dc(w,Jl(Qt,w))}else{if(!z[Bn])return Xt?w:{};Qt=mc(w,Bn,Ks,L)}}Me||(Me=new Nn);var Ca=Me.get(w);if(Ca)return Ca;if(Me.set(w,Qt),!Ta)var di=F?hc(w):ui(w);return K(di||w,function(er,Vi){di&&(Vi=er,er=w[Vi]),Re(Qt,Vi,Ks(er,L,F,tt,Vi,w,Me))}),Qt}function tc(w){return mn(w)?Fe(w):{}}function ec(w,L,F){var tt=L(w);return Js(w)?tt:Z(tt,F(w))}function nc(w){return ee.call(w)}function Bi(w){if(!mn(w)||pc(w))return!1;var L=tr(w)||at(w)?Ft:lt;return L.test(le(w))}function ic(w){if(!fn(w))return ga(w);var L=[];for(var F in Object(w))Et.call(w,F)&&F!="constructor"&&L.push(F);return L}function sc(w,L){if(L)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function zi(w){var L=new w.constructor(w.byteLength);return new Xe(L).set(new Xe(w)),L}function rc(w,L){var F=L?zi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function ac(w,L,F){var tt=L?F(bt(w),!0):bt(w);return G(tt,H,new w.constructor)}function Zs(w){var L=new w.constructor(w.source,V.exec(w));return L.lastIndex=w.lastIndex,L}function oc(w,L,F){var tt=L?F(jt(w),!0):jt(w);return G(tt,X,new w.constructor)}function lc(w){return ya?Object(ya.call(w)):{}}function cc(w,L){var F=L?zi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function uc(w,L){var F=-1,tt=w.length;for(L||(L=Array(tt));++F<tt;)L[F]=w[F];return L}function _a(w,L,F,tt){F||(F={});for(var Yt=-1,Xt=L.length;++Yt<Xt;){var Me=L[Yt],Qt=void 0;Re(F,Me,Qt===void 0?w[Me]:Qt)}return F}function dc(w,L){return _a(w,xa(w),L)}function hc(w){return ec(w,ui,xa)}function Hi(w,L){var F=w.__data__;return Wi(L)?F[typeof L=="string"?"string":"hash"]:F.map}function Fn(w,L){var F=vt(w,L);return Bi(F)?F:void 0}var xa=ai?dt(ai,Object):ka,Ge=nc;(js&&Ge(new js(new ArrayBuffer(1)))!=O||oi&&Ge(new oi)!=f||Us&&Ge(Us.resolve())!=_||li&&Ge(new li)!=v||cn&&Ge(new cn)!=T)&&(Ge=function(w){var L=ee.call(w),F=L==g?w.constructor:void 0,tt=F?le(F):void 0;if(tt)switch(tt){case qs:return O;case Xs:return f;case ci:return _;case Fl:return v;case Bl:return T}return L});function fc(w){var L=w.length,F=w.constructor(L);return L&&typeof w[0]=="string"&&Et.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function wa(w){return typeof w.constructor=="function"&&!fn(w)?tc(ri(w)):{}}function mc(w,L,F,tt){var Yt=w.constructor;switch(L){case P:return zi(w);case o:case l:return new Yt(+w);case O:return rc(w,tt);case C:case p:case b:case S:case E:case R:case I:case B:case j:return cc(w,tt);case f:return ac(w,tt,F);case m:case M:return new Yt(w);case x:return Zs(w);case v:return oc(w,tt,F);case k:return lc(w)}}function gc(w,L){return L=L??s,!!L&&(typeof w=="number"||U.test(w))&&w>-1&&w%1==0&&w<L}function Wi(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function pc(w){return!!Ut&&Ut in w}function fn(w){var L=w&&w.constructor,F=typeof L=="function"&&L.prototype||te;return w===F}function le(w){if(w!=null){try{return qe.call(w)}catch{}try{return w+""}catch{}}return""}function yc(w){return Ks(w,!0,!0)}function Qs(w,L){return w===L||w!==w&&L!==L}function Yi(w){return bc(w)&&Et.call(w,"callee")&&(!Bt.call(w,"callee")||ee.call(w)==r)}var Js=Array.isArray;function va(w){return w!=null&&_c(w.length)&&!tr(w)}function bc(w){return gn(w)&&va(w)}var Ma=ma||Sa;function tr(w){var L=mn(w)?ee.call(w):"";return L==u||L==h}function _c(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function mn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function gn(w){return!!w&&typeof w=="object"}function ui(w){return va(w)?Ql(w):ic(w)}function ka(){return[]}function Sa(){return!1}n.exports=yc}(Ur,Ur.exports),Ur.exports;const an=(n,t)=>new Date(n.getTime()-x1(t,n));class ae{constructor(t){Pe(this,"timeframeText"),Pe(this,"key"),Pe(this,"display"),Pe(this,"timeframeLength"),Pe(this,"allowedTiers"),Pe(this,"defaultResponseGranularity"),Pe(this,"dataGranularity"),Pe(this,"isRelative"),Pe(this,"fineGrainedDefaultGranularity"),Pe(this,"_startCustom"),Pe(this,"_endCustom"),Pe(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){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t};if(Ew.includes(this.key))return{type:"relative",time_range:this.key,tz:t};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(t){if(!t)return new Date;const e=_1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Hh(e,t)}}class M1 extends ae{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class k1 extends ae{rawStart(t){let e=ki(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class S1 extends ae{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*366}}class T1 extends ae{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=an(i,t)),i}}class D1 extends ae{rawEnd(t){let e=ki(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}rawStart(t){let e=ki(Th(this.tzAdjustedDate(t)));return t&&(e=an(e,t)),e}}class C1 extends ae{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=an(e,t)),e}}nt.FIFTEEN_MIN,new ae({key:nt.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"]}),nt.ONE_HOUR,new ae({key:nt.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"]}),nt.SIX_HOUR,new ae({key:nt.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"]}),nt.TWELVE_HOUR,new ae({key:nt.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"]}),nt.ONE_DAY,new ae({key:nt.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"]}),nt.SEVEN_DAY,new ae({key:nt.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"]}),nt.THIRTY_DAY,new ae({key:nt.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"]}),nt.NINETY_DAY,new ae({key:nt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.ONE_HUNDRED_EIGHTY_DAY,new ae({key:nt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.ONE_YEAR,new ae({key:nt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.CURRENT_WEEK,new M1({key:nt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Ps(Bo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),nt.CURRENT_MONTH,new k1({key:nt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=ki(new Date);return(Ps(Bo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.CURRENT_YEAR,new S1({key:nt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Ps(Bo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.PREVIOUS_WEEK,new T1({key:nt.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"]}),nt.PREVIOUS_MONTH,new D1({key:nt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=ki(new Date),e=ki(Th(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Wh(t,e)),60*60*24*Vv(new Date().setMonth(new Date().getMonth()-1))+Sh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.PREVIOUS_YEAR,new C1({key:nt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Wh(n,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+Sh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Wh(n,t){return jv(n.getTimezoneOffset()-t.getTimezoneOffset())}nt.FIFTEEN_MIN,nt.ONE_HOUR,nt.SIX_HOUR,nt.TWELVE_HOUR,nt.ONE_DAY,nt.SEVEN_DAY,nt.FIFTEEN_MIN,nt.ONE_HOUR,nt.SIX_HOUR,nt.TWELVE_HOUR,nt.ONE_DAY,nt.SEVEN_DAY,nt.THIRTY_DAY,nt.NINETY_DAY,nt.ONE_HUNDRED_EIGHTY_DAY,nt.ONE_YEAR,nt.CURRENT_WEEK,nt.CURRENT_MONTH,nt.CURRENT_YEAR,nt.PREVIOUS_WEEK,nt.PREVIOUS_MONTH,nt.PREVIOUS_YEAR;const E1=new Map(mh.map(n=>[n.code,{code:n.code,name:n.name}])),Xo=n=>{var t;return((t=E1.get(n))==null?void 0:t.name)||n};var Yh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,_){_&&_%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(Yh);var O1=Yh.exports;const Go=v1(O1);var Vh;const P1=typeof document<"u"&&((Vh=document.documentElement)==null?void 0:Vh.lang)||"en-US",qr=new Intl.NumberFormat(P1);function Ti({i18n:n}){const t=(i,s)=>{if(isNaN(i))return"0 B";const r=s?Math.pow(2,50):1e15,a=s?Math.pow(2,40):1e12,o=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=r?u=n.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=n.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},e=(i,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?n.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:r=!1,currency:a="USD",approximate:o=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,r);case"usd":return e(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${Go(i,{capital:!0})} ${c}`:i>=.01?`${qr.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:e,formatRange:(i,s,r,{isBytes1024:a=!1,currency:o="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(r,s);switch(r){case"bytes":return`${t(i,a)} - ${t(s,a)}`;case"usd":return`${e(i,o)} - ${e(s,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${Go(i,{capital:!0})} - ${Go(s,{capital:!0})} ${u}`}const h=i>=.01?`${qr.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${qr.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const Xr=n=>["interactive","zoom-interactive"].includes(n),$h=(n,t,e,i)=>{var l,c;const{tooltip:s}=t;if(s.opacity===0&&!Xr(n.interactionMode)){n.showTooltip=!1;return}const{i18n:r}=mt.useI18n(),{formatUnit:a}=Ti({i18n:r}),o=n.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(s.body&&!Xr(n.interactionMode)){const u=s.labelColors,h=((c=(l=t.chart.config)==null?void 0:l.options)==null?void 0:c.indexAxis)==="y"?"x":"y",f=s.dataPoints[0].parsed.x??0;n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(f,e):Ns({tickValue:new Date(f),granularity:e}),n.tooltipSeries=s.dataPoints.map((m,g)=>{const _=m.parsed[h],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=m.dataset.label;return{backgroundColor:u[g].backgroundColor,borderColor:u[g].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:m.dataset.isSegmentEmpty}}).sort(o),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},jh=(n,t)=>{var a,o;const{tooltip:e}=t,{i18n:i}=mt.useI18n(),{formatUnit:s}=Ti({i18n:i});if(e.opacity===0&&!Xr(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(e.body&&!Xr(n.interactionMode)){const l=e.labelColors,c=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[c],g=s(m??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=h.dataset.labels[h.dataIndex]:_=h.dataset.label,{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:_,value:g,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},A1=n=>n&&n.datasets&&n.datasets.length,R1=n=>A1(n)&&n.datasets.some(t=>t.data.length),I1=n=>n.datasets.some(t=>t.data[0]&&Co(t.data[0].x)),L1=n=>!!R1(n)&&n.datasets.some(t=>t.data.length==1),N1=n=>I1(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Ko=(n,t,e)=>{const s=Math.min(t/1150,1),r=.15,a=1.15,o=n.x??0;return o<e?o+t*r*(1-s):o-t*a*(1-s)},F1=(n,t,e)=>{const r=n.y??0;return r<e?r+t*.15:r-t*.5};function Uh(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const qh=(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)},B1=2,Xh=10,Gh=12,Gr=10,Kh="#6c7489",z1="#d60027",H1="#ad000e",Zo="#6c7489",Zh="#52596e",W1="#007d60",Y1="#995c00",V1="#ffc400",Rs="16px",$1="20px",j1="'Inter', Roboto, Helvetica, sans-serif",Qh={"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"],Kr=(n,t)=>(t||on)[n%on.length],Jh=(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),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},tf="#6f7787",ef={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"}},U1=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=ef[t])==null?void 0:e.background)||"#fafafa"},q1={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},X1={"4XX":"#FFBA81","5XX":"#FF8484"},G1={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},K1="#dad4c7",nf="#afb7c5",Z1=n=>{const t=Object.entries(Qh).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Qh.standard},Qo=(n,t,e,i)=>{let s;return e?s=nf:Array.isArray(i)?s=Kr(n,i):s=i[t],s||Kr(n)},Zr=n=>{switch(n){case"error":return z1;case"warning":return V1;case"neutral":return Kh;default:return Kh}},Q1={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},J1=2,tM=0,Jo=new Map,sf=(n,t)=>{const{i18n:e}=mt.useI18n(),{formatBytes:i}=Ti({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):qr.format(n)},eM=n=>{const e=document.createElement("canvas").getContext("2d"),i=Rt({});return e.font=i.string,e.measureText(n).width},nM=()=>{const n="label_height";if(!Jo.has(n)){const t=Rt({});Jo.set(n,t.lineHeight)}return Jo.get(n)},iM=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),sM=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,tl="#e0e4ea",rM={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"]},Is=(n,t)=>{let e=1;const i=rM[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},rf=new Map([[100,Is("100",[100,101,102,103])],[200,Is("200",[200,201,202,203,204,205,206,207,208,226])],[300,Is("300",[300,301,302,303,304,305,307,308])],[400,Is("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,Is("500",[500,501,502,503,504,505,506,507,508,510,511])]]),el=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=rf.get(e);return i===void 0?tl:i.get(t)??i.get(-1)??tl},aM=n=>{const t=el(n);return{solid:t,light:t}},Qr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=el(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function af(n,t,e){const i=ih(),s=cM(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?oM(s,t):lM(s,t)}function oM(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 lM(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function cM(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function uM(n,t){const e=gM(t);return"formatToParts"in e?hM(e,n):fM(e,n)}const dM={year:0,month:1,day:2,hour:3,minute:4,second:5};function hM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=dM[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 fM(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 nl={},of=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")),mM=of==="06/25/2014, 00:00:00"||of==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function gM(n){return nl[n]||(nl[n]=mM?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"})),nl[n]}function lf(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const cf=36e5,pM=6e4,il={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function sl(n,t,e){if(!n)return 0;let i=il.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=il.timezoneHH.exec(n),i)return s=parseInt(i[1],10),uf(s)?-(s*cf):NaN;if(i=il.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return uf(s,a)?(r=Math.abs(s)*cf+a*pM,i[1]==="+"?-r:r):NaN}if(_M(n)){t=new Date(t||Date.now());const a=e?t:yM(t),o=rl(a,n);return-(e?o:bM(t,o,n))}return NaN}function yM(n){return lf(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function rl(n,t){const e=uM(n,t),i=lf(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 bM(n,t,e){let s=n.getTime()-t;const r=rl(new Date(s),e);if(t===r)return t;s-=r-t;const a=rl(new Date(s),e);return r===a?r:Math.max(r,a)}function uf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const df={};function _M(n){if(df[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),df[n]=!0,!0}catch{return!1}}const xM=60*1e3,wM={X:function(n,t,e){const i=al(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return hf(i);case"XXXX":case"XX":return Di(i);case"XXXXX":case"XXX":default:return Di(i,":")}},x:function(n,t,e){const i=al(e.timeZone,n);switch(t){case"x":return hf(i);case"xxxx":case"xx":return Di(i);case"xxxxx":case"xxx":default:return Di(i,":")}},O:function(n,t,e){const i=al(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+vM(i,":");case"OOOO":default:return"GMT"+Di(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return af("short",n,e);case"zzzz":default:return af("long",n,e)}}};function al(n,t){const e=n?sl(n,t,!0)/xM:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Jr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Di(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Jr(Math.floor(i/60),2),r=Jr(Math.floor(i%60),2);return e+s+t+r}function hf(n,t){return n%60===0?(n>0?"-":"+")+Jr(Math.abs(n)/60,2):Di(n,t)}function vM(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+Jr(r,2)}function ff(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 MM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ol=36e5,mf=6e4,kM=2,he={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:MM};function gf(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?kM: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=SM(n),{year:s,restDateString:r}=TM(i.date,e),a=DM(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=CM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=sl(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=ff(new Date(o+l)),c=ff(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function SM(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function TM(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.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 DM(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=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,bf(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return PM(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return bf(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,_f(s)?pf(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return _f(s,a)?pf(t,s,a):new Date(NaN)}return null}function CM(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ll(t)?t%24*ol:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ll(t,e)?t%24*ol+e*mf:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ll(t,e,s)?t%24*ol+e*mf+s*1e3:NaN}return null}function pf(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 EM=[31,28,31,30,31,30,31,31,30,31,30,31],OM=[31,29,31,30,31,30,31,31,30,31,30,31];function yf(n){return n%400===0||n%4===0&&n%100!==0}function bf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=yf(n);if(i&&e>OM[t]||!i&&e>EM[t])return!1}return!0}function PM(n,t){if(t<1)return!1;const e=yf(n);return!(e&&t>366||!e&&t>365)}function _f(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ll(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const AM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function cl(n,t,e={}){t=String(t);const i=t.match(AM);if(i){const s=gf(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+wM[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return zr(n,t,e)}function RM(n,t,e){n=gf(n,e);const i=sl(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 Ls(n,t,e,i){return i={...i,timeZone:t,originalDate:n},cl(RM(n,t,{timeZone:i.timeZone}),e,i)}const IM=(n,t)=>`${Ls(n,t,"yyyy")} W${Ls(n,t,"II")}`,ul="yyyy-MM-dd h:mm:ss a",dl="h:mm:ss a",Jn="yyyy-MM-dd h:mm a",Ci="h:mm a",LM="yyyy-MM-dd",hl="MMM dd, yyyy h:mm:ss a",On="MMM dd, yyyy h:mm a",NM={secondly:n=>n?ul:dl,tenSecondly:n=>n?ul:dl,thirtySecondly:n=>n?ul:dl,minutely:n=>n?Jn:Ci,fiveMinutely:n=>n?Jn:Ci,tenMinutely:n=>n?Jn:Ci,thirtyMinutely:n=>n?Jn:Ci,hourly:n=>n?Jn:Ci,twoHourly:n=>n?Jn:Ci,twelveHourly:()=>Jn,daily:()=>LM},FM={secondly:()=>hl,tenSecondly:()=>hl,thirtySecondly:()=>hl,minutely:()=>On,fiveMinutely:()=>On,tenMinutely:()=>On,thirtyMinutely:()=>On,hourly:()=>On,twoHourly:()=>On,twelveHourly:()=>On,daily:()=>On};function xf({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:a}){const o=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return IM(n,o);if(s&&s[t]){const l=s[t](i);return Ls(n,o,l)}if(r&&r[t]){const l=r[t]();return Ls(n,o,l)}return Ls(n,o,a)}const BM=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>xf({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:NM,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Ns=({tickValue:n,granularity:t,timezone:e})=>xf({tickValue:n,granularity:t,timezone:e,tooltipMap:FM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),zM=n=>{var e,i,s,r,a;const{i18n:t}=mt.useI18n();return(n==null?void 0:n.status)===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(n==null?void 0:n.status)===408?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(n==null?void 0:n.message)}};function HM(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};De.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=u.width/2,m=Ko(c,h,f),g=c.y,_=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:g-n.tooltipState.offsetY,xAlign:_}},ao.modes.customInteractionMode=function(l,c){const u=kn(c,l),h=[];return ao.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,g)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),l.options.indexAxis==="x"&&u.x!==null&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const s=n.numLabels.value>25?Xh:Gh,r=({chart:l,index:c})=>{var h;const u=l.data;return{size:s,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[c]?"italic":"normal"}},a=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Gr?c.slice(0,Gr)+"...":c):l.getLabelForValue(Number(c)),o=d.computed(()=>{var l,c,u,h,f,m,g,_;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="y"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(h=n.dimensionAxesTitle)==null?void 0:h.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="x"?!st((f=n.metricAxesTitle)==null?void 0:f.value):!st((m=n.dimensionAxesTitle)==null?void 0:m.value),text:n.indexAxis==="x"?(g=n.metricAxesTitle)==null?void 0:g.value:(_=n.dimensionAxesTitle)==null?void 0:_.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{jh(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.getCurrentInstance()&&d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),o}ye.register(...$0);const WM=(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 YM(n,t,e,i,s){const r=d.shallowRef(null),a=(o,l)=>{if(t.value)return new ye(t.value,{type:n,data:o,plugins:i,options:l})};return d.onMounted(()=>{r.value=a(e.value,s.value)}),d.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),d.watch(e,(o,l)=>{if(WM(l,o)&&!st(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=a(o,s.value)}),d.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),d.watch(s,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(st(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}var xe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wf={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,_){_&&_%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(wf);var VM=wf.exports;const ta=fl(VM);function $M(n,t,e){const{i18n:i}=mt.useI18n(),{formatBytes:s}=Ti({i18n:i}),{translateUnit:r}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>n.value.datasets.reduce((o,l)=>{const c=l.total?l.total:l.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(e.value==="bytes")u=s(c);else{const h=r(e.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:ta(c,{capital:!0}),unit:h})||`${ta(c,{capital:!0})} ${e.value}`}return{...o,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function jM(n){return d.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?`${Uo(e)} - ${Uo(i,{includeTZ:!0})}`:""})}function UM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};De.positioners[e]=function(r,a){if(!r.length||a.x===null||a.y===null)return!1;const o=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=o.width/2,u=Ko(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{jh(n.tooltipState,r)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),{options:s}}function qM(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return BM({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=d.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};De.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,m=u.width/2,g=u.height/2,_=Ko(c,h,m);let x=F1(c,f,g);const v=c.y<g?"top":"bottom",M=c.x<m?"left":"center";return f>u.height&&(x=0),{x:_,y:x,xAlign:M,yAlign:v}};const a=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return lw(l)>24||u.getDate()!==c.getDate()}),o=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.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:{...r,external:u=>{$h(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.onUnmounted(()=>{De.positioners[s]&&delete De.positioners[s]}),{options:o}}function XM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Kr(i.indexOf(u),on),data:a.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Qo(h,u.name,u.id==="empty",o);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:a.map(m=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function GM(n,t){const{i18n:e}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0,u=c&&o.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&o||a,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(l?s.flatMap(b=>a.map((S,E)=>{const R=b.event[f],I=c?`${R},${S}`:`${E},${S}`,B=b.event[S];return[I,B]})):s.map(b=>{const S=c?`${b.event[f]},${b.event[m]}`:`${f},${m}`,E=b.event[a[0]];return[S,E]})),_=Object.keys(g).reduce((b,S)=>{const[E]=S.split(","),R=g[S];return b[E]?b[E]+=R:b[E]=R,b},{}),x=Object.entries(_).sort(([,b],[,S])=>Number(S)-Number(b)).map(([b])=>b),v=r[f],M=r[m];let k=c&&v&&Object.entries(v).map(([b,S])=>({id:b,name:S.name}))||a.map(b=>({id:b,name:b})),T=c&&M&&Object.entries(M).map(([b,S])=>({id:b,name:S.name}))||a.map(b=>({id:b,name:b}));if(c&&f==="country_code"&&(k=k.map(b=>({...b,name:Xo(b.id)||b.name}))),c&&m==="country_code"&&(T=T.map(b=>({...b,name:Xo(b.id)||b.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(k.sort((b,S)=>x.indexOf(b.id)-x.indexOf(S.id)),T.sort((b,S)=>x.indexOf(b.id)-x.indexOf(S.id))),!k||!T)return{labels:[],datasets:[]};const P=XM({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:T,pivotRecords:g,rowLabels:k,colorPalette:n.colorPalette||on}),O=c?k.map(b=>e&&e.te(`chartLabels.${b.name}`)&&e.t(`chartLabels.${b.name}`)||b.name):a.map(b=>e&&e.te(`chartLabels.${b}`)&&e.t(`chartLabels.${b}`)||b),C=k.map(b=>b.id==="empty");return{labels:O,datasets:P,isLabelEmpty:C,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const KM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),ZM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return lh(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},QM=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return KM(o,l,e)};function JM(n,t){const{i18n:e}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||a,u=c&&c[0],h=r[u];let f=r&&h&&Object.keys(h).map(T=>({id:T,name:h[T].name}))||a.map(T=>({id:T,name:T}));u==="country_code"&&(f=f.map(T=>({...T,name:Xo(T.id)||T.name})));const m=t.value.meta.granularity_ms;if(typeof m!="number"||isNaN(m)||!isFinite(m)||m===0)return console.error("Invalid step value:",m),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const g=ZM(o),_=QM(o,l,m,g,s),x=new Set,v=s!=null&&s.length?s.reduce((T,P)=>{const O=new Date(P.timestamp).valueOf(),C=P.event;for(const p of a)x.add(p),O in T||(T[O]={}),p in T[O]||(T[O][p]={});for(const p of a)f.forEach(b=>{C[u]===b.id||p===b.id?(T[O][p]||(T[O][p]={}),T[O][p][b.name]=Math.round(Number(C[p])*1e3)/1e3):c.length||(T[O][p]||(T[O][p]={}),T[O][p][b.name]=Math.round(Number(C[b.id])*1e3)/1e3)});return T},{}):{},k=[...a.length===1?a.flatMap(T=>f.map(P=>[T,P.name,P.id==="empty"])):f.map(T=>[T.name,T.name,T.id==="empty"])].map(([T,P,O],C)=>{const p=_.map(R=>R in v&&T in v[R]?{x:R,y:v[R][T][P]||0}:{x:R,y:0});let{colorPalette:b,fill:S}=n;st(b)&&(b=on);const E=Qo(C,P,O,b);return{rawDimension:P,rawMetric:T,label:e&&e.te(`chartLabels.${P}`)&&e.t(`chartLabels.${P}`)||P,borderColor:E,backgroundColor:E,data:p,total:p.reduce((R,{y:I})=>R+Number(I),0),...Q1,fill:S,borderWidth:S?tM:J1,isSegmentEmpty:O}});return u==="status_code"||u==="status_code_grouped"?k.sort((T,P)=>(T.label??"")<(P.label??"")?-1:1):k.sort((T,P)=>Number(T.total)<Number(P.total)?-1:1),{datasets:k}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const tk=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function ek(){const{i18n:n}=mt.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 nk="analytics-query-provider",vf=2;function ik(){const n=d.inject(nk);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function ml(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const Mf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sk=n=>n!=null,rk=Object.prototype.toString,ak=n=>rk.call(n)==="[object Object]";function ea(n){return Array.isArray(n)?n:[n]}function ok(n){return d.getCurrentInstance()}function lk(n,t={}){if(!d.isRef(n))return d.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=d.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=d.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const o=[...n.value];o[i]=s,n.value=o}else{const o={...n.value,[i]:s};Object.setPrototypeOf(o,Object.getPrototypeOf(n.value)),n.value=o}else n.value[i]=s}}));return e}function ck(n,t=!0,e){ok()?d.onMounted(n,e):t?n():d.nextTick(n)}function uk(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const na=Mf?window:void 0;function Ei(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Fs(...n){const t=[],e=()=>{t.forEach(o=>o()),t.length=0},i=(o,l,c,u)=>(o.addEventListener(l,c,u),()=>o.removeEventListener(l,c,u)),s=d.computed(()=>{const o=ea(d.toValue(n[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),r=uk(()=>{var o,l;return[(l=(o=s.value)==null?void 0:o.map(c=>Ei(c)))!=null?l:[na].filter(c=>c!=null),ea(d.toValue(s.value?n[1]:n[0])),ea(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([o,l,c,u])=>{if(e(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=ak(u)?{...u}:u;t.push(...o.flatMap(f=>l.flatMap(m=>c.map(g=>i(f,m,g,h)))))},{flush:"post"}),a=()=>{r(),e()};return ml(e),a}function dk(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function kf(n){const t=dk();return d.computed(()=>(t.value,!!n()))}function hk(n,t,e={}){const{window:i=na,...s}=e;let r;const a=kf(()=>i&&"MutationObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=ea(f).map(Ei).filter(sk);return new Set(m)}),c=d.watch(l,f=>{o(),a.value&&f.size&&(r=new MutationObserver(t),f.forEach(m=>r.observe(m,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),o()};return ml(h),{isSupported:a,stop:h,takeRecords:u}}function fk(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:a,onMove:o,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=na,containerElement:m,handle:g=n,buttons:_=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),v=d.ref(),M=C=>i?i.includes(C.pointerType):!0,k=C=>{d.toValue(s)&&C.preventDefault(),d.toValue(r)&&C.stopPropagation()},T=C=>{var p;if(!d.toValue(_).includes(C.button)||d.toValue(t.disabled)||!M(C)||d.toValue(a)&&C.target!==d.toValue(n))return;const b=d.toValue(m),S=(p=b==null?void 0:b.getBoundingClientRect)==null?void 0:p.call(b),E=d.toValue(n).getBoundingClientRect(),R={x:C.clientX-(b?E.left-S.left+b.scrollLeft:E.left),y:C.clientY-(b?E.top-S.top+b.scrollTop:E.top)};(c==null?void 0:c(R,C))!==!1&&(v.value=R,k(C))},P=C=>{if(d.toValue(t.disabled)||!M(C)||!v.value)return;const p=d.toValue(m),b=d.toValue(n).getBoundingClientRect();let{x:S,y:E}=x.value;(h==="x"||h==="both")&&(S=C.clientX-v.value.x,p&&(S=Math.min(Math.max(0,S),p.scrollWidth-b.width))),(h==="y"||h==="both")&&(E=C.clientY-v.value.y,p&&(E=Math.min(Math.max(0,E),p.scrollHeight-b.height))),x.value={x:S,y:E},o==null||o(x.value,C),k(C)},O=C=>{d.toValue(t.disabled)||!M(C)||v.value&&(v.value=void 0,l==null||l(x.value,C),k(C))};if(Mf){const C=()=>{var p;return{capture:(p=t.capture)!=null?p:!0,passive:!d.toValue(s)}};Fs(g,"pointerdown",T,C),Fs(f,"pointermove",P,C),Fs(f,"pointerup",O,C)}return{...lk(x),position:x,isDragging:d.computed(()=>!!v.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function mk(n,t,e={}){const{window:i=na,...s}=e;let r;const a=kf(()=>i&&"ResizeObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Ei(f)):[Ei(h)]}),c=d.watch(l,h=>{if(o(),a.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{o(),c()};return ml(u),{isSupported:a,stop:u}}function gk(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:a="sync"}=t,o=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function _(){const v=Ei(n);if(!v){e&&(o.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const M=v.getBoundingClientRect();o.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,h.value=M.top,f.value=M.width,m.value=M.x,g.value=M.y}function x(){a==="sync"?_():a==="next-frame"&&requestAnimationFrame(()=>_())}return mk(n,x),d.watch(()=>Ei(n),v=>!v&&x()),hk(n,x,{attributeFilter:["style","class"]}),s&&Fs("scroll",x,{capture:!0,passive:!0}),i&&Fs("resize",x,{passive:!0}),ck(()=>{r&&x()}),{height:o,bottom:l,left:c,right:u,top:h,width:f,x:m,y:g,update:x}}function pk(n,t){const{top:e,left:i}=gk(n),s=d.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=d.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const yk=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=e).sort((l,c)=>l-c),r=[];if(e-t<n-2)return[];const a=(e-t)/n;let o=0;for(let l=0;l<n;l++){const c=t+l*a,u=t+(l+1)*a;let h=0;for(;o<s.length&&s[o]>=c&&s[o]<=u;)h++,o++;r.push([Math.ceil(c),h])}return r},Sf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Bs=d.ref({}),bk=n=>(Bs.value[n]||(Bs.value[n]=Sf()),Bs.value[n]),_k=(n,t)=>{const e=Bs.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete Bs.value[t])};function xk({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:s=void 0,minCount:r=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:l}){const u=e!==void 0&&n!==void 0?bk(e):Sf(),h=n!==void 0?n:"static-chart-key",f=d.computed(()=>t.reduce((S,{timestamps:E})=>[...S,...E],[])),m=d.computed(()=>i||f.value.reduce((S,E)=>S===0?E:Math.min(S,E),0)),g=d.computed(()=>s||f.value.reduce((S,E)=>Math.max(S,E),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,o!==void 0&&(u.renderPoints[h]=o)});const _=d.computed(()=>Object.values(u.minStamps).reduce((S,E)=>S===0?E:Math.min(S,E),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((S,E)=>Math.max(S,E),0)),v=d.computed(()=>{const S=Object.values(u.renderPoints);return S.length===0?24:S.reduce((E,R)=>Math.max(E,R),2)}),M=d.computed(()=>{const S=x.value-_.value;return Math.ceil(S/v.value)}),k=d.computed(()=>t.length>1),T=d.computed(()=>t.map(({timestamps:S,color:E,label:R})=>({data:yk({bucketCount:v.value,minStamp:_.value,maxStamp:x.value,timestamps:S}).map(([j,Q])=>({x:j,y:Q})),label:R,...(l==="sparkline_bar"||k.value)&&E&&{backgroundColor:E},...l!=="sparkline_bar"&&E&&{borderColor:E},...k.value&&l!=="sparkline_bar"&&{fill:!0}}))),P=d.computed(()=>{var R,I;const S=((I=(R=T.value[0])==null?void 0:R.data)==null?void 0:I.length)??0,E=[];for(let B=0;B<S;B++){let j=0;for(let Q=0;Q<T.value.length;Q++)j+=T.value[Q].data[B].y;E.push(j)}return E}),O=d.computed(()=>{const S=P.value.reduce((E,R)=>Math.max(E,R),0);return Math.max(S,a??0)}),C=d.computed(()=>{const S=T.value.reduce((I,{data:B})=>[...I,...B.map(({y:j})=>j)],[]),E=S.length?S[0]:0,R=S.reduce((I,B)=>Math.min(I,B),E);return r===void 0?R:Math.min(R,r)});d.watchEffect(()=>{u.maxCounts[h]=O.value,u.minCounts[h]=C.value});const p=d.computed(()=>{const S=Object.values(u.minCounts),E=S.length?S[0]:0;return S.reduce((R,I)=>Math.min(R,I),E)}),b=d.computed(()=>Object.values(u.maxCounts).reduce((S,E)=>Math.max(S,E),0));return d.onUnmounted(()=>{n!==void 0&&e!==void 0&&_k(n,e)}),{syncedMinStamp:_,syncedMaxStamp:x,syncedRenderPoints:v,syncedChartDatasets:T,syncedGroupSizeMs:M,syncedMinCount:p,syncedMaxCount:b}}const mt={useBarChartOptions:HM,useChartJSCommon:YM,useChartLegendValues:$M,useChartSelectedRange:jM,useExploreResultToDatasets:GM,useExploreResultToTimeDataset:JM,useDonutChartOptions:UM,useLineChartOptions:qM,useI18n:Hm,useReportChartDataForSynthetics:tk,useTranslatedUnits:ek,useEvaluateFeatureFlag:ik,useTooltipAbsolutePosition:pk,useSparklineSync:xk};var we=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(we||{});/*!
18
+ `):n}function f0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function xd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),u=Rt(t.footerFont),h=r.length,f=s.length,m=i.length,g=$t(t.padding);let _=g.height,x=0,v=i.reduce((T,P)=>T+P.before.length+P.lines.length+P.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,h&&(_+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){const T=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;_+=m*T+(v-m)*l.lineHeight+(v-1)*t.bodySpacing}f&&(_+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let M=0;const k=function(T){x=Math.max(x,e.measureText(T).width+M)};return e.save(),e.font=c.string,St(n.title,k),e.font=l.string,St(n.beforeBody.concat(n.afterBody),k),M=t.displayColors?a+2+t.boxPadding:0,St(i,T=>{St(T.before,k),St(T.lines,k),St(T.after,k)}),M=0,e.font=u.string,St(n.footer,k),e.restore(),x+=g.width,{width:x,height:_}}function m0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function g0(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function p0(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),g0(c,n,t,e)&&(c="center"),c}function wd(n,t,e){const i=e.yAlign||t.yAlign||m0(n,e);return{xAlign:e.xAlign||t.xAlign||p0(n,t,e,i),yAlign:i}}function y0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function b0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function vd(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=vn(a);let g=y0(t,o);const _=b0(t,l,c);return l==="center"?o==="left"?g+=c:o==="right"&&(g-=c):o==="left"?g-=Math.max(u,f)+s:o==="right"&&(g+=Math.max(h,m)+s),{x:Kt(g,0,i.width-t.width),y:Kt(_,0,i.height-t.height)}}function Rr(n,t,e){const i=$t(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Md(n){return Ve([],sn(n))}function _0(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function kd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Sd={beforeTitle:Ze,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:Ze,beforeBody:Ze,beforeLabel:Ze,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:Ze,afterBody:Ze,beforeFooter:Ze,footer:Ze,afterFooter:Ze};function be(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Sd[t].call(e,i):s}class _o extends Zt{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 Za(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=_0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=be(i,"beforeTitle",this,t),r=be(i,"title",this,t),a=be(i,"afterTitle",this,t);let o=[];return o=Ve(o,sn(s)),o=Ve(o,sn(r)),o=Ve(o,sn(a)),o}getBeforeBody(t,e){return Md(be(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return St(t,r=>{const a={before:[],lines:[],after:[]},o=kd(i,r);Ve(a.before,sn(be(o,"beforeLabel",this,r))),Ve(a.lines,be(o,"label",this,r)),Ve(a.after,sn(be(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Md(be(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=be(i,"beforeFooter",this,t),r=be(i,"footer",this,t),a=be(i,"afterFooter",this,t);let o=[];return o=Ve(o,sn(s)),o=Ve(o,sn(r)),o=Ve(o,sn(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(f0(this.chart,e[l]));return t.filter&&(o=o.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(o=o.sort((u,h)=>t.itemSort(u,h,i))),St(o,u=>{const h=kd(t.callbacks,u);s.push(be(h,"labelColor",this,u)),r.push(be(h,"labelPointStyle",this,u)),a.push(be(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=ys[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=xd(this,i),c=Object.assign({},o,l),u=wd(this.chart,i,c),h=vd(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,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:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=vn(o),{x:f,y:m}=t,{width:g,height:_}=e;let x,v,M,k,T,P;return r==="center"?(T=m+_/2,s==="left"?(x=f,v=x-a,k=T+a,P=T-a):(x=f+g,v=x+a,k=T-a,P=T+a),M=x):(s==="left"?v=f+Math.max(l,u)+a:s==="right"?v=f+g-Math.max(c,h)-a:v=this.caretX,r==="top"?(k=m,T=k-a,x=v-a,M=v+a):(k=m+_,T=k+a,x=v+a,M=v-a),P=k),{x1:x,x2:v,x3:M,y1:k,y2:T,y3:P}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=bi(i.rtl,this.x,this.width);for(t.x=Rr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=Rt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=Rt(r.bodyFont),h=Rr(this,"left",r),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=e.y+m;if(r.usePointStyle){const _={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=g+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,$a(t,_,x,v),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,$a(t,_,x,v)}else{t.lineWidth=ft(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const _=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=vn(a.borderRadius);Object.values(v).some(M=>M!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,gi(t,{x:_,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),gi(t,{x,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(_,g,c,l),t.strokeRect(_,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=Rt(i.bodyFont);let f=h.lineHeight,m=0;const g=bi(i.rtl,this.x,this.width),_=function(p){e.fillText(p,g.x(t.x+m),t.y+f/2),t.y+=f+r},x=g.textAlign(a);let v,M,k,T,P,O,C;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Rr(this,x,i),e.fillStyle=i.bodyColor,St(this.beforeBody,_),m=o&&x!=="right"?a==="center"?c/2+u:c+2+u:0,T=0,O=s.length;T<O;++T){for(v=s[T],M=this.labelTextColors[T],e.fillStyle=M,St(v.before,_),k=v.lines,o&&k.length&&(this._drawColorBox(e,t,T,g,i),f=Math.max(h.lineHeight,l)),P=0,C=k.length;P<C;++P)_(k[P]),f=h.lineHeight;St(v.after,_)}m=0,f=h.lineHeight,St(this.afterBody,_),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=bi(i.rtl,this.x,this.width);for(t.x=Rr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=Rt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+h,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-g),e.quadraticCurveTo(o+c,l+u,o+c-g,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+m,l+u),e.quadraticCurveTo(o,l+u,o,l+u-m),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+h),e.quadraticCurveTo(o,l,o+h,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 a=ys[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=xd(this,t),l=Object.assign({},a,this._size),c=wd(e,t,l),u=vd(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.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 a=$t(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),ru(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),au(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),r=!rr(i,s),a=this._positionChanged(s,e);(r||a)&&(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||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!rr(a,r)||o;return l&&(this._active=a,(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(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=ys[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}A(_o,"positioners",ys);var De={id:"tooltip",_element:_o,positioners:ys,afterInit(n,t,e){e&&(n.tooltip=new _o({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:Sd},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"]},x0=Object.freeze({__proto__:null,Colors:Rb,Decimation:Fb,Filler:i0,Legend:c0,SubTitle:h0,Title:d0,Tooltip:De});const w0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function v0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return w0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const M0=(n,t)=>n===null?null:Kt(Math.round(n),0,t);function Td(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class xo extends qn{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:v0(i,t,rt(e,t),this._addedLabels),M0(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 a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Td.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}}A(xo,"id","category"),A(xo,"defaults",{ticks:{callback:Td}});function k0(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,g=u-1,{min:_,max:x}=t,v=!st(a),M=!st(o),k=!st(c),T=(x-_)/(h+1);let P=Pc((x-_)/g/m)*m,O,C,p,b;if(P<1e-14&&!v&&!M)return[{value:_},{value:x}];b=Math.ceil(x/P)-Math.floor(_/P),b>g&&(P=Pc(b*P/g/m)*m),st(l)||(O=Math.pow(10,l),P=Math.ceil(P*O)/O),s==="ticks"?(C=Math.floor(_/P)*P,p=Math.ceil(x/P)*P):(C=_,p=x),v&&M&&r&&_g((o-a)/r,P/1e3)?(b=Math.round(Math.min((o-a)/P,u)),P=(o-a)/b,C=a,p=o):k?(C=v?a:C,p=M?o:p,b=c-1,P=(p-C)/b):(b=(p-C)/P,Zi(b,Math.round(b),P/1e3)?b=Math.round(b):b=Math.ceil(b));const S=Math.max(Rc(P),Rc(C));O=Math.pow(10,st(l)?S:l),C=Math.round(C*O)/O,p=Math.round(p*O)/O;let E=0;for(v&&(f&&C!==a?(e.push({value:a}),C<a&&E++,Zi(Math.round((C+E*P)*O)/O,a,Dd(a,T,n))&&E++):C<a&&E++);E<b;++E){const R=Math.round((C+E*P)*O)/O;if(M&&R>o)break;e.push({value:R})}return M&&f&&p!==o?e.length&&Zi(e[e.length-1].value,o,Dd(o,T,n))?e[e.length-1].value=o:e.push({value:o}):(!M||p===o)&&e.push({value:p}),e}function Dd(n,t,{horizontal:e,minRotation:i}){const s=Vt(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Ir extends qn{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 a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=We(s),c=We(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(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,a=k0(s,r);return t.bounds==="ticks"&&Ac(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}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 ts(t,this.chart.options.locale,this.options.ticks.format)}}class wo extends Ir{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Vt(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}}A(wo,"id","linear"),A(wo,"defaults",{ticks:{callback:hr.formatters.numeric}});const bs=n=>Math.floor(xn(n)),Xn=(n,t)=>Math.pow(10,bs(n)+t);function Cd(n){return n/Math.pow(10,bs(n))===1}function Ed(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function S0(n,t){const e=t-n;let i=bs(e);for(;Ed(n,t,i)>10;)i++;for(;Ed(n,t,i)<10;)i--;return Math.min(i,bs(n))}function T0(n,{min:t,max:e}){t=Te(n.min,t);const i=[],s=bs(t);let r=S0(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let h=Math.floor((c-u)/Math.pow(10,r)),f=Te(n.min,Math.round((l+u+h*Math.pow(10,r))*a)/a);for(;f<e;)i.push({value:f,major:Cd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,a=r>=0?1:a),f=Math.round((l+u+h*Math.pow(10,r))*a)/a;const m=Te(n.max,f);return i.push({value:m,major:Cd(m),significand:h}),i}class vo extends qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Ir.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(Xn(i,-1)),a(Xn(s,1)))),i<=0&&r(Xn(s,-1)),s<=0&&a(Xn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=T0(e,this);return t.bounds==="ticks"&&Ac(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":ts(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}A(vo,"id","logarithmic"),A(vo,"defaults",{ticks:{callback:hr.formatters.logarithmic,major:{enabled:!0}}});function Mo(n){const t=n.ticks;if(t.display&&n.display){const e=$t(t.backdropPadding);return rt(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function D0(n,t,e){return e=wt(e)?e:[e],{w:Ng(n,t.string,e),h:e.length*t.lineHeight}}function Od(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 C0(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,a=n.options.pointLabels,o=a.centerPointLabels?ut/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),h=Rt(c.font),f=D0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=ie(n.getIndexAngle(l)+o),g=Math.round(cr(m)),_=Od(g,u.x,f.w,0,180),x=Od(g,u.y,f.h,90,270);E0(e,t,m,_,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=A0(n,i,s)}function E0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function O0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(cr(ie(l.angle+Ot))),u=L0(l.y,o.h,c),h=R0(c),f=I0(l.x,o.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+o.w,bottom:u+o.h}}function P0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(tn({x:e,y:i},t)||tn({x:e,y:r},t)||tn({x:s,y:i},t)||tn({x:s,y:r},t))}function A0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:Mo(r)/2,additionalAngle:a?ut/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=O0(n,u,l);i.push(h),o==="auto"&&(h.visible=P0(h,c),h.visible&&(c=h))}return i}function R0(n){return n===0||n===180?"center":n<180?"left":"right"}function I0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function L0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function N0(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!st(o)){const l=vn(t.borderRadius),c=$t(t.backdropPadding);n.fillStyle=o;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=a-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),gi(n,{x:u,y:h,w:f,h:m,radius:l}),n.fill()):n.fillRect(u,h,f,m)}}function F0(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 a=i.setContext(n.getPointLabelContext(s));N0(e,a,r);const o=Rt(a.font),{x:l,y:c,textAlign:u}=r;Vn(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Pd(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ct);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function B0(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Pd(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function z0(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class _s extends Ir{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=$t(Mo(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=At(t)&&!isNaN(t)?t:0,this.max=At(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Mo(this.options))}generateTickLabels(t){Ir.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=kt(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?C0(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=Ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return ie(t*e+Vt(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 z0(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(),Pd(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,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&F0(this,a),s.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=s.setContext(f),g=r.setContext(f);B0(this,m,l,a,g)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(o,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,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Rt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const h=$t(c.backdropPadding);t.fillRect(-a/2-h.left,-r-u.size/2-h.top,a+h.width,u.size+h.height)}Vn(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}A(_s,"id","radialLinear"),A(_s,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:hr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),A(_s,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),A(_s,"descriptors",{angleLines:{_fallback:"grid"}});const Lr={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}},_e=Object.keys(Lr);function Ad(n,t){return n-t}function Rd(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),At(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(wn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Id(n,t,e,i){const s=_e.length;for(let r=_e.indexOf(n);r<s-1;++r){const a=Lr[_e[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return _e[r]}return _e[s-1]}function H0(n,t,e,i,s){for(let r=_e.length-1;r>=_e.indexOf(e);r--){const a=_e[r];if(Lr[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return _e[e?_e.indexOf(e):0]}function W0(n){for(let t=_e.indexOf(n)+1,e=_e.length;t<e;++t)if(Lr[_e[t]].common)return _e[t]}function Ld(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Ba(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function Y0(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Nd(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:Y0(n,i,s,e)}class xs extends qn{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 Su._date(t.adapters.date);s.init(e),Ki(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:Rd(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:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=At(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=At(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,a=this.max,o=Mg(s,r,a);return this._unit=e.unit||(i.autoSkip?Id(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):H0(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:W0(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),Nd(this,o,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 a=t.length<3?.5:.25;e=Kt(e,0,a),i=Kt(i,0,a),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,a=r.unit||Id(r.minUnit,e,i,this._getLabelCapacity(e)),o=rt(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)Ld(u,f,g);return(f===i||s.bounds==="ticks"||m===1)&&Ld(u,f,g),Object.keys(u).sort(Ad).map(_=>+_)}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,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return kt(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],h=c&&o[c],f=i[e],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h: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=Vt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Nd(this,[t],this._majorUnit),s),a=this._getLabelSize(r),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o: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(Rd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Nc(t.sort(Ad))}}A(xs,"id","time"),A(xs,"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 Nr(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Je(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Je(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class ko extends xs{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=Nr(e,this.min),this._tableRange=Nr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-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(Nr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Nr(this._table,i*this._tableRange+this._minPos,!0)}}A(ko,"id","timeseries"),A(ko,"defaults",xs.defaults);var V0=Object.freeze({__proto__:null,CategoryScale:xo,LinearScale:wo,LogarithmicScale:vo,RadialLinearScale:_s,TimeScale:xs,TimeSeriesScale:ko});const $0=[Qp,Tb,x0,V0],Fd=6048e5,j0=864e5,ws=6e4,xi=36e5,U0=1e3,Bd=Symbol.for("constructDateFrom");function Lt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Bd in n?n[Bd](t):n instanceof Date?new n.constructor(t):new Date(t)}function ct(n,t){return Lt(t||n,n)}function Fr(n,t,e){const i=ct(n,e==null?void 0:e.in);return isNaN(t)?Lt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function So(n,t,e){const i=ct(n,e==null?void 0:e.in);if(isNaN(t))return Lt(n,NaN);if(!t)return i;const s=i.getDate(),r=Lt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function To(n,t,e){return Lt(n,+ct(n)+t)}function q0(n,t,e){return To(n,t*xi)}let X0={};function Gn(){return X0}function $e(n,t){var o,l,c,u;const e=Gn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function wi(n,t){return $e(n,{...t,weekStartsOn:1})}function zd(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Lt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=wi(s),a=Lt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=wi(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function Br(n){const t=ct(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 Kn(n,...t){const e=Lt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Do(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Hd(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Do(i),a=Do(s),o=+r-Br(r),l=+a-Br(a);return Math.round((o-l)/j0)}function G0(n,t){const e=zd(n,t),i=Lt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),wi(i)}function K0(n,t,e){const i=ct(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ws),i}function Z0(n,t,e){return So(n,t*3,e)}function Q0(n,t,e){return To(n,t*1e3)}function J0(n,t,e){return Fr(n,t*7,e)}function t_(n,t,e){return So(n,t*12,e)}function vs(n,t){const e=+ct(n)-+ct(t);return e<0?-1:e>0?1:e}function e_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Co(n){return!(!e_(n)&&typeof n!="number"||isNaN(+ct(n)))}function n_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function i_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Wd(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Yd(i,s),a=Math.abs(Hd(i,s));i.setDate(i.getDate()-r*a);const o=+(Yd(i,s)===-r),l=r*(a-o);return l===0?0:l}function Yd(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 s_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=(+i-+s)/xi;return Ms(e==null?void 0:e.roundingMethod)(r)}function Eo(n,t){return+ct(n)-+ct(t)}function r_(n,t,e){const i=Eo(n,t)/ws;return Ms(e==null?void 0:e.roundingMethod)(i)}function Vd(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function $d(n,t){const e=ct(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 a_(n,t){const e=ct(n,t==null?void 0:t.in);return+Vd(e,t)==+$d(e,t)}function jd(n,t,e){const[i,s,r]=Kn(e==null?void 0:e.in,n,n,t),a=vs(s,r),o=Math.abs(n_(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=vs(s,r)===-a;a_(i)&&o===1&&vs(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function o_(n,t,e){const i=jd(n,t,e)/3;return Ms(e==null?void 0:e.roundingMethod)(i)}function l_(n,t,e){const i=Eo(n,t)/1e3;return Ms(e==null?void 0:e.roundingMethod)(i)}function c_(n,t,e){const i=Wd(n,t,e)/7;return Ms(e==null?void 0:e.roundingMethod)(i)}function u_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=vs(i,s),a=Math.abs(i_(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=vs(i,s)===-r,l=r*(a-+o);return l===0?0:l}function d_(n,t){const e=ct(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 h_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function f_(n,t){const e=ct(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 Ud(n,t){const e=ct(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function m_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function g_(n,t){var o,l;const e=Gn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function p_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function y_(n,t){const e=ct(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 b_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const __={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"}},x_=(n,t,e)=>{let i;const s=__[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 Oo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const w_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},v_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},M_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},k_={date:Oo({formats:w_,defaultWidth:"full"}),time:Oo({formats:v_,defaultWidth:"full"}),dateTime:Oo({formats:M_,defaultWidth:"full"})},S_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},T_=(n,t,e,i)=>S_[n];function ks(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const D_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},C_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},E_={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"]},O_={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"]},P_={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"}},A_={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"}},R_={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:ks({values:D_,defaultWidth:"wide"}),quarter:ks({values:C_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:ks({values:E_,defaultWidth:"wide"}),day:ks({values:O_,defaultWidth:"wide"}),dayPeriod:ks({values:P_,defaultWidth:"wide",formattingValues:A_,defaultFormattingWidth:"wide"})};function Ss(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 a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?L_(o,h=>h.test(a)):I_(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function I_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function L_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function N_(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 a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const F_=/^(\d+)(th|st|nd|rd)?/i,B_=/\d+/i,z_={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},H_={any:[/^b/i,/^(a|c)/i]},W_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Y_={any:[/1/i,/2/i,/3/i,/4/i]},V_={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},$_={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]},j_={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},U_={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]},q_={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},X_={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}},G_={ordinalNumber:N_({matchPattern:F_,parsePattern:B_,valueCallback:n=>parseInt(n,10)}),era:Ss({matchPatterns:z_,defaultMatchWidth:"wide",parsePatterns:H_,defaultParseWidth:"any"}),quarter:Ss({matchPatterns:W_,defaultMatchWidth:"wide",parsePatterns:Y_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Ss({matchPatterns:V_,defaultMatchWidth:"wide",parsePatterns:$_,defaultParseWidth:"any"}),day:Ss({matchPatterns:j_,defaultMatchWidth:"wide",parsePatterns:U_,defaultParseWidth:"any"}),dayPeriod:Ss({matchPatterns:q_,defaultMatchWidth:"any",parsePatterns:X_,defaultParseWidth:"any"})},qd={code:"en-US",formatDistance:x_,formatLong:k_,formatRelative:T_,localize:R_,match:G_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function K_(n,t){const e=ct(n,t==null?void 0:t.in);return Hd(e,Ud(e))+1}function Xd(n,t){const e=ct(n,t==null?void 0:t.in),i=+wi(e)-+G0(e);return Math.round(i/Fd)+1}function Po(n,t){var u,h,f,m;const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Gn(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Lt((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=$e(a,t),l=Lt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=$e(l,t);return+e>=+o?i+1:+e>=+c?i:i-1}function Z_(n,t){var o,l,c,u;const e=Gn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Po(n,t),r=Lt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),$e(r,t)}function Gd(n,t){const e=ct(n,t==null?void 0:t.in),i=+$e(e,t)-+Z_(e,t);return Math.round(i/Fd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(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 Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},vi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kd={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 Cn.y(n,t)},Y:function(n,t,e,i){const s=Po(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Tt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=zd(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(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 Tt(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 Tt(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 Cn.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 Tt(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=Gd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Xd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Cn.d(n,t)},D:function(n,t,e){const i=K_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(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 Tt(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 Tt(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 Tt(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=vi.noon:i===0?s=vi.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=vi.evening:i>=12?s=vi.afternoon:i>=4?s=vi.morning:s=vi.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 Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Qd(i);case"XXXX":case"XX":return Zn(i);case"XXXXX":case"XXX":default:return Zn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Qd(i);case"xxxx":case"xx":return Zn(i);case"xxxxx":case"xxx":default:return Zn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zd(i,":");case"OOOO":default:return"GMT"+Zn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zd(i,":");case"zzzz":default:return"GMT"+Zn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function Zd(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+Tt(r,2)}function Qd(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Zn(n,t)}function Zn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const Jd=(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"})}},th=(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"})}},Ao={p:th,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Jd(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}}",Jd(i,t)).replace("{{time}}",th(s,t))}},Q_=/^D+$/,J_=/^Y+$/,tx=["D","DD","YY","YYYY"];function eh(n){return Q_.test(n)}function nh(n){return J_.test(n)}function Ro(n,t,e){const i=ex(n,t,e);if(console.warn(i),tx.includes(n))throw new RangeError(i)}function ex(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 nx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ix=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sx=/^'([^]*?)'?$/,rx=/''/g,ax=/[a-zA-Z]/;function zr(n,t,e){var u,h,f,m,g,_,x,v;const i=Gn(),s=(e==null?void 0:e.locale)??i.locale??qd,r=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=(e==null?void 0:e.weekStartsOn)??((_=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:_.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,o=ct(n,e==null?void 0:e.in);if(!Co(o))throw new RangeError("Invalid time value");let l=t.match(ix).map(M=>{const k=M[0];if(k==="p"||k==="P"){const T=Ao[k];return T(M,s.formatLong)}return M}).join("").match(nx).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const k=M[0];if(k==="'")return{isToken:!1,value:ox(M)};if(Kd[k])return{isToken:!0,value:M};if(k.match(ax))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:M}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(M=>{if(!M.isToken)return M.value;const k=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&nh(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&eh(k))&&Ro(k,t,String(n));const T=Kd[k[0]];return T(o,k,s.localize,c)}).join("")}function ox(n){const t=n.match(sx);return t?t[1].replace(rx,"'"):n}function ih(){return Object.assign({},Gn())}function lx(n,t){const e=ct(n,t==null?void 0:t.in).getDay();return e===0?7:e}function cx(n,t){const e=ux(t)?new t(0):Lt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function ux(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const dx=10;class sh{constructor(){A(this,"subPriority",0)}validate(t,e){return!0}}class hx extends sh{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 fx extends sh{constructor(e,i){super();A(this,"priority",dx);A(this,"subPriority",-1);this.context=e||(s=>Lt(i,s))}set(e,i){return i.timestampIsSet?e:Lt(e,cx(e,this.context))}}class xt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new hx(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class mx extends xt{constructor(){super(...arguments);A(this,"priority",140);A(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}/},je={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 It(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(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,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*xi+r*ws+a*U0),rest:t.slice(e[0].length)}}function rh(n){return It(Ht.anyDigitsSigned,n)}function Nt(n,t){switch(n){case 1:return It(Ht.singleDigit,t);case 2:return It(Ht.twoDigits,t);case 3:return It(Ht.threeDigits,t);case 4:return It(Ht.fourDigits,t);default:return It(new RegExp("^\\d{1,"+n+"}"),t)}}function Hr(n,t){switch(n){case 1:return It(Ht.singleDigitSigned,t);case 2:return It(Ht.twoDigitsSigned,t);case 3:return It(Ht.threeDigitsSigned,t);case 4:return It(Ht.fourDigitsSigned,t);default:return It(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Io(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 ah(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function oh(n){return n%400===0||n%4===0&&n%100!==0}class gx extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Wt(Nt(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(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 o=ah(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class px extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Wt(Nt(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Po(e,r);if(s.isTwoDigitYear){const l=ah(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),$e(e,r)}}class yx extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Hr(i==="R"?4:i.length,e)}set(e,i,s){const r=Lt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),wi(r)}}class bx extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Hr(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class _x extends xt{constructor(){super(...arguments);A(this,"priority",120);A(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 Nt(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 xx extends xt{constructor(){super(...arguments);A(this,"priority",120);A(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 Nt(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 wx extends xt{constructor(){super(...arguments);A(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);A(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return Wt(It(Ht.month,e),r);case"MM":return Wt(Nt(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 vx extends xt{constructor(){super(...arguments);A(this,"priority",110);A(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return Wt(It(Ht.month,e),r);case"LL":return Wt(Nt(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 Mx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Gd(i,e)-t;return i.setDate(i.getDate()-s*7),ct(i,e==null?void 0:e.in)}class kx extends xt{constructor(){super(...arguments);A(this,"priority",100);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return It(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return $e(Mx(e,s,r),r)}}function Sx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Xd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Tx extends xt{constructor(){super(...arguments);A(this,"priority",100);A(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 It(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return wi(Sx(e,s))}}const Dx=[31,28,31,30,31,30,31,31,30,31,30,31],Cx=[31,29,31,30,31,30,31,31,30,31,30,31];class Ex extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"subPriority",1);A(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return It(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=oh(s),a=e.getMonth();return r?i>=1&&i<=Cx[a]:i>=1&&i<=Dx[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Ox extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"subpriority",1);A(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 It(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear();return oh(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 Lo(n,t,e){var h,f,m,g;const i=Gn(),s=(e==null?void 0:e.weekStartsOn)??((f=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,r=ct(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Fr(r,u,e)}class Px extends xt{constructor(){super(...arguments);A(this,"priority",90);A(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=Lo(e,s,r),e.setHours(0,0,0,0),e}}class Ax extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Wt(Nt(i.length,e),a);case"eo":return Wt(s.ordinalNumber(e,{unit:"day"}),a);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=Lo(e,s,r),e.setHours(0,0,0,0),e}}class Rx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Wt(Nt(i.length,e),a);case"co":return Wt(s.ordinalNumber(e,{unit:"day"}),a);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=Lo(e,s,r),e.setHours(0,0,0,0),e}}function Ix(n,t,e){const i=ct(n,e==null?void 0:e.in),s=lx(i,e),r=t-s;return Fr(i,r,e)}class Lx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Nt(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=Ix(e,s),e.setHours(0,0,0,0),e}}class Nx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(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(Io(s),0,0,0),e}}class Fx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(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(Io(s),0,0,0),e}}class Bx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(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(Io(s),0,0,0),e}}class zx extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return It(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 Hx extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return It(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class Wx extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return It(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 Yx extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return It(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(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 Vx extends xt{constructor(){super(...arguments);A(this,"priority",60);A(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return It(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class $x extends xt{constructor(){super(...arguments);A(this,"priority",50);A(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return It(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class jx extends xt{constructor(){super(...arguments);A(this,"priority",30);A(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Nt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class Ux extends xt{constructor(){super(...arguments);A(this,"priority",10);A(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ue(je.basicOptionalMinutes,e);case"XX":return Ue(je.basic,e);case"XXXX":return Ue(je.basicOptionalSeconds,e);case"XXXXX":return Ue(je.extendedOptionalSeconds,e);case"XXX":default:return Ue(je.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-Br(e)-s)}}class qx extends xt{constructor(){super(...arguments);A(this,"priority",10);A(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ue(je.basicOptionalMinutes,e);case"xx":return Ue(je.basic,e);case"xxxx":return Ue(je.basicOptionalSeconds,e);case"xxxxx":return Ue(je.extendedOptionalSeconds,e);case"xxx":default:return Ue(je.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-Br(e)-s)}}class Xx extends xt{constructor(){super(...arguments);A(this,"priority",40);A(this,"incompatibleTokens","*")}parse(e){return rh(e)}set(e,i,s){return[Lt(e,s*1e3),{timestampIsSet:!0}]}}class Gx extends xt{constructor(){super(...arguments);A(this,"priority",20);A(this,"incompatibleTokens","*")}parse(e){return rh(e)}set(e,i,s){return[Lt(e,s),{timestampIsSet:!0}]}}const Kx={G:new mx,y:new gx,Y:new px,R:new yx,u:new bx,Q:new _x,q:new xx,M:new wx,L:new vx,w:new kx,I:new Tx,d:new Ex,D:new Ox,E:new Px,e:new Ax,c:new Rx,i:new Lx,a:new Nx,b:new Fx,B:new Bx,h:new zx,H:new Hx,K:new Wx,k:new Yx,m:new Vx,s:new $x,S:new jx,X:new Ux,x:new qx,t:new Xx,T:new Gx},Zx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jx=/^'([^]*?)'?$/,tw=/''/g,ew=/\S/,nw=/[a-zA-Z]/;function iw(n,t,e,i){var x,v,M,k,T,P,O,C;const s=()=>Lt((i==null?void 0:i.in)||e,NaN),r=ih(),a=(i==null?void 0:i.locale)??r.locale??qd,o=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((k=(M=r.locale)==null?void 0:M.options)==null?void 0:k.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((P=(T=i==null?void 0:i.locale)==null?void 0:T.options)==null?void 0:P.weekStartsOn)??r.weekStartsOn??((C=(O=r.locale)==null?void 0:O.options)==null?void 0:C.weekStartsOn)??0;if(!t)return n?s():ct(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new fx(i==null?void 0:i.in,e)],h=t.match(Qx).map(p=>{const b=p[0];if(b in Ao){const S=Ao[b];return S(p,a.formatLong)}return p}).join("").match(Zx),f=[];for(let p of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&nh(p)&&Ro(p,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&eh(p)&&Ro(p,t,n);const b=p[0],S=Kx[b];if(S){const{incompatibleTokens:E}=S;if(Array.isArray(E)){const I=f.find(B=>E.includes(B.token)||B.token===b);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${p}\` at the same time`)}else if(S.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${p}\` and any other token at the same time`);f.push({token:b,fullToken:p});const R=S.run(n,p,a.match,c);if(!R)return s();u.push(R.setter),n=R.rest}else{if(b.match(nw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(p==="''"?p="'":b==="'"&&(p=sw(p)),n.indexOf(p)===0)n=n.slice(p.length);else return s()}}if(n.length>0&&ew.test(n))return s();const m=u.map(p=>p.priority).sort((p,b)=>b-p).filter((p,b,S)=>S.indexOf(p)===b).map(p=>u.filter(b=>b.priority===p).sort((b,S)=>S.subPriority-b.subPriority)).map(p=>p[0]);let g=ct(e,i==null?void 0:i.in);if(isNaN(+g))return s();const _={};for(const p of m){if(!p.validate(g,c))return s();const b=p.set(g,_,c);Array.isArray(b)?(g=b[0],Object.assign(_,b[1])):g=b}return g}function sw(n){return n.match(Jx)[1].replace(tw,"'")}function rw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function aw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function ow(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function lw(n){const t=n/xi;return Math.trunc(t)}function lh(n,t){const e=()=>Lt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=hw(n);let r;if(s.date){const c=fw(s.date,i);r=mw(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=gw(s.time),isNaN(o)))return e();if(s.timezone){if(l=pw(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=ct(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 ct(a+o+l,t==null?void 0:t.in)}const Wr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},cw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,uw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,dw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function hw(n){const t={},e=n.split(Wr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Wr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Wr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Wr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function fw(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 mw(n,t){if(t===null)return new Date(NaN);const e=n.match(cw);if(!e)return new Date(NaN);const i=!!e[4],s=Ts(e[1]),r=Ts(e[2])-1,a=Ts(e[3]),o=Ts(e[4]),l=Ts(e[5])-1;if(i)return ww(t,o,l)?yw(t,o,l):new Date(NaN);{const c=new Date(0);return!_w(t,r,a)||!xw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function Ts(n){return n?parseInt(n):1}function gw(n){const t=n.match(uw);if(!t)return NaN;const e=No(t[1]),i=No(t[2]),s=No(t[3]);return vw(e,i,s)?e*xi+i*ws+s*1e3:NaN}function No(n){return n&&parseFloat(n.replace(",","."))||0}function pw(n){if(n==="Z")return 0;const t=n.match(dw);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Mw(i,s)?e*(i*xi+s*ws):NaN}function yw(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 bw=[31,null,31,30,31,30,31,31,30,31,30,31];function ch(n){return n%400===0||n%4===0&&n%100!==0}function _w(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(bw[t]||(ch(n)?29:28))}function xw(n,t){return t>=1&&t<=(ch(n)?366:365)}function ww(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function vw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Mw(n,t){return t>=0&&t<=59}var kw=Object.defineProperty,Sw=(n,t,e)=>t in n?kw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>Sw(n,typeof t!="symbol"?t+"":t,e);const Tw=1e3;var nt=(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.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(nt||{});const Dw=["in","not_in","selector"],Cw=["empty","not_empty"],Ew=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],Ow=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ds=n=>n.filter(t=>t!=="time"),uh=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],dh=Ds(uh),Pw=[...uh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api"],hh=Ds(Pw),Aw=["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","realm","status_code","status_code_grouped","ai_plugin"],fh=Ds(Aw);Ds(["api","api_package","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","portal","realm","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"]),Ds(["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(dh),new Set(hh),new Set(fh);const mh=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];mh.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Dw},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:n},operator:{type:"string",enum:Cw}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...hh,...dh,...fh])]);const Rw={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"}},Iw=(n,t,e)=>{let i;const s=Rw[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 Fo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Lw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Nw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Fw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Bw={date:Fo({formats:Lw,defaultWidth:"full"}),time:Fo({formats:Nw,defaultWidth:"full"}),dateTime:Fo({formats:Fw,defaultWidth:"full"})},zw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Hw=(n,t,e,i)=>zw[n];function Cs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Ww={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Vw={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"]},$w={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"]},jw={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"}},Uw={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"}},qw=(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"},Xw={ordinalNumber:qw,era:Cs({values:Ww,defaultWidth:"wide"}),quarter:Cs({values:Yw,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Cs({values:Vw,defaultWidth:"wide"}),day:Cs({values:$w,defaultWidth:"wide"}),dayPeriod:Cs({values:jw,defaultWidth:"wide",formattingValues:Uw,defaultFormattingWidth:"wide"})};function Es(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 a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Kw(o,h=>h.test(a)):Gw(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function Gw(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Kw(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Zw(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 a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const Qw=/^(\d+)(th|st|nd|rd)?/i,Jw=/\d+/i,tv={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},ev={any:[/^b/i,/^(a|c)/i]},nv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iv={any:[/1/i,/2/i,/3/i,/4/i]},sv={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},rv={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]},av={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},ov={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]},lv={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},cv={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}},uv={ordinalNumber:Zw({matchPattern:Qw,parsePattern:Jw,valueCallback:n=>parseInt(n,10)}),era:Es({matchPatterns:tv,defaultMatchWidth:"wide",parsePatterns:ev,defaultParseWidth:"any"}),quarter:Es({matchPatterns:nv,defaultMatchWidth:"wide",parsePatterns:iv,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Es({matchPatterns:sv,defaultMatchWidth:"wide",parsePatterns:rv,defaultParseWidth:"any"}),day:Es({matchPatterns:av,defaultMatchWidth:"wide",parsePatterns:ov,defaultParseWidth:"any"}),dayPeriod:Es({matchPatterns:lv,defaultMatchWidth:"any",parsePatterns:cv,defaultParseWidth:"any"})},dv={code:"en-US",formatDistance:Iw,formatLong:Bw,formatRelative:Hw,localize:Xw,match:uv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let hv={};function Os(){return hv}const gh=6048e5,fv=864e5,mv=60,gv=3600,ph=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&ph in n?n[ph](t):n instanceof Date?new n.constructor(t):new Date(t)}function ue(n,t){return Ae(t||n,n)}function yh(n){const t=ue(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 pv(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Ps(n,t){const e=ue(n,void 0);return e.setHours(0,0,0,0),e}function yv(n,t,e){const[i,s]=pv(void 0,n,t),r=Ps(i),a=Ps(s),o=+r-yh(r),l=+a-yh(a);return Math.round((o-l)/fv)}function bv(n,t){const e=ue(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function _v(n,t){const e=ue(n,void 0);return yv(e,bv(e))+1}function rn(n,t){var e,i,s,r;const a=Os(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=ue(n,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Yr(n,t){return rn(n,{...t,weekStartsOn:1})}function bh(n,t){const e=ue(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Yr(s),a=Ae(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Yr(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function xv(n,t){const e=bh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Yr(i)}function wv(n,t){const e=ue(n,void 0),i=+Yr(e)-+xv(e);return Math.round(i/gh)+1}function _h(n,t){var e,i,s,r;const a=ue(n,t==null?void 0:t.in),o=a.getFullYear(),l=Os(),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(o+1,0,c),u.setHours(0,0,0,0);const h=rn(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(o,0,c),f.setHours(0,0,0,0);const m=rn(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function vv(n,t){var e,i,s,r;const a=Os(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=_h(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),rn(c,t)}function Mv(n,t){const e=ue(n,t==null?void 0:t.in),i=+rn(e,t)-+vv(e,t);return Math.round(i/gh)+1}function Dt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const En={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Dt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Dt(e+1,2)},d(n,t){return Dt(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 Dt(n.getHours()%12||12,t.length)},H(n,t){return Dt(n.getHours(),t.length)},m(n,t){return Dt(n.getMinutes(),t.length)},s(n,t){return Dt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Dt(s,t.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xh={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 En.y(n,t)},Y:function(n,t,e,i){const s=_h(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Dt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Dt(r,t.length)},R:function(n,t){const e=bh(n);return Dt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Dt(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 Dt(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 Dt(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 En.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 Dt(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=Mv(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Dt(s,t.length)},I:function(n,t,e){const i=wv(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Dt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):En.d(n,t)},D:function(n,t,e){const i=_v(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Dt(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 Dt(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 Dt(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 Dt(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=Mi.noon:i===0?s=Mi.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=Mi.evening:i>=12?s=Mi.afternoon:i>=4?s=Mi.morning:s=Mi.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 En.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):En.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):En.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):En.s(n,t)},S:function(n,t){return En.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return vh(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 vh(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"+wh(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"+wh(i,":");case"zzzz":default:return"GMT"+Qn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Dt(i,t.length)},T:function(n,t,e){return Dt(+n,t.length)}};function wh(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+Dt(r,2)}function vh(n,t){return n%60===0?(n>0?"-":"+")+Dt(Math.abs(n)/60,2):Qn(n,t)}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Dt(Math.trunc(i/60),2),r=Dt(i%60,2);return e+s+t+r}const Mh=(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"})}},kh=(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"})}},kv=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Mh(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}}",Mh(i,t)).replace("{{time}}",kh(s,t))},Sv={p:kh,P:kv},Tv=/^D+$/,Dv=/^Y+$/,Cv=["D","DD","YY","YYYY"];function Ev(n){return Tv.test(n)}function Ov(n){return Dv.test(n)}function Pv(n,t,e){const i=Av(n,t,e);if(console.warn(i),Cv.includes(n))throw new RangeError(i)}function Av(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`}function Rv(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Iv(n){return!(!Rv(n)&&typeof n!="number"||isNaN(+ue(n)))}const Lv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Nv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Fv=/^'([^]*?)'?$/,Bv=/''/g,zv=/[a-zA-Z]/;function Hv(n,t,e){var i,s,r,a,o,l,c,u;const h=Os(),f=(e==null?void 0:e.locale)??h.locale??dv,m=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(r=h.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,g=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((u=(c=h.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,_=ue(n,e==null?void 0:e.in);if(!Iv(_))throw new RangeError("Invalid time value");let x=t.match(Nv).map(M=>{const k=M[0];if(k==="p"||k==="P"){const T=Sv[k];return T(M,f.formatLong)}return M}).join("").match(Lv).map(M=>{if(M==="''")return{isToken:!1,value:"'"};const k=M[0];if(k==="'")return{isToken:!1,value:Wv(M)};if(xh[k])return{isToken:!0,value:M};if(k.match(zv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:M}});f.localize.preprocessor&&(x=f.localize.preprocessor(_,x));const v={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(M=>{if(!M.isToken)return M.value;const k=M.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Ov(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Ev(k))&&Pv(k,t,String(n));const T=xh[k[0]];return T(_,k,f.localize,v)}).join("")}function Wv(n){const t=n.match(Fv);return t?t[1].replace(Bv,"'"):n}function Bo(n,t,e){const i=ue(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function Yv(n,t,e){const i=ue(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 a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function ki(n,t){const e=ue(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function Vv(n,t){const e=ue(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 $v(){return Object.assign({},Os())}function Sh(n){return Math.trunc(n*gv)}function jv(n){const t=n/mv;return Math.trunc(t)}function Th(n,t,e){return Yv(n,-1)}function Dh(n,t,e){const i=$v(),s=Xv(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?Uv(s,t):qv(s,t)}function Uv(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 qv(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Xv(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Gv(n,t){const e=t1(t);return"formatToParts"in e?Zv(e,n):Qv(e,n)}const Kv={year:0,month:1,day:2,hour:3,minute:4,second:5};function Zv(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=Kv[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 Qv(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 zo={},Ch=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")),Jv=Ch==="06/25/2014, 00:00:00"||Ch==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function t1(n){return zo[n]||(zo[n]=Jv?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"})),zo[n]}function Ho(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Eh=36e5,e1=6e4,Wo={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function As(n,t,e){if(!n)return 0;let i=Wo.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Wo.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Oh(s)?-(s*Eh):NaN;if(i=Wo.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Oh(s,a)?(r=Math.abs(s)*Eh+a*e1,i[1]==="+"?-r:r):NaN}if(s1(n)){t=new Date(t||Date.now());const a=e?t:n1(t),o=Yo(a,n);return-(e?o:i1(t,o,n))}return NaN}function n1(n){return Ho(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Yo(n,t){const e=Gv(n,t),i=Ho(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 i1(n,t,e){let i=n.getTime()-t;const s=Yo(new Date(i),e);if(t===s)return t;i-=s-t;const r=Yo(new Date(i),e);return s===r?s:Math.max(s,r)}function Oh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Ph={};function s1(n){if(Ph[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Ph[n]=!0,!0}catch{return!1}}const r1=60*1e3,a1={X:function(n,t,e){const i=Vo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Ah(i);case"XXXX":case"XX":return Si(i);case"XXXXX":case"XXX":default:return Si(i,":")}},x:function(n,t,e){const i=Vo(e.timeZone,n);switch(t){case"x":return Ah(i);case"xxxx":case"xx":return Si(i);case"xxxxx":case"xxx":default:return Si(i,":")}},O:function(n,t,e){const i=Vo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+o1(i,":");case"OOOO":default:return"GMT"+Si(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Dh("short",n,e);case"zzzz":default:return Dh("long",n,e)}}};function Vo(n,t){const e=n?As(n,t,!0)/r1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Vr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Si(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Vr(Math.floor(i/60),2),r=Vr(Math.floor(i%60),2);return e+s+t+r}function Ah(n,t){return n%60===0?(n>0?"-":"+")+Vr(Math.abs(n)/60,2):Si(n,t)}function o1(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+Vr(r,2)}function Rh(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 Ih=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,$o=36e5,Lh=6e4,l1=2,de={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:Ih};function $r(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?l1: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=c1(n),{year:s,restDateString:r}=u1(i.date,e),a=d1(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=h1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=As(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Rh(new Date(o+l)),c=Rh(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function c1(n){const t={};let e=de.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=de.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=de.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function u1(n,t){if(n){const e=de.YYY[t],i=de.YYYYY[t];let s=de.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=de.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 d1(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=de.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Bh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=de.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return g1(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=de.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return Bh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=de.Www.exec(n),r)return s=parseInt(r[1],10)-1,zh(s)?Nh(t,s):new Date(NaN);if(r=de.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return zh(s,a)?Nh(t,s,a):new Date(NaN)}return null}function h1(n){let t,e,i=de.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),jo(t)?t%24*$o:NaN;if(i=de.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),jo(t,e)?t%24*$o+e*Lh:NaN;if(i=de.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return jo(t,e,s)?t%24*$o+e*Lh+s*1e3:NaN}return null}function Nh(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 f1=[31,28,31,30,31,30,31,31,30,31,30,31],m1=[31,29,31,30,31,30,31,31,30,31,30,31];function Fh(n){return n%400===0||n%4===0&&n%100!==0}function Bh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Fh(n);if(i&&e>m1[t]||!i&&e>f1[t])return!1}return!0}function g1(n,t){if(t<1)return!1;const e=Fh(n);return!(e&&t>366||!e&&t>365)}function zh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function jo(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const p1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function y1(n,t,e={}){t=String(t);const i=t.match(p1);if(i){const s=$r(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+a1[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return Hv(n,t,e)}function Hh(n,t,e){n=$r(n,e);const i=As(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 b1(n,t,e,i){return i={...i,timeZone:t,originalDate:n},y1(Hh(n,t,{timeZone:i.timeZone}),e,i)}function _1(n,t,e){if(typeof n=="string"&&!n.match(Ih))return $r(n,{...e,timeZone:t});n=$r(n,e);const i=Ho(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=As(t,new Date(i));return new Date(i+s)}function x1(n,t){return-As(n,t)}function Uo(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 b1(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const w1={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 qo(n){return n&&Ow.find(t=>n<=w1[t])||null}var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function v1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ur={exports:{}};Ur.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",_="[object Promise]",x="[object RegExp]",v="[object Set]",M="[object String]",k="[object Symbol]",T="[object WeakMap]",P="[object ArrayBuffer]",O="[object DataView]",C="[object Float32Array]",p="[object Float64Array]",b="[object Int8Array]",S="[object Int16Array]",E="[object Int32Array]",R="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",j="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,lt=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,z={};z[r]=z[a]=z[P]=z[O]=z[o]=z[l]=z[C]=z[p]=z[b]=z[S]=z[E]=z[f]=z[m]=z[g]=z[x]=z[v]=z[M]=z[k]=z[R]=z[I]=z[B]=z[j]=!0,z[c]=z[u]=z[T]=!1;var q=typeof jr=="object"&&jr&&jr.Object===Object&&jr,J=typeof self=="object"&&self&&self.Object===Object&&self,$=q||J||Function("return this")(),yt=t&&!t.nodeType&&t,_t=yt&&!0&&n&&!n.nodeType&&n,Y=_t&&_t.exports===yt;function H(w,L){return w.set(L[0],L[1]),w}function X(w,L){return w.add(L),w}function K(w,L){for(var F=-1,tt=w?w.length:0;++F<tt&&L(w[F],F,w)!==!1;);return w}function Z(w,L){for(var F=-1,tt=L.length,Yt=w.length;++F<tt;)w[Yt+F]=L[F];return w}function G(w,L,F,tt){for(var Yt=-1,Xt=w?w.length:0;++Yt<Xt;)F=L(F,w[Yt],Yt,w);return F}function gt(w,L){for(var F=-1,tt=Array(w);++F<w;)tt[F]=L(F);return tt}function vt(w,L){return w==null?void 0:w[L]}function at(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function bt(w){var L=-1,F=Array(w.size);return w.forEach(function(tt,Yt){F[++L]=[Yt,tt]}),F}function dt(w,L){return function(F){return w(L(F))}}function jt(w){var L=-1,F=Array(w.size);return w.forEach(function(tt){F[++L]=tt}),F}var ot=Array.prototype,Mt=Function.prototype,te=Object.prototype,oe=$["__core-js_shared__"],Ut=function(){var w=/[^.]+$/.exec(oe&&oe.keys&&oe.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),qe=Mt.toString,Et=te.hasOwnProperty,ee=te.toString,Ft=RegExp("^"+qe.call(Et).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=Y?$.Buffer:void 0,ne=$.Symbol,Xe=$.Uint8Array,ri=dt(Object.getPrototypeOf,Object),Fe=Object.create,Bt=te.propertyIsEnumerable,ve=ot.splice,ai=Object.getOwnPropertySymbols,ma=qt?qt.isBuffer:void 0,ga=dt(Object.keys,Object),js=Fn($,"DataView"),oi=Fn($,"Map"),Us=Fn($,"Promise"),li=Fn($,"Set"),cn=Fn($,"WeakMap"),un=Fn(Object,"create"),qs=le(js),Xs=le(oi),ci=le(Us),Fl=le(li),Bl=le(cn),pa=ne?ne.prototype:void 0,ya=pa?pa.valueOf:void 0;function dn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function Li(){this.__data__=un?un(null):{}}function Gs(w){return this.has(w)&&delete this.__data__[w]}function ba(w){var L=this.__data__;if(un){var F=L[w];return F===i?void 0:F}return Et.call(L,w)?L[w]:void 0}function hn(w){var L=this.__data__;return un?L[w]!==void 0:Et.call(L,w)}function zl(w,L){var F=this.__data__;return F[w]=un&&L===void 0?i:L,this}dn.prototype.clear=Li,dn.prototype.delete=Gs,dn.prototype.get=ba,dn.prototype.has=hn,dn.prototype.set=zl;function Be(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function Hl(){this.__data__=[]}function Wl(w){var L=this.__data__,F=Fi(L,w);if(F<0)return!1;var tt=L.length-1;return F==tt?L.pop():ve.call(L,F,1),!0}function Yl(w){var L=this.__data__,F=Fi(L,w);return F<0?void 0:L[F][1]}function ze(w){return Fi(this.__data__,w)>-1}function Vl(w,L){var F=this.__data__,tt=Fi(F,w);return tt<0?F.push([w,L]):F[tt][1]=L,this}Be.prototype.clear=Hl,Be.prototype.delete=Wl,Be.prototype.get=Yl,Be.prototype.has=ze,Be.prototype.set=Vl;function Ln(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var tt=w[L];this.set(tt[0],tt[1])}}function $l(){this.__data__={hash:new dn,map:new(oi||Be),string:new dn}}function jl(w){return Hi(this,w).delete(w)}function Ul(w){return Hi(this,w).get(w)}function He(w){return Hi(this,w).has(w)}function ql(w,L){return Hi(this,w).set(w,L),this}Ln.prototype.clear=$l,Ln.prototype.delete=jl,Ln.prototype.get=Ul,Ln.prototype.has=He,Ln.prototype.set=ql;function Nn(w){this.__data__=new Be(w)}function Xl(){this.__data__=new Be}function Gl(w){return this.__data__.delete(w)}function Kl(w){return this.__data__.get(w)}function Ni(w){return this.__data__.has(w)}function Zl(w,L){var F=this.__data__;if(F instanceof Be){var tt=F.__data__;if(!oi||tt.length<e-1)return tt.push([w,L]),this;F=this.__data__=new Ln(tt)}return F.set(w,L),this}Nn.prototype.clear=Xl,Nn.prototype.delete=Gl,Nn.prototype.get=Kl,Nn.prototype.has=Ni,Nn.prototype.set=Zl;function Ql(w,L){var F=Js(w)||Yi(w)?gt(w.length,String):[],tt=F.length,Yt=!!tt;for(var Xt in w)Et.call(w,Xt)&&!(Yt&&(Xt=="length"||gc(Xt,tt)))&&F.push(Xt);return F}function Re(w,L,F){var tt=w[L];(!(Et.call(w,L)&&Qs(tt,F))||F===void 0&&!(L in w))&&(w[L]=F)}function Fi(w,L){for(var F=w.length;F--;)if(Qs(w[F][0],L))return F;return-1}function Jl(w,L){return w&&_a(L,ui(L),w)}function Ks(w,L,F,tt,Yt,Xt,Me){var Qt;if(tt&&(Qt=Xt?tt(w,Yt,Xt,Me):tt(w)),Qt!==void 0)return Qt;if(!mn(w))return w;var Ta=Js(w);if(Ta){if(Qt=fc(w),!L)return uc(w,Qt)}else{var Bn=Ge(w),Da=Bn==u||Bn==h;if(Ma(w))return sc(w,L);if(Bn==g||Bn==r||Da&&!Xt){if(at(w))return Xt?w:{};if(Qt=wa(Da?{}:w),!L)return dc(w,Jl(Qt,w))}else{if(!z[Bn])return Xt?w:{};Qt=mc(w,Bn,Ks,L)}}Me||(Me=new Nn);var Ca=Me.get(w);if(Ca)return Ca;if(Me.set(w,Qt),!Ta)var di=F?hc(w):ui(w);return K(di||w,function(er,Vi){di&&(Vi=er,er=w[Vi]),Re(Qt,Vi,Ks(er,L,F,tt,Vi,w,Me))}),Qt}function tc(w){return mn(w)?Fe(w):{}}function ec(w,L,F){var tt=L(w);return Js(w)?tt:Z(tt,F(w))}function nc(w){return ee.call(w)}function Bi(w){if(!mn(w)||pc(w))return!1;var L=tr(w)||at(w)?Ft:lt;return L.test(le(w))}function ic(w){if(!fn(w))return ga(w);var L=[];for(var F in Object(w))Et.call(w,F)&&F!="constructor"&&L.push(F);return L}function sc(w,L){if(L)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function zi(w){var L=new w.constructor(w.byteLength);return new Xe(L).set(new Xe(w)),L}function rc(w,L){var F=L?zi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function ac(w,L,F){var tt=L?F(bt(w),!0):bt(w);return G(tt,H,new w.constructor)}function Zs(w){var L=new w.constructor(w.source,V.exec(w));return L.lastIndex=w.lastIndex,L}function oc(w,L,F){var tt=L?F(jt(w),!0):jt(w);return G(tt,X,new w.constructor)}function lc(w){return ya?Object(ya.call(w)):{}}function cc(w,L){var F=L?zi(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function uc(w,L){var F=-1,tt=w.length;for(L||(L=Array(tt));++F<tt;)L[F]=w[F];return L}function _a(w,L,F,tt){F||(F={});for(var Yt=-1,Xt=L.length;++Yt<Xt;){var Me=L[Yt],Qt=void 0;Re(F,Me,Qt===void 0?w[Me]:Qt)}return F}function dc(w,L){return _a(w,xa(w),L)}function hc(w){return ec(w,ui,xa)}function Hi(w,L){var F=w.__data__;return Wi(L)?F[typeof L=="string"?"string":"hash"]:F.map}function Fn(w,L){var F=vt(w,L);return Bi(F)?F:void 0}var xa=ai?dt(ai,Object):ka,Ge=nc;(js&&Ge(new js(new ArrayBuffer(1)))!=O||oi&&Ge(new oi)!=f||Us&&Ge(Us.resolve())!=_||li&&Ge(new li)!=v||cn&&Ge(new cn)!=T)&&(Ge=function(w){var L=ee.call(w),F=L==g?w.constructor:void 0,tt=F?le(F):void 0;if(tt)switch(tt){case qs:return O;case Xs:return f;case ci:return _;case Fl:return v;case Bl:return T}return L});function fc(w){var L=w.length,F=w.constructor(L);return L&&typeof w[0]=="string"&&Et.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function wa(w){return typeof w.constructor=="function"&&!fn(w)?tc(ri(w)):{}}function mc(w,L,F,tt){var Yt=w.constructor;switch(L){case P:return zi(w);case o:case l:return new Yt(+w);case O:return rc(w,tt);case C:case p:case b:case S:case E:case R:case I:case B:case j:return cc(w,tt);case f:return ac(w,tt,F);case m:case M:return new Yt(w);case x:return Zs(w);case v:return oc(w,tt,F);case k:return lc(w)}}function gc(w,L){return L=L??s,!!L&&(typeof w=="number"||U.test(w))&&w>-1&&w%1==0&&w<L}function Wi(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function pc(w){return!!Ut&&Ut in w}function fn(w){var L=w&&w.constructor,F=typeof L=="function"&&L.prototype||te;return w===F}function le(w){if(w!=null){try{return qe.call(w)}catch{}try{return w+""}catch{}}return""}function yc(w){return Ks(w,!0,!0)}function Qs(w,L){return w===L||w!==w&&L!==L}function Yi(w){return bc(w)&&Et.call(w,"callee")&&(!Bt.call(w,"callee")||ee.call(w)==r)}var Js=Array.isArray;function va(w){return w!=null&&_c(w.length)&&!tr(w)}function bc(w){return gn(w)&&va(w)}var Ma=ma||Sa;function tr(w){var L=mn(w)?ee.call(w):"";return L==u||L==h}function _c(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function mn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function gn(w){return!!w&&typeof w=="object"}function ui(w){return va(w)?Ql(w):ic(w)}function ka(){return[]}function Sa(){return!1}n.exports=yc}(Ur,Ur.exports),Ur.exports;const an=(n,t)=>new Date(n.getTime()-x1(t,n));class ae{constructor(t){Pe(this,"timeframeText"),Pe(this,"key"),Pe(this,"display"),Pe(this,"timeframeLength"),Pe(this,"allowedTiers"),Pe(this,"defaultResponseGranularity"),Pe(this,"dataGranularity"),Pe(this,"isRelative"),Pe(this,"fineGrainedDefaultGranularity"),Pe(this,"_startCustom"),Pe(this,"_endCustom"),Pe(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){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t};if(Ew.includes(this.key))return{type:"relative",time_range:this.key,tz:t};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(t){if(!t)return new Date;const e=_1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Hh(e,t)}}class M1 extends ae{rawStart(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class k1 extends ae{rawStart(t){let e=ki(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class S1 extends ae{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}maximumTimeframeLength(){return 60*60*24*366}}class T1 extends ae{rawEnd(t){let e=rn(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=an(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rn(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=an(i,t)),i}}class D1 extends ae{rawEnd(t){let e=ki(this.tzAdjustedDate(t));return t&&(e=an(e,t)),e}rawStart(t){let e=ki(Th(this.tzAdjustedDate(t)));return t&&(e=an(e,t)),e}}class C1 extends ae{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=an(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=an(e,t)),e}}nt.FIFTEEN_MIN,new ae({key:nt.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"]}),nt.ONE_HOUR,new ae({key:nt.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"]}),nt.SIX_HOUR,new ae({key:nt.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"]}),nt.TWELVE_HOUR,new ae({key:nt.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"]}),nt.ONE_DAY,new ae({key:nt.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"]}),nt.SEVEN_DAY,new ae({key:nt.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"]}),nt.THIRTY_DAY,new ae({key:nt.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"]}),nt.NINETY_DAY,new ae({key:nt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.ONE_HUNDRED_EIGHTY_DAY,new ae({key:nt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.ONE_YEAR,new ae({key:nt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),nt.CURRENT_WEEK,new M1({key:nt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rn(new Date,{weekStartsOn:1});return(Ps(Bo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),nt.CURRENT_MONTH,new k1({key:nt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=ki(new Date);return(Ps(Bo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.CURRENT_YEAR,new S1({key:nt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Ps(Bo(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.PREVIOUS_WEEK,new T1({key:nt.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"]}),nt.PREVIOUS_MONTH,new D1({key:nt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=ki(new Date),e=ki(Th(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Wh(t,e)),60*60*24*Vv(new Date().setMonth(new Date().getMonth()-1))+Sh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),nt.PREVIOUS_YEAR,new C1({key:nt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Wh(n,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+Sh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Wh(n,t){return jv(n.getTimezoneOffset()-t.getTimezoneOffset())}nt.FIFTEEN_MIN,nt.ONE_HOUR,nt.SIX_HOUR,nt.TWELVE_HOUR,nt.ONE_DAY,nt.SEVEN_DAY,nt.FIFTEEN_MIN,nt.ONE_HOUR,nt.SIX_HOUR,nt.TWELVE_HOUR,nt.ONE_DAY,nt.SEVEN_DAY,nt.THIRTY_DAY,nt.NINETY_DAY,nt.ONE_HUNDRED_EIGHTY_DAY,nt.ONE_YEAR,nt.CURRENT_WEEK,nt.CURRENT_MONTH,nt.CURRENT_YEAR,nt.PREVIOUS_WEEK,nt.PREVIOUS_MONTH,nt.PREVIOUS_YEAR;const E1=new Map(mh.map(n=>[n.code,{code:n.code,name:n.name}])),Xo=n=>{var t;return((t=E1.get(n))==null?void 0:t.name)||n};var Yh={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,_){_&&_%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(Yh);var O1=Yh.exports;const Go=v1(O1);var Vh;const P1=typeof document<"u"&&((Vh=document.documentElement)==null?void 0:Vh.lang)||"en-US",qr=new Intl.NumberFormat(P1);function Ti({i18n:n}){const t=(i,s)=>{if(isNaN(i))return"0 B";const r=s?Math.pow(2,50):1e15,a=s?Math.pow(2,40):1e12,o=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=r?u=n.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=n.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},e=(i,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?n.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:r=!1,currency:a="USD",approximate:o=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,r);case"usd":return e(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${Go(i,{capital:!0})} ${c}`:i>=.01?`${qr.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:e,formatRange:(i,s,r,{isBytes1024:a=!1,currency:o="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(r,s);switch(r){case"bytes":return`${t(i,a)} - ${t(s,a)}`;case"usd":return`${e(i,o)} - ${e(s,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${Go(i,{capital:!0})} - ${Go(s,{capital:!0})} ${u}`}const h=i>=.01?`${qr.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${qr.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const Xr=n=>["interactive","zoom-interactive"].includes(n),$h=(n,t,e,i)=>{var l,c;const{tooltip:s}=t;if(s.opacity===0&&!Xr(n.interactionMode)){n.showTooltip=!1;return}const{i18n:r}=mt.useI18n(),{formatUnit:a}=Ti({i18n:r}),o=n.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(s.body&&!Xr(n.interactionMode)){const u=s.labelColors,h=((c=(l=t.chart.config)==null?void 0:l.options)==null?void 0:c.indexAxis)==="y"?"x":"y",f=s.dataPoints[0].parsed.x??0;n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(f,e):Ns({tickValue:new Date(f),granularity:e}),n.tooltipSeries=s.dataPoints.map((m,g)=>{const _=m.parsed[h],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=m.dataset.label;return{backgroundColor:u[g].backgroundColor,borderColor:u[g].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:m.dataset.isSegmentEmpty}}).sort(o),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},jh=(n,t)=>{var a,o;const{tooltip:e}=t,{i18n:i}=mt.useI18n(),{formatUnit:s}=Ti({i18n:i});if(e.opacity===0&&!Xr(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(e.body&&!Xr(n.interactionMode)){const l=e.labelColors,c=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[c],g=s(m??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=h.dataset.labels[h.dataIndex]:_=h.dataset.label,{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:_,value:g,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},A1=n=>n&&n.datasets&&n.datasets.length,R1=n=>A1(n)&&n.datasets.some(t=>t.data.length),I1=n=>n.datasets.some(t=>t.data[0]&&Co(t.data[0].x)),L1=n=>!!R1(n)&&n.datasets.some(t=>t.data.length==1),N1=n=>I1(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Ko=(n,t,e)=>{const s=Math.min(t/1150,1),r=.15,a=1.15,o=n.x??0;return o<e?o+t*r*(1-s):o-t*a*(1-s)},F1=(n,t,e)=>{const r=n.y??0;return r<e?r+t*.15:r-t*.5};function Uh(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const qh=(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)},B1=2,Xh=10,Gh=12,Gr=10,Kh="#6c7489",z1="#d60027",H1="#ad000e",Zo="#6c7489",Zh="#52596e",W1="#007d60",Y1="#995c00",V1="#ffc400",Rs="16px",$1="20px",j1="'Inter', Roboto, Helvetica, sans-serif",Qh={"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"],Kr=(n,t)=>(t||on)[n%on.length],Jh=(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),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},tf="#6f7787",ef={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"}},U1=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=ef[t])==null?void 0:e.background)||"#fafafa"},q1={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},X1={"4XX":"#FFBA81","5XX":"#FF8484"},G1={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},K1="#dad4c7",nf="#afb7c5",Z1=n=>{const t=Object.entries(Qh).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Qh.standard},Qo=(n,t,e,i)=>{let s;return e?s=nf:Array.isArray(i)?s=Kr(n,i):s=i[t],s||Kr(n)},Zr=n=>{switch(n){case"error":return z1;case"warning":return V1;case"neutral":return Kh;default:return Kh}},Q1={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},J1=2,tM=0,Jo=new Map,sf=(n,t)=>{const{i18n:e}=mt.useI18n(),{formatBytes:i}=Ti({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):qr.format(n)},eM=n=>{const e=document.createElement("canvas").getContext("2d"),i=Rt({});return e.font=i.string,e.measureText(n).width},nM=()=>{const n="label_height";if(!Jo.has(n)){const t=Rt({});Jo.set(n,t.lineHeight)}return Jo.get(n)},iM=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),sM=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,tl="#e0e4ea",rM={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"]},Is=(n,t)=>{let e=1;const i=rM[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},rf=new Map([[100,Is("100",[100,101,102,103])],[200,Is("200",[200,201,202,203,204,205,206,207,208,226])],[300,Is("300",[300,301,302,303,304,305,307,308])],[400,Is("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,Is("500",[500,501,502,503,504,505,506,507,508,510,511])]]),el=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=rf.get(e);return i===void 0?tl:i.get(t)??i.get(-1)??tl},aM=n=>{const t=el(n);return{solid:t,light:t}},Qr={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=el(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function af(n,t,e){const i=ih(),s=cM(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?oM(s,t):lM(s,t)}function oM(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 lM(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function cM(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function uM(n,t){const e=gM(t);return"formatToParts"in e?hM(e,n):fM(e,n)}const dM={year:0,month:1,day:2,hour:3,minute:4,second:5};function hM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=dM[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 fM(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 nl={},of=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")),mM=of==="06/25/2014, 00:00:00"||of==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function gM(n){return nl[n]||(nl[n]=mM?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"})),nl[n]}function lf(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const cf=36e5,pM=6e4,il={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function sl(n,t,e){if(!n)return 0;let i=il.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=il.timezoneHH.exec(n),i)return s=parseInt(i[1],10),uf(s)?-(s*cf):NaN;if(i=il.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return uf(s,a)?(r=Math.abs(s)*cf+a*pM,i[1]==="+"?-r:r):NaN}if(_M(n)){t=new Date(t||Date.now());const a=e?t:yM(t),o=rl(a,n);return-(e?o:bM(t,o,n))}return NaN}function yM(n){return lf(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function rl(n,t){const e=uM(n,t),i=lf(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 bM(n,t,e){let s=n.getTime()-t;const r=rl(new Date(s),e);if(t===r)return t;s-=r-t;const a=rl(new Date(s),e);return r===a?r:Math.max(r,a)}function uf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const df={};function _M(n){if(df[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),df[n]=!0,!0}catch{return!1}}const xM=60*1e3,wM={X:function(n,t,e){const i=al(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return hf(i);case"XXXX":case"XX":return Di(i);case"XXXXX":case"XXX":default:return Di(i,":")}},x:function(n,t,e){const i=al(e.timeZone,n);switch(t){case"x":return hf(i);case"xxxx":case"xx":return Di(i);case"xxxxx":case"xxx":default:return Di(i,":")}},O:function(n,t,e){const i=al(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+vM(i,":");case"OOOO":default:return"GMT"+Di(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return af("short",n,e);case"zzzz":default:return af("long",n,e)}}};function al(n,t){const e=n?sl(n,t,!0)/xM:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Jr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Di(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Jr(Math.floor(i/60),2),r=Jr(Math.floor(i%60),2);return e+s+t+r}function hf(n,t){return n%60===0?(n>0?"-":"+")+Jr(Math.abs(n)/60,2):Di(n,t)}function vM(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+Jr(r,2)}function ff(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 MM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ol=36e5,mf=6e4,kM=2,he={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:MM};function gf(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?kM: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=SM(n),{year:s,restDateString:r}=TM(i.date,e),a=DM(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=CM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=sl(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=ff(new Date(o+l)),c=ff(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function SM(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function TM(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.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 DM(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=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,bf(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return PM(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return bf(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,_f(s)?pf(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return _f(s,a)?pf(t,s,a):new Date(NaN)}return null}function CM(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ll(t)?t%24*ol:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ll(t,e)?t%24*ol+e*mf:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ll(t,e,s)?t%24*ol+e*mf+s*1e3:NaN}return null}function pf(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 EM=[31,28,31,30,31,30,31,31,30,31,30,31],OM=[31,29,31,30,31,30,31,31,30,31,30,31];function yf(n){return n%400===0||n%4===0&&n%100!==0}function bf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=yf(n);if(i&&e>OM[t]||!i&&e>EM[t])return!1}return!0}function PM(n,t){if(t<1)return!1;const e=yf(n);return!(e&&t>366||!e&&t>365)}function _f(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ll(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const AM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function cl(n,t,e={}){t=String(t);const i=t.match(AM);if(i){const s=gf(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+wM[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return zr(n,t,e)}function RM(n,t,e){n=gf(n,e);const i=sl(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 Ls(n,t,e,i){return i={...i,timeZone:t,originalDate:n},cl(RM(n,t,{timeZone:i.timeZone}),e,i)}const IM=(n,t)=>`${Ls(n,t,"yyyy")} W${Ls(n,t,"II")}`,ul="yyyy-MM-dd h:mm:ss a",dl="h:mm:ss a",Jn="yyyy-MM-dd h:mm a",Ci="h:mm a",LM="yyyy-MM-dd",hl="MMM dd, yyyy h:mm:ss a",On="MMM dd, yyyy h:mm a",NM={secondly:n=>n?ul:dl,tenSecondly:n=>n?ul:dl,thirtySecondly:n=>n?ul:dl,minutely:n=>n?Jn:Ci,fiveMinutely:n=>n?Jn:Ci,tenMinutely:n=>n?Jn:Ci,thirtyMinutely:n=>n?Jn:Ci,hourly:n=>n?Jn:Ci,twoHourly:n=>n?Jn:Ci,twelveHourly:()=>Jn,daily:()=>LM},FM={secondly:()=>hl,tenSecondly:()=>hl,thirtySecondly:()=>hl,minutely:()=>On,fiveMinutely:()=>On,tenMinutely:()=>On,thirtyMinutely:()=>On,hourly:()=>On,twoHourly:()=>On,twelveHourly:()=>On,daily:()=>On};function xf({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:a}){const o=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return IM(n,o);if(s&&s[t]){const l=s[t](i);return Ls(n,o,l)}if(r&&r[t]){const l=r[t]();return Ls(n,o,l)}return Ls(n,o,a)}const BM=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>xf({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:NM,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Ns=({tickValue:n,granularity:t,timezone:e})=>xf({tickValue:n,granularity:t,timezone:e,tooltipMap:FM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),zM=n=>{var e,i,s,r,a;const{i18n:t}=mt.useI18n();return(n==null?void 0:n.status)===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(n==null?void 0:n.status)===408?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(n==null?void 0:n.message)}};function HM(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};De.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=u.width/2,m=Ko(c,h,f),g=c.y,_=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:g-n.tooltipState.offsetY,xAlign:_}},ao.modes.customInteractionMode=function(l,c){const u=kn(c,l),h=[];return ao.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,g)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),l.options.indexAxis==="x"&&u.x!==null&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const s=n.numLabels.value>25?Xh:Gh,r=({chart:l,index:c})=>{var h;const u=l.data;return{size:s,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[c]?"italic":"normal"}},a=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>Gr?c.slice(0,Gr)+"...":c):l.getLabelForValue(Number(c)),o=d.computed(()=>{var l,c,u,h,f,m,g,_;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="y"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(h=n.dimensionAxesTitle)==null?void 0:h.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="x"?!st((f=n.metricAxesTitle)==null?void 0:f.value):!st((m=n.dimensionAxesTitle)==null?void 0:m.value),text:n.indexAxis==="x"?(g=n.metricAxesTitle)==null?void 0:g.value:(_=n.dimensionAxesTitle)==null?void 0:_.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{jh(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.getCurrentInstance()&&d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),o}ye.register(...$0);const WM=(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 YM(n,t,e,i,s){const r=d.shallowRef(null),a=(o,l)=>{if(t.value)return new ye(t.value,{type:n,data:o,plugins:i,options:l})};return d.onMounted(()=>{r.value=a(e.value,s.value)}),d.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),d.watch(e,(o,l)=>{if(WM(l,o)&&!st(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=a(o,s.value)}),d.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),d.watch(s,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(st(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}var xe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fl(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wf={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,_){_&&_%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function e(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,s=1e4,r=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?s:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(e(c,1,u),u):c<r?h=e(c,i,u)+"k":c<a?h=e(c,r,u)+"m":c<o?h=t(e(c,a,u),u)+"b":h=t(e(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,n.exports=l})()})(wf);var VM=wf.exports;const ta=fl(VM);function $M(n,t,e){const{i18n:i}=mt.useI18n(),{formatBytes:s}=Ti({i18n:i}),{translateUnit:r}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>n.value.datasets.reduce((o,l)=>{const c=l.total?l.total:l.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(e.value==="bytes")u=s(c);else{const h=r(e.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:ta(c,{capital:!0}),unit:h})||`${ta(c,{capital:!0})} ${e.value}`}return{...o,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function jM(n){return d.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?`${Uo(e)} - ${Uo(i,{includeTZ:!0})}`:""})}function UM(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};De.positioners[e]=function(r,a){if(!r.length||a.x===null||a.y===null)return!1;const o=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=o.width/2,u=Ko(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{jh(n.tooltipState,r)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),{options:s}}function qM(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return BM({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=d.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};De.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,m=u.width/2,g=u.height/2,_=Ko(c,h,m);let x=F1(c,f,g);const v=c.y<g?"top":"bottom",M=c.x<m?"left":"center";return f>u.height&&(x=0),{x:_,y:x,xAlign:M,yAlign:v}};const a=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return lw(l)>24||u.getDate()!==c.getDate()}),o=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.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:{...r,external:u=>{$h(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.onUnmounted(()=>{De.positioners[s]&&delete De.positioners[s]}),{options:o}}function XM(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Kr(i.indexOf(u),on),data:a.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=Qo(h,u.name,u.id==="empty",o);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:a.map(m=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function GM(n,t){const{i18n:e}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0,u=c&&o.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&o||a,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(l?s.flatMap(b=>a.map((S,E)=>{const R=b.event[f],I=c?`${R},${S}`:`${E},${S}`,B=b.event[S];return[I,B]})):s.map(b=>{const S=c?`${b.event[f]},${b.event[m]}`:`${f},${m}`,E=b.event[a[0]];return[S,E]})),_=Object.keys(g).reduce((b,S)=>{const[E]=S.split(","),R=g[S];return b[E]?b[E]+=R:b[E]=R,b},{}),x=Object.entries(_).sort(([,b],[,S])=>Number(S)-Number(b)).map(([b])=>b),v=r[f],M=r[m];let k=c&&v&&Object.entries(v).map(([b,S])=>({id:b,name:S.name}))||a.map(b=>({id:b,name:b})),T=c&&M&&Object.entries(M).map(([b,S])=>({id:b,name:S.name}))||a.map(b=>({id:b,name:b}));if(c&&f==="country_code"&&(k=k.map(b=>({...b,name:Xo(b.id)||b.name}))),c&&m==="country_code"&&(T=T.map(b=>({...b,name:Xo(b.id)||b.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(k.sort((b,S)=>x.indexOf(b.id)-x.indexOf(S.id)),T.sort((b,S)=>x.indexOf(b.id)-x.indexOf(S.id))),!k||!T)return{labels:[],datasets:[]};const P=XM({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:T,pivotRecords:g,rowLabels:k,colorPalette:n.colorPalette||on}),O=c?k.map(b=>e&&e.te(`chartLabels.${b.name}`)&&e.t(`chartLabels.${b.name}`)||b.name):a.map(b=>e&&e.te(`chartLabels.${b}`)&&e.t(`chartLabels.${b}`)||b),C=k.map(b=>b.id==="empty");return{labels:O,datasets:P,isLabelEmpty:C,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const KM=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),ZM=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return lh(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},QM=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return KM(o,l,e)};function JM(n,t){const{i18n:e}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||a,u=c&&c[0],h=r[u];let f=r&&h&&Object.keys(h).map(T=>({id:T,name:h[T].name}))||a.map(T=>({id:T,name:T}));u==="country_code"&&(f=f.map(T=>({...T,name:Xo(T.id)||T.name})));const m=t.value.meta.granularity_ms;if(typeof m!="number"||isNaN(m)||!isFinite(m)||m===0)return console.error("Invalid step value:",m),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const g=ZM(o),_=QM(o,l,m,g,s),x=new Set,v=s!=null&&s.length?s.reduce((T,P)=>{const O=new Date(P.timestamp).valueOf(),C=P.event;for(const p of a)x.add(p),O in T||(T[O]={}),p in T[O]||(T[O][p]={});for(const p of a)f.forEach(b=>{C[u]===b.id||p===b.id?(T[O][p]||(T[O][p]={}),T[O][p][b.name]=Math.round(Number(C[p])*1e3)/1e3):c.length||(T[O][p]||(T[O][p]={}),T[O][p][b.name]=Math.round(Number(C[b.id])*1e3)/1e3)});return T},{}):{},k=[...a.length===1?a.flatMap(T=>f.map(P=>[T,P.name,P.id==="empty"])):f.map(T=>[T.name,T.name,T.id==="empty"])].map(([T,P,O],C)=>{const p=_.map(R=>R in v&&T in v[R]?{x:R,y:v[R][T][P]||0}:{x:R,y:0});let{colorPalette:b,fill:S}=n;st(b)&&(b=on);const E=Qo(C,P,O,b);return{rawDimension:P,rawMetric:T,label:e&&e.te(`chartLabels.${P}`)&&e.t(`chartLabels.${P}`)||P,borderColor:E,backgroundColor:E,data:p,total:p.reduce((R,{y:I})=>R+Number(I),0),...Q1,fill:S,borderWidth:S?tM:J1,isSegmentEmpty:O}});return u==="status_code"||u==="status_code_grouped"?k.sort((T,P)=>(T.label??"")<(P.label??"")?-1:1):k.sort((T,P)=>Number(T.total)<Number(P.total)?-1:1),{datasets:k}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const tk=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function ek(){const{i18n:n}=mt.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 nk="analytics-query-provider",vf=2;function ik(){const n=d.inject(nk);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function ml(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const Mf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const sk=n=>n!=null,rk=Object.prototype.toString,ak=n=>rk.call(n)==="[object Object]";function ea(n){return Array.isArray(n)?n:[n]}function ok(n){return d.getCurrentInstance()}function lk(n,t={}){if(!d.isRef(n))return d.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=d.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=d.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const o=[...n.value];o[i]=s,n.value=o}else{const o={...n.value,[i]:s};Object.setPrototypeOf(o,Object.getPrototypeOf(n.value)),n.value=o}else n.value[i]=s}}));return e}function ck(n,t=!0,e){ok()?d.onMounted(n,e):t?n():d.nextTick(n)}function uk(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const na=Mf?window:void 0;function Ei(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Fs(...n){const t=[],e=()=>{t.forEach(o=>o()),t.length=0},i=(o,l,c,u)=>(o.addEventListener(l,c,u),()=>o.removeEventListener(l,c,u)),s=d.computed(()=>{const o=ea(d.toValue(n[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),r=uk(()=>{var o,l;return[(l=(o=s.value)==null?void 0:o.map(c=>Ei(c)))!=null?l:[na].filter(c=>c!=null),ea(d.toValue(s.value?n[1]:n[0])),ea(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([o,l,c,u])=>{if(e(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=ak(u)?{...u}:u;t.push(...o.flatMap(f=>l.flatMap(m=>c.map(g=>i(f,m,g,h)))))},{flush:"post"}),a=()=>{r(),e()};return ml(e),a}function dk(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function kf(n){const t=dk();return d.computed(()=>(t.value,!!n()))}function hk(n,t,e={}){const{window:i=na,...s}=e;let r;const a=kf(()=>i&&"MutationObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=ea(f).map(Ei).filter(sk);return new Set(m)}),c=d.watch(l,f=>{o(),a.value&&f.size&&(r=new MutationObserver(t),f.forEach(m=>r.observe(m,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),o()};return ml(h),{isSupported:a,stop:h,takeRecords:u}}function fk(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:a,onMove:o,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=na,containerElement:m,handle:g=n,buttons:_=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),v=d.ref(),M=C=>i?i.includes(C.pointerType):!0,k=C=>{d.toValue(s)&&C.preventDefault(),d.toValue(r)&&C.stopPropagation()},T=C=>{var p;if(!d.toValue(_).includes(C.button)||d.toValue(t.disabled)||!M(C)||d.toValue(a)&&C.target!==d.toValue(n))return;const b=d.toValue(m),S=(p=b==null?void 0:b.getBoundingClientRect)==null?void 0:p.call(b),E=d.toValue(n).getBoundingClientRect(),R={x:C.clientX-(b?E.left-S.left+b.scrollLeft:E.left),y:C.clientY-(b?E.top-S.top+b.scrollTop:E.top)};(c==null?void 0:c(R,C))!==!1&&(v.value=R,k(C))},P=C=>{if(d.toValue(t.disabled)||!M(C)||!v.value)return;const p=d.toValue(m),b=d.toValue(n).getBoundingClientRect();let{x:S,y:E}=x.value;(h==="x"||h==="both")&&(S=C.clientX-v.value.x,p&&(S=Math.min(Math.max(0,S),p.scrollWidth-b.width))),(h==="y"||h==="both")&&(E=C.clientY-v.value.y,p&&(E=Math.min(Math.max(0,E),p.scrollHeight-b.height))),x.value={x:S,y:E},o==null||o(x.value,C),k(C)},O=C=>{d.toValue(t.disabled)||!M(C)||v.value&&(v.value=void 0,l==null||l(x.value,C),k(C))};if(Mf){const C=()=>{var p;return{capture:(p=t.capture)!=null?p:!0,passive:!d.toValue(s)}};Fs(g,"pointerdown",T,C),Fs(f,"pointermove",P,C),Fs(f,"pointerup",O,C)}return{...lk(x),position:x,isDragging:d.computed(()=>!!v.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function mk(n,t,e={}){const{window:i=na,...s}=e;let r;const a=kf(()=>i&&"ResizeObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Ei(f)):[Ei(h)]}),c=d.watch(l,h=>{if(o(),a.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{o(),c()};return ml(u),{isSupported:a,stop:u}}function gk(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!0,updateTiming:a="sync"}=t,o=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function _(){const v=Ei(n);if(!v){e&&(o.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const M=v.getBoundingClientRect();o.value=M.height,l.value=M.bottom,c.value=M.left,u.value=M.right,h.value=M.top,f.value=M.width,m.value=M.x,g.value=M.y}function x(){a==="sync"?_():a==="next-frame"&&requestAnimationFrame(()=>_())}return mk(n,x),d.watch(()=>Ei(n),v=>!v&&x()),hk(n,x,{attributeFilter:["style","class"]}),s&&Fs("scroll",x,{capture:!0,passive:!0}),i&&Fs("resize",x,{passive:!0}),ck(()=>{r&&x()}),{height:o,bottom:l,left:c,right:u,top:h,width:f,x:m,y:g,update:x}}function pk(n,t){const{top:e,left:i}=gk(n),s=d.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=d.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const yk=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=e).sort((l,c)=>l-c),r=[];if(e-t<n-2)return[];const a=(e-t)/n;let o=0;for(let l=0;l<n;l++){const c=t+l*a,u=t+(l+1)*a;let h=0;for(;o<s.length&&s[o]>=c&&s[o]<=u;)h++,o++;r.push([Math.ceil(c),h])}return r},Sf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Bs=d.ref({}),bk=n=>(Bs.value[n]||(Bs.value[n]=Sf()),Bs.value[n]),_k=(n,t)=>{const e=Bs.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete Bs.value[t])};function xk({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:s=void 0,minCount:r=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:l}){const u=e!==void 0&&n!==void 0?bk(e):Sf(),h=n!==void 0?n:"static-chart-key",f=d.computed(()=>t.reduce((S,{timestamps:E})=>[...S,...E],[])),m=d.computed(()=>i||f.value.reduce((S,E)=>S===0?E:Math.min(S,E),0)),g=d.computed(()=>s||f.value.reduce((S,E)=>Math.max(S,E),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,o!==void 0&&(u.renderPoints[h]=o)});const _=d.computed(()=>Object.values(u.minStamps).reduce((S,E)=>S===0?E:Math.min(S,E),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((S,E)=>Math.max(S,E),0)),v=d.computed(()=>{const S=Object.values(u.renderPoints);return S.length===0?24:S.reduce((E,R)=>Math.max(E,R),2)}),M=d.computed(()=>{const S=x.value-_.value;return Math.ceil(S/v.value)}),k=d.computed(()=>t.length>1),T=d.computed(()=>t.map(({timestamps:S,color:E,label:R})=>({data:yk({bucketCount:v.value,minStamp:_.value,maxStamp:x.value,timestamps:S}).map(([j,Q])=>({x:j,y:Q})),label:R,...(l==="sparkline_bar"||k.value)&&E&&{backgroundColor:E},...l!=="sparkline_bar"&&E&&{borderColor:E},...k.value&&l!=="sparkline_bar"&&{fill:!0}}))),P=d.computed(()=>{var R,I;const S=((I=(R=T.value[0])==null?void 0:R.data)==null?void 0:I.length)??0,E=[];for(let B=0;B<S;B++){let j=0;for(let Q=0;Q<T.value.length;Q++)j+=T.value[Q].data[B].y;E.push(j)}return E}),O=d.computed(()=>{const S=P.value.reduce((E,R)=>Math.max(E,R),0);return Math.max(S,a??0)}),C=d.computed(()=>{const S=T.value.reduce((I,{data:B})=>[...I,...B.map(({y:j})=>j)],[]),E=S.length?S[0]:0,R=S.reduce((I,B)=>Math.min(I,B),E);return r===void 0?R:Math.min(R,r)});d.watchEffect(()=>{u.maxCounts[h]=O.value,u.minCounts[h]=C.value});const p=d.computed(()=>{const S=Object.values(u.minCounts),E=S.length?S[0]:0;return S.reduce((R,I)=>Math.min(R,I),E)}),b=d.computed(()=>Object.values(u.maxCounts).reduce((S,E)=>Math.max(S,E),0));return d.onUnmounted(()=>{n!==void 0&&e!==void 0&&_k(n,e)}),{syncedMinStamp:_,syncedMaxStamp:x,syncedRenderPoints:v,syncedChartDatasets:T,syncedGroupSizeMs:M,syncedMinCount:p,syncedMaxCount:b}}const mt={useBarChartOptions:HM,useChartJSCommon:YM,useChartLegendValues:$M,useChartSelectedRange:jM,useExploreResultToDatasets:GM,useExploreResultToTimeDataset:JM,useDonutChartOptions:UM,useLineChartOptions:qM,useI18n:Hm,useReportChartDataForSynthetics:tk,useTranslatedUnits:ek,useEvaluateFeatureFlag:ik,useTooltipAbsolutePosition:pk,useSparklineSync:xk};var we=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(we||{});/*!
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