@kong-ui-public/analytics-chart 1.1.4 → 1.1.6
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.
- package/dist/style.css +1 -1
- package/dist/types/components/chart-plugins/ChartLegend.vue.d.ts.map +1 -1
- package/dist/types/utils/commonOptions.d.ts +1 -0
- package/dist/types/utils/commonOptions.d.ts.map +1 -1
- package/dist/vitals-chart.es.js +1421 -1410
- package/dist/vitals-chart.umd.js +12 -12
- package/package.json +4 -4
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ct,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],h):(ct=typeof globalThis<"u"?globalThis:ct||self,h(ct["kong-ui-publicvitals-chart"]={},ct.Vue,ct["kong-ui-public-i18n"]))})(this,function(ct,h,rn){"use strict";var
|
|
1
|
+
(function(ct,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],h):(ct=typeof globalThis<"u"?globalThis:ct||self,h(ct["kong-ui-publicvitals-chart"]={},ct.Vue,ct["kong-ui-public-i18n"]))})(this,function(ct,h,rn){"use strict";var GS=Object.defineProperty;var KS=(ct,h,rn)=>h in ct?GS(ct,h,{enumerable:!0,configurable:!0,writable:!0,value:rn}):ct[h]=rn;var z=(ct,h,rn)=>(KS(ct,typeof h!="symbol"?h+"":h,rn),rn);var Tn,uh;const Dh={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Not all data is shown in the below report. Reports are currently limited to a maximum of {maxReturned} entities.",entityNoName:"no-name",debug:"debug",total:"Total",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}"},csvExport:{noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",defaultFilename:"Chart Export",exportPreview:"Export Preview",exportButton:"Export",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel"},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{Service:"Service",ServiceVersion:"Service Version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime Group",GatewayService:"Gateway Service",StatusCode:"Status Code",CodeClass:"Status Code (grouped)",Time:"Time",API_PRODUCT:"API Product",API_PRODUCT_VERSION:"API Product Version",RUNTIME_GROUP:"Runtime Group",GATEWAY_SERVICE:"Gateway Service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status Code",STATUS_CODE_GROUPED:"Status Code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request Count",RequestsPerMinute:"Requests per Minute",LatencyP99:"Response Latency (p99)",LatencyP95:"Response Latency (p95)",LatencyP50:"Response Latency (p50)",LatencyAverage:"Response Latency (avg)",UpstreamLatencyP99:"Upstream Latency (p99)",UpstreamLatencyP95:"Upstream Latency (p95)",UpstreamLatencyP50:"Upstream Latency (p50)",UpstreamLatencyAverage:"Upstream Latency (avg)",KongLatencyP99:"Kong Latency (p99)",KongLatencyP95:"Kong Latency (p95)",KongLatencyP50:"Kong Latency (p50)",KongLatencyAverage:"Kong Latency (avg)",ResponseSizeP99:"Response Size (p99)",ResponseSizeP95:"Response Size (p95)",ResponseSizeP50:"Response Size (p50)",RequestSizeP99:"Request Size (p99)",RequestSizeP95:"Request Size (p95)",RequestSizeP50:"Request Size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx",REQUEST_COUNT:"Request Count",REQUEST_PER_MINUTE:"Requests per Minute",RESPONSE_LATENCY_P99:"Response Latency",RESPONSE_LATENCY_P95:"Response Latency",RESPONSE_LATENCY_P50:"Response Latency",RESPONSE_SIZE_P99:"Response Size (p99)",RESPONSE_SIZE_P95:"Response Size (p95)",RESPONSE_SIZE_P50:"Response Size (p50)",REQUEST_SIZE_P99:"Request Size (p99)",REQUEST_SIZE_P95:"Request Size (p95)",REQUEST_SIZE_P50:"Request Size (p50)",CONTROL_PLANE:"Control Plane"},metricAxisTitles:{REQUEST_COUNT:"Request Count",REQUEST_PER_MINUTE:"Requests per Minute",RESPONSE_LATENCY_P99:"Response Latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response Latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response Latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response Size (p99) in {unit}",RESPONSE_SIZE_P95:"Response Size (p95) in {unit}",RESPONSE_SIZE_P50:"Response Size (p50) in {unit}",REQUEST_SIZE_P99:"Request Size (p99) in {unit}",REQUEST_SIZE_P95:"Request Size (p95) in {unit}",REQUEST_SIZE_P50:"Request Size (p50) in {unit}",TotalRequests:"Request Count",RequestsPerMinute:"Requests per Minute",LatencyP99:"Response Latency (p99) in {unit}",LatencyP95:"Response Latency (p95) in {unit}",LatencyP50:"Response Latency (p50) in {unit}",LatencyAverage:"Response Latency (avg) in {unit}",UpstreamLatencyP99:"Upstream Latency (p99) in {unit}",UpstreamLatencyP95:"Upstream Latency (p95) in {unit}",UpstreamLatencyP50:"Upstream Latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream Latency (avg) in {unit}",KongLatencyP99:"Kong Latency (p99) in {unit}",KongLatencyP95:"Kong Latency (p95) in {unit}",KongLatencyP50:"Kong Latency (p50) in {unit}",KongLatencyAverage:"Kong Latency (avg) in {unit}",ResponseSizeP99:"Response Size (p99) in {unit}",ResponseSizeP95:"Response Size (p95) in {unit}",ResponseSizeP50:"Response Size (p50) in {unit}",RequestSizeP99:"Request Size (p99) in {unit}",RequestSizeP95:"Request Size (p95) in {unit}",RequestSizeP50:"Request Size (p50) in {unit}"},granularityAxisTitles:{Minutely:"@timestamp per minute",Hourly:"@timestamp per hour",Daily:"@timestamp per day",Weekly:"@timestamp per week"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}}};function Mh(){const n=rn.createI18n("en-us",Dh);return{i18n:n,i18nT:rn.i18nTComponent(n)}}/*!
|
|
2
2
|
* @kurkle/color v0.3.2
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2023 Jukka Kurkela
|
|
@@ -8,37 +8,37 @@
|
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2023 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function He(){}const Xh=(()=>{let n=0;return()=>n++})();function it(n){return n===null||typeof n>"u"}function yt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function lt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Lt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function be(n,t){return Lt(n)?n:t}function nt(n,t){return typeof n>"u"?t:n}const Gh=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Cl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function _t(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function wt(n,t,e,i){let r,a,s;if(yt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;r<a;r++)t.call(e,n[r],r);else if(lt(n))for(s=Object.keys(n),a=s.length,r=0;r<a;r++)t.call(e,n[s[r]],s[r])}function hr(n,t){let e,i,r,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],a=t[e],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function gr(n){if(yt(n))return n.map(gr);if(lt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=gr(n[e[r]]);return t}return n}function kl(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Kh(n,t,e,i){if(!kl(n))return;const r=t[n],a=e[n];lt(r)&<(a)?vi(r,a,i):t[n]=gr(a)}function vi(n,t,e){const i=yt(t)?t:[t],r=i.length;if(!lt(n))return n;e=e||{};const a=e.merger||Kh;let s;for(let o=0;o<r;++o){if(s=i[o],!lt(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)a(l[c],n,s,e)}return n}function xi(n,t){return vi(n,t,{merger:Zh})}function Zh(n,t,e){if(!kl(n))return;const i=t[n],r=e[n];lt(i)&<(r)?xi(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=gr(r))}const Ol={"":n=>n,x:n=>n.x,y:n=>n.y};function Qh(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Jh(n){const t=Qh(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function on(n,t){return(Ol[t]||(Ol[t]=Jh(t)))(n)}function La(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ue=n=>typeof n<"u",de=n=>typeof n=="function",Pl=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function tg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ut=Math.PI,kt=2*ut,eg=kt+ut,pr=Number.POSITIVE_INFINITY,Ia=ut/180,Pt=ut/2,we=ut/4,mr=ut*2/3,ln=Math.log10,Le=Math.sign;function _i(n,t,e){return Math.abs(n-t)<e}function El(n){const t=Math.round(n);n=_i(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(ln(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function ng(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,a)=>r-a).pop(),t}function cn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ig(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Al(n,t,e){let i,r,a;for(i=0,r=n.length;i<r;i++)a=n[i][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function qt(n){return n*(ut/180)}function yr(n){return n*(180/ut)}function Rl(n){if(!Lt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Ll(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let a=Math.atan2(i,e);return a<-.5*ut&&(a+=kt),{angle:a,distance:r}}function Gn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function rg(n,t){return(n-t+eg)%kt-ut}function ve(n){return(n%kt+kt)%kt}function wi(n,t,e,i){const r=ve(n),a=ve(t),s=ve(e),o=ve(a-r),l=ve(s-r),c=ve(r-a),u=ve(r-s);return r===a||r===s||i&&a===s||o>l&&c<u}function Zt(n,t,e){return Math.max(t,Math.min(e,n))}function ag(n){return Zt(n,-32768,32767)}function $e(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Na(n,t,e){e=e||(s=>n[s]<t);let i=n.length-1,r=0,a;for(;i-r>1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const je=(n,t,e,i)=>Na(n,e,i?r=>{const a=n[r][t];return a<e||a===e&&n[r+1][t]===e}:r=>n[r][t]<e),sg=(n,t,e)=>Na(n,e,i=>n[i][t]>=e);function og(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Il=["push","pop","shift","splice","unshift"];function lg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Il.forEach(e=>{const i="_onData"+La(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=r.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...a)}),s}})})}function Nl(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Il.forEach(a=>{delete n[a]}),delete n._chartjs)}function Fl(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Ul=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Bl(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,Ul.call(window,()=>{i=!1,n.apply(t,e)}))}}function cg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Fa=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ug=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Yl(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:f}=s.getUserBounds();d&&(r=Zt(Math.min(je(o,l,c).lo,e?i:je(t,l,s.getPixelForValue(c)).lo),0,i-1)),f?a=Zt(Math.max(je(o,s.axis,u,!0).hi+1,e?0:je(t,l,s.getPixelForValue(u),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function Wl(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const br=n=>n===0||n===1,zl=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*kt/e)),Hl=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*kt/e)+1,Ti={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Pt)+1,easeOutSine:n=>Math.sin(n*Pt),easeInOutSine:n=>-.5*(Math.cos(ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>br(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>br(n)?n:zl(n,.075,.3),easeOutElastic:n=>br(n)?n:Hl(n,.075,.3),easeInOutElastic(n){return br(n)?n:n<.5?.5*zl(n*2,.1125,.45):.5+.5*Hl(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Ti.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ti.easeInBounce(n*2)*.5:Ti.easeOutBounce(n*2-1)*.5+.5};function Ua(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $l(n){return Ua(n)?n:new bi(n)}function Ba(n){return Ua(n)?n:new bi(n).saturate(.5).darken(.1).hexString()}const dg=["x","y","borderWidth","radius","tension"],fg=["color","borderColor","backgroundColor"];function hg(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:fg},numbers:{type:"number",properties:dg}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function gg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jl=new Map;function pg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=jl.get(e);return i||(i=new Intl.NumberFormat(n,t),jl.set(e,i)),i}function Di(n,t,e){return pg(t,e).format(n)}const Vl={values(n){return yt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(r="scientific"),a=mg(n,e)}const s=ln(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Di(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(ln(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Vl.numeric.call(this,n,t,e):""}};function mg(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var vr={formatters:Vl};function yg(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:vr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Cn=Object.create(null),Ya=Object.create(null);function Mi(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const a=e[i];n=n[a]||(n[a]=Object.create(null))}return n}function Wa(n,t,e){return typeof t=="string"?vi(Mi(n,t),e):vi(Mi(n,""),t)}class bg{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Ba(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ba(r.borderColor),this.hoverColor=(i,r)=>Ba(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Wa(this,t,e)}get(t){return Mi(this,t)}describe(t,e){return Wa(Ya,t,e)}override(t,e){return Wa(Cn,t,e)}route(t,e,i,r){const a=Mi(this,t),s=Mi(this,i),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[r];return lt(l)?Object.assign({},c,l):nt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Ft=new bg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[hg,gg,yg]);function vg(n){return!n||it(n.size)||it(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function xr(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function xg(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,f;for(l=0;l<o;l++)if(d=e[l],d!=null&&!yt(d))s=xr(n,r,a,s,d);else if(yt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!yt(f)&&(s=xr(n,r,a,s,f));n.restore();const g=a.length/2;if(g>e.length){for(l=0;l<g;l++)delete r[a[l]];a.splice(0,g)}return s}function kn(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function ql(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function za(n,t,e,i){Xl(n,t,e,i,null)}function Xl(n,t,e,i,r){let a,s,o,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,v=t.radius;let m=(p||0)*Ia;if(g&&typeof g=="object"&&(a=g.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(m),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(v)||v<=0)){switch(n.beginPath(),g){default:r?n.ellipse(e,i,r/2,v,0,0,kt):n.arc(e,i,v,0,kt),n.closePath();break;case"triangle":u=r?r/2:v,n.moveTo(e+Math.sin(m)*u,i-Math.cos(m)*v),m+=mr,n.lineTo(e+Math.sin(m)*u,i-Math.cos(m)*v),m+=mr,n.lineTo(e+Math.sin(m)*u,i-Math.cos(m)*v),n.closePath();break;case"rectRounded":c=v*.516,l=v-c,s=Math.cos(m+we)*l,d=Math.cos(m+we)*(r?r/2-c:l),o=Math.sin(m+we)*l,f=Math.sin(m+we)*(r?r/2-c:l),n.arc(e-d,i-o,c,m-ut,m-Pt),n.arc(e+f,i-s,c,m-Pt,m),n.arc(e+d,i+o,c,m,m+Pt),n.arc(e-f,i+s,c,m+Pt,m+ut),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*v,u=r?r/2:l,n.rect(e-u,i-l,2*u,2*l);break}m+=we;case"rectRot":d=Math.cos(m)*(r?r/2:v),s=Math.cos(m)*v,o=Math.sin(m)*v,f=Math.sin(m)*(r?r/2:v),n.moveTo(e-d,i-o),n.lineTo(e+f,i-s),n.lineTo(e+d,i+o),n.lineTo(e-f,i+s),n.closePath();break;case"crossRot":m+=we;case"cross":d=Math.cos(m)*(r?r/2:v),s=Math.cos(m)*v,o=Math.sin(m)*v,f=Math.sin(m)*(r?r/2:v),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s);break;case"star":d=Math.cos(m)*(r?r/2:v),s=Math.cos(m)*v,o=Math.sin(m)*v,f=Math.sin(m)*(r?r/2:v),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s),m+=we,d=Math.cos(m)*(r?r/2:v),s=Math.cos(m)*v,o=Math.sin(m)*v,f=Math.sin(m)*(r?r/2:v),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s);break;case"line":s=r?r/2:Math.cos(m)*v,o=Math.sin(m)*v,n.moveTo(e-s,i-o),n.lineTo(e+s,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(m)*(r?r/2:v),i+Math.sin(m)*v);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ve(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Si(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ci(n){n.restore()}function _g(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function wg(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Tg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),it(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Dg(n,t,e,i,r){if(r.strikethrough||r.underline){const a=n.measureText(i),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function Mg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function On(n,t,e,i,r,a={}){const s=yt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=r.string,Tg(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&Mg(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),it(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,i,a.maxWidth)),n.fillText(c,e,i,a.maxWidth),Dg(n,e,i,c,a),i+=Number(r.lineHeight);n.restore()}function Kn(n,t){const{x:e,y:i,w:r,h:a,radius:s}=t;n.arc(e+s.topLeft,i+s.topLeft,s.topLeft,1.5*ut,ut,!0),n.lineTo(e,i+a-s.bottomLeft),n.arc(e+s.bottomLeft,i+a-s.bottomLeft,s.bottomLeft,ut,Pt,!0),n.lineTo(e+r-s.bottomRight,i+a),n.arc(e+r-s.bottomRight,i+a-s.bottomRight,s.bottomRight,Pt,0,!0),n.lineTo(e+r,i+s.topRight),n.arc(e+r-s.topRight,i+s.topRight,s.topRight,0,-Pt,!0),n.lineTo(e+s.topLeft,i)}const Sg=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function kg(n,t){const e=(""+n).match(Sg);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Og=n=>+n||0;function Ha(n,t){const e={},i=lt(t),r=i?Object.keys(t):t,a=lt(n)?i?s=>nt(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of r)e[s]=Og(a(s));return e}function Gl(n){return Ha(n,{top:"y",right:"x",bottom:"y",left:"x"})}function un(n){return Ha(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Xt(n){const t=Gl(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Et(n,t){n=n||{},t=t||Ft.font;let e=nt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=nt(n.style,t.style);i&&!(""+i).match(Cg)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:nt(n.family,t.family),lineHeight:kg(nt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:nt(n.weight,t.weight),string:""};return r.string=vg(r),r}function ki(n,t,e,i){let r=!0,a,s,o;for(a=0,s=n.length;a<s;++a)if(o=n[a],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t),r=!1),e!==void 0&&yt(o)&&(o=o[e%o.length],r=!1),o!==void 0))return i&&!r&&(i.cacheable=!1),o}function Pg(n,t,e){const{min:i,max:r}=n,a=Cl(t,(r-i)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(i,-Math.abs(a)),max:s(r,a)}}function dn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e,i,r=()=>n[0]){const a=e||n;typeof i>"u"&&(i=tc("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:i,_getTarget:r,override:o=>$a([o,...n],t,a,i)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Zl(o,l,()=>Ug(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return ec(o).includes(l)},ownKeys(o){return ec(o)},set(o,l,c){const u=o._storage||(o._storage=r());return o[l]=u[l]=c,delete o._keys,!0}})}function Zn(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Kl(n,i),setContext:a=>Zn(n,a,e,i),override:a=>Zn(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Zl(a,s,()=>Ag(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(a,s,o){return n[s]=o,delete a[s],!0}})}function Kl(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:de(e)?e:()=>e,isIndexable:de(i)?i:()=>i}}const Eg=(n,t)=>n?n+La(t):t,ja=(n,t)=>lt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zl(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Ag(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=n;let o=i[t];return de(o)&&s.isScriptable(t)&&(o=Rg(t,o,n,e)),yt(o)&&o.length&&(o=Lg(t,o,n,s.isIndexable)),ja(t,o)&&(o=Zn(o,r,a&&a[t],s)),o}function Rg(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(a,s||i);return o.delete(n),ja(n,l)&&(l=Va(r._scopes,r,n,l)),l}function Lg(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&i(n))return t[a.index%t.length];if(lt(t[0])){const l=t,c=r._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Va(c,r,n,u);t.push(Zn(d,a,s&&s[n],o))}}return t}function Ql(n,t,e){return de(n)?n(t,e):n}const Ig=(n,t)=>n===!0?t:typeof n=="string"?on(t,n):void 0;function Ng(n,t,e,i,r){for(const a of t){const s=Ig(e,a);if(s){n.add(s);const o=Ql(s._fallback,e,r);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(s===!1&&typeof i<"u"&&e!==i)return null}return!1}function Va(n,t,e,i){const r=t._rootScopes,a=Ql(t._fallback,e,i),s=[...n,...r],o=new Set;o.add(i);let l=Jl(o,s,e,a||e,i);return l===null||typeof a<"u"&&a!==e&&(l=Jl(o,s,a,l,i),l===null)?!1:$a(Array.from(o),[""],r,a,()=>Fg(t,e,i))}function Jl(n,t,e,i,r){for(;e;)e=Ng(n,t,e,i,r);return e}function Fg(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return yt(r)&<(e)?e:r||{}}function Ug(n,t,e,i){let r;for(const a of t)if(r=tc(Eg(a,n),e),typeof r<"u")return ja(n,r)?Va(e,i,n,r):r}function tc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function ec(n){let t=n._keys;return t||(t=n._keys=Bg(n._scopes)),t}function Bg(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function nc(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,s=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],s[o]={r:r.parse(on(u,a),c)};return s}const Yg=Number.EPSILON||1e-14,Qn=(n,t)=>t<n.length&&!n[t].skip&&n[t],ic=n=>n==="x"?"y":"x";function Wg(n,t,e,i){const r=n.skip?t:n,a=t,s=e.skip?t:e,o=Gn(a,r),l=Gn(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:a.x-d*(s.x-r.x),y:a.y-d*(s.y-r.y)},next:{x:a.x+f*(s.x-r.x),y:a.y+f*(s.y-r.y)}}}function zg(n,t,e){const i=n.length;let r,a,s,o,l,c=Qn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=Qn(n,u+1),!(!l||!c)){if(_i(t[u],0,Yg)){e[u]=e[u+1]=0;continue}r=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(r,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=r*s*t[u],e[u+1]=a*s*t[u])}}function Hg(n,t,e="x"){const i=ic(e),r=n.length;let a,s,o,l=Qn(n,0);for(let c=0;c<r;++c){if(s=o,o=l,l=Qn(n,c+1),!o)continue;const u=o[e],d=o[i];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${i}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${i}`]=d+a*t[c])}}function $g(n,t="x"){const e=ic(t),i=n.length,r=Array(i).fill(0),a=Array(i);let s,o,l,c=Qn(n,0);for(s=0;s<i;++s)if(o=l,l=c,c=Qn(n,s+1),!!l){if(c){const u=c[t]-l[t];r[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Le(r[s-1])!==Le(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}zg(n,r,a),Hg(n,a,t)}function _r(n,t,e){return Math.max(Math.min(n,e),t)}function jg(n,t){let e,i,r,a,s,o=Ve(n[0],t);for(e=0,i=n.length;e<i;++e)s=a,a=o,o=e<i-1&&Ve(n[e+1],t),a&&(r=n[e],s&&(r.cp1x=_r(r.cp1x,t.left,t.right),r.cp1y=_r(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=_r(r.cp2x,t.left,t.right),r.cp2y=_r(r.cp2y,t.top,t.bottom)))}function Vg(n,t,e,i,r){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")$g(n,r);else{let c=i?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Wg(c,o,n[Math.min(a+1,s-(i?0:1))%s],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&jg(n,e)}function qa(){return typeof window<"u"&&typeof document<"u"}function Xa(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Tr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function qg(n,t){return Tr(n).getPropertyValue(t)}const Xg=["top","right","bottom","left"];function Pn(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=Xg[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Gg=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Kg(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let s=!1,o,l;if(Gg(r,a,n.target))o=r,l=a;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function fn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Tr(e),a=r.boxSizing==="border-box",s=Pn(r,"padding"),o=Pn(r,"border","width"),{x:l,y:c,box:u}=Kg(n,e),d=s.left+(u&&o.left),f=s.top+(u&&o.top);let{width:g,height:p}=t;return a&&(g-=s.width+o.width,p-=s.height+o.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Zg(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Xa(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=Tr(a),l=Pn(o,"border","width"),c=Pn(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,i=wr(o.maxWidth,a,"clientWidth"),r=wr(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||pr,maxHeight:r||pr}}const Dr=n=>Math.round(n*10)/10;function Qg(n,t,e,i){const r=Tr(n),a=Pn(r,"margin"),s=wr(r.maxWidth,n,"clientWidth")||pr,o=wr(r.maxHeight,n,"clientHeight")||pr,l=Zg(n,t,e);let{width:c,height:u}=l;if(r.boxSizing==="content-box"){const f=Pn(r,"border","width"),g=Pn(r,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-a.width),u=Math.max(0,i?c/i:u-a.height),c=Dr(Math.min(c,s,l.maxWidth)),u=Dr(Math.min(u,o,l.maxHeight)),c&&!u&&(u=Dr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Dr(Math.floor(u*i))),{width:c,height:u}}function rc(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const s=n.canvas;return s.style&&(e||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||s.height!==r||s.width!==a?(n.currentDevicePixelRatio=i,s.height=r,s.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Jg=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};qa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function ac(n,t){const e=qg(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function En(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function tp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function ep(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=En(n,r,e),o=En(r,a,e),l=En(a,t,e),c=En(s,o,e),u=En(o,l,e);return En(c,u,e)}const np=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},ip=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Jn(n,t,e){return n?np(t,e):ip()}function sc(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function oc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function lc(n){return n==="angle"?{between:wi,compare:rg,normalize:ve}:{between:$e,compare:(t,e)=>t-e,normalize:t=>t}}function cc({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function rp(n,t,e){const{property:i,start:r,end:a}=e,{between:s,normalize:o}=lc(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&s(o(t[c%l][i]),r,a);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function uc(n,t,e){if(!e)return[n];const{property:i,start:r,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=lc(i),{start:u,end:d,loop:f,style:g}=rp(n,t,e),p=[];let v=!1,m=null,y,x,_;const w=()=>l(r,_,y)&&o(r,_)!==0,M=()=>o(a,y)===0||l(a,_,y),C=()=>v||w(),k=()=>!v||M();for(let T=u,D=u;T<=d;++T)x=t[T%s],!x.skip&&(y=c(x[i]),y!==_&&(v=l(y,r,a),m===null&&C()&&(m=o(y,r)===0?T:D),m!==null&&k()&&(p.push(cc({start:m,end:T,loop:f,count:s,style:g})),m=null),D=T,_=y));return m!==null&&p.push(cc({start:m,end:d,loop:f,count:s,style:g})),p}function dc(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const a=uc(i[r],n.points,t);a.length&&e.push(...a)}return e}function ap(n,t,e,i){let r=0,a=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(a+=r);a>r&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function sp(n,t,e,i){const r=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%r];c.skip||c.stop?o.skip||(i=!1,a.push({start:t%r,end:(l-1)%r,loop:i}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%r,end:s%r,loop:i}),a}function op(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:s,end:o}=ap(e,r,a,i);if(i===!0)return fc(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+r:o,c=!!n._fullLoop&&s===0&&o===r-1;return fc(n,sp(e,s,l,c),e,t)}function fc(n,t,e,i){return!i||!i.setContext||!e?t:lp(n,t,e,i)}function lp(n,t,e,i){const r=n._chart.getContext(),a=hc(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,f=d;function g(p,v,m,y){const x=o?-1:1;if(p!==v){for(p+=l;e[p%l].skip;)p-=x;for(;e[v%l].skip;)v+=x;p%l!==v%l&&(c.push({start:p%l,end:v%l,loop:m,style:y}),u=y,d=v%l)}}for(const p of t){d=o?d:p.start;let v=e[d%l],m;for(f=d+1;f<=p.end;f++){const y=e[f%l];m=hc(i.setContext(dn(r,{type:"segment",p0:v,p1:y,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),cp(m,u)&&g(d,f-1,p.loop,u),v=y,u=m}d<f-1&&g(d,f-1,p.loop,u)}return c}function hc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function cp(n,t){if(!t)return!1;const e=[],i=function(r,a){return Ua(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
11
|
+
*/function He(){}const Xh=(()=>{let n=0;return()=>n++})();function it(n){return n===null||typeof n>"u"}function yt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function lt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Lt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function be(n,t){return Lt(n)?n:t}function nt(n,t){return typeof n>"u"?t:n}const Gh=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Cl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function _t(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function wt(n,t,e,i){let r,a,s;if(yt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;r<a;r++)t.call(e,n[r],r);else if(lt(n))for(s=Object.keys(n),a=s.length,r=0;r<a;r++)t.call(e,n[s[r]],s[r])}function hr(n,t){let e,i,r,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],a=t[e],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function gr(n){if(yt(n))return n.map(gr);if(lt(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=gr(n[e[r]]);return t}return n}function kl(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Kh(n,t,e,i){if(!kl(n))return;const r=t[n],a=e[n];lt(r)&<(a)?vi(r,a,i):t[n]=gr(a)}function vi(n,t,e){const i=yt(t)?t:[t],r=i.length;if(!lt(n))return n;e=e||{};const a=e.merger||Kh;let s;for(let o=0;o<r;++o){if(s=i[o],!lt(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)a(l[c],n,s,e)}return n}function xi(n,t){return vi(n,t,{merger:Zh})}function Zh(n,t,e){if(!kl(n))return;const i=t[n],r=e[n];lt(i)&<(r)?xi(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=gr(r))}const Ol={"":n=>n,x:n=>n.x,y:n=>n.y};function Qh(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Jh(n){const t=Qh(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function on(n,t){return(Ol[t]||(Ol[t]=Jh(t)))(n)}function La(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ue=n=>typeof n<"u",de=n=>typeof n=="function",Pl=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function tg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ut=Math.PI,kt=2*ut,eg=kt+ut,pr=Number.POSITIVE_INFINITY,Ia=ut/180,Pt=ut/2,we=ut/4,mr=ut*2/3,ln=Math.log10,Le=Math.sign;function _i(n,t,e){return Math.abs(n-t)<e}function El(n){const t=Math.round(n);n=_i(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(ln(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function ng(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,a)=>r-a).pop(),t}function cn(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ig(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Al(n,t,e){let i,r,a;for(i=0,r=n.length;i<r;i++)a=n[i][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function qt(n){return n*(ut/180)}function yr(n){return n*(180/ut)}function Rl(n){if(!Lt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Ll(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let a=Math.atan2(i,e);return a<-.5*ut&&(a+=kt),{angle:a,distance:r}}function Gn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function rg(n,t){return(n-t+eg)%kt-ut}function ve(n){return(n%kt+kt)%kt}function wi(n,t,e,i){const r=ve(n),a=ve(t),s=ve(e),o=ve(a-r),l=ve(s-r),c=ve(r-a),u=ve(r-s);return r===a||r===s||i&&a===s||o>l&&c<u}function Zt(n,t,e){return Math.max(t,Math.min(e,n))}function ag(n){return Zt(n,-32768,32767)}function $e(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Na(n,t,e){e=e||(s=>n[s]<t);let i=n.length-1,r=0,a;for(;i-r>1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const je=(n,t,e,i)=>Na(n,e,i?r=>{const a=n[r][t];return a<e||a===e&&n[r+1][t]===e}:r=>n[r][t]<e),sg=(n,t,e)=>Na(n,e,i=>n[i][t]>=e);function og(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const Il=["push","pop","shift","splice","unshift"];function lg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Il.forEach(e=>{const i="_onData"+La(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=r.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...a)}),s}})})}function Nl(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(Il.forEach(a=>{delete n[a]}),delete n._chartjs)}function Fl(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Ul=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Bl(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,Ul.call(window,()=>{i=!1,n.apply(t,e)}))}}function cg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Fa=n=>n==="start"?"left":n==="end"?"right":"center",ie=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ug=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Yl(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:f}=s.getUserBounds();d&&(r=Zt(Math.min(je(o,l,c).lo,e?i:je(t,l,s.getPixelForValue(c)).lo),0,i-1)),f?a=Zt(Math.max(je(o,s.axis,u,!0).hi+1,e?0:je(t,l,s.getPixelForValue(u),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function Wl(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const br=n=>n===0||n===1,zl=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*kt/e)),Hl=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*kt/e)+1,Ti={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Pt)+1,easeOutSine:n=>Math.sin(n*Pt),easeInOutSine:n=>-.5*(Math.cos(ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>br(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>br(n)?n:zl(n,.075,.3),easeOutElastic:n=>br(n)?n:Hl(n,.075,.3),easeInOutElastic(n){return br(n)?n:n<.5?.5*zl(n*2,.1125,.45):.5+.5*Hl(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Ti.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Ti.easeInBounce(n*2)*.5:Ti.easeOutBounce(n*2-1)*.5+.5};function Ua(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $l(n){return Ua(n)?n:new bi(n)}function Ba(n){return Ua(n)?n:new bi(n).saturate(.5).darken(.1).hexString()}const dg=["x","y","borderWidth","radius","tension"],fg=["color","borderColor","backgroundColor"];function hg(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:fg},numbers:{type:"number",properties:dg}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function gg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jl=new Map;function pg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=jl.get(e);return i||(i=new Intl.NumberFormat(n,t),jl.set(e,i)),i}function Di(n,t,e){return pg(t,e).format(n)}const Vl={values(n){return yt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(r="scientific"),a=mg(n,e)}const s=ln(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Di(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(ln(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Vl.numeric.call(this,n,t,e):""}};function mg(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var vr={formatters:Vl};function yg(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:vr.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Cn=Object.create(null),Ya=Object.create(null);function Mi(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const a=e[i];n=n[a]||(n[a]=Object.create(null))}return n}function Wa(n,t,e){return typeof t=="string"?vi(Mi(n,t),e):vi(Mi(n,""),t)}class bg{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Ba(r.backgroundColor),this.hoverBorderColor=(i,r)=>Ba(r.borderColor),this.hoverColor=(i,r)=>Ba(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Wa(this,t,e)}get(t){return Mi(this,t)}describe(t,e){return Wa(Ya,t,e)}override(t,e){return Wa(Cn,t,e)}route(t,e,i,r){const a=Mi(this,t),s=Mi(this,i),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[r];return lt(l)?Object.assign({},c,l):nt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Ft=new bg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[hg,gg,yg]);function vg(n){return!n||it(n.size)||it(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function xr(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function xg(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,f;for(l=0;l<o;l++)if(d=e[l],d!=null&&!yt(d))s=xr(n,r,a,s,d);else if(yt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!yt(f)&&(s=xr(n,r,a,s,f));n.restore();const g=a.length/2;if(g>e.length){for(l=0;l<g;l++)delete r[a[l]];a.splice(0,g)}return s}function kn(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function ql(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function za(n,t,e,i){Xl(n,t,e,i,null)}function Xl(n,t,e,i,r){let a,s,o,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,x=t.radius;let m=(p||0)*Ia;if(g&&typeof g=="object"&&(a=g.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(m),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(x)||x<=0)){switch(n.beginPath(),g){default:r?n.ellipse(e,i,r/2,x,0,0,kt):n.arc(e,i,x,0,kt),n.closePath();break;case"triangle":u=r?r/2:x,n.moveTo(e+Math.sin(m)*u,i-Math.cos(m)*x),m+=mr,n.lineTo(e+Math.sin(m)*u,i-Math.cos(m)*x),m+=mr,n.lineTo(e+Math.sin(m)*u,i-Math.cos(m)*x),n.closePath();break;case"rectRounded":c=x*.516,l=x-c,s=Math.cos(m+we)*l,d=Math.cos(m+we)*(r?r/2-c:l),o=Math.sin(m+we)*l,f=Math.sin(m+we)*(r?r/2-c:l),n.arc(e-d,i-o,c,m-ut,m-Pt),n.arc(e+f,i-s,c,m-Pt,m),n.arc(e+d,i+o,c,m,m+Pt),n.arc(e-f,i+s,c,m+Pt,m+ut),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*x,u=r?r/2:l,n.rect(e-u,i-l,2*u,2*l);break}m+=we;case"rectRot":d=Math.cos(m)*(r?r/2:x),s=Math.cos(m)*x,o=Math.sin(m)*x,f=Math.sin(m)*(r?r/2:x),n.moveTo(e-d,i-o),n.lineTo(e+f,i-s),n.lineTo(e+d,i+o),n.lineTo(e-f,i+s),n.closePath();break;case"crossRot":m+=we;case"cross":d=Math.cos(m)*(r?r/2:x),s=Math.cos(m)*x,o=Math.sin(m)*x,f=Math.sin(m)*(r?r/2:x),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s);break;case"star":d=Math.cos(m)*(r?r/2:x),s=Math.cos(m)*x,o=Math.sin(m)*x,f=Math.sin(m)*(r?r/2:x),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s),m+=we,d=Math.cos(m)*(r?r/2:x),s=Math.cos(m)*x,o=Math.sin(m)*x,f=Math.sin(m)*(r?r/2:x),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+f,i-s),n.lineTo(e-f,i+s);break;case"line":s=r?r/2:Math.cos(m)*x,o=Math.sin(m)*x,n.moveTo(e-s,i-o),n.lineTo(e+s,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(m)*(r?r/2:x),i+Math.sin(m)*x);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ve(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function Si(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ci(n){n.restore()}function _g(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function wg(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Tg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),it(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Dg(n,t,e,i,r){if(r.strikethrough||r.underline){const a=n.measureText(i),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function Mg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function On(n,t,e,i,r,a={}){const s=yt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=r.string,Tg(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&Mg(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),it(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,i,a.maxWidth)),n.fillText(c,e,i,a.maxWidth),Dg(n,e,i,c,a),i+=Number(r.lineHeight);n.restore()}function Kn(n,t){const{x:e,y:i,w:r,h:a,radius:s}=t;n.arc(e+s.topLeft,i+s.topLeft,s.topLeft,1.5*ut,ut,!0),n.lineTo(e,i+a-s.bottomLeft),n.arc(e+s.bottomLeft,i+a-s.bottomLeft,s.bottomLeft,ut,Pt,!0),n.lineTo(e+r-s.bottomRight,i+a),n.arc(e+r-s.bottomRight,i+a-s.bottomRight,s.bottomRight,Pt,0,!0),n.lineTo(e+r,i+s.topRight),n.arc(e+r-s.topRight,i+s.topRight,s.topRight,0,-Pt,!0),n.lineTo(e+s.topLeft,i)}const Sg=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function kg(n,t){const e=(""+n).match(Sg);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Og=n=>+n||0;function Ha(n,t){const e={},i=lt(t),r=i?Object.keys(t):t,a=lt(n)?i?s=>nt(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of r)e[s]=Og(a(s));return e}function Gl(n){return Ha(n,{top:"y",right:"x",bottom:"y",left:"x"})}function un(n){return Ha(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Xt(n){const t=Gl(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Et(n,t){n=n||{},t=t||Ft.font;let e=nt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=nt(n.style,t.style);i&&!(""+i).match(Cg)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:nt(n.family,t.family),lineHeight:kg(nt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:nt(n.weight,t.weight),string:""};return r.string=vg(r),r}function ki(n,t,e,i){let r=!0,a,s,o;for(a=0,s=n.length;a<s;++a)if(o=n[a],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t),r=!1),e!==void 0&&yt(o)&&(o=o[e%o.length],r=!1),o!==void 0))return i&&!r&&(i.cacheable=!1),o}function Pg(n,t,e){const{min:i,max:r}=n,a=Cl(t,(r-i)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(i,-Math.abs(a)),max:s(r,a)}}function dn(n,t){return Object.assign(Object.create(n),t)}function $a(n,t=[""],e,i,r=()=>n[0]){const a=e||n;typeof i>"u"&&(i=tc("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:i,_getTarget:r,override:o=>$a([o,...n],t,a,i)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Zl(o,l,()=>Ug(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return ec(o).includes(l)},ownKeys(o){return ec(o)},set(o,l,c){const u=o._storage||(o._storage=r());return o[l]=u[l]=c,delete o._keys,!0}})}function Zn(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Kl(n,i),setContext:a=>Zn(n,a,e,i),override:a=>Zn(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Zl(a,s,()=>Ag(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(a,s,o){return n[s]=o,delete a[s],!0}})}function Kl(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:de(e)?e:()=>e,isIndexable:de(i)?i:()=>i}}const Eg=(n,t)=>n?n+La(t):t,ja=(n,t)=>lt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zl(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Ag(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=n;let o=i[t];return de(o)&&s.isScriptable(t)&&(o=Rg(t,o,n,e)),yt(o)&&o.length&&(o=Lg(t,o,n,s.isIndexable)),ja(t,o)&&(o=Zn(o,r,a&&a[t],s)),o}function Rg(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(a,s||i);return o.delete(n),ja(n,l)&&(l=Va(r._scopes,r,n,l)),l}function Lg(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&i(n))return t[a.index%t.length];if(lt(t[0])){const l=t,c=r._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Va(c,r,n,u);t.push(Zn(d,a,s&&s[n],o))}}return t}function Ql(n,t,e){return de(n)?n(t,e):n}const Ig=(n,t)=>n===!0?t:typeof n=="string"?on(t,n):void 0;function Ng(n,t,e,i,r){for(const a of t){const s=Ig(e,a);if(s){n.add(s);const o=Ql(s._fallback,e,r);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(s===!1&&typeof i<"u"&&e!==i)return null}return!1}function Va(n,t,e,i){const r=t._rootScopes,a=Ql(t._fallback,e,i),s=[...n,...r],o=new Set;o.add(i);let l=Jl(o,s,e,a||e,i);return l===null||typeof a<"u"&&a!==e&&(l=Jl(o,s,a,l,i),l===null)?!1:$a(Array.from(o),[""],r,a,()=>Fg(t,e,i))}function Jl(n,t,e,i,r){for(;e;)e=Ng(n,t,e,i,r);return e}function Fg(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return yt(r)&<(e)?e:r||{}}function Ug(n,t,e,i){let r;for(const a of t)if(r=tc(Eg(a,n),e),typeof r<"u")return ja(n,r)?Va(e,i,n,r):r}function tc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function ec(n){let t=n._keys;return t||(t=n._keys=Bg(n._scopes)),t}function Bg(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function nc(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,s=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],s[o]={r:r.parse(on(u,a),c)};return s}const Yg=Number.EPSILON||1e-14,Qn=(n,t)=>t<n.length&&!n[t].skip&&n[t],ic=n=>n==="x"?"y":"x";function Wg(n,t,e,i){const r=n.skip?t:n,a=t,s=e.skip?t:e,o=Gn(a,r),l=Gn(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:a.x-d*(s.x-r.x),y:a.y-d*(s.y-r.y)},next:{x:a.x+f*(s.x-r.x),y:a.y+f*(s.y-r.y)}}}function zg(n,t,e){const i=n.length;let r,a,s,o,l,c=Qn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=Qn(n,u+1),!(!l||!c)){if(_i(t[u],0,Yg)){e[u]=e[u+1]=0;continue}r=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(r,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=r*s*t[u],e[u+1]=a*s*t[u])}}function Hg(n,t,e="x"){const i=ic(e),r=n.length;let a,s,o,l=Qn(n,0);for(let c=0;c<r;++c){if(s=o,o=l,l=Qn(n,c+1),!o)continue;const u=o[e],d=o[i];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${i}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${i}`]=d+a*t[c])}}function $g(n,t="x"){const e=ic(t),i=n.length,r=Array(i).fill(0),a=Array(i);let s,o,l,c=Qn(n,0);for(s=0;s<i;++s)if(o=l,l=c,c=Qn(n,s+1),!!l){if(c){const u=c[t]-l[t];r[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Le(r[s-1])!==Le(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}zg(n,r,a),Hg(n,a,t)}function _r(n,t,e){return Math.max(Math.min(n,e),t)}function jg(n,t){let e,i,r,a,s,o=Ve(n[0],t);for(e=0,i=n.length;e<i;++e)s=a,a=o,o=e<i-1&&Ve(n[e+1],t),a&&(r=n[e],s&&(r.cp1x=_r(r.cp1x,t.left,t.right),r.cp1y=_r(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=_r(r.cp2x,t.left,t.right),r.cp2y=_r(r.cp2y,t.top,t.bottom)))}function Vg(n,t,e,i,r){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")$g(n,r);else{let c=i?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Wg(c,o,n[Math.min(a+1,s-(i?0:1))%s],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&jg(n,e)}function qa(){return typeof window<"u"&&typeof document<"u"}function Xa(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Tr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function qg(n,t){return Tr(n).getPropertyValue(t)}const Xg=["top","right","bottom","left"];function Pn(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=Xg[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Gg=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Kg(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let s=!1,o,l;if(Gg(r,a,n.target))o=r,l=a;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function fn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Tr(e),a=r.boxSizing==="border-box",s=Pn(r,"padding"),o=Pn(r,"border","width"),{x:l,y:c,box:u}=Kg(n,e),d=s.left+(u&&o.left),f=s.top+(u&&o.top);let{width:g,height:p}=t;return a&&(g-=s.width+o.width,p-=s.height+o.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Zg(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Xa(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=Tr(a),l=Pn(o,"border","width"),c=Pn(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,i=wr(o.maxWidth,a,"clientWidth"),r=wr(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||pr,maxHeight:r||pr}}const Dr=n=>Math.round(n*10)/10;function Qg(n,t,e,i){const r=Tr(n),a=Pn(r,"margin"),s=wr(r.maxWidth,n,"clientWidth")||pr,o=wr(r.maxHeight,n,"clientHeight")||pr,l=Zg(n,t,e);let{width:c,height:u}=l;if(r.boxSizing==="content-box"){const f=Pn(r,"border","width"),g=Pn(r,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-a.width),u=Math.max(0,i?c/i:u-a.height),c=Dr(Math.min(c,s,l.maxWidth)),u=Dr(Math.min(u,o,l.maxHeight)),c&&!u&&(u=Dr(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=Dr(Math.floor(u*i))),{width:c,height:u}}function rc(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const s=n.canvas;return s.style&&(e||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||s.height!==r||s.width!==a?(n.currentDevicePixelRatio=i,s.height=r,s.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Jg=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};qa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function ac(n,t){const e=qg(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function En(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function tp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function ep(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=En(n,r,e),o=En(r,a,e),l=En(a,t,e),c=En(s,o,e),u=En(o,l,e);return En(c,u,e)}const np=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},ip=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Jn(n,t,e){return n?np(t,e):ip()}function sc(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function oc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function lc(n){return n==="angle"?{between:wi,compare:rg,normalize:ve}:{between:$e,compare:(t,e)=>t-e,normalize:t=>t}}function cc({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function rp(n,t,e){const{property:i,start:r,end:a}=e,{between:s,normalize:o}=lc(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&s(o(t[c%l][i]),r,a);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function uc(n,t,e){if(!e)return[n];const{property:i,start:r,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=lc(i),{start:u,end:d,loop:f,style:g}=rp(n,t,e),p=[];let x=!1,m=null,b,v,_;const w=()=>l(r,_,b)&&o(r,_)!==0,M=()=>o(a,b)===0||l(a,_,b),C=()=>x||w(),k=()=>!x||M();for(let T=u,D=u;T<=d;++T)v=t[T%s],!v.skip&&(b=c(v[i]),b!==_&&(x=l(b,r,a),m===null&&C()&&(m=o(b,r)===0?T:D),m!==null&&k()&&(p.push(cc({start:m,end:T,loop:f,count:s,style:g})),m=null),D=T,_=b));return m!==null&&p.push(cc({start:m,end:d,loop:f,count:s,style:g})),p}function dc(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const a=uc(i[r],n.points,t);a.length&&e.push(...a)}return e}function ap(n,t,e,i){let r=0,a=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(a+=r);a>r&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function sp(n,t,e,i){const r=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%r];c.skip||c.stop?o.skip||(i=!1,a.push({start:t%r,end:(l-1)%r,loop:i}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%r,end:s%r,loop:i}),a}function op(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:s,end:o}=ap(e,r,a,i);if(i===!0)return fc(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+r:o,c=!!n._fullLoop&&s===0&&o===r-1;return fc(n,sp(e,s,l,c),e,t)}function fc(n,t,e,i){return!i||!i.setContext||!e?t:lp(n,t,e,i)}function lp(n,t,e,i){const r=n._chart.getContext(),a=hc(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,f=d;function g(p,x,m,b){const v=o?-1:1;if(p!==x){for(p+=l;e[p%l].skip;)p-=v;for(;e[x%l].skip;)x+=v;p%l!==x%l&&(c.push({start:p%l,end:x%l,loop:m,style:b}),u=b,d=x%l)}}for(const p of t){d=o?d:p.start;let x=e[d%l],m;for(f=d+1;f<=p.end;f++){const b=e[f%l];m=hc(i.setContext(dn(r,{type:"segment",p0:x,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),cp(m,u)&&g(d,f-1,p.loop,u),x=b,u=m}d<f-1&&g(d,f-1,p.loop,u)}return c}function hc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function cp(n,t){if(!t)return!1;const e=[],i=function(r,a){return Ua(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
12
12
|
* Chart.js v4.4.1
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2023 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class up{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const a=e.listeners[r],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Ul.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.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,r)=>Math.max(i,r._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 r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var qe=new up;const gc="transparent",dp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=$l(n||gc),r=i.valid&&$l(t||gc);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class fp{constructor(t,e,i,r){const a=e[i];r=ki([t.to,r,a,t.from]);const s=ki([t.from,a,r]);this._active=!0,this._fn=t.fn||dp[t.type||typeof s],this._easing=Ti[t.easing]||Ti.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=s,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ki([t.to,e,r,t.from]),this._from=ki([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<i),!this._active){this._target[r]=o,this._notify(!0);return}if(e<0){this._target[r]=a;return}l=e/i%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(a,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 r=0;r<i.length;r++)i[r][e]()}}class Ga{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!lt(t))return;const e=Object.keys(Ft.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const a=t[r];if(!lt(a))return;const s={};for(const o of e)s[o]=a[o];(yt(a.properties)&&a.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,s)})})}_animateOptions(t,e){const i=e.options,r=gp(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&hp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}a[c]=d=new fp(f,t,c,u),r.push(d)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return qe.add(this._chart,i),!0}}function hp(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const a=n[i[r]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function gp(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 pc(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:i?a:r,end:i?r:a}}function pp(n,t,e){if(e===!1)return!1;const i=pc(n,e),r=pc(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function mp(n){let t,e,i,r;return lt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function mc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,a;for(r=0,a=i.length;r<a;++r)e.push(i[r].index);return e}function yc(n,t,e,i={}){const r=n.keys,a=i.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=r.length;s<o;++s){if(l=+r[s],l===e){if(i.all)continue;break}c=n.values[l],Lt(c)&&(a||t===0||Le(t)===Le(c))&&(t+=c)}return t}}function yp(n){const t=Object.keys(n),e=new Array(t.length);let i,r,a;for(i=0,r=t.length;i<r;++i)a=t[i],e[i]={x:a,y:n[a]};return e}function bc(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function bp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function vp(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function xp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function vc(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const a=n[r.index];if(e&&a>0||!e&&a<0)return r.index}return null}function xc(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=i,l=a.axis,c=s.axis,u=bp(a,s,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:v,[c]:m}=p,y=p._stacks||(p._stacks={});f=y[c]=xp(r,u,v),f[o]=m,f._top=vc(f,s,!0,i.type),f._bottom=vc(f,s,!1,i.type);const x=f._visualValues||(f._visualValues={});x[o]=m}}function Ka(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function _p(n,t){return dn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function wp(n,t,e){return dn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Oi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const Za=n=>n==="reset"||n==="none",_c=(n,t)=>t?n:Object.assign({},n),Tp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:mc(e,!0),values:null};class Oe{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=bc(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&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,a=e.xAxisID=nt(i.xAxisID,Ka(t,"x")),s=e.yAxisID=nt(i.yAxisID,Ka(t,"y")),o=e.rAxisID=nt(i.rAxisID,Ka(t,"r")),l=e.indexAxis,c=e.iAxisID=r(l,a,s,o),u=e.vAxisID=r(l,s,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),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&&Nl(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(lt(e))this._data=yp(e);else if(i!==e){if(i){Nl(i,this);const r=this._cachedMeta;Oi(r),r._parsed=[]}e&&Object.isExtensible(e)&&lg(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 r=!1;this._dataCheck();const a=e._stacked;e._stacked=bc(e.vScale,e),e.stack!==i.stack&&(r=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&xc(this,e._parsed)}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:r}=this,{iScale:a,_stacked:s}=i,o=a.axis;let l=t===0&&e===r.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{yt(r[t])?f=this.parseArrayData(i,r,t,e):lt(r[t])?f=this.parseObjectData(i,r,t,e):f=this.parsePrimitiveData(i,r,t,e);const g=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}s&&xc(this,f)}parsePrimitiveData(t,e,i,r){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(r);let f,g,p;for(f=0,g=r;f<g;++f)p=f+i,d[f]={[o]:u||a.parse(c[p],p),[l]:s.parse(e[p],p)};return d}parseArrayData(t,e,i,r){const{xScale:a,yScale:s}=t,o=new Array(r);let l,c,u,d;for(l=0,c=r;l<c;++l)u=l+i,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,i,r){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(r);let u,d,f,g;for(u=0,d=r;u<d;++u)f=u+i,g=e[f],c[u]={x:a.parse(on(g,o),f),y:s.parse(on(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:mc(r,!0),values:e._stacks[t.axis]._visualValues};return yc(o,s,a.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const a=i[e.axis];let s=a===null?NaN:a;const o=r&&i._stacks[e.axis];r&&o&&(r.values=o,s=yc(r,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,a=i._sorted&&t===i.iScale,s=r.length,o=this._getOtherScale(t),l=Tp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=vp(o);let f,g;function p(){g=r[f];const v=g[o.axis];return!Lt(g[t.axis])||u>v||d<v}for(f=0;f<s&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),a));++f);if(a){for(f=s-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,s;for(r=0,a=e.length;r<a;++r)s=e[r][t.axis],Lt(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=mp(nt(this.options.clip,pp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=r[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,a))}for(u=0;u<s.length;++u)s[u].draw(t,a)}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 r=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=wp(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=_p(this.chart.getContext(),this.index)),a.dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}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 r=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&ue(i);if(o)return _c(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=r?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Ft.elements[t]),p=()=>this.getContext(i,r,e),v=c.resolveNamedOptions(f,g,p,d);return v.$shared&&(v.$shared=l,a[s]=Object.freeze(_c(v,l))),v}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(r.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Ga(r,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Za(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),s=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:s}}updateElement(t,e,i,r){Za(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Za(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}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 r=i.length,a=e.length,s=Math.min(a,r);s&&this.parse(0,s),a>r?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){const r=this._cachedMeta,a=r.data,s=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=s;o--)c[o]=c[o-e]};for(l(a),o=t;o<s;++o)a[o]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Oi(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}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])}}z(Oe,"defaults",{}),z(Oe,"datasetElementType",null),z(Oe,"dataElementType",null);function Dp(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,a=e.length;r<a;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Fl(i.sort((r,a)=>r-a))}return n._cache.$bar}function Mp(n){const t=n.iScale,e=Dp(t,n.type);let i=t._length,r,a,s,o;const l=()=>{s===32767||s===-32768||(ue(o)&&(i=Math.min(i,Math.abs(s-o)||i)),o=s)};for(r=0,a=e.length;r<a;++r)s=t.getPixelForValue(e[r]),l();for(o=void 0,r=0,a=t.ticks.length;r<a;++r)s=t.getPixelForTick(r),l();return i}function Sp(n,t,e,i){const r=e.barThickness;let a,s;return it(r)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=r*i,s=1),{chunk:a/i,ratio:s,start:t.pixels[n]-a/2}}function Cp(n,t,e,i){const r=t.pixels,a=r[n];let s=n>0?r[n-1]:null,o=n<r.length-1?r[n+1]:null;const l=e.categoryPercentage;s===null&&(s=a-(o===null?t.end-t.start:o-a)),o===null&&(o=a+a-s);const c=a-(a-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/i,ratio:e.barPercentage,start:c}}function kp(n,t,e,i){const r=e.parse(n[0],i),a=e.parse(n[1],i),s=Math.min(r,a),o=Math.max(r,a);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:r,end:a,min:s,max:o}}function wc(n,t,e,i){return yt(n)?kp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Tc(n,t,e,i){const r=n.iScale,a=n.vScale,s=r.getLabels(),o=r===a,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[r.axis]=o||r.parse(s[c],c),l.push(wc(f,d,a,c));return l}function Qa(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Op(n,t,e){return n!==0?Le(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pp(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",a="start"):(r="start",a="end"),{start:e,end:i,reverse:t,top:r,bottom:a}}function Ep(n,t,e,i){let r=t.borderSkipped;const a={};if(!r){n.borderSkipped=a;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Pp(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=c:(e._bottom||0)===i?r=u:(a[Dc(u,s,o,l)]=!0,r=c)),a[Dc(r,s,o,l)]=!0,n.borderSkipped=a}function Dc(n,t,e,i){return i?(n=Ap(n,t,e),n=Mc(n,e,t)):n=Mc(n,t,e),n}function Ap(n,t,e){return n===t?e:n===e?t:n}function Mc(n,t,e){return n==="start"?t:n==="end"?e:n}function Rp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Pi extends Oe{parsePrimitiveData(t,e,i,r){return Tc(t,e,i,r)}parseArrayData(t,e,i,r){return Tc(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:a,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=a.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,g,p,v;for(f=i,g=i+r;f<g;++f)v=e[f],p={},p[a.axis]=a.parse(on(v,c),f),d.push(wc(on(v,u),p,s,f));return d}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,a=this.getParsed(t),s=a._custom,o=Qa(s)?"["+s.start+", "+s.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+i.getLabelForValue(a[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,r){const a=r==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,r);for(let g=e;g<e+i;g++){const p=this.getParsed(g),v=a||it(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),m=this._calculateBarIndexPixels(g,u),y=(p._stacks||{})[o.axis],x={horizontal:c,base:v.base,enableBorderRadius:!y||Qa(p._custom)||s===y._top||s===y._bottom,x:c?v.head:m.center,y:c?m.center:v.head,height:c?m.size:Math.abs(v.size),width:c?Math.abs(v.size):m.size};f&&(x.options=d||this.resolveDataElementOptions(g,t[g].active?"active":r));const _=x.options||t[g].options;Ep(x,_,y,s),Rp(x,_,u.ratio),this.updateElement(t[g],g,x,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=i.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(it(u)||isNaN(u))return!0};for(const l of r)if(!(e!==void 0&&o(l))&&((a===!1||s.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,s;for(a=0,s=e.data.length;a<s;++a)r.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const o=t.barThickness;return{min:o||Mp(e),pixels:r,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:r},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=Qa(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,v;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Le(d)!==Le(c.barEnd)&&(f=0),f+=d);const m=!it(a)&&!u?a:f;let y=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=y,v=p-y,Math.abs(v)<s){v=Op(v,e,o)*s,d===o&&(y-=v/2);const x=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),w=Math.min(x,_),M=Math.max(x,_);y=Math.max(Math.min(y,M),w),p=y+v,i&&!u&&(l._stacks[e.axis]._visualValues[r]=e.getValueForPixel(p)-e.getValueForPixel(y))}if(y===e.getPixelForValue(o)){const x=Le(v)*e.getLineWidthForValue(o)/2;y+=x,v-=x}return{size:v,base:y,head:p,center:p+v/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,a=r.skipNull,s=nt(r.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=r.barThickness==="flex"?Cp(t,e,r,c):Sp(t,e,r,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(s,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,r=i.length;let a=0;for(;a<r;++a)this.getParsed(a)[e.axis]!==null&&i[a].draw(this._ctx)}}z(Pi,"id","bar"),z(Pi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),z(Pi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Mr extends Oe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const a=super.parsePrimitiveData(t,e,i,r);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+i).radius;return a}parseArrayData(t,e,i,r){const a=super.parseArrayData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=nt(o[2],this.resolveDataElementOptions(s+i).radius)}return a}parseObjectData(t,e,i,r){const a=super.parseObjectData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=nt(o&&o.r&&+o.r,this.resolveDataElementOptions(s+i).radius)}return a}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:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._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,r){const a=r==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,r),u=s.axis,d=o.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!a&&this.getParsed(f),v={},m=v[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),y=v[d]=a?o.getBasePixel():o.getPixelForValue(p[d]);v.skip=isNaN(m)||isNaN(y),c&&(v.options=l||this.resolveDataElementOptions(f,g.active?"active":r),a&&(v.options.radius=0)),this.updateElement(g,f,v,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return e!=="active"&&(r.radius=0),r.radius+=nt(i&&i._custom,a),r}}z(Mr,"id","bubble"),z(Mr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),z(Mr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Lp(n,t,e){let i=1,r=1,a=0,s=0;if(t<kt){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),g=(_,w,M)=>wi(_,o,l,!0)?1:Math.max(w,w*e,M,M*e),p=(_,w,M)=>wi(_,o,l,!0)?-1:Math.min(w,w*e,M,M*e),v=g(0,c,d),m=g(Pt,u,f),y=p(ut,c,d),x=p(ut+Pt,u,f);i=(v-y)/2,r=(m-x)/2,a=-(v+y)/2,s=-(m+x)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:s}}class hn extends Oe{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,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=l=>+i[l];if(lt(i[t])){const{key:l="value"}=this._parsing;a=c=>+on(i[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)r._parsed[s]=a(s)}}_getRotation(){return qt(this.options.rotation-90)}_getCircumference(){return qt(this.options.circumference)}_getRotationExtents(){let t=kt,e=-kt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,a=r._getRotation(),s=r._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,a=r.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),l=Math.min(Gh(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:v}=Lp(d,u,l),m=(i.width-s)/f,y=(i.height-s)/g,x=Math.max(Math.min(m,y)/2,0),_=Cl(this.options.radius,x),w=Math.max(_*l,0),M=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=v*_,r.total=this.calculateTotal(),this.outerRadius=_-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*a/kt)}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=a&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:v,includeOptions:m}=this._getSharedOptions(e,r);let y=this._getRotation(),x;for(x=0;x<e;++x)y+=this._circumference(x,a);for(x=e;x<e+i;++x){const _=this._circumference(x,a),w=t[x],M={x:u+this.offsetX,y:d+this.offsetY,startAngle:y,endAngle:y+_,circumference:_,outerRadius:p,innerRadius:g};m&&(M.options=v||this.resolveDataElementOptions(x,w.active?"active":r)),y+=_,this.updateElement(w,x,M,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const a=t._parsed[r];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(a))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?kt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Di(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,s,o,l;if(!t){for(r=0,a=i.data.datasets.length;r<a;++r)if(i.isDatasetVisible(r)){s=i.getDatasetMeta(r),t=s.data,o=s.controller;break}}if(!t)return 0;for(r=0,a=t.length;r<a;++r)l=o.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.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(nt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}z(hn,"id","doughnut"),z(hn,"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"}),z(hn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),z(hn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Ei extends Oe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=Yl(e,r,s);this._drawStart=o,this._drawCount=l,Wl(e)&&(o=0,l=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:c},t),this.updateElements(r,o,l,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),f=s.axis,g=o.axis,{spanGaps:p,segment:v}=this.options,m=cn(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||r==="none",x=e+i,_=t.length;let w=e>0&&this.getParsed(e-1);for(let M=0;M<_;++M){const C=t[M],k=y?C:{};if(M<e||M>=x){k.skip=!0;continue}const T=this.getParsed(M),D=it(T[g]),O=k[f]=s.getPixelForValue(T[f],M),E=k[g]=a||D?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,T,l):T[g],M);k.skip=isNaN(O)||isNaN(E)||D,k.stop=M>0&&Math.abs(T[f]-w[f])>m,v&&(k.parsed=T,k.raw=c.data[M]),d&&(k.options=u||this.resolveDataElementOptions(M,C.active?"active":r)),y||this.updateElement(C,M,k,r),w=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}z(Ei,"id","line"),z(Ei,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),z(Ei,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ai extends Oe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Di(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return nc.bind(this)(t,e,i,r)}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,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),s=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*ut;let g=f,p;const v=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,r,v);for(p=e;p<e+i;p++){const m=t[p];let y=g,x=g+this._computeAngle(p,r,v),_=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=x,a&&(l.animateScale&&(_=0),l.animateRotate&&(y=x=f));const w={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:y,endAngle:x,options:this.resolveDataElementOptions(p,m.active?"active":r)};this.updateElement(m,p,w,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?qt(this.resolveDataElementOptions(t,e).angle||i):0}}z(Ai,"id","polarArea"),z(Ai,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),z(Ai,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}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 Ja extends hn{}z(Ja,"id","pie"),z(Ja,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Sr extends Oe{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,r){return nc.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===r.length,options:s};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,s=r==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":r),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,f=s?a.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,g,r)}}}z(Sr,"id","radar"),z(Sr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),z(Sr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cr extends Oe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:a,count:s}=Yl(e,i,r);if(this._drawStart=a,this._drawCount=s,Wl(e)&&(a=0,s=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:!r,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,r),d=this.getSharedOptions(u),f=this.includeOptions(r,d),g=s.axis,p=o.axis,{spanGaps:v,segment:m}=this.options,y=cn(v)?v:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||a||r==="none";let _=e>0&&this.getParsed(e-1);for(let w=e;w<e+i;++w){const M=t[w],C=this.getParsed(w),k=x?M:{},T=it(C[p]),D=k[g]=s.getPixelForValue(C[g],w),O=k[p]=a||T?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,C,l):C[p],w);k.skip=isNaN(D)||isNaN(O)||T,k.stop=w>0&&Math.abs(C[g]-_[g])>y,m&&(k.parsed=C,k.raw=c.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,M.active?"active":r)),x||this.updateElement(M,w,k,r),_=C}this.updateSharedOptions(d,r,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,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,s)/2}}z(Cr,"id","scatter"),z(Cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),z(Cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Ip=Object.freeze({__proto__:null,BarController:Pi,BubbleController:Mr,DoughnutController:hn,LineController:Ei,PieController:Ja,PolarAreaController:Ai,RadarController:Sr,ScatterController:Cr});function An(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ts{constructor(t){z(this,"options");this.options=t||{}}static override(t){Object.assign(ts.prototype,t)}init(){}formats(){return An()}parse(){return An()}format(){return An()}add(){return An()}diff(){return An()}startOf(){return An()}endOf(){return An()}}var Sc={_date:ts};function Np(n,t,e,i){const{controller:r,data:a,_sorted:s}=n,o=r._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?sg:je;if(i){if(r._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),f=l(a,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Ri(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),s=e[t];for(let o=0,l=a.length;o<l;++o){const{index:c,data:u}=a[o],{lo:d,hi:f}=Np(a[o],t,s,r);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Fp(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const a=t?Math.abs(i.x-r.x):0,s=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function es(n,t,e,i,r){const a=[];return!r&&!n.isPointInArea(t)||Ri(n,e,t,function(o,l,c){!r&&!Ve(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function Up(n,t,e,i){let r=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],i),{angle:d}=Ll(s,{x:t.x,y:t.y});wi(d,c,u)&&r.push({element:s,datasetIndex:o,index:l})}return Ri(n,e,t,a),r}function Bp(n,t,e,i,r,a){let s=[];const o=Fp(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,r);if(i&&!g)return;const p=u.getCenterPoint(r);if(!(!!a||n.isPointInArea(p))&&!g)return;const m=o(t,p);m<l?(s=[{element:u,datasetIndex:d,index:f}],l=m):m===l&&s.push({element:u,datasetIndex:d,index:f})}return Ri(n,e,t,c),s}function ns(n,t,e,i,r,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!i?Up(n,t,e,r):Bp(n,t,e,i,r,a)}function Cc(n,t,e,i,r){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Ri(n,e,t,(l,c,u)=>{l[s](t[e],r)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,r))}),i&&!o?[]:a}var is={evaluateInteractionItems:Ri,modes:{index(n,t,e,i){const r=fn(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?es(n,r,a,i,s):ns(n,r,a,!1,i,s),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?es(n,r,a,i,s):ns(n,r,a,!1,i,s);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 r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return es(n,r,a,i,s)},nearest(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return ns(n,r,a,e.intersect,i,s)},x(n,t,e,i){const r=fn(t,n);return Cc(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=fn(t,n);return Cc(n,r,"y",e.intersect,i)}}};const kc=["left","top","right","bottom"];function Li(n,t){return n.filter(e=>e.pos===t)}function Oc(n,t){return n.filter(e=>kc.indexOf(e.pos)===-1&&e.box.axis===t)}function Ii(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function Yp(n){const t=[];let e,i,r,a,s,o;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=r,t.push({index:e,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:s&&a+s,stackWeight:o});return t}function Wp(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:a}=e;if(!i||!kc.includes(r))continue;const s=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function zp(n,t){const e=Wp(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let a,s,o;for(a=0,s=n.length;a<s;++a){o=n[a];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=r):(o.width=i,o.height=u?u*r:l&&t.availableHeight)}return e}function Hp(n){const t=Yp(n),e=Ii(t.filter(c=>c.box.fullSize),!0),i=Ii(Li(t,"left"),!0),r=Ii(Li(t,"right")),a=Ii(Li(t,"top"),!0),s=Ii(Li(t,"bottom")),o=Oc(t,"x"),l=Oc(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(l).concat(s).concat(o),chartArea:Li(t,"chartArea"),vertical:i.concat(r).concat(l),horizontal:a.concat(s).concat(o)}}function Pc(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Ec(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 $p(n,t,e,i){const{pos:r,box:a}=e,s=n.maxPadding;if(!lt(r)){e.size&&(n[r]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?a.height:a.width),e.size=d.size/d.count,n[r]+=e.size}a.getPadding&&Ec(s,a.getPadding());const o=Math.max(0,t.outerWidth-Pc(s,n,"left","right")),l=Math.max(0,t.outerHeight-Pc(s,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 jp(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Vp(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return i(n?["left","right"]:["top","bottom"])}function Ni(n,t,e,i){const r=[];let a,s,o,l,c,u;for(a=0,s=n.length,c=0;a<s;++a){o=n[a],l=o.box,l.update(o.width||t.w,o.height||t.h,Vp(o.horizontal,t));const{same:d,other:f}=$p(t,e,o,i);c|=d&&r.length,u=u||f,l.fullSize||r.push(o)}return c&&Ni(r,t,e,i)||u}function kr(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Ac(n,t,e,i){const r=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=i[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;ue(c.start)&&(s=c.start),l.fullSize?kr(l,r.left,s,e.outerWidth-r.right-r.left,f):kr(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;ue(c.start)&&(a=c.start),l.fullSize?kr(l,a,r.top,f,e.outerHeight-r.bottom-r.top):kr(l,a,t.top+c.placed,f,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}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 r=Xt(n.options.layout.padding),a=Math.max(t-r.width,0),s=Math.max(e-r.height,0),o=Hp(n.boxes),l=o.vertical,c=o.horizontal;wt(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const u=l.reduce((v,m)=>m.box.options&&m.box.options.display===!1?v:v+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},r);Ec(f,Xt(i));const g=Object.assign({maxPadding:f,w:a,h:s,x:r.left,y:r.top},r),p=zp(l.concat(c),d);Ni(o.fullSize,g,d,p),Ni(l,g,d,p),Ni(c,g,d,p)&&Ni(l,g,d,p),jp(g),Ac(o.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Ac(o.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},wt(o.chartArea,v=>{const m=v.box;Object.assign(m,n.chartArea),m.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Rc{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class qp extends Rc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Or="$chartjs",Xp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Lc=n=>n===null||n==="";function Gp(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Or]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Lc(r)){const a=ac(n,"width");a!==void 0&&(n.width=a)}if(Lc(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=ac(n,"height");a!==void 0&&(n.height=a)}return n}const Ic=Jg?{passive:!0}:!1;function Kp(n,t,e){n.addEventListener(t,e,Ic)}function Zp(n,t,e){n.canvas.removeEventListener(t,e,Ic)}function Qp(n,t){const e=Xp[n.type]||n.type,{x:i,y:r}=fn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Jp(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Pr(o.addedNodes,i),s=s&&!Pr(o.removedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function tm(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Pr(o.removedNodes,i),s=s&&!Pr(o.addedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const Fi=new Map;let Nc=0;function Fc(){const n=window.devicePixelRatio;n!==Nc&&(Nc=n,Fi.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function em(n,t){Fi.size||window.addEventListener("resize",Fc),Fi.set(n,t)}function nm(n){Fi.delete(n),Fi.size||window.removeEventListener("resize",Fc)}function im(n,t,e){const i=n.canvas,r=i&&Xa(i);if(!r)return;const a=Bl((o,l)=>{const c=r.clientWidth;e(o,l),c<r.clientWidth&&e()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||a(c,u)});return s.observe(r),em(n,a),s}function rs(n,t,e){e&&e.disconnect(),t==="resize"&&nm(n)}function rm(n,t,e){const i=n.canvas,r=Bl(a=>{n.ctx!==null&&e(Qp(a,n))},n);return Kp(i,t,r),r}class am extends Rc{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Gp(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Or])return!1;const i=e[Or].initial;["height","width"].forEach(a=>{const s=i[a];it(s)?e.removeAttribute(a):e.setAttribute(a,s)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[Or],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),s={attach:Jp,detach:tm,resize:im}[e]||rm;r[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:rs,detach:rs,resize:rs}[e]||Zp)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Qg(t,e,i,r)}isAttached(t){const e=Xa(t);return!!(e&&e.isConnected)}}function sm(n){return!qa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?qp:am}class te{constructor(){z(this,"x");z(this,"y");z(this,"active",!1);z(this,"options");z(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return cn(this.x)&&cn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}z(te,"defaults",{}),z(te,"defaultRoutes");function om(n,t){const e=n.options.ticks,i=lm(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?um(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>r)return dm(t,c,a,s/r),c;const u=cm(a,t,r);if(s>0){let d,f;const g=s>1?Math.round((l-o)/(s-1)):null;for(Er(t,c,u,it(g)?0:o-g,o),d=0,f=s-1;d<f;d++)Er(t,c,u,a[d],a[d+1]);return Er(t,c,u,l,it(g)?t.length:l+g),c}return Er(t,c,u),c}function lm(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function cm(n,t,e){const i=fm(n),r=t.length/e;if(!i)return Math.max(r,1);const a=ng(i);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>r)return l}return Math.max(r,1)}function um(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function dm(n,t,e,i){let r=0,a=e[0],s;for(i=Math.ceil(i),s=0;s<n.length;s++)s===a&&(t.push(n[s]),r++,a=e[r*i])}function Er(n,t,e,i,r){const a=nt(i,0),s=Math.min(nt(r,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),r&&(l=r-i,e=l/Math.floor(l/e)),u=a;u<0;)o++,u=Math.round(a+o*e);for(c=Math.max(a,0);c<s;c++)c===u&&(t.push(n[c]),o++,u=Math.round(a+o*e))}function fm(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 hm=n=>n==="left"?"right":n==="right"?"left":n,Uc=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Bc=(n,t)=>Math.min(t||n,n);function Yc(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;a<r;a+=i)e.push(n[Math.floor(a)]);return e}function gm(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(r),c;if(!(e&&(i===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(r-1))/2,l+=r<t?c:-c,l<a-o||l>s+o)))return l}function pm(n,t){wt(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;a<r;++a)delete e.data[i[a]];i.splice(0,r)}})}function Ui(n){return n.drawTicks?n.tickLength:0}function Wc(n,t){if(!n.display)return 0;const e=Et(n.font,t),i=Xt(n.padding);return(yt(n.text)?n.text.length:1)*e.lineHeight+i.height}function mm(n,t){return dn(n,{scale:t,type:"scale"})}function ym(n,t,e){return dn(n,{tick:e,index:t,type:"tick"})}function bm(n,t,e){let i=Fa(n);return(e&&t!=="right"||!e&&t==="right")&&(i=hm(i)),i}function vm(n,t,e,i){const{top:r,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const v=s-r,m=o-a;if(n.isHorizontal()){if(g=ie(i,a,o),lt(e)){const y=Object.keys(e)[0],x=e[y];p=u[y].getPixelForValue(x)+v-t}else e==="center"?p=(c.bottom+c.top)/2+v-t:p=Uc(n,e,t);f=o-a}else{if(lt(e)){const y=Object.keys(e)[0],x=e[y];g=u[y].getPixelForValue(x)-m+t}else e==="center"?g=(c.left+c.right)/2-m+t:g=Uc(n,e,t);p=ie(i,s,r),d=e==="left"?-Pt:Pt}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class Rn extends te{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:r}=this;return t=be(t,Number.POSITIVE_INFINITY),e=be(e,Number.NEGATIVE_INFINITY),i=be(i,Number.POSITIVE_INFINITY),r=be(r,Number.NEGATIVE_INFINITY),{min:be(t,i),max:be(e,r),minDefined:Lt(t),maxDefined:Lt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:a}=this.getUserBounds(),s;if(r&&a)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),r||(e=Math.min(e,s.min)),a||(i=Math.max(i,s.max));return e=a&&e>i?i:e,i=r&&e>i?e:i,{min:be(e,be(i,e)),max:be(i,be(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(){_t(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:s}=this.options,o=s.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=Pg(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Yc(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=om(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(){_t(this.options.afterUpdate,[this])}beforeSetDimensions(){_t(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(){_t(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),_t(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){_t(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,a;for(i=0,r=t.length;i<r;i++)a=t[i],a.label=_t(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){_t(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){_t(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Bc(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,a=e.maxRotation;let s=r,o,l,c;if(!this._isVisible()||!e.display||r>=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Zt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/i:g/(i-1),d+6>o&&(o=g/(i-(t.offset?.5:1)),l=this.maxHeight-Ui(t.grid)-e.padding-Wc(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=yr(Math.min(Math.asin(Zt((u.highest.height+6)/o,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(f/c,-1,1)))),s=Math.max(r,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){_t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){_t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=Wc(r,e.options.font);if(o?(t.width=this.maxWidth,t.height=Ui(a)+l):(t.height=this.maxHeight,t.width=Ui(a)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=qt(this.labelRotation),v=Math.cos(p),m=Math.sin(p);if(o){const y=i.mirror?0:m*d.width+v*f.height;t.height=Math.min(this.maxHeight,t.height+y+g)}else{const y=i.mirror?0:v*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+y+g)}this._calculatePadding(c,u,m,v)}}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,r){const{ticks:{align:a,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=r*t.width,g=i*e.height):(f=i*t.height,g=r*e.width):a==="start"?g=e.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;a==="start"?(u=0,d=t.height):a==="end"&&(u=e.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){_t(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++)it(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=Yc(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/Bc(e,i));let c=0,u=0,d,f,g,p,v,m,y,x,_,w,M;for(d=0;d<e;d+=l){if(p=t[d].label,v=this._resolveTickFontOptions(d),r.font=m=v.string,y=a[m]=a[m]||{data:{},gc:[]},x=v.lineHeight,_=w=0,!it(p)&&!yt(p))_=xr(r,y.data,y.gc,_,p),w=x;else if(yt(p))for(f=0,g=p.length;f<g;++f)M=p[f],!it(M)&&!yt(M)&&(_=xr(r,y.data,y.gc,_,M),w+=x);s.push(_),o.push(w),c=Math.max(_,c),u=Math.max(w,u)}pm(a,e);const C=s.indexOf(c),k=o.indexOf(u),T=D=>({width:s[D]||0,height:o[D]||0});return{first:T(0),last:T(e-1),widest:T(C),highest:T(k),widths:s,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 ag(this._alignToPixels?kn(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=ym(this.getContext(),t,i))}return this.$context||(this.$context=mm(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=qt(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,o=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return this.isHorizontal()?l*i>o*r?o/i:l/r:l*r<o*i?l/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:s,border:o}=r,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ui(a),g=[],p=o.setContext(this.getContext()),v=p.display?p.width:0,m=v/2,y=function(B){return kn(i,B,v)};let x,_,w,M,C,k,T,D,O,E,A,R;if(s==="top")x=y(this.bottom),k=this.bottom-f,D=x-m,E=y(t.top)+m,R=t.bottom;else if(s==="bottom")x=y(this.top),E=t.top,R=y(t.bottom)-m,k=x+m,D=this.top+f;else if(s==="left")x=y(this.right),C=this.right-f,T=x-m,O=y(t.left)+m,A=t.right;else if(s==="right")x=y(this.left),O=t.left,A=y(t.right)-m,C=x+m,T=this.left+f;else if(e==="x"){if(s==="center")x=y((t.top+t.bottom)/2+.5);else if(lt(s)){const B=Object.keys(s)[0],I=s[B];x=y(this.chart.scales[B].getPixelForValue(I))}E=t.top,R=t.bottom,k=x+m,D=k+f}else if(e==="y"){if(s==="center")x=y((t.left+t.right)/2);else if(lt(s)){const B=Object.keys(s)[0],I=s[B];x=y(this.chart.scales[B].getPixelForValue(I))}C=x-m,T=C-f,O=t.left,A=t.right}const q=nt(r.ticks.maxTicksLimit,d),H=Math.max(1,Math.ceil(d/q));for(_=0;_<d;_+=H){const B=this.getContext(_),I=a.setContext(B),rt=o.setContext(B),W=I.lineWidth,Ct=I.color,mt=rt.dash||[],$=rt.dashOffset,N=I.tickWidth,Y=I.tickColor,V=I.tickBorderDash||[],Z=I.tickBorderDashOffset;w=gm(this,_,l),w!==void 0&&(M=kn(i,w,W),c?C=T=O=A=M:k=D=E=R=M,g.push({tx1:C,ty1:k,tx2:T,ty2:D,x1:O,y1:E,x2:A,y2:R,width:W,color:Ct,borderDash:mt,borderDashOffset:$,tickWidth:N,tickColor:Y,tickBorderDash:V,tickBorderDashOffset:Z}))}return this._ticksLength=d,this._borderValue=x,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:a}=i,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,f=Ui(i.grid),g=f+u,p=d?-u:g,v=-qt(this.labelRotation),m=[];let y,x,_,w,M,C,k,T,D,O,E,A,R="middle";if(r==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(r==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(r==="left"){const H=this._getYAxisLabelAlignment(f);k=H.textAlign,M=H.x}else if(r==="right"){const H=this._getYAxisLabelAlignment(f);k=H.textAlign,M=H.x}else if(e==="x"){if(r==="center")C=(t.top+t.bottom)/2+g;else if(lt(r)){const H=Object.keys(r)[0],B=r[H];C=this.chart.scales[H].getPixelForValue(B)+g}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")M=(t.left+t.right)/2-g;else if(lt(r)){const H=Object.keys(r)[0],B=r[H];M=this.chart.scales[H].getPixelForValue(B)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?R="top":l==="end"&&(R="bottom"));const q=this._getLabelSizes();for(y=0,x=o.length;y<x;++y){_=o[y],w=_.label;const H=a.setContext(this.getContext(y));T=this.getPixelForTick(y)+a.labelOffset,D=this._resolveTickFontOptions(y),O=D.lineHeight,E=yt(w)?w.length:1;const B=E/2,I=H.color,rt=H.textStrokeColor,W=H.textStrokeWidth;let Ct=k;s?(M=T,k==="inner"&&(y===x-1?Ct=this.options.reverse?"left":"right":y===0?Ct=this.options.reverse?"right":"left":Ct="center"),r==="top"?c==="near"||v!==0?A=-E*O+O/2:c==="center"?A=-q.highest.height/2-B*O+O:A=-q.highest.height+O/2:c==="near"||v!==0?A=O/2:c==="center"?A=q.highest.height/2-B*O:A=q.highest.height-E*O,d&&(A*=-1),v!==0&&!H.showLabelBackdrop&&(M+=O/2*Math.sin(v))):(C=T,A=(1-E)*O/2);let mt;if(H.showLabelBackdrop){const $=Xt(H.backdropPadding),N=q.heights[y],Y=q.widths[y];let V=A-$.top,Z=0-$.left;switch(R){case"middle":V-=N/2;break;case"bottom":V-=N;break}switch(k){case"center":Z-=Y/2;break;case"right":Z-=Y;break;case"inner":y===x-1?Z-=Y:y>0&&(Z-=Y/2);break}mt={left:Z,top:V,width:Y+$.width,height:N+$.height,color:H.backdropColor}}m.push({label:w,font:D,textOffset:A,options:{rotation:v,color:I,strokeColor:rt,strokeWidth:W,textAlign:Ct,textBaseline:R,translation:[M,C],backdrop:mt}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-qt(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?r?(u=this.right+a,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"?r?(u=this.left+a,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:r,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(a=>a.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;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(a=0,s=r.length;a<s;++a){const l=r[a];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:r}}=this,a=i.setContext(this.getContext()),s=i.display?a.width:0;if(!s)return;const o=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=kn(t,this.left,s)-s/2,u=kn(t,this.right,o)+o/2,d=f=l):(d=kn(t,this.top,s)-s/2,f=kn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Si(i,r);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;On(i,c,0,u,l,o)}r&&Ci(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const a=Et(i.font),s=Xt(i.padding),o=i.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||lt(e)?(l+=s.bottom,yt(i.text)&&(l+=a.lineHeight*(i.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=vm(this,l,e,o);On(t,i.text,0,0,a,{color:i.color,maxWidth:d,rotation:f,textAlign:bm(o,e,r),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=nt(t.grid&&t.grid.z,-1),r=nt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Rn.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Et(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ar{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;wm(e)&&(i=this.register(e));const r=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in r||(r[a]=t,xm(t,s,i),this.override&&Ft.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in Ft[r]&&(delete Ft[r][i],this.override&&delete Cn[i])}}function xm(n,t,e){const i=vi(Object.create(null),[e?Ft.get(e):{},Ft.get(t),n.defaults]);Ft.set(t,i),n.defaultRoutes&&_m(t,n.defaultRoutes),n.descriptors&&Ft.describe(t,n.descriptors)}function _m(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");Ft.route(a,r,l,o)})}function wm(n){return"id"in n&&"defaults"in n}class Tm{constructor(){this.controllers=new Ar(Oe,"datasets",!0),this.elements=new Ar(te,"elements"),this.plugins=new Ar(Object,"plugins"),this.scales=new Ar(Rn,"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(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):wt(r,s=>{const o=i||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,i){const r=La(t);_t(i["before"+r],[],i),e[t](i),_t(i["after"+r],[],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 r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Ie=new Tm;class Dm{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=r?this._descriptors(t).filter(r):this._descriptors(t),s=this._notify(a,t,e,i);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,r){r=r||{};for(const a of t){const s=a.plugin,o=s[i],l=[e,r,a.options];if(_t(o,l,s)===!1&&r.cancelable)return!1}return!0}invalidate(){it(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,r=nt(i.options&&i.options.plugins,{}),a=Mm(i);return r===!1&&!e?[]:Cm(t,a,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function Mm(n){const t={},e=[],i=Object.keys(Ie.plugins.items);for(let a=0;a<i.length;a++)e.push(Ie.getPlugin(i[a]));const r=n.plugins||[];for(let a=0;a<r.length;a++){const s=r[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function Sm(n,t){return!t&&n===!1?null:n===!0?{}:n}function Cm(n,{plugins:t,localIds:e},i,r){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=Sm(i[l],r);c!==null&&a.push({plugin:o,options:km(n.config,{plugin:o,local:e[l]},c,s)})}return a}function km(n,{plugin:t,local:e},i,r){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(i,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function as(n,t){const e=Ft.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Om(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Pm(n,t){return n===t?"_index_":"_value_"}function zc(n){if(n==="x"||n==="y"||n==="r")return n}function Em(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ss(n,...t){if(zc(n))return n;for(const e of t){const i=e.axis||Em(e.position)||n.length>1&&zc(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Hc(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Am(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 Hc(n,"x",e[0])||Hc(n,"y",e[0])}return{}}function Rm(n,t){const e=Cn[n.type]||{scales:{}},i=t.scales||{},r=as(n.type,t),a=Object.create(null);return Object.keys(i).forEach(s=>{const o=i[s];if(!lt(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=ss(s,o,Am(s,n),Ft.scales[o.type]),c=Pm(l,r),u=e.scales||{};a[s]=xi(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||as(o,t),u=(Cn[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Om(d,l),g=s[f+"AxisID"]||f;a[g]=a[g]||Object.create(null),xi(a[g],[{axis:f},i[g],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];xi(o,[Ft.scales[o.type],Ft.scale])}),a}function $c(n){const t=n.options||(n.options={});t.plugins=nt(t.plugins,{}),t.scales=Rm(n,t)}function jc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Lm(n){return n=n||{},n.data=jc(n.data),$c(n),n}const Vc=new Map,qc=new Set;function Rr(n,t){let e=Vc.get(n);return e||(e=t(),Vc.set(n,e),qc.add(e)),e}const Bi=(n,t,e)=>{const i=on(t,e);i!==void 0&&n.add(i)};class Im{constructor(t){this._config=Lm(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=jc(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(),$c(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Rr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Rr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Rr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Rr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>Bi(l,t,d))),u.forEach(d=>Bi(l,r,d)),u.forEach(d=>Bi(l,Cn[a]||{},d)),u.forEach(d=>Bi(l,Ft,d)),u.forEach(d=>Bi(l,Ya,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qc.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Cn[e]||{},Ft.datasets[e]||{},{type:e},Ft,Ya]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Xc(this._resolverCache,t,r);let l=s;if(Fm(s,e)){a.$shared=!1,i=de(i)?i():i;const c=this.createResolver(t,i,o);l=Zn(s,i,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,i=[""],r){const{resolver:a}=Xc(this._resolverCache,t,i);return lt(e)?Zn(a,e,void 0,r):a}}function Xc(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:$a(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,a)),a}const Nm=n=>lt(n)&&Object.getOwnPropertyNames(n).some(t=>de(n[t]));function Fm(n,t){const{isScriptable:e,isIndexable:i}=Kl(n);for(const r of t){const a=e(r),s=i(r),o=(s||a)&&n[r];if(a&&(de(o)||Nm(o))||s&&yt(o))return!0}return!1}var Um="4.4.1";const Bm=["top","bottom","left","right","chartArea"];function Gc(n,t){return n==="top"||n==="bottom"||Bm.indexOf(n)===-1&&t==="x"}function Kc(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Zc(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),_t(e&&e.onComplete,[n],t)}function Ym(n){const t=n.chart,e=t.options.animation;_t(e&&e.onProgress,[n],t)}function Qc(n){return qa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Lr={},Jc=n=>{const t=Qc(n);return Object.values(Lr).filter(e=>e.canvas===t).pop()};function Wm(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const s=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=s)}}}function zm(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Ir(n,t,e){return n.options.clip?n[e]:t[e]}function Hm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Ir(e,t,"left"),right:Ir(e,t,"right"),top:Ir(i,t,"top"),bottom:Ir(i,t,"bottom")}:t}let Te=(Tn=class{static register(...t){Ie.add(...t),tu()}static unregister(...t){Ie.remove(...t),tu()}constructor(t,e){const i=this.config=new Im(e),r=Qc(t),a=Jc(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||sm(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Xh(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Dm,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=cg(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Lr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}qe.listen(this,"complete",Zc),qe.listen(this,"progress",Ym),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return it(t)?e&&a?a:r?i/r: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 Ie}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ql(this.canvas,this.ctx),this}stop(){return qe.stop(this),this}resize(t,e){qe.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(r,t,e,a),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,rc(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),_t(i.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};wt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=ss(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),wt(a,s=>{const o=s.options,l=o.id,c=ss(l,o),u=nt(o.type,s.dtype);(o.position===void 0||Gc(o.position,c)!==Gc(s.dposition))&&(o.position=s.dposition),r[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=Ie.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(o,t)}),wt(r,(s,o)=>{s||delete i[o]}),wt(i,s=>{re.configure(this,s,s.options),re.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Kc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const a=e[i];let s=this.getDatasetMeta(i);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=o,s.indexAxis=a.indexAxis||as(o,this.options),s.order=a.order||0,s.index=i,s.label=""+a.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const l=Ie.getController(o),{datasetElementType:c,dataElementType:u}=Ft.datasets[o];Object.assign(l,{dataElementType:Ie.getElement(u),datasetElementType:c&&Ie.getElement(c)}),s.controller=new l(this,i),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){wt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!r&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),r||wt(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Kc("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){wt(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);(!Pl(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const s=i==="_removeElements"?-a:a;Wm(t,r,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),r=i(0);for(let a=1;a<e;a++)if(!Pl(r,i(a)))return;return Array.from(r).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[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=[],wt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),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,de(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(qe.has(this)?this.attached&&!qe.running(this)&&qe.start(this):(this.draw(),Zc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}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 r,a;for(r=0,a=e.length;r<a;++r){const s=e[r];(!t||s.visible)&&i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,r=!i.disabled,a=Hm(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Si(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&Ci(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=is.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={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(r)),r}getContext(){return this.$context||(this.$context=dn(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 r=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,r);ue(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(o=>o.datasetIndex===t?r: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(),qe.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(),ql(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Lr[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=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},r=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};wt(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},r=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},a=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){wt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},wt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:a,index:s})=>{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!hr(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 r=this.options.hover,a=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=a(e,t),o=i?t:a(t,e);s.length&&this.updateHoverStyle(s,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,s=e,o=this._getActiveElements(t,r,i,s),l=tg(t),c=zm(t,this._lastEvent,i,l);i&&(this._lastEvent=null,_t(a.onHover,[t,o,this],this),l&&_t(a.onClick,[t,o,this],this));const u=!hr(o,r);return(u||e)&&(this._active=o,this._updateHoverStyles(o,r,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}},z(Tn,"defaults",Ft),z(Tn,"instances",Lr),z(Tn,"overrides",Cn),z(Tn,"registry",Ie),z(Tn,"version",Um),z(Tn,"getChart",Jc),Tn);function tu(){return wt(Te.instances,n=>n._plugins.invalidate())}function $m(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=r/o;n.beginPath(),n.arc(a,s,o,i-c,e+c),l>r?(c=r/l,n.arc(a,s,l,e+c,i-c,!0)):n.arc(a,s,r,e+Pt,i-Pt),n.closePath(),n.clip()}function jm(n){return Ha(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Vm(n,t,e,i){const r=jm(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,i*t/2),o=l=>{const c=(e-Math.min(a,l))*i/2;return Zt(l,0,Math.min(a,c))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Zt(r.innerStart,0,s),innerEnd:Zt(r.innerEnd,0,s)}}function ti(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Nr(n,t,e,i,r,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=r-l;if(i){const H=u>0?u-i:0,B=d>0?d-i:0,I=(H+B)/2,rt=I!==0?p*I/(I+i):p;g=(p-rt)/2}const v=Math.max(.001,p*d-e/ut)/d,m=(p-v)/2,y=l+m+g,x=r-m-g,{outerStart:_,outerEnd:w,innerStart:M,innerEnd:C}=Vm(t,f,d,x-y),k=d-_,T=d-w,D=y+_/k,O=x-w/T,E=f+M,A=f+C,R=y+M/E,q=x-C/A;if(n.beginPath(),a){const H=(D+O)/2;if(n.arc(s,o,d,D,H),n.arc(s,o,d,H,O),w>0){const W=ti(T,O,s,o);n.arc(W.x,W.y,w,O,x+Pt)}const B=ti(A,x,s,o);if(n.lineTo(B.x,B.y),C>0){const W=ti(A,q,s,o);n.arc(W.x,W.y,C,x+Pt,q+Math.PI)}const I=(x-C/f+(y+M/f))/2;if(n.arc(s,o,f,x-C/f,I,!0),n.arc(s,o,f,I,y+M/f,!0),M>0){const W=ti(E,R,s,o);n.arc(W.x,W.y,M,R+Math.PI,y-Pt)}const rt=ti(k,y,s,o);if(n.lineTo(rt.x,rt.y),_>0){const W=ti(k,D,s,o);n.arc(W.x,W.y,_,y-Pt,D)}}else{n.moveTo(s,o);const H=Math.cos(D)*d+s,B=Math.sin(D)*d+o;n.lineTo(H,B);const I=Math.cos(O)*d+s,rt=Math.sin(O)*d+o;n.lineTo(I,rt)}n.closePath()}function qm(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Nr(n,t,e,i,l,r);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%kt||kt))}return Nr(n,t,e,i,l,r),n.fill(),l}function Xm(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(a){Nr(n,t,e,i,p,r);for(let v=0;v<a;++v)n.stroke();isNaN(o)||(p=s+(o%kt||kt))}g&&$m(n,t,p),a||(Nr(n,t,e,i,p,r),n.stroke())}class Yi extends te{constructor(e){super();z(this,"circumference");z(this,"endAngle");z(this,"fullCircles");z(this,"innerRadius");z(this,"outerRadius");z(this,"pixelMargin");z(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,r){const a=this.getProps(["x","y"],r),{angle:s,distance:o}=Ll(a,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),g=(this.options.spacing+this.options.borderWidth)/2,v=nt(f,c-l)>=kt||wi(s,l,c),m=$e(o,u+g,d+g);return v&&m}getCenterPoint(e){const{x:i,y:r,startAngle:a,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(a+s)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(d)*f,y:r+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:r}=this,a=(i.offset||0)/4,s=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>kt?Math.floor(r/kt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const c=1-Math.sin(Math.min(ut,r||0)),u=a*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,qm(e,this,u,s,o),Xm(e,this,u,s,o),e.restore()}}z(Yi,"id","arc"),z(Yi,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),z(Yi,"defaultRoutes",{backgroundColor:"backgroundColor"}),z(Yi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function eu(n,t,e=t){n.lineCap=nt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(nt(e.borderDash,t.borderDash)),n.lineDashOffset=nt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=nt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=nt(e.borderWidth,t.borderWidth),n.strokeStyle=nt(e.borderColor,t.borderColor)}function Gm(n,t,e){n.lineTo(e.x,e.y)}function Km(n){return n.stepped?_g:n.tension||n.cubicInterpolationMode==="monotone"?wg:Gm}function nu(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:s,end:o}=t,l=Math.max(r,s),c=Math.min(a,o),u=r<s&&a<s||r>o&&a>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Zm(n,t,e,i){const{points:r,options:a}=t,{count:s,start:o,loop:l,ilen:c}=nu(r,e,i),u=Km(a);let{move:d=!0,reverse:f}=i||{},g,p,v;for(g=0;g<=c;++g)p=r[(o+(f?c-g:g))%s],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,v,p,f,a.stepped),v=p);return l&&(p=r[(o+(f?c:0))%s],u(n,v,p,f,a.stepped)),!!l}function Qm(n,t,e,i){const r=t.points,{count:a,start:s,ilen:o}=nu(r,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,v,m,y;const x=w=>(s+(c?o-w:w))%a,_=()=>{v!==m&&(n.lineTo(u,m),n.lineTo(u,v),n.lineTo(u,y))};for(l&&(g=r[x(0)],n.moveTo(g.x,g.y)),f=0;f<=o;++f){if(g=r[x(f)],g.skip)continue;const w=g.x,M=g.y,C=w|0;C===p?(M<v?v=M:M>m&&(m=M),u=(d*u+w)/++d):(_(),n.lineTo(w,M),p=C,d=0,v=m=M),y=M}_()}function os(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Qm:Zm}function Jm(n){return n.stepped?tp:n.tension||n.cubicInterpolationMode==="monotone"?ep:En}function t0(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),eu(n,t.options),n.stroke(r)}function e0(n,t,e,i){const{segments:r,options:a}=t,s=os(t);for(const o of r)eu(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const n0=typeof Path2D=="function";function i0(n,t,e,i){n0&&!t.options.segment?t0(n,t,e,i):e0(n,t,e,i)}class gn extends te{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 r=i.spanGaps?this._loop:this._fullLoop;Vg(this._points,i,t,r,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=op(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,r=t[e],a=this.points,s=dc(this,{property:e,start:r,end:r});if(!s.length)return;const o=[],l=Jm(i);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],g=a[d],p=a[f];if(g===p){o.push(g);continue}const v=Math.abs((r-g[e])/(p[e]-g[e])),m=l(g,p,v,i.stepped);m[e]=t[e],o.push(m)}return o.length===1?o[0]:o}pathSegment(t,e,i){return os(this)(t,this,e,i)}path(t,e,i){const r=this.segments,a=os(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of r)s&=a(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,r){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),i0(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}z(gn,"id","line"),z(gn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),z(gn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),z(gn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function iu(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)<r.radius+r.hitRadius}class Fr extends te{constructor(e){super();z(this,"parsed");z(this,"skip");z(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,r){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],r);return Math.pow(e-s,2)+Math.pow(i-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,i){return iu(this,e,"x",i)}inYRange(e,i){return iu(this,e,"y",i)}getCenterPoint(e){const{x:i,y:r}=this.getProps(["x","y"],e);return{x:i,y:r}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const r=i&&e.borderWidth||0;return(i+r)*2}draw(e,i){const r=this.options;this.skip||r.radius<.1||!Ve(this,i,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,za(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}z(Fr,"id","point"),z(Fr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),z(Fr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function ru(n,t){const{x:e,y:i,base:r,width:a,height:s}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=s/2,o=Math.min(e,r),l=Math.max(e,r),c=i-d,u=i+d):(d=a/2,o=e-d,l=e+d,c=Math.min(i,r),u=Math.max(i,r)),{left:o,top:c,right:l,bottom:u}}function pn(n,t,e,i){return n?0:Zt(t,e,i)}function r0(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,a=Gl(i);return{t:pn(r.top,a.top,0,e),r:pn(r.right,a.right,0,t),b:pn(r.bottom,a.bottom,0,e),l:pn(r.left,a.left,0,t)}}function a0(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,a=un(r),s=Math.min(t,e),o=n.borderSkipped,l=i||lt(r);return{topLeft:pn(!l||o.top||o.left,a.topLeft,0,s),topRight:pn(!l||o.top||o.right,a.topRight,0,s),bottomLeft:pn(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:pn(!l||o.bottom||o.right,a.bottomRight,0,s)}}function s0(n){const t=ru(n),e=t.right-t.left,i=t.bottom-t.top,r=r0(n,e/2,i/2),a=a0(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:a},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function ls(n,t,e,i){const r=t===null,a=e===null,o=n&&!(r&&a)&&ru(n,i);return o&&(r||$e(t,o.left,o.right))&&(a||$e(e,o.top,o.bottom))}function o0(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function l0(n,t){n.rect(t.x,t.y,t.w,t.h)}function cs(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-i,s=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+a,h:n.h+s,radius:n.radius}}class Ur extends te{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:r}}=this,{inner:a,outer:s}=s0(this),o=o0(s.radius)?Kn:l0;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,cs(s,e,a)),t.clip(),o(t,cs(a,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,cs(a,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return ls(this,t,e,i)}inXRange(t,e){return ls(this,t,null,e)}inYRange(t,e){return ls(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}z(Ur,"id","bar"),z(Ur,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),z(Ur,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var c0=Object.freeze({__proto__:null,ArcElement:Yi,BarElement:Ur,LineElement:gn,PointElement:Fr});const us=["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)"],au=us.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function su(n){return us[n%us.length]}function ou(n){return au[n%au.length]}function u0(n,t){return n.borderColor=su(t),n.backgroundColor=ou(t),++t}function d0(n,t){return n.backgroundColor=n.data.map(()=>su(t++)),t}function f0(n,t){return n.backgroundColor=n.data.map(()=>ou(t++)),t}function h0(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof hn?t=d0(e,t):r instanceof Ai?t=f0(e,t):r&&(t=u0(e,t))}}function lu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function g0(n){return n&&(n.borderColor||n.backgroundColor)}var p0={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:a}=r;if(!e.forceOverride&&(lu(i)||g0(r)||a&&lu(a)))return;const s=h0(n);i.forEach(s)}};function m0(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const s=[],o=(e-2)/(a-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,v;for(s[l++]=n[u],d=0;d<a-2;d++){let m=0,y=0,x;const _=Math.floor((d+1)*o)+1+t,w=Math.min(Math.floor((d+2)*o)+1,e)+t,M=w-_;for(x=_;x<w;x++)m+=n[x].x,y+=n[x].y;m/=M,y/=M;const C=Math.floor(d*o)+1+t,k=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:T,y:D}=n[u];for(g=p=-1,x=C;x<k;x++)p=.5*Math.abs((T-m)*(n[x].y-D)-(T-n[x].x)*(y-D)),p>g&&(g=p,f=n[x],v=x);s[l++]=f,u=v}return s[l++]=n[c],s}function y0(n,t,e,i){let r=0,a=0,s,o,l,c,u,d,f,g,p,v;const m=[],y=t+e-1,x=n[t].x,w=n[y].x-x;for(s=t;s<t+e;++s){o=n[s],l=(o.x-x)/w*i,c=o.y;const M=l|0;if(M===u)c<p?(p=c,d=s):c>v&&(v=c,f=s),r=(a*r+o.x)/++a;else{const C=s-1;if(!it(d)&&!it(f)){const k=Math.min(d,f),T=Math.max(d,f);k!==g&&k!==C&&m.push({...n[k],x:r}),T!==g&&T!==C&&m.push({...n[T],x:r})}s>0&&C!==g&&m.push(n[C]),m.push(o),u=M,a=0,p=v=c,d=f=g=s}}return m}function cu(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 uu(n){n.data.datasets.forEach(t=>{cu(t)})}function b0(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(i=Zt(je(t,a.axis,s).lo,0,e-1)),c?r=Zt(je(t,a.axis,o).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var v0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){uu(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:s,indexAxis:o}=r,l=n.getDatasetMeta(a),c=s||r.data;if(ki([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:d,count:f}=b0(l,c);const g=e.threshold||4*i;if(f<=g){cu(r);return}it(s)&&(r._data=c,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let p;switch(e.algorithm){case"lttb":p=m0(c,d,f,i,e);break;case"min-max":p=y0(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=p})},destroy(n){uu(n)}};function x0(n,t,e){const i=n.segments,r=n.points,a=t.points,s=[];for(const o of i){let{start:l,end:c}=o;c=fs(l,c,r);const u=ds(e,r[l],r[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:r[l],end:r[c]});continue}const d=dc(t,u);for(const f of d){const g=ds(e,a[f.start],a[f.end],f.loop),p=uc(o,r,g);for(const v of p)s.push({source:v,target:f,start:{[e]:du(u,g,"start",Math.max)},end:{[e]:du(u,g,"end",Math.min)}})}}return s}function ds(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=ve(r),a=ve(a)),{property:n,start:r,end:a}}function _0(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=fs(s,o,r);const l=r[s],c=r[o];i!==null?(a.push({x:l.x,y:i}),a.push({x:c.x,y:i})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function fs(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function du(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function fu(n,t){let e=[],i=!1;return yt(n)?(i=!0,e=n):e=_0(n,t),e.length?new gn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function hu(n){return n&&n.fill!==!1}function w0(n,t,e){let r=n[t].fill;const a=[t];let s;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!Lt(r))return r;if(s=n[r],!s)return!1;if(s.visible)return r;a.push(r),r=s.fill}return!1}function T0(n,t,e){const i=C0(n);if(lt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Lt(r)&&Math.floor(r)===r?D0(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function D0(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function M0(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:lt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function S0(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:lt(n)?i=n.value:i=t.getBaseValue(),i}function C0(n){const t=n.options,e=t.fill;let i=nt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function k0(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,s=i.points,o=O0(t,e);o.push(fu({x:null,y:t.bottom},i));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)P0(r,s[u],o)}return new gn({points:r,options:{}})}function O0(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const a=i[r];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function P0(n,t,e){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{first:s,last:o,point:l}=E0(a,t,"x");if(!(!l||s&&o)){if(s)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function E0(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],a=n.segments,s=n.points;let o=!1,l=!1;for(let c=0;c<a.length;c++){const u=a[c],d=s[u.start][e],f=s[u.end][e];if($e(r,d,f)){o=r===d,l=r===f;break}}return{first:o,last:l,point:i}}class gu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:a,radius:s}=this;return e=e||{start:0,end:kt},t.arc(r,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:i+Math.sin(a)*r,angle:a}}}function A0(n){const{chart:t,fill:e,line:i}=n;if(Lt(e))return R0(t,e);if(e==="stack")return k0(n);if(e==="shape")return!0;const r=L0(n);return r instanceof gu?r:fu(r,i)}function R0(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function L0(n){return(n.scale||{}).getPointPositionForValue?N0(n):I0(n)}function I0(n){const{scale:t={},fill:e}=n,i=M0(e,t);if(Lt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function N0(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,a=i.reverse?t.max:t.min,s=S0(e,t,a),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,a);return new gu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<r;++l)o.push(t.getPointPositionForValue(l,s));return o}function hs(n,t,e){const i=A0(t),{line:r,scale:a,axis:s}=t,o=r.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};i&&r.points.length&&(Si(n,e),F0(n,{line:r,target:i,above:u,below:d,area:e,scale:a,axis:s}),Ci(n))}function F0(n,t){const{line:e,target:i,above:r,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==r&&(pu(n,i,s.top),mu(n,{line:e,target:i,color:r,scale:o,property:l}),n.restore(),n.save(),pu(n,i,s.bottom)),mu(n,{line:e,target:i,color:a,scale:o,property:l}),n.restore()}function pu(n,t,e){const{segments:i,points:r}=t;let a=!0,s=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=r[l],d=r[fs(l,c,r)];a?(n.moveTo(u.x,u.y),a=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),s=!!t.pathSegment(n,o,{move:s}),s?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function mu(n,t){const{line:e,target:i,property:r,color:a,scale:s}=t,o=x0(e,i,r);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=a}={}}=l,g=i!==!0;n.save(),n.fillStyle=f,U0(n,s,g&&ds(r,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let v;if(g){p?n.closePath():yu(n,i,d,r);const m=!!i.pathSegment(n,c,{move:p,reverse:!0});v=p&&m,v||yu(n,i,u,r)}n.closePath(),n.fill(v?"evenodd":"nonzero"),n.restore()}}function U0(n,t,e){const{top:i,bottom:r}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,i,o-s,r-i),n.clip())}function yu(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var B0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let a,s,o,l;for(s=0;s<i;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof gn&&(l={visible:n.isDatasetVisible(s),index:s,fill:T0(o,s,i),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,r.push(l);for(s=0;s<i;++s)l=r[s],!(!l||l.fill===!1)&&(l.fill=w0(r,s,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),i&&o.fill&&hs(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;hu(a)&&hs(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!hu(i)||e.drawTime!=="beforeDatasetDraw"||hs(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bu=(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)}},Y0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class vu extends te{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=_t(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,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,r=Et(i.font),a=r.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=bu(i,a);let c,u;e.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,r,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,r){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+o;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,v)=>{const m=i+e/2+a.measureText(p.text).width;(v===0||c[c.length-1]+m+2*o>s)&&(d+=u,c[c.length-(v>0?0:1)]=0,g+=u,f++),l[v]={left:0,top:g,row:f,width:m,height:r},c[c.length-1]+=m+o}),d}_fitCols(t,e,i,r){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,g=0,p=0,v=0;return this.legendItems.forEach((m,y)=>{const{itemWidth:x,itemHeight:_}=W0(i,e,a,m,r);y>0&&g+_+2*o>u&&(d+=f+o,c.push({width:f,height:g}),p+=f+o,v++,f=g=0),l[y]={left:p,top:g,col:v,width:x,height:_},f=Math.max(f,x),g+=_+o}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,s=Jn(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=ie(i,this.left+r,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=ie(i,this.left+r,this.right-this.lineWidths[o])),c.top+=this.top+t+r,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+r}else{let o=0,l=ie(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=ie(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+r,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Si(t,this),this._draw(),Ci(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:s}=t,o=Ft.color,l=Jn(t.rtl,this.left,this.width),c=Et(s.font),{padding:u}=s,d=c.size,f=d/2;let g;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;const{boxWidth:p,boxHeight:v,itemHeight:m}=bu(s,d),y=function(C,k,T){if(isNaN(p)||p<=0||isNaN(v)||v<0)return;r.save();const D=nt(T.lineWidth,1);if(r.fillStyle=nt(T.fillStyle,o),r.lineCap=nt(T.lineCap,"butt"),r.lineDashOffset=nt(T.lineDashOffset,0),r.lineJoin=nt(T.lineJoin,"miter"),r.lineWidth=D,r.strokeStyle=nt(T.strokeStyle,o),r.setLineDash(nt(T.lineDash,[])),s.usePointStyle){const O={radius:v*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:D},E=l.xPlus(C,p/2),A=k+f;Xl(r,O,E,A,s.pointStyleWidth&&p)}else{const O=k+Math.max((d-v)/2,0),E=l.leftForLtr(C,p),A=un(T.borderRadius);r.beginPath(),Object.values(A).some(R=>R!==0)?Kn(r,{x:E,y:O,w:p,h:v,radius:A}):r.rect(E,O,p,v),r.fill(),D!==0&&r.stroke()}r.restore()},x=function(C,k,T){On(r,T.text,C,k+m/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?g={x:ie(a,this.left+u,this.right-i[0]),y:this.top+u+w,line:0}:g={x:this.left+u,y:ie(a,this.top+w+u,this.bottom-e[0].height),line:0},sc(this.ctx,t.textDirection);const M=m+u;this.legendItems.forEach((C,k)=>{r.strokeStyle=C.fontColor,r.fillStyle=C.fontColor;const T=r.measureText(C.text).width,D=l.textAlign(C.textAlign||(C.textAlign=s.textAlign)),O=p+f+T;let E=g.x,A=g.y;l.setWidth(this.width),_?k>0&&E+O+u>this.right&&(A=g.y+=M,g.line++,E=g.x=ie(a,this.left+u,this.right-i[g.line])):k>0&&A+M>this.bottom&&(E=g.x=E+e[g.line].width+u,g.line++,A=g.y=ie(a,this.top+w+u,this.bottom-e[g.line].height));const R=l.x(E);if(y(R,A,C),E=ug(D,E+p+f,_?E+O:this.right,t.rtl),x(l.x(E),A,C),_)g.x+=O+u;else if(typeof C.text!="string"){const q=c.lineHeight;g.y+=xu(C,q)+u}else g.y+=M}),oc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Et(e.font),r=Xt(e.padding);if(!e.display)return;const a=Jn(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=i.size/2,c=r.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ie(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((v,m)=>Math.max(v,m.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=ie(o,d,d+f);s.textAlign=a.textAlign(Fa(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,On(s,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=Et(t.font),i=Xt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if($e(t,this.left,this.right)&&$e(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(r=a[i],$e(t,r.left,r.left+r.width)&&$e(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!$0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,a=Y0(r,i);r&&!a&&_t(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&_t(e.onHover,[t,i,this],this)}else i&&_t(e.onClick,[t,i,this],this)}}function W0(n,t,e,i,r){const a=z0(i,n,t,e),s=H0(r,i,t.lineHeight);return{itemWidth:a,itemHeight:s}}function z0(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+i.measureText(r).width}function H0(n,t,e){let i=n;return typeof t.text!="string"&&(i=xu(t,e)),i}function xu(n,t){const e=n.text?n.text.length:0;return t*e}function $0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var j0={id:"legend",_element:vu,start(n,t,e){const i=n.legend=new vu({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,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.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:r,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Xt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:a,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:r||c.textAlign,borderRadius:s&&(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 gs extends te{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 r=yt(i.text)?i.text.length:1;this._padding=Xt(i.padding);const a=r*Et(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=ie(o,i,a),d=e+t,c=a-i):(s.position==="left"?(u=i+t,d=ie(o,r,e),l=ut*-.5):(u=a-t,d=ie(o,e,r),l=ut*.5),c=r-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Et(e.font),a=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);On(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Fa(e.align),textBaseline:"middle",translation:[s,o]})}}function V0(n,t){const e=new gs({ctx:n.ctx,options:t,chart:n});re.configure(n,e,t),re.addBox(n,e),n.titleBlock=e}var q0={id:"title",_element:gs,start(n,t,e){V0(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 Br=new WeakMap;var X0={id:"subtitle",start(n,t,e){const i=new gs({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i),Br.set(n,i)},stop(n){re.removeBox(n,Br.get(n)),Br.delete(n)},beforeUpdate(n,t,e){const i=Br.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 Wi={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t<e;++t){const s=n[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();i+=o.x,r+=o.y,++a}}return{x:i/a,y:r/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=n.length;a<s;++a){const l=n[a].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Gn(t,c);u<r&&(r=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ne(n,t){return t&&(yt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Xe(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
16
|
+
*/class up{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const a=e.listeners[r],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Ul.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.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,r)=>Math.max(i,r._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 r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var qe=new up;const gc="transparent",dp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=$l(n||gc),r=i.valid&&$l(t||gc);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class fp{constructor(t,e,i,r){const a=e[i];r=ki([t.to,r,a,t.from]);const s=ki([t.from,a,r]);this._active=!0,this._fn=t.fn||dp[t.type||typeof s],this._easing=Ti[t.easing]||Ti.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=s,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=ki([t.to,e,r,t.from]),this._from=ki([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<i),!this._active){this._target[r]=o,this._notify(!0);return}if(e<0){this._target[r]=a;return}l=e/i%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(a,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 r=0;r<i.length;r++)i[r][e]()}}class Ga{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!lt(t))return;const e=Object.keys(Ft.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const a=t[r];if(!lt(a))return;const s={};for(const o of e)s[o]=a[o];(yt(a.properties)&&a.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,s)})})}_animateOptions(t,e){const i=e.options,r=gp(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&hp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}a[c]=d=new fp(f,t,c,u),r.push(d)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return qe.add(this._chart,i),!0}}function hp(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const a=n[i[r]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function gp(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 pc(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:i?a:r,end:i?r:a}}function pp(n,t,e){if(e===!1)return!1;const i=pc(n,e),r=pc(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function mp(n){let t,e,i,r;return lt(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function mc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,a;for(r=0,a=i.length;r<a;++r)e.push(i[r].index);return e}function yc(n,t,e,i={}){const r=n.keys,a=i.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=r.length;s<o;++s){if(l=+r[s],l===e){if(i.all)continue;break}c=n.values[l],Lt(c)&&(a||t===0||Le(t)===Le(c))&&(t+=c)}return t}}function yp(n){const t=Object.keys(n),e=new Array(t.length);let i,r,a;for(i=0,r=t.length;i<r;++i)a=t[i],e[i]={x:a,y:n[a]};return e}function bc(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function bp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function vp(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function xp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function vc(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const a=n[r.index];if(e&&a>0||!e&&a<0)return r.index}return null}function xc(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=i,l=a.axis,c=s.axis,u=bp(a,s,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:x,[c]:m}=p,b=p._stacks||(p._stacks={});f=b[c]=xp(r,u,x),f[o]=m,f._top=vc(f,s,!0,i.type),f._bottom=vc(f,s,!1,i.type);const v=f._visualValues||(f._visualValues={});v[o]=m}}function Ka(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function _p(n,t){return dn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function wp(n,t,e){return dn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Oi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const Za=n=>n==="reset"||n==="none",_c=(n,t)=>t?n:Object.assign({},n),Tp=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:mc(e,!0),values:null};class Oe{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=bc(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&&Oi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,a=e.xAxisID=nt(i.xAxisID,Ka(t,"x")),s=e.yAxisID=nt(i.yAxisID,Ka(t,"y")),o=e.rAxisID=nt(i.rAxisID,Ka(t,"r")),l=e.indexAxis,c=e.iAxisID=r(l,a,s,o),u=e.vAxisID=r(l,s,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),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&&Nl(this._data,this),t._stacked&&Oi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(lt(e))this._data=yp(e);else if(i!==e){if(i){Nl(i,this);const r=this._cachedMeta;Oi(r),r._parsed=[]}e&&Object.isExtensible(e)&&lg(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 r=!1;this._dataCheck();const a=e._stacked;e._stacked=bc(e.vScale,e),e.stack!==i.stack&&(r=!0,Oi(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&xc(this,e._parsed)}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:r}=this,{iScale:a,_stacked:s}=i,o=a.axis;let l=t===0&&e===r.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{yt(r[t])?f=this.parseArrayData(i,r,t,e):lt(r[t])?f=this.parseObjectData(i,r,t,e):f=this.parsePrimitiveData(i,r,t,e);const g=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}s&&xc(this,f)}parsePrimitiveData(t,e,i,r){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(r);let f,g,p;for(f=0,g=r;f<g;++f)p=f+i,d[f]={[o]:u||a.parse(c[p],p),[l]:s.parse(e[p],p)};return d}parseArrayData(t,e,i,r){const{xScale:a,yScale:s}=t,o=new Array(r);let l,c,u,d;for(l=0,c=r;l<c;++l)u=l+i,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,i,r){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(r);let u,d,f,g;for(u=0,d=r;u<d;++u)f=u+i,g=e[f],c[u]={x:a.parse(on(g,o),f),y:s.parse(on(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:mc(r,!0),values:e._stacks[t.axis]._visualValues};return yc(o,s,a.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const a=i[e.axis];let s=a===null?NaN:a;const o=r&&i._stacks[e.axis];r&&o&&(r.values=o,s=yc(r,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,a=i._sorted&&t===i.iScale,s=r.length,o=this._getOtherScale(t),l=Tp(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=vp(o);let f,g;function p(){g=r[f];const x=g[o.axis];return!Lt(g[t.axis])||u>x||d<x}for(f=0;f<s&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),a));++f);if(a){for(f=s-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,s;for(r=0,a=e.length;r<a;++r)s=e[r][t.axis],Lt(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=mp(nt(this.options.clip,pp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=r[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,a))}for(u=0;u<s.length;++u)s[u].draw(t,a)}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 r=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=wp(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=_p(this.chart.getContext(),this.index)),a.dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}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 r=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&ue(i);if(o)return _c(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=r?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Ft.elements[t]),p=()=>this.getContext(i,r,e),x=c.resolveNamedOptions(f,g,p,d);return x.$shared&&(x.$shared=l,a[s]=Object.freeze(_c(x,l))),x}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(r.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Ga(r,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Za(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),s=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:s}}updateElement(t,e,i,r){Za(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Za(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}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 r=i.length,a=e.length,s=Math.min(a,r);s&&this.parse(0,s),a>r?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){const r=this._cachedMeta,a=r.data,s=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=s;o--)c[o]=c[o-e]};for(l(a),o=t;o<s;++o)a[o]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Oi(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}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])}}z(Oe,"defaults",{}),z(Oe,"datasetElementType",null),z(Oe,"dataElementType",null);function Dp(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,a=e.length;r<a;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=Fl(i.sort((r,a)=>r-a))}return n._cache.$bar}function Mp(n){const t=n.iScale,e=Dp(t,n.type);let i=t._length,r,a,s,o;const l=()=>{s===32767||s===-32768||(ue(o)&&(i=Math.min(i,Math.abs(s-o)||i)),o=s)};for(r=0,a=e.length;r<a;++r)s=t.getPixelForValue(e[r]),l();for(o=void 0,r=0,a=t.ticks.length;r<a;++r)s=t.getPixelForTick(r),l();return i}function Sp(n,t,e,i){const r=e.barThickness;let a,s;return it(r)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=r*i,s=1),{chunk:a/i,ratio:s,start:t.pixels[n]-a/2}}function Cp(n,t,e,i){const r=t.pixels,a=r[n];let s=n>0?r[n-1]:null,o=n<r.length-1?r[n+1]:null;const l=e.categoryPercentage;s===null&&(s=a-(o===null?t.end-t.start:o-a)),o===null&&(o=a+a-s);const c=a-(a-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/i,ratio:e.barPercentage,start:c}}function kp(n,t,e,i){const r=e.parse(n[0],i),a=e.parse(n[1],i),s=Math.min(r,a),o=Math.max(r,a);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:r,end:a,min:s,max:o}}function wc(n,t,e,i){return yt(n)?kp(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Tc(n,t,e,i){const r=n.iScale,a=n.vScale,s=r.getLabels(),o=r===a,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[r.axis]=o||r.parse(s[c],c),l.push(wc(f,d,a,c));return l}function Qa(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Op(n,t,e){return n!==0?Le(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Pp(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",a="start"):(r="start",a="end"),{start:e,end:i,reverse:t,top:r,bottom:a}}function Ep(n,t,e,i){let r=t.borderSkipped;const a={};if(!r){n.borderSkipped=a;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Pp(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=c:(e._bottom||0)===i?r=u:(a[Dc(u,s,o,l)]=!0,r=c)),a[Dc(r,s,o,l)]=!0,n.borderSkipped=a}function Dc(n,t,e,i){return i?(n=Ap(n,t,e),n=Mc(n,e,t)):n=Mc(n,t,e),n}function Ap(n,t,e){return n===t?e:n===e?t:n}function Mc(n,t,e){return n==="start"?t:n==="end"?e:n}function Rp(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Pi extends Oe{parsePrimitiveData(t,e,i,r){return Tc(t,e,i,r)}parseArrayData(t,e,i,r){return Tc(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:a,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=a.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let f,g,p,x;for(f=i,g=i+r;f<g;++f)x=e[f],p={},p[a.axis]=a.parse(on(x,c),f),d.push(wc(on(x,u),p,s,f));return d}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,a=this.getParsed(t),s=a._custom,o=Qa(s)?"["+s.start+", "+s.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+i.getLabelForValue(a[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,r){const a=r==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,r);for(let g=e;g<e+i;g++){const p=this.getParsed(g),x=a||it(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),m=this._calculateBarIndexPixels(g,u),b=(p._stacks||{})[o.axis],v={horizontal:c,base:x.base,enableBorderRadius:!b||Qa(p._custom)||s===b._top||s===b._bottom,x:c?x.head:m.center,y:c?m.center:x.head,height:c?m.size:Math.abs(x.size),width:c?Math.abs(x.size):m.size};f&&(v.options=d||this.resolveDataElementOptions(g,t[g].active?"active":r));const _=v.options||t[g].options;Ep(v,_,b,s),Rp(v,_,u.ratio),this.updateElement(t[g],g,v,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=i.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(it(u)||isNaN(u))return!0};for(const l of r)if(!(e!==void 0&&o(l))&&((a===!1||s.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,s;for(a=0,s=e.data.length;a<s;++a)r.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const o=t.barThickness;return{min:o||Mp(e),pixels:r,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:r},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=Qa(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,x;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Le(d)!==Le(c.barEnd)&&(f=0),f+=d);const m=!it(a)&&!u?a:f;let b=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=b,x=p-b,Math.abs(x)<s){x=Op(x,e,o)*s,d===o&&(b-=x/2);const v=e.getPixelForDecimal(0),_=e.getPixelForDecimal(1),w=Math.min(v,_),M=Math.max(v,_);b=Math.max(Math.min(b,M),w),p=b+x,i&&!u&&(l._stacks[e.axis]._visualValues[r]=e.getValueForPixel(p)-e.getValueForPixel(b))}if(b===e.getPixelForValue(o)){const v=Le(x)*e.getLineWidthForValue(o)/2;b+=v,x-=v}return{size:x,base:b,head:p,center:p+x/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,a=r.skipNull,s=nt(r.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=r.barThickness==="flex"?Cp(t,e,r,c):Sp(t,e,r,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(s,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,r=i.length;let a=0;for(;a<r;++a)this.getParsed(a)[e.axis]!==null&&i[a].draw(this._ctx)}}z(Pi,"id","bar"),z(Pi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),z(Pi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Mr extends Oe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const a=super.parsePrimitiveData(t,e,i,r);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+i).radius;return a}parseArrayData(t,e,i,r){const a=super.parseArrayData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=nt(o[2],this.resolveDataElementOptions(s+i).radius)}return a}parseObjectData(t,e,i,r){const a=super.parseObjectData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=nt(o&&o.r&&+o.r,this.resolveDataElementOptions(s+i).radius)}return a}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:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._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,r){const a=r==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,r),u=s.axis,d=o.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!a&&this.getParsed(f),x={},m=x[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),b=x[d]=a?o.getBasePixel():o.getPixelForValue(p[d]);x.skip=isNaN(m)||isNaN(b),c&&(x.options=l||this.resolveDataElementOptions(f,g.active?"active":r),a&&(x.options.radius=0)),this.updateElement(g,f,x,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return e!=="active"&&(r.radius=0),r.radius+=nt(i&&i._custom,a),r}}z(Mr,"id","bubble"),z(Mr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),z(Mr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Lp(n,t,e){let i=1,r=1,a=0,s=0;if(t<kt){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),f=Math.sin(l),g=(_,w,M)=>wi(_,o,l,!0)?1:Math.max(w,w*e,M,M*e),p=(_,w,M)=>wi(_,o,l,!0)?-1:Math.min(w,w*e,M,M*e),x=g(0,c,d),m=g(Pt,u,f),b=p(ut,c,d),v=p(ut+Pt,u,f);i=(x-b)/2,r=(m-v)/2,a=-(x+b)/2,s=-(m+v)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:s}}class hn extends Oe{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,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=l=>+i[l];if(lt(i[t])){const{key:l="value"}=this._parsing;a=c=>+on(i[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)r._parsed[s]=a(s)}}_getRotation(){return qt(this.options.rotation-90)}_getCircumference(){return qt(this.options.circumference)}_getRotationExtents(){let t=kt,e=-kt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,a=r._getRotation(),s=r._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,a=r.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),l=Math.min(Gh(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:x}=Lp(d,u,l),m=(i.width-s)/f,b=(i.height-s)/g,v=Math.max(Math.min(m,b)/2,0),_=Cl(this.options.radius,v),w=Math.max(_*l,0),M=(_-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=x*_,r.total=this.calculateTotal(),this.outerRadius=_-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*a/kt)}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=a&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:x,includeOptions:m}=this._getSharedOptions(e,r);let b=this._getRotation(),v;for(v=0;v<e;++v)b+=this._circumference(v,a);for(v=e;v<e+i;++v){const _=this._circumference(v,a),w=t[v],M={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:p,innerRadius:g};m&&(M.options=x||this.resolveDataElementOptions(v,w.active?"active":r)),b+=_,this.updateElement(w,v,M,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const a=t._parsed[r];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(a))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?kt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Di(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,s,o,l;if(!t){for(r=0,a=i.data.datasets.length;r<a;++r)if(i.isDatasetVisible(r)){s=i.getDatasetMeta(r),t=s.data,o=s.controller;break}}if(!t)return 0;for(r=0,a=t.length;r<a;++r)l=o.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.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(nt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}z(hn,"id","doughnut"),z(hn,"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"}),z(hn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),z(hn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Ei extends Oe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=Yl(e,r,s);this._drawStart=o,this._drawCount=l,Wl(e)&&(o=0,l=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:c},t),this.updateElements(r,o,l,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),f=s.axis,g=o.axis,{spanGaps:p,segment:x}=this.options,m=cn(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||r==="none",v=e+i,_=t.length;let w=e>0&&this.getParsed(e-1);for(let M=0;M<_;++M){const C=t[M],k=b?C:{};if(M<e||M>=v){k.skip=!0;continue}const T=this.getParsed(M),D=it(T[g]),O=k[f]=s.getPixelForValue(T[f],M),E=k[g]=a||D?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,T,l):T[g],M);k.skip=isNaN(O)||isNaN(E)||D,k.stop=M>0&&Math.abs(T[f]-w[f])>m,x&&(k.parsed=T,k.raw=c.data[M]),d&&(k.options=u||this.resolveDataElementOptions(M,C.active?"active":r)),b||this.updateElement(C,M,k,r),w=T}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}z(Ei,"id","line"),z(Ei,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),z(Ei,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ai extends Oe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Di(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return nc.bind(this)(t,e,i,r)}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,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),s=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*ut;let g=f,p;const x=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,r,x);for(p=e;p<e+i;p++){const m=t[p];let b=g,v=g+this._computeAngle(p,r,x),_=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=v,a&&(l.animateScale&&(_=0),l.animateRotate&&(b=v=f));const w={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:b,endAngle:v,options:this.resolveDataElementOptions(p,m.active?"active":r)};this.updateElement(m,p,w,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?qt(this.resolveDataElementOptions(t,e).angle||i):0}}z(Ai,"id","polarArea"),z(Ai,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),z(Ai,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}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 Ja extends hn{}z(Ja,"id","pie"),z(Ja,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Sr extends Oe{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,r){return nc.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===r.length,options:s};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,s=r==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":r),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,f=s?a.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,g,r)}}}z(Sr,"id","radar"),z(Sr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),z(Sr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cr extends Oe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:a,count:s}=Yl(e,i,r);if(this._drawStart=a,this._drawCount=s,Wl(e)&&(a=0,s=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:!r,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,r),d=this.getSharedOptions(u),f=this.includeOptions(r,d),g=s.axis,p=o.axis,{spanGaps:x,segment:m}=this.options,b=cn(x)?x:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||a||r==="none";let _=e>0&&this.getParsed(e-1);for(let w=e;w<e+i;++w){const M=t[w],C=this.getParsed(w),k=v?M:{},T=it(C[p]),D=k[g]=s.getPixelForValue(C[g],w),O=k[p]=a||T?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,C,l):C[p],w);k.skip=isNaN(D)||isNaN(O)||T,k.stop=w>0&&Math.abs(C[g]-_[g])>b,m&&(k.parsed=C,k.raw=c.data[w]),f&&(k.options=d||this.resolveDataElementOptions(w,M.active?"active":r)),v||this.updateElement(M,w,k,r),_=C}this.updateSharedOptions(d,r,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,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,s)/2}}z(Cr,"id","scatter"),z(Cr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),z(Cr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Ip=Object.freeze({__proto__:null,BarController:Pi,BubbleController:Mr,DoughnutController:hn,LineController:Ei,PieController:Ja,PolarAreaController:Ai,RadarController:Sr,ScatterController:Cr});function An(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ts{constructor(t){z(this,"options");this.options=t||{}}static override(t){Object.assign(ts.prototype,t)}init(){}formats(){return An()}parse(){return An()}format(){return An()}add(){return An()}diff(){return An()}startOf(){return An()}endOf(){return An()}}var Sc={_date:ts};function Np(n,t,e,i){const{controller:r,data:a,_sorted:s}=n,o=r._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?sg:je;if(i){if(r._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),f=l(a,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Ri(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),s=e[t];for(let o=0,l=a.length;o<l;++o){const{index:c,data:u}=a[o],{lo:d,hi:f}=Np(a[o],t,s,r);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Fp(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const a=t?Math.abs(i.x-r.x):0,s=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function es(n,t,e,i,r){const a=[];return!r&&!n.isPointInArea(t)||Ri(n,e,t,function(o,l,c){!r&&!Ve(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function Up(n,t,e,i){let r=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],i),{angle:d}=Ll(s,{x:t.x,y:t.y});wi(d,c,u)&&r.push({element:s,datasetIndex:o,index:l})}return Ri(n,e,t,a),r}function Bp(n,t,e,i,r,a){let s=[];const o=Fp(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,r);if(i&&!g)return;const p=u.getCenterPoint(r);if(!(!!a||n.isPointInArea(p))&&!g)return;const m=o(t,p);m<l?(s=[{element:u,datasetIndex:d,index:f}],l=m):m===l&&s.push({element:u,datasetIndex:d,index:f})}return Ri(n,e,t,c),s}function ns(n,t,e,i,r,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!i?Up(n,t,e,r):Bp(n,t,e,i,r,a)}function Cc(n,t,e,i,r){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Ri(n,e,t,(l,c,u)=>{l[s](t[e],r)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,r))}),i&&!o?[]:a}var is={evaluateInteractionItems:Ri,modes:{index(n,t,e,i){const r=fn(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?es(n,r,a,i,s):ns(n,r,a,!1,i,s),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?es(n,r,a,i,s):ns(n,r,a,!1,i,s);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 r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return es(n,r,a,i,s)},nearest(n,t,e,i){const r=fn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return ns(n,r,a,e.intersect,i,s)},x(n,t,e,i){const r=fn(t,n);return Cc(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=fn(t,n);return Cc(n,r,"y",e.intersect,i)}}};const kc=["left","top","right","bottom"];function Li(n,t){return n.filter(e=>e.pos===t)}function Oc(n,t){return n.filter(e=>kc.indexOf(e.pos)===-1&&e.box.axis===t)}function Ii(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function Yp(n){const t=[];let e,i,r,a,s,o;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=r,t.push({index:e,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:s&&a+s,stackWeight:o});return t}function Wp(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:a}=e;if(!i||!kc.includes(r))continue;const s=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function zp(n,t){const e=Wp(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let a,s,o;for(a=0,s=n.length;a<s;++a){o=n[a];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=r):(o.width=i,o.height=u?u*r:l&&t.availableHeight)}return e}function Hp(n){const t=Yp(n),e=Ii(t.filter(c=>c.box.fullSize),!0),i=Ii(Li(t,"left"),!0),r=Ii(Li(t,"right")),a=Ii(Li(t,"top"),!0),s=Ii(Li(t,"bottom")),o=Oc(t,"x"),l=Oc(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(l).concat(s).concat(o),chartArea:Li(t,"chartArea"),vertical:i.concat(r).concat(l),horizontal:a.concat(s).concat(o)}}function Pc(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Ec(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 $p(n,t,e,i){const{pos:r,box:a}=e,s=n.maxPadding;if(!lt(r)){e.size&&(n[r]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?a.height:a.width),e.size=d.size/d.count,n[r]+=e.size}a.getPadding&&Ec(s,a.getPadding());const o=Math.max(0,t.outerWidth-Pc(s,n,"left","right")),l=Math.max(0,t.outerHeight-Pc(s,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 jp(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Vp(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return i(n?["left","right"]:["top","bottom"])}function Ni(n,t,e,i){const r=[];let a,s,o,l,c,u;for(a=0,s=n.length,c=0;a<s;++a){o=n[a],l=o.box,l.update(o.width||t.w,o.height||t.h,Vp(o.horizontal,t));const{same:d,other:f}=$p(t,e,o,i);c|=d&&r.length,u=u||f,l.fullSize||r.push(o)}return c&&Ni(r,t,e,i)||u}function kr(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function Ac(n,t,e,i){const r=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=i[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;ue(c.start)&&(s=c.start),l.fullSize?kr(l,r.left,s,e.outerWidth-r.right-r.left,f):kr(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;ue(c.start)&&(a=c.start),l.fullSize?kr(l,a,r.top,f,e.outerHeight-r.bottom-r.top):kr(l,a,t.top+c.placed,f,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}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 r=Xt(n.options.layout.padding),a=Math.max(t-r.width,0),s=Math.max(e-r.height,0),o=Hp(n.boxes),l=o.vertical,c=o.horizontal;wt(n.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const u=l.reduce((x,m)=>m.box.options&&m.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},r);Ec(f,Xt(i));const g=Object.assign({maxPadding:f,w:a,h:s,x:r.left,y:r.top},r),p=zp(l.concat(c),d);Ni(o.fullSize,g,d,p),Ni(l,g,d,p),Ni(c,g,d,p)&&Ni(l,g,d,p),jp(g),Ac(o.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Ac(o.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},wt(o.chartArea,x=>{const m=x.box;Object.assign(m,n.chartArea),m.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Rc{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class qp extends Rc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Or="$chartjs",Xp={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Lc=n=>n===null||n==="";function Gp(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Or]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Lc(r)){const a=ac(n,"width");a!==void 0&&(n.width=a)}if(Lc(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=ac(n,"height");a!==void 0&&(n.height=a)}return n}const Ic=Jg?{passive:!0}:!1;function Kp(n,t,e){n.addEventListener(t,e,Ic)}function Zp(n,t,e){n.canvas.removeEventListener(t,e,Ic)}function Qp(n,t){const e=Xp[n.type]||n.type,{x:i,y:r}=fn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Pr(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Jp(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Pr(o.addedNodes,i),s=s&&!Pr(o.removedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function tm(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Pr(o.removedNodes,i),s=s&&!Pr(o.addedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const Fi=new Map;let Nc=0;function Fc(){const n=window.devicePixelRatio;n!==Nc&&(Nc=n,Fi.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function em(n,t){Fi.size||window.addEventListener("resize",Fc),Fi.set(n,t)}function nm(n){Fi.delete(n),Fi.size||window.removeEventListener("resize",Fc)}function im(n,t,e){const i=n.canvas,r=i&&Xa(i);if(!r)return;const a=Bl((o,l)=>{const c=r.clientWidth;e(o,l),c<r.clientWidth&&e()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||a(c,u)});return s.observe(r),em(n,a),s}function rs(n,t,e){e&&e.disconnect(),t==="resize"&&nm(n)}function rm(n,t,e){const i=n.canvas,r=Bl(a=>{n.ctx!==null&&e(Qp(a,n))},n);return Kp(i,t,r),r}class am extends Rc{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Gp(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Or])return!1;const i=e[Or].initial;["height","width"].forEach(a=>{const s=i[a];it(s)?e.removeAttribute(a):e.setAttribute(a,s)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[Or],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),s={attach:Jp,detach:tm,resize:im}[e]||rm;r[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:rs,detach:rs,resize:rs}[e]||Zp)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return Qg(t,e,i,r)}isAttached(t){const e=Xa(t);return!!(e&&e.isConnected)}}function sm(n){return!qa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?qp:am}class te{constructor(){z(this,"x");z(this,"y");z(this,"active",!1);z(this,"options");z(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return cn(this.x)&&cn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}z(te,"defaults",{}),z(te,"defaultRoutes");function om(n,t){const e=n.options.ticks,i=lm(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?um(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>r)return dm(t,c,a,s/r),c;const u=cm(a,t,r);if(s>0){let d,f;const g=s>1?Math.round((l-o)/(s-1)):null;for(Er(t,c,u,it(g)?0:o-g,o),d=0,f=s-1;d<f;d++)Er(t,c,u,a[d],a[d+1]);return Er(t,c,u,l,it(g)?t.length:l+g),c}return Er(t,c,u),c}function lm(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function cm(n,t,e){const i=fm(n),r=t.length/e;if(!i)return Math.max(r,1);const a=ng(i);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>r)return l}return Math.max(r,1)}function um(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function dm(n,t,e,i){let r=0,a=e[0],s;for(i=Math.ceil(i),s=0;s<n.length;s++)s===a&&(t.push(n[s]),r++,a=e[r*i])}function Er(n,t,e,i,r){const a=nt(i,0),s=Math.min(nt(r,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),r&&(l=r-i,e=l/Math.floor(l/e)),u=a;u<0;)o++,u=Math.round(a+o*e);for(c=Math.max(a,0);c<s;c++)c===u&&(t.push(n[c]),o++,u=Math.round(a+o*e))}function fm(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 hm=n=>n==="left"?"right":n==="right"?"left":n,Uc=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Bc=(n,t)=>Math.min(t||n,n);function Yc(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;a<r;a+=i)e.push(n[Math.floor(a)]);return e}function gm(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(r),c;if(!(e&&(i===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(r-1))/2,l+=r<t?c:-c,l<a-o||l>s+o)))return l}function pm(n,t){wt(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;a<r;++a)delete e.data[i[a]];i.splice(0,r)}})}function Ui(n){return n.drawTicks?n.tickLength:0}function Wc(n,t){if(!n.display)return 0;const e=Et(n.font,t),i=Xt(n.padding);return(yt(n.text)?n.text.length:1)*e.lineHeight+i.height}function mm(n,t){return dn(n,{scale:t,type:"scale"})}function ym(n,t,e){return dn(n,{tick:e,index:t,type:"tick"})}function bm(n,t,e){let i=Fa(n);return(e&&t!=="right"||!e&&t==="right")&&(i=hm(i)),i}function vm(n,t,e,i){const{top:r,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const x=s-r,m=o-a;if(n.isHorizontal()){if(g=ie(i,a,o),lt(e)){const b=Object.keys(e)[0],v=e[b];p=u[b].getPixelForValue(v)+x-t}else e==="center"?p=(c.bottom+c.top)/2+x-t:p=Uc(n,e,t);f=o-a}else{if(lt(e)){const b=Object.keys(e)[0],v=e[b];g=u[b].getPixelForValue(v)-m+t}else e==="center"?g=(c.left+c.right)/2-m+t:g=Uc(n,e,t);p=ie(i,s,r),d=e==="left"?-Pt:Pt}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class Rn extends te{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:r}=this;return t=be(t,Number.POSITIVE_INFINITY),e=be(e,Number.NEGATIVE_INFINITY),i=be(i,Number.POSITIVE_INFINITY),r=be(r,Number.NEGATIVE_INFINITY),{min:be(t,i),max:be(e,r),minDefined:Lt(t),maxDefined:Lt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:a}=this.getUserBounds(),s;if(r&&a)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),r||(e=Math.min(e,s.min)),a||(i=Math.max(i,s.max));return e=a&&e>i?i:e,i=r&&e>i?e:i,{min:be(e,be(i,e)),max:be(i,be(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(){_t(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:s}=this.options,o=s.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=Pg(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Yc(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=om(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(){_t(this.options.afterUpdate,[this])}beforeSetDimensions(){_t(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(){_t(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),_t(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){_t(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,a;for(i=0,r=t.length;i<r;i++)a=t[i],a.label=_t(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){_t(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){_t(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Bc(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,a=e.maxRotation;let s=r,o,l,c;if(!this._isVisible()||!e.display||r>=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=Zt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/i:g/(i-1),d+6>o&&(o=g/(i-(t.offset?.5:1)),l=this.maxHeight-Ui(t.grid)-e.padding-Wc(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=yr(Math.min(Math.asin(Zt((u.highest.height+6)/o,-1,1)),Math.asin(Zt(l/c,-1,1))-Math.asin(Zt(f/c,-1,1)))),s=Math.max(r,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){_t(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){_t(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=Wc(r,e.options.font);if(o?(t.width=this.maxWidth,t.height=Ui(a)+l):(t.height=this.maxHeight,t.width=Ui(a)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=qt(this.labelRotation),x=Math.cos(p),m=Math.sin(p);if(o){const b=i.mirror?0:m*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+b+g)}else{const b=i.mirror?0:x*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+b+g)}this._calculatePadding(c,u,m,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,r){const{ticks:{align:a,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=r*t.width,g=i*e.height):(f=i*t.height,g=r*e.width):a==="start"?g=e.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+s)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;a==="start"?(u=0,d=t.height):a==="end"&&(u=e.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){_t(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++)it(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=Yc(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/Bc(e,i));let c=0,u=0,d,f,g,p,x,m,b,v,_,w,M;for(d=0;d<e;d+=l){if(p=t[d].label,x=this._resolveTickFontOptions(d),r.font=m=x.string,b=a[m]=a[m]||{data:{},gc:[]},v=x.lineHeight,_=w=0,!it(p)&&!yt(p))_=xr(r,b.data,b.gc,_,p),w=v;else if(yt(p))for(f=0,g=p.length;f<g;++f)M=p[f],!it(M)&&!yt(M)&&(_=xr(r,b.data,b.gc,_,M),w+=v);s.push(_),o.push(w),c=Math.max(_,c),u=Math.max(w,u)}pm(a,e);const C=s.indexOf(c),k=o.indexOf(u),T=D=>({width:s[D]||0,height:o[D]||0});return{first:T(0),last:T(e-1),widest:T(C),highest:T(k),widths:s,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 ag(this._alignToPixels?kn(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=ym(this.getContext(),t,i))}return this.$context||(this.$context=mm(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=qt(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,o=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return this.isHorizontal()?l*i>o*r?o/i:l/r:l*r<o*i?l/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:s,border:o}=r,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ui(a),g=[],p=o.setContext(this.getContext()),x=p.display?p.width:0,m=x/2,b=function(B){return kn(i,B,x)};let v,_,w,M,C,k,T,D,O,E,A,R;if(s==="top")v=b(this.bottom),k=this.bottom-f,D=v-m,E=b(t.top)+m,R=t.bottom;else if(s==="bottom")v=b(this.top),E=t.top,R=b(t.bottom)-m,k=v+m,D=this.top+f;else if(s==="left")v=b(this.right),C=this.right-f,T=v-m,O=b(t.left)+m,A=t.right;else if(s==="right")v=b(this.left),O=t.left,A=b(t.right)-m,C=v+m,T=this.left+f;else if(e==="x"){if(s==="center")v=b((t.top+t.bottom)/2+.5);else if(lt(s)){const B=Object.keys(s)[0],I=s[B];v=b(this.chart.scales[B].getPixelForValue(I))}E=t.top,R=t.bottom,k=v+m,D=k+f}else if(e==="y"){if(s==="center")v=b((t.left+t.right)/2);else if(lt(s)){const B=Object.keys(s)[0],I=s[B];v=b(this.chart.scales[B].getPixelForValue(I))}C=v-m,T=C-f,O=t.left,A=t.right}const q=nt(r.ticks.maxTicksLimit,d),H=Math.max(1,Math.ceil(d/q));for(_=0;_<d;_+=H){const B=this.getContext(_),I=a.setContext(B),rt=o.setContext(B),W=I.lineWidth,Ct=I.color,mt=rt.dash||[],$=rt.dashOffset,N=I.tickWidth,Y=I.tickColor,V=I.tickBorderDash||[],Z=I.tickBorderDashOffset;w=gm(this,_,l),w!==void 0&&(M=kn(i,w,W),c?C=T=O=A=M:k=D=E=R=M,g.push({tx1:C,ty1:k,tx2:T,ty2:D,x1:O,y1:E,x2:A,y2:R,width:W,color:Ct,borderDash:mt,borderDashOffset:$,tickWidth:N,tickColor:Y,tickBorderDash:V,tickBorderDashOffset:Z}))}return this._ticksLength=d,this._borderValue=v,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:a}=i,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,f=Ui(i.grid),g=f+u,p=d?-u:g,x=-qt(this.labelRotation),m=[];let b,v,_,w,M,C,k,T,D,O,E,A,R="middle";if(r==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(r==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(r==="left"){const H=this._getYAxisLabelAlignment(f);k=H.textAlign,M=H.x}else if(r==="right"){const H=this._getYAxisLabelAlignment(f);k=H.textAlign,M=H.x}else if(e==="x"){if(r==="center")C=(t.top+t.bottom)/2+g;else if(lt(r)){const H=Object.keys(r)[0],B=r[H];C=this.chart.scales[H].getPixelForValue(B)+g}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")M=(t.left+t.right)/2-g;else if(lt(r)){const H=Object.keys(r)[0],B=r[H];M=this.chart.scales[H].getPixelForValue(B)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?R="top":l==="end"&&(R="bottom"));const q=this._getLabelSizes();for(b=0,v=o.length;b<v;++b){_=o[b],w=_.label;const H=a.setContext(this.getContext(b));T=this.getPixelForTick(b)+a.labelOffset,D=this._resolveTickFontOptions(b),O=D.lineHeight,E=yt(w)?w.length:1;const B=E/2,I=H.color,rt=H.textStrokeColor,W=H.textStrokeWidth;let Ct=k;s?(M=T,k==="inner"&&(b===v-1?Ct=this.options.reverse?"left":"right":b===0?Ct=this.options.reverse?"right":"left":Ct="center"),r==="top"?c==="near"||x!==0?A=-E*O+O/2:c==="center"?A=-q.highest.height/2-B*O+O:A=-q.highest.height+O/2:c==="near"||x!==0?A=O/2:c==="center"?A=q.highest.height/2-B*O:A=q.highest.height-E*O,d&&(A*=-1),x!==0&&!H.showLabelBackdrop&&(M+=O/2*Math.sin(x))):(C=T,A=(1-E)*O/2);let mt;if(H.showLabelBackdrop){const $=Xt(H.backdropPadding),N=q.heights[b],Y=q.widths[b];let V=A-$.top,Z=0-$.left;switch(R){case"middle":V-=N/2;break;case"bottom":V-=N;break}switch(k){case"center":Z-=Y/2;break;case"right":Z-=Y;break;case"inner":b===v-1?Z-=Y:b>0&&(Z-=Y/2);break}mt={left:Z,top:V,width:Y+$.width,height:N+$.height,color:H.backdropColor}}m.push({label:w,font:D,textOffset:A,options:{rotation:x,color:I,strokeColor:rt,strokeWidth:W,textAlign:Ct,textBaseline:R,translation:[M,C],backdrop:mt}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-qt(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?r?(u=this.right+a,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"?r?(u=this.left+a,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:r,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(a=>a.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;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(a=0,s=r.length;a<s;++a){const l=r[a];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:r}}=this,a=i.setContext(this.getContext()),s=i.display?a.width:0;if(!s)return;const o=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=kn(t,this.left,s)-s/2,u=kn(t,this.right,o)+o/2,d=f=l):(d=kn(t,this.top,s)-s/2,f=kn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Si(i,r);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;On(i,c,0,u,l,o)}r&&Ci(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const a=Et(i.font),s=Xt(i.padding),o=i.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||lt(e)?(l+=s.bottom,yt(i.text)&&(l+=a.lineHeight*(i.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=vm(this,l,e,o);On(t,i.text,0,0,a,{color:i.color,maxWidth:d,rotation:f,textAlign:bm(o,e,r),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=nt(t.grid&&t.grid.z,-1),r=nt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Rn.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Et(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ar{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;wm(e)&&(i=this.register(e));const r=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in r||(r[a]=t,xm(t,s,i),this.override&&Ft.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in Ft[r]&&(delete Ft[r][i],this.override&&delete Cn[i])}}function xm(n,t,e){const i=vi(Object.create(null),[e?Ft.get(e):{},Ft.get(t),n.defaults]);Ft.set(t,i),n.defaultRoutes&&_m(t,n.defaultRoutes),n.descriptors&&Ft.describe(t,n.descriptors)}function _m(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");Ft.route(a,r,l,o)})}function wm(n){return"id"in n&&"defaults"in n}class Tm{constructor(){this.controllers=new Ar(Oe,"datasets",!0),this.elements=new Ar(te,"elements"),this.plugins=new Ar(Object,"plugins"),this.scales=new Ar(Rn,"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(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):wt(r,s=>{const o=i||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,i){const r=La(t);_t(i["before"+r],[],i),e[t](i),_t(i["after"+r],[],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 r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Ie=new Tm;class Dm{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=r?this._descriptors(t).filter(r):this._descriptors(t),s=this._notify(a,t,e,i);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,r){r=r||{};for(const a of t){const s=a.plugin,o=s[i],l=[e,r,a.options];if(_t(o,l,s)===!1&&r.cancelable)return!1}return!0}invalidate(){it(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,r=nt(i.options&&i.options.plugins,{}),a=Mm(i);return r===!1&&!e?[]:Cm(t,a,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function Mm(n){const t={},e=[],i=Object.keys(Ie.plugins.items);for(let a=0;a<i.length;a++)e.push(Ie.getPlugin(i[a]));const r=n.plugins||[];for(let a=0;a<r.length;a++){const s=r[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function Sm(n,t){return!t&&n===!1?null:n===!0?{}:n}function Cm(n,{plugins:t,localIds:e},i,r){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=Sm(i[l],r);c!==null&&a.push({plugin:o,options:km(n.config,{plugin:o,local:e[l]},c,s)})}return a}function km(n,{plugin:t,local:e},i,r){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(i,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function as(n,t){const e=Ft.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Om(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Pm(n,t){return n===t?"_index_":"_value_"}function zc(n){if(n==="x"||n==="y"||n==="r")return n}function Em(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ss(n,...t){if(zc(n))return n;for(const e of t){const i=e.axis||Em(e.position)||n.length>1&&zc(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Hc(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Am(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 Hc(n,"x",e[0])||Hc(n,"y",e[0])}return{}}function Rm(n,t){const e=Cn[n.type]||{scales:{}},i=t.scales||{},r=as(n.type,t),a=Object.create(null);return Object.keys(i).forEach(s=>{const o=i[s];if(!lt(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=ss(s,o,Am(s,n),Ft.scales[o.type]),c=Pm(l,r),u=e.scales||{};a[s]=xi(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||as(o,t),u=(Cn[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Om(d,l),g=s[f+"AxisID"]||f;a[g]=a[g]||Object.create(null),xi(a[g],[{axis:f},i[g],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];xi(o,[Ft.scales[o.type],Ft.scale])}),a}function $c(n){const t=n.options||(n.options={});t.plugins=nt(t.plugins,{}),t.scales=Rm(n,t)}function jc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Lm(n){return n=n||{},n.data=jc(n.data),$c(n),n}const Vc=new Map,qc=new Set;function Rr(n,t){let e=Vc.get(n);return e||(e=t(),Vc.set(n,e),qc.add(e)),e}const Bi=(n,t,e)=>{const i=on(t,e);i!==void 0&&n.add(i)};class Im{constructor(t){this._config=Lm(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=jc(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(),$c(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Rr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Rr(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Rr(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Rr(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>Bi(l,t,d))),u.forEach(d=>Bi(l,r,d)),u.forEach(d=>Bi(l,Cn[a]||{},d)),u.forEach(d=>Bi(l,Ft,d)),u.forEach(d=>Bi(l,Ya,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qc.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Cn[e]||{},Ft.datasets[e]||{},{type:e},Ft,Ya]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Xc(this._resolverCache,t,r);let l=s;if(Fm(s,e)){a.$shared=!1,i=de(i)?i():i;const c=this.createResolver(t,i,o);l=Zn(s,i,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,i=[""],r){const{resolver:a}=Xc(this._resolverCache,t,i);return lt(e)?Zn(a,e,void 0,r):a}}function Xc(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:$a(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,a)),a}const Nm=n=>lt(n)&&Object.getOwnPropertyNames(n).some(t=>de(n[t]));function Fm(n,t){const{isScriptable:e,isIndexable:i}=Kl(n);for(const r of t){const a=e(r),s=i(r),o=(s||a)&&n[r];if(a&&(de(o)||Nm(o))||s&&yt(o))return!0}return!1}var Um="4.4.1";const Bm=["top","bottom","left","right","chartArea"];function Gc(n,t){return n==="top"||n==="bottom"||Bm.indexOf(n)===-1&&t==="x"}function Kc(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Zc(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),_t(e&&e.onComplete,[n],t)}function Ym(n){const t=n.chart,e=t.options.animation;_t(e&&e.onProgress,[n],t)}function Qc(n){return qa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Lr={},Jc=n=>{const t=Qc(n);return Object.values(Lr).filter(e=>e.canvas===t).pop()};function Wm(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const s=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=s)}}}function zm(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Ir(n,t,e){return n.options.clip?n[e]:t[e]}function Hm(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Ir(e,t,"left"),right:Ir(e,t,"right"),top:Ir(i,t,"top"),bottom:Ir(i,t,"bottom")}:t}let Te=(Tn=class{static register(...t){Ie.add(...t),tu()}static unregister(...t){Ie.remove(...t),tu()}constructor(t,e){const i=this.config=new Im(e),r=Qc(t),a=Jc(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||sm(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Xh(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Dm,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=cg(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Lr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}qe.listen(this,"complete",Zc),qe.listen(this,"progress",Ym),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return it(t)?e&&a?a:r?i/r: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 Ie}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ql(this.canvas,this.ctx),this}stop(){return qe.stop(this),this}resize(t,e){qe.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(r,t,e,a),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,rc(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),_t(i.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};wt(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=ss(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),wt(a,s=>{const o=s.options,l=o.id,c=ss(l,o),u=nt(o.type,s.dtype);(o.position===void 0||Gc(o.position,c)!==Gc(s.dposition))&&(o.position=s.dposition),r[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=Ie.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(o,t)}),wt(r,(s,o)=>{s||delete i[o]}),wt(i,s=>{re.configure(this,s,s.options),re.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Kc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const a=e[i];let s=this.getDatasetMeta(i);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=o,s.indexAxis=a.indexAxis||as(o,this.options),s.order=a.order||0,s.index=i,s.label=""+a.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const l=Ie.getController(o),{datasetElementType:c,dataElementType:u}=Ft.datasets[o];Object.assign(l,{dataElementType:Ie.getElement(u),datasetElementType:c&&Ie.getElement(c)}),s.controller=new l(this,i),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){wt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!r&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),r||wt(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Kc("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){wt(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);(!Pl(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const s=i==="_removeElements"?-a:a;Wm(t,r,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),r=i(0);for(let a=1;a<e;a++)if(!Pl(r,i(a)))return;return Array.from(r).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[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=[],wt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),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,de(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(qe.has(this)?this.attached&&!qe.running(this)&&qe.start(this):(this.draw(),Zc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}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 r,a;for(r=0,a=e.length;r<a;++r){const s=e[r];(!t||s.visible)&&i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,r=!i.disabled,a=Hm(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Si(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&Ci(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=is.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={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(r)),r}getContext(){return this.$context||(this.$context=dn(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 r=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,r);ue(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(o=>o.datasetIndex===t?r: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(),qe.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(),ql(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Lr[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=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},r=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};wt(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},r=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},a=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){wt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},wt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:a,index:s})=>{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!hr(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 r=this.options.hover,a=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=a(e,t),o=i?t:a(t,e);s.length&&this.updateHoverStyle(s,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,s=e,o=this._getActiveElements(t,r,i,s),l=tg(t),c=zm(t,this._lastEvent,i,l);i&&(this._lastEvent=null,_t(a.onHover,[t,o,this],this),l&&_t(a.onClick,[t,o,this],this));const u=!hr(o,r);return(u||e)&&(this._active=o,this._updateHoverStyles(o,r,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}},z(Tn,"defaults",Ft),z(Tn,"instances",Lr),z(Tn,"overrides",Cn),z(Tn,"registry",Ie),z(Tn,"version",Um),z(Tn,"getChart",Jc),Tn);function tu(){return wt(Te.instances,n=>n._plugins.invalidate())}function $m(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=r/o;n.beginPath(),n.arc(a,s,o,i-c,e+c),l>r?(c=r/l,n.arc(a,s,l,e+c,i-c,!0)):n.arc(a,s,r,e+Pt,i-Pt),n.closePath(),n.clip()}function jm(n){return Ha(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Vm(n,t,e,i){const r=jm(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,i*t/2),o=l=>{const c=(e-Math.min(a,l))*i/2;return Zt(l,0,Math.min(a,c))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Zt(r.innerStart,0,s),innerEnd:Zt(r.innerEnd,0,s)}}function ti(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Nr(n,t,e,i,r,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=r-l;if(i){const H=u>0?u-i:0,B=d>0?d-i:0,I=(H+B)/2,rt=I!==0?p*I/(I+i):p;g=(p-rt)/2}const x=Math.max(.001,p*d-e/ut)/d,m=(p-x)/2,b=l+m+g,v=r-m-g,{outerStart:_,outerEnd:w,innerStart:M,innerEnd:C}=Vm(t,f,d,v-b),k=d-_,T=d-w,D=b+_/k,O=v-w/T,E=f+M,A=f+C,R=b+M/E,q=v-C/A;if(n.beginPath(),a){const H=(D+O)/2;if(n.arc(s,o,d,D,H),n.arc(s,o,d,H,O),w>0){const W=ti(T,O,s,o);n.arc(W.x,W.y,w,O,v+Pt)}const B=ti(A,v,s,o);if(n.lineTo(B.x,B.y),C>0){const W=ti(A,q,s,o);n.arc(W.x,W.y,C,v+Pt,q+Math.PI)}const I=(v-C/f+(b+M/f))/2;if(n.arc(s,o,f,v-C/f,I,!0),n.arc(s,o,f,I,b+M/f,!0),M>0){const W=ti(E,R,s,o);n.arc(W.x,W.y,M,R+Math.PI,b-Pt)}const rt=ti(k,b,s,o);if(n.lineTo(rt.x,rt.y),_>0){const W=ti(k,D,s,o);n.arc(W.x,W.y,_,b-Pt,D)}}else{n.moveTo(s,o);const H=Math.cos(D)*d+s,B=Math.sin(D)*d+o;n.lineTo(H,B);const I=Math.cos(O)*d+s,rt=Math.sin(O)*d+o;n.lineTo(I,rt)}n.closePath()}function qm(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Nr(n,t,e,i,l,r);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%kt||kt))}return Nr(n,t,e,i,l,r),n.fill(),l}function Xm(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(a){Nr(n,t,e,i,p,r);for(let x=0;x<a;++x)n.stroke();isNaN(o)||(p=s+(o%kt||kt))}g&&$m(n,t,p),a||(Nr(n,t,e,i,p,r),n.stroke())}class Yi extends te{constructor(e){super();z(this,"circumference");z(this,"endAngle");z(this,"fullCircles");z(this,"innerRadius");z(this,"outerRadius");z(this,"pixelMargin");z(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,r){const a=this.getProps(["x","y"],r),{angle:s,distance:o}=Ll(a,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),g=(this.options.spacing+this.options.borderWidth)/2,x=nt(f,c-l)>=kt||wi(s,l,c),m=$e(o,u+g,d+g);return x&&m}getCenterPoint(e){const{x:i,y:r,startAngle:a,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(a+s)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(d)*f,y:r+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:r}=this,a=(i.offset||0)/4,s=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>kt?Math.floor(r/kt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const c=1-Math.sin(Math.min(ut,r||0)),u=a*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,qm(e,this,u,s,o),Xm(e,this,u,s,o),e.restore()}}z(Yi,"id","arc"),z(Yi,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),z(Yi,"defaultRoutes",{backgroundColor:"backgroundColor"}),z(Yi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function eu(n,t,e=t){n.lineCap=nt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(nt(e.borderDash,t.borderDash)),n.lineDashOffset=nt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=nt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=nt(e.borderWidth,t.borderWidth),n.strokeStyle=nt(e.borderColor,t.borderColor)}function Gm(n,t,e){n.lineTo(e.x,e.y)}function Km(n){return n.stepped?_g:n.tension||n.cubicInterpolationMode==="monotone"?wg:Gm}function nu(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:s,end:o}=t,l=Math.max(r,s),c=Math.min(a,o),u=r<s&&a<s||r>o&&a>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Zm(n,t,e,i){const{points:r,options:a}=t,{count:s,start:o,loop:l,ilen:c}=nu(r,e,i),u=Km(a);let{move:d=!0,reverse:f}=i||{},g,p,x;for(g=0;g<=c;++g)p=r[(o+(f?c-g:g))%s],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,x,p,f,a.stepped),x=p);return l&&(p=r[(o+(f?c:0))%s],u(n,x,p,f,a.stepped)),!!l}function Qm(n,t,e,i){const r=t.points,{count:a,start:s,ilen:o}=nu(r,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,x,m,b;const v=w=>(s+(c?o-w:w))%a,_=()=>{x!==m&&(n.lineTo(u,m),n.lineTo(u,x),n.lineTo(u,b))};for(l&&(g=r[v(0)],n.moveTo(g.x,g.y)),f=0;f<=o;++f){if(g=r[v(f)],g.skip)continue;const w=g.x,M=g.y,C=w|0;C===p?(M<x?x=M:M>m&&(m=M),u=(d*u+w)/++d):(_(),n.lineTo(w,M),p=C,d=0,x=m=M),b=M}_()}function os(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Qm:Zm}function Jm(n){return n.stepped?tp:n.tension||n.cubicInterpolationMode==="monotone"?ep:En}function t0(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),eu(n,t.options),n.stroke(r)}function e0(n,t,e,i){const{segments:r,options:a}=t,s=os(t);for(const o of r)eu(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const n0=typeof Path2D=="function";function i0(n,t,e,i){n0&&!t.options.segment?t0(n,t,e,i):e0(n,t,e,i)}class gn extends te{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 r=i.spanGaps?this._loop:this._fullLoop;Vg(this._points,i,t,r,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=op(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,r=t[e],a=this.points,s=dc(this,{property:e,start:r,end:r});if(!s.length)return;const o=[],l=Jm(i);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],g=a[d],p=a[f];if(g===p){o.push(g);continue}const x=Math.abs((r-g[e])/(p[e]-g[e])),m=l(g,p,x,i.stepped);m[e]=t[e],o.push(m)}return o.length===1?o[0]:o}pathSegment(t,e,i){return os(this)(t,this,e,i)}path(t,e,i){const r=this.segments,a=os(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of r)s&=a(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,r){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),i0(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}z(gn,"id","line"),z(gn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),z(gn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),z(gn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function iu(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)<r.radius+r.hitRadius}class Fr extends te{constructor(e){super();z(this,"parsed");z(this,"skip");z(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,r){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],r);return Math.pow(e-s,2)+Math.pow(i-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,i){return iu(this,e,"x",i)}inYRange(e,i){return iu(this,e,"y",i)}getCenterPoint(e){const{x:i,y:r}=this.getProps(["x","y"],e);return{x:i,y:r}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const r=i&&e.borderWidth||0;return(i+r)*2}draw(e,i){const r=this.options;this.skip||r.radius<.1||!Ve(this,i,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,za(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}z(Fr,"id","point"),z(Fr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),z(Fr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function ru(n,t){const{x:e,y:i,base:r,width:a,height:s}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=s/2,o=Math.min(e,r),l=Math.max(e,r),c=i-d,u=i+d):(d=a/2,o=e-d,l=e+d,c=Math.min(i,r),u=Math.max(i,r)),{left:o,top:c,right:l,bottom:u}}function pn(n,t,e,i){return n?0:Zt(t,e,i)}function r0(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,a=Gl(i);return{t:pn(r.top,a.top,0,e),r:pn(r.right,a.right,0,t),b:pn(r.bottom,a.bottom,0,e),l:pn(r.left,a.left,0,t)}}function a0(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,a=un(r),s=Math.min(t,e),o=n.borderSkipped,l=i||lt(r);return{topLeft:pn(!l||o.top||o.left,a.topLeft,0,s),topRight:pn(!l||o.top||o.right,a.topRight,0,s),bottomLeft:pn(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:pn(!l||o.bottom||o.right,a.bottomRight,0,s)}}function s0(n){const t=ru(n),e=t.right-t.left,i=t.bottom-t.top,r=r0(n,e/2,i/2),a=a0(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:a},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function ls(n,t,e,i){const r=t===null,a=e===null,o=n&&!(r&&a)&&ru(n,i);return o&&(r||$e(t,o.left,o.right))&&(a||$e(e,o.top,o.bottom))}function o0(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function l0(n,t){n.rect(t.x,t.y,t.w,t.h)}function cs(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-i,s=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+a,h:n.h+s,radius:n.radius}}class Ur extends te{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:r}}=this,{inner:a,outer:s}=s0(this),o=o0(s.radius)?Kn:l0;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,cs(s,e,a)),t.clip(),o(t,cs(a,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,cs(a,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return ls(this,t,e,i)}inXRange(t,e){return ls(this,t,null,e)}inYRange(t,e){return ls(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}z(Ur,"id","bar"),z(Ur,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),z(Ur,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var c0=Object.freeze({__proto__:null,ArcElement:Yi,BarElement:Ur,LineElement:gn,PointElement:Fr});const us=["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)"],au=us.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function su(n){return us[n%us.length]}function ou(n){return au[n%au.length]}function u0(n,t){return n.borderColor=su(t),n.backgroundColor=ou(t),++t}function d0(n,t){return n.backgroundColor=n.data.map(()=>su(t++)),t}function f0(n,t){return n.backgroundColor=n.data.map(()=>ou(t++)),t}function h0(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof hn?t=d0(e,t):r instanceof Ai?t=f0(e,t):r&&(t=u0(e,t))}}function lu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function g0(n){return n&&(n.borderColor||n.backgroundColor)}var p0={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:a}=r;if(!e.forceOverride&&(lu(i)||g0(r)||a&&lu(a)))return;const s=h0(n);i.forEach(s)}};function m0(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const s=[],o=(e-2)/(a-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,x;for(s[l++]=n[u],d=0;d<a-2;d++){let m=0,b=0,v;const _=Math.floor((d+1)*o)+1+t,w=Math.min(Math.floor((d+2)*o)+1,e)+t,M=w-_;for(v=_;v<w;v++)m+=n[v].x,b+=n[v].y;m/=M,b/=M;const C=Math.floor(d*o)+1+t,k=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:T,y:D}=n[u];for(g=p=-1,v=C;v<k;v++)p=.5*Math.abs((T-m)*(n[v].y-D)-(T-n[v].x)*(b-D)),p>g&&(g=p,f=n[v],x=v);s[l++]=f,u=x}return s[l++]=n[c],s}function y0(n,t,e,i){let r=0,a=0,s,o,l,c,u,d,f,g,p,x;const m=[],b=t+e-1,v=n[t].x,w=n[b].x-v;for(s=t;s<t+e;++s){o=n[s],l=(o.x-v)/w*i,c=o.y;const M=l|0;if(M===u)c<p?(p=c,d=s):c>x&&(x=c,f=s),r=(a*r+o.x)/++a;else{const C=s-1;if(!it(d)&&!it(f)){const k=Math.min(d,f),T=Math.max(d,f);k!==g&&k!==C&&m.push({...n[k],x:r}),T!==g&&T!==C&&m.push({...n[T],x:r})}s>0&&C!==g&&m.push(n[C]),m.push(o),u=M,a=0,p=x=c,d=f=g=s}}return m}function cu(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 uu(n){n.data.datasets.forEach(t=>{cu(t)})}function b0(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(i=Zt(je(t,a.axis,s).lo,0,e-1)),c?r=Zt(je(t,a.axis,o).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var v0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){uu(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:s,indexAxis:o}=r,l=n.getDatasetMeta(a),c=s||r.data;if(ki([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:d,count:f}=b0(l,c);const g=e.threshold||4*i;if(f<=g){cu(r);return}it(s)&&(r._data=c,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(x){this._data=x}}));let p;switch(e.algorithm){case"lttb":p=m0(c,d,f,i,e);break;case"min-max":p=y0(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=p})},destroy(n){uu(n)}};function x0(n,t,e){const i=n.segments,r=n.points,a=t.points,s=[];for(const o of i){let{start:l,end:c}=o;c=fs(l,c,r);const u=ds(e,r[l],r[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:r[l],end:r[c]});continue}const d=dc(t,u);for(const f of d){const g=ds(e,a[f.start],a[f.end],f.loop),p=uc(o,r,g);for(const x of p)s.push({source:x,target:f,start:{[e]:du(u,g,"start",Math.max)},end:{[e]:du(u,g,"end",Math.min)}})}}return s}function ds(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=ve(r),a=ve(a)),{property:n,start:r,end:a}}function _0(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=fs(s,o,r);const l=r[s],c=r[o];i!==null?(a.push({x:l.x,y:i}),a.push({x:c.x,y:i})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function fs(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function du(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function fu(n,t){let e=[],i=!1;return yt(n)?(i=!0,e=n):e=_0(n,t),e.length?new gn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function hu(n){return n&&n.fill!==!1}function w0(n,t,e){let r=n[t].fill;const a=[t];let s;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!Lt(r))return r;if(s=n[r],!s)return!1;if(s.visible)return r;a.push(r),r=s.fill}return!1}function T0(n,t,e){const i=C0(n);if(lt(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return Lt(r)&&Math.floor(r)===r?D0(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function D0(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function M0(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:lt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function S0(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:lt(n)?i=n.value:i=t.getBaseValue(),i}function C0(n){const t=n.options,e=t.fill;let i=nt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function k0(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,s=i.points,o=O0(t,e);o.push(fu({x:null,y:t.bottom},i));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)P0(r,s[u],o)}return new gn({points:r,options:{}})}function O0(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const a=i[r];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function P0(n,t,e){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{first:s,last:o,point:l}=E0(a,t,"x");if(!(!l||s&&o)){if(s)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function E0(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],a=n.segments,s=n.points;let o=!1,l=!1;for(let c=0;c<a.length;c++){const u=a[c],d=s[u.start][e],f=s[u.end][e];if($e(r,d,f)){o=r===d,l=r===f;break}}return{first:o,last:l,point:i}}class gu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:a,radius:s}=this;return e=e||{start:0,end:kt},t.arc(r,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:i+Math.sin(a)*r,angle:a}}}function A0(n){const{chart:t,fill:e,line:i}=n;if(Lt(e))return R0(t,e);if(e==="stack")return k0(n);if(e==="shape")return!0;const r=L0(n);return r instanceof gu?r:fu(r,i)}function R0(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function L0(n){return(n.scale||{}).getPointPositionForValue?N0(n):I0(n)}function I0(n){const{scale:t={},fill:e}=n,i=M0(e,t);if(Lt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function N0(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,a=i.reverse?t.max:t.min,s=S0(e,t,a),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,a);return new gu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<r;++l)o.push(t.getPointPositionForValue(l,s));return o}function hs(n,t,e){const i=A0(t),{line:r,scale:a,axis:s}=t,o=r.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};i&&r.points.length&&(Si(n,e),F0(n,{line:r,target:i,above:u,below:d,area:e,scale:a,axis:s}),Ci(n))}function F0(n,t){const{line:e,target:i,above:r,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==r&&(pu(n,i,s.top),mu(n,{line:e,target:i,color:r,scale:o,property:l}),n.restore(),n.save(),pu(n,i,s.bottom)),mu(n,{line:e,target:i,color:a,scale:o,property:l}),n.restore()}function pu(n,t,e){const{segments:i,points:r}=t;let a=!0,s=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=r[l],d=r[fs(l,c,r)];a?(n.moveTo(u.x,u.y),a=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),s=!!t.pathSegment(n,o,{move:s}),s?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function mu(n,t){const{line:e,target:i,property:r,color:a,scale:s}=t,o=x0(e,i,r);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=a}={}}=l,g=i!==!0;n.save(),n.fillStyle=f,U0(n,s,g&&ds(r,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let x;if(g){p?n.closePath():yu(n,i,d,r);const m=!!i.pathSegment(n,c,{move:p,reverse:!0});x=p&&m,x||yu(n,i,u,r)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function U0(n,t,e){const{top:i,bottom:r}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,i,o-s,r-i),n.clip())}function yu(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var B0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let a,s,o,l;for(s=0;s<i;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof gn&&(l={visible:n.isDatasetVisible(s),index:s,fill:T0(o,s,i),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,r.push(l);for(s=0;s<i;++s)l=r[s],!(!l||l.fill===!1)&&(l.fill=w0(r,s,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),i&&o.fill&&hs(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;hu(a)&&hs(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!hu(i)||e.drawTime!=="beforeDatasetDraw"||hs(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bu=(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)}},Y0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class vu extends te{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=_t(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,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,r=Et(i.font),a=r.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=bu(i,a);let c,u;e.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,r,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,r){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+o;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,x)=>{const m=i+e/2+a.measureText(p.text).width;(x===0||c[c.length-1]+m+2*o>s)&&(d+=u,c[c.length-(x>0?0:1)]=0,g+=u,f++),l[x]={left:0,top:g,row:f,width:m,height:r},c[c.length-1]+=m+o}),d}_fitCols(t,e,i,r){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,g=0,p=0,x=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:v,itemHeight:_}=W0(i,e,a,m,r);b>0&&g+_+2*o>u&&(d+=f+o,c.push({width:f,height:g}),p+=f+o,x++,f=g=0),l[b]={left:p,top:g,col:x,width:v,height:_},f=Math.max(f,v),g+=_+o}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,s=Jn(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=ie(i,this.left+r,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=ie(i,this.left+r,this.right-this.lineWidths[o])),c.top+=this.top+t+r,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+r}else{let o=0,l=ie(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=ie(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+r,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Si(t,this),this._draw(),Ci(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:s}=t,o=Ft.color,l=Jn(t.rtl,this.left,this.width),c=Et(s.font),{padding:u}=s,d=c.size,f=d/2;let g;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;const{boxWidth:p,boxHeight:x,itemHeight:m}=bu(s,d),b=function(C,k,T){if(isNaN(p)||p<=0||isNaN(x)||x<0)return;r.save();const D=nt(T.lineWidth,1);if(r.fillStyle=nt(T.fillStyle,o),r.lineCap=nt(T.lineCap,"butt"),r.lineDashOffset=nt(T.lineDashOffset,0),r.lineJoin=nt(T.lineJoin,"miter"),r.lineWidth=D,r.strokeStyle=nt(T.strokeStyle,o),r.setLineDash(nt(T.lineDash,[])),s.usePointStyle){const O={radius:x*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:D},E=l.xPlus(C,p/2),A=k+f;Xl(r,O,E,A,s.pointStyleWidth&&p)}else{const O=k+Math.max((d-x)/2,0),E=l.leftForLtr(C,p),A=un(T.borderRadius);r.beginPath(),Object.values(A).some(R=>R!==0)?Kn(r,{x:E,y:O,w:p,h:x,radius:A}):r.rect(E,O,p,x),r.fill(),D!==0&&r.stroke()}r.restore()},v=function(C,k,T){On(r,T.text,C,k+m/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},_=this.isHorizontal(),w=this._computeTitleHeight();_?g={x:ie(a,this.left+u,this.right-i[0]),y:this.top+u+w,line:0}:g={x:this.left+u,y:ie(a,this.top+w+u,this.bottom-e[0].height),line:0},sc(this.ctx,t.textDirection);const M=m+u;this.legendItems.forEach((C,k)=>{r.strokeStyle=C.fontColor,r.fillStyle=C.fontColor;const T=r.measureText(C.text).width,D=l.textAlign(C.textAlign||(C.textAlign=s.textAlign)),O=p+f+T;let E=g.x,A=g.y;l.setWidth(this.width),_?k>0&&E+O+u>this.right&&(A=g.y+=M,g.line++,E=g.x=ie(a,this.left+u,this.right-i[g.line])):k>0&&A+M>this.bottom&&(E=g.x=E+e[g.line].width+u,g.line++,A=g.y=ie(a,this.top+w+u,this.bottom-e[g.line].height));const R=l.x(E);if(b(R,A,C),E=ug(D,E+p+f,_?E+O:this.right,t.rtl),v(l.x(E),A,C),_)g.x+=O+u;else if(typeof C.text!="string"){const q=c.lineHeight;g.y+=xu(C,q)+u}else g.y+=M}),oc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Et(e.font),r=Xt(e.padding);if(!e.display)return;const a=Jn(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=i.size/2,c=r.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=ie(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((x,m)=>Math.max(x,m.height),0);u=c+ie(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=ie(o,d,d+f);s.textAlign=a.textAlign(Fa(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,On(s,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=Et(t.font),i=Xt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if($e(t,this.left,this.right)&&$e(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(r=a[i],$e(t,r.left,r.left+r.width)&&$e(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!$0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,a=Y0(r,i);r&&!a&&_t(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&_t(e.onHover,[t,i,this],this)}else i&&_t(e.onClick,[t,i,this],this)}}function W0(n,t,e,i,r){const a=z0(i,n,t,e),s=H0(r,i,t.lineHeight);return{itemWidth:a,itemHeight:s}}function z0(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+i.measureText(r).width}function H0(n,t,e){let i=n;return typeof t.text!="string"&&(i=xu(t,e)),i}function xu(n,t){const e=n.text?n.text.length:0;return t*e}function $0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var j0={id:"legend",_element:vu,start(n,t,e){const i=n.legend=new vu({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,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.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:r,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Xt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:a,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:r||c.textAlign,borderRadius:s&&(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 gs extends te{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 r=yt(i.text)?i.text.length:1;this._padding=Xt(i.padding);const a=r*Et(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=ie(o,i,a),d=e+t,c=a-i):(s.position==="left"?(u=i+t,d=ie(o,r,e),l=ut*-.5):(u=a-t,d=ie(o,e,r),l=ut*.5),c=r-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Et(e.font),a=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);On(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Fa(e.align),textBaseline:"middle",translation:[s,o]})}}function V0(n,t){const e=new gs({ctx:n.ctx,options:t,chart:n});re.configure(n,e,t),re.addBox(n,e),n.titleBlock=e}var q0={id:"title",_element:gs,start(n,t,e){V0(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 Br=new WeakMap;var X0={id:"subtitle",start(n,t,e){const i=new gs({ctx:n.ctx,options:e,chart:n});re.configure(n,i,e),re.addBox(n,i),Br.set(n,i)},stop(n){re.removeBox(n,Br.get(n)),Br.delete(n)},beforeUpdate(n,t,e){const i=Br.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 Wi={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t<e;++t){const s=n[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();i+=o.x,r+=o.y,++a}}return{x:i/a,y:r/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=n.length;a<s;++a){const l=n[a].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Gn(t,c);u<r&&(r=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ne(n,t){return t&&(yt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Xe(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function G0(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:s,value:o}=a.getLabelAndValue(r);return{chart:n,label:s,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:o,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function _u(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=Et(t.bodyFont),c=Et(t.titleFont),u=Et(t.footerFont),d=a.length,f=r.length,g=i.length,p=Xt(t.padding);let v=p.height,m=0,y=i.reduce((w,M)=>w+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,d&&(v+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const w=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;v+=g*w+(y-g)*l.lineHeight+(y-1)*t.bodySpacing}f&&(v+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let x=0;const _=function(w){m=Math.max(m,e.measureText(w).width+x)};return e.save(),e.font=c.string,wt(n.title,_),e.font=l.string,wt(n.beforeBody.concat(n.afterBody),_),x=t.displayColors?s+2+t.boxPadding:0,wt(i,w=>{wt(w.before,_),wt(w.lines,_),wt(w.after,_)}),x=0,e.font=u.string,wt(n.footer,_),e.restore(),m+=p.width,{width:m,height:v}}function K0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Z0(n,t,e,i){const{x:r,width:a}=i,s=e.caretSize+e.caretPadding;if(n==="left"&&r+a+s>t.width||n==="right"&&r-a-s<0)return!0}function Q0(n,t,e,i){const{x:r,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=r<=(o+l)/2?"left":"right":r<=a/2?c="left":r>=s-a/2&&(c="right"),Z0(c,n,t,e)&&(c="center"),c}function wu(n,t,e){const i=e.yAlign||t.yAlign||K0(n,e);return{xAlign:e.xAlign||t.xAlign||Q0(n,t,e,i),yAlign:i}}function J0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function ty(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Tu(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=r+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=un(s);let p=J0(t,o);const v=ty(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+r:o==="right"&&(p+=Math.max(d,g)+r),{x:Zt(p,0,i.width-t.width),y:Zt(v,0,i.height-t.height)}}function Yr(n,t,e){const i=Xt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Du(n){return Ne([],Xe(n))}function ey(n,t,e){return dn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Mu(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Su={beforeTitle:He,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:He,beforeBody:He,beforeLabel:He,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 it(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:He,afterBody:He,beforeFooter:He,footer:He,afterFooter:He};function fe(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Su[t].call(e,i):r}class ps extends te{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()),r=i.enabled&&e.options.animation&&i.animations,a=new Ga(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=ey(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=fe(i,"beforeTitle",this,t),a=fe(i,"title",this,t),s=fe(i,"afterTitle",this,t);let o=[];return o=Ne(o,Xe(r)),o=Ne(o,Xe(a)),o=Ne(o,Xe(s)),o}getBeforeBody(t,e){return Du(fe(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return wt(t,a=>{const s={before:[],lines:[],after:[]},o=Mu(i,a);Ne(s.before,Xe(fe(o,"beforeLabel",this,a))),Ne(s.lines,fe(o,"label",this,a)),Ne(s.after,Xe(fe(o,"afterLabel",this,a))),r.push(s)}),r}getAfterBody(t,e){return Du(fe(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=fe(i,"beforeFooter",this,t),a=fe(i,"footer",this,t),s=fe(i,"afterFooter",this,t);let o=[];return o=Ne(o,Xe(r)),o=Ne(o,Xe(a)),o=Ne(o,Xe(s)),o}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(G0(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),wt(o,u=>{const d=Mu(t.callbacks,u);r.push(fe(d,"labelColor",this,u)),a.push(fe(d,"labelPointStyle",this,u)),s.push(fe(d,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,s=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const o=Wi[i.position].call(this,r,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const l=this._size=_u(this,i),c=Object.assign({},o,l),u=wu(this.chart,i,c),d=Tu(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=un(o),{x:f,y:g}=t,{width:p,height:v}=e;let m,y,x,_,w,M;return a==="center"?(w=g+v/2,r==="left"?(m=f,y=m-s,_=w+s,M=w-s):(m=f+p,y=m+s,_=w-s,M=w+s),x=m):(r==="left"?y=f+Math.max(l,u)+s:r==="right"?y=f+p-Math.max(c,d)-s:y=this.caretX,a==="top"?(_=g,w=_-s,m=y-s,x=y+s):(_=g+v,w=_+s,m=y+s,x=y-s),M=_),{x1:m,x2:y,x3:x,y1:_,y2:w,y3:M}}drawTitle(t,e,i){const r=this.title,a=r.length;let s,o,l;if(a){const c=Jn(i.rtl,this.x,this.width);for(t.x=Yr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",s=Et(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(r[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,r,a){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=a,u=Et(a.bodyFont),d=Yr(this,"left",a),f=r.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(a.usePointStyle){const v={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},m=r.leftForLtr(f,c)+c/2,y=p+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,za(t,v,m,y),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,za(t,v,m,y)}else{t.lineWidth=lt(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const v=r.leftForLtr(f,c),m=r.leftForLtr(r.xPlus(f,1),c-2),y=un(s.borderRadius);Object.values(y).some(x=>x!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Kn(t,{x:v,y:p,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Kn(t,{x:m,y:p+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(v,p,c,l),t.strokeRect(v,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=Et(i.bodyFont);let f=d.lineHeight,g=0;const p=Jn(i.rtl,this.x,this.width),v=function(T){e.fillText(T,p.x(t.x+g),t.y+f/2),t.y+=f+a},m=p.textAlign(s);let y,x,_,w,M,C,k;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=Yr(this,m,i),e.fillStyle=i.bodyColor,wt(this.beforeBody,v),g=o&&m!=="right"?s==="center"?c/2+u:c+2+u:0,w=0,C=r.length;w<C;++w){for(y=r[w],x=this.labelTextColors[w],e.fillStyle=x,wt(y.before,v),_=y.lines,o&&_.length&&(this._drawColorBox(e,t,w,p,i),f=Math.max(d.lineHeight,l)),M=0,k=_.length;M<k;++M)v(_[M]),f=d.lineHeight;wt(y.after,v)}g=0,f=d.lineHeight,wt(this.afterBody,v),t.y-=a}drawFooter(t,e,i){const r=this.footer,a=r.length;let s,o;if(a){const l=Jn(i.rtl,this.x,this.width);for(t.x=Yr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",s=Et(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(r[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=un(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,i,r),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&a==="right"&&this.drawCaret(t,e,i,r),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),s==="center"&&a==="left"&&this.drawCaret(t,e,i,r),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const s=Wi[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=_u(this,t),l=Object.assign({},s,this._size),c=wu(e,t,l),u=Tu(t,l,c,e);(r._to!==u.x||a._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.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 r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=Xt(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(a,t,r,e),sc(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),oc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=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}}),a=!hr(i,r),s=this._positionChanged(r,e);(a||s)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),o=this._positionChanged(s,t),l=e||!hr(s,a)||o;return l&&(this._active=s,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,s=Wi[a.position].call(this,t,e);return s!==!1&&(i!==s.x||r!==s.y)}}z(ps,"positioners",Wi);var Wr={id:"tooltip",_element:ps,positioners:Wi,afterInit(n,t,e){e&&(n.tooltip=new ps({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:Su},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"]},ny=Object.freeze({__proto__:null,Colors:p0,Decimation:v0,Filler:B0,Legend:j0,SubTitle:X0,Title:q0,Tooltip:Wr});const iy=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ry(n,t,e,i){const r=n.indexOf(t);if(r===-1)return iy(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const ay=(n,t)=>n===null?null:Zt(Math.round(n),0,t);function Cu(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ms extends Rn{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:r,label:a}of e)i[r]===a&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(it(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:ry(i,t,nt(e,t),this._addedLabels),ay(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)r.push({value:s});return r}getLabelForValue(t){return Cu.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}}z(ms,"id","category"),z(ms,"defaults",{ticks:{callback:Cu}});function sy(n,t){const e=[],{bounds:r,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=a||1,p=u-1,{min:v,max:m}=t,y=!it(s),x=!it(o),_=!it(c),w=(m-v)/(d+1);let M=El((m-v)/p/g)*g,C,k,T,D;if(M<1e-14&&!y&&!x)return[{value:v},{value:m}];D=Math.ceil(m/M)-Math.floor(v/M),D>p&&(M=El(D*M/p/g)*g),it(l)||(C=Math.pow(10,l),M=Math.ceil(M*C)/C),r==="ticks"?(k=Math.floor(v/M)*M,T=Math.ceil(m/M)*M):(k=v,T=m),y&&x&&a&&ig((o-s)/a,M/1e3)?(D=Math.round(Math.min((o-s)/M,u)),M=(o-s)/D,k=s,T=o):_?(k=y?s:k,T=x?o:T,D=c-1,M=(T-k)/D):(D=(T-k)/M,_i(D,Math.round(D),M/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(Rl(M),Rl(k));C=Math.pow(10,it(l)?O:l),k=Math.round(k*C)/C,T=Math.round(T*C)/C;let E=0;for(y&&(f&&k!==s?(e.push({value:s}),k<s&&E++,_i(Math.round((k+E*M)*C)/C,s,ku(s,w,n))&&E++):k<s&&E++);E<D;++E){const A=Math.round((k+E*M)*C)/C;if(x&&A>o)break;e.push({value:A})}return x&&f&&T!==o?e.length&&_i(e[e.length-1].value,o,ku(o,w,n))?e[e.length-1].value=o:e.push({value:o}):(!x||T===o)&&e.push({value:T}),e}function ku(n,t,{horizontal:e,minRotation:i}){const r=qt(i),a=(e?Math.sin(r):Math.cos(r))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class zr extends Rn{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 it(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:r,max:a}=this;const s=l=>r=e?r:l,o=l=>a=i?a:l;if(t){const l=Le(r),c=Le(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(r===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(r-l)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={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},a=this._range||this,s=sy(r,a);return t.bounds==="ticks"&&Al(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Di(t,this.chart.options.locale,this.options.ticks.format)}}class ys extends zr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Lt(t)?t:0,this.max=Lt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=qt(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}z(ys,"id","linear"),z(ys,"defaults",{ticks:{callback:vr.formatters.numeric}});const zi=n=>Math.floor(ln(n)),Ln=(n,t)=>Math.pow(10,zi(n)+t);function Ou(n){return n/Math.pow(10,zi(n))===1}function Pu(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function oy(n,t){const e=t-n;let i=zi(e);for(;Pu(n,t,i)>10;)i++;for(;Pu(n,t,i)<10;)i--;return Math.min(i,zi(n))}function ly(n,{min:t,max:e}){t=be(n.min,t);const i=[],r=zi(t);let a=oy(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=r>a?Math.pow(10,r):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,a)),f=be(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;f<e;)i.push({value:f,major:Ou(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),f=Math.round((l+u+d*Math.pow(10,a))*s)/s;const g=be(n.max,f);return i.push({value:g,major:Ou(g),significand:d}),i}class bs extends Rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=zr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Lt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Lt(t)?Math.max(0,t):null,this.max=Lt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Lt(this._userMin)&&(this.min=t===Ln(this.min,0)?Ln(this.min,-1):Ln(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=o=>i=t?i:o,s=o=>r=e?r:o;i===r&&(i<=0?(a(1),s(10)):(a(Ln(i,-1)),s(Ln(r,1)))),i<=0&&a(Ln(r,-1)),r<=0&&s(Ln(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=ly(e,this);return t.bounds==="ticks"&&Al(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":Di(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ln(t),this._valueRange=ln(this.max)-ln(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ln(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}z(bs,"id","logarithmic"),z(bs,"defaults",{ticks:{callback:vr.formatters.logarithmic,major:{enabled:!0}}});function vs(n){const t=n.ticks;if(t.display&&n.display){const e=Xt(t.backdropPadding);return nt(t.font&&t.font.size,Ft.font.size)+e.height}return 0}function cy(n,t,e){return e=yt(e)?e:[e],{w:xg(n,t.string,e),h:e.length*t.lineHeight}}function Eu(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function uy(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=[],r=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?ut/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));r[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+r[l],o),d=Et(c.font),f=cy(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=ve(n.getIndexAngle(l)+o),p=Math.round(yr(g)),v=Eu(p,u.x,f.w,0,180),m=Eu(p,u.y,f.h,90,270);dy(e,t,g,v,m)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=gy(n,i,r)}function dy(n,t,e,i,r){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/a,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),r.start<t.t?(l=(t.t-r.start)/s,n.t=Math.min(n.t,t.t-l)):r.end>t.b&&(l=(r.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function fy(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,i+r+s,a),c=Math.round(yr(ve(l.angle+Pt))),u=yy(l.y,o.h,c),d=py(c),f=my(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function hy(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:a}=n;return!(Ve({x:e,y:i},t)||Ve({x:e,y:a},t)||Ve({x:r,y:i},t)||Ve({x:r,y:a},t))}function gy(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:vs(a)/2,additionalAngle:s?ut/r:0};let c;for(let u=0;u<r;u++){l.padding=e[u],l.size=t[u];const d=fy(n,u,l);i.push(d),o==="auto"&&(d.visible=hy(d,c),d.visible&&(c=d))}return i}function py(n){return n===0||n===180?"center":n<180?"left":"right"}function my(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function yy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function by(n,t,e){const{left:i,top:r,right:a,bottom:s}=e,{backdropColor:o}=t;if(!it(o)){const l=un(t.borderRadius),c=Xt(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=r-c.top,f=a-i+c.width,g=s-r+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Kn(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function vy(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=n._pointLabelItems[r];if(!a.visible)continue;const s=i.setContext(n.getPointLabelContext(r));by(e,s,a);const o=Et(s.font),{x:l,y:c,textAlign:u}=a;On(e,n._pointLabels[r],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function Au(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,kt);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let s=1;s<i;s++)a=n.getPointPosition(s,t),r.lineTo(a.x,a.y)}}function xy(n,t,e,i,r){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!i||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(r.dash),a.lineDashOffset=r.dashOffset,a.beginPath(),Au(n,e,s,i),a.closePath(),a.stroke(),a.restore())}function _y(n,t,e){return dn(n,{label:e,index:t,type:"pointLabel"})}class Hi extends zr{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=Xt(vs(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=Lt(t)&&!isNaN(t)?t:0,this.max=Lt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/vs(this.options))}generateTickLabels(t){zr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=_t(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?uy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ve(t*e+qt(i))}getDistanceFromCenterForValue(t){if(it(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(it(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 _y(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-Pt+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}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:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Au(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:r,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&vy(this,s),r.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=r.setContext(f),p=a.setContext(f);xy(this,g,l,s,p)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.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 r=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Et(c.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=Xt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}On(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}z(Hi,"id","radialLinear"),z(Hi,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:vr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),z(Hi,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),z(Hi,"descriptors",{angleLines:{_fallback:"grid"}});const Hr={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}},he=Object.keys(Hr);function Ru(n,t){return n-t}function Lu(n,t){if(it(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let s=t;return typeof i=="function"&&(s=i(s)),Lt(s)||(s=typeof i=="string"?e.parse(s,i):e.parse(s)),s===null?null:(r&&(s=r==="week"&&(cn(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,r)),+s)}function Iu(n,t,e,i){const r=he.length;for(let a=he.indexOf(n);a<r-1;++a){const s=Hr[he[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=i)return he[a]}return he[r-1]}function wy(n,t,e,i,r){for(let a=he.length-1;a>=he.indexOf(e);a--){const s=he[a];if(Hr[s].common&&n._adapter.diff(r,i,s)>=t-1)return s}return he[e?he.indexOf(e):0]}function Ty(n){for(let t=he.indexOf(n)+1,e=he.length;t<e;++t)if(Hr[he[t]].common)return he[t]}function Nu(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Na(e,t),a=e[i]>=t?e[i]:e[r];n[a]=!0}}function Dy(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+r.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Fu(n,t,e){const i=[],r={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],r[o]=s,i.push({value:o,major:!1});return a===0||!e?i:Dy(n,i,r,e)}class $i extends Rn{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={}),r=this._adapter=new Sc._date(t.adapters.date);r.init(e),xi(i.displayFormats,r.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:Lu(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:r,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(r=Math.min(r,c.min)),!o&&!isNaN(c.max)&&(a=Math.max(a,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=Lt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=Lt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_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,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const a=this.min,s=this.max,o=og(r,a,s);return this._unit=e.unit||(i.autoSkip?Iu(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):wy(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Ty(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),Fu(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Zt(e,0,s),i=Zt(i,0,s),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,s=a.unit||Iu(a.minUnit,e,i,this._getLabelCapacity(e)),o=nt(r.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=cn(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,o,s),g++)Nu(u,f,p);return(f===i||r.bounds==="ticks"||g===1)&&Nu(u,f,p),Object.keys(u).sort(Ru).map(v=>+v)}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 r=this.options.time.displayFormats,a=this._unit,s=e||r[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,r){const a=this.options,s=a.ticks.callback;if(s)return _t(s,[t,e,i],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,r||(g?d:u))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.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,r=qt(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(r),s=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*a+o*s,h:i*s+o*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,Fu(this,[t],this._majorUnit),r),s=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[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 r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(Lu(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Fl(t.sort(Ru))}}z($i,"id","time"),z($i,"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 $r(n,t,e){let i=0,r=n.length-1,a,s,o,l;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=je(n,"pos",t)),{pos:a,time:o}=n[i],{pos:s,time:l}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=je(n,"time",t)),{time:a,pos:o}=n[i],{time:s,pos:l}=n[r]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class xs extends $i{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=$r(e,this.min),this._tableRange=$r(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=i&&r.push(c);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=r.length;s<o;++s)u=r[s+1],l=r[s-1],c=r[s],Math.round((u+l)/2)!==c&&a.push({time:c,pos:s/(o-1)});return a}_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((r,a)=>r-a)}_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($r(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return $r(this._table,i*this._tableRange+this._minPos,!0)}}z(xs,"id","timeseries"),z(xs,"defaults",$i.defaults);var My=Object.freeze({__proto__:null,CategoryScale:ms,LinearScale:ys,LogarithmicScale:bs,RadialLinearScale:Hi,TimeScale:$i,TimeSeriesScale:xs});const Sy=[Ip,c0,ny,My],Cy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],ky=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Oy=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Py=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Uu=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function _s(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?Py:Oy:t.binary?ky:Cy,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const r=n<0,a=r?"-":t.signed?"+":"";r&&(n=-n);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),n<1){const u=Uu(n,t.locale,s);return a+u+i+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,s||(n=n.toPrecision(3));const l=Uu(Number(n),t.locale,s),c=e[o];return a+l+i+c}function Ge(n){"@babel/helpers - typeof";return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(n)}function At(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function K(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function et(n){K(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ge(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Bu(n,t){K(2,arguments);var e=et(n),i=At(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function ws(n,t){K(2,arguments);var e=et(n),i=At(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}function ji(n,t){K(2,arguments);var e=et(n).getTime(),i=At(t);return new Date(e+i)}var Ey=36e5;function Ay(n,t){K(2,arguments);var e=At(t);return ji(n,e*Ey)}var Ry={};function mn(){return Ry}function Yu(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=et(n),g=f.getDay(),p=(g<d?7:0)+g-d;return f.setDate(f.getDate()-p),f.setHours(0,0,0,0),f}function jr(n){var 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.getTime()-t.getTime()}function Ts(n){K(1,arguments);var t=et(n);return t.setHours(0,0,0,0),t}var Ly=864e5;function Iy(n,t){K(2,arguments);var e=Ts(n),i=Ts(t),r=e.getTime()-jr(e),a=i.getTime()-jr(i);return Math.round((r-a)/Ly)}var Ny=6e4;function Fy(n,t){K(2,arguments);var e=At(t);return ji(n,e*Ny)}function Uy(n,t){K(2,arguments);var e=At(t),i=e*3;return ws(n,i)}function By(n,t){K(2,arguments);var e=At(t);return ji(n,e*1e3)}function Yy(n,t){K(2,arguments);var e=At(t),i=e*7;return Bu(n,i)}function Wy(n,t){K(2,arguments);var e=At(t);return ws(n,e*12)}function Vi(n,t){K(2,arguments);var e=et(n),i=et(t),r=e.getTime()-i.getTime();return r<0?-1:r>0?1:r}var Vr=6e4,qi=36e5,zy=1e3,Hy=3600;function $y(n){return K(1,arguments),n instanceof Date||Ge(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ds(n){if(K(1,arguments),!$y(n)&&typeof n!="number")return!1;var t=et(n);return!isNaN(Number(t))}function jy(n,t){K(2,arguments);var e=et(n),i=et(t),r=e.getFullYear()-i.getFullYear(),a=e.getMonth()-i.getMonth();return r*12+a}function Vy(n,t){K(2,arguments);var e=et(n),i=et(t);return e.getFullYear()-i.getFullYear()}function Wu(n,t){var 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 zu(n,t){K(2,arguments);var e=et(n),i=et(t),r=Wu(e,i),a=Math.abs(Iy(e,i));e.setDate(e.getDate()-r*a);var s=+(Wu(e,i)===-r),o=r*(a-s);return o===0?0:o}function qr(n,t){return K(2,arguments),et(n).getTime()-et(t).getTime()}var Hu={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},qy="trunc";function Xi(n){return n?Hu[n]:Hu[qy]}function Xy(n,t,e){K(2,arguments);var i=qr(n,t)/qi;return Xi(e==null?void 0:e.roundingMethod)(i)}function Gy(n,t,e){K(2,arguments);var i=qr(n,t)/Vr;return Xi(e==null?void 0:e.roundingMethod)(i)}function $u(n){K(1,arguments);var t=et(n);return t.setHours(23,59,59,999),t}function ju(n){K(1,arguments);var t=et(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Ky(n){K(1,arguments);var t=et(n);return $u(t).getTime()===ju(t).getTime()}function Vu(n,t){K(2,arguments);var e=et(n),i=et(t),r=Vi(e,i),a=Math.abs(jy(e,i)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-r*a);var o=Vi(e,i)===-r;Ky(et(n))&&a===1&&Vi(n,i)===1&&(o=!1),s=r*(a-Number(o))}return s===0?0:s}function Zy(n,t,e){K(2,arguments);var i=Vu(n,t)/3;return Xi(e==null?void 0:e.roundingMethod)(i)}function Qy(n,t,e){K(2,arguments);var i=qr(n,t)/1e3;return Xi(e==null?void 0:e.roundingMethod)(i)}function Jy(n,t,e){K(2,arguments);var i=zu(n,t)/7;return Xi(e==null?void 0:e.roundingMethod)(i)}function tb(n,t){K(2,arguments);var e=et(n),i=et(t),r=Vi(e,i),a=Math.abs(Vy(e,i));e.setFullYear(1584),i.setFullYear(1584);var s=Vi(e,i)===-r,o=r*(a-Number(s));return o===0?0:o}function eb(n){K(1,arguments);var t=et(n);return t.setSeconds(0,0),t}function nb(n){K(1,arguments);var t=et(n),e=t.getMonth(),i=e-e%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function ib(n){K(1,arguments);var t=et(n);return t.setDate(1),t.setHours(0,0,0,0),t}function rb(n){K(1,arguments);var t=et(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function ab(n){K(1,arguments);var t=et(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function sb(n){K(1,arguments);var t=et(n);return t.setMinutes(59,59,999),t}function ob(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=et(n),g=f.getDay(),p=(g<d?-7:0)+6-(g-d);return f.setDate(f.getDate()+p),f.setHours(23,59,59,999),f}function lb(n){K(1,arguments);var t=et(n);return t.setSeconds(59,999),t}function cb(n){K(1,arguments);var t=et(n),e=t.getMonth(),i=e-e%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function ub(n){K(1,arguments);var t=et(n);return t.setMilliseconds(999),t}function qu(n,t){K(2,arguments);var e=At(t);return ji(n,-e)}var db=864e5;function fb(n){K(1,arguments);var t=et(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),r=e-i;return Math.floor(r/db)+1}function ei(n){K(1,arguments);var t=1,e=et(n),i=e.getUTCDay(),r=(i<t?7:0)+i-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function Xu(n){K(1,arguments);var t=et(n),e=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(e+1,0,4),i.setUTCHours(0,0,0,0);var r=ei(i),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=ei(a);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function hb(n){K(1,arguments);var t=Xu(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var i=ei(e);return i}var gb=6048e5;function Gu(n){K(1,arguments);var t=et(n),e=ei(t).getTime()-hb(t).getTime();return Math.round(e/gb)+1}function In(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=et(n),g=f.getUTCDay(),p=(g<d?7:0)+g-d;return f.setUTCDate(f.getUTCDate()-p),f.setUTCHours(0,0,0,0),f}function Ms(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=et(n),d=u.getUTCFullYear(),f=mn(),g=At((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&i!==void 0?i:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,g),p.setUTCHours(0,0,0,0);var v=In(p,t),m=new Date(0);m.setUTCFullYear(d,0,g),m.setUTCHours(0,0,0,0);var y=In(m,t);return u.getTime()>=v.getTime()?d+1:u.getTime()>=y.getTime()?d:d-1}function pb(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1),f=Ms(n,t),g=new Date(0);g.setUTCFullYear(f,0,d),g.setUTCHours(0,0,0,0);var p=In(g,t);return p}var mb=6048e5;function Ku(n,t){K(1,arguments);var e=et(n),i=In(e,t).getTime()-pb(e,t).getTime();return Math.round(i/mb)+1}function Tt(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}var yb={y:function(t,e){var i=t.getUTCFullYear(),r=i>0?i:1-i;return Tt(e==="yy"?r%100:r,e.length)},M:function(t,e){var i=t.getUTCMonth();return e==="M"?String(i+1):Tt(i+1,2)},d:function(t,e){return Tt(t.getUTCDate(),e.length)},a:function(t,e){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h:function(t,e){return Tt(t.getUTCHours()%12||12,e.length)},H:function(t,e){return Tt(t.getUTCHours(),e.length)},m:function(t,e){return Tt(t.getUTCMinutes(),e.length)},s:function(t,e){return Tt(t.getUTCSeconds(),e.length)},S:function(t,e){var i=e.length,r=t.getUTCMilliseconds(),a=Math.floor(r*Math.pow(10,i-3));return Tt(a,e.length)}};const yn=yb;var ni={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bb={G:function(t,e,i){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(r,{width:"abbreviated"});case"GGGGG":return i.era(r,{width:"narrow"});case"GGGG":default:return i.era(r,{width:"wide"})}},y:function(t,e,i){if(e==="yo"){var r=t.getUTCFullYear(),a=r>0?r:1-r;return i.ordinalNumber(a,{unit:"year"})}return yn.y(t,e)},Y:function(t,e,i,r){var a=Ms(t,r),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return Tt(o,2)}return e==="Yo"?i.ordinalNumber(s,{unit:"year"}):Tt(s,e.length)},R:function(t,e){var i=Xu(t);return Tt(i,e.length)},u:function(t,e){var i=t.getUTCFullYear();return Tt(i,e.length)},Q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Tt(r,2);case"Qo":return i.ordinalNumber(r,{unit:"quarter"});case"QQQ":return i.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Tt(r,2);case"qo":return i.ordinalNumber(r,{unit:"quarter"});case"qqq":return i.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,i){var r=t.getUTCMonth();switch(e){case"M":case"MM":return yn.M(t,e);case"Mo":return i.ordinalNumber(r+1,{unit:"month"});case"MMM":return i.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,i){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return Tt(r+1,2);case"Lo":return i.ordinalNumber(r+1,{unit:"month"});case"LLL":return i.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,i,r){var a=Ku(t,r);return e==="wo"?i.ordinalNumber(a,{unit:"week"}):Tt(a,e.length)},I:function(t,e,i){var r=Gu(t);return e==="Io"?i.ordinalNumber(r,{unit:"week"}):Tt(r,e.length)},d:function(t,e,i){return e==="do"?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):yn.d(t,e)},D:function(t,e,i){var r=fb(t);return e==="Do"?i.ordinalNumber(r,{unit:"dayOfYear"}):Tt(r,e.length)},E:function(t,e,i){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(r,{width:"short",context:"formatting"});case"EEEE":default:return i.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Tt(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Tt(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var r=t.getUTCDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return Tt(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(r,{width:"short",context:"formatting"});case"iiii":default:return i.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,i){var r=t.getUTCHours(),a=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,i){var r=t.getUTCHours(),a;switch(r===12?a=ni.noon:r===0?a=ni.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,i){var r=t.getUTCHours(),a;switch(r>=17?a=ni.evening:r>=12?a=ni.afternoon:r>=4?a=ni.morning:a=ni.night,e){case"B":case"BB":case"BBB":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,i){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),i.ordinalNumber(r,{unit:"hour"})}return yn.h(t,e)},H:function(t,e,i){return e==="Ho"?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):yn.H(t,e)},K:function(t,e,i){var r=t.getUTCHours()%12;return e==="Ko"?i.ordinalNumber(r,{unit:"hour"}):Tt(r,e.length)},k:function(t,e,i){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?i.ordinalNumber(r,{unit:"hour"}):Tt(r,e.length)},m:function(t,e,i){return e==="mo"?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):yn.m(t,e)},s:function(t,e,i){return e==="so"?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):yn.s(t,e)},S:function(t,e){return yn.S(t,e)},X:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Qu(s);case"XXXX":case"XX":return Nn(s);case"XXXXX":case"XXX":default:return Nn(s,":")}},x:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Qu(s);case"xxxx":case"xx":return Nn(s);case"xxxxx":case"xxx":default:return Nn(s,":")}},O:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Zu(s,":");case"OOOO":default:return"GMT"+Nn(s,":")}},z:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Zu(s,":");case"zzzz":default:return"GMT"+Nn(s,":")}},t:function(t,e,i,r){var a=r._originalDate||t,s=Math.floor(a.getTime()/1e3);return Tt(s,e.length)},T:function(t,e,i,r){var a=r._originalDate||t,s=a.getTime();return Tt(s,e.length)}};function Zu(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+Tt(a,2)}function Qu(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Tt(Math.abs(n)/60,2)}return Nn(n,t)}function Nn(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=Tt(Math.floor(r/60),2),s=Tt(r%60,2);return i+a+e+s}const vb=bb;var Ju=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},td=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},xb=function(t,e){var i=t.match(/(P+)(p+)?/)||[],r=i[1],a=i[2];if(!a)return Ju(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Ju(r,e)).replace("{{time}}",td(a,e))},_b={p:td,P:xb};const Ss=_b;var wb=["D","DD"],Tb=["YY","YYYY"];function ed(n){return wb.indexOf(n)!==-1}function nd(n){return Tb.indexOf(n)!==-1}function Xr(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Db={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"}},Mb=function(t,e,i){var r,a=Db[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r};const Sb=Mb;function Cs(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,i=n.formats[e]||n.formats[n.defaultWidth];return i}}var Cb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ob={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pb={date:Cs({formats:Cb,defaultWidth:"full"}),time:Cs({formats:kb,defaultWidth:"full"}),dateTime:Cs({formats:Ob,defaultWidth:"full"})};const Eb=Pb;var Ab={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rb=function(t,e,i,r){return Ab[t]};const Lb=Rb;function Gi(n){return function(t,e){var i=e!=null&&e.context?String(e.context):"standalone",r;if(i==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;r=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return r[c]}}var Ib={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fb={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"]},Ub={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"]},Bb={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"}},Yb={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"}},Wb=function(t,e){var i=Number(t),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},zb={ordinalNumber:Wb,era:Gi({values:Ib,defaultWidth:"wide"}),quarter:Gi({values:Nb,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Gi({values:Fb,defaultWidth:"wide"}),day:Gi({values:Ub,defaultWidth:"wide"}),dayPeriod:Gi({values:Bb,defaultWidth:"wide",formattingValues:Yb,defaultFormattingWidth:"wide"})};const Hb=zb;function Ki(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],a=t.match(r);if(!a)return null;var s=a[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?jb(o,function(d){return d.test(s)}):$b(o,function(d){return d.test(s)}),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function $b(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function jb(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function Vb(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(n.matchPattern);if(!i)return null;var r=i[0],a=t.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var o=t.slice(r.length);return{value:s,rest:o}}}var qb=/^(\d+)(th|st|nd|rd)?/i,Xb=/\d+/i,Gb={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},Kb={any:[/^b/i,/^(a|c)/i]},Zb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Qb={any:[/1/i,/2/i,/3/i,/4/i]},Jb={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},tv={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]},ev={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},nv={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]},iv={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},rv={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}},av={ordinalNumber:Vb({matchPattern:qb,parsePattern:Xb,valueCallback:function(t){return parseInt(t,10)}}),era:Ki({matchPatterns:Gb,defaultMatchWidth:"wide",parsePatterns:Kb,defaultParseWidth:"any"}),quarter:Ki({matchPatterns:Zb,defaultMatchWidth:"wide",parsePatterns:Qb,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ki({matchPatterns:Jb,defaultMatchWidth:"wide",parsePatterns:tv,defaultParseWidth:"any"}),day:Ki({matchPatterns:ev,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),dayPeriod:Ki({matchPatterns:iv,defaultMatchWidth:"any",parsePatterns:rv,defaultParseWidth:"any"})},sv={code:"en-US",formatDistance:Sb,formatLong:Eb,formatRelative:Lb,localize:Hb,match:av,options:{weekStartsOn:0,firstWeekContainsDate:1}};const id=sv;var ov=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cv=/^'([^]*?)'?$/,uv=/''/g,dv=/[a-zA-Z]/;function fv(n,t,e){var i,r,a,s,o,l,c,u,d,f,g,p,v,m,y,x,_,w;K(2,arguments);var M=String(t),C=mn(),k=(i=(r=e==null?void 0:e.locale)!==null&&r!==void 0?r:C.locale)!==null&&i!==void 0?i:id,T=At((a=(s=(o=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(c=e.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:C.firstWeekContainsDate)!==null&&s!==void 0?s:(d=C.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=At((g=(p=(v=(m=e==null?void 0:e.weekStartsOn)!==null&&m!==void 0?m:e==null||(y=e.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&v!==void 0?v:C.weekStartsOn)!==null&&p!==void 0?p:(_=C.locale)===null||_===void 0||(w=_.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&g!==void 0?g:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var O=et(n);if(!Ds(O))throw new RangeError("Invalid time value");var E=jr(O),A=qu(O,E),R={firstWeekContainsDate:T,weekStartsOn:D,locale:k,_originalDate:O},q=M.match(lv).map(function(H){var B=H[0];if(B==="p"||B==="P"){var I=Ss[B];return I(H,k.formatLong)}return H}).join("").match(ov).map(function(H){if(H==="''")return"'";var B=H[0];if(B==="'")return hv(H);var I=vb[B];if(I)return!(e!=null&&e.useAdditionalWeekYearTokens)&&nd(H)&&Xr(H,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&ed(H)&&Xr(H,t,String(n)),I(A,H,k.localize,R);if(B.match(dv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+B+"`");return H}).join("");return q}function hv(n){var t=n.match(cv);return t?t[1].replace(uv,"'"):n}function gv(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function rd(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function pv(n,t){if(n){if(typeof n=="string")return rd(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return rd(n,t)}}function ad(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=pv(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(s)throw o}}}}function X(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ks(n,t){return ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},ks(n,t)}function gt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&ks(n,t)}function Gr(n){return Gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gr(n)}function mv(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yv(n,t){if(t&&(Ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X(n)}function pt(n){var t=mv();return function(){var i=Gr(n),r;if(t){var a=Gr(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return yv(this,r)}}function ft(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function bv(n,t){if(Ge(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(Ge(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function sd(n){var t=bv(n,"string");return Ge(t)==="symbol"?t:String(t)}function od(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,sd(i.key),i)}}function ht(n,t,e){return t&&od(n.prototype,t),e&&od(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function j(n,t,e){return t=sd(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var vv=10,ld=function(){function n(){ft(this,n),j(this,"priority",void 0),j(this,"subPriority",0)}return ht(n,[{key:"validate",value:function(e,i){return!0}}]),n}(),xv=function(n){gt(e,n);var t=pt(e);function e(i,r,a,s,o){var l;return ft(this,e),l=t.call(this),l.value=i,l.validateValue=r,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return ht(e,[{key:"validate",value:function(r,a){return this.validateValue(r,this.value,a)}},{key:"set",value:function(r,a,s){return this.setValue(r,a,this.value,s)}}]),e}(ld),_v=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",vv),j(X(i),"subPriority",-1),i}return ht(e,[{key:"set",value:function(r,a){if(a.timestampIsSet)return r;var s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}}]),e}(ld),bt=function(){function n(){ft(this,n),j(this,"incompatibleTokens",void 0),j(this,"priority",void 0),j(this,"subPriority",void 0)}return ht(n,[{key:"run",value:function(e,i,r,a){var s=this.parse(e,i,r,a);return s?{setter:new xv(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,i,r){return!0}}]),n}(),wv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",140),j(X(i),"incompatibleTokens",["R","u","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})||s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"})}}},{key:"set",value:function(r,a,s){return a.era=s,r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),jt={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}/},Fe={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 Vt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Ut(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:i*(r*qi+a*Vr+s*zy),rest:t.slice(e[0].length)}}function cd(n){return Ut(jt.anyDigitsSigned,n)}function $t(n,t){switch(n){case 1:return Ut(jt.singleDigit,t);case 2:return Ut(jt.twoDigits,t);case 3:return Ut(jt.threeDigits,t);case 4:return Ut(jt.fourDigits,t);default:return Ut(new RegExp("^\\d{1,"+n+"}"),t)}}function Kr(n,t){switch(n){case 1:return Ut(jt.singleDigitSigned,t);case 2:return Ut(jt.twoDigitsSigned,t);case 3:return Ut(jt.threeDigitsSigned,t);case 4:return Ut(jt.fourDigitsSigned,t);default:return Ut(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Os(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 ud(n,t){var e=t>0,i=e?t:1-t,r;if(i<=50)r=n||100;else{var a=i+50,s=Math.floor(a/100)*100,o=n>=a%100;r=n+s-(o?100:0)}return e?r:1-r}function dd(n){return n%400===0||n%4===0&&n%100!==0}var Tv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",130),j(X(i),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return Vt($t(4,r),o);case"yo":return Vt(s.ordinalNumber(r,{unit:"year"}),o);default:return Vt($t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s){var o=r.getUTCFullYear();if(s.isTwoDigitYear){var l=ud(s.year,o);return r.setUTCFullYear(l,0,1),r.setUTCHours(0,0,0,0),r}var c=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(c,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Dv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",130),j(X(i),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return Vt($t(4,r),o);case"Yo":return Vt(s.ordinalNumber(r,{unit:"year"}),o);default:return Vt($t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s,o){var l=Ms(r,o);if(s.isTwoDigitYear){var c=ud(s.year,l);return r.setUTCFullYear(c,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),In(r,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(u,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),In(r,o)}}]),e}(bt),Mv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",130),j(X(i),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){return Kr(a==="R"?4:a.length,r)}},{key:"set",value:function(r,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),ei(o)}}]),e}(bt),Sv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",130),j(X(i),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){return Kr(a==="u"?4:a.length,r)}},{key:"set",value:function(r,a,s){return r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Cv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",120),j(X(i),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"Q":case"QQ":return $t(a.length,r);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})||s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),kv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",120),j(X(i),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"q":case"qq":return $t(a.length,r);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})||s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Ov=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),j(X(i),"priority",110),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"M":return Vt(Ut(jt.month,r),o);case"MM":return Vt($t(2,r),o);case"Mo":return Vt(s.ordinalNumber(r,{unit:"month"}),o);case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})||s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Pv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",110),j(X(i),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"L":return Vt(Ut(jt.month,r),o);case"LL":return Vt($t(2,r),o);case"Lo":return Vt(s.ordinalNumber(r,{unit:"month"}),o);case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})||s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function Ev(n,t,e){K(2,arguments);var i=et(n),r=At(t),a=Ku(i,e)-r;return i.setUTCDate(i.getUTCDate()-a*7),i}var Av=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",100),j(X(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"w":return Ut(jt.week,r);case"wo":return s.ordinalNumber(r,{unit:"week"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s,o){return In(Ev(r,s,o),o)}}]),e}(bt);function Rv(n,t){K(2,arguments);var e=et(n),i=At(t),r=Gu(e)-i;return e.setUTCDate(e.getUTCDate()-r*7),e}var Lv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",100),j(X(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"I":return Ut(jt.week,r);case"Io":return s.ordinalNumber(r,{unit:"week"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s){return ei(Rv(r,s))}}]),e}(bt),Iv=[31,28,31,30,31,30,31,31,30,31,30,31],Nv=[31,29,31,30,31,30,31,31,30,31,30,31],Fv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"subPriority",1),j(X(i),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"d":return Ut(jt.date,r);case"do":return s.ordinalNumber(r,{unit:"date"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=dd(s),l=r.getUTCMonth();return o?a>=1&&a<=Nv[l]:a>=1&&a<=Iv[l]}},{key:"set",value:function(r,a,s){return r.setUTCDate(s),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Uv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"subpriority",1),j(X(i),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"D":case"DD":return Ut(jt.dayOfYear,r);case"Do":return s.ordinalNumber(r,{unit:"date"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=dd(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(r,a,s){return r.setUTCMonth(0,s),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function Ps(n,t,e){var i,r,a,s,o,l,c,u;K(2,arguments);var d=mn(),f=At((i=(r=(a=(s=e==null?void 0:e.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:d.weekStartsOn)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=et(n),p=At(t),v=g.getUTCDay(),m=p%7,y=(m+7)%7,x=(y<f?7:0)+p-v;return g.setUTCDate(g.getUTCDate()+x),g}var Bv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"incompatibleTokens",["D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Yv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"e":case"ee":return Vt($t(a.length,r),l);case"eo":return Vt(s.ordinalNumber(r,{unit:"day"}),l);case"eee":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Wv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"c":case"cc":return Vt($t(a.length,r),l);case"co":return Vt(s.ordinalNumber(r,{unit:"day"}),l);case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})||s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function zv(n,t){K(2,arguments);var e=At(t);e%7===0&&(e=e-7);var i=1,r=et(n),a=r.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<i?7:0)+e-a;return r.setUTCDate(r.getUTCDate()+l),r}var Hv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return $t(a.length,r);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return Vt(s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return Vt(s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Vt(s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Vt(s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(r,a){return a>=1&&a<=7}},{key:"set",value:function(r,a,s){return r=zv(r,s),r.setUTCHours(0,0,0,0),r}}]),e}(bt),$v=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",80),j(X(i),"incompatibleTokens",["b","B","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),jv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",80),j(X(i),"incompatibleTokens",["a","B","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),Vv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",80),j(X(i),"incompatibleTokens",["a","b","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),qv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",70),j(X(i),"incompatibleTokens",["H","K","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"h":return Ut(jt.hour12h,r);case"ho":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=12}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):!o&&s===12?r.setUTCHours(0,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(bt),Xv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",70),j(X(i),"incompatibleTokens",["a","b","h","K","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"H":return Ut(jt.hour23h,r);case"Ho":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=23}},{key:"set",value:function(r,a,s){return r.setUTCHours(s,0,0,0),r}}]),e}(bt),Gv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",70),j(X(i),"incompatibleTokens",["h","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"K":return Ut(jt.hour11h,r);case"Ko":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(bt),Kv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",70),j(X(i),"incompatibleTokens",["a","b","h","H","K","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"k":return Ut(jt.hour24h,r);case"ko":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=24}},{key:"set",value:function(r,a,s){var o=s<=24?s%24:s;return r.setUTCHours(o,0,0,0),r}}]),e}(bt),Zv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",60),j(X(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"m":return Ut(jt.minute,r);case"mo":return s.ordinalNumber(r,{unit:"minute"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCMinutes(s,0,0),r}}]),e}(bt),Qv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",50),j(X(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"s":return Ut(jt.second,r);case"so":return s.ordinalNumber(r,{unit:"second"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCSeconds(s,0),r}}]),e}(bt),Jv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",30),j(X(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return Vt($t(a.length,r),s)}},{key:"set",value:function(r,a,s){return r.setUTCMilliseconds(s),r}}]),e}(bt),tx=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",10),j(X(i),"incompatibleTokens",["t","T","x"]),i}return ht(e,[{key:"parse",value:function(r,a){switch(a){case"X":return Ue(Fe.basicOptionalMinutes,r);case"XX":return Ue(Fe.basic,r);case"XXXX":return Ue(Fe.basicOptionalSeconds,r);case"XXXXX":return Ue(Fe.extendedOptionalSeconds,r);case"XXX":default:return Ue(Fe.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(bt),ex=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",10),j(X(i),"incompatibleTokens",["t","T","X"]),i}return ht(e,[{key:"parse",value:function(r,a){switch(a){case"x":return Ue(Fe.basicOptionalMinutes,r);case"xx":return Ue(Fe.basic,r);case"xxxx":return Ue(Fe.basicOptionalSeconds,r);case"xxxxx":return Ue(Fe.extendedOptionalSeconds,r);case"xxx":default:return Ue(Fe.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(bt),nx=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",40),j(X(i),"incompatibleTokens","*"),i}return ht(e,[{key:"parse",value:function(r){return cd(r)}},{key:"set",value:function(r,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(bt),ix=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",20),j(X(i),"incompatibleTokens","*"),i}return ht(e,[{key:"parse",value:function(r){return cd(r)}},{key:"set",value:function(r,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(bt),rx={G:new wv,y:new Tv,Y:new Dv,R:new Mv,u:new Sv,Q:new Cv,q:new kv,M:new Ov,L:new Pv,w:new Av,I:new Lv,d:new Fv,D:new Uv,E:new Bv,e:new Yv,c:new Wv,i:new Hv,a:new $v,b:new jv,B:new Vv,h:new qv,H:new Xv,K:new Gv,k:new Kv,m:new Zv,s:new Qv,S:new Jv,X:new tx,x:new ex,t:new nx,T:new ix},ax=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ox=/^'([^]*?)'?$/,lx=/''/g,cx=/\S/,ux=/[a-zA-Z]/;function dx(n,t,e,i){var r,a,s,o,l,c,u,d,f,g,p,v,m,y,x,_,w,M;K(3,arguments);var C=String(n),k=String(t),T=mn(),D=(r=(a=i==null?void 0:i.locale)!==null&&a!==void 0?a:T.locale)!==null&&r!==void 0?r:id;if(!D.match)throw new RangeError("locale must contain match property");var O=At((s=(o=(l=(c=i==null?void 0:i.firstWeekContainsDate)!==null&&c!==void 0?c:i==null||(u=i.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:T.firstWeekContainsDate)!==null&&o!==void 0?o:(f=T.locale)===null||f===void 0||(g=f.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=At((p=(v=(m=(y=i==null?void 0:i.weekStartsOn)!==null&&y!==void 0?y:i==null||(x=i.locale)===null||x===void 0||(_=x.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&v!==void 0?v:(w=T.locale)===null||w===void 0||(M=w.options)===null||M===void 0?void 0:M.weekStartsOn)!==null&&p!==void 0?p:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(k==="")return C===""?et(e):new Date(NaN);var A={firstWeekContainsDate:O,weekStartsOn:E,locale:D},R=[new _v],q=k.match(sx).map(function(F){var L=F[0];if(L in Ss){var Q=Ss[L];return Q(F,D.formatLong)}return F}).join("").match(ax),H=[],B=ad(q),I;try{var rt=function(){var L=I.value;!(i!=null&&i.useAdditionalWeekYearTokens)&&nd(L)&&Xr(L,k,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&ed(L)&&Xr(L,k,n);var Q=L[0],G=rx[Q];if(G){var vt=G.incompatibleTokens;if(Array.isArray(vt)){var dt=H.find(function(Dt){return vt.includes(Dt.token)||Dt.token===Q});if(dt)throw new RangeError("The format string mustn't contain `".concat(dt.fullToken,"` and `").concat(L,"` at the same time"))}else if(G.incompatibleTokens==="*"&&H.length>0)throw new RangeError("The format string mustn't contain `".concat(L,"` and any other token at the same time"));H.push({token:Q,fullToken:L});var It=G.run(C,L,D.match,A);if(!It)return{v:new Date(NaN)};R.push(It.setter),C=It.rest}else{if(Q.match(ux))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Q+"`");if(L==="''"?L="'":Q==="'"&&(L=fx(L)),C.indexOf(L)===0)C=C.slice(L.length);else return{v:new Date(NaN)}}};for(B.s();!(I=B.n()).done;){var W=rt();if(Ge(W)==="object")return W.v}}catch(F){B.e(F)}finally{B.f()}if(C.length>0&&cx.test(C))return new Date(NaN);var Ct=R.map(function(F){return F.priority}).sort(function(F,L){return L-F}).filter(function(F,L,Q){return Q.indexOf(F)===L}).map(function(F){return R.filter(function(L){return L.priority===F}).sort(function(L,Q){return Q.subPriority-L.subPriority})}).map(function(F){return F[0]}),mt=et(e);if(isNaN(mt.getTime()))return new Date(NaN);var $=qu(mt,jr(mt)),N={},Y=ad(Ct),V;try{for(Y.s();!(V=Y.n()).done;){var Z=V.value;if(!Z.validate($,A))return new Date(NaN);var J=Z.set($,N,A);Array.isArray(J)?($=J[0],gv(N,J[1])):$=J}}catch(F){Y.e(F)}finally{Y.f()}return $}function fx(n){return n.match(ox)[1].replace(lx,"'")}function hx(n){K(1,arguments);var t=et(n);return t.setMinutes(0,0,0),t}function gx(n){K(1,arguments);var t=et(n);return t.setMilliseconds(0),t}function px(n){K(1,arguments);var t=n/qi;return Math.floor(t)}function fd(n,t){var e;K(1,arguments);var i=At((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=vx(n),a;if(r.date){var s=xx(r.date,i);a=_x(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(r.time&&(l=wx(r.time),isNaN(l)))return new Date(NaN);if(r.timezone){if(c=Tx(r.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(o+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(o+l+c)}var Zr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},mx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,yx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,bx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function vx(n){var t={},e=n.split(Zr.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Zr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Zr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){var r=Zr.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function xx(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,a=i[2]?parseInt(i[2]):null;return{year:a===null?r:a*100,restDateString:n.slice((i[1]||i[2]).length)}}function _x(n,t){if(t===null)return new Date(NaN);var e=n.match(mx);if(!e)return new Date(NaN);var i=!!e[4],r=Zi(e[1]),a=Zi(e[2])-1,s=Zi(e[3]),o=Zi(e[4]),l=Zi(e[5])-1;if(i)return kx(t,o,l)?Dx(t,o,l):new Date(NaN);var c=new Date(0);return!Sx(t,a,s)||!Cx(t,r)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(r,s)),c)}function Zi(n){return n?parseInt(n):1}function wx(n){var t=n.match(yx);if(!t)return NaN;var e=Es(t[1]),i=Es(t[2]),r=Es(t[3]);return Ox(e,i,r)?e*qi+i*Vr+r*1e3:NaN}function Es(n){return n&&parseFloat(n.replace(",","."))||0}function Tx(n){if(n==="Z")return 0;var t=n.match(bx);if(!t)return 0;var e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return Px(i,r)?e*(i*qi+r*Vr):NaN}function Dx(n,t,e){var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Mx=[31,null,31,30,31,30,31,31,30,31,30,31];function hd(n){return n%400===0||n%4===0&&n%100!==0}function Sx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Mx[t]||(hd(n)?29:28))}function Cx(n,t){return t>=1&&t<=(hd(n)?366:365)}function kx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Ox(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Px(n,t){return t>=0&&t<=59}function Ex(n){K(1,arguments);var t=n/Hy;return Math.floor(t)}var ee=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(ee||{}),Qr=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(Qr||{}),Bt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Bt||{}),ii=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(ii||{});const As=(n,t)=>{var r,a;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((s,o)=>o.rawValue-s.rawValue);if(e.body&&!n.locked){const s=e.labelColors,o=((a=(r=t.chart.config)==null?void 0:r.options)==null?void 0:a.indexAxis)==="y"?"x":"y",l=[ee.HORIZONTAL_BAR,ee.VERTICAL_BAR].includes(n.chartType),c=[Qr.GAUGE,ee.DOUGHNUT].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const f=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(f)?f:_s(f);else{const v=n.translateUnit(n.units,f);g=`${f%1===0?ta.format(f):ta.format(Number(f.toFixed(Id)))} ${v}`}const p=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:s[d].backgroundColor,borderColor:s[d].borderColor,label:p,value:g,rawValue:f}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Ax=n=>n&&n.datasets&&n.datasets.length,Rx=n=>Ax(n)&&n.datasets.some(t=>t.data.length),Lx=n=>Rx(n)&&n.datasets.some(t=>t.data.length>1),Ix=n=>Lx(n)&&n.datasets.some(t=>t.data[0]&&Ds(t.data[0].x)),Nx=n=>Ix(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Rs=(n,t,e)=>{const r=Math.min(t/1150,1),a=.15,s=1.15;return n.x<e?n.x+t*a*(1-r):n.x-t*s*(1-r)},Fx=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ls={exports:{}},gd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(gd);var Yt=gd.exports,Is={exports:{}},Ns={exports:{}},pd={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(pd);var md=pd.exports,Fs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(r.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+r.length+" present")}n.exports=t.default})(Fs,Fs.exports);var ae=Fs.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(md),r=e(ae);function a(s){return(0,r.default)(1,arguments),s instanceof Date||(0,i.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ns,Ns.exports);var Ux=Ns.exports,Us={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(md),r=e(ae);function a(s){(0,r.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,i.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}n.exports=t.default})(Us,Us.exports);var Be=Us.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Ux),r=e(Be),a=e(ae);function s(o){if((0,a.default)(1,arguments),!(0,i.default)(o)&&typeof o!="number")return!1;var l=(0,r.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Is,Is.exports);var Bx=Is.exports,Bs={exports:{}},Ys={exports:{}},Ws={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Ws,Ws.exports);var Un=Ws.exports;const Yx=Fn(Un);(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Un),r=e(Be),a=e(ae);function s(o,l){(0,a.default)(2,arguments);var c=(0,r.default)(o).getTime(),u=(0,i.default)(l);return new Date(c+u)}n.exports=t.default})(Ys,Ys.exports);var Wx=Ys.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Wx),r=e(ae),a=e(Un);function s(o,l){(0,r.default)(2,arguments);var c=(0,a.default)(l);return(0,i.default)(o,-c)}n.exports=t.default})(Bs,Bs.exports);var zx=Bs.exports,zs={exports:{}},Hs={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Be),r=e(ae),a=864e5;function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(Hs,Hs.exports);var Hx=Hs.exports,$s={exports:{}},js={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(Be),r=e(ae);function a(s){(0,r.default)(1,arguments);var o=1,l=(0,i.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(js,js.exports);var Vs=js.exports,qs={exports:{}},Xs={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Be),r=e(ae),a=e(Vs);function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var g=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=g.getTime()?c:c-1}n.exports=t.default})(Xs,Xs.exports);var yd=Xs.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(yd),r=e(Vs),a=e(ae);function s(o){(0,a.default)(1,arguments);var l=(0,i.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,r.default)(c);return u}n.exports=t.default})(qs,qs.exports);var $x=qs.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(Vs),a=e($x),s=e(ae),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,i.default)(c),d=(0,r.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})($s,$s.exports);var jx=$s.exports,Gs={exports:{}},Ks={exports:{}},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.getDefaultOptions=Vx,Bn.setDefaultOptions=qx;var bd={};function Vx(){return bd}function qx(n){bd=n}(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=e(Be),r=e(ae),a=e(Un),s=Bn;function o(l,c){var u,d,f,g,p,v,m,y;(0,r.default)(1,arguments);var x=(0,s.getDefaultOptions)(),_=(0,a.default)((u=(d=(f=(g=c==null?void 0:c.weekStartsOn)!==null&&g!==void 0?g:c==null||(p=c.locale)===null||p===void 0||(v=p.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&f!==void 0?f:x.weekStartsOn)!==null&&d!==void 0?d:(m=x.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&u!==void 0?u:0);if(!(_>=0&&_<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,i.default)(l),M=w.getUTCDay(),C=(M<_?7:0)+M-_;return w.setUTCDate(w.getUTCDate()-C),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(Ks,Ks.exports);var Zs=Ks.exports,Qs={exports:{}},Js={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(ae),a=e(Zs),s=e(Un),o=Bn;function l(c,u){var d,f,g,p,v,m,y,x;(0,r.default)(1,arguments);var _=(0,i.default)(c),w=_.getUTCFullYear(),M=(0,o.getDefaultOptions)(),C=(0,s.default)((d=(f=(g=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(v=u.locale)===null||v===void 0||(m=v.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&g!==void 0?g:M.firstWeekContainsDate)!==null&&f!==void 0?f:(y=M.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=new Date(0);k.setUTCFullYear(w+1,0,C),k.setUTCHours(0,0,0,0);var T=(0,a.default)(k,u),D=new Date(0);D.setUTCFullYear(w,0,C),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return _.getTime()>=T.getTime()?w+1:_.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(Js,Js.exports);var vd=Js.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(vd),r=e(ae),a=e(Zs),s=e(Un),o=Bn;function l(c,u){var d,f,g,p,v,m,y,x;(0,r.default)(1,arguments);var _=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(g=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(v=u.locale)===null||v===void 0||(m=v.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&g!==void 0?g:_.firstWeekContainsDate)!==null&&f!==void 0?f:(y=_.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.firstWeekContainsDate)!==null&&d!==void 0?d:1),M=(0,i.default)(c,u),C=new Date(0);C.setUTCFullYear(M,0,w),C.setUTCHours(0,0,0,0);var k=(0,a.default)(C,u);return k}n.exports=t.default})(Qs,Qs.exports);var Xx=Qs.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(Zs),a=e(Xx),s=e(ae),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,i.default)(c),f=(0,r.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(Gs,Gs.exports);var Gx=Gs.exports,to={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){for(var a=i<0?"-":"",s=Math.abs(i).toString();s.length<r;)s="0"+s;return a+s}n.exports=t.default})(to,to.exports);var xd=to.exports,eo={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(xd),r={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,i.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,i.default)(c+1,2)},d:function(o,l){return(0,i.default)(o.getUTCDate(),l.length)},a:function(o,l){var c=o.getUTCHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];case"aaaa":default:return c==="am"?"a.m.":"p.m."}},h:function(o,l){return(0,i.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,i.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,i.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,i.default)(o.getUTCSeconds(),l.length)},S:function(o,l){var c=l.length,u=o.getUTCMilliseconds(),d=Math.floor(u*Math.pow(10,c-3));return(0,i.default)(d,l.length)}},a=r;t.default=a,n.exports=t.default})(eo,eo.exports);var Kx=eo.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(Hx),r=e(jx),a=e(yd),s=e(Gx),o=e(vd),l=e(xd),c=e(Kx),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(y,x,_){var w=y.getUTCFullYear()>0?1:0;switch(x){case"G":case"GG":case"GGG":return _.era(w,{width:"abbreviated"});case"GGGGG":return _.era(w,{width:"narrow"});case"GGGG":default:return _.era(w,{width:"wide"})}},y:function(y,x,_){if(x==="yo"){var w=y.getUTCFullYear(),M=w>0?w:1-w;return _.ordinalNumber(M,{unit:"year"})}return c.default.y(y,x)},Y:function(y,x,_,w){var M=(0,o.default)(y,w),C=M>0?M:1-M;if(x==="YY"){var k=C%100;return(0,l.default)(k,2)}return x==="Yo"?_.ordinalNumber(C,{unit:"year"}):(0,l.default)(C,x.length)},R:function(y,x){var _=(0,a.default)(y);return(0,l.default)(_,x.length)},u:function(y,x){var _=y.getUTCFullYear();return(0,l.default)(_,x.length)},Q:function(y,x,_){var w=Math.ceil((y.getUTCMonth()+1)/3);switch(x){case"Q":return String(w);case"QQ":return(0,l.default)(w,2);case"Qo":return _.ordinalNumber(w,{unit:"quarter"});case"QQQ":return _.quarter(w,{width:"abbreviated",context:"formatting"});case"QQQQQ":return _.quarter(w,{width:"narrow",context:"formatting"});case"QQQQ":default:return _.quarter(w,{width:"wide",context:"formatting"})}},q:function(y,x,_){var w=Math.ceil((y.getUTCMonth()+1)/3);switch(x){case"q":return String(w);case"qq":return(0,l.default)(w,2);case"qo":return _.ordinalNumber(w,{unit:"quarter"});case"qqq":return _.quarter(w,{width:"abbreviated",context:"standalone"});case"qqqqq":return _.quarter(w,{width:"narrow",context:"standalone"});case"qqqq":default:return _.quarter(w,{width:"wide",context:"standalone"})}},M:function(y,x,_){var w=y.getUTCMonth();switch(x){case"M":case"MM":return c.default.M(y,x);case"Mo":return _.ordinalNumber(w+1,{unit:"month"});case"MMM":return _.month(w,{width:"abbreviated",context:"formatting"});case"MMMMM":return _.month(w,{width:"narrow",context:"formatting"});case"MMMM":default:return _.month(w,{width:"wide",context:"formatting"})}},L:function(y,x,_){var w=y.getUTCMonth();switch(x){case"L":return String(w+1);case"LL":return(0,l.default)(w+1,2);case"Lo":return _.ordinalNumber(w+1,{unit:"month"});case"LLL":return _.month(w,{width:"abbreviated",context:"standalone"});case"LLLLL":return _.month(w,{width:"narrow",context:"standalone"});case"LLLL":default:return _.month(w,{width:"wide",context:"standalone"})}},w:function(y,x,_,w){var M=(0,s.default)(y,w);return x==="wo"?_.ordinalNumber(M,{unit:"week"}):(0,l.default)(M,x.length)},I:function(y,x,_){var w=(0,r.default)(y);return x==="Io"?_.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,x.length)},d:function(y,x,_){return x==="do"?_.ordinalNumber(y.getUTCDate(),{unit:"date"}):c.default.d(y,x)},D:function(y,x,_){var w=(0,i.default)(y);return x==="Do"?_.ordinalNumber(w,{unit:"dayOfYear"}):(0,l.default)(w,x.length)},E:function(y,x,_){var w=y.getUTCDay();switch(x){case"E":case"EE":case"EEE":return _.day(w,{width:"abbreviated",context:"formatting"});case"EEEEE":return _.day(w,{width:"narrow",context:"formatting"});case"EEEEEE":return _.day(w,{width:"short",context:"formatting"});case"EEEE":default:return _.day(w,{width:"wide",context:"formatting"})}},e:function(y,x,_,w){var M=y.getUTCDay(),C=(M-w.weekStartsOn+8)%7||7;switch(x){case"e":return String(C);case"ee":return(0,l.default)(C,2);case"eo":return _.ordinalNumber(C,{unit:"day"});case"eee":return _.day(M,{width:"abbreviated",context:"formatting"});case"eeeee":return _.day(M,{width:"narrow",context:"formatting"});case"eeeeee":return _.day(M,{width:"short",context:"formatting"});case"eeee":default:return _.day(M,{width:"wide",context:"formatting"})}},c:function(y,x,_,w){var M=y.getUTCDay(),C=(M-w.weekStartsOn+8)%7||7;switch(x){case"c":return String(C);case"cc":return(0,l.default)(C,x.length);case"co":return _.ordinalNumber(C,{unit:"day"});case"ccc":return _.day(M,{width:"abbreviated",context:"standalone"});case"ccccc":return _.day(M,{width:"narrow",context:"standalone"});case"cccccc":return _.day(M,{width:"short",context:"standalone"});case"cccc":default:return _.day(M,{width:"wide",context:"standalone"})}},i:function(y,x,_){var w=y.getUTCDay(),M=w===0?7:w;switch(x){case"i":return String(M);case"ii":return(0,l.default)(M,x.length);case"io":return _.ordinalNumber(M,{unit:"day"});case"iii":return _.day(w,{width:"abbreviated",context:"formatting"});case"iiiii":return _.day(w,{width:"narrow",context:"formatting"});case"iiiiii":return _.day(w,{width:"short",context:"formatting"});case"iiii":default:return _.day(w,{width:"wide",context:"formatting"})}},a:function(y,x,_){var w=y.getUTCHours(),M=w/12>=1?"pm":"am";switch(x){case"a":case"aa":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"});case"aaa":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return _.dayPeriod(M,{width:"narrow",context:"formatting"});case"aaaa":default:return _.dayPeriod(M,{width:"wide",context:"formatting"})}},b:function(y,x,_){var w=y.getUTCHours(),M;switch(w===12?M=u.noon:w===0?M=u.midnight:M=w/12>=1?"pm":"am",x){case"b":case"bb":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"});case"bbb":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return _.dayPeriod(M,{width:"narrow",context:"formatting"});case"bbbb":default:return _.dayPeriod(M,{width:"wide",context:"formatting"})}},B:function(y,x,_){var w=y.getUTCHours(),M;switch(w>=17?M=u.evening:w>=12?M=u.afternoon:w>=4?M=u.morning:M=u.night,x){case"B":case"BB":case"BBB":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"});case"BBBBB":return _.dayPeriod(M,{width:"narrow",context:"formatting"});case"BBBB":default:return _.dayPeriod(M,{width:"wide",context:"formatting"})}},h:function(y,x,_){if(x==="ho"){var w=y.getUTCHours()%12;return w===0&&(w=12),_.ordinalNumber(w,{unit:"hour"})}return c.default.h(y,x)},H:function(y,x,_){return x==="Ho"?_.ordinalNumber(y.getUTCHours(),{unit:"hour"}):c.default.H(y,x)},K:function(y,x,_){var w=y.getUTCHours()%12;return x==="Ko"?_.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,x.length)},k:function(y,x,_){var w=y.getUTCHours();return w===0&&(w=24),x==="ko"?_.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,x.length)},m:function(y,x,_){return x==="mo"?_.ordinalNumber(y.getUTCMinutes(),{unit:"minute"}):c.default.m(y,x)},s:function(y,x,_){return x==="so"?_.ordinalNumber(y.getUTCSeconds(),{unit:"second"}):c.default.s(y,x)},S:function(y,x){return c.default.S(y,x)},X:function(y,x,_,w){var M=w._originalDate||y,C=M.getTimezoneOffset();if(C===0)return"Z";switch(x){case"X":return g(C);case"XXXX":case"XX":return p(C);case"XXXXX":case"XXX":default:return p(C,":")}},x:function(y,x,_,w){var M=w._originalDate||y,C=M.getTimezoneOffset();switch(x){case"x":return g(C);case"xxxx":case"xx":return p(C);case"xxxxx":case"xxx":default:return p(C,":")}},O:function(y,x,_,w){var M=w._originalDate||y,C=M.getTimezoneOffset();switch(x){case"O":case"OO":case"OOO":return"GMT"+f(C,":");case"OOOO":default:return"GMT"+p(C,":")}},z:function(y,x,_,w){var M=w._originalDate||y,C=M.getTimezoneOffset();switch(x){case"z":case"zz":case"zzz":return"GMT"+f(C,":");case"zzzz":default:return"GMT"+p(C,":")}},t:function(y,x,_,w){var M=w._originalDate||y,C=Math.floor(M.getTime()/1e3);return(0,l.default)(C,x.length)},T:function(y,x,_,w){var M=w._originalDate||y,C=M.getTime();return(0,l.default)(C,x.length)}};function f(m,y){var x=m>0?"-":"+",_=Math.abs(m),w=Math.floor(_/60),M=_%60;if(M===0)return x+String(w);var C=y||"";return x+String(w)+C+(0,l.default)(M,2)}function g(m,y){if(m%60===0){var x=m>0?"-":"+";return x+(0,l.default)(Math.abs(m)/60,2)}return p(m,y)}function p(m,y){var x=y||"",_=m>0?"-":"+",w=Math.abs(m),M=(0,l.default)(Math.floor(w/60),2),C=(0,l.default)(w%60,2);return _+M+x+C}var v=d;t.default=v,n.exports=t.default})(zs,zs.exports);var Zx=zs.exports,no={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},i=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},r=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return e(l,c);var g;switch(d){case"P":g=c.dateTime({width:"short"});break;case"PP":g=c.dateTime({width:"medium"});break;case"PPP":g=c.dateTime({width:"long"});break;case"PPPP":default:g=c.dateTime({width:"full"});break}return g.replace("{{date}}",e(d,c)).replace("{{time}}",i(f,c))},a={p:i,P:r},s=a;t.default=s,n.exports=t.default})(no,no.exports);var Qx=no.exports,io={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(io,io.exports);var _d=io.exports;const wd=Fn(_d);var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.isProtectedDayOfYearToken=e_,Qi.isProtectedWeekYearToken=n_,Qi.throwProtectedError=i_;var Jx=["D","DD"],t_=["YY","YYYY"];function e_(n){return Jx.indexOf(n)!==-1}function n_(n){return t_.indexOf(n)!==-1}function i_(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ro={exports:{}},ao={exports:{}},so={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={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"}},i=function(s,o,l){var c,u=e[s];return typeof u=="string"?c=u:o===1?c=u.one:c=u.other.replace("{{count}}",o.toString()),l!=null&&l.addSuffix?l.comparison&&l.comparison>0?"in "+c:c+" ago":c},r=i;t.default=r,n.exports=t.default})(so,so.exports);var r_=so.exports,oo={exports:{}},lo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):i.defaultWidth,s=i.formats[a]||i.formats[i.defaultWidth];return s}}n.exports=t.default})(lo,lo.exports);var a_=lo.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(a_),r={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,i.default)({formats:r,defaultWidth:"full"}),time:(0,i.default)({formats:a,defaultWidth:"full"}),dateTime:(0,i.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(oo,oo.exports);var s_=oo.exports,co={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i=function(s,o,l,c){return e[s]},r=i;t.default=r,n.exports=t.default})(co,co.exports);var o_=co.exports,uo={exports:{}},fo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&i.formattingValues){var l=i.defaultFormattingWidth||i.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=i.formattingValues[c]||i.formattingValues[l]}else{var u=i.defaultWidth,d=a!=null&&a.width?String(a.width):i.defaultWidth;o=i.values[d]||i.values[u]}var f=i.argumentCallback?i.argumentCallback(r):r;return o[f]}}n.exports=t.default})(fo,fo.exports);var l_=fo.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(l_),r={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={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"]},l={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"}},c={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"}},u=function(p,v){var m=Number(p),y=m%100;if(y>20||y<10)switch(y%10){case 1:return m+"st";case 2:return m+"nd";case 3:return m+"rd"}return m+"th"},d={ordinalNumber:u,era:(0,i.default)({values:r,defaultWidth:"wide"}),quarter:(0,i.default)({values:a,defaultWidth:"wide",argumentCallback:function(p){return p-1}}),month:(0,i.default)({values:s,defaultWidth:"wide"}),day:(0,i.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,i.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(uo,uo.exports);var c_=uo.exports,ho={exports:{}},go={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],g=Array.isArray(f)?r(f,function(m){return m.test(d)}):i(f,function(m){return m.test(d)}),p;p=a.valueCallback?a.valueCallback(g):g,p=o.valueCallback?o.valueCallback(p):p;var v=s.slice(d.length);return{value:p,rest:v}}}function i(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function r(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(go,go.exports);var u_=go.exports,po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.match(i.matchPattern);if(!s)return null;var o=s[0],l=r.match(i.parsePattern);if(!l)return null;var c=i.valueCallback?i.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=r.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(po,po.exports);var d_=po.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(u_),r=e(d_),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={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},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={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},f={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]},g={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},p={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]},v={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},m={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}},y={ordinalNumber:(0,r.default)({matchPattern:a,parsePattern:s,valueCallback:function(w){return parseInt(w,10)}}),era:(0,i.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,i.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(w){return w+1}}),month:(0,i.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,i.default)({matchPatterns:g,defaultMatchWidth:"wide",parsePatterns:p,defaultParseWidth:"any"}),dayPeriod:(0,i.default)({matchPatterns:v,defaultMatchWidth:"any",parsePatterns:m,defaultParseWidth:"any"})},x=y;t.default=x,n.exports=t.default})(ho,ho.exports);var f_=ho.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(r_),r=e(s_),a=e(o_),s=e(c_),o=e(f_),l={code:"en-US",formatDistance:i.default,formatLong:r.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(ao,ao.exports);var h_=ao.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(h_),r=i.default;t.default=r,n.exports=t.default})(ro,ro.exports);var g_=ro.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var i=e(Bx),r=e(zx),a=e(Be),s=e(Zx),o=e(Qx),l=e(_d),c=Qi,u=e(Un),d=e(ae),f=Bn,g=e(g_),p=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,v=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,m=/^'([^]*?)'?$/,y=/''/g,x=/[a-zA-Z]/;function _(M,C,k){var T,D,O,E,A,R,q,H,B,I,rt,W,Ct,mt,$,N,Y,V;(0,d.default)(2,arguments);var Z=String(C),J=(0,f.getDefaultOptions)(),F=(T=(D=k==null?void 0:k.locale)!==null&&D!==void 0?D:J.locale)!==null&&T!==void 0?T:g.default,L=(0,u.default)((O=(E=(A=(R=k==null?void 0:k.firstWeekContainsDate)!==null&&R!==void 0?R:k==null||(q=k.locale)===null||q===void 0||(H=q.options)===null||H===void 0?void 0:H.firstWeekContainsDate)!==null&&A!==void 0?A:J.firstWeekContainsDate)!==null&&E!==void 0?E:(B=J.locale)===null||B===void 0||(I=B.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(L>=1&&L<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Q=(0,u.default)((rt=(W=(Ct=(mt=k==null?void 0:k.weekStartsOn)!==null&&mt!==void 0?mt:k==null||($=k.locale)===null||$===void 0||(N=$.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&Ct!==void 0?Ct:J.weekStartsOn)!==null&&W!==void 0?W:(Y=J.locale)===null||Y===void 0||(V=Y.options)===null||V===void 0?void 0:V.weekStartsOn)!==null&&rt!==void 0?rt:0);if(!(Q>=0&&Q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!F.localize)throw new RangeError("locale must contain localize property");if(!F.formatLong)throw new RangeError("locale must contain formatLong property");var G=(0,a.default)(M);if(!(0,i.default)(G))throw new RangeError("Invalid time value");var vt=(0,l.default)(G),dt=(0,r.default)(G,vt),It={firstWeekContainsDate:L,weekStartsOn:Q,locale:F,_originalDate:G},Dt=Z.match(v).map(function(ot){var zt=ot[0];if(zt==="p"||zt==="P"){var Gt=o.default[zt];return Gt(ot,F.formatLong)}return ot}).join("").match(p).map(function(ot){if(ot==="''")return"'";var zt=ot[0];if(zt==="'")return w(ot);var Gt=s.default[zt];if(Gt)return!(k!=null&&k.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(ot)&&(0,c.throwProtectedError)(ot,C,String(M)),!(k!=null&&k.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(ot)&&(0,c.throwProtectedError)(ot,C,String(M)),Gt(dt,ot,F.localize,It);if(zt.match(x))throw new RangeError("Format string contains an unescaped latin alphabet character `"+zt+"`");return ot}).join("");return Dt}function w(M){var C=M.match(m);return C?C[1].replace(y,"'"):M}n.exports=t.default})(Ls,Ls.exports);var p_=Ls.exports;const m_=Fn(p_);function Td(n,t,e){var i=v_(n,e.timeZone,e.locale);return i.formatToParts?y_(i,t):b_(i,t)}function y_(n,t){for(var e=n.formatToParts(t),i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function b_(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function v_(n,t,e){if(e&&!e.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function x_(n,t){var e=D_(t);return e.formatToParts?w_(e,n):T_(e,n)}var __={year:0,month:1,day:2,hour:3,minute:4,second:5};function w_(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=__[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function T_(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var mo={};function D_(n){if(!mo[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";mo[n]=e?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"}):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"})}return mo[n]}function Dd(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Md=36e5,M_=6e4,yo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function bo(n,t,e){var i,r;if(!n||(i=yo.timezoneZ.exec(n),i))return 0;var a;if(i=yo.timezoneHH.exec(n),i)return a=parseInt(i[1],10),Sd(a)?-(a*Md):NaN;if(i=yo.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return Sd(a,s)?(r=Math.abs(a)*Md+s*M_,a>0?-r:r):NaN}if(k_(n)){t=new Date(t||Date.now());var o=e?t:S_(t),l=vo(o,n),c=e?l:C_(t,l,n);return-c}return NaN}function S_(n){return Dd(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function vo(n,t){var e=x_(n,t),i=Dd(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function C_(n,t,e){var i=n.getTime(),r=i-t,a=vo(new Date(r),e);if(t===a)return t;r-=a-t;var s=vo(new Date(r),e);return a===s?a:Math.max(a,s)}function Sd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Cd={};function k_(n){if(Cd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Cd[n]=!0,!0}catch{return!1}}var O_=60*1e3,P_={X:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);if(r===0)return"Z";switch(t){case"X":return kd(r);case"XXXX":case"XX":return ri(r);case"XXXXX":case"XXX":default:return ri(r,":")}},x:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);switch(t){case"x":return kd(r);case"xxxx":case"xx":return ri(r);case"xxxxx":case"xxx":default:return ri(r,":")}},O:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);switch(t){case"O":case"OO":case"OOO":return"GMT"+E_(r,":");case"OOOO":default:return"GMT"+ri(r,":")}},z:function(n,t,e,i){var r=i._originalDate||n;switch(t){case"z":case"zz":case"zzz":return Td("short",r,i);case"zzzz":default:return Td("long",r,i)}}};function xo(n,t){var e=n?bo(n,t,!0)/O_:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Jr(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}function ri(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=Jr(Math.floor(r/60),2),s=Jr(Math.floor(r%60),2);return i+a+e+s}function kd(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Jr(Math.abs(n)/60,2)}return ri(n,t)}function E_(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+Jr(a,2)}const A_=P_;var R_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,_o=36e5,Od=6e4,L_=2,se={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:R_};function Pd(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?L_:Yx(e.additionalDigits);if(i!==2&&i!==1&&i!==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(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=I_(n),a=N_(r.date,i),s=a.year,o=a.restDateString,l=F_(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=U_(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=bo(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=wd(new Date(c+u)),d=wd(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function I_(n){var t={},e=se.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=se.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=se.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function N_(n,t){var e=se.YYY[t],i=se.YYYYY[t],r;if(r=se.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=se.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function F_(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=se.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,Rd(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=se.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return W_(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=se.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Rd(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=se.Www.exec(n),e)return a=parseInt(e[1],10)-1,Ld(t,a)?Ed(t,a):new Date(NaN);if(e=se.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Ld(t,a,l)?Ed(t,a,l):new Date(NaN)}return null}function U_(n){var t,e,i;if(t=se.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),wo(e)?e%24*_o:NaN;if(t=se.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),wo(e,i)?e%24*_o+i*Od:NaN;if(t=se.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return wo(e,i,r)?e%24*_o+i*Od+r*1e3:NaN}return null}function Ed(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var B_=[31,28,31,30,31,30,31,31,30,31,30,31],Y_=[31,29,31,30,31,30,31,31,30,31,30,31];function Ad(n){return n%400===0||n%4===0&&n%100!==0}function Rd(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=Ad(n);if(i&&e>Y_[t]||!i&&e>B_[t])return!1}return!0}function W_(n,t){if(t<1)return!1;var e=Ad(n);return!(e&&t>366||!e&&t>365)}function Ld(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function wo(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var z_=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function To(n,t,e){var i=String(t),r=e||{},a=i.match(z_);if(a){var s=Pd(n,r);i=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+A_[l[0]](s,l,null,r)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},i)}return m_(n,i,r)}var Do={exports:{}},Mo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(Mo,Mo.exports);var H_=Mo.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(H_);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Do,Do.exports);var $_=Do.exports;const j_=Fn($_);function V_(n,t,e){var i=Pd(n,e),r=bo(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function q_(n,t,e,i){var r=j_(i);return r.timeZone=t,To(V_(n,t),e,r)}const Id=2,Nd=10,Fd=12,ta=new Intl.NumberFormat(((uh=document==null?void 0:document.documentElement)==null?void 0:uh.lang)||"en-US");function ea(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 r=new Date(n);return q_(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const na=10,De=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ai=(n,t)=>(t||De)[n%De.length],Ji=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),r=parseInt(n.substring(4,6),16);e=e-t,i=i-t,r=r-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${a}${s}${o}`},Ud="#6f7787",X_={lineTension:.4,borderWidth:2,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},So=new Map,Co=(n,t)=>t==="bytes"?_s(n):t==="count/minute"?n.toFixed(2):ta.format(n),Bd=n=>{const e=document.createElement("canvas").getContext("2d"),i=Et({});return e.font=i.string,e.measureText(n).width},G_=()=>{const n="label_height";if(!So.has(n)){const t=Et({});So.set(n,t.lineHeight)}return So.get(n)},K_=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,r)=>isNaN(r)?i:i+r,0),0),Yd=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),Wd=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`;function Z_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};Wr.positioners.barChartTooltipPosition=function(r,a){if(!r.length)return!1;const s=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=s.width/2,c=Rs(a,o,l),u=a.y,d=a.x<l?"left":"center";return{x:c-n.tooltipState.offsetX,y:u-n.tooltipState.offsetY,xAlign:d}},is.modes.customInteractionMode=function(r,a){const s=fn(a,r),o=[];return is.evaluateInteractionItems(r,r.options.indexAxis||"x",s,(l,c,u)=>{r.options.indexAxis==="y"&&l.inYRange(s.y,!0)&&r.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),r.options.indexAxis==="x"&&l.inXRange(s.x,!0)&&r.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?Nd:Fd;return h.computed(()=>{var r,a,s,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(f,g){const p=this;if(p.chart.options.indexAxis===p.axis){f=p.getLabelForValue(g);const v=10;return f&&f.length>v?f.slice(0,v)+"...":f}return p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="y"?!it((r=n.metricAxesTitle)==null?void 0:r.value):!it((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(s=n.metricAxesTitle)==null?void 0:s.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:20},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(f,g){const p=this;return p.chart.options.indexAxis===p.axis?(f=p.getLabelForValue(g),f&&f.length>na?f.slice(0,na)+"...":f):p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="x"?!it((l=n.metricAxesTitle)==null?void 0:l.value):!it((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:f=>{As(n.tooltipState,f)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Te.register(...Sy);const Q_=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,a)=>r===i[a])};function J_(n,t,e,i,r){const a=h.shallowRef(null),s=(o,l)=>{if(t.value)return new Te(t.value,{type:n,data:o,plugins:i,options:l})};return h.onMounted(()=>{a.value=s(e.value,r.value)}),h.onBeforeUnmount(()=>{it(a.value)||a.value.destroy()}),h.watch(e,(o,l)=>{if(Q_(l,o)&&!it(a.value)){for(const[c,u]of o.datasets.entries())Object.assign(a.value.data.datasets[c],u);a.value.data.labels=o.labels,a.value.update()}else it(a.value)||a.value.destroy(),a.value=s(o,r.value)}),h.watch(t,()=>{it(a.value)||a.value.destroy(),a.value=s(e.value,r.value)}),h.watch(r,(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))&&(it(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var zd={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,v){v&&v%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,r=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?r:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,i,u)+"k":c<s?d=e(c,a,u)+"m":c<o?d=t(e(c,s,u),u)+"b":d=t(e(c,o,u),u)+"t",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(zd);var tw=zd.exports;const tr=Fn(tw);function ew(n,t,e){const{i18n:i}=St.useI18n(),{translateUnit:r}=St.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((s,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":_s(l);else{const u=r(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:tr(l,{capital:!0}),unit:u})||`${tr(l,{capital:!0})} ${e.value}`}return{...s,[o.label]:{raw:l,formatted:c}}},{}))}}function nw(n){return h.computed(()=>{var r,a,s;if(!((r=n.value)!=null&&r.meta))return"";const e="startMs"in n.value.meta?n.value.meta.startMs:((a=n.value.meta)==null?void 0:a.start)*1e3||"",i="endMs"in n.value.meta?n.value.meta.endMs:((s=n.value.meta)==null?void 0:s.end)*1e3||"";return e&&i?`${ea(e)} - ${ea(i,{includeTZ:!0})}`:""})}function iw(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Wr.positioners.doughnutChartTooltipPosition=function(i,r){if(!i.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=Rs(r,s,o),c=r.y,u=r.x<o?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{As(n.tooltipState,i)}}}}))}}var rw=Object.defineProperty,aw=(n,t,e)=>t in n?rw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ye=(n,t,e)=>(aw(n,typeof t!="symbol"?t+"":t,e),e),st=(n=>(n.MINUTELY="Minutely",n.HOURLY="Hourly",n.DAILY="Daily",n.WEEKLY="Weekly",n))(st||{}),Wt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(Wt||{});function ko(n){"@babel/helpers - typeof";return ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ko(n)}function ia(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function We(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function si(n){We(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||ko(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Hd(n,t){We(2,arguments);var e=si(n),i=ia(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function sw(n,t){We(2,arguments);var e=si(n),i=ia(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}var ow={};function lw(){return ow}function ra(n,t){var e,i,r,a,s,o,l,c;We(1,arguments);var u=lw(),d=ia((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=si(n),g=f.getDay(),p=(g<d?7:0)+g-d;return f.setDate(f.getDate()-p),f.setHours(0,0,0,0),f}function $d(n){We(1,arguments);var t=si(n);return t.setHours(0,0,0,0),t}var cw=60,uw=3600;function oi(n){We(1,arguments);var t=si(n);return t.setDate(1),t.setHours(0,0,0,0),t}function dw(n){We(1,arguments);var t=si(n),e=t.getFullYear(),i=t.getMonth(),r=new Date(0);return r.setFullYear(e,i+1,0),r.setHours(0,0,0,0),r.getDate()}function fw(n){return We(1,arguments),Math.floor(n*uw)}function hw(n){We(1,arguments);var t=n/cw;return Math.floor(t)}function jd(n,t){We(2,arguments);var e=ia(t);return sw(n,-e)}function Oo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Vd);var gw=Vd.exports,Po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Po,Po.exports);var pw=Po.exports;const mw=Oo(pw);var Eo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(Eo,Eo.exports);var yw=Eo.exports;const qd=Oo(yw);function bw(n,t){var e=ww(t);return e.formatToParts?xw(e,n):_w(e,n)}var vw={year:0,month:1,day:2,hour:3,minute:4,second:5};function xw(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=vw[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function _w(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var Ao={};function ww(n){if(!Ao[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";Ao[n]=e?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"}):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"})}return Ao[n]}function Ro(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Xd=36e5,Tw=6e4,Lo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function aa(n,t,e){var i,r;if(!n||(i=Lo.timezoneZ.exec(n),i))return 0;var a;if(i=Lo.timezoneHH.exec(n),i)return a=parseInt(i[1],10),Gd(a)?-(a*Xd):NaN;if(i=Lo.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return Gd(a,s)?(r=Math.abs(a)*Xd+s*Tw,a>0?-r:r):NaN}if(Sw(n)){t=new Date(t||Date.now());var o=e?t:Dw(t),l=Io(o,n),c=e?l:Mw(t,l,n);return-c}return NaN}function Dw(n){return Ro(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Io(n,t){var e=bw(n,t),i=Ro(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function Mw(n,t,e){var i=n.getTime(),r=i-t,a=Io(new Date(r),e);if(t===a)return t;r-=a-t;var s=Io(new Date(r),e);return a===s?a:Math.max(a,s)}function Gd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Kd={};function Sw(n){if(Kd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Kd[n]=!0,!0}catch{return!1}}var Cw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Zd=Cw;var No=36e5,Qd=6e4,kw=2,oe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Zd};function Fo(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?kw:mw(e.additionalDigits);if(i!==2&&i!==1&&i!==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(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=Ow(n),a=Pw(r.date,i),s=a.year,o=a.restDateString,l=Ew(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=Aw(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=aa(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=qd(new Date(c+u)),d=qd(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Ow(n){var t={},e=oe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=oe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=oe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Pw(n,t){var e=oe.YYY[t],i=oe.YYYYY[t],r;if(r=oe.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=oe.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Ew(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=oe.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,ef(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=oe.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Iw(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=oe.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return ef(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=oe.Www.exec(n),e)return a=parseInt(e[1],10)-1,nf(t,a)?Jd(t,a):new Date(NaN);if(e=oe.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return nf(t,a,l)?Jd(t,a,l):new Date(NaN)}return null}function Aw(n){var t,e,i;if(t=oe.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),Uo(e)?e%24*No:NaN;if(t=oe.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),Uo(e,i)?e%24*No+i*Qd:NaN;if(t=oe.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Uo(e,i,r)?e%24*No+i*Qd+r*1e3:NaN}return null}function Jd(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Rw=[31,28,31,30,31,30,31,31,30,31,30,31],Lw=[31,29,31,30,31,30,31,31,30,31,30,31];function tf(n){return n%400===0||n%4===0&&n%100!==0}function ef(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=tf(n);if(i&&e>Lw[t]||!i&&e>Rw[t])return!1}return!0}function Iw(n,t){if(t<1)return!1;var e=tf(n);return!(e&&t>366||!e&&t>365)}function nf(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function Uo(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Bo={exports:{}},Yo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(Yo,Yo.exports);var Nw=Yo.exports;(function(n,t){var e=gw.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(Nw);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Bo,Bo.exports);var Fw=Bo.exports;const Uw=Oo(Fw);function Bw(n,t,e){var i=Fo(n,e),r=aa(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function Yw(n,t){return-aa(n,t)}function Ww(n,t,e){if(typeof n=="string"&&!n.match(Zd)){var i=Uw(e);return i.timeZone=t,Fo(n,i)}var r=Fo(n,e),a=Ro(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()).getTime(),s=aa(t,new Date(a));return new Date(a+s)}const zw={[st.MINUTELY]:60*1e3,[st.HOURLY]:60*60*1e3,[st.DAILY]:60*60*24*1e3,[st.WEEKLY]:60*60*24*7*1e3};function er(n){return n&&Object.values(st).find(t=>n<=zw[t])||null}const li=(n,t)=>new Date(n.getTime()-Yw(t,n));class Pe{constructor(t){Ye(this,"timeframeText"),Ye(this,"key"),Ye(this,"display"),Ye(this,"timeframeLength"),Ye(this,"allowedTiers"),Ye(this,"defaultResponseGranularity"),Ye(this,"dataGranularity"),Ye(this,"isRelative"),Ye(this,"_startCustom"),Ye(this,"_endCustom"),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}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(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add(st.MINUTELY),e>=2&&e<=7*24&&t.add(st.HOURLY),e>=2*24&&t.add(st.DAILY),e>=2*24*14&&t.add(st.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const e=Ww(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Bw(e,t)}}class Hw extends Pe{rawStart(t){let e=ra(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=li(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class $w extends Pe{rawStart(t){let e=oi(this.tzAdjustedDate(t));return t&&(e=li(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class jw extends Pe{rawEnd(t){let e=ra(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=li(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=ra(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=li(i,t)),i}}class Vw extends Pe{rawEnd(t){let e=oi(this.tzAdjustedDate(t));return t&&(e=li(e,t)),e}rawStart(t){let e=oi(jd(this.tzAdjustedDate(t),1));return t&&(e=li(e,t)),e}}Wt.FIFTEEN_MIN,new Pe({key:Wt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:st.MINUTELY,dataGranularity:st.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.ONE_HOUR,new Pe({key:Wt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:st.MINUTELY,dataGranularity:st.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.SIX_HOUR,new Pe({key:Wt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:st.HOURLY,dataGranularity:st.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.TWELVE_HOUR,new Pe({key:Wt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:st.HOURLY,dataGranularity:st.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.ONE_DAY,new Pe({key:Wt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:st.HOURLY,dataGranularity:st.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.SEVEN_DAY,new Pe({key:Wt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Wt.THIRTY_DAY,new Pe({key:Wt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Wt.CURRENT_WEEK,new Hw({key:Wt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=ra(new Date,{weekStartsOn:1});return($d(Hd(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Wt.CURRENT_MONTH,new $w({key:Wt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=oi(new Date);return($d(Hd(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Wt.PREVIOUS_WEEK,new jw({key:Wt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Wt.PREVIOUS_MONTH,new Vw({key:Wt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=oi(new Date),e=oi(jd(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=qw(t,e)),60*60*24*dw(new Date().setMonth(new Date().getMonth()-1))+fw(n)},defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]});function qw(n,t){return hw(n.getTimezoneOffset()-t.getTimezoneOffset())}function Xw(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!it((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:20},font:{weight:"bold"}}}}),e=h.computed(()=>{var l,c;return{title:{display:!it((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:20},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};Wr.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,v=Rs(c,d,g);let m=Fx(c,f,p);const y=c.y<p?"top":"bottom",x=c.x<g?"left":"center";return f>u.height&&(m=0),{x:v,y:m,xAlign:x,yAlign:y}};const r=h.computed(()=>{switch(n.granularity.value){case st.MINUTELY:return"minute";case st.HOURLY:return"hour";case st.DAILY:return"day";default:return"day"}}),a=h.computed(()=>n.timeRangeMs?px(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm":Ex(Number(n.timeRangeSec.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=h.computed(()=>[st.DAILY,st.WEEKLY].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:h.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:r.value,displayFormats:{minute:"h:mm:ss a",hour:a.value,day:s.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:l=>{As(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function Gw(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:a,rowLabels:s,colorPalette:o}=n,{i18n:l}=St.useI18n();return t?i.map(c=>({label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:ai(i.indexOf(c),De),data:s.map((u,d)=>e?a[`${u},${c}`]||0:a[`${d},${c}`]||null)})):Array.from(r).flatMap((c,u)=>{if(!c)return[];const d=Array.isArray(o)?ai(u,o):o[c]||ai(u);return{label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:d,data:s.map(f=>a[`${f},${c}`]||null)}})}function Kw(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o=a&&Object.keys(a),l=s&&s.length>1,c=a&&o&&(o.length===1?o[0]!=="Organization":o.length>0);if(!r.length||!s)return{datasets:[],labels:[]};const u=c&&o||s,d=u[0],f=u.length>1?u[1]:u[0],g=Object.fromEntries(l?r.flatMap(y=>s.map((x,_)=>{const w=y.event[d],M=c?`${w},${x}`:`${_},${x}`,C=y.event[x];return[M,C]})):r.map(y=>{const x=c?`${y.event[d]},${y.event[f]}`:`${d},${f}`,_=y.event[s[0]];return[x,_]})),p=c&&a[d]||s,v=c&&a[f]||s;return!p||!v?{labels:[],datasets:[]}:{labels:c?a[d].map(y=>e&&e.te(`chartLabels.${y}`)&&e.t(`chartLabels.${y}`)||y):s.map(y=>e&&e.te(`chartLabels.${y}`)&&e.t(`chartLabels.${y}`)||y),datasets:Gw({isMultiMetric:l,hasDimensions:c,metricNames:s,dimensionFieldNames:u,barSegmentLabels:v,pivotRecords:g,rowLabels:p,colorPalette:n.colorPalette||De})}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const Zw=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),Qw=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return fd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},Jw=(n,t,e,i,r)=>{const s=Math.max(t-6e4,Math.max(...(r||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((s-i)/e)*e+i+e;return Zw(o,l,e)};function t1(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o="startMs"in t.value.meta?t.value.meta.startMs:t.value.meta.start*1e3,l="endMs"in t.value.meta?t.value.meta.endMs:t.value.meta.end*1e3;if(!s)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=a&&Object.keys(a)||s,u=c&&c[0],d=a&&a[u]||s,f=t.value.meta.granularity;if(typeof f!="number"||isNaN(f)||!isFinite(f)||f===0)return console.error("Invalid step value:",f),{datasets:[]};if(!r.length)return{datasets:[]};const g=Qw(o),p=Jw(o,l,f,g,r),v=new Set,m=r!=null&&r.length?r.reduce((w,M)=>{const C=new Date(M.timestamp).valueOf(),k=M.event;for(const T of s)v.add(T),C in w||(w[C]={}),T in w[C]||(w[C][T]={});for(const T of s)d.forEach(D=>{k[u]===D||T===D?(w[C][T]||(w[C][T]={}),w[C][T][D]=Math.round(Number(k[T])*1e3)/1e3):c.length||(w[C][T]||(w[C][T]={}),w[C][T][D]=Math.round(Number(k[D])*1e3)/1e3)});return w},{}):{},y=s.length===1?s.flatMap(w=>d.map(M=>[w,M])):d.map(w=>[w,w]),x={},_=[...y].map(([w,M],C)=>{const k=p.map(A=>A in m&&w in m[A]?{x:A,y:m[A][w][M]||0}:{x:A,y:0});let{colorPalette:T,fill:D}=n;it(T)&&(T=De);const O=Array.isArray(T)?ai(C,T):T[M]||ai(C),E=Ji(O,50);return x[M]=O,{rawDimension:M,rawMetric:w,label:e&&e.te(`chartLabels.${M}`)&&e.t(`chartLabels.${M}`)||M,borderColor:E,backgroundColor:O,data:k,total:k.reduce((A,{y:R})=>A+Number(R),0),...X_,fill:D}});return _.sort((w,M)=>Number(w.total)<Number(M.total)?-1:1),{datasets:_,colorMap:x}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const e1=(n,t)=>{h.watch([n,t],(e,i,r)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})};function n1(){const{i18n:n}=St.useI18n();return{translateUnit:(e,i)=>{const r=i===1,a=`chartUnits.${e}`;return n.te(a)?n.t(a,{plural:r?"":"s"}):e}}}const St={useBarChartOptions:Z_,useChartJSCommon:J_,useChartLegendValues:ew,useChartSelectedRange:nw,useExploreResultToDatasets:Kw,useExploreResultToTimeDataset:t1,useDoughnutChartOptions:iw,useLinechartOptions:Xw,useI18n:Mh,useReportChartDataForSynthetics:e1,useTranslatedUnits:n1};/*!
|
|
18
|
+
`):n}function G0(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:s,value:o}=a.getLabelAndValue(r);return{chart:n,label:s,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:o,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function _u(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=Et(t.bodyFont),c=Et(t.titleFont),u=Et(t.footerFont),d=a.length,f=r.length,g=i.length,p=Xt(t.padding);let x=p.height,m=0,b=i.reduce((w,M)=>w+M.before.length+M.lines.length+M.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;x+=g*w+(b-g)*l.lineHeight+(b-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const _=function(w){m=Math.max(m,e.measureText(w).width+v)};return e.save(),e.font=c.string,wt(n.title,_),e.font=l.string,wt(n.beforeBody.concat(n.afterBody),_),v=t.displayColors?s+2+t.boxPadding:0,wt(i,w=>{wt(w.before,_),wt(w.lines,_),wt(w.after,_)}),v=0,e.font=u.string,wt(n.footer,_),e.restore(),m+=p.width,{width:m,height:x}}function K0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Z0(n,t,e,i){const{x:r,width:a}=i,s=e.caretSize+e.caretPadding;if(n==="left"&&r+a+s>t.width||n==="right"&&r-a-s<0)return!0}function Q0(n,t,e,i){const{x:r,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=r<=(o+l)/2?"left":"right":r<=a/2?c="left":r>=s-a/2&&(c="right"),Z0(c,n,t,e)&&(c="center"),c}function wu(n,t,e){const i=e.yAlign||t.yAlign||K0(n,e);return{xAlign:e.xAlign||t.xAlign||Q0(n,t,e,i),yAlign:i}}function J0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function ty(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function Tu(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=r+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=un(s);let p=J0(t,o);const x=ty(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+r:o==="right"&&(p+=Math.max(d,g)+r),{x:Zt(p,0,i.width-t.width),y:Zt(x,0,i.height-t.height)}}function Yr(n,t,e){const i=Xt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Du(n){return Ne([],Xe(n))}function ey(n,t,e){return dn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Mu(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Su={beforeTitle:He,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:He,beforeBody:He,beforeLabel:He,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 it(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:He,afterBody:He,beforeFooter:He,footer:He,afterFooter:He};function fe(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?Su[t].call(e,i):r}class ps extends te{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()),r=i.enabled&&e.options.animation&&i.animations,a=new Ga(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=ey(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=fe(i,"beforeTitle",this,t),a=fe(i,"title",this,t),s=fe(i,"afterTitle",this,t);let o=[];return o=Ne(o,Xe(r)),o=Ne(o,Xe(a)),o=Ne(o,Xe(s)),o}getBeforeBody(t,e){return Du(fe(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return wt(t,a=>{const s={before:[],lines:[],after:[]},o=Mu(i,a);Ne(s.before,Xe(fe(o,"beforeLabel",this,a))),Ne(s.lines,fe(o,"label",this,a)),Ne(s.after,Xe(fe(o,"afterLabel",this,a))),r.push(s)}),r}getAfterBody(t,e){return Du(fe(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=fe(i,"beforeFooter",this,t),a=fe(i,"footer",this,t),s=fe(i,"afterFooter",this,t);let o=[];return o=Ne(o,Xe(r)),o=Ne(o,Xe(a)),o=Ne(o,Xe(s)),o}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(G0(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),wt(o,u=>{const d=Mu(t.callbacks,u);r.push(fe(d,"labelColor",this,u)),a.push(fe(d,"labelPointStyle",this,u)),s.push(fe(d,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,s=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const o=Wi[i.position].call(this,r,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const l=this._size=_u(this,i),c=Object.assign({},o,l),u=wu(this.chart,i,c),d=Tu(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=un(o),{x:f,y:g}=t,{width:p,height:x}=e;let m,b,v,_,w,M;return a==="center"?(w=g+x/2,r==="left"?(m=f,b=m-s,_=w+s,M=w-s):(m=f+p,b=m+s,_=w-s,M=w+s),v=m):(r==="left"?b=f+Math.max(l,u)+s:r==="right"?b=f+p-Math.max(c,d)-s:b=this.caretX,a==="top"?(_=g,w=_-s,m=b-s,v=b+s):(_=g+x,w=_+s,m=b+s,v=b-s),M=_),{x1:m,x2:b,x3:v,y1:_,y2:w,y3:M}}drawTitle(t,e,i){const r=this.title,a=r.length;let s,o,l;if(a){const c=Jn(i.rtl,this.x,this.width);for(t.x=Yr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",s=Et(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(r[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,r,a){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=a,u=Et(a.bodyFont),d=Yr(this,"left",a),f=r.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(a.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},m=r.leftForLtr(f,c)+c/2,b=p+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,za(t,x,m,b),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,za(t,x,m,b)}else{t.lineWidth=lt(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const x=r.leftForLtr(f,c),m=r.leftForLtr(r.xPlus(f,1),c-2),b=un(s.borderRadius);Object.values(b).some(v=>v!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Kn(t,{x,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Kn(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(x,p,c,l),t.strokeRect(x,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=Et(i.bodyFont);let f=d.lineHeight,g=0;const p=Jn(i.rtl,this.x,this.width),x=function(T){e.fillText(T,p.x(t.x+g),t.y+f/2),t.y+=f+a},m=p.textAlign(s);let b,v,_,w,M,C,k;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=Yr(this,m,i),e.fillStyle=i.bodyColor,wt(this.beforeBody,x),g=o&&m!=="right"?s==="center"?c/2+u:c+2+u:0,w=0,C=r.length;w<C;++w){for(b=r[w],v=this.labelTextColors[w],e.fillStyle=v,wt(b.before,x),_=b.lines,o&&_.length&&(this._drawColorBox(e,t,w,p,i),f=Math.max(d.lineHeight,l)),M=0,k=_.length;M<k;++M)x(_[M]),f=d.lineHeight;wt(b.after,x)}g=0,f=d.lineHeight,wt(this.afterBody,x),t.y-=a}drawFooter(t,e,i){const r=this.footer,a=r.length;let s,o;if(a){const l=Jn(i.rtl,this.x,this.width);for(t.x=Yr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",s=Et(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(r[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=un(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,i,r),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&a==="right"&&this.drawCaret(t,e,i,r),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(o+g,l+u),e.quadraticCurveTo(o,l+u,o,l+u-g),s==="center"&&a==="left"&&this.drawCaret(t,e,i,r),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const s=Wi[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=_u(this,t),l=Object.assign({},s,this._size),c=wu(e,t,l),u=Tu(t,l,c,e);(r._to!==u.x||a._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.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 r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=Xt(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(a,t,r,e),sc(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),oc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=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}}),a=!hr(i,r),s=this._positionChanged(r,e);(a||s)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),o=this._positionChanged(s,t),l=e||!hr(s,a)||o;return l&&(this._active=s,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,s=Wi[a.position].call(this,t,e);return s!==!1&&(i!==s.x||r!==s.y)}}z(ps,"positioners",Wi);var Wr={id:"tooltip",_element:ps,positioners:Wi,afterInit(n,t,e){e&&(n.tooltip=new ps({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:Su},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"]},ny=Object.freeze({__proto__:null,Colors:p0,Decimation:v0,Filler:B0,Legend:j0,SubTitle:X0,Title:q0,Tooltip:Wr});const iy=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ry(n,t,e,i){const r=n.indexOf(t);if(r===-1)return iy(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const ay=(n,t)=>n===null?null:Zt(Math.round(n),0,t);function Cu(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class ms extends Rn{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:r,label:a}of e)i[r]===a&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(it(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:ry(i,t,nt(e,t),this._addedLabels),ay(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)r.push({value:s});return r}getLabelForValue(t){return Cu.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}}z(ms,"id","category"),z(ms,"defaults",{ticks:{callback:Cu}});function sy(n,t){const e=[],{bounds:r,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=a||1,p=u-1,{min:x,max:m}=t,b=!it(s),v=!it(o),_=!it(c),w=(m-x)/(d+1);let M=El((m-x)/p/g)*g,C,k,T,D;if(M<1e-14&&!b&&!v)return[{value:x},{value:m}];D=Math.ceil(m/M)-Math.floor(x/M),D>p&&(M=El(D*M/p/g)*g),it(l)||(C=Math.pow(10,l),M=Math.ceil(M*C)/C),r==="ticks"?(k=Math.floor(x/M)*M,T=Math.ceil(m/M)*M):(k=x,T=m),b&&v&&a&&ig((o-s)/a,M/1e3)?(D=Math.round(Math.min((o-s)/M,u)),M=(o-s)/D,k=s,T=o):_?(k=b?s:k,T=v?o:T,D=c-1,M=(T-k)/D):(D=(T-k)/M,_i(D,Math.round(D),M/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(Rl(M),Rl(k));C=Math.pow(10,it(l)?O:l),k=Math.round(k*C)/C,T=Math.round(T*C)/C;let E=0;for(b&&(f&&k!==s?(e.push({value:s}),k<s&&E++,_i(Math.round((k+E*M)*C)/C,s,ku(s,w,n))&&E++):k<s&&E++);E<D;++E){const A=Math.round((k+E*M)*C)/C;if(v&&A>o)break;e.push({value:A})}return v&&f&&T!==o?e.length&&_i(e[e.length-1].value,o,ku(o,w,n))?e[e.length-1].value=o:e.push({value:o}):(!v||T===o)&&e.push({value:T}),e}function ku(n,t,{horizontal:e,minRotation:i}){const r=qt(i),a=(e?Math.sin(r):Math.cos(r))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class zr extends Rn{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 it(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:r,max:a}=this;const s=l=>r=e?r:l,o=l=>a=i?a:l;if(t){const l=Le(r),c=Le(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(r===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(r-l)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={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},a=this._range||this,s=sy(r,a);return t.bounds==="ticks"&&Al(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Di(t,this.chart.options.locale,this.options.ticks.format)}}class ys extends zr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Lt(t)?t:0,this.max=Lt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=qt(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}z(ys,"id","linear"),z(ys,"defaults",{ticks:{callback:vr.formatters.numeric}});const zi=n=>Math.floor(ln(n)),Ln=(n,t)=>Math.pow(10,zi(n)+t);function Ou(n){return n/Math.pow(10,zi(n))===1}function Pu(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function oy(n,t){const e=t-n;let i=zi(e);for(;Pu(n,t,i)>10;)i++;for(;Pu(n,t,i)<10;)i--;return Math.min(i,zi(n))}function ly(n,{min:t,max:e}){t=be(n.min,t);const i=[],r=zi(t);let a=oy(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=r>a?Math.pow(10,r):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,a)),f=be(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;f<e;)i.push({value:f,major:Ou(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),f=Math.round((l+u+d*Math.pow(10,a))*s)/s;const g=be(n.max,f);return i.push({value:g,major:Ou(g),significand:d}),i}class bs extends Rn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=zr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Lt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Lt(t)?Math.max(0,t):null,this.max=Lt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Lt(this._userMin)&&(this.min=t===Ln(this.min,0)?Ln(this.min,-1):Ln(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=o=>i=t?i:o,s=o=>r=e?r:o;i===r&&(i<=0?(a(1),s(10)):(a(Ln(i,-1)),s(Ln(r,1)))),i<=0&&a(Ln(r,-1)),r<=0&&s(Ln(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=ly(e,this);return t.bounds==="ticks"&&Al(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":Di(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ln(t),this._valueRange=ln(this.max)-ln(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ln(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}z(bs,"id","logarithmic"),z(bs,"defaults",{ticks:{callback:vr.formatters.logarithmic,major:{enabled:!0}}});function vs(n){const t=n.ticks;if(t.display&&n.display){const e=Xt(t.backdropPadding);return nt(t.font&&t.font.size,Ft.font.size)+e.height}return 0}function cy(n,t,e){return e=yt(e)?e:[e],{w:xg(n,t.string,e),h:e.length*t.lineHeight}}function Eu(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function uy(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=[],r=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?ut/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));r[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+r[l],o),d=Et(c.font),f=cy(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=ve(n.getIndexAngle(l)+o),p=Math.round(yr(g)),x=Eu(p,u.x,f.w,0,180),m=Eu(p,u.y,f.h,90,270);dy(e,t,g,x,m)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=gy(n,i,r)}function dy(n,t,e,i,r){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/a,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),r.start<t.t?(l=(t.t-r.start)/s,n.t=Math.min(n.t,t.t-l)):r.end>t.b&&(l=(r.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function fy(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,i+r+s,a),c=Math.round(yr(ve(l.angle+Pt))),u=yy(l.y,o.h,c),d=py(c),f=my(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function hy(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:a}=n;return!(Ve({x:e,y:i},t)||Ve({x:e,y:a},t)||Ve({x:r,y:i},t)||Ve({x:r,y:a},t))}function gy(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:vs(a)/2,additionalAngle:s?ut/r:0};let c;for(let u=0;u<r;u++){l.padding=e[u],l.size=t[u];const d=fy(n,u,l);i.push(d),o==="auto"&&(d.visible=hy(d,c),d.visible&&(c=d))}return i}function py(n){return n===0||n===180?"center":n<180?"left":"right"}function my(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function yy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function by(n,t,e){const{left:i,top:r,right:a,bottom:s}=e,{backdropColor:o}=t;if(!it(o)){const l=un(t.borderRadius),c=Xt(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=r-c.top,f=a-i+c.width,g=s-r+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Kn(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function vy(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=n._pointLabelItems[r];if(!a.visible)continue;const s=i.setContext(n.getPointLabelContext(r));by(e,s,a);const o=Et(s.font),{x:l,y:c,textAlign:u}=a;On(e,n._pointLabels[r],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function Au(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,kt);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let s=1;s<i;s++)a=n.getPointPosition(s,t),r.lineTo(a.x,a.y)}}function xy(n,t,e,i,r){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!i||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(r.dash),a.lineDashOffset=r.dashOffset,a.beginPath(),Au(n,e,s,i),a.closePath(),a.stroke(),a.restore())}function _y(n,t,e){return dn(n,{label:e,index:t,type:"pointLabel"})}class Hi extends zr{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=Xt(vs(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=Lt(t)&&!isNaN(t)?t:0,this.max=Lt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/vs(this.options))}generateTickLabels(t){zr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=_t(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?uy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=kt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ve(t*e+qt(i))}getDistanceFromCenterForValue(t){if(it(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(it(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 _y(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-Pt+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}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:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Au(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:r,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&vy(this,s),r.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=r.setContext(f),p=a.setContext(f);xy(this,g,l,s,p)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.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 r=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Et(c.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=Xt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}On(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}z(Hi,"id","radialLinear"),z(Hi,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:vr.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),z(Hi,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),z(Hi,"descriptors",{angleLines:{_fallback:"grid"}});const Hr={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}},he=Object.keys(Hr);function Ru(n,t){return n-t}function Lu(n,t){if(it(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let s=t;return typeof i=="function"&&(s=i(s)),Lt(s)||(s=typeof i=="string"?e.parse(s,i):e.parse(s)),s===null?null:(r&&(s=r==="week"&&(cn(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,r)),+s)}function Iu(n,t,e,i){const r=he.length;for(let a=he.indexOf(n);a<r-1;++a){const s=Hr[he[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=i)return he[a]}return he[r-1]}function wy(n,t,e,i,r){for(let a=he.length-1;a>=he.indexOf(e);a--){const s=he[a];if(Hr[s].common&&n._adapter.diff(r,i,s)>=t-1)return s}return he[e?he.indexOf(e):0]}function Ty(n){for(let t=he.indexOf(n)+1,e=he.length;t<e;++t)if(Hr[he[t]].common)return he[t]}function Nu(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Na(e,t),a=e[i]>=t?e[i]:e[r];n[a]=!0}}function Dy(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+r.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Fu(n,t,e){const i=[],r={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],r[o]=s,i.push({value:o,major:!1});return a===0||!e?i:Dy(n,i,r,e)}class $i extends Rn{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={}),r=this._adapter=new Sc._date(t.adapters.date);r.init(e),xi(i.displayFormats,r.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:Lu(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:r,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(r=Math.min(r,c.min)),!o&&!isNaN(c.max)&&(a=Math.max(a,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=Lt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=Lt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_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,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const a=this.min,s=this.max,o=og(r,a,s);return this._unit=e.unit||(i.autoSkip?Iu(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):wy(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Ty(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),Fu(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Zt(e,0,s),i=Zt(i,0,s),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,s=a.unit||Iu(a.minUnit,e,i,this._getLabelCapacity(e)),o=nt(r.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=cn(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,o,s),g++)Nu(u,f,p);return(f===i||r.bounds==="ticks"||g===1)&&Nu(u,f,p),Object.keys(u).sort(Ru).map(x=>+x)}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 r=this.options.time.displayFormats,a=this._unit,s=e||r[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,r){const a=this.options,s=a.ticks.callback;if(s)return _t(s,[t,e,i],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,r||(g?d:u))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.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,r=qt(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(r),s=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*a+o*s,h:i*s+o*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,Fu(this,[t],this._majorUnit),r),s=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[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 r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(Lu(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Fl(t.sort(Ru))}}z($i,"id","time"),z($i,"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 $r(n,t,e){let i=0,r=n.length-1,a,s,o,l;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=je(n,"pos",t)),{pos:a,time:o}=n[i],{pos:s,time:l}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=je(n,"time",t)),{time:a,pos:o}=n[i],{time:s,pos:l}=n[r]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class xs extends $i{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=$r(e,this.min),this._tableRange=$r(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=i&&r.push(c);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=r.length;s<o;++s)u=r[s+1],l=r[s-1],c=r[s],Math.round((u+l)/2)!==c&&a.push({time:c,pos:s/(o-1)});return a}_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((r,a)=>r-a)}_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($r(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return $r(this._table,i*this._tableRange+this._minPos,!0)}}z(xs,"id","timeseries"),z(xs,"defaults",$i.defaults);var My=Object.freeze({__proto__:null,CategoryScale:ms,LinearScale:ys,LogarithmicScale:bs,RadialLinearScale:Hi,TimeScale:$i,TimeSeriesScale:xs});const Sy=[Ip,c0,ny,My],Cy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],ky=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Oy=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Py=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Uu=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function _s(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?Py:Oy:t.binary?ky:Cy,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const r=n<0,a=r?"-":t.signed?"+":"";r&&(n=-n);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),n<1){const u=Uu(n,t.locale,s);return a+u+i+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,s||(n=n.toPrecision(3));const l=Uu(Number(n),t.locale,s),c=e[o];return a+l+i+c}function Ge(n){"@babel/helpers - typeof";return Ge=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(n)}function At(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function K(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function et(n){K(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ge(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Bu(n,t){K(2,arguments);var e=et(n),i=At(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function ws(n,t){K(2,arguments);var e=et(n),i=At(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}function ji(n,t){K(2,arguments);var e=et(n).getTime(),i=At(t);return new Date(e+i)}var Ey=36e5;function Ay(n,t){K(2,arguments);var e=At(t);return ji(n,e*Ey)}var Ry={};function mn(){return Ry}function Yu(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=et(n),g=f.getDay(),p=(g<d?7:0)+g-d;return f.setDate(f.getDate()-p),f.setHours(0,0,0,0),f}function jr(n){var 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.getTime()-t.getTime()}function Ts(n){K(1,arguments);var t=et(n);return t.setHours(0,0,0,0),t}var Ly=864e5;function Iy(n,t){K(2,arguments);var e=Ts(n),i=Ts(t),r=e.getTime()-jr(e),a=i.getTime()-jr(i);return Math.round((r-a)/Ly)}var Ny=6e4;function Fy(n,t){K(2,arguments);var e=At(t);return ji(n,e*Ny)}function Uy(n,t){K(2,arguments);var e=At(t),i=e*3;return ws(n,i)}function By(n,t){K(2,arguments);var e=At(t);return ji(n,e*1e3)}function Yy(n,t){K(2,arguments);var e=At(t),i=e*7;return Bu(n,i)}function Wy(n,t){K(2,arguments);var e=At(t);return ws(n,e*12)}function Vi(n,t){K(2,arguments);var e=et(n),i=et(t),r=e.getTime()-i.getTime();return r<0?-1:r>0?1:r}var Vr=6e4,qi=36e5,zy=1e3,Hy=3600;function $y(n){return K(1,arguments),n instanceof Date||Ge(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ds(n){if(K(1,arguments),!$y(n)&&typeof n!="number")return!1;var t=et(n);return!isNaN(Number(t))}function jy(n,t){K(2,arguments);var e=et(n),i=et(t),r=e.getFullYear()-i.getFullYear(),a=e.getMonth()-i.getMonth();return r*12+a}function Vy(n,t){K(2,arguments);var e=et(n),i=et(t);return e.getFullYear()-i.getFullYear()}function Wu(n,t){var 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 zu(n,t){K(2,arguments);var e=et(n),i=et(t),r=Wu(e,i),a=Math.abs(Iy(e,i));e.setDate(e.getDate()-r*a);var s=+(Wu(e,i)===-r),o=r*(a-s);return o===0?0:o}function qr(n,t){return K(2,arguments),et(n).getTime()-et(t).getTime()}var Hu={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},qy="trunc";function Xi(n){return n?Hu[n]:Hu[qy]}function Xy(n,t,e){K(2,arguments);var i=qr(n,t)/qi;return Xi(e==null?void 0:e.roundingMethod)(i)}function Gy(n,t,e){K(2,arguments);var i=qr(n,t)/Vr;return Xi(e==null?void 0:e.roundingMethod)(i)}function $u(n){K(1,arguments);var t=et(n);return t.setHours(23,59,59,999),t}function ju(n){K(1,arguments);var t=et(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Ky(n){K(1,arguments);var t=et(n);return $u(t).getTime()===ju(t).getTime()}function Vu(n,t){K(2,arguments);var e=et(n),i=et(t),r=Vi(e,i),a=Math.abs(jy(e,i)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-r*a);var o=Vi(e,i)===-r;Ky(et(n))&&a===1&&Vi(n,i)===1&&(o=!1),s=r*(a-Number(o))}return s===0?0:s}function Zy(n,t,e){K(2,arguments);var i=Vu(n,t)/3;return Xi(e==null?void 0:e.roundingMethod)(i)}function Qy(n,t,e){K(2,arguments);var i=qr(n,t)/1e3;return Xi(e==null?void 0:e.roundingMethod)(i)}function Jy(n,t,e){K(2,arguments);var i=zu(n,t)/7;return Xi(e==null?void 0:e.roundingMethod)(i)}function tb(n,t){K(2,arguments);var e=et(n),i=et(t),r=Vi(e,i),a=Math.abs(Vy(e,i));e.setFullYear(1584),i.setFullYear(1584);var s=Vi(e,i)===-r,o=r*(a-Number(s));return o===0?0:o}function eb(n){K(1,arguments);var t=et(n);return t.setSeconds(0,0),t}function nb(n){K(1,arguments);var t=et(n),e=t.getMonth(),i=e-e%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function ib(n){K(1,arguments);var t=et(n);return t.setDate(1),t.setHours(0,0,0,0),t}function rb(n){K(1,arguments);var t=et(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function ab(n){K(1,arguments);var t=et(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function sb(n){K(1,arguments);var t=et(n);return t.setMinutes(59,59,999),t}function ob(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=et(n),g=f.getDay(),p=(g<d?-7:0)+6-(g-d);return f.setDate(f.getDate()+p),f.setHours(23,59,59,999),f}function lb(n){K(1,arguments);var t=et(n);return t.setSeconds(59,999),t}function cb(n){K(1,arguments);var t=et(n),e=t.getMonth(),i=e-e%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function ub(n){K(1,arguments);var t=et(n);return t.setMilliseconds(999),t}function qu(n,t){K(2,arguments);var e=At(t);return ji(n,-e)}var db=864e5;function fb(n){K(1,arguments);var t=et(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),r=e-i;return Math.floor(r/db)+1}function ei(n){K(1,arguments);var t=1,e=et(n),i=e.getUTCDay(),r=(i<t?7:0)+i-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function Xu(n){K(1,arguments);var t=et(n),e=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(e+1,0,4),i.setUTCHours(0,0,0,0);var r=ei(i),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=ei(a);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function hb(n){K(1,arguments);var t=Xu(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var i=ei(e);return i}var gb=6048e5;function Gu(n){K(1,arguments);var t=et(n),e=ei(t).getTime()-hb(t).getTime();return Math.round(e/gb)+1}function In(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=et(n),g=f.getUTCDay(),p=(g<d?7:0)+g-d;return f.setUTCDate(f.getUTCDate()-p),f.setUTCHours(0,0,0,0),f}function Ms(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=et(n),d=u.getUTCFullYear(),f=mn(),g=At((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:f.firstWeekContainsDate)!==null&&i!==void 0?i:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,g),p.setUTCHours(0,0,0,0);var x=In(p,t),m=new Date(0);m.setUTCFullYear(d,0,g),m.setUTCHours(0,0,0,0);var b=In(m,t);return u.getTime()>=x.getTime()?d+1:u.getTime()>=b.getTime()?d:d-1}function pb(n,t){var e,i,r,a,s,o,l,c;K(1,arguments);var u=mn(),d=At((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1),f=Ms(n,t),g=new Date(0);g.setUTCFullYear(f,0,d),g.setUTCHours(0,0,0,0);var p=In(g,t);return p}var mb=6048e5;function Ku(n,t){K(1,arguments);var e=et(n),i=In(e,t).getTime()-pb(e,t).getTime();return Math.round(i/mb)+1}function Tt(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}var yb={y:function(t,e){var i=t.getUTCFullYear(),r=i>0?i:1-i;return Tt(e==="yy"?r%100:r,e.length)},M:function(t,e){var i=t.getUTCMonth();return e==="M"?String(i+1):Tt(i+1,2)},d:function(t,e){return Tt(t.getUTCDate(),e.length)},a:function(t,e){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h:function(t,e){return Tt(t.getUTCHours()%12||12,e.length)},H:function(t,e){return Tt(t.getUTCHours(),e.length)},m:function(t,e){return Tt(t.getUTCMinutes(),e.length)},s:function(t,e){return Tt(t.getUTCSeconds(),e.length)},S:function(t,e){var i=e.length,r=t.getUTCMilliseconds(),a=Math.floor(r*Math.pow(10,i-3));return Tt(a,e.length)}};const yn=yb;var ni={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},bb={G:function(t,e,i){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(r,{width:"abbreviated"});case"GGGGG":return i.era(r,{width:"narrow"});case"GGGG":default:return i.era(r,{width:"wide"})}},y:function(t,e,i){if(e==="yo"){var r=t.getUTCFullYear(),a=r>0?r:1-r;return i.ordinalNumber(a,{unit:"year"})}return yn.y(t,e)},Y:function(t,e,i,r){var a=Ms(t,r),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return Tt(o,2)}return e==="Yo"?i.ordinalNumber(s,{unit:"year"}):Tt(s,e.length)},R:function(t,e){var i=Xu(t);return Tt(i,e.length)},u:function(t,e){var i=t.getUTCFullYear();return Tt(i,e.length)},Q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return Tt(r,2);case"Qo":return i.ordinalNumber(r,{unit:"quarter"});case"QQQ":return i.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return Tt(r,2);case"qo":return i.ordinalNumber(r,{unit:"quarter"});case"qqq":return i.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,i){var r=t.getUTCMonth();switch(e){case"M":case"MM":return yn.M(t,e);case"Mo":return i.ordinalNumber(r+1,{unit:"month"});case"MMM":return i.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,i){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return Tt(r+1,2);case"Lo":return i.ordinalNumber(r+1,{unit:"month"});case"LLL":return i.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,i,r){var a=Ku(t,r);return e==="wo"?i.ordinalNumber(a,{unit:"week"}):Tt(a,e.length)},I:function(t,e,i){var r=Gu(t);return e==="Io"?i.ordinalNumber(r,{unit:"week"}):Tt(r,e.length)},d:function(t,e,i){return e==="do"?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):yn.d(t,e)},D:function(t,e,i){var r=fb(t);return e==="Do"?i.ordinalNumber(r,{unit:"dayOfYear"}):Tt(r,e.length)},E:function(t,e,i){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(r,{width:"short",context:"formatting"});case"EEEE":default:return i.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Tt(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Tt(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var r=t.getUTCDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return Tt(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(r,{width:"short",context:"formatting"});case"iiii":default:return i.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,i){var r=t.getUTCHours(),a=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,i){var r=t.getUTCHours(),a;switch(r===12?a=ni.noon:r===0?a=ni.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,i){var r=t.getUTCHours(),a;switch(r>=17?a=ni.evening:r>=12?a=ni.afternoon:r>=4?a=ni.morning:a=ni.night,e){case"B":case"BB":case"BBB":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,i){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),i.ordinalNumber(r,{unit:"hour"})}return yn.h(t,e)},H:function(t,e,i){return e==="Ho"?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):yn.H(t,e)},K:function(t,e,i){var r=t.getUTCHours()%12;return e==="Ko"?i.ordinalNumber(r,{unit:"hour"}):Tt(r,e.length)},k:function(t,e,i){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?i.ordinalNumber(r,{unit:"hour"}):Tt(r,e.length)},m:function(t,e,i){return e==="mo"?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):yn.m(t,e)},s:function(t,e,i){return e==="so"?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):yn.s(t,e)},S:function(t,e){return yn.S(t,e)},X:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Qu(s);case"XXXX":case"XX":return Nn(s);case"XXXXX":case"XXX":default:return Nn(s,":")}},x:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Qu(s);case"xxxx":case"xx":return Nn(s);case"xxxxx":case"xxx":default:return Nn(s,":")}},O:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Zu(s,":");case"OOOO":default:return"GMT"+Nn(s,":")}},z:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Zu(s,":");case"zzzz":default:return"GMT"+Nn(s,":")}},t:function(t,e,i,r){var a=r._originalDate||t,s=Math.floor(a.getTime()/1e3);return Tt(s,e.length)},T:function(t,e,i,r){var a=r._originalDate||t,s=a.getTime();return Tt(s,e.length)}};function Zu(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+Tt(a,2)}function Qu(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Tt(Math.abs(n)/60,2)}return Nn(n,t)}function Nn(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=Tt(Math.floor(r/60),2),s=Tt(r%60,2);return i+a+e+s}const vb=bb;var Ju=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},td=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},xb=function(t,e){var i=t.match(/(P+)(p+)?/)||[],r=i[1],a=i[2];if(!a)return Ju(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Ju(r,e)).replace("{{time}}",td(a,e))},_b={p:td,P:xb};const Ss=_b;var wb=["D","DD"],Tb=["YY","YYYY"];function ed(n){return wb.indexOf(n)!==-1}function nd(n){return Tb.indexOf(n)!==-1}function Xr(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Db={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"}},Mb=function(t,e,i){var r,a=Db[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r};const Sb=Mb;function Cs(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,i=n.formats[e]||n.formats[n.defaultWidth];return i}}var Cb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},kb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ob={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pb={date:Cs({formats:Cb,defaultWidth:"full"}),time:Cs({formats:kb,defaultWidth:"full"}),dateTime:Cs({formats:Ob,defaultWidth:"full"})};const Eb=Pb;var Ab={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rb=function(t,e,i,r){return Ab[t]};const Lb=Rb;function Gi(n){return function(t,e){var i=e!=null&&e.context?String(e.context):"standalone",r;if(i==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;r=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return r[c]}}var Ib={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Fb={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"]},Ub={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"]},Bb={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"}},Yb={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"}},Wb=function(t,e){var i=Number(t),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},zb={ordinalNumber:Wb,era:Gi({values:Ib,defaultWidth:"wide"}),quarter:Gi({values:Nb,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Gi({values:Fb,defaultWidth:"wide"}),day:Gi({values:Ub,defaultWidth:"wide"}),dayPeriod:Gi({values:Bb,defaultWidth:"wide",formattingValues:Yb,defaultFormattingWidth:"wide"})};const Hb=zb;function Ki(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],a=t.match(r);if(!a)return null;var s=a[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?jb(o,function(d){return d.test(s)}):$b(o,function(d){return d.test(s)}),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function $b(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function jb(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function Vb(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(n.matchPattern);if(!i)return null;var r=i[0],a=t.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var o=t.slice(r.length);return{value:s,rest:o}}}var qb=/^(\d+)(th|st|nd|rd)?/i,Xb=/\d+/i,Gb={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},Kb={any:[/^b/i,/^(a|c)/i]},Zb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Qb={any:[/1/i,/2/i,/3/i,/4/i]},Jb={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},tv={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]},ev={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},nv={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]},iv={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},rv={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}},av={ordinalNumber:Vb({matchPattern:qb,parsePattern:Xb,valueCallback:function(t){return parseInt(t,10)}}),era:Ki({matchPatterns:Gb,defaultMatchWidth:"wide",parsePatterns:Kb,defaultParseWidth:"any"}),quarter:Ki({matchPatterns:Zb,defaultMatchWidth:"wide",parsePatterns:Qb,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Ki({matchPatterns:Jb,defaultMatchWidth:"wide",parsePatterns:tv,defaultParseWidth:"any"}),day:Ki({matchPatterns:ev,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),dayPeriod:Ki({matchPatterns:iv,defaultMatchWidth:"any",parsePatterns:rv,defaultParseWidth:"any"})},sv={code:"en-US",formatDistance:Sb,formatLong:Eb,formatRelative:Lb,localize:Hb,match:av,options:{weekStartsOn:0,firstWeekContainsDate:1}};const id=sv;var ov=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cv=/^'([^]*?)'?$/,uv=/''/g,dv=/[a-zA-Z]/;function fv(n,t,e){var i,r,a,s,o,l,c,u,d,f,g,p,x,m,b,v,_,w;K(2,arguments);var M=String(t),C=mn(),k=(i=(r=e==null?void 0:e.locale)!==null&&r!==void 0?r:C.locale)!==null&&i!==void 0?i:id,T=At((a=(s=(o=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(c=e.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:C.firstWeekContainsDate)!==null&&s!==void 0?s:(d=C.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=At((g=(p=(x=(m=e==null?void 0:e.weekStartsOn)!==null&&m!==void 0?m:e==null||(b=e.locale)===null||b===void 0||(v=b.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&x!==void 0?x:C.weekStartsOn)!==null&&p!==void 0?p:(_=C.locale)===null||_===void 0||(w=_.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&g!==void 0?g:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!k.localize)throw new RangeError("locale must contain localize property");if(!k.formatLong)throw new RangeError("locale must contain formatLong property");var O=et(n);if(!Ds(O))throw new RangeError("Invalid time value");var E=jr(O),A=qu(O,E),R={firstWeekContainsDate:T,weekStartsOn:D,locale:k,_originalDate:O},q=M.match(lv).map(function(H){var B=H[0];if(B==="p"||B==="P"){var I=Ss[B];return I(H,k.formatLong)}return H}).join("").match(ov).map(function(H){if(H==="''")return"'";var B=H[0];if(B==="'")return hv(H);var I=vb[B];if(I)return!(e!=null&&e.useAdditionalWeekYearTokens)&&nd(H)&&Xr(H,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&ed(H)&&Xr(H,t,String(n)),I(A,H,k.localize,R);if(B.match(dv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+B+"`");return H}).join("");return q}function hv(n){var t=n.match(cv);return t?t[1].replace(uv,"'"):n}function gv(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function rd(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function pv(n,t){if(n){if(typeof n=="string")return rd(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return rd(n,t)}}function ad(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=pv(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
19
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(s)throw o}}}}function X(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ks(n,t){return ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},ks(n,t)}function gt(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&ks(n,t)}function Gr(n){return Gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gr(n)}function mv(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function yv(n,t){if(t&&(Ge(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X(n)}function pt(n){var t=mv();return function(){var i=Gr(n),r;if(t){var a=Gr(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return yv(this,r)}}function ft(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function bv(n,t){if(Ge(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(Ge(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function sd(n){var t=bv(n,"string");return Ge(t)==="symbol"?t:String(t)}function od(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,sd(i.key),i)}}function ht(n,t,e){return t&&od(n.prototype,t),e&&od(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function j(n,t,e){return t=sd(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var vv=10,ld=function(){function n(){ft(this,n),j(this,"priority",void 0),j(this,"subPriority",0)}return ht(n,[{key:"validate",value:function(e,i){return!0}}]),n}(),xv=function(n){gt(e,n);var t=pt(e);function e(i,r,a,s,o){var l;return ft(this,e),l=t.call(this),l.value=i,l.validateValue=r,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return ht(e,[{key:"validate",value:function(r,a){return this.validateValue(r,this.value,a)}},{key:"set",value:function(r,a,s){return this.setValue(r,a,this.value,s)}}]),e}(ld),_v=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",vv),j(X(i),"subPriority",-1),i}return ht(e,[{key:"set",value:function(r,a){if(a.timestampIsSet)return r;var s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}}]),e}(ld),bt=function(){function n(){ft(this,n),j(this,"incompatibleTokens",void 0),j(this,"priority",void 0),j(this,"subPriority",void 0)}return ht(n,[{key:"run",value:function(e,i,r,a){var s=this.parse(e,i,r,a);return s?{setter:new xv(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,i,r){return!0}}]),n}(),wv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",140),j(X(i),"incompatibleTokens",["R","u","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})||s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"})}}},{key:"set",value:function(r,a,s){return a.era=s,r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),jt={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}/},Fe={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 Vt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Ut(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ue(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:i*(r*qi+a*Vr+s*zy),rest:t.slice(e[0].length)}}function cd(n){return Ut(jt.anyDigitsSigned,n)}function $t(n,t){switch(n){case 1:return Ut(jt.singleDigit,t);case 2:return Ut(jt.twoDigits,t);case 3:return Ut(jt.threeDigits,t);case 4:return Ut(jt.fourDigits,t);default:return Ut(new RegExp("^\\d{1,"+n+"}"),t)}}function Kr(n,t){switch(n){case 1:return Ut(jt.singleDigitSigned,t);case 2:return Ut(jt.twoDigitsSigned,t);case 3:return Ut(jt.threeDigitsSigned,t);case 4:return Ut(jt.fourDigitsSigned,t);default:return Ut(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Os(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 ud(n,t){var e=t>0,i=e?t:1-t,r;if(i<=50)r=n||100;else{var a=i+50,s=Math.floor(a/100)*100,o=n>=a%100;r=n+s-(o?100:0)}return e?r:1-r}function dd(n){return n%400===0||n%4===0&&n%100!==0}var Tv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",130),j(X(i),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return Vt($t(4,r),o);case"yo":return Vt(s.ordinalNumber(r,{unit:"year"}),o);default:return Vt($t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s){var o=r.getUTCFullYear();if(s.isTwoDigitYear){var l=ud(s.year,o);return r.setUTCFullYear(l,0,1),r.setUTCHours(0,0,0,0),r}var c=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(c,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Dv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",130),j(X(i),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return Vt($t(4,r),o);case"Yo":return Vt(s.ordinalNumber(r,{unit:"year"}),o);default:return Vt($t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s,o){var l=Ms(r,o);if(s.isTwoDigitYear){var c=ud(s.year,l);return r.setUTCFullYear(c,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),In(r,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(u,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),In(r,o)}}]),e}(bt),Mv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",130),j(X(i),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){return Kr(a==="R"?4:a.length,r)}},{key:"set",value:function(r,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),ei(o)}}]),e}(bt),Sv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",130),j(X(i),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){return Kr(a==="u"?4:a.length,r)}},{key:"set",value:function(r,a,s){return r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Cv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",120),j(X(i),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"Q":case"QQ":return $t(a.length,r);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})||s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),kv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",120),j(X(i),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"q":case"qq":return $t(a.length,r);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})||s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Ov=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),j(X(i),"priority",110),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"M":return Vt(Ut(jt.month,r),o);case"MM":return Vt($t(2,r),o);case"Mo":return Vt(s.ordinalNumber(r,{unit:"month"}),o);case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})||s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Pv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",110),j(X(i),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"L":return Vt(Ut(jt.month,r),o);case"LL":return Vt($t(2,r),o);case"Lo":return Vt(s.ordinalNumber(r,{unit:"month"}),o);case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})||s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function Ev(n,t,e){K(2,arguments);var i=et(n),r=At(t),a=Ku(i,e)-r;return i.setUTCDate(i.getUTCDate()-a*7),i}var Av=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",100),j(X(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"w":return Ut(jt.week,r);case"wo":return s.ordinalNumber(r,{unit:"week"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s,o){return In(Ev(r,s,o),o)}}]),e}(bt);function Rv(n,t){K(2,arguments);var e=et(n),i=At(t),r=Gu(e)-i;return e.setUTCDate(e.getUTCDate()-r*7),e}var Lv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",100),j(X(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"I":return Ut(jt.week,r);case"Io":return s.ordinalNumber(r,{unit:"week"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s){return ei(Rv(r,s))}}]),e}(bt),Iv=[31,28,31,30,31,30,31,31,30,31,30,31],Nv=[31,29,31,30,31,30,31,31,30,31,30,31],Fv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"subPriority",1),j(X(i),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"d":return Ut(jt.date,r);case"do":return s.ordinalNumber(r,{unit:"date"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=dd(s),l=r.getUTCMonth();return o?a>=1&&a<=Nv[l]:a>=1&&a<=Iv[l]}},{key:"set",value:function(r,a,s){return r.setUTCDate(s),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Uv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"subpriority",1),j(X(i),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"D":case"DD":return Ut(jt.dayOfYear,r);case"Do":return s.ordinalNumber(r,{unit:"date"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=dd(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(r,a,s){return r.setUTCMonth(0,s),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function Ps(n,t,e){var i,r,a,s,o,l,c,u;K(2,arguments);var d=mn(),f=At((i=(r=(a=(s=e==null?void 0:e.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:d.weekStartsOn)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=et(n),p=At(t),x=g.getUTCDay(),m=p%7,b=(m+7)%7,v=(b<f?7:0)+p-x;return g.setUTCDate(g.getUTCDate()+v),g}var Bv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"incompatibleTokens",["D","i","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Yv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"e":case"ee":return Vt($t(a.length,r),l);case"eo":return Vt(s.ordinalNumber(r,{unit:"day"}),l);case"eee":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt),Wv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"c":case"cc":return Vt($t(a.length,r),l);case"co":return Vt(s.ordinalNumber(r,{unit:"day"}),l);case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})||s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=Ps(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(bt);function zv(n,t){K(2,arguments);var e=At(t);e%7===0&&(e=e-7);var i=1,r=et(n),a=r.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<i?7:0)+e-a;return r.setUTCDate(r.getUTCDate()+l),r}var Hv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",90),j(X(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return $t(a.length,r);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return Vt(s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return Vt(s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Vt(s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Vt(s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(r,a){return a>=1&&a<=7}},{key:"set",value:function(r,a,s){return r=zv(r,s),r.setUTCHours(0,0,0,0),r}}]),e}(bt),$v=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",80),j(X(i),"incompatibleTokens",["b","B","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),jv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",80),j(X(i),"incompatibleTokens",["a","B","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),Vv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",80),j(X(i),"incompatibleTokens",["a","b","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(Os(s),0,0,0),r}}]),e}(bt),qv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",70),j(X(i),"incompatibleTokens",["H","K","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"h":return Ut(jt.hour12h,r);case"ho":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=12}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):!o&&s===12?r.setUTCHours(0,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(bt),Xv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",70),j(X(i),"incompatibleTokens",["a","b","h","K","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"H":return Ut(jt.hour23h,r);case"Ho":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=23}},{key:"set",value:function(r,a,s){return r.setUTCHours(s,0,0,0),r}}]),e}(bt),Gv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",70),j(X(i),"incompatibleTokens",["h","H","k","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"K":return Ut(jt.hour11h,r);case"Ko":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(bt),Kv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",70),j(X(i),"incompatibleTokens",["a","b","h","H","K","t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"k":return Ut(jt.hour24h,r);case"ko":return s.ordinalNumber(r,{unit:"hour"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=24}},{key:"set",value:function(r,a,s){var o=s<=24?s%24:s;return r.setUTCHours(o,0,0,0),r}}]),e}(bt),Zv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",60),j(X(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"m":return Ut(jt.minute,r);case"mo":return s.ordinalNumber(r,{unit:"minute"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCMinutes(s,0,0),r}}]),e}(bt),Qv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",50),j(X(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a,s){switch(a){case"s":return Ut(jt.second,r);case"so":return s.ordinalNumber(r,{unit:"second"});default:return $t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCSeconds(s,0),r}}]),e}(bt),Jv=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",30),j(X(i),"incompatibleTokens",["t","T"]),i}return ht(e,[{key:"parse",value:function(r,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return Vt($t(a.length,r),s)}},{key:"set",value:function(r,a,s){return r.setUTCMilliseconds(s),r}}]),e}(bt),tx=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",10),j(X(i),"incompatibleTokens",["t","T","x"]),i}return ht(e,[{key:"parse",value:function(r,a){switch(a){case"X":return Ue(Fe.basicOptionalMinutes,r);case"XX":return Ue(Fe.basic,r);case"XXXX":return Ue(Fe.basicOptionalSeconds,r);case"XXXXX":return Ue(Fe.extendedOptionalSeconds,r);case"XXX":default:return Ue(Fe.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(bt),ex=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",10),j(X(i),"incompatibleTokens",["t","T","X"]),i}return ht(e,[{key:"parse",value:function(r,a){switch(a){case"x":return Ue(Fe.basicOptionalMinutes,r);case"xx":return Ue(Fe.basic,r);case"xxxx":return Ue(Fe.basicOptionalSeconds,r);case"xxxxx":return Ue(Fe.extendedOptionalSeconds,r);case"xxx":default:return Ue(Fe.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(bt),nx=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",40),j(X(i),"incompatibleTokens","*"),i}return ht(e,[{key:"parse",value:function(r){return cd(r)}},{key:"set",value:function(r,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(bt),ix=function(n){gt(e,n);var t=pt(e);function e(){var i;ft(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),j(X(i),"priority",20),j(X(i),"incompatibleTokens","*"),i}return ht(e,[{key:"parse",value:function(r){return cd(r)}},{key:"set",value:function(r,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(bt),rx={G:new wv,y:new Tv,Y:new Dv,R:new Mv,u:new Sv,Q:new Cv,q:new kv,M:new Ov,L:new Pv,w:new Av,I:new Lv,d:new Fv,D:new Uv,E:new Bv,e:new Yv,c:new Wv,i:new Hv,a:new $v,b:new jv,B:new Vv,h:new qv,H:new Xv,K:new Gv,k:new Kv,m:new Zv,s:new Qv,S:new Jv,X:new tx,x:new ex,t:new nx,T:new ix},ax=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ox=/^'([^]*?)'?$/,lx=/''/g,cx=/\S/,ux=/[a-zA-Z]/;function dx(n,t,e,i){var r,a,s,o,l,c,u,d,f,g,p,x,m,b,v,_,w,M;K(3,arguments);var C=String(n),k=String(t),T=mn(),D=(r=(a=i==null?void 0:i.locale)!==null&&a!==void 0?a:T.locale)!==null&&r!==void 0?r:id;if(!D.match)throw new RangeError("locale must contain match property");var O=At((s=(o=(l=(c=i==null?void 0:i.firstWeekContainsDate)!==null&&c!==void 0?c:i==null||(u=i.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:T.firstWeekContainsDate)!==null&&o!==void 0?o:(f=T.locale)===null||f===void 0||(g=f.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=At((p=(x=(m=(b=i==null?void 0:i.weekStartsOn)!==null&&b!==void 0?b:i==null||(v=i.locale)===null||v===void 0||(_=v.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&m!==void 0?m:T.weekStartsOn)!==null&&x!==void 0?x:(w=T.locale)===null||w===void 0||(M=w.options)===null||M===void 0?void 0:M.weekStartsOn)!==null&&p!==void 0?p:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(k==="")return C===""?et(e):new Date(NaN);var A={firstWeekContainsDate:O,weekStartsOn:E,locale:D},R=[new _v],q=k.match(sx).map(function(F){var L=F[0];if(L in Ss){var Q=Ss[L];return Q(F,D.formatLong)}return F}).join("").match(ax),H=[],B=ad(q),I;try{var rt=function(){var L=I.value;!(i!=null&&i.useAdditionalWeekYearTokens)&&nd(L)&&Xr(L,k,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&ed(L)&&Xr(L,k,n);var Q=L[0],G=rx[Q];if(G){var vt=G.incompatibleTokens;if(Array.isArray(vt)){var dt=H.find(function(Dt){return vt.includes(Dt.token)||Dt.token===Q});if(dt)throw new RangeError("The format string mustn't contain `".concat(dt.fullToken,"` and `").concat(L,"` at the same time"))}else if(G.incompatibleTokens==="*"&&H.length>0)throw new RangeError("The format string mustn't contain `".concat(L,"` and any other token at the same time"));H.push({token:Q,fullToken:L});var It=G.run(C,L,D.match,A);if(!It)return{v:new Date(NaN)};R.push(It.setter),C=It.rest}else{if(Q.match(ux))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Q+"`");if(L==="''"?L="'":Q==="'"&&(L=fx(L)),C.indexOf(L)===0)C=C.slice(L.length);else return{v:new Date(NaN)}}};for(B.s();!(I=B.n()).done;){var W=rt();if(Ge(W)==="object")return W.v}}catch(F){B.e(F)}finally{B.f()}if(C.length>0&&cx.test(C))return new Date(NaN);var Ct=R.map(function(F){return F.priority}).sort(function(F,L){return L-F}).filter(function(F,L,Q){return Q.indexOf(F)===L}).map(function(F){return R.filter(function(L){return L.priority===F}).sort(function(L,Q){return Q.subPriority-L.subPriority})}).map(function(F){return F[0]}),mt=et(e);if(isNaN(mt.getTime()))return new Date(NaN);var $=qu(mt,jr(mt)),N={},Y=ad(Ct),V;try{for(Y.s();!(V=Y.n()).done;){var Z=V.value;if(!Z.validate($,A))return new Date(NaN);var J=Z.set($,N,A);Array.isArray(J)?($=J[0],gv(N,J[1])):$=J}}catch(F){Y.e(F)}finally{Y.f()}return $}function fx(n){return n.match(ox)[1].replace(lx,"'")}function hx(n){K(1,arguments);var t=et(n);return t.setMinutes(0,0,0),t}function gx(n){K(1,arguments);var t=et(n);return t.setMilliseconds(0),t}function px(n){K(1,arguments);var t=n/qi;return Math.floor(t)}function fd(n,t){var e;K(1,arguments);var i=At((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=vx(n),a;if(r.date){var s=xx(r.date,i);a=_x(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(r.time&&(l=wx(r.time),isNaN(l)))return new Date(NaN);if(r.timezone){if(c=Tx(r.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(o+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(o+l+c)}var Zr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},mx=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,yx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,bx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function vx(n){var t={},e=n.split(Zr.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Zr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Zr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){var r=Zr.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function xx(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,a=i[2]?parseInt(i[2]):null;return{year:a===null?r:a*100,restDateString:n.slice((i[1]||i[2]).length)}}function _x(n,t){if(t===null)return new Date(NaN);var e=n.match(mx);if(!e)return new Date(NaN);var i=!!e[4],r=Zi(e[1]),a=Zi(e[2])-1,s=Zi(e[3]),o=Zi(e[4]),l=Zi(e[5])-1;if(i)return kx(t,o,l)?Dx(t,o,l):new Date(NaN);var c=new Date(0);return!Sx(t,a,s)||!Cx(t,r)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(r,s)),c)}function Zi(n){return n?parseInt(n):1}function wx(n){var t=n.match(yx);if(!t)return NaN;var e=Es(t[1]),i=Es(t[2]),r=Es(t[3]);return Ox(e,i,r)?e*qi+i*Vr+r*1e3:NaN}function Es(n){return n&&parseFloat(n.replace(",","."))||0}function Tx(n){if(n==="Z")return 0;var t=n.match(bx);if(!t)return 0;var e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return Px(i,r)?e*(i*qi+r*Vr):NaN}function Dx(n,t,e){var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Mx=[31,null,31,30,31,30,31,31,30,31,30,31];function hd(n){return n%400===0||n%4===0&&n%100!==0}function Sx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Mx[t]||(hd(n)?29:28))}function Cx(n,t){return t>=1&&t<=(hd(n)?366:365)}function kx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Ox(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Px(n,t){return t>=0&&t<=59}function Ex(n){K(1,arguments);var t=n/Hy;return Math.floor(t)}var ee=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(ee||{}),Qr=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(Qr||{}),Bt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Bt||{}),ii=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(ii||{});const As=(n,t)=>{var r,a;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((s,o)=>o.rawValue-s.rawValue);if(e.body&&!n.locked){const s=e.labelColors,o=((a=(r=t.chart.config)==null?void 0:r.options)==null?void 0:a.indexAxis)==="y"?"x":"y",l=[ee.HORIZONTAL_BAR,ee.VERTICAL_BAR].includes(n.chartType),c=[Qr.GAUGE,ee.DOUGHNUT].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const f=c?u.parsed:u.parsed[o];let g;if(n.units==="bytes")g=isNaN(f)?f:_s(f);else{const x=n.translateUnit(n.units,f);g=`${f%1===0?ta.format(f):ta.format(Number(f.toFixed(Id)))} ${x}`}const p=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:s[d].backgroundColor,borderColor:s[d].borderColor,label:p,value:g,rawValue:f}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Ax=n=>n&&n.datasets&&n.datasets.length,Rx=n=>Ax(n)&&n.datasets.some(t=>t.data.length),Lx=n=>Rx(n)&&n.datasets.some(t=>t.data.length>1),Ix=n=>Lx(n)&&n.datasets.some(t=>t.data[0]&&Ds(t.data[0].x)),Nx=n=>Ix(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Rs=(n,t,e)=>{const r=Math.min(t/1150,1),a=.15,s=1.15;return n.x<e?n.x+t*a*(1-r):n.x-t*s*(1-r)},Fx=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Ux(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ls={exports:{}},gd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(gd);var Yt=gd.exports,Is={exports:{}},Ns={exports:{}},pd={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(pd);var md=pd.exports,Fs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(r.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+r.length+" present")}n.exports=t.default})(Fs,Fs.exports);var ae=Fs.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(md),r=e(ae);function a(s){return(0,r.default)(1,arguments),s instanceof Date||(0,i.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ns,Ns.exports);var Bx=Ns.exports,Us={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(md),r=e(ae);function a(s){(0,r.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,i.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}n.exports=t.default})(Us,Us.exports);var Be=Us.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Bx),r=e(Be),a=e(ae);function s(o){if((0,a.default)(1,arguments),!(0,i.default)(o)&&typeof o!="number")return!1;var l=(0,r.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Is,Is.exports);var Yx=Is.exports,Bs={exports:{}},Ys={exports:{}},Ws={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Ws,Ws.exports);var Un=Ws.exports;const Wx=Fn(Un);(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Un),r=e(Be),a=e(ae);function s(o,l){(0,a.default)(2,arguments);var c=(0,r.default)(o).getTime(),u=(0,i.default)(l);return new Date(c+u)}n.exports=t.default})(Ys,Ys.exports);var zx=Ys.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(zx),r=e(ae),a=e(Un);function s(o,l){(0,r.default)(2,arguments);var c=(0,a.default)(l);return(0,i.default)(o,-c)}n.exports=t.default})(Bs,Bs.exports);var Hx=Bs.exports,zs={exports:{}},Hs={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Be),r=e(ae),a=864e5;function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(Hs,Hs.exports);var $x=Hs.exports,$s={exports:{}},js={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(Be),r=e(ae);function a(s){(0,r.default)(1,arguments);var o=1,l=(0,i.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(js,js.exports);var Vs=js.exports,qs={exports:{}},Xs={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Be),r=e(ae),a=e(Vs);function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var g=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=g.getTime()?c:c-1}n.exports=t.default})(Xs,Xs.exports);var yd=Xs.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(yd),r=e(Vs),a=e(ae);function s(o){(0,a.default)(1,arguments);var l=(0,i.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,r.default)(c);return u}n.exports=t.default})(qs,qs.exports);var jx=qs.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(Vs),a=e(jx),s=e(ae),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,i.default)(c),d=(0,r.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})($s,$s.exports);var Vx=$s.exports,Gs={exports:{}},Ks={exports:{}},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.getDefaultOptions=qx,Bn.setDefaultOptions=Xx;var bd={};function qx(){return bd}function Xx(n){bd=n}(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=e(Be),r=e(ae),a=e(Un),s=Bn;function o(l,c){var u,d,f,g,p,x,m,b;(0,r.default)(1,arguments);var v=(0,s.getDefaultOptions)(),_=(0,a.default)((u=(d=(f=(g=c==null?void 0:c.weekStartsOn)!==null&&g!==void 0?g:c==null||(p=c.locale)===null||p===void 0||(x=p.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:v.weekStartsOn)!==null&&d!==void 0?d:(m=v.locale)===null||m===void 0||(b=m.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&u!==void 0?u:0);if(!(_>=0&&_<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,i.default)(l),M=w.getUTCDay(),C=(M<_?7:0)+M-_;return w.setUTCDate(w.getUTCDate()-C),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(Ks,Ks.exports);var Zs=Ks.exports,Qs={exports:{}},Js={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(ae),a=e(Zs),s=e(Un),o=Bn;function l(c,u){var d,f,g,p,x,m,b,v;(0,r.default)(1,arguments);var _=(0,i.default)(c),w=_.getUTCFullYear(),M=(0,o.getDefaultOptions)(),C=(0,s.default)((d=(f=(g=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(x=u.locale)===null||x===void 0||(m=x.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&g!==void 0?g:M.firstWeekContainsDate)!==null&&f!==void 0?f:(b=M.locale)===null||b===void 0||(v=b.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(C>=1&&C<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var k=new Date(0);k.setUTCFullYear(w+1,0,C),k.setUTCHours(0,0,0,0);var T=(0,a.default)(k,u),D=new Date(0);D.setUTCFullYear(w,0,C),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return _.getTime()>=T.getTime()?w+1:_.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(Js,Js.exports);var vd=Js.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(vd),r=e(ae),a=e(Zs),s=e(Un),o=Bn;function l(c,u){var d,f,g,p,x,m,b,v;(0,r.default)(1,arguments);var _=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(g=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(x=u.locale)===null||x===void 0||(m=x.options)===null||m===void 0?void 0:m.firstWeekContainsDate)!==null&&g!==void 0?g:_.firstWeekContainsDate)!==null&&f!==void 0?f:(b=_.locale)===null||b===void 0||(v=b.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1),M=(0,i.default)(c,u),C=new Date(0);C.setUTCFullYear(M,0,w),C.setUTCHours(0,0,0,0);var k=(0,a.default)(C,u);return k}n.exports=t.default})(Qs,Qs.exports);var Gx=Qs.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(Be),r=e(Zs),a=e(Gx),s=e(ae),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,i.default)(c),f=(0,r.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(Gs,Gs.exports);var Kx=Gs.exports,to={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){for(var a=i<0?"-":"",s=Math.abs(i).toString();s.length<r;)s="0"+s;return a+s}n.exports=t.default})(to,to.exports);var xd=to.exports,eo={exports:{}};(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(xd),r={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,i.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,i.default)(c+1,2)},d:function(o,l){return(0,i.default)(o.getUTCDate(),l.length)},a:function(o,l){var c=o.getUTCHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];case"aaaa":default:return c==="am"?"a.m.":"p.m."}},h:function(o,l){return(0,i.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,i.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,i.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,i.default)(o.getUTCSeconds(),l.length)},S:function(o,l){var c=l.length,u=o.getUTCMilliseconds(),d=Math.floor(u*Math.pow(10,c-3));return(0,i.default)(d,l.length)}},a=r;t.default=a,n.exports=t.default})(eo,eo.exports);var Zx=eo.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e($x),r=e(Vx),a=e(yd),s=e(Kx),o=e(vd),l=e(xd),c=e(Zx),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(b,v,_){var w=b.getUTCFullYear()>0?1:0;switch(v){case"G":case"GG":case"GGG":return _.era(w,{width:"abbreviated"});case"GGGGG":return _.era(w,{width:"narrow"});case"GGGG":default:return _.era(w,{width:"wide"})}},y:function(b,v,_){if(v==="yo"){var w=b.getUTCFullYear(),M=w>0?w:1-w;return _.ordinalNumber(M,{unit:"year"})}return c.default.y(b,v)},Y:function(b,v,_,w){var M=(0,o.default)(b,w),C=M>0?M:1-M;if(v==="YY"){var k=C%100;return(0,l.default)(k,2)}return v==="Yo"?_.ordinalNumber(C,{unit:"year"}):(0,l.default)(C,v.length)},R:function(b,v){var _=(0,a.default)(b);return(0,l.default)(_,v.length)},u:function(b,v){var _=b.getUTCFullYear();return(0,l.default)(_,v.length)},Q:function(b,v,_){var w=Math.ceil((b.getUTCMonth()+1)/3);switch(v){case"Q":return String(w);case"QQ":return(0,l.default)(w,2);case"Qo":return _.ordinalNumber(w,{unit:"quarter"});case"QQQ":return _.quarter(w,{width:"abbreviated",context:"formatting"});case"QQQQQ":return _.quarter(w,{width:"narrow",context:"formatting"});case"QQQQ":default:return _.quarter(w,{width:"wide",context:"formatting"})}},q:function(b,v,_){var w=Math.ceil((b.getUTCMonth()+1)/3);switch(v){case"q":return String(w);case"qq":return(0,l.default)(w,2);case"qo":return _.ordinalNumber(w,{unit:"quarter"});case"qqq":return _.quarter(w,{width:"abbreviated",context:"standalone"});case"qqqqq":return _.quarter(w,{width:"narrow",context:"standalone"});case"qqqq":default:return _.quarter(w,{width:"wide",context:"standalone"})}},M:function(b,v,_){var w=b.getUTCMonth();switch(v){case"M":case"MM":return c.default.M(b,v);case"Mo":return _.ordinalNumber(w+1,{unit:"month"});case"MMM":return _.month(w,{width:"abbreviated",context:"formatting"});case"MMMMM":return _.month(w,{width:"narrow",context:"formatting"});case"MMMM":default:return _.month(w,{width:"wide",context:"formatting"})}},L:function(b,v,_){var w=b.getUTCMonth();switch(v){case"L":return String(w+1);case"LL":return(0,l.default)(w+1,2);case"Lo":return _.ordinalNumber(w+1,{unit:"month"});case"LLL":return _.month(w,{width:"abbreviated",context:"standalone"});case"LLLLL":return _.month(w,{width:"narrow",context:"standalone"});case"LLLL":default:return _.month(w,{width:"wide",context:"standalone"})}},w:function(b,v,_,w){var M=(0,s.default)(b,w);return v==="wo"?_.ordinalNumber(M,{unit:"week"}):(0,l.default)(M,v.length)},I:function(b,v,_){var w=(0,r.default)(b);return v==="Io"?_.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,v.length)},d:function(b,v,_){return v==="do"?_.ordinalNumber(b.getUTCDate(),{unit:"date"}):c.default.d(b,v)},D:function(b,v,_){var w=(0,i.default)(b);return v==="Do"?_.ordinalNumber(w,{unit:"dayOfYear"}):(0,l.default)(w,v.length)},E:function(b,v,_){var w=b.getUTCDay();switch(v){case"E":case"EE":case"EEE":return _.day(w,{width:"abbreviated",context:"formatting"});case"EEEEE":return _.day(w,{width:"narrow",context:"formatting"});case"EEEEEE":return _.day(w,{width:"short",context:"formatting"});case"EEEE":default:return _.day(w,{width:"wide",context:"formatting"})}},e:function(b,v,_,w){var M=b.getUTCDay(),C=(M-w.weekStartsOn+8)%7||7;switch(v){case"e":return String(C);case"ee":return(0,l.default)(C,2);case"eo":return _.ordinalNumber(C,{unit:"day"});case"eee":return _.day(M,{width:"abbreviated",context:"formatting"});case"eeeee":return _.day(M,{width:"narrow",context:"formatting"});case"eeeeee":return _.day(M,{width:"short",context:"formatting"});case"eeee":default:return _.day(M,{width:"wide",context:"formatting"})}},c:function(b,v,_,w){var M=b.getUTCDay(),C=(M-w.weekStartsOn+8)%7||7;switch(v){case"c":return String(C);case"cc":return(0,l.default)(C,v.length);case"co":return _.ordinalNumber(C,{unit:"day"});case"ccc":return _.day(M,{width:"abbreviated",context:"standalone"});case"ccccc":return _.day(M,{width:"narrow",context:"standalone"});case"cccccc":return _.day(M,{width:"short",context:"standalone"});case"cccc":default:return _.day(M,{width:"wide",context:"standalone"})}},i:function(b,v,_){var w=b.getUTCDay(),M=w===0?7:w;switch(v){case"i":return String(M);case"ii":return(0,l.default)(M,v.length);case"io":return _.ordinalNumber(M,{unit:"day"});case"iii":return _.day(w,{width:"abbreviated",context:"formatting"});case"iiiii":return _.day(w,{width:"narrow",context:"formatting"});case"iiiiii":return _.day(w,{width:"short",context:"formatting"});case"iiii":default:return _.day(w,{width:"wide",context:"formatting"})}},a:function(b,v,_){var w=b.getUTCHours(),M=w/12>=1?"pm":"am";switch(v){case"a":case"aa":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"});case"aaa":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return _.dayPeriod(M,{width:"narrow",context:"formatting"});case"aaaa":default:return _.dayPeriod(M,{width:"wide",context:"formatting"})}},b:function(b,v,_){var w=b.getUTCHours(),M;switch(w===12?M=u.noon:w===0?M=u.midnight:M=w/12>=1?"pm":"am",v){case"b":case"bb":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"});case"bbb":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return _.dayPeriod(M,{width:"narrow",context:"formatting"});case"bbbb":default:return _.dayPeriod(M,{width:"wide",context:"formatting"})}},B:function(b,v,_){var w=b.getUTCHours(),M;switch(w>=17?M=u.evening:w>=12?M=u.afternoon:w>=4?M=u.morning:M=u.night,v){case"B":case"BB":case"BBB":return _.dayPeriod(M,{width:"abbreviated",context:"formatting"});case"BBBBB":return _.dayPeriod(M,{width:"narrow",context:"formatting"});case"BBBB":default:return _.dayPeriod(M,{width:"wide",context:"formatting"})}},h:function(b,v,_){if(v==="ho"){var w=b.getUTCHours()%12;return w===0&&(w=12),_.ordinalNumber(w,{unit:"hour"})}return c.default.h(b,v)},H:function(b,v,_){return v==="Ho"?_.ordinalNumber(b.getUTCHours(),{unit:"hour"}):c.default.H(b,v)},K:function(b,v,_){var w=b.getUTCHours()%12;return v==="Ko"?_.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,v.length)},k:function(b,v,_){var w=b.getUTCHours();return w===0&&(w=24),v==="ko"?_.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,v.length)},m:function(b,v,_){return v==="mo"?_.ordinalNumber(b.getUTCMinutes(),{unit:"minute"}):c.default.m(b,v)},s:function(b,v,_){return v==="so"?_.ordinalNumber(b.getUTCSeconds(),{unit:"second"}):c.default.s(b,v)},S:function(b,v){return c.default.S(b,v)},X:function(b,v,_,w){var M=w._originalDate||b,C=M.getTimezoneOffset();if(C===0)return"Z";switch(v){case"X":return g(C);case"XXXX":case"XX":return p(C);case"XXXXX":case"XXX":default:return p(C,":")}},x:function(b,v,_,w){var M=w._originalDate||b,C=M.getTimezoneOffset();switch(v){case"x":return g(C);case"xxxx":case"xx":return p(C);case"xxxxx":case"xxx":default:return p(C,":")}},O:function(b,v,_,w){var M=w._originalDate||b,C=M.getTimezoneOffset();switch(v){case"O":case"OO":case"OOO":return"GMT"+f(C,":");case"OOOO":default:return"GMT"+p(C,":")}},z:function(b,v,_,w){var M=w._originalDate||b,C=M.getTimezoneOffset();switch(v){case"z":case"zz":case"zzz":return"GMT"+f(C,":");case"zzzz":default:return"GMT"+p(C,":")}},t:function(b,v,_,w){var M=w._originalDate||b,C=Math.floor(M.getTime()/1e3);return(0,l.default)(C,v.length)},T:function(b,v,_,w){var M=w._originalDate||b,C=M.getTime();return(0,l.default)(C,v.length)}};function f(m,b){var v=m>0?"-":"+",_=Math.abs(m),w=Math.floor(_/60),M=_%60;if(M===0)return v+String(w);var C=b||"";return v+String(w)+C+(0,l.default)(M,2)}function g(m,b){if(m%60===0){var v=m>0?"-":"+";return v+(0,l.default)(Math.abs(m)/60,2)}return p(m,b)}function p(m,b){var v=b||"",_=m>0?"-":"+",w=Math.abs(m),M=(0,l.default)(Math.floor(w/60),2),C=(0,l.default)(w%60,2);return _+M+v+C}var x=d;t.default=x,n.exports=t.default})(zs,zs.exports);var Qx=zs.exports,no={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},i=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},r=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return e(l,c);var g;switch(d){case"P":g=c.dateTime({width:"short"});break;case"PP":g=c.dateTime({width:"medium"});break;case"PPP":g=c.dateTime({width:"long"});break;case"PPPP":default:g=c.dateTime({width:"full"});break}return g.replace("{{date}}",e(d,c)).replace("{{time}}",i(f,c))},a={p:i,P:r},s=a;t.default=s,n.exports=t.default})(no,no.exports);var Jx=no.exports,io={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(io,io.exports);var _d=io.exports;const wd=Fn(_d);var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.isProtectedDayOfYearToken=n_,Qi.isProtectedWeekYearToken=i_,Qi.throwProtectedError=r_;var t_=["D","DD"],e_=["YY","YYYY"];function n_(n){return t_.indexOf(n)!==-1}function i_(n){return e_.indexOf(n)!==-1}function r_(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ro={exports:{}},ao={exports:{}},so={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={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"}},i=function(s,o,l){var c,u=e[s];return typeof u=="string"?c=u:o===1?c=u.one:c=u.other.replace("{{count}}",o.toString()),l!=null&&l.addSuffix?l.comparison&&l.comparison>0?"in "+c:c+" ago":c},r=i;t.default=r,n.exports=t.default})(so,so.exports);var a_=so.exports,oo={exports:{}},lo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):i.defaultWidth,s=i.formats[a]||i.formats[i.defaultWidth];return s}}n.exports=t.default})(lo,lo.exports);var s_=lo.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(s_),r={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,i.default)({formats:r,defaultWidth:"full"}),time:(0,i.default)({formats:a,defaultWidth:"full"}),dateTime:(0,i.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(oo,oo.exports);var o_=oo.exports,co={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i=function(s,o,l,c){return e[s]},r=i;t.default=r,n.exports=t.default})(co,co.exports);var l_=co.exports,uo={exports:{}},fo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&i.formattingValues){var l=i.defaultFormattingWidth||i.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=i.formattingValues[c]||i.formattingValues[l]}else{var u=i.defaultWidth,d=a!=null&&a.width?String(a.width):i.defaultWidth;o=i.values[d]||i.values[u]}var f=i.argumentCallback?i.argumentCallback(r):r;return o[f]}}n.exports=t.default})(fo,fo.exports);var c_=fo.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(c_),r={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={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"]},l={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"}},c={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"}},u=function(p,x){var m=Number(p),b=m%100;if(b>20||b<10)switch(b%10){case 1:return m+"st";case 2:return m+"nd";case 3:return m+"rd"}return m+"th"},d={ordinalNumber:u,era:(0,i.default)({values:r,defaultWidth:"wide"}),quarter:(0,i.default)({values:a,defaultWidth:"wide",argumentCallback:function(p){return p-1}}),month:(0,i.default)({values:s,defaultWidth:"wide"}),day:(0,i.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,i.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(uo,uo.exports);var u_=uo.exports,ho={exports:{}},go={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],g=Array.isArray(f)?r(f,function(m){return m.test(d)}):i(f,function(m){return m.test(d)}),p;p=a.valueCallback?a.valueCallback(g):g,p=o.valueCallback?o.valueCallback(p):p;var x=s.slice(d.length);return{value:p,rest:x}}}function i(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function r(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(go,go.exports);var d_=go.exports,po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.match(i.matchPattern);if(!s)return null;var o=s[0],l=r.match(i.parsePattern);if(!l)return null;var c=i.valueCallback?i.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=r.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(po,po.exports);var f_=po.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(d_),r=e(f_),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={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},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={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},f={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]},g={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},p={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]},x={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},m={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}},b={ordinalNumber:(0,r.default)({matchPattern:a,parsePattern:s,valueCallback:function(w){return parseInt(w,10)}}),era:(0,i.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,i.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(w){return w+1}}),month:(0,i.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,i.default)({matchPatterns:g,defaultMatchWidth:"wide",parsePatterns:p,defaultParseWidth:"any"}),dayPeriod:(0,i.default)({matchPatterns:x,defaultMatchWidth:"any",parsePatterns:m,defaultParseWidth:"any"})},v=b;t.default=v,n.exports=t.default})(ho,ho.exports);var h_=ho.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(a_),r=e(o_),a=e(l_),s=e(u_),o=e(h_),l={code:"en-US",formatDistance:i.default,formatLong:r.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(ao,ao.exports);var g_=ao.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(g_),r=i.default;t.default=r,n.exports=t.default})(ro,ro.exports);var p_=ro.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var i=e(Yx),r=e(Hx),a=e(Be),s=e(Qx),o=e(Jx),l=e(_d),c=Qi,u=e(Un),d=e(ae),f=Bn,g=e(p_),p=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,m=/^'([^]*?)'?$/,b=/''/g,v=/[a-zA-Z]/;function _(M,C,k){var T,D,O,E,A,R,q,H,B,I,rt,W,Ct,mt,$,N,Y,V;(0,d.default)(2,arguments);var Z=String(C),J=(0,f.getDefaultOptions)(),F=(T=(D=k==null?void 0:k.locale)!==null&&D!==void 0?D:J.locale)!==null&&T!==void 0?T:g.default,L=(0,u.default)((O=(E=(A=(R=k==null?void 0:k.firstWeekContainsDate)!==null&&R!==void 0?R:k==null||(q=k.locale)===null||q===void 0||(H=q.options)===null||H===void 0?void 0:H.firstWeekContainsDate)!==null&&A!==void 0?A:J.firstWeekContainsDate)!==null&&E!==void 0?E:(B=J.locale)===null||B===void 0||(I=B.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(L>=1&&L<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Q=(0,u.default)((rt=(W=(Ct=(mt=k==null?void 0:k.weekStartsOn)!==null&&mt!==void 0?mt:k==null||($=k.locale)===null||$===void 0||(N=$.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&Ct!==void 0?Ct:J.weekStartsOn)!==null&&W!==void 0?W:(Y=J.locale)===null||Y===void 0||(V=Y.options)===null||V===void 0?void 0:V.weekStartsOn)!==null&&rt!==void 0?rt:0);if(!(Q>=0&&Q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!F.localize)throw new RangeError("locale must contain localize property");if(!F.formatLong)throw new RangeError("locale must contain formatLong property");var G=(0,a.default)(M);if(!(0,i.default)(G))throw new RangeError("Invalid time value");var vt=(0,l.default)(G),dt=(0,r.default)(G,vt),It={firstWeekContainsDate:L,weekStartsOn:Q,locale:F,_originalDate:G},Dt=Z.match(x).map(function(ot){var zt=ot[0];if(zt==="p"||zt==="P"){var Gt=o.default[zt];return Gt(ot,F.formatLong)}return ot}).join("").match(p).map(function(ot){if(ot==="''")return"'";var zt=ot[0];if(zt==="'")return w(ot);var Gt=s.default[zt];if(Gt)return!(k!=null&&k.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(ot)&&(0,c.throwProtectedError)(ot,C,String(M)),!(k!=null&&k.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(ot)&&(0,c.throwProtectedError)(ot,C,String(M)),Gt(dt,ot,F.localize,It);if(zt.match(v))throw new RangeError("Format string contains an unescaped latin alphabet character `"+zt+"`");return ot}).join("");return Dt}function w(M){var C=M.match(m);return C?C[1].replace(b,"'"):M}n.exports=t.default})(Ls,Ls.exports);var m_=Ls.exports;const y_=Fn(m_);function Td(n,t,e){var i=x_(n,e.timeZone,e.locale);return i.formatToParts?b_(i,t):v_(i,t)}function b_(n,t){for(var e=n.formatToParts(t),i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function v_(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function x_(n,t,e){if(e&&!e.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function __(n,t){var e=M_(t);return e.formatToParts?T_(e,n):D_(e,n)}var w_={year:0,month:1,day:2,hour:3,minute:4,second:5};function T_(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=w_[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function D_(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var mo={};function M_(n){if(!mo[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";mo[n]=e?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"}):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"})}return mo[n]}function Dd(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Md=36e5,S_=6e4,yo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function bo(n,t,e){var i,r;if(!n||(i=yo.timezoneZ.exec(n),i))return 0;var a;if(i=yo.timezoneHH.exec(n),i)return a=parseInt(i[1],10),Sd(a)?-(a*Md):NaN;if(i=yo.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return Sd(a,s)?(r=Math.abs(a)*Md+s*S_,a>0?-r:r):NaN}if(O_(n)){t=new Date(t||Date.now());var o=e?t:C_(t),l=vo(o,n),c=e?l:k_(t,l,n);return-c}return NaN}function C_(n){return Dd(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function vo(n,t){var e=__(n,t),i=Dd(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function k_(n,t,e){var i=n.getTime(),r=i-t,a=vo(new Date(r),e);if(t===a)return t;r-=a-t;var s=vo(new Date(r),e);return a===s?a:Math.max(a,s)}function Sd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Cd={};function O_(n){if(Cd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Cd[n]=!0,!0}catch{return!1}}var P_=60*1e3,E_={X:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);if(r===0)return"Z";switch(t){case"X":return kd(r);case"XXXX":case"XX":return ri(r);case"XXXXX":case"XXX":default:return ri(r,":")}},x:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);switch(t){case"x":return kd(r);case"xxxx":case"xx":return ri(r);case"xxxxx":case"xxx":default:return ri(r,":")}},O:function(n,t,e,i){var r=xo(i.timeZone,i._originalDate||n);switch(t){case"O":case"OO":case"OOO":return"GMT"+A_(r,":");case"OOOO":default:return"GMT"+ri(r,":")}},z:function(n,t,e,i){var r=i._originalDate||n;switch(t){case"z":case"zz":case"zzz":return Td("short",r,i);case"zzzz":default:return Td("long",r,i)}}};function xo(n,t){var e=n?bo(n,t,!0)/P_:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Jr(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}function ri(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=Jr(Math.floor(r/60),2),s=Jr(Math.floor(r%60),2);return i+a+e+s}function kd(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Jr(Math.abs(n)/60,2)}return ri(n,t)}function A_(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+Jr(a,2)}const R_=E_;var L_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,_o=36e5,Od=6e4,I_=2,se={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:L_};function Pd(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?I_:Wx(e.additionalDigits);if(i!==2&&i!==1&&i!==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(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=N_(n),a=F_(r.date,i),s=a.year,o=a.restDateString,l=U_(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=B_(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=bo(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=wd(new Date(c+u)),d=wd(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function N_(n){var t={},e=se.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=se.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=se.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function F_(n,t){var e=se.YYY[t],i=se.YYYYY[t],r;if(r=se.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=se.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function U_(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=se.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,Rd(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=se.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return z_(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=se.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Rd(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=se.Www.exec(n),e)return a=parseInt(e[1],10)-1,Ld(t,a)?Ed(t,a):new Date(NaN);if(e=se.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Ld(t,a,l)?Ed(t,a,l):new Date(NaN)}return null}function B_(n){var t,e,i;if(t=se.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),wo(e)?e%24*_o:NaN;if(t=se.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),wo(e,i)?e%24*_o+i*Od:NaN;if(t=se.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return wo(e,i,r)?e%24*_o+i*Od+r*1e3:NaN}return null}function Ed(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Y_=[31,28,31,30,31,30,31,31,30,31,30,31],W_=[31,29,31,30,31,30,31,31,30,31,30,31];function Ad(n){return n%400===0||n%4===0&&n%100!==0}function Rd(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=Ad(n);if(i&&e>W_[t]||!i&&e>Y_[t])return!1}return!0}function z_(n,t){if(t<1)return!1;var e=Ad(n);return!(e&&t>366||!e&&t>365)}function Ld(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function wo(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var H_=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function To(n,t,e){var i=String(t),r=e||{},a=i.match(H_);if(a){var s=Pd(n,r);i=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+R_[l[0]](s,l,null,r)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},i)}return y_(n,i,r)}var Do={exports:{}},Mo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(Mo,Mo.exports);var $_=Mo.exports;(function(n,t){var e=Yt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e($_);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Do,Do.exports);var j_=Do.exports;const V_=Fn(j_);function q_(n,t,e){var i=Pd(n,e),r=bo(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function X_(n,t,e,i){var r=V_(i);return r.timeZone=t,To(q_(n,t),e,r)}const Id=2,Nd=10,Fd=12,ta=new Intl.NumberFormat(((uh=document==null?void 0:document.documentElement)==null?void 0:uh.lang)||"en-US");function ea(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 r=new Date(n);return X_(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const na=10,De=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ai=(n,t)=>(t||De)[n%De.length],Ji=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),r=parseInt(n.substring(4,6),16);e=e-t,i=i-t,r=r-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${a}${s}${o}`},Ud="#6f7787",G_={lineTension:.4,borderWidth:2,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},So=new Map,Co=(n,t)=>t==="bytes"?_s(n):t==="count/minute"?n.toFixed(2):ta.format(n),Bd=n=>{const e=document.createElement("canvas").getContext("2d"),i=Et({});return e.font=i.string,e.measureText(n).width},K_=()=>{const n="label_height";if(!So.has(n)){const t=Et({});So.set(n,t.lineHeight)}return So.get(n)},Z_=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,r)=>isNaN(r)?i:i+r,0),0),Yd=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),Wd=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`;function Q_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};Wr.positioners.barChartTooltipPosition=function(r,a){if(!r.length)return!1;const s=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=s.width/2,c=Rs(a,o,l),u=a.y,d=a.x<l?"left":"center";return{x:c-n.tooltipState.offsetX,y:u-n.tooltipState.offsetY,xAlign:d}},is.modes.customInteractionMode=function(r,a){const s=fn(a,r),o=[];return is.evaluateInteractionItems(r,r.options.indexAxis||"x",s,(l,c,u)=>{r.options.indexAxis==="y"&&l.inYRange(s.y,!0)&&r.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),r.options.indexAxis==="x"&&l.inXRange(s.x,!0)&&r.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?Nd:Fd;return h.computed(()=>{var r,a,s,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(f,g){const p=this;if(p.chart.options.indexAxis===p.axis){f=p.getLabelForValue(g);const x=10;return f&&f.length>x?f.slice(0,x)+"...":f}return p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="y"?!it((r=n.metricAxesTitle)==null?void 0:r.value):!it((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(s=n.metricAxesTitle)==null?void 0:s.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:20},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(f,g){const p=this;return p.chart.options.indexAxis===p.axis?(f=p.getLabelForValue(g),f&&f.length>na?f.slice(0,na)+"...":f):p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="x"?!it((l=n.metricAxesTitle)==null?void 0:l.value):!it((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:f=>{As(n.tooltipState,f)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Te.register(...Sy);const J_=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,a)=>r===i[a])};function tw(n,t,e,i,r){const a=h.shallowRef(null),s=(o,l)=>{if(t.value)return new Te(t.value,{type:n,data:o,plugins:i,options:l})};return h.onMounted(()=>{a.value=s(e.value,r.value)}),h.onBeforeUnmount(()=>{it(a.value)||a.value.destroy()}),h.watch(e,(o,l)=>{if(J_(l,o)&&!it(a.value)){for(const[c,u]of o.datasets.entries())Object.assign(a.value.data.datasets[c],u);a.value.data.labels=o.labels,a.value.update()}else it(a.value)||a.value.destroy(),a.value=s(o,r.value)}),h.watch(t,()=>{it(a.value)||a.value.destroy(),a.value=s(e.value,r.value)}),h.watch(r,(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))&&(it(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var zd={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,x){x&&x%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,r=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?r:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,i,u)+"k":c<s?d=e(c,a,u)+"m":c<o?d=t(e(c,s,u),u)+"b":d=t(e(c,o,u),u)+"t",f&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(zd);var ew=zd.exports;const tr=Fn(ew);function nw(n,t,e){const{i18n:i}=St.useI18n(),{translateUnit:r}=St.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((s,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":_s(l);else{const u=r(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:tr(l,{capital:!0}),unit:u})||`${tr(l,{capital:!0})} ${e.value}`}return{...s,[o.label]:{raw:l,formatted:c}}},{}))}}function iw(n){return h.computed(()=>{var r,a,s;if(!((r=n.value)!=null&&r.meta))return"";const e="startMs"in n.value.meta?n.value.meta.startMs:((a=n.value.meta)==null?void 0:a.start)*1e3||"",i="endMs"in n.value.meta?n.value.meta.endMs:((s=n.value.meta)==null?void 0:s.end)*1e3||"";return e&&i?`${ea(e)} - ${ea(i,{includeTZ:!0})}`:""})}function rw(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Wr.positioners.doughnutChartTooltipPosition=function(i,r){if(!i.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=Rs(r,s,o),c=r.y,u=r.x<o?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{As(n.tooltipState,i)}}}}))}}var aw=Object.defineProperty,sw=(n,t,e)=>t in n?aw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Ye=(n,t,e)=>(sw(n,typeof t!="symbol"?t+"":t,e),e),st=(n=>(n.MINUTELY="Minutely",n.HOURLY="Hourly",n.DAILY="Daily",n.WEEKLY="Weekly",n))(st||{}),Wt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(Wt||{});function ko(n){"@babel/helpers - typeof";return ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ko(n)}function ia(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function We(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function si(n){We(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||ko(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Hd(n,t){We(2,arguments);var e=si(n),i=ia(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function ow(n,t){We(2,arguments);var e=si(n),i=ia(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}var lw={};function cw(){return lw}function ra(n,t){var e,i,r,a,s,o,l,c;We(1,arguments);var u=cw(),d=ia((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=si(n),g=f.getDay(),p=(g<d?7:0)+g-d;return f.setDate(f.getDate()-p),f.setHours(0,0,0,0),f}function $d(n){We(1,arguments);var t=si(n);return t.setHours(0,0,0,0),t}var uw=60,dw=3600;function oi(n){We(1,arguments);var t=si(n);return t.setDate(1),t.setHours(0,0,0,0),t}function fw(n){We(1,arguments);var t=si(n),e=t.getFullYear(),i=t.getMonth(),r=new Date(0);return r.setFullYear(e,i+1,0),r.setHours(0,0,0,0),r.getDate()}function hw(n){return We(1,arguments),Math.floor(n*dw)}function gw(n){We(1,arguments);var t=n/uw;return Math.floor(t)}function jd(n,t){We(2,arguments);var e=ia(t);return ow(n,-e)}function Oo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Vd={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Vd);var pw=Vd.exports,Po={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Po,Po.exports);var mw=Po.exports;const yw=Oo(mw);var Eo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(Eo,Eo.exports);var bw=Eo.exports;const qd=Oo(bw);function vw(n,t){var e=Tw(t);return e.formatToParts?_w(e,n):ww(e,n)}var xw={year:0,month:1,day:2,hour:3,minute:4,second:5};function _w(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=xw[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function ww(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var Ao={};function Tw(n){if(!Ao[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="06/25/2014 00:00:00";Ao[n]=e?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"}):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"})}return Ao[n]}function Ro(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Xd=36e5,Dw=6e4,Lo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function aa(n,t,e){var i,r;if(!n||(i=Lo.timezoneZ.exec(n),i))return 0;var a;if(i=Lo.timezoneHH.exec(n),i)return a=parseInt(i[1],10),Gd(a)?-(a*Xd):NaN;if(i=Lo.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return Gd(a,s)?(r=Math.abs(a)*Xd+s*Dw,a>0?-r:r):NaN}if(Cw(n)){t=new Date(t||Date.now());var o=e?t:Mw(t),l=Io(o,n),c=e?l:Sw(t,l,n);return-c}return NaN}function Mw(n){return Ro(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Io(n,t){var e=vw(n,t),i=Ro(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function Sw(n,t,e){var i=n.getTime(),r=i-t,a=Io(new Date(r),e);if(t===a)return t;r-=a-t;var s=Io(new Date(r),e);return a===s?a:Math.max(a,s)}function Gd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Kd={};function Cw(n){if(Kd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Kd[n]=!0,!0}catch{return!1}}var kw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Zd=kw;var No=36e5,Qd=6e4,Ow=2,oe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Zd};function Fo(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?Ow:yw(e.additionalDigits);if(i!==2&&i!==1&&i!==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(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=Pw(n),a=Ew(r.date,i),s=a.year,o=a.restDateString,l=Aw(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=Rw(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=aa(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=qd(new Date(c+u)),d=qd(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Pw(n){var t={},e=oe.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=oe.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=oe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Ew(n,t){var e=oe.YYY[t],i=oe.YYYYY[t],r;if(r=oe.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=oe.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Aw(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=oe.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,ef(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=oe.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Nw(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=oe.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return ef(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=oe.Www.exec(n),e)return a=parseInt(e[1],10)-1,nf(t,a)?Jd(t,a):new Date(NaN);if(e=oe.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return nf(t,a,l)?Jd(t,a,l):new Date(NaN)}return null}function Rw(n){var t,e,i;if(t=oe.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),Uo(e)?e%24*No:NaN;if(t=oe.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),Uo(e,i)?e%24*No+i*Qd:NaN;if(t=oe.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return Uo(e,i,r)?e%24*No+i*Qd+r*1e3:NaN}return null}function Jd(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Lw=[31,28,31,30,31,30,31,31,30,31,30,31],Iw=[31,29,31,30,31,30,31,31,30,31,30,31];function tf(n){return n%400===0||n%4===0&&n%100!==0}function ef(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=tf(n);if(i&&e>Iw[t]||!i&&e>Lw[t])return!1}return!0}function Nw(n,t){if(t<1)return!1;var e=tf(n);return!(e&&t>366||!e&&t>365)}function nf(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function Uo(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Bo={exports:{}},Yo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(Yo,Yo.exports);var Fw=Yo.exports;(function(n,t){var e=pw.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(Fw);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Bo,Bo.exports);var Uw=Bo.exports;const Bw=Oo(Uw);function Yw(n,t,e){var i=Fo(n,e),r=aa(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function Ww(n,t){return-aa(n,t)}function zw(n,t,e){if(typeof n=="string"&&!n.match(Zd)){var i=Bw(e);return i.timeZone=t,Fo(n,i)}var r=Fo(n,e),a=Ro(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()).getTime(),s=aa(t,new Date(a));return new Date(a+s)}const Hw={[st.MINUTELY]:60*1e3,[st.HOURLY]:60*60*1e3,[st.DAILY]:60*60*24*1e3,[st.WEEKLY]:60*60*24*7*1e3};function er(n){return n&&Object.values(st).find(t=>n<=Hw[t])||null}const li=(n,t)=>new Date(n.getTime()-Ww(t,n));class Pe{constructor(t){Ye(this,"timeframeText"),Ye(this,"key"),Ye(this,"display"),Ye(this,"timeframeLength"),Ye(this,"allowedTiers"),Ye(this,"defaultResponseGranularity"),Ye(this,"dataGranularity"),Ye(this,"isRelative"),Ye(this,"_startCustom"),Ye(this,"_endCustom"),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}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(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add(st.MINUTELY),e>=2&&e<=7*24&&t.add(st.HOURLY),e>=2*24&&t.add(st.DAILY),e>=2*24*14&&t.add(st.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const e=zw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Yw(e,t)}}class $w extends Pe{rawStart(t){let e=ra(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=li(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class jw extends Pe{rawStart(t){let e=oi(this.tzAdjustedDate(t));return t&&(e=li(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class Vw extends Pe{rawEnd(t){let e=ra(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=li(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=ra(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=li(i,t)),i}}class qw extends Pe{rawEnd(t){let e=oi(this.tzAdjustedDate(t));return t&&(e=li(e,t)),e}rawStart(t){let e=oi(jd(this.tzAdjustedDate(t),1));return t&&(e=li(e,t)),e}}Wt.FIFTEEN_MIN,new Pe({key:Wt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:st.MINUTELY,dataGranularity:st.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.ONE_HOUR,new Pe({key:Wt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:st.MINUTELY,dataGranularity:st.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.SIX_HOUR,new Pe({key:Wt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:st.HOURLY,dataGranularity:st.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.TWELVE_HOUR,new Pe({key:Wt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:st.HOURLY,dataGranularity:st.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.ONE_DAY,new Pe({key:Wt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:st.HOURLY,dataGranularity:st.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Wt.SEVEN_DAY,new Pe({key:Wt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Wt.THIRTY_DAY,new Pe({key:Wt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Wt.CURRENT_WEEK,new $w({key:Wt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=ra(new Date,{weekStartsOn:1});return($d(Hd(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Wt.CURRENT_MONTH,new jw({key:Wt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=oi(new Date);return($d(Hd(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Wt.PREVIOUS_WEEK,new Vw({key:Wt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),Wt.PREVIOUS_MONTH,new qw({key:Wt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=oi(new Date),e=oi(jd(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Xw(t,e)),60*60*24*fw(new Date().setMonth(new Date().getMonth()-1))+hw(n)},defaultResponseGranularity:st.DAILY,dataGranularity:st.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]});function Xw(n,t){return gw(n.getTimezoneOffset()-t.getTimezoneOffset())}function Gw(n){const t=h.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!it((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:20},font:{weight:"bold"}}}}),e=h.computed(()=>{var l,c;return{title:{display:!it((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:20},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};Wr.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,x=Rs(c,d,g);let m=Fx(c,f,p);const b=c.y<p?"top":"bottom",v=c.x<g?"left":"center";return f>u.height&&(m=0),{x,y:m,xAlign:v,yAlign:b}};const r=h.computed(()=>{switch(n.granularity.value){case st.MINUTELY:return"minute";case st.HOURLY:return"hour";case st.DAILY:return"day";default:return"day"}}),a=h.computed(()=>n.timeRangeMs?px(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm":Ex(Number(n.timeRangeSec.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=h.computed(()=>[st.DAILY,st.WEEKLY].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:h.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:r.value,displayFormats:{minute:"h:mm:ss a",hour:a.value,day:s.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:l=>{As(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function Kw(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:r,pivotRecords:a,rowLabels:s,colorPalette:o}=n,{i18n:l}=St.useI18n();return t?i.map(c=>({label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:ai(i.indexOf(c),De),data:s.map((u,d)=>e?a[`${u},${c}`]||0:a[`${d},${c}`]||null)})):Array.from(r).flatMap((c,u)=>{if(!c)return[];const d=Array.isArray(o)?ai(u,o):o[c]||ai(u);return{label:l&&l.te(`chartLabels.${c}`)&&l.t(`chartLabels.${c}`)||c,backgroundColor:d,data:s.map(f=>a[`${f},${c}`]||null)}})}function Zw(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o=a&&Object.keys(a),l=s&&s.length>1,c=a&&o&&(o.length===1?o[0]!=="Organization":o.length>0);if(!r.length||!s)return{datasets:[],labels:[]};const u=c&&o||s,d=u[0],f=u.length>1?u[1]:u[0],g=Object.fromEntries(l?r.flatMap(b=>s.map((v,_)=>{const w=b.event[d],M=c?`${w},${v}`:`${_},${v}`,C=b.event[v];return[M,C]})):r.map(b=>{const v=c?`${b.event[d]},${b.event[f]}`:`${d},${f}`,_=b.event[s[0]];return[v,_]})),p=c&&a[d]||s,x=c&&a[f]||s;return!p||!x?{labels:[],datasets:[]}:{labels:c?a[d].map(b=>e&&e.te(`chartLabels.${b}`)&&e.t(`chartLabels.${b}`)||b):s.map(b=>e&&e.te(`chartLabels.${b}`)&&e.t(`chartLabels.${b}`)||b),datasets:Kw({isMultiMetric:l,hasDimensions:c,metricNames:s,dimensionFieldNames:u,barSegmentLabels:x,pivotRecords:g,rowLabels:p,colorPalette:n.colorPalette||De})}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const Qw=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),Jw=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return fd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},t1=(n,t,e,i,r)=>{const s=Math.max(t-6e4,Math.max(...(r||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((s-i)/e)*e+i+e;return Qw(o,l,e)};function e1(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o="startMs"in t.value.meta?t.value.meta.startMs:t.value.meta.start*1e3,l="endMs"in t.value.meta?t.value.meta.endMs:t.value.meta.end*1e3;if(!s)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=a&&Object.keys(a)||s,u=c&&c[0],d=a&&a[u]||s,f=t.value.meta.granularity;if(typeof f!="number"||isNaN(f)||!isFinite(f)||f===0)return console.error("Invalid step value:",f),{datasets:[]};if(!r.length)return{datasets:[]};const g=Jw(o),p=t1(o,l,f,g,r),x=new Set,m=r!=null&&r.length?r.reduce((w,M)=>{const C=new Date(M.timestamp).valueOf(),k=M.event;for(const T of s)x.add(T),C in w||(w[C]={}),T in w[C]||(w[C][T]={});for(const T of s)d.forEach(D=>{k[u]===D||T===D?(w[C][T]||(w[C][T]={}),w[C][T][D]=Math.round(Number(k[T])*1e3)/1e3):c.length||(w[C][T]||(w[C][T]={}),w[C][T][D]=Math.round(Number(k[D])*1e3)/1e3)});return w},{}):{},b=s.length===1?s.flatMap(w=>d.map(M=>[w,M])):d.map(w=>[w,w]),v={},_=[...b].map(([w,M],C)=>{const k=p.map(A=>A in m&&w in m[A]?{x:A,y:m[A][w][M]||0}:{x:A,y:0});let{colorPalette:T,fill:D}=n;it(T)&&(T=De);const O=Array.isArray(T)?ai(C,T):T[M]||ai(C),E=Ji(O,50);return v[M]=O,{rawDimension:M,rawMetric:w,label:e&&e.te(`chartLabels.${M}`)&&e.t(`chartLabels.${M}`)||M,borderColor:E,backgroundColor:O,data:k,total:k.reduce((A,{y:R})=>A+Number(R),0),...G_,fill:D}});return _.sort((w,M)=>Number(w.total)<Number(M.total)?-1:1),{datasets:_,colorMap:v}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const n1=(n,t)=>{h.watch([n,t],(e,i,r)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})};function i1(){const{i18n:n}=St.useI18n();return{translateUnit:(e,i)=>{const r=i===1,a=`chartUnits.${e}`;return n.te(a)?n.t(a,{plural:r?"":"s"}):e}}}const St={useBarChartOptions:Q_,useChartJSCommon:tw,useChartLegendValues:nw,useChartSelectedRange:iw,useExploreResultToDatasets:Zw,useExploreResultToTimeDataset:e1,useDoughnutChartOptions:rw,useLinechartOptions:Gw,useI18n:Mh,useReportChartDataForSynthetics:n1,useTranslatedUnits:i1};/*!
|
|
20
20
|
* chartjs-plugin-annotation v3.0.1
|
|
21
21
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
22
22
|
* (c) 2023 chartjs-plugin-annotation Contributors
|
|
23
23
|
* Released under the MIT License
|
|
24
|
-
*/const rf={modes:{point(n,t){return sa(n,t,{intersect:!0})},nearest(n,t,e){return a1(n,t,e)},x(n,t,e){return sa(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return sa(n,t,{intersect:e.intersect,axis:"y"})}}};function Wo(n,t,e){return(rf.modes[e.mode]||rf.modes.nearest)(n,t,e)}function i1(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function r1(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function sa(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):i1(i,t,e.axis))}function a1(n,t,e){let i=Number.POSITIVE_INFINITY;return sa(n,t,e).reduce((r,a)=>{const s=a.getCenterPoint(),o=r1(t,s,e.axis),l=Gn(t,o);return l<i?(r=[a],i=l):l===i&&r.push(a),r},[]).sort((r,a)=>r._index-a._index).slice(0,1)}const s1=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Yn=.001,oa=(n,t,e)=>Math.min(e,Math.max(t,n));function o1(n,t,e){for(const i of Object.keys(n))n[i]=oa(n[i],t,e);return n}function l1(n,t,e,i){if(!n||!t||e<=0)return!1;const r=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+r,2)}function af(n,{x:t,y:e,x2:i,y2:r},a,s){const o=s/2,l=n.x>=t-o-Yn&&n.x<=i+o+Yn,c=n.y>=e-o-Yn&&n.y<=r+o+Yn;return a==="x"?l:(a==="y"||l)&&c}function ci(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function c1(n,t,e,i=!0){const r=e.split(".");let a=0;for(const s of t.split(".")){const o=r[a++];if(parseInt(s,10)<parseInt(o,10))break;if(s1(o,s)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const sf=n=>typeof n=="string"&&n.endsWith("%"),of=n=>parseFloat(n)/100,lf=n=>oa(of(n),0,1),la=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),u1={box:n=>la(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>la(n.centerX,n.centerY),line:n=>la(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>la(n.centerX,n.centerY)};function zo(n,t){return t==="start"?0:t==="end"?n:sf(t)?lf(t)*n:n/2}function bn(n,t,e=!0){return typeof t=="number"?t:sf(t)?(e?lf(t):of(t))*n:n}function d1(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Ho(n,t="center"){return lt(n)?{x:nt(n.x,t),y:nt(n.y,t)}:(n=nt(n,t),{x:n,y:n})}function cf(n){return n&&(ue(n.xValue)||ue(n.yValue))}function nr(n,t,e){const i=e.init;if(i){if(i===!0)return df(t,e)}else return;return f1(n,t,e)}function uf(n,t,e){let i=!1;return t.forEach(r=>{de(n[r])?(i=!0,e[r]=n[r]):ue(e[r])&&delete e[r]}),i}function df(n,t){const e=t.type||"line";return u1[e](n)}function f1(n,t,e){const i=_t(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return df(t,e);if(lt(i))return i}const $o=new Map,h1=n=>isNaN(n)||n<=0,g1=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ca(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function jo(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(qt(i)),n.translate(-t,-e))}function vn(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function ui(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Vo(n,t){const e=t.content;if(ca(e))return{width:bn(e.width,t.width),height:bn(e.height,t.height)};const i=t.font,r=yt(i)?i.map(l=>Et(l)):[Et(i)],a=t.textStrokeWidth,s=yt(e)?e:[e],o=s.join()+g1(r)+a+(n._measureText?"-spriting":"");return $o.has(o)||$o.set(o,v1(n,s,r,a)),$o.get(o)}function ff(n,t,e){const{x:i,y:r,width:a,height:s}=t;n.save(),ui(n,e);const o=vn(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Kn(n,{x:i,y:r,w:a,h:s,radius:o1(un(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function p1(n,t,e){const i=e.content;if(ca(i)){n.save(),n.globalAlpha=w1(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}const r=yt(i)?i:[i],a=e.font,s=yt(a)?a.map(d=>Et(d)):[Et(a)],o=e.color,l=yt(o)?o:[o],c=d1(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,m1(n,e)&&x1(n,{x:c,y:u},r,s),_1(n,{x:c,y:u},r,{fonts:s,colors:l}),n.restore()}function m1(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function y1(n,t,e,i){const{radius:r,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Ia;if(ca(s)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}h1(r)||b1(n,{x:e,y:i,radius:r,rotation:o,style:s,rad:l})}function b1(n,{x:t,y:e,radius:i,rotation:r,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,i,0,kt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=mr,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=mr,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(s+we)*c,l=Math.sin(s+we)*c,n.arc(t-o,e-l,u,s-ut,s-Pt),n.arc(t+l,e-o,u,s-Pt,s),n.arc(t+o,e+l,u,s,s+Pt),n.arc(t-l,e+o,u,s+Pt,s+ut),n.closePath();break;case"rect":if(!r){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}s+=we;case"rectRot":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":s+=we;case"cross":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),s+=we,o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(s)*i,e+Math.sin(s)*i);break}n.fill()}function v1(n,t,e,i){n.save();const r=t.length;let a=0,s=i;for(let o=0;o<r;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];a=Math.max(a,n.measureText(c).width+i),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function x1(n,{x:t,y:e},i,r){n.beginPath();let a=0;i.forEach(function(s,o){const l=r[Math.min(o,r.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function _1(n,{x:t,y:e},i,{fonts:r,colors:a}){let s=0;i.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+s),s+=d,n.fill()})}function w1(n,t){const e=cn(n)?n:t;return cn(e)?oa(e,0,1):1}const hf={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function di(n,t,e){return t=typeof t=="number"?t:n.parse(t),Lt(t)?n.getPixelForValue(t):e}function Wn(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===r);return a.length?a[0].id:r}function gf(n,t){if(n){const e=n.options.reverse,i=di(n,t.min,e?t.end:t.start),r=di(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function pf(n,t){const{chartArea:e,scales:i}=n,r=i[Wn(i,t,"xScaleID")],a=i[Wn(i,t,"yScaleID")];let s=e.width/2,o=e.height/2;return r&&(s=di(r,t.xValue,r.left+r.width/2)),a&&(o=di(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function qo(n,t){const e=n.scales,i=e[Wn(e,t,"xScaleID")],r=e[Wn(e,t,"yScaleID")];if(!i&&!r)return{};let{left:a,right:s}=i||n.chartArea,{top:o,bottom:l}=r||n.chartArea;const c=bf(i,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=bf(r,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:a,y:o,x2:s,y2:l,width:s-a,height:l-o,centerX:a+(s-a)/2,centerY:o+(l-o)/2}}function mf(n,t){if(!cf(t)){const e=qo(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-i,y:s-i,x2:a+i,y2:s+i,centerX:a,centerY:s,width:r,height:r,radius:i}}return D1(n,t)}function T1(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],a={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?M1(r,a,t):S1(e,a,t),a}function yf(n,t){const e=qo(n,t);return e.initProperties=nr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:O1(n,e,t),initProperties:e.initProperties}],e}function D1(n,t){const e=pf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function bf(n,t){const e=gf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function M1(n,t,e){const i=di(n,e.value,NaN),r=di(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function S1(n,t,e){for(const i of Object.keys(hf)){const r=n[Wn(n,e,i)];if(r){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=hf[i],d=gf(r,{min:e[a],max:e[s],start:r[o],end:r[l]});t[c]=d.start,t[u]=d.end}}}function C1({properties:n,options:t},e,i,r){const{x:a,x2:s,width:o}=n;return vf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function k1({properties:n,options:t},e,i,r){const{y:a,y2:s,height:o}=n;return vf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function vf(n,t){const{start:e,end:i,borderWidth:r}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=i-r-e-s-o-t.size;return e+r/2+l+zo(c,a)}function O1(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Ho(i.position),a=Xt(i.padding),s=Vo(n.ctx,i),o=C1({properties:t,options:e},s,r,a),l=k1({properties:t,options:e},s,r,a),c=s.width+a.width,u=s.height+a.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}function zn(n,t,e){const i=Math.cos(e),r=Math.sin(e),a=t.x,s=t.y;return{x:a+i*(n.x-a)-r*(n.y-s),y:s+r*(n.x-a)+i*(n.y-s)}}const Xo=["enter","leave"],Go=Xo.concat("click");function P1(n,t,e){t.listened=uf(e,Go,t.listeners),t.moveListened=!1,t._getElements=Wo,Xo.forEach(i=>{de(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&de(i.click)&&(t.listened=!0),t.moveListened||Xo.forEach(r=>{de(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function E1(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return A1(n,t,e);case"click":return R1(n,t,e)}}function A1(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Wo(n,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const a={state:n,event:t};let s=xf(a,"leave",r,i);return xf(a,"enter",i,r)||s}function xf({state:n,event:t},e,i,r){let a;for(const s of i)r.indexOf(s)<0&&(a=_f(s.options[e]||n.listeners[e],s,t)||a);return a}function R1(n,t,e){const i=n.listeners,r=Wo(n,t,e.interaction);let a;for(const s of r)a=_f(s.options.click||i.click,s,t)||a;return a}function _f(n,t,e){return _t(n,[t.$context,e])===!0}const ua=["afterDraw","beforeDraw"];function L1(n,t,e){const i=t.visibleElements;t.hooked=uf(e,ua,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ua.forEach(a=>{de(r.options[a])&&(t.hooked=!0)})})}function wf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return _t(i,[t.$context])}}function I1(n,t,e){const i=Y1(n.scales,t,e);let r=Tf(t,i,"min","suggestedMin");r=Tf(t,i,"max","suggestedMax")||r,r&&de(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function N1(n,t){for(const e of n)U1(e,t)}function Tf(n,t,e,i){if(Lt(t[e])&&!F1(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function F1(n,t,e){return ue(n[t])||ue(n[e])}function U1(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Wn(t,n,e);i&&!t[i]&&B1(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function B1(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ue(n[e+i]))return!0;return!1}function Y1(n,t,e){const i=t.axis,r=t.id,a=i+"ScaleID",s={min:nt(t.min,Number.NEGATIVE_INFINITY),max:nt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===r?Df(o,t,["value","endValue"],s):Wn(n,o,a)===r&&Df(o,t,[i+"Min",i+"Max",i+"Value"],s);return s}function Df(n,t,e,i){for(const r of e){const a=n[r];if(ue(a)){const s=t.parse(a);i.min=Math.min(i.min,s),i.max=Math.max(i.max,s)}}}class fi extends te{inRange(t,e,i,r){const{x:a,y:s}=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.options.rotation));return af({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return ci(this,t)}draw(t){t.save(),jo(t,this.getCenterPoint(),this.options.rotation),ff(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return yf(t,e)}}fi.id="boxAnnotation",fi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},fi.defaultRoutes={borderColor:"color",backgroundColor:"color"},fi.descriptors={label:{_fallback:!0}};const Mf=["left","bottom","top","right"];class ir extends te{inRange(t,e,i,r){const{x:a,y:s}=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.rotation));return af({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return ci(this,t)}draw(t){const e=this.options,i=!ue(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),jo(t,this.getCenterPoint(),this.rotation),z1(t,this),ff(t,this,e),p1(t,G1(this),e),t.restore())}resolveElementProperties(t,e){let i;if(cf(e))i=pf(t,e);else{const{centerX:o,centerY:l}=qo(t,e);i={x:o,y:l}}const r=Xt(e.padding),a=Vo(t.ctx,e),s=W1(i,a,e,r);return{initProperties:nr(t,s,e),pointX:i.x,pointY:i.y,...s,rotation:e.rotation}}}ir.id="labelAnnotation",ir.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ir.defaultRoutes={borderColor:"color"};function W1(n,t,e,i){const r=t.width+i.width+e.borderWidth,a=t.height+i.height+e.borderWidth,s=Ho(e.position,"center"),o=Sf(n.x,r,e.xAdjust,s.x),l=Sf(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+r,y2:l+a,width:r,height:a,centerX:o+r/2,centerY:l+a/2}}function Sf(n,t,e=0,i){return n-zo(t,i)+e}function z1(n,t){const{pointX:e,pointY:i,options:r}=t,a=r.callout,s=a&&a.display&&q1(t,a);if(!s||K1(t,a,s))return;if(n.save(),n.beginPath(),!vn(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=H1(t,s),{sideStart:u,sideEnd:d}=j1(t,s,l);(a.margin>0||r.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const f=zn({x:e,y:i},t.getCenterPoint(),qt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function H1(n,t){const{x:e,y:i,x2:r,y2:a}=n,s=$1(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:i},l={x:o.x,y:a}):(o={x:e,y:i+s},l={x:r,y:o.y}),{separatorStart:o,separatorEnd:l}}function $1(n,t){const{width:e,height:i,options:r}=n,a=r.callout.margin+r.borderWidth/2;return t==="right"?e+a:t==="bottom"?i+a:-a}function j1(n,t,e){const{y:i,width:r,height:a,options:s}=n,o=s.callout.start,l=V1(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+bn(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+bn(r,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function V1(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function q1(n,t){const e=t.position;return Mf.includes(e)?e:X1(n,t)}function X1(n,t){const{x:e,y:i,x2:r,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,v=bn(s,p),m=bn(o,p),y=[e,e+v,e+v,r],x=[i+m,a,i,a],_=[];for(let w=0;w<4;w++){const M=zn({x:y[w],y:x[w]},g,qt(f));_.push({position:Mf[w],distance:Gn(M,{x:l,y:c})})}return _.sort((w,M)=>w.distance-M.distance)[0].position}function G1({x:n,y:t,width:e,height:i,options:r}){const a=r.borderWidth/2,s=Xt(r.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-r.borderWidth,height:i-s.top-s.bottom-r.borderWidth}}function K1(n,t,e){const{pointX:i,pointY:r}=n,a=t.margin;let s=i,o=r;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ko=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Zo=(n,t,e)=>Ko(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Cf=(n,t,e)=>Ko(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,rr=n=>n*n,Z1=(n,t,{x:e,y:i,x2:r,y2:a},s)=>s==="y"?{start:Math.min(i,a),end:Math.max(i,a),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},kf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Qo=(n,t,e,i)=>({x:kf(n.x,t.x,e.x,i),y:kf(n.y,t.y,e.y,i)}),Of=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Pf=(n,t,e,i)=>-Math.atan2(Of(n.x,t.x,e.x,i),Of(n.y,t.y,e.y,i))+.5*ut;class ar extends te{inRange(t,e,i,r){const a=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){vn(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(o,d,f)||Jo(this,s,r);return l.restore(),g}const c=rr(a);return eT(this,s,c,r)||Jo(this,s,r)}return Q1(this,{mouseX:t,mouseY:e},i,{hBorderWidth:a,useFinalPosition:r})}getCenterPoint(t){return ci(this,t)}draw(t){const{x:e,y:i,x2:r,y2:a,cp:s,options:o}=this;if(t.save(),!vn(t,o))return t.restore();ui(t,o);const l=Math.sqrt(Math.pow(r-e,2)+Math.pow(a-i,2));if(o.curve&&s)return cT(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=If(this),g=Math.atan2(a-i,r-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),tl(t,0,d,c),tl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=T1(t,e),{x:r,y:a,x2:s,y2:o}=i,l=J1(i,t.chartArea),c=l?tT({x:r,y:a},{x:s,y:o},t.chartArea):{x:r,y:a,x2:s,y2:o,width:Math.abs(s-r),height:Math.abs(o-a)};if(c.centerX=(s+r)/2,c.centerY=(o+a)/2,c.initProperties=nr(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=lT(c,e,Gn(d,f))}const u=nT(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}ar.id="lineAnnotation";const Ef={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ar.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Ef),fill:!1,length:12,start:Object.assign({},Ef),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},ir.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ar.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},ar.defaultRoutes={borderColor:"color"};function Q1(n,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:a}){const s=Z1(t,e,n.getProps(["x","y","x2","y2"],a),i);return s.value>=s.start-r&&s.value<=s.end+r||Jo(n,{mouseX:t,mouseY:e},a,i)}function J1({x:n,y:t,x2:e,y2:i},{top:r,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<r&&i<r||t>s&&i>s)}function Af({x:n,y:t},e,{top:i,right:r,bottom:a,left:s}){return n<s&&(t=Cf(s,{x:n,y:t},e),n=s),n>r&&(t=Cf(r,{x:n,y:t},e),n=r),t<i&&(n=Zo(i,{x:n,y:t},e),t=i),t>a&&(n=Zo(a,{x:n,y:t},e),t=a),{x:n,y:t}}function tT(n,t,e){const{x:i,y:r}=Af(n,t,e),{x:a,y:s}=Af(t,n,e);return{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)}}function eT(n,{mouseX:t,mouseY:e},i=Yn,r){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],r),c=o-a,u=l-s,d=rr(c)+rr(u),f=d===0?-1:((t-a)*c+(e-s)*u)/d;let g,p;return f<0?(g=a,p=s):f>1?(g=o,p=l):(g=a+f*c,p=s+f*u),rr(t-g)+rr(e-p)<=i}function Jo(n,{mouseX:t,mouseY:e},i,r){const a=n.label;return a.options.display&&a.inRange(t,e,r,i)}function nT(n,t,e){const i=e.borderWidth,r=Xt(e.padding),a=Vo(n.ctx,e),s=a.width+r.width+i,o=a.height+r.height+i;return rT(t,e,{width:s,height:o,padding:r},n.chartArea)}function iT(n){const{x:t,y:e,x2:i,y2:r}=n,a=Math.atan2(r-e,i-t);return a>ut/2?a-ut:a<ut/-2?a+ut:a}function rT(n,t,e,i){const{width:r,height:a,padding:s}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?iT(n):qt(t.rotation),f=aT(r,a,d),g=sT(n,t,{labelSize:f,padding:s},i),p=n.cp?Qo(c,n.cp,u,g):Ko(c,u,g),v={size:f.w,min:i.left,max:i.right,padding:s.left},m={size:f.h,min:i.top,max:i.bottom,padding:s.top},y=Lf(p.x,v)+o,x=Lf(p.y,m)+l;return{x:y-r/2,y:x-a/2,x2:y+r/2,y2:x+a/2,centerX:y,centerY:x,pointX:p.x,pointY:p.y,width:r,height:a,rotation:yr(d)}}function aT(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function sT(n,t,e,i){let r;const a=oT(n,i);return t.position==="start"?r=Rf({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?r=1-Rf({w:n.x-n.x2,h:n.y-n.y2},e,t,a):r=zo(1,t.position),r}function Rf(n,t,e,i){const{labelSize:r,padding:a}=t,s=n.w*i.dx,o=n.h*i.dy,l=s>0&&(r.w/2+a.left-i.x)/s,c=o>0&&(r.h/2+a.top-i.y)/o;return oa(Math.max(l,c),0,.25)}function oT(n,t){const{x:e,x2:i,y:r,y2:a}=n,s=Math.min(r,a)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(r,a),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function Lf(n,t){const{size:e,min:i,max:r,padding:a}=t,s=e/2;return e>r-i?(r+i)/2:(i>=n-a-s&&(n=i+a+s),r<=n+a+s&&(n=r-a-s),n)}function If(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Nf(n,e),endAdjust:Nf(n,i)}}function Nf(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,a={x:e,y:i+r};return Math.abs(Zo(0,a,{x:0,y:r}))}function tl(n,t,e,i){if(!i||!i.display)return;const{length:r,width:a,fill:s,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-r)+e;n.beginPath(),ui(n,i),vn(n,i),n.moveTo(c,-a),n.lineTo(t+e,0),n.lineTo(c,a),s===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function lT(n,t,e){const{x:i,y:r,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-r,a-i),u=Ho(t.controlPoint,0),d={x:o+bn(e,u.x,!1),y:l+bn(e,u.y,!1)};return zn(d,{x:o,y:l},c)}function Ff(n,{x:t,y:e},{angle:i,adjust:r},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(i),tl(n,0,-r,a),n.restore())}function cT(n,t,e,i){const{x:r,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=If(t),g={x:r,y:a},p={x:s,y:o},v=Pf(g,e,p,0),m=Pf(g,e,p,1)-ut,y=Qo(g,e,p,d/i),x=Qo(g,e,p,1-f/i),_=new Path2D;n.beginPath(),_.moveTo(y.x,y.y),_.quadraticCurveTo(e.x,e.y,x.x,x.y),n.shadowColor=l.borderShadowColor,n.stroke(_),t.path=_,t.ctx=n,Ff(n,y,{angle:v,adjust:d},c),Ff(n,x,{angle:m,adjust:f},u)}class sr extends te{inRange(t,e,i,r){const a=this.options.rotation,s=this.options.borderWidth;if(i!=="x"&&i!=="y")return uT({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],r),d=s/2,f=i==="y"?{start:l,end:u}:{start:o,end:c},g=zn({x:t,y:e},this.getCenterPoint(r),qt(-a));return g[i]>=f.start-d-Yn&&g[i]<=f.end+d+Yn}getCenterPoint(t){return ci(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:a,options:s}=this;t.save(),jo(t,this.getCenterPoint(),s.rotation),ui(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=vn(t,s);t.ellipse(r,a,i/2,e/2,ut/2,0,2*ut),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return yf(t,e)}}sr.id="ellipseAnnotation",sr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},fi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},sr.defaultRoutes={borderColor:"color",backgroundColor:"color"},sr.descriptors={label:{_fallback:!0}};function uT(n,t,e,i){const{width:r,height:a,centerX:s,centerY:o}=t,l=r/2,c=a/2;if(l<=0||c<=0)return!1;const u=qt(e||0),d=i/2||0,f=Math.cos(u),g=Math.sin(u),p=Math.pow(f*(n.x-s)+g*(n.y-o),2),v=Math.pow(g*(n.x-s)-f*(n.y-o),2);return p/Math.pow(l+d,2)+v/Math.pow(c+d,2)<=1.0001}class da extends te{inRange(t,e,i,r){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],r),u=this.options.borderWidth;if(i!=="x"&&i!=="y")return l1({x:t,y:e},this.getCenterPoint(r),c/2,u);const d=u/2,f=i==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return f.value>=f.start-d&&f.value<=f.end+d}getCenterPoint(t){return ci(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,ui(t,e);const r=vn(t,e);y1(t,this,this.centerX,this.centerY),r&&!ca(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=mf(t,e);return i.initProperties=nr(t,i,e),i}}da.id="pointAnnotation",da.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},da.defaultRoutes={borderColor:"color",backgroundColor:"color"};class fa extends te{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&fT(this.elements,t,e,r);const a=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.options.rotation)),s=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[i]>=o&&a[i]<=l}getCenterPoint(t){return ci(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,ui(t,i);const r=vn(t,i);let a=!0;for(const s of e)a?(t.moveTo(s.x,s.y),a=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=mf(t,e),{sides:r,rotation:a}=e,s=[],o=2*ut/r;let l=a*Ia;for(let c=0;c<r;c++,l+=o){const u=dT(i,e,l);u.initProperties=nr(t,i,e),s.push(u)}return i.elements=s,i}}fa.id="polygonAnnotation",fa.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},fa.defaultRoutes={borderColor:"color",backgroundColor:"color"};function dT({centerX:n,centerY:t},{radius:e,borderWidth:i},r){const a=i/2,s=Math.sin(r),o=Math.cos(r),l={x:n+s*e,y:t-o*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+s*(e+a),bY:t-o*(e+a)}}}function fT(n,t,e,i){let r=!1,a=n[n.length-1].getProps(["bX","bY"],i);for(const s of n){const o=s.getProps(["bX","bY"],i);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(r=!r),a=o}return r}const xn={box:fi,ellipse:sr,label:ir,line:ar,point:da,polygon:fa};Object.keys(xn).forEach(n=>{Ft.describe(`elements.${xn[n].id}`,{_fallback:"plugins.annotation.common"})});const hT={update:Object.assign},gT=Go.concat(ua),Uf=(n,t)=>lt(t)?il(n,t):n,el=n=>n==="color"||n==="font";function nl(n="line"){return xn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function pT(n,t,e,i){const r=yT(n,e.animations,i),a=t.annotations,s=xT(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=Bf(s,o,l.type),u=l.setContext(vT(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=mT(d),"elements"in d&&(bT(c,d.elements,u,r),delete d.elements),ue(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Yf(u),r.update(c,d)}}function mT(n){return isNaN(n.x)||isNaN(n.y)}function yT(n,t,e){return e==="reset"||e==="none"||e==="resize"?hT:new Ga(n,t)}function bT(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=Bf(r,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=Yf(c),i.update(l,o)}}function Bf(n,t,e,i){const r=xn[nl(e)];let a=n[t];return(!a||!(a instanceof r))&&(a=n[t]=new r,Object.assign(a,i)),a}function Yf(n){const t=xn[nl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,il(n,t.defaults),il(n,t.defaultRoutes));for(const i of gT)e[i]=n[i];return e}function il(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],a=n[i];el(i)&&yt(a)?e[i]=a.map(s=>Uf(s,r)):e[i]=Uf(a,r)}return e}function vT(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function xT(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var _T="3.0.1";const _n=new Map,wT=Go.concat(ua);var Wf={id:"annotation",version:_T,beforeRegister(){c1("chart.js","4.0",Te.version)},afterRegister(){Te.register(xn)},afterUnregister(){Te.unregister(xn)},beforeInit(n){_n.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=_n.get(n),r=i.annotations=[];let a=e.annotations;lt(a)?Object.keys(a).forEach(s=>{const o=a[s];lt(o)&&(o.id=s,r.push(o))}):yt(a)&&r.push(...a),N1(r,n.scales)},afterDataLimits(n,t){const e=_n.get(n);I1(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=_n.get(n);P1(n,i,e),pT(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),L1(n,i,e)},beforeDatasetsDraw(n,t,e){ha(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){ha(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){ha(n,"beforeDraw",e.clip)},afterDraw(n,t,e){ha(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=_n.get(n);E1(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){_n.delete(n)},_getState(n){return _n.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!wT.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${xn[nl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:el,_fallback:!0},_indexable:el}},additionalOptionScopes:[""]};function ha(n,t,e){const{ctx:i,chartArea:r}=n,a=_n.get(n);e&&Si(i,r);const s=TT(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)DT(i,r,a,o);e&&Ci(i)}function TT(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function DT(n,t,e,i){const r=i.element;i.main?(wf(e,r,"beforeDraw"),r.draw(n,t),wf(e,r,"afterDraw")):r.draw(n,t)}const ga="24px",zf=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},MT=n=>(h.pushScopeId("data-v-1129d9a2"),n=n(),h.popScopeId(),n),ST=["aria-hidden"],CT={key:0,"data-testid":"kui-icon-svg-title"},kT=MT(()=>h.createElementVNode("path",{d:"M9 20C8.45 20 7.97917 19.8042 7.5875 19.4125C7.19583 19.0208 7 18.55 7 18C7 17.45 7.19583 16.9792 7.5875 16.5875C7.97917 16.1958 8.45 16 9 16C9.55 16 10.0208 16.1958 10.4125 16.5875C10.8042 16.9792 11 17.45 11 18C11 18.55 10.8042 19.0208 10.4125 19.4125C10.0208 19.8042 9.55 20 9 20ZM15 20C14.45 20 13.9792 19.8042 13.5875 19.4125C13.1958 19.0208 13 18.55 13 18C13 17.45 13.1958 16.9792 13.5875 16.5875C13.9792 16.1958 14.45 16 15 16C15.55 16 16.0208 16.1958 16.4125 16.5875C16.8042 16.9792 17 17.45 17 18C17 18.55 16.8042 19.0208 16.4125 19.4125C16.0208 19.8042 15.55 20 15 20ZM9 14C8.45 14 7.97917 13.8042 7.5875 13.4125C7.19583 13.0208 7 12.55 7 12C7 11.45 7.19583 10.9792 7.5875 10.5875C7.97917 10.1958 8.45 10 9 10C9.55 10 10.0208 10.1958 10.4125 10.5875C10.8042 10.9792 11 11.45 11 12C11 12.55 10.8042 13.0208 10.4125 13.4125C10.0208 13.8042 9.55 14 9 14ZM15 14C14.45 14 13.9792 13.8042 13.5875 13.4125C13.1958 13.0208 13 12.55 13 12C13 11.45 13.1958 10.9792 13.5875 10.5875C13.9792 10.1958 14.45 10 15 10C15.55 10 16.0208 10.1958 16.4125 10.5875C16.8042 10.9792 17 11.45 17 12C17 12.55 16.8042 13.0208 16.4125 13.4125C16.0208 13.8042 15.55 14 15 14ZM9 8C8.45 8 7.97917 7.80417 7.5875 7.4125C7.19583 7.02083 7 6.55 7 6C7 5.45 7.19583 4.97917 7.5875 4.5875C7.97917 4.19583 8.45 4 9 4C9.55 4 10.0208 4.19583 10.4125 4.5875C10.8042 4.97917 11 5.45 11 6C11 6.55 10.8042 7.02083 10.4125 7.4125C10.0208 7.80417 9.55 8 9 8ZM15 8C14.45 8 13.9792 7.80417 13.5875 7.4125C13.1958 7.02083 13 6.55 13 6C13 5.45 13.1958 4.97917 13.5875 4.5875C13.9792 4.19583 14.45 4 15 4C15.55 4 16.0208 4.19583 16.4125 4.5875C16.8042 4.97917 17 5.45 17 6C17 6.55 16.8042 7.02083 16.4125 7.4125C16.0208 7.80417 15.55 8 15 8Z",fill:"currentColor"},null,-1)),OT=h.defineComponent({__name:"DragIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ga,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const r=String(t.size).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return ga}),i=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(r,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon drag-icon","data-testid":"kui-icon-wrapper-drag-icon",style:h.normalizeStyle(i.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-drag-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",CT,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),kT],8,ST))]),_:1},8,["aria-hidden","style"]))}}),PT=zf(OT,[["__scopeId","data-v-1129d9a2"]]),ET=n=>(h.pushScopeId("data-v-fb1f3252"),n=n(),h.popScopeId(),n),AT=["aria-hidden"],RT={key:0,"data-testid":"kui-icon-svg-title"},LT=ET(()=>h.createElementVNode("path",{d:"M12.025 22.05C11.7583 22.05 11.5042 22 11.2625 21.9C11.0208 21.8 10.8 21.6583 10.6 21.475L2.575 13.45C2.39167 13.25 2.25 13.0292 2.15 12.7875C2.05 12.5458 2 12.2917 2 12.025C2 11.7583 2.05 11.5 2.15 11.25C2.25 11 2.39167 10.7833 2.575 10.6L10.6 2.575C10.8 2.375 11.0208 2.22917 11.2625 2.1375C11.5042 2.04583 11.7583 2 12.025 2C12.2917 2 12.55 2.04583 12.8 2.1375C13.05 2.22917 13.2667 2.375 13.45 2.575L21.475 10.6C21.675 10.7833 21.8208 11 21.9125 11.25C22.0042 11.5 22.05 11.7583 22.05 12.025C22.05 12.2917 22.0042 12.5458 21.9125 12.7875C21.8208 13.0292 21.675 13.25 21.475 13.45L13.45 21.475C13.2667 21.6583 13.05 21.8 12.8 21.9C12.55 22 12.2917 22.05 12.025 22.05ZM11.025 13.025H13.025V7.025H11.025V13.025ZM12.025 16.025C12.3083 16.025 12.5458 15.9292 12.7375 15.7375C12.9292 15.5458 13.025 15.3083 13.025 15.025C13.025 14.7417 12.9292 14.5042 12.7375 14.3125C12.5458 14.1208 12.3083 14.025 12.025 14.025C11.7417 14.025 11.5042 14.1208 11.3125 14.3125C11.1208 14.5042 11.025 14.7417 11.025 15.025C11.025 15.3083 11.1208 15.5458 11.3125 15.7375C11.5042 15.9292 11.7417 16.025 12.025 16.025Z",fill:"currentColor"},null,-1)),IT=h.defineComponent({__name:"WarningIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ga,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const r=String(t.size).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return ga}),i=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(r,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon warning-icon","data-testid":"kui-icon-wrapper-warning-icon",style:h.normalizeStyle(i.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-warning-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",RT,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),LT],8,AT))]),_:1},8,["aria-hidden","style"]))}}),NT=zf(IT,[["__scopeId","data-v-fb1f3252"]]),FT="#6c7489",UT="#995c00",BT="20px",YT="40px",WT={class:"tooltip-title"},zT={class:"title font-bold"},HT={key:1,class:"subtitle"},$T={class:"tooltip"},jT={key:0},VT={class:"display-label"},qT={class:"display-value"},XT=h.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=t,i=n,r=h.ref(null),a=h.ref(!1),s=h.ref({x:0,y:0}),o=h.ref({x:0,y:0}),l=h.ref({left:i.left,top:i.top});h.watch(r,g=>{if(g){const{width:p,height:v}=g.getBoundingClientRect();e("dimensions",{width:p,height:v})}}),h.watch(()=>i.locked,g=>{g?(l.value.left=i.left,l.value.top=i.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(r.value){a.value=!0;const p=window.getComputedStyle(r.value),v=p.transform||p.webkitTransform||p.mozTransform,m=new DOMMatrix(v),y=m.m41,x=m.m42;s.value={x:y,y:x},o.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),a.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const p=g.clientX-o.value.x,v=g.clientY-o.value.y;l.value.left=`${s.value.x+p}px`,l.value.top=`${s.value.y+v}px`}))}function f(){a.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return(g,p)=>n.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:h.normalizeClass(["tooltip-container",{locked:n.locked}]),style:h.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[h.createElementVNode("div",WT,[h.createElementVNode("span",zT,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(PT),{key:0,class:"drag-icon",color:h.unref(FT)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",HT,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",$T,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.series,({backgroundColor:v,borderColor:m,label:y,value:x})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:y},[n.series.length?(h.openBlock(),h.createElementBlock("li",jT,[h.createElementVNode("div",{class:"tooltip-legend",style:h.normalizeStyle({background:v,"border-color":m})},null,4),h.createElementVNode("span",VT,h.toDisplayString(y),1),h.createElementVNode("span",qT,h.toDisplayString(x),1)])):h.createCommentVNode("",!0)],64))),128))])],38)):h.createCommentVNode("",!0)}}),Ke=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},rl=Ke(XT,[["__scopeId","data-v-a3fae01e"]]),GT=["onClick"],KT=["title"],ZT={key:0,class:"sub-label"},al=Ke(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,e=h.ref(),i=h.ref([]),r=h.ref(!1),a=h.inject("showLegendValues",!0),s=h.inject("legendPosition",h.ref(Bt.Right)),o=h.ref([]),l=()=>{const m=e.value;if(!m||!i.value||m.children.length===0)return 0;const y=m.children[0].getBoundingClientRect().top;for(const x of i.value)if(x.getBoundingClientRect().top>y)return!0;return!1},c=()=>{e.value&&s.value===Bt.Bottom&&(l()?r.value=!0:r.value=!1)},u=()=>{if(e.value&&s.value===Bt.Bottom){let m=0;i.value.forEach(x=>{const _=Array.from(x.children).reduce((w,M)=>w+M.offsetWidth,0);_>m&&(m=_)});const y=parseInt(YT,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${m+y}px)`}},d=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let m=0;m<t.items.length;m++)if(t.items[m].text!==o.value[m].text)return o.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{c(),d()&&u()},{immediate:!0,flush:"post"});const f=new ResizeObserver(()=>{c()});h.watch(()=>s.value,()=>{u()}),h.onMounted(()=>{o.value=t.items,e.value&&f.observe(e.value)}),h.onBeforeUnmount(()=>{e.value&&f.unobserve(e.value)});const g=(m=0,y)=>{if(t.chartInstance===null)return;const x=t.chartInstance instanceof Te?t.chartInstance:t.chartInstance.chart;p(m,y)?x.hide(m,y):x.show(m,y),x.update()},p=(m=0,y)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const x=t.chartInstance instanceof Te?t.chartInstance:t.chartInstance.chart,_=x.getDatasetMeta(m);return _.dataset||y===void 0?x.isDatasetVisible(m):!(_.data.length&&_.data[y].hidden)},v=m=>({[Bt.Right]:"vertical",[Bt.Bottom]:"horizontal",[Bt.Hidden]:"hidden"})[m];return(m,y)=>h.unref(s)!==h.unref(Bt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:h.normalizeClass(["legend-container",v(h.unref(s))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:x,strokeStyle:_,text:w,datasetIndex:M,index:C,value:k})=>(h.openBlock(),h.createElementBlock("li",{key:w,ref_for:!0,ref_key:"legendItemsRef",ref:i,onClick:T=>g(M,C)},[h.createElementVNode("div",{class:"legend",style:h.normalizeStyle({background:x,"border-color":_})},null,4),h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!p(M,C)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":r.value}]),title:h.unref(s)===h.unref(Bt).Bottom&&w},h.toDisplayString(w),11,KT),k&&h.unref(a)?(h.openBlock(),h.createElementBlock("div",ZT,h.toDisplayString(k.formatted),1)):h.createCommentVNode("",!0)],2)],8,GT))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-71ab0079"]]);let pa;const QT=new Uint8Array(16);function JT(){if(!pa&&(pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pa(QT)}const ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function tD(n,t=0){return ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]}const Hf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function wn(n,t,e){if(Hf.randomUUID&&!t&&!n)return Hf.randomUUID();n=n||{};const i=n.random||(n.rng||JT)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(let r=0;r<16;++r)t[e+r]=i[r];return t}return tD(i)}const $f=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,a=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(a.x-a.width/2,a.y,a.width,i.bottom-a.y):e.strokeRect(r.left,a.y-a.height/2,a.x-r.left,a.height),e.restore()},jf={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&$f(n,this.clickedElements)},afterEvent:function(n,{event:t}){var r;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((r=n.options.interaction)==null?void 0:r.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,$f(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},Vf=6,eD="100%",nD="100%",iD=20,rD=20,qf=6,aD=0,sD=10,oD=10,lD=1,cD=Ke(h.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{i18n:e}=St.useI18n(),{translateUnit:i}=St.useTranslatedUnits(),r=h.ref(null),a=({chart:N},Y)=>{var J;const V=N.data,Z=(J=V.labels)==null?void 0:J.indexOf(Y);return V.datasets.reduce((F,L,Q)=>{if(N.isDatasetVisible(Q)){const G=L.data[Z];return isNaN(G)?F:F+G}else return F},0)},s=(N,Y,V,Z)=>{const J=Z==="horizontal";Y===null&&(Y=e.t("entityNoName"));const F={type:"label",yValue:G=>J?Y:a(G,Y),xValue:G=>J?a(G,Y):Y},L={...F,position:J?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>J?0:-Math.abs(G_()),content:G=>Co(a(G,Y),V)},Q={...F,content:G=>Wd(a(G,Y),Yd(G.chart,N)),position:J?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:G=>J?Bd(Co(a(G,Y),V)):0,color:Ud};return{[`${Y}-value`]:L,[`${Y}-percent`]:Q}},o=h.ref(null),l=h.ref(),c=h.ref(wn()),u=wn(),d=wn(),f=h.ref([]),g=h.ref(h.inject("legendPosition",Bt.Right)),p=h.ref({show:!1,top:"0px",left:"0px",text:"",offset:0}),v=h.toRef(t,"metricUnit"),m=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),y=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:v,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:m.value?ee.HORIZONTAL_BAR:ee.VERTICAL_BAR,chartTooltipSortFn:t.chartTooltipSortFn}),x=h.ref(0),_=()=>{var N;return t.annotations&&((N=t.chartData.labels)==null?void 0:N.reduce((Y,V)=>Object.assign(Y,s(t.chartData,V,v.value,t.orientation)),{}))},w={id:c.value,afterUpdate(N){x.value+=1,f.value=N.options.plugins.legend.labels.generateLabels(N).map(Y=>({...Y,value:t.legendValues&&t.legendValues[Y.text]})).sort(t.chartLegendSortFn)}},M={id:u,afterUpdate(N){N.options.plugins.annotation.annotations=t.annotations?_():{}}},T=[w,{id:"axisHover",afterEvent(N,Y){if(p.value.show=!1,Y.event.type==="mousemove"){const V=Y.event,Z=N.options.indexAxis,J=N.scales,F=N.scales[Z].getLabelForValue(Number(N.scales[Z].getValueForPixel(V[Z])));if((Q=>Q==="x"?V.y>J.x.top:V.x<J.y.right)(Z))if(y.locked||(y.showTooltip=!1),F.length>na){const G=N.canvas.getContext("2d").measureText(F).width,vt=Math.abs(Math.round(V.x-G*.5)),dt=Math.round(V.x+G*.5);p.value.left=Z==="x"?`${(vt>0?vt:dt)-p.value.offset}px`:`${V.x-G*.5-p.value.offset}px`,p.value.top=`${V.y-50}px`,p.value.show=!0,p.value.text=F}else p.value.show=!1;else p.value.show=!1}}},{id:d,afterUpdate(N){N.options.layout.padding.right=m.value?I.value:0}},jf,...t.annotations?[M]:[]],D=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),O=h.ref(0),E=h.ref(0),A=new ResizeObserver(N=>{O.value=N[0].contentRect.width,E.value=N[0].contentRect.height}),R=h.computed(()=>{var Y,V;const N=(V=(Y=t.chartData)==null?void 0:Y.labels)==null?void 0:V.length;return o.value&&N&&!m.value?`${Math.max(N*(iD+qf),O.value)}px`:eD}),q=h.computed(()=>{var Y,V;const N=(V=(Y=t.chartData)==null?void 0:Y.labels)==null?void 0:V.length;return o.value&&N&&m.value?`${Math.max(N*(rD+qf),E.value)}px`:nD});St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Te.register(Wf),r.value&&A.observe(r.value)}),h.onUnmounted(()=>{r.value&&A.unobserve(r.value)});const H=h.computed(()=>{const N=St.useBarChartOptions({tooltipState:y,legendID:c.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:m.value?"y":"x",numLabels:D});return{...N.value,plugins:{...N.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Vf}}}}),B=St.useChartJSCommon("bar",o,h.toRef(t,"chartData"),T,H),I=h.computed(()=>{x.value;const N=t.chartData.labels,Y=t.chartData.datasets,V=N.map((F,L)=>Y.reduce((Q,G)=>isNaN(Number(G.data[L]))?Q:Q+Number(G.data[L]),0)),Z=B.value?Yd(B.value,t.chartData):K_(t.chartData);return V.map(F=>Bd(Co(F,v.value)+Wd(F,Z))).reduce((F,L)=>Math.max(F,L),0)+Vf});h.onBeforeUnmount(()=>{Te.unregister(Wf)});const rt={[Bt.Right]:"legend-row",[Bt.Bottom]:"column"},W=h.computed(()=>{if(l.value&&B.value){const N=window.devicePixelRatio,Y=B.value,V=Y.scales.y.width*N+lD,Z=(Y.scales.y.height+Y.scales.y.top+Y.scales.x.height)*N,J=l.value.getContext("2d");return J.scale(N,N),J.canvas.width=V,J.canvas.height=Z,J.canvas.style.width=`${V/N}px`,J.canvas.style.height=`${Z/N}px`,{scale:N,width:V*N,height:Z*N,targetCtx:J}}return null}),Ct=N=>{const Y=N.target;if(W.value&&B.value&&!m.value){const V=W.value.scale,Z=W.value.targetCtx,J=W.value.width,F=W.value.height,L=B.value,Q=L.canvas;Z.fillStyle="white",Y.scrollLeft>=aD&&Y.scrollLeft<=sD?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,J,F),Z.drawImage(Q,0,0,J,F,0,0,J,F),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,J,F)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(L.scales.y.height+L.scales.y.top+oD)*V,J,L.scales.x.height*V))}y.offsetY=Y.scrollTop,y.offsetX=Y.scrollLeft,p.value.offset=Y.scrollLeft},mt=({width:N,height:Y})=>{y.width=N,y.height=Y};h.watch(()=>t.orientation,()=>{var N;if(l.value&&W.value){const Y=W.value.width,V=W.value.height;((N=l.value)==null?void 0:N.getContext("2d")).clearRect(0,0,Y,V)}y.showTooltip=!1,y.locked=!1}),h.watch(()=>t.annotations,N=>{B.value&&(N?B.value.options.plugins.annotation.annotations=_(t.chartData):delete B.value.options.plugins.annotation.annotations)});const $=()=>{y.showTooltip&&(y.locked=!y.locked)};return(N,Y)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",rt[g.value]])},[h.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:r,class:"chart-container","on:scroll":Ct,onClick:Y[0]||(Y[0]=V=>$())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:R.value,height:q.value})},[h.createElementVNode("canvas",{ref_key:"canvas",ref:o},null,512)],4)],544),p.value.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:p.value.top,left:p.value.left})},h.toDisplayString(p.value.text),5)):h.createCommentVNode("",!0),h.createVNode(rl,{context:y.tooltipContext,left:y.left,locked:y.locked,series:y.tooltipSeries,"show-tooltip":y.showTooltip,"tooltip-title":n.tooltipTitle,top:y.top,onDimensions:mt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),h.createVNode(al,{id:c.value,"chart-instance":h.unref(B),items:f.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-b8bf74df"]]);/*!
|
|
24
|
+
*/const rf={modes:{point(n,t){return sa(n,t,{intersect:!0})},nearest(n,t,e){return s1(n,t,e)},x(n,t,e){return sa(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return sa(n,t,{intersect:e.intersect,axis:"y"})}}};function Wo(n,t,e){return(rf.modes[e.mode]||rf.modes.nearest)(n,t,e)}function r1(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function a1(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function sa(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):r1(i,t,e.axis))}function s1(n,t,e){let i=Number.POSITIVE_INFINITY;return sa(n,t,e).reduce((r,a)=>{const s=a.getCenterPoint(),o=a1(t,s,e.axis),l=Gn(t,o);return l<i?(r=[a],i=l):l===i&&r.push(a),r},[]).sort((r,a)=>r._index-a._index).slice(0,1)}const o1=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Yn=.001,oa=(n,t,e)=>Math.min(e,Math.max(t,n));function l1(n,t,e){for(const i of Object.keys(n))n[i]=oa(n[i],t,e);return n}function c1(n,t,e,i){if(!n||!t||e<=0)return!1;const r=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+r,2)}function af(n,{x:t,y:e,x2:i,y2:r},a,s){const o=s/2,l=n.x>=t-o-Yn&&n.x<=i+o+Yn,c=n.y>=e-o-Yn&&n.y<=r+o+Yn;return a==="x"?l:(a==="y"||l)&&c}function ci(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function u1(n,t,e,i=!0){const r=e.split(".");let a=0;for(const s of t.split(".")){const o=r[a++];if(parseInt(s,10)<parseInt(o,10))break;if(o1(o,s)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const sf=n=>typeof n=="string"&&n.endsWith("%"),of=n=>parseFloat(n)/100,lf=n=>oa(of(n),0,1),la=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),d1={box:n=>la(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>la(n.centerX,n.centerY),line:n=>la(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>la(n.centerX,n.centerY)};function zo(n,t){return t==="start"?0:t==="end"?n:sf(t)?lf(t)*n:n/2}function bn(n,t,e=!0){return typeof t=="number"?t:sf(t)?(e?lf(t):of(t))*n:n}function f1(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function Ho(n,t="center"){return lt(n)?{x:nt(n.x,t),y:nt(n.y,t)}:(n=nt(n,t),{x:n,y:n})}function cf(n){return n&&(ue(n.xValue)||ue(n.yValue))}function nr(n,t,e){const i=e.init;if(i){if(i===!0)return df(t,e)}else return;return h1(n,t,e)}function uf(n,t,e){let i=!1;return t.forEach(r=>{de(n[r])?(i=!0,e[r]=n[r]):ue(e[r])&&delete e[r]}),i}function df(n,t){const e=t.type||"line";return d1[e](n)}function h1(n,t,e){const i=_t(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return df(t,e);if(lt(i))return i}const $o=new Map,g1=n=>isNaN(n)||n<=0,p1=n=>n.reduce(function(t,e){return t+=e.string,t},"");function ca(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function jo(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(qt(i)),n.translate(-t,-e))}function vn(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function ui(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Vo(n,t){const e=t.content;if(ca(e))return{width:bn(e.width,t.width),height:bn(e.height,t.height)};const i=t.font,r=yt(i)?i.map(l=>Et(l)):[Et(i)],a=t.textStrokeWidth,s=yt(e)?e:[e],o=s.join()+p1(r)+a+(n._measureText?"-spriting":"");return $o.has(o)||$o.set(o,x1(n,s,r,a)),$o.get(o)}function ff(n,t,e){const{x:i,y:r,width:a,height:s}=t;n.save(),ui(n,e);const o=vn(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Kn(n,{x:i,y:r,w:a,h:s,radius:l1(un(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function m1(n,t,e){const i=e.content;if(ca(i)){n.save(),n.globalAlpha=T1(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}const r=yt(i)?i:[i],a=e.font,s=yt(a)?a.map(d=>Et(d)):[Et(a)],o=e.color,l=yt(o)?o:[o],c=f1(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,y1(n,e)&&_1(n,{x:c,y:u},r,s),w1(n,{x:c,y:u},r,{fonts:s,colors:l}),n.restore()}function y1(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function b1(n,t,e,i){const{radius:r,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Ia;if(ca(s)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}g1(r)||v1(n,{x:e,y:i,radius:r,rotation:o,style:s,rad:l})}function v1(n,{x:t,y:e,radius:i,rotation:r,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,i,0,kt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=mr,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=mr,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(s+we)*c,l=Math.sin(s+we)*c,n.arc(t-o,e-l,u,s-ut,s-Pt),n.arc(t+l,e-o,u,s-Pt,s),n.arc(t+o,e+l,u,s,s+Pt),n.arc(t-l,e+o,u,s+Pt,s+ut),n.closePath();break;case"rect":if(!r){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}s+=we;case"rectRot":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":s+=we;case"cross":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),s+=we,o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(s)*i,e+Math.sin(s)*i);break}n.fill()}function x1(n,t,e,i){n.save();const r=t.length;let a=0,s=i;for(let o=0;o<r;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];a=Math.max(a,n.measureText(c).width+i),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function _1(n,{x:t,y:e},i,r){n.beginPath();let a=0;i.forEach(function(s,o){const l=r[Math.min(o,r.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function w1(n,{x:t,y:e},i,{fonts:r,colors:a}){let s=0;i.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+s),s+=d,n.fill()})}function T1(n,t){const e=cn(n)?n:t;return cn(e)?oa(e,0,1):1}const hf={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function di(n,t,e){return t=typeof t=="number"?t:n.parse(t),Lt(t)?n.getPixelForValue(t):e}function Wn(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===r);return a.length?a[0].id:r}function gf(n,t){if(n){const e=n.options.reverse,i=di(n,t.min,e?t.end:t.start),r=di(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function pf(n,t){const{chartArea:e,scales:i}=n,r=i[Wn(i,t,"xScaleID")],a=i[Wn(i,t,"yScaleID")];let s=e.width/2,o=e.height/2;return r&&(s=di(r,t.xValue,r.left+r.width/2)),a&&(o=di(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function qo(n,t){const e=n.scales,i=e[Wn(e,t,"xScaleID")],r=e[Wn(e,t,"yScaleID")];if(!i&&!r)return{};let{left:a,right:s}=i||n.chartArea,{top:o,bottom:l}=r||n.chartArea;const c=bf(i,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=bf(r,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:a,y:o,x2:s,y2:l,width:s-a,height:l-o,centerX:a+(s-a)/2,centerY:o+(l-o)/2}}function mf(n,t){if(!cf(t)){const e=qo(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-i,y:s-i,x2:a+i,y2:s+i,centerX:a,centerY:s,width:r,height:r,radius:i}}return M1(n,t)}function D1(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],a={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?S1(r,a,t):C1(e,a,t),a}function yf(n,t){const e=qo(n,t);return e.initProperties=nr(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:P1(n,e,t),initProperties:e.initProperties}],e}function M1(n,t){const e=pf(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function bf(n,t){const e=gf(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function S1(n,t,e){const i=di(n,e.value,NaN),r=di(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function C1(n,t,e){for(const i of Object.keys(hf)){const r=n[Wn(n,e,i)];if(r){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=hf[i],d=gf(r,{min:e[a],max:e[s],start:r[o],end:r[l]});t[c]=d.start,t[u]=d.end}}}function k1({properties:n,options:t},e,i,r){const{x:a,x2:s,width:o}=n;return vf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function O1({properties:n,options:t},e,i,r){const{y:a,y2:s,height:o}=n;return vf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function vf(n,t){const{start:e,end:i,borderWidth:r}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=i-r-e-s-o-t.size;return e+r/2+l+zo(c,a)}function P1(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=Ho(i.position),a=Xt(i.padding),s=Vo(n.ctx,i),o=k1({properties:t,options:e},s,r,a),l=O1({properties:t,options:e},s,r,a),c=s.width+a.width,u=s.height+a.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}function zn(n,t,e){const i=Math.cos(e),r=Math.sin(e),a=t.x,s=t.y;return{x:a+i*(n.x-a)-r*(n.y-s),y:s+r*(n.x-a)+i*(n.y-s)}}const Xo=["enter","leave"],Go=Xo.concat("click");function E1(n,t,e){t.listened=uf(e,Go,t.listeners),t.moveListened=!1,t._getElements=Wo,Xo.forEach(i=>{de(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&de(i.click)&&(t.listened=!0),t.moveListened||Xo.forEach(r=>{de(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function A1(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return R1(n,t,e);case"click":return L1(n,t,e)}}function R1(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Wo(n,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const a={state:n,event:t};let s=xf(a,"leave",r,i);return xf(a,"enter",i,r)||s}function xf({state:n,event:t},e,i,r){let a;for(const s of i)r.indexOf(s)<0&&(a=_f(s.options[e]||n.listeners[e],s,t)||a);return a}function L1(n,t,e){const i=n.listeners,r=Wo(n,t,e.interaction);let a;for(const s of r)a=_f(s.options.click||i.click,s,t)||a;return a}function _f(n,t,e){return _t(n,[t.$context,e])===!0}const ua=["afterDraw","beforeDraw"];function I1(n,t,e){const i=t.visibleElements;t.hooked=uf(e,ua,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ua.forEach(a=>{de(r.options[a])&&(t.hooked=!0)})})}function wf(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return _t(i,[t.$context])}}function N1(n,t,e){const i=W1(n.scales,t,e);let r=Tf(t,i,"min","suggestedMin");r=Tf(t,i,"max","suggestedMax")||r,r&&de(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function F1(n,t){for(const e of n)B1(e,t)}function Tf(n,t,e,i){if(Lt(t[e])&&!U1(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function U1(n,t,e){return ue(n[t])||ue(n[e])}function B1(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Wn(t,n,e);i&&!t[i]&&Y1(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function Y1(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ue(n[e+i]))return!0;return!1}function W1(n,t,e){const i=t.axis,r=t.id,a=i+"ScaleID",s={min:nt(t.min,Number.NEGATIVE_INFINITY),max:nt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===r?Df(o,t,["value","endValue"],s):Wn(n,o,a)===r&&Df(o,t,[i+"Min",i+"Max",i+"Value"],s);return s}function Df(n,t,e,i){for(const r of e){const a=n[r];if(ue(a)){const s=t.parse(a);i.min=Math.min(i.min,s),i.max=Math.max(i.max,s)}}}class fi extends te{inRange(t,e,i,r){const{x:a,y:s}=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.options.rotation));return af({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return ci(this,t)}draw(t){t.save(),jo(t,this.getCenterPoint(),this.options.rotation),ff(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return yf(t,e)}}fi.id="boxAnnotation",fi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},fi.defaultRoutes={borderColor:"color",backgroundColor:"color"},fi.descriptors={label:{_fallback:!0}};const Mf=["left","bottom","top","right"];class ir extends te{inRange(t,e,i,r){const{x:a,y:s}=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.rotation));return af({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return ci(this,t)}draw(t){const e=this.options,i=!ue(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),jo(t,this.getCenterPoint(),this.rotation),H1(t,this),ff(t,this,e),m1(t,K1(this),e),t.restore())}resolveElementProperties(t,e){let i;if(cf(e))i=pf(t,e);else{const{centerX:o,centerY:l}=qo(t,e);i={x:o,y:l}}const r=Xt(e.padding),a=Vo(t.ctx,e),s=z1(i,a,e,r);return{initProperties:nr(t,s,e),pointX:i.x,pointY:i.y,...s,rotation:e.rotation}}}ir.id="labelAnnotation",ir.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ir.defaultRoutes={borderColor:"color"};function z1(n,t,e,i){const r=t.width+i.width+e.borderWidth,a=t.height+i.height+e.borderWidth,s=Ho(e.position,"center"),o=Sf(n.x,r,e.xAdjust,s.x),l=Sf(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+r,y2:l+a,width:r,height:a,centerX:o+r/2,centerY:l+a/2}}function Sf(n,t,e=0,i){return n-zo(t,i)+e}function H1(n,t){const{pointX:e,pointY:i,options:r}=t,a=r.callout,s=a&&a.display&&X1(t,a);if(!s||Z1(t,a,s))return;if(n.save(),n.beginPath(),!vn(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=$1(t,s),{sideStart:u,sideEnd:d}=V1(t,s,l);(a.margin>0||r.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const f=zn({x:e,y:i},t.getCenterPoint(),qt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function $1(n,t){const{x:e,y:i,x2:r,y2:a}=n,s=j1(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:i},l={x:o.x,y:a}):(o={x:e,y:i+s},l={x:r,y:o.y}),{separatorStart:o,separatorEnd:l}}function j1(n,t){const{width:e,height:i,options:r}=n,a=r.callout.margin+r.borderWidth/2;return t==="right"?e+a:t==="bottom"?i+a:-a}function V1(n,t,e){const{y:i,width:r,height:a,options:s}=n,o=s.callout.start,l=q1(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+bn(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+bn(r,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function q1(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function X1(n,t){const e=t.position;return Mf.includes(e)?e:G1(n,t)}function G1(n,t){const{x:e,y:i,x2:r,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,x=bn(s,p),m=bn(o,p),b=[e,e+x,e+x,r],v=[i+m,a,i,a],_=[];for(let w=0;w<4;w++){const M=zn({x:b[w],y:v[w]},g,qt(f));_.push({position:Mf[w],distance:Gn(M,{x:l,y:c})})}return _.sort((w,M)=>w.distance-M.distance)[0].position}function K1({x:n,y:t,width:e,height:i,options:r}){const a=r.borderWidth/2,s=Xt(r.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-r.borderWidth,height:i-s.top-s.bottom-r.borderWidth}}function Z1(n,t,e){const{pointX:i,pointY:r}=n,a=t.margin;let s=i,o=r;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ko=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Zo=(n,t,e)=>Ko(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Cf=(n,t,e)=>Ko(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,rr=n=>n*n,Q1=(n,t,{x:e,y:i,x2:r,y2:a},s)=>s==="y"?{start:Math.min(i,a),end:Math.max(i,a),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},kf=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Qo=(n,t,e,i)=>({x:kf(n.x,t.x,e.x,i),y:kf(n.y,t.y,e.y,i)}),Of=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Pf=(n,t,e,i)=>-Math.atan2(Of(n.x,t.x,e.x,i),Of(n.y,t.y,e.y,i))+.5*ut;class ar extends te{inRange(t,e,i,r){const a=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){vn(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(o,d,f)||Jo(this,s,r);return l.restore(),g}const c=rr(a);return nT(this,s,c,r)||Jo(this,s,r)}return J1(this,{mouseX:t,mouseY:e},i,{hBorderWidth:a,useFinalPosition:r})}getCenterPoint(t){return ci(this,t)}draw(t){const{x:e,y:i,x2:r,y2:a,cp:s,options:o}=this;if(t.save(),!vn(t,o))return t.restore();ui(t,o);const l=Math.sqrt(Math.pow(r-e,2)+Math.pow(a-i,2));if(o.curve&&s)return uT(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=If(this),g=Math.atan2(a-i,r-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),tl(t,0,d,c),tl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=D1(t,e),{x:r,y:a,x2:s,y2:o}=i,l=tT(i,t.chartArea),c=l?eT({x:r,y:a},{x:s,y:o},t.chartArea):{x:r,y:a,x2:s,y2:o,width:Math.abs(s-r),height:Math.abs(o-a)};if(c.centerX=(s+r)/2,c.centerY=(o+a)/2,c.initProperties=nr(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=cT(c,e,Gn(d,f))}const u=iT(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}ar.id="lineAnnotation";const Ef={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ar.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Ef),fill:!1,length:12,start:Object.assign({},Ef),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},ir.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ar.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},ar.defaultRoutes={borderColor:"color"};function J1(n,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:a}){const s=Q1(t,e,n.getProps(["x","y","x2","y2"],a),i);return s.value>=s.start-r&&s.value<=s.end+r||Jo(n,{mouseX:t,mouseY:e},a,i)}function tT({x:n,y:t,x2:e,y2:i},{top:r,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<r&&i<r||t>s&&i>s)}function Af({x:n,y:t},e,{top:i,right:r,bottom:a,left:s}){return n<s&&(t=Cf(s,{x:n,y:t},e),n=s),n>r&&(t=Cf(r,{x:n,y:t},e),n=r),t<i&&(n=Zo(i,{x:n,y:t},e),t=i),t>a&&(n=Zo(a,{x:n,y:t},e),t=a),{x:n,y:t}}function eT(n,t,e){const{x:i,y:r}=Af(n,t,e),{x:a,y:s}=Af(t,n,e);return{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)}}function nT(n,{mouseX:t,mouseY:e},i=Yn,r){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],r),c=o-a,u=l-s,d=rr(c)+rr(u),f=d===0?-1:((t-a)*c+(e-s)*u)/d;let g,p;return f<0?(g=a,p=s):f>1?(g=o,p=l):(g=a+f*c,p=s+f*u),rr(t-g)+rr(e-p)<=i}function Jo(n,{mouseX:t,mouseY:e},i,r){const a=n.label;return a.options.display&&a.inRange(t,e,r,i)}function iT(n,t,e){const i=e.borderWidth,r=Xt(e.padding),a=Vo(n.ctx,e),s=a.width+r.width+i,o=a.height+r.height+i;return aT(t,e,{width:s,height:o,padding:r},n.chartArea)}function rT(n){const{x:t,y:e,x2:i,y2:r}=n,a=Math.atan2(r-e,i-t);return a>ut/2?a-ut:a<ut/-2?a+ut:a}function aT(n,t,e,i){const{width:r,height:a,padding:s}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?rT(n):qt(t.rotation),f=sT(r,a,d),g=oT(n,t,{labelSize:f,padding:s},i),p=n.cp?Qo(c,n.cp,u,g):Ko(c,u,g),x={size:f.w,min:i.left,max:i.right,padding:s.left},m={size:f.h,min:i.top,max:i.bottom,padding:s.top},b=Lf(p.x,x)+o,v=Lf(p.y,m)+l;return{x:b-r/2,y:v-a/2,x2:b+r/2,y2:v+a/2,centerX:b,centerY:v,pointX:p.x,pointY:p.y,width:r,height:a,rotation:yr(d)}}function sT(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function oT(n,t,e,i){let r;const a=lT(n,i);return t.position==="start"?r=Rf({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?r=1-Rf({w:n.x-n.x2,h:n.y-n.y2},e,t,a):r=zo(1,t.position),r}function Rf(n,t,e,i){const{labelSize:r,padding:a}=t,s=n.w*i.dx,o=n.h*i.dy,l=s>0&&(r.w/2+a.left-i.x)/s,c=o>0&&(r.h/2+a.top-i.y)/o;return oa(Math.max(l,c),0,.25)}function lT(n,t){const{x:e,x2:i,y:r,y2:a}=n,s=Math.min(r,a)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(r,a),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function Lf(n,t){const{size:e,min:i,max:r,padding:a}=t,s=e/2;return e>r-i?(r+i)/2:(i>=n-a-s&&(n=i+a+s),r<=n+a+s&&(n=r-a-s),n)}function If(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Nf(n,e),endAdjust:Nf(n,i)}}function Nf(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,a={x:e,y:i+r};return Math.abs(Zo(0,a,{x:0,y:r}))}function tl(n,t,e,i){if(!i||!i.display)return;const{length:r,width:a,fill:s,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-r)+e;n.beginPath(),ui(n,i),vn(n,i),n.moveTo(c,-a),n.lineTo(t+e,0),n.lineTo(c,a),s===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function cT(n,t,e){const{x:i,y:r,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-r,a-i),u=Ho(t.controlPoint,0),d={x:o+bn(e,u.x,!1),y:l+bn(e,u.y,!1)};return zn(d,{x:o,y:l},c)}function Ff(n,{x:t,y:e},{angle:i,adjust:r},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(i),tl(n,0,-r,a),n.restore())}function uT(n,t,e,i){const{x:r,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=If(t),g={x:r,y:a},p={x:s,y:o},x=Pf(g,e,p,0),m=Pf(g,e,p,1)-ut,b=Qo(g,e,p,d/i),v=Qo(g,e,p,1-f/i),_=new Path2D;n.beginPath(),_.moveTo(b.x,b.y),_.quadraticCurveTo(e.x,e.y,v.x,v.y),n.shadowColor=l.borderShadowColor,n.stroke(_),t.path=_,t.ctx=n,Ff(n,b,{angle:x,adjust:d},c),Ff(n,v,{angle:m,adjust:f},u)}class sr extends te{inRange(t,e,i,r){const a=this.options.rotation,s=this.options.borderWidth;if(i!=="x"&&i!=="y")return dT({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],r),d=s/2,f=i==="y"?{start:l,end:u}:{start:o,end:c},g=zn({x:t,y:e},this.getCenterPoint(r),qt(-a));return g[i]>=f.start-d-Yn&&g[i]<=f.end+d+Yn}getCenterPoint(t){return ci(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:a,options:s}=this;t.save(),jo(t,this.getCenterPoint(),s.rotation),ui(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=vn(t,s);t.ellipse(r,a,i/2,e/2,ut/2,0,2*ut),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return yf(t,e)}}sr.id="ellipseAnnotation",sr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},fi.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},sr.defaultRoutes={borderColor:"color",backgroundColor:"color"},sr.descriptors={label:{_fallback:!0}};function dT(n,t,e,i){const{width:r,height:a,centerX:s,centerY:o}=t,l=r/2,c=a/2;if(l<=0||c<=0)return!1;const u=qt(e||0),d=i/2||0,f=Math.cos(u),g=Math.sin(u),p=Math.pow(f*(n.x-s)+g*(n.y-o),2),x=Math.pow(g*(n.x-s)-f*(n.y-o),2);return p/Math.pow(l+d,2)+x/Math.pow(c+d,2)<=1.0001}class da extends te{inRange(t,e,i,r){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],r),u=this.options.borderWidth;if(i!=="x"&&i!=="y")return c1({x:t,y:e},this.getCenterPoint(r),c/2,u);const d=u/2,f=i==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return f.value>=f.start-d&&f.value<=f.end+d}getCenterPoint(t){return ci(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,ui(t,e);const r=vn(t,e);b1(t,this,this.centerX,this.centerY),r&&!ca(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=mf(t,e);return i.initProperties=nr(t,i,e),i}}da.id="pointAnnotation",da.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},da.defaultRoutes={borderColor:"color",backgroundColor:"color"};class fa extends te{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&hT(this.elements,t,e,r);const a=zn({x:t,y:e},this.getCenterPoint(r),qt(-this.options.rotation)),s=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[i]>=o&&a[i]<=l}getCenterPoint(t){return ci(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,ui(t,i);const r=vn(t,i);let a=!0;for(const s of e)a?(t.moveTo(s.x,s.y),a=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=mf(t,e),{sides:r,rotation:a}=e,s=[],o=2*ut/r;let l=a*Ia;for(let c=0;c<r;c++,l+=o){const u=fT(i,e,l);u.initProperties=nr(t,i,e),s.push(u)}return i.elements=s,i}}fa.id="polygonAnnotation",fa.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},fa.defaultRoutes={borderColor:"color",backgroundColor:"color"};function fT({centerX:n,centerY:t},{radius:e,borderWidth:i},r){const a=i/2,s=Math.sin(r),o=Math.cos(r),l={x:n+s*e,y:t-o*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+s*(e+a),bY:t-o*(e+a)}}}function hT(n,t,e,i){let r=!1,a=n[n.length-1].getProps(["bX","bY"],i);for(const s of n){const o=s.getProps(["bX","bY"],i);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(r=!r),a=o}return r}const xn={box:fi,ellipse:sr,label:ir,line:ar,point:da,polygon:fa};Object.keys(xn).forEach(n=>{Ft.describe(`elements.${xn[n].id}`,{_fallback:"plugins.annotation.common"})});const gT={update:Object.assign},pT=Go.concat(ua),Uf=(n,t)=>lt(t)?il(n,t):n,el=n=>n==="color"||n==="font";function nl(n="line"){return xn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function mT(n,t,e,i){const r=bT(n,e.animations,i),a=t.annotations,s=_T(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=Bf(s,o,l.type),u=l.setContext(xT(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=yT(d),"elements"in d&&(vT(c,d.elements,u,r),delete d.elements),ue(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Yf(u),r.update(c,d)}}function yT(n){return isNaN(n.x)||isNaN(n.y)}function bT(n,t,e){return e==="reset"||e==="none"||e==="resize"?gT:new Ga(n,t)}function vT(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=Bf(r,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=Yf(c),i.update(l,o)}}function Bf(n,t,e,i){const r=xn[nl(e)];let a=n[t];return(!a||!(a instanceof r))&&(a=n[t]=new r,Object.assign(a,i)),a}function Yf(n){const t=xn[nl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,il(n,t.defaults),il(n,t.defaultRoutes));for(const i of pT)e[i]=n[i];return e}function il(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],a=n[i];el(i)&&yt(a)?e[i]=a.map(s=>Uf(s,r)):e[i]=Uf(a,r)}return e}function xT(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function _T(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var wT="3.0.1";const _n=new Map,TT=Go.concat(ua);var Wf={id:"annotation",version:wT,beforeRegister(){u1("chart.js","4.0",Te.version)},afterRegister(){Te.register(xn)},afterUnregister(){Te.unregister(xn)},beforeInit(n){_n.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=_n.get(n),r=i.annotations=[];let a=e.annotations;lt(a)?Object.keys(a).forEach(s=>{const o=a[s];lt(o)&&(o.id=s,r.push(o))}):yt(a)&&r.push(...a),F1(r,n.scales)},afterDataLimits(n,t){const e=_n.get(n);N1(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=_n.get(n);E1(n,i,e),mT(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),I1(n,i,e)},beforeDatasetsDraw(n,t,e){ha(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){ha(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){ha(n,"beforeDraw",e.clip)},afterDraw(n,t,e){ha(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=_n.get(n);A1(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){_n.delete(n)},_getState(n){return _n.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!TT.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${xn[nl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:el,_fallback:!0},_indexable:el}},additionalOptionScopes:[""]};function ha(n,t,e){const{ctx:i,chartArea:r}=n,a=_n.get(n);e&&Si(i,r);const s=DT(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)MT(i,r,a,o);e&&Ci(i)}function DT(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function MT(n,t,e,i){const r=i.element;i.main?(wf(e,r,"beforeDraw"),r.draw(n,t),wf(e,r,"afterDraw")):r.draw(n,t)}const ga="24px",zf=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},ST=n=>(h.pushScopeId("data-v-1129d9a2"),n=n(),h.popScopeId(),n),CT=["aria-hidden"],kT={key:0,"data-testid":"kui-icon-svg-title"},OT=ST(()=>h.createElementVNode("path",{d:"M9 20C8.45 20 7.97917 19.8042 7.5875 19.4125C7.19583 19.0208 7 18.55 7 18C7 17.45 7.19583 16.9792 7.5875 16.5875C7.97917 16.1958 8.45 16 9 16C9.55 16 10.0208 16.1958 10.4125 16.5875C10.8042 16.9792 11 17.45 11 18C11 18.55 10.8042 19.0208 10.4125 19.4125C10.0208 19.8042 9.55 20 9 20ZM15 20C14.45 20 13.9792 19.8042 13.5875 19.4125C13.1958 19.0208 13 18.55 13 18C13 17.45 13.1958 16.9792 13.5875 16.5875C13.9792 16.1958 14.45 16 15 16C15.55 16 16.0208 16.1958 16.4125 16.5875C16.8042 16.9792 17 17.45 17 18C17 18.55 16.8042 19.0208 16.4125 19.4125C16.0208 19.8042 15.55 20 15 20ZM9 14C8.45 14 7.97917 13.8042 7.5875 13.4125C7.19583 13.0208 7 12.55 7 12C7 11.45 7.19583 10.9792 7.5875 10.5875C7.97917 10.1958 8.45 10 9 10C9.55 10 10.0208 10.1958 10.4125 10.5875C10.8042 10.9792 11 11.45 11 12C11 12.55 10.8042 13.0208 10.4125 13.4125C10.0208 13.8042 9.55 14 9 14ZM15 14C14.45 14 13.9792 13.8042 13.5875 13.4125C13.1958 13.0208 13 12.55 13 12C13 11.45 13.1958 10.9792 13.5875 10.5875C13.9792 10.1958 14.45 10 15 10C15.55 10 16.0208 10.1958 16.4125 10.5875C16.8042 10.9792 17 11.45 17 12C17 12.55 16.8042 13.0208 16.4125 13.4125C16.0208 13.8042 15.55 14 15 14ZM9 8C8.45 8 7.97917 7.80417 7.5875 7.4125C7.19583 7.02083 7 6.55 7 6C7 5.45 7.19583 4.97917 7.5875 4.5875C7.97917 4.19583 8.45 4 9 4C9.55 4 10.0208 4.19583 10.4125 4.5875C10.8042 4.97917 11 5.45 11 6C11 6.55 10.8042 7.02083 10.4125 7.4125C10.0208 7.80417 9.55 8 9 8ZM15 8C14.45 8 13.9792 7.80417 13.5875 7.4125C13.1958 7.02083 13 6.55 13 6C13 5.45 13.1958 4.97917 13.5875 4.5875C13.9792 4.19583 14.45 4 15 4C15.55 4 16.0208 4.19583 16.4125 4.5875C16.8042 4.97917 17 5.45 17 6C17 6.55 16.8042 7.02083 16.4125 7.4125C16.0208 7.80417 15.55 8 15 8Z",fill:"currentColor"},null,-1)),PT=h.defineComponent({__name:"DragIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ga,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const r=String(t.size).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return ga}),i=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(r,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon drag-icon","data-testid":"kui-icon-wrapper-drag-icon",style:h.normalizeStyle(i.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-drag-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",kT,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),OT],8,CT))]),_:1},8,["aria-hidden","style"]))}}),ET=zf(PT,[["__scopeId","data-v-1129d9a2"]]),AT=n=>(h.pushScopeId("data-v-fb1f3252"),n=n(),h.popScopeId(),n),RT=["aria-hidden"],LT={key:0,"data-testid":"kui-icon-svg-title"},IT=AT(()=>h.createElementVNode("path",{d:"M12.025 22.05C11.7583 22.05 11.5042 22 11.2625 21.9C11.0208 21.8 10.8 21.6583 10.6 21.475L2.575 13.45C2.39167 13.25 2.25 13.0292 2.15 12.7875C2.05 12.5458 2 12.2917 2 12.025C2 11.7583 2.05 11.5 2.15 11.25C2.25 11 2.39167 10.7833 2.575 10.6L10.6 2.575C10.8 2.375 11.0208 2.22917 11.2625 2.1375C11.5042 2.04583 11.7583 2 12.025 2C12.2917 2 12.55 2.04583 12.8 2.1375C13.05 2.22917 13.2667 2.375 13.45 2.575L21.475 10.6C21.675 10.7833 21.8208 11 21.9125 11.25C22.0042 11.5 22.05 11.7583 22.05 12.025C22.05 12.2917 22.0042 12.5458 21.9125 12.7875C21.8208 13.0292 21.675 13.25 21.475 13.45L13.45 21.475C13.2667 21.6583 13.05 21.8 12.8 21.9C12.55 22 12.2917 22.05 12.025 22.05ZM11.025 13.025H13.025V7.025H11.025V13.025ZM12.025 16.025C12.3083 16.025 12.5458 15.9292 12.7375 15.7375C12.9292 15.5458 13.025 15.3083 13.025 15.025C13.025 14.7417 12.9292 14.5042 12.7375 14.3125C12.5458 14.1208 12.3083 14.025 12.025 14.025C11.7417 14.025 11.5042 14.1208 11.3125 14.3125C11.1208 14.5042 11.025 14.7417 11.025 15.025C11.025 15.3083 11.1208 15.5458 11.3125 15.7375C11.5042 15.9292 11.7417 16.025 12.025 16.025Z",fill:"currentColor"},null,-1)),NT=h.defineComponent({__name:"WarningIcon",props:{title:{type:String,required:!1,default:""},color:{type:String,required:!1,default:"currentColor"},display:{type:String,required:!1,default:"block"},decorative:{type:Boolean,required:!1,default:!1},size:{type:[Number,String],required:!1,default:ga,validator:n=>{if(typeof n=="number"&&n>0)return!0;if(typeof n=="string"){const t=String(n).replace(/px/gi,""),e=Number(t);if(e&&!isNaN(e)&&Number.isInteger(e)&&e>0)return!0}return!1}},as:{type:String,required:!1,default:"span"}},setup(n){const t=n,e=h.computed(()=>{if(typeof t.size=="number"&&t.size>0)return`${t.size}px`;if(typeof t.size=="string"){const r=String(t.size).replace(/px/gi,""),a=Number(r);if(a&&!isNaN(a)&&Number.isInteger(a)&&a>0)return`${a}px`}return ga}),i=h.computed(()=>({boxSizing:"border-box",color:t.color,display:t.display,height:e.value,lineHeight:"0",width:e.value}));return(r,a)=>(h.openBlock(),h.createBlock(h.resolveDynamicComponent(n.as),{"aria-hidden":n.decorative?"true":void 0,class:"kui-icon warning-icon","data-testid":"kui-icon-wrapper-warning-icon",style:h.normalizeStyle(i.value)},{default:h.withCtx(()=>[(h.openBlock(),h.createElementBlock("svg",{"aria-hidden":n.decorative?"true":void 0,"data-testid":"kui-icon-svg-warning-icon",fill:"none",height:"100%",role:"img",viewBox:"0 0 24 24",width:"100%",xmlns:"http://www.w3.org/2000/svg"},[n.title?(h.openBlock(),h.createElementBlock("title",LT,h.toDisplayString(n.title),1)):h.createCommentVNode("",!0),IT],8,RT))]),_:1},8,["aria-hidden","style"]))}}),FT=zf(NT,[["__scopeId","data-v-fb1f3252"]]),UT="#6c7489",BT="#995c00",YT="20px",WT="40px",zT={class:"tooltip-title"},HT={class:"title font-bold"},$T={key:1,class:"subtitle"},jT={class:"tooltip"},VT={key:0},qT={class:"display-label"},XT={class:"display-value"},GT=h.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=t,i=n,r=h.ref(null),a=h.ref(!1),s=h.ref({x:0,y:0}),o=h.ref({x:0,y:0}),l=h.ref({left:i.left,top:i.top});h.watch(r,g=>{if(g){const{width:p,height:x}=g.getBoundingClientRect();e("dimensions",{width:p,height:x})}}),h.watch(()=>i.locked,g=>{g?(l.value.left=i.left,l.value.top=i.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(r.value){a.value=!0;const p=window.getComputedStyle(r.value),x=p.transform||p.webkitTransform||p.mozTransform,m=new DOMMatrix(x),b=m.m41,v=m.m42;s.value={x:b,y:v},o.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),a.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const p=g.clientX-o.value.x,x=g.clientY-o.value.y;l.value.left=`${s.value.x+p}px`,l.value.top=`${s.value.y+x}px`}))}function f(){a.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return(g,p)=>n.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:h.normalizeClass(["tooltip-container",{locked:n.locked}]),style:h.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[h.createElementVNode("div",zT,[h.createElementVNode("span",HT,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(ET),{key:0,class:"drag-icon",color:h.unref(UT)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",$T,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",jT,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.series,({backgroundColor:x,borderColor:m,label:b,value:v})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:b},[n.series.length?(h.openBlock(),h.createElementBlock("li",VT,[h.createElementVNode("div",{class:"tooltip-legend",style:h.normalizeStyle({background:x,"border-color":m})},null,4),h.createElementVNode("span",qT,h.toDisplayString(b),1),h.createElementVNode("span",XT,h.toDisplayString(v),1)])):h.createCommentVNode("",!0)],64))),128))])],38)):h.createCommentVNode("",!0)}}),Ke=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},rl=Ke(GT,[["__scopeId","data-v-a3fae01e"]]),KT=["onClick"],ZT=["title"],QT={key:0,class:"sub-label"},al=Ke(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,e=h.ref(),i=h.ref([]),r=h.ref(!1),a=h.inject("showLegendValues",!0),s=h.inject("legendPosition",h.ref(Bt.Right)),o=h.ref([]),l=()=>{const v=e.value;if(!v||!i.value||v.children.length===0)return 0;const _=v.children[0].getBoundingClientRect().top;for(const w of i.value)if(w.getBoundingClientRect().top>_)return!0;return!1},c=()=>{e.value&&s.value===Bt.Bottom&&(l()?r.value=!0:r.value=!1)},u=()=>{if(e.value&&s.value===Bt.Bottom){let v=0;i.value.forEach(w=>{const M=Array.from(w.children).reduce((C,k)=>C+k.offsetWidth,0);M>v&&(v=M)});const _=parseInt(WT,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${v+_}px)`}},d=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let v=0;v<t.items.length;v++)if(t.items[v].text!==o.value[v].text)return o.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{c(),d()&&u()},{immediate:!0,flush:"post"});const f=h.ref(0),g=h.ref(0),p=new ResizeObserver(Ux(v=>{const _=v[0],w=_.contentRect.width,M=_.contentRect.height;w!==f.value&&M===g.value&&(c(),u()),f.value=w,g.value=M},100));h.watch(()=>s.value,()=>{c(),u()}),h.onMounted(()=>{o.value=t.items,e.value&&p.observe(e.value),window.requestAnimationFrame(()=>{c(),u()})}),h.onBeforeUnmount(()=>{e.value&&p.unobserve(e.value)});const x=(v=0,_)=>{if(t.chartInstance===null)return;const w=t.chartInstance instanceof Te?t.chartInstance:t.chartInstance.chart;m(v,_)?w.hide(v,_):w.show(v,_),w.update()},m=(v=0,_)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const w=t.chartInstance instanceof Te?t.chartInstance:t.chartInstance.chart,M=w.getDatasetMeta(v);return M.dataset||_===void 0?w.isDatasetVisible(v):!(M.data.length&&M.data[_].hidden)},b=v=>({[Bt.Right]:"vertical",[Bt.Bottom]:"horizontal",[Bt.Hidden]:"hidden"})[v];return(v,_)=>h.unref(s)!==h.unref(Bt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:h.normalizeClass(["legend-container",b(h.unref(s))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:w,strokeStyle:M,text:C,datasetIndex:k,index:T,value:D})=>(h.openBlock(),h.createElementBlock("li",{key:C,ref_for:!0,ref_key:"legendItemsRef",ref:i,onClick:O=>x(k,T)},[h.createElementVNode("div",{class:"legend",style:h.normalizeStyle({background:w,"border-color":M})},null,4),h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!m(k,T)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":r.value}]),title:h.unref(s)===h.unref(Bt).Bottom&&C},h.toDisplayString(C),11,ZT),D&&h.unref(a)?(h.openBlock(),h.createElementBlock("div",QT,h.toDisplayString(D.formatted),1)):h.createCommentVNode("",!0)],2)],8,KT))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-8525349f"]]);let pa;const JT=new Uint8Array(16);function tD(){if(!pa&&(pa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!pa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return pa(JT)}const ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function eD(n,t=0){return ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]}const Hf={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function wn(n,t,e){if(Hf.randomUUID&&!t&&!n)return Hf.randomUUID();n=n||{};const i=n.random||(n.rng||tD)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(let r=0;r<16;++r)t[e+r]=i[r];return t}return eD(i)}const $f=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,a=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(a.x-a.width/2,a.y,a.width,i.bottom-a.y):e.strokeRect(r.left,a.y-a.height/2,a.x-r.left,a.height),e.restore()},jf={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&$f(n,this.clickedElements)},afterEvent:function(n,{event:t}){var r;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((r=n.options.interaction)==null?void 0:r.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,$f(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},Vf=6,nD="100%",iD="100%",rD=20,aD=20,qf=6,sD=0,oD=10,lD=10,cD=1,uD=Ke(h.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{i18n:e}=St.useI18n(),{translateUnit:i}=St.useTranslatedUnits(),r=h.ref(null),a=({chart:N},Y)=>{var J;const V=N.data,Z=(J=V.labels)==null?void 0:J.indexOf(Y);return V.datasets.reduce((F,L,Q)=>{if(N.isDatasetVisible(Q)){const G=L.data[Z];return isNaN(G)?F:F+G}else return F},0)},s=(N,Y,V,Z)=>{const J=Z==="horizontal";Y===null&&(Y=e.t("entityNoName"));const F={type:"label",yValue:G=>J?Y:a(G,Y),xValue:G=>J?a(G,Y):Y},L={...F,position:J?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>J?0:-Math.abs(K_()),content:G=>Co(a(G,Y),V)},Q={...F,content:G=>Wd(a(G,Y),Yd(G.chart,N)),position:J?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:G=>J?Bd(Co(a(G,Y),V)):0,color:Ud};return{[`${Y}-value`]:L,[`${Y}-percent`]:Q}},o=h.ref(null),l=h.ref(),c=h.ref(wn()),u=wn(),d=wn(),f=h.ref([]),g=h.ref(h.inject("legendPosition",Bt.Right)),p=h.ref({show:!1,top:"0px",left:"0px",text:"",offset:0}),x=h.toRef(t,"metricUnit"),m=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),b=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:x,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:m.value?ee.HORIZONTAL_BAR:ee.VERTICAL_BAR,chartTooltipSortFn:t.chartTooltipSortFn}),v=h.ref(0),_=()=>{var N;return t.annotations&&((N=t.chartData.labels)==null?void 0:N.reduce((Y,V)=>Object.assign(Y,s(t.chartData,V,x.value,t.orientation)),{}))},w={id:c.value,afterUpdate(N){v.value+=1,f.value=N.options.plugins.legend.labels.generateLabels(N).map(Y=>({...Y,value:t.legendValues&&t.legendValues[Y.text]})).sort(t.chartLegendSortFn)}},M={id:u,afterUpdate(N){N.options.plugins.annotation.annotations=t.annotations?_():{}}},T=[w,{id:"axisHover",afterEvent(N,Y){if(p.value.show=!1,Y.event.type==="mousemove"){const V=Y.event,Z=N.options.indexAxis,J=N.scales,F=N.scales[Z].getLabelForValue(Number(N.scales[Z].getValueForPixel(V[Z])));if((Q=>Q==="x"?V.y>J.x.top:V.x<J.y.right)(Z))if(b.locked||(b.showTooltip=!1),F.length>na){const G=N.canvas.getContext("2d").measureText(F).width,vt=Math.abs(Math.round(V.x-G*.5)),dt=Math.round(V.x+G*.5);p.value.left=Z==="x"?`${(vt>0?vt:dt)-p.value.offset}px`:`${V.x-G*.5-p.value.offset}px`,p.value.top=`${V.y-50}px`,p.value.show=!0,p.value.text=F}else p.value.show=!1;else p.value.show=!1}}},{id:d,afterUpdate(N){N.options.layout.padding.right=m.value?I.value:0}},jf,...t.annotations?[M]:[]],D=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),O=h.ref(0),E=h.ref(0),A=new ResizeObserver(N=>{O.value=N[0].contentRect.width,E.value=N[0].contentRect.height}),R=h.computed(()=>{var Y,V;const N=(V=(Y=t.chartData)==null?void 0:Y.labels)==null?void 0:V.length;return o.value&&N&&!m.value?`${Math.max(N*(rD+qf),O.value)}px`:nD}),q=h.computed(()=>{var Y,V;const N=(V=(Y=t.chartData)==null?void 0:Y.labels)==null?void 0:V.length;return o.value&&N&&m.value?`${Math.max(N*(aD+qf),E.value)}px`:iD});St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Te.register(Wf),r.value&&A.observe(r.value)}),h.onUnmounted(()=>{r.value&&A.unobserve(r.value)});const H=h.computed(()=>{const N=St.useBarChartOptions({tooltipState:b,legendID:c.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:m.value?"y":"x",numLabels:D});return{...N.value,plugins:{...N.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Vf}}}}),B=St.useChartJSCommon("bar",o,h.toRef(t,"chartData"),T,H),I=h.computed(()=>{v.value;const N=t.chartData.labels,Y=t.chartData.datasets,V=N.map((F,L)=>Y.reduce((Q,G)=>isNaN(Number(G.data[L]))?Q:Q+Number(G.data[L]),0)),Z=B.value?Yd(B.value,t.chartData):Z_(t.chartData);return V.map(F=>Bd(Co(F,x.value)+Wd(F,Z))).reduce((F,L)=>Math.max(F,L),0)+Vf});h.onBeforeUnmount(()=>{Te.unregister(Wf)});const rt={[Bt.Right]:"legend-row",[Bt.Bottom]:"column"},W=h.computed(()=>{if(l.value&&B.value){const N=window.devicePixelRatio,Y=B.value,V=Y.scales.y.width*N+cD,Z=(Y.scales.y.height+Y.scales.y.top+Y.scales.x.height)*N,J=l.value.getContext("2d");return J.scale(N,N),J.canvas.width=V,J.canvas.height=Z,J.canvas.style.width=`${V/N}px`,J.canvas.style.height=`${Z/N}px`,{scale:N,width:V*N,height:Z*N,targetCtx:J}}return null}),Ct=N=>{const Y=N.target;if(W.value&&B.value&&!m.value){const V=W.value.scale,Z=W.value.targetCtx,J=W.value.width,F=W.value.height,L=B.value,Q=L.canvas;Z.fillStyle="white",Y.scrollLeft>=sD&&Y.scrollLeft<=oD?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,J,F),Z.drawImage(Q,0,0,J,F,0,0,J,F),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,J,F)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(L.scales.y.height+L.scales.y.top+lD)*V,J,L.scales.x.height*V))}b.offsetY=Y.scrollTop,b.offsetX=Y.scrollLeft,p.value.offset=Y.scrollLeft},mt=({width:N,height:Y})=>{b.width=N,b.height=Y};h.watch(()=>t.orientation,()=>{var N;if(l.value&&W.value){const Y=W.value.width,V=W.value.height;((N=l.value)==null?void 0:N.getContext("2d")).clearRect(0,0,Y,V)}b.showTooltip=!1,b.locked=!1}),h.watch(()=>t.annotations,N=>{B.value&&(N?B.value.options.plugins.annotation.annotations=_(t.chartData):delete B.value.options.plugins.annotation.annotations)});const $=()=>{b.showTooltip&&(b.locked=!b.locked)};return(N,Y)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",rt[g.value]])},[h.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:r,class:"chart-container","on:scroll":Ct,onClick:Y[0]||(Y[0]=V=>$())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:R.value,height:q.value})},[h.createElementVNode("canvas",{ref_key:"canvas",ref:o},null,512)],4)],544),p.value.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:p.value.top,left:p.value.left})},h.toDisplayString(p.value.text),5)):h.createCommentVNode("",!0),h.createVNode(rl,{context:b.tooltipContext,left:b.left,locked:b.locked,series:b.tooltipSeries,"show-tooltip":b.showTooltip,"tooltip-title":n.tooltipTitle,top:b.top,onDimensions:mt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),h.createVNode(al,{id:c.value,"chart-instance":h.unref(B),items:f.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-b8bf74df"]]);/*!
|
|
25
25
|
* chartjs-adapter-date-fns v3.0.0
|
|
26
26
|
* https://www.chartjs.org
|
|
27
27
|
* (c) 2022 chartjs-adapter-date-fns Contributors
|
|
28
28
|
* Released under the MIT license
|
|
29
|
-
*/const uD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Sc._date.override({_id:"date-fns",formats:function(){return uD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=et(n):e==="string"&&(typeof t=="string"?n=dx(n,t,new Date,this.options):n=fd(n,this.options)),Ds(n)?n.getTime():null},format:function(n,t){return fv(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ji(n,t);case"second":return By(n,t);case"minute":return Fy(n,t);case"hour":return Ay(n,t);case"day":return Bu(n,t);case"week":return Yy(n,t);case"month":return ws(n,t);case"quarter":return Uy(n,t);case"year":return Wy(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return qr(n,t);case"second":return Qy(n,t);case"minute":return Gy(n,t);case"hour":return Xy(n,t);case"day":return zu(n,t);case"week":return Jy(n,t);case"month":return Vu(n,t);case"quarter":return Zy(n,t);case"year":return tb(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return gx(n);case"minute":return eb(n);case"hour":return hx(n);case"day":return Ts(n);case"week":return Yu(n);case"isoWeek":return Yu(n,{weekStartsOn:+e});case"month":return ib(n);case"quarter":return nb(n);case"year":return ab(n);default:return n}},endOf:function(n,t){switch(t){case"second":return ub(n);case"minute":return lb(n);case"hour":return sb(n);case"day":return $u(n);case"week":return ob(n);case"month":return ju(n);case"quarter":return cb(n);case"year":return rb(n);default:return n}}});const Xf={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},dD={type:{type:String,required:!0},...Xf,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},fD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function hi(n){return h.isProxy(n)?h.toRaw(n):n}function hD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function gD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Gf(n,t){n.labels=t}function Kf(n,t,e){const i=[];n.datasets=t.map(r=>{const a=n.datasets.find(s=>s[e]===r[e]);return!a||!r.data||i.includes(a)?{...r}:(i.push(a),Object.assign(a,r),a)})}function pD(n,t){const e={labels:[],datasets:[]};return Gf(e,n.labels),Kf(e,n.datasets,t),e}const mD=h.defineComponent({props:dD,setup(n,t){let{expose:e,slots:i}=t;const r=h.ref(null),a=h.shallowRef(null);e({chart:a});const s=()=>{if(!r.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=pD(u,g),v=hD(p,u);a.value=new Te(r.value,{type:c,data:v,options:{...d},plugins:f})},o=()=>{const c=h.toRaw(a.value);c&&(c.destroy(),a.value=null)},l=c=>{c.update(n.updateMode)};return h.onMounted(s),h.onBeforeUnmount(o),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const v=h.toRaw(a.value);if(!v)return;let m=!1;if(d){const y=hi(d),x=hi(g);y&&y!==x&&(gD(v,y),m=!0)}if(f){const y=hi(f.labels),x=hi(p.labels),_=hi(f.datasets),w=hi(p.datasets);y!==x&&(Gf(v.config.data,y),m=!0),_&&_!==w&&(Kf(v.config.data,_,n.datasetIdKey),m=!0)}m&&h.nextTick(()=>{l(v)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:r},[h.h("p",{},[i.default?i.default():""])])}});function sl(n,t){return Te.register(t),h.defineComponent({props:Xf,setup(e,i){let{expose:r}=i;const a=h.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return r({chart:a}),()=>h.h(mD,fD({ref:s},{type:n,...e}))}})}const yD=sl("bar",Pi),Zf=sl("doughnut",hn),bD=sl("line",Ei),vD={class:"chart-container"},xD=h.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Bt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),i=h.ref(wn()),r=h.ref(wn()),a=h.ref([]),s=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:ee.DOUGHNUT}),o={id:i.value,afterUpdate(v){a.value=v.options.plugins.legend.labels.generateLabels(v).map(m=>({...m,value:t.legendValues&&t.legendValues[m.text],hidden:!1}))}},l=h.computed(()=>[o]),c=h.computed(()=>[t.chartData.datasets.reduce((m,y)=>(m.labels.push(y.label),m.backgroundColor.push(y.backgroundColor),m.borderColor.push(Ji(y.backgroundColor,50)),m.data.push(y.data.reduce((x,_)=>x+_,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=h.computed(()=>({...t.chartData,datasets:c.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:d}=St.useDoughnutChartOptions({tooltipState:s,legendID:i.value}),f=h.ref(),g=v=>({[Bt.Right]:"legend-row",[Bt.Bottom]:"column",[Bt.Hidden]:"hidden"})[v],p=({width:v,height:m})=>{s.width=v,s.height=m};return(v,m)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[h.createElementVNode("div",vD,[h.createVNode(h.unref(Zf),{ref_key:"chartInstance",ref:f,"chart-id":r.value,data:u.value,options:h.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),h.createVNode(rl,{left:s.left,series:s.tooltipSeries,"show-tooltip":s.showTooltip,"tooltip-title":n.tooltipTitle,top:s.top,unit:n.metricUnit,onDimensions:p},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),h.createVNode(al,{id:i.value,"chart-instance":f.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),_D=Ke(xD,[["__scopeId","data-v-b3095003"]]);var Hn=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(Hn||{}),ma={exports:{}};ma.exports,function(n,t){var e=200,i="Expected a function",r="__lodash_hash_undefined__",a=1,s=2,o=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",f="[object Date]",g="[object Error]",p="[object Function]",v="[object GeneratorFunction]",m="[object Map]",y="[object Number]",x="[object Object]",_="[object Promise]",w="[object RegExp]",M="[object Set]",C="[object String]",k="[object Symbol]",T="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",E="[object Float32Array]",A="[object Float64Array]",R="[object Int8Array]",q="[object Int16Array]",H="[object Int32Array]",B="[object Uint8Array]",I="[object Uint8ClampedArray]",rt="[object Uint16Array]",W="[object Uint32Array]",Ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mt=/^\w*$/,$=/^\./,N=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,V=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,F={};F[E]=F[A]=F[R]=F[q]=F[H]=F[B]=F[I]=F[rt]=F[W]=!0,F[c]=F[u]=F[D]=F[d]=F[O]=F[f]=F[g]=F[p]=F[m]=F[y]=F[x]=F[w]=F[M]=F[C]=F[T]=!1;var L=typeof ge=="object"&&ge&&ge.Object===Object&&ge,Q=typeof self=="object"&&self&&self.Object===Object&&self,G=L||Q||Function("return this")(),vt=t&&!t.nodeType&&t,dt=vt&&!0&&n&&!n.nodeType&&n,It=dt&&dt.exports===vt,Dt=It&&L.process,ot=function(){try{return Dt&&Dt.binding("util")}catch{}}(),zt=ot&&ot.isTypedArray;function Gt(b,S){for(var P=-1,U=b?b.length:0;++P<U;)if(S(b[P],P,b))return!0;return!1}function Me(b){return function(S){return S==null?void 0:S[b]}}function Ee(b,S){for(var P=-1,U=Array(b);++P<b;)U[P]=S(P);return U}function pe(b){return function(S){return b(S)}}function Rt(b,S){return b==null?void 0:b[S]}function Nt(b){var S=!1;if(b!=null&&typeof b.toString!="function")try{S=!!(b+"")}catch{}return S}function Ze(b){var S=-1,P=Array(b.size);return b.forEach(function(U,at){P[++S]=[at,U]}),P}function Mt(b,S){return function(P){return b(S(P))}}function Dn(b){var S=-1,P=Array(b.size);return b.forEach(function(U){P[++S]=U}),P}var Ae=Array.prototype,Qe=Function.prototype,xe=Object.prototype,Se=G["__core-js_shared__"],Re=function(){var b=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}(),le=Qe.toString,me=xe.hasOwnProperty,Kt=xe.toString,ya=RegExp("^"+le.call(me).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gi=G.Symbol,dh=G.Uint8Array,YM=xe.propertyIsEnumerable,WM=Ae.splice,zM=Mt(Object.keys,Object),dl=pi(G,"DataView"),lr=pi(G,"Map"),fl=pi(G,"Promise"),hl=pi(G,"Set"),gl=pi(G,"WeakMap"),cr=pi(Object,"create"),HM=jn(dl),$M=jn(lr),jM=jn(fl),VM=jn(hl),qM=jn(gl),ba=gi?gi.prototype:void 0,pl=ba?ba.valueOf:void 0,fh=ba?ba.toString:void 0;function $n(b){var S=-1,P=b?b.length:0;for(this.clear();++S<P;){var U=b[S];this.set(U[0],U[1])}}function XM(){this.__data__=cr?cr(null):{}}function GM(b){return this.has(b)&&delete this.__data__[b]}function KM(b){var S=this.__data__;if(cr){var P=S[b];return P===r?void 0:P}return me.call(S,b)?S[b]:void 0}function ZM(b){var S=this.__data__;return cr?S[b]!==void 0:me.call(S,b)}function QM(b,S){var P=this.__data__;return P[b]=cr&&S===void 0?r:S,this}$n.prototype.clear=XM,$n.prototype.delete=GM,$n.prototype.get=KM,$n.prototype.has=ZM,$n.prototype.set=QM;function Je(b){var S=-1,P=b?b.length:0;for(this.clear();++S<P;){var U=b[S];this.set(U[0],U[1])}}function JM(){this.__data__=[]}function tS(b){var S=this.__data__,P=xa(S,b);if(P<0)return!1;var U=S.length-1;return P==U?S.pop():WM.call(S,P,1),!0}function eS(b){var S=this.__data__,P=xa(S,b);return P<0?void 0:S[P][1]}function nS(b){return xa(this.__data__,b)>-1}function iS(b,S){var P=this.__data__,U=xa(P,b);return U<0?P.push([b,S]):P[U][1]=S,this}Je.prototype.clear=JM,Je.prototype.delete=tS,Je.prototype.get=eS,Je.prototype.has=nS,Je.prototype.set=iS;function tn(b){var S=-1,P=b?b.length:0;for(this.clear();++S<P;){var U=b[S];this.set(U[0],U[1])}}function rS(){this.__data__={hash:new $n,map:new(lr||Je),string:new $n}}function aS(b){return _a(this,b).delete(b)}function sS(b){return _a(this,b).get(b)}function oS(b){return _a(this,b).has(b)}function lS(b,S){return _a(this,b).set(b,S),this}tn.prototype.clear=rS,tn.prototype.delete=aS,tn.prototype.get=sS,tn.prototype.has=oS,tn.prototype.set=lS;function va(b){var S=-1,P=b?b.length:0;for(this.__data__=new tn;++S<P;)this.add(b[S])}function cS(b){return this.__data__.set(b,r),this}function uS(b){return this.__data__.has(b)}va.prototype.add=va.prototype.push=cS,va.prototype.has=uS;function en(b){this.__data__=new Je(b)}function dS(){this.__data__=new Je}function fS(b){return this.__data__.delete(b)}function hS(b){return this.__data__.get(b)}function gS(b){return this.__data__.has(b)}function pS(b,S){var P=this.__data__;if(P instanceof Je){var U=P.__data__;if(!lr||U.length<e-1)return U.push([b,S]),this;P=this.__data__=new tn(U)}return P.set(b,S),this}en.prototype.clear=dS,en.prototype.delete=fS,en.prototype.get=hS,en.prototype.has=gS,en.prototype.set=pS;function mS(b,S){var P=Vn(b)||xh(b)?Ee(b.length,String):[],U=P.length,at=!!U;for(var tt in b)(S||me.call(b,tt))&&!(at&&(tt=="length"||mh(tt,U)))&&P.push(tt);return P}function xa(b,S){for(var P=b.length;P--;)if(vh(b[P][0],S))return P;return-1}var yS=ES();function bS(b,S){return b&&yS(b,S,Sa)}function hh(b,S){S=wa(S,b)?[S]:gh(S);for(var P=0,U=S.length;b!=null&&P<U;)b=b[Ta(S[P++])];return P&&P==U?b:void 0}function vS(b){return Kt.call(b)}function xS(b,S){return b!=null&&S in Object(b)}function ml(b,S,P,U,at){return b===S?!0:b==null||S==null||!Da(b)&&!Ma(S)?b!==b&&S!==S:_S(b,S,ml,P,U,at)}function _S(b,S,P,U,at,tt){var xt=Vn(b),Ot=Vn(S),Ht=u,Qt=u;xt||(Ht=Mn(b),Ht=Ht==c?x:Ht),Ot||(Qt=Mn(S),Qt=Qt==c?x:Qt);var ce=Ht==x&&!Nt(b),ye=Qt==x&&!Nt(S),Jt=Ht==Qt;if(Jt&&!ce)return tt||(tt=new en),xt||WS(b)?ph(b,S,P,U,at,tt):AS(b,S,Ht,P,U,at,tt);if(!(at&s)){var Ce=ce&&me.call(b,"__wrapped__"),ke=ye&&me.call(S,"__wrapped__");if(Ce||ke){var Sn=Ce?b.value():b,nn=ke?S.value():S;return tt||(tt=new en),P(Sn,nn,U,at,tt)}}return Jt?(tt||(tt=new en),RS(b,S,P,U,at,tt)):!1}function wS(b,S,P,U){var at=P.length,tt=at,xt=!U;if(b==null)return!tt;for(b=Object(b);at--;){var Ot=P[at];if(xt&&Ot[2]?Ot[1]!==b[Ot[0]]:!(Ot[0]in b))return!1}for(;++at<tt;){Ot=P[at];var Ht=Ot[0],Qt=b[Ht],ce=Ot[1];if(xt&&Ot[2]){if(Qt===void 0&&!(Ht in b))return!1}else{var ye=new en;if(U)var Jt=U(Qt,ce,Ht,b,S,ye);if(!(Jt===void 0?ml(ce,Qt,U,a|s,ye):Jt))return!1}}return!0}function TS(b){if(!Da(b)||FS(b))return!1;var S=wh(b)||Nt(b)?ya:Z;return S.test(jn(b))}function DS(b){return Ma(b)&&bl(b.length)&&!!F[Kt.call(b)]}function MS(b){return typeof b=="function"?b:b==null?VS:typeof b=="object"?Vn(b)?kS(b[0],b[1]):CS(b):qS(b)}function SS(b){if(!US(b))return zM(b);var S=[];for(var P in Object(b))me.call(b,P)&&P!="constructor"&&S.push(P);return S}function CS(b){var S=LS(b);return S.length==1&&S[0][2]?bh(S[0][0],S[0][1]):function(P){return P===b||wS(P,b,S)}}function kS(b,S){return wa(b)&&yh(S)?bh(Ta(b),S):function(P){var U=HS(P,b);return U===void 0&&U===S?$S(P,b):ml(S,U,void 0,a|s)}}function OS(b){return function(S){return hh(S,b)}}function PS(b){if(typeof b=="string")return b;if(vl(b))return fh?fh.call(b):"";var S=b+"";return S=="0"&&1/b==-o?"-0":S}function gh(b){return Vn(b)?b:BS(b)}function ES(b){return function(S,P,U){for(var at=-1,tt=Object(S),xt=U(S),Ot=xt.length;Ot--;){var Ht=xt[b?Ot:++at];if(P(tt[Ht],Ht,tt)===!1)break}return S}}function ph(b,S,P,U,at,tt){var xt=at&s,Ot=b.length,Ht=S.length;if(Ot!=Ht&&!(xt&&Ht>Ot))return!1;var Qt=tt.get(b);if(Qt&&tt.get(S))return Qt==S;var ce=-1,ye=!0,Jt=at&a?new va:void 0;for(tt.set(b,S),tt.set(S,b);++ce<Ot;){var Ce=b[ce],ke=S[ce];if(U)var Sn=xt?U(ke,Ce,ce,S,b,tt):U(Ce,ke,ce,b,S,tt);if(Sn!==void 0){if(Sn)continue;ye=!1;break}if(Jt){if(!Gt(S,function(nn,qn){if(!Jt.has(qn)&&(Ce===nn||P(Ce,nn,U,at,tt)))return Jt.add(qn)})){ye=!1;break}}else if(!(Ce===ke||P(Ce,ke,U,at,tt))){ye=!1;break}}return tt.delete(b),tt.delete(S),ye}function AS(b,S,P,U,at,tt,xt){switch(P){case O:if(b.byteLength!=S.byteLength||b.byteOffset!=S.byteOffset)return!1;b=b.buffer,S=S.buffer;case D:return!(b.byteLength!=S.byteLength||!U(new dh(b),new dh(S)));case d:case f:case y:return vh(+b,+S);case g:return b.name==S.name&&b.message==S.message;case w:case C:return b==S+"";case m:var Ot=Ze;case M:var Ht=tt&s;if(Ot||(Ot=Dn),b.size!=S.size&&!Ht)return!1;var Qt=xt.get(b);if(Qt)return Qt==S;tt|=a,xt.set(b,S);var ce=ph(Ot(b),Ot(S),U,at,tt,xt);return xt.delete(b),ce;case k:if(pl)return pl.call(b)==pl.call(S)}return!1}function RS(b,S,P,U,at,tt){var xt=at&s,Ot=Sa(b),Ht=Ot.length,Qt=Sa(S),ce=Qt.length;if(Ht!=ce&&!xt)return!1;for(var ye=Ht;ye--;){var Jt=Ot[ye];if(!(xt?Jt in S:me.call(S,Jt)))return!1}var Ce=tt.get(b);if(Ce&&tt.get(S))return Ce==S;var ke=!0;tt.set(b,S),tt.set(S,b);for(var Sn=xt;++ye<Ht;){Jt=Ot[ye];var nn=b[Jt],qn=S[Jt];if(U)var Th=xt?U(qn,nn,Jt,S,b,tt):U(nn,qn,Jt,b,S,tt);if(!(Th===void 0?nn===qn||P(nn,qn,U,at,tt):Th)){ke=!1;break}Sn||(Sn=Jt=="constructor")}if(ke&&!Sn){var Ca=b.constructor,ka=S.constructor;Ca!=ka&&"constructor"in b&&"constructor"in S&&!(typeof Ca=="function"&&Ca instanceof Ca&&typeof ka=="function"&&ka instanceof ka)&&(ke=!1)}return tt.delete(b),tt.delete(S),ke}function _a(b,S){var P=b.__data__;return NS(S)?P[typeof S=="string"?"string":"hash"]:P.map}function LS(b){for(var S=Sa(b),P=S.length;P--;){var U=S[P],at=b[U];S[P]=[U,at,yh(at)]}return S}function pi(b,S){var P=Rt(b,S);return TS(P)?P:void 0}var Mn=vS;(dl&&Mn(new dl(new ArrayBuffer(1)))!=O||lr&&Mn(new lr)!=m||fl&&Mn(fl.resolve())!=_||hl&&Mn(new hl)!=M||gl&&Mn(new gl)!=T)&&(Mn=function(b){var S=Kt.call(b),P=S==x?b.constructor:void 0,U=P?jn(P):void 0;if(U)switch(U){case HM:return O;case $M:return m;case jM:return _;case VM:return M;case qM:return T}return S});function IS(b,S,P){S=wa(S,b)?[S]:gh(S);for(var U,at=-1,xt=S.length;++at<xt;){var tt=Ta(S[at]);if(!(U=b!=null&&P(b,tt)))break;b=b[tt]}if(U)return U;var xt=b?b.length:0;return!!xt&&bl(xt)&&mh(tt,xt)&&(Vn(b)||xh(b))}function mh(b,S){return S=S??l,!!S&&(typeof b=="number"||J.test(b))&&b>-1&&b%1==0&&b<S}function wa(b,S){if(Vn(b))return!1;var P=typeof b;return P=="number"||P=="symbol"||P=="boolean"||b==null||vl(b)?!0:mt.test(b)||!Ct.test(b)||S!=null&&b in Object(S)}function NS(b){var S=typeof b;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?b!=="__proto__":b===null}function FS(b){return!!Re&&Re in b}function US(b){var S=b&&b.constructor,P=typeof S=="function"&&S.prototype||xe;return b===P}function yh(b){return b===b&&!Da(b)}function bh(b,S){return function(P){return P==null?!1:P[b]===S&&(S!==void 0||b in Object(P))}}var BS=yl(function(b){b=zS(b);var S=[];return $.test(b)&&S.push(""),b.replace(N,function(P,U,at,tt){S.push(at?tt.replace(V,"$1"):U||P)}),S});function Ta(b){if(typeof b=="string"||vl(b))return b;var S=b+"";return S=="0"&&1/b==-o?"-0":S}function jn(b){if(b!=null){try{return le.call(b)}catch{}try{return b+""}catch{}}return""}function yl(b,S){if(typeof b!="function"||S&&typeof S!="function")throw new TypeError(i);var P=function(){var U=arguments,at=S?S.apply(this,U):U[0],tt=P.cache;if(tt.has(at))return tt.get(at);var xt=b.apply(this,U);return P.cache=tt.set(at,xt),xt};return P.cache=new(yl.Cache||tn),P}yl.Cache=tn;function vh(b,S){return b===S||b!==b&&S!==S}function xh(b){return YS(b)&&me.call(b,"callee")&&(!YM.call(b,"callee")||Kt.call(b)==c)}var Vn=Array.isArray;function _h(b){return b!=null&&bl(b.length)&&!wh(b)}function YS(b){return Ma(b)&&_h(b)}function wh(b){var S=Da(b)?Kt.call(b):"";return S==p||S==v}function bl(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=l}function Da(b){var S=typeof b;return!!b&&(S=="object"||S=="function")}function Ma(b){return!!b&&typeof b=="object"}function vl(b){return typeof b=="symbol"||Ma(b)&&Kt.call(b)==k}var WS=zt?pe(zt):DS;function zS(b){return b==null?"":PS(b)}function HS(b,S,P){var U=b==null?void 0:hh(b,S);return U===void 0?P:U}function $S(b,S){return b!=null&&IS(b,S,xS)}function Sa(b){return _h(b)?mS(b):SS(b)}function jS(b,S){var P={};return S=MS(S),bS(b,function(U,at,tt){P[S(U,at,tt)]=U}),P}function VS(b){return b}function qS(b){return wa(b)?Me(Ta(b)):OS(b)}n.exports=jS}(ma,ma.exports);var wD=ma.exports;const TD=Fn(wD);var DD=1/0,MD=9007199254740991,SD="[object Arguments]",CD="[object Function]",kD="[object GeneratorFunction]",OD="[object Symbol]",PD=typeof ge=="object"&&ge&&ge.Object===Object&&ge,ED=typeof self=="object"&&self&&self.Object===Object&&self,AD=PD||ED||Function("return this")();function RD(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function LD(n,t){for(var e=-1,i=n?n.length:0,r=Array(i);++e<i;)r[e]=t(n[e],e,n);return r}function ID(n,t){for(var e=-1,i=t.length,r=n.length;++e<i;)n[r+e]=t[e];return n}var ol=Object.prototype,ND=ol.hasOwnProperty,ll=ol.toString,Qf=AD.Symbol,FD=ol.propertyIsEnumerable,Jf=Qf?Qf.isConcatSpreadable:void 0,th=Math.max;function eh(n,t,e,i,r){var a=-1,s=n.length;for(e||(e=WD),r||(r=[]);++a<s;){var o=n[a];t>0&&e(o)?t>1?eh(o,t-1,e,i,r):ID(r,o):i||(r[r.length]=o)}return r}function UD(n,t){return n=Object(n),BD(n,t,function(e,i){return i in n})}function BD(n,t,e){for(var i=-1,r=t.length,a={};++i<r;){var s=t[i],o=n[s];e(o,s)&&(a[s]=o)}return a}function YD(n,t){return t=th(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,r=th(e.length-t,0),a=Array(r);++i<r;)a[i]=e[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=e[i];return s[t]=a,RD(n,this,s)}}function WD(n){return $D(n)||HD(n)||!!(Jf&&n&&n[Jf])}function zD(n){if(typeof n=="string"||KD(n))return n;var t=n+"";return t=="0"&&1/n==-DD?"-0":t}function HD(n){return VD(n)&&ND.call(n,"callee")&&(!FD.call(n,"callee")||ll.call(n)==SD)}var $D=Array.isArray;function jD(n){return n!=null&&XD(n.length)&&!qD(n)}function VD(n){return nh(n)&&jD(n)}function qD(n){var t=GD(n)?ll.call(n):"";return t==CD||t==kD}function XD(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=MD}function GD(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function nh(n){return!!n&&typeof n=="object"}function KD(n){return typeof n=="symbol"||nh(n)&&ll.call(n)==OD}var ZD=YD(function(n,t){return n==null?{}:UD(n,LD(eh(t,1),zD))}),QD=ZD;const JD=Fn(QD);var ih={exports:{}};(function(n,t){(function(e,i){i()})(ge,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function r(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ge=="object"&&ge.global===ge?ge:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,d){var f=s.URL||s.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?a(g):r(g.href)?i(c,u,d):a(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){a(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(r(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){a(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,v=/CriOS\/[\d]+/.test(navigator.userAgent);if((v||g&&p||o)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var _=m.result;_=v?_:_.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=_:location=_,f=null},m.readAsDataURL(c)}else{var y=s.URL||s.webkitURL,x=y.createObjectURL(c);f?f.location=x:location.href=x,f=null,setTimeout(function(){y.revokeObjectURL(x)},4e4)}});s.saveAs=l.saveAs=l,n.exports=l})})(ih);var tM=ih.exports,rh={exports:{}};/* @license
|
|
29
|
+
*/const dD={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Sc._date.override({_id:"date-fns",formats:function(){return dD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=et(n):e==="string"&&(typeof t=="string"?n=dx(n,t,new Date,this.options):n=fd(n,this.options)),Ds(n)?n.getTime():null},format:function(n,t){return fv(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return ji(n,t);case"second":return By(n,t);case"minute":return Fy(n,t);case"hour":return Ay(n,t);case"day":return Bu(n,t);case"week":return Yy(n,t);case"month":return ws(n,t);case"quarter":return Uy(n,t);case"year":return Wy(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return qr(n,t);case"second":return Qy(n,t);case"minute":return Gy(n,t);case"hour":return Xy(n,t);case"day":return zu(n,t);case"week":return Jy(n,t);case"month":return Vu(n,t);case"quarter":return Zy(n,t);case"year":return tb(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return gx(n);case"minute":return eb(n);case"hour":return hx(n);case"day":return Ts(n);case"week":return Yu(n);case"isoWeek":return Yu(n,{weekStartsOn:+e});case"month":return ib(n);case"quarter":return nb(n);case"year":return ab(n);default:return n}},endOf:function(n,t){switch(t){case"second":return ub(n);case"minute":return lb(n);case"hour":return sb(n);case"day":return $u(n);case"week":return ob(n);case"month":return ju(n);case"quarter":return cb(n);case"year":return rb(n);default:return n}}});const Xf={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},fD={type:{type:String,required:!0},...Xf,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},hD=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function hi(n){return h.isProxy(n)?h.toRaw(n):n}function gD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function pD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Gf(n,t){n.labels=t}function Kf(n,t,e){const i=[];n.datasets=t.map(r=>{const a=n.datasets.find(s=>s[e]===r[e]);return!a||!r.data||i.includes(a)?{...r}:(i.push(a),Object.assign(a,r),a)})}function mD(n,t){const e={labels:[],datasets:[]};return Gf(e,n.labels),Kf(e,n.datasets,t),e}const yD=h.defineComponent({props:fD,setup(n,t){let{expose:e,slots:i}=t;const r=h.ref(null),a=h.shallowRef(null);e({chart:a});const s=()=>{if(!r.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=mD(u,g),x=gD(p,u);a.value=new Te(r.value,{type:c,data:x,options:{...d},plugins:f})},o=()=>{const c=h.toRaw(a.value);c&&(c.destroy(),a.value=null)},l=c=>{c.update(n.updateMode)};return h.onMounted(s),h.onBeforeUnmount(o),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const x=h.toRaw(a.value);if(!x)return;let m=!1;if(d){const b=hi(d),v=hi(g);b&&b!==v&&(pD(x,b),m=!0)}if(f){const b=hi(f.labels),v=hi(p.labels),_=hi(f.datasets),w=hi(p.datasets);b!==v&&(Gf(x.config.data,b),m=!0),_&&_!==w&&(Kf(x.config.data,_,n.datasetIdKey),m=!0)}m&&h.nextTick(()=>{l(x)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:r},[h.h("p",{},[i.default?i.default():""])])}});function sl(n,t){return Te.register(t),h.defineComponent({props:Xf,setup(e,i){let{expose:r}=i;const a=h.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return r({chart:a}),()=>h.h(yD,hD({ref:s},{type:n,...e}))}})}const bD=sl("bar",Pi),Zf=sl("doughnut",hn),vD=sl("line",Ei),xD={class:"chart-container"},_D=h.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Bt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),i=h.ref(wn()),r=h.ref(wn()),a=h.ref([]),s=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:ee.DOUGHNUT}),o={id:i.value,afterUpdate(x){a.value=x.options.plugins.legend.labels.generateLabels(x).map(m=>({...m,value:t.legendValues&&t.legendValues[m.text],hidden:!1}))}},l=h.computed(()=>[o]),c=h.computed(()=>[t.chartData.datasets.reduce((m,b)=>(m.labels.push(b.label),m.backgroundColor.push(b.backgroundColor),m.borderColor.push(Ji(b.backgroundColor,50)),m.data.push(b.data.reduce((v,_)=>v+_,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=h.computed(()=>({...t.chartData,datasets:c.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:d}=St.useDoughnutChartOptions({tooltipState:s,legendID:i.value}),f=h.ref(),g=x=>({[Bt.Right]:"legend-row",[Bt.Bottom]:"column",[Bt.Hidden]:"hidden"})[x],p=({width:x,height:m})=>{s.width=x,s.height=m};return(x,m)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[h.createElementVNode("div",xD,[h.createVNode(h.unref(Zf),{ref_key:"chartInstance",ref:f,"chart-id":r.value,data:u.value,options:h.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),h.createVNode(rl,{left:s.left,series:s.tooltipSeries,"show-tooltip":s.showTooltip,"tooltip-title":n.tooltipTitle,top:s.top,unit:n.metricUnit,onDimensions:p},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),h.createVNode(al,{id:i.value,"chart-instance":f.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),wD=Ke(_D,[["__scopeId","data-v-b3095003"]]);var Hn=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(Hn||{}),ma={exports:{}};ma.exports,function(n,t){var e=200,i="Expected a function",r="__lodash_hash_undefined__",a=1,s=2,o=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",f="[object Date]",g="[object Error]",p="[object Function]",x="[object GeneratorFunction]",m="[object Map]",b="[object Number]",v="[object Object]",_="[object Promise]",w="[object RegExp]",M="[object Set]",C="[object String]",k="[object Symbol]",T="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",E="[object Float32Array]",A="[object Float64Array]",R="[object Int8Array]",q="[object Int16Array]",H="[object Int32Array]",B="[object Uint8Array]",I="[object Uint8ClampedArray]",rt="[object Uint16Array]",W="[object Uint32Array]",Ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,mt=/^\w*$/,$=/^\./,N=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,V=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,J=/^(?:0|[1-9]\d*)$/,F={};F[E]=F[A]=F[R]=F[q]=F[H]=F[B]=F[I]=F[rt]=F[W]=!0,F[c]=F[u]=F[D]=F[d]=F[O]=F[f]=F[g]=F[p]=F[m]=F[b]=F[v]=F[w]=F[M]=F[C]=F[T]=!1;var L=typeof ge=="object"&&ge&&ge.Object===Object&&ge,Q=typeof self=="object"&&self&&self.Object===Object&&self,G=L||Q||Function("return this")(),vt=t&&!t.nodeType&&t,dt=vt&&!0&&n&&!n.nodeType&&n,It=dt&&dt.exports===vt,Dt=It&&L.process,ot=function(){try{return Dt&&Dt.binding("util")}catch{}}(),zt=ot&&ot.isTypedArray;function Gt(y,S){for(var P=-1,U=y?y.length:0;++P<U;)if(S(y[P],P,y))return!0;return!1}function Me(y){return function(S){return S==null?void 0:S[y]}}function Ee(y,S){for(var P=-1,U=Array(y);++P<y;)U[P]=S(P);return U}function pe(y){return function(S){return y(S)}}function Rt(y,S){return y==null?void 0:y[S]}function Nt(y){var S=!1;if(y!=null&&typeof y.toString!="function")try{S=!!(y+"")}catch{}return S}function Ze(y){var S=-1,P=Array(y.size);return y.forEach(function(U,at){P[++S]=[at,U]}),P}function Mt(y,S){return function(P){return y(S(P))}}function Dn(y){var S=-1,P=Array(y.size);return y.forEach(function(U){P[++S]=U}),P}var Ae=Array.prototype,Qe=Function.prototype,xe=Object.prototype,Se=G["__core-js_shared__"],Re=function(){var y=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),le=Qe.toString,me=xe.hasOwnProperty,Kt=xe.toString,ya=RegExp("^"+le.call(me).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gi=G.Symbol,dh=G.Uint8Array,WM=xe.propertyIsEnumerable,zM=Ae.splice,HM=Mt(Object.keys,Object),dl=pi(G,"DataView"),lr=pi(G,"Map"),fl=pi(G,"Promise"),hl=pi(G,"Set"),gl=pi(G,"WeakMap"),cr=pi(Object,"create"),$M=jn(dl),jM=jn(lr),VM=jn(fl),qM=jn(hl),XM=jn(gl),ba=gi?gi.prototype:void 0,pl=ba?ba.valueOf:void 0,fh=ba?ba.toString:void 0;function $n(y){var S=-1,P=y?y.length:0;for(this.clear();++S<P;){var U=y[S];this.set(U[0],U[1])}}function GM(){this.__data__=cr?cr(null):{}}function KM(y){return this.has(y)&&delete this.__data__[y]}function ZM(y){var S=this.__data__;if(cr){var P=S[y];return P===r?void 0:P}return me.call(S,y)?S[y]:void 0}function QM(y){var S=this.__data__;return cr?S[y]!==void 0:me.call(S,y)}function JM(y,S){var P=this.__data__;return P[y]=cr&&S===void 0?r:S,this}$n.prototype.clear=GM,$n.prototype.delete=KM,$n.prototype.get=ZM,$n.prototype.has=QM,$n.prototype.set=JM;function Je(y){var S=-1,P=y?y.length:0;for(this.clear();++S<P;){var U=y[S];this.set(U[0],U[1])}}function tS(){this.__data__=[]}function eS(y){var S=this.__data__,P=xa(S,y);if(P<0)return!1;var U=S.length-1;return P==U?S.pop():zM.call(S,P,1),!0}function nS(y){var S=this.__data__,P=xa(S,y);return P<0?void 0:S[P][1]}function iS(y){return xa(this.__data__,y)>-1}function rS(y,S){var P=this.__data__,U=xa(P,y);return U<0?P.push([y,S]):P[U][1]=S,this}Je.prototype.clear=tS,Je.prototype.delete=eS,Je.prototype.get=nS,Je.prototype.has=iS,Je.prototype.set=rS;function tn(y){var S=-1,P=y?y.length:0;for(this.clear();++S<P;){var U=y[S];this.set(U[0],U[1])}}function aS(){this.__data__={hash:new $n,map:new(lr||Je),string:new $n}}function sS(y){return _a(this,y).delete(y)}function oS(y){return _a(this,y).get(y)}function lS(y){return _a(this,y).has(y)}function cS(y,S){return _a(this,y).set(y,S),this}tn.prototype.clear=aS,tn.prototype.delete=sS,tn.prototype.get=oS,tn.prototype.has=lS,tn.prototype.set=cS;function va(y){var S=-1,P=y?y.length:0;for(this.__data__=new tn;++S<P;)this.add(y[S])}function uS(y){return this.__data__.set(y,r),this}function dS(y){return this.__data__.has(y)}va.prototype.add=va.prototype.push=uS,va.prototype.has=dS;function en(y){this.__data__=new Je(y)}function fS(){this.__data__=new Je}function hS(y){return this.__data__.delete(y)}function gS(y){return this.__data__.get(y)}function pS(y){return this.__data__.has(y)}function mS(y,S){var P=this.__data__;if(P instanceof Je){var U=P.__data__;if(!lr||U.length<e-1)return U.push([y,S]),this;P=this.__data__=new tn(U)}return P.set(y,S),this}en.prototype.clear=fS,en.prototype.delete=hS,en.prototype.get=gS,en.prototype.has=pS,en.prototype.set=mS;function yS(y,S){var P=Vn(y)||xh(y)?Ee(y.length,String):[],U=P.length,at=!!U;for(var tt in y)(S||me.call(y,tt))&&!(at&&(tt=="length"||mh(tt,U)))&&P.push(tt);return P}function xa(y,S){for(var P=y.length;P--;)if(vh(y[P][0],S))return P;return-1}var bS=AS();function vS(y,S){return y&&bS(y,S,Sa)}function hh(y,S){S=wa(S,y)?[S]:gh(S);for(var P=0,U=S.length;y!=null&&P<U;)y=y[Ta(S[P++])];return P&&P==U?y:void 0}function xS(y){return Kt.call(y)}function _S(y,S){return y!=null&&S in Object(y)}function ml(y,S,P,U,at){return y===S?!0:y==null||S==null||!Da(y)&&!Ma(S)?y!==y&&S!==S:wS(y,S,ml,P,U,at)}function wS(y,S,P,U,at,tt){var xt=Vn(y),Ot=Vn(S),Ht=u,Qt=u;xt||(Ht=Mn(y),Ht=Ht==c?v:Ht),Ot||(Qt=Mn(S),Qt=Qt==c?v:Qt);var ce=Ht==v&&!Nt(y),ye=Qt==v&&!Nt(S),Jt=Ht==Qt;if(Jt&&!ce)return tt||(tt=new en),xt||zS(y)?ph(y,S,P,U,at,tt):RS(y,S,Ht,P,U,at,tt);if(!(at&s)){var Ce=ce&&me.call(y,"__wrapped__"),ke=ye&&me.call(S,"__wrapped__");if(Ce||ke){var Sn=Ce?y.value():y,nn=ke?S.value():S;return tt||(tt=new en),P(Sn,nn,U,at,tt)}}return Jt?(tt||(tt=new en),LS(y,S,P,U,at,tt)):!1}function TS(y,S,P,U){var at=P.length,tt=at,xt=!U;if(y==null)return!tt;for(y=Object(y);at--;){var Ot=P[at];if(xt&&Ot[2]?Ot[1]!==y[Ot[0]]:!(Ot[0]in y))return!1}for(;++at<tt;){Ot=P[at];var Ht=Ot[0],Qt=y[Ht],ce=Ot[1];if(xt&&Ot[2]){if(Qt===void 0&&!(Ht in y))return!1}else{var ye=new en;if(U)var Jt=U(Qt,ce,Ht,y,S,ye);if(!(Jt===void 0?ml(ce,Qt,U,a|s,ye):Jt))return!1}}return!0}function DS(y){if(!Da(y)||US(y))return!1;var S=wh(y)||Nt(y)?ya:Z;return S.test(jn(y))}function MS(y){return Ma(y)&&bl(y.length)&&!!F[Kt.call(y)]}function SS(y){return typeof y=="function"?y:y==null?qS:typeof y=="object"?Vn(y)?OS(y[0],y[1]):kS(y):XS(y)}function CS(y){if(!BS(y))return HM(y);var S=[];for(var P in Object(y))me.call(y,P)&&P!="constructor"&&S.push(P);return S}function kS(y){var S=IS(y);return S.length==1&&S[0][2]?bh(S[0][0],S[0][1]):function(P){return P===y||TS(P,y,S)}}function OS(y,S){return wa(y)&&yh(S)?bh(Ta(y),S):function(P){var U=$S(P,y);return U===void 0&&U===S?jS(P,y):ml(S,U,void 0,a|s)}}function PS(y){return function(S){return hh(S,y)}}function ES(y){if(typeof y=="string")return y;if(vl(y))return fh?fh.call(y):"";var S=y+"";return S=="0"&&1/y==-o?"-0":S}function gh(y){return Vn(y)?y:YS(y)}function AS(y){return function(S,P,U){for(var at=-1,tt=Object(S),xt=U(S),Ot=xt.length;Ot--;){var Ht=xt[y?Ot:++at];if(P(tt[Ht],Ht,tt)===!1)break}return S}}function ph(y,S,P,U,at,tt){var xt=at&s,Ot=y.length,Ht=S.length;if(Ot!=Ht&&!(xt&&Ht>Ot))return!1;var Qt=tt.get(y);if(Qt&&tt.get(S))return Qt==S;var ce=-1,ye=!0,Jt=at&a?new va:void 0;for(tt.set(y,S),tt.set(S,y);++ce<Ot;){var Ce=y[ce],ke=S[ce];if(U)var Sn=xt?U(ke,Ce,ce,S,y,tt):U(Ce,ke,ce,y,S,tt);if(Sn!==void 0){if(Sn)continue;ye=!1;break}if(Jt){if(!Gt(S,function(nn,qn){if(!Jt.has(qn)&&(Ce===nn||P(Ce,nn,U,at,tt)))return Jt.add(qn)})){ye=!1;break}}else if(!(Ce===ke||P(Ce,ke,U,at,tt))){ye=!1;break}}return tt.delete(y),tt.delete(S),ye}function RS(y,S,P,U,at,tt,xt){switch(P){case O:if(y.byteLength!=S.byteLength||y.byteOffset!=S.byteOffset)return!1;y=y.buffer,S=S.buffer;case D:return!(y.byteLength!=S.byteLength||!U(new dh(y),new dh(S)));case d:case f:case b:return vh(+y,+S);case g:return y.name==S.name&&y.message==S.message;case w:case C:return y==S+"";case m:var Ot=Ze;case M:var Ht=tt&s;if(Ot||(Ot=Dn),y.size!=S.size&&!Ht)return!1;var Qt=xt.get(y);if(Qt)return Qt==S;tt|=a,xt.set(y,S);var ce=ph(Ot(y),Ot(S),U,at,tt,xt);return xt.delete(y),ce;case k:if(pl)return pl.call(y)==pl.call(S)}return!1}function LS(y,S,P,U,at,tt){var xt=at&s,Ot=Sa(y),Ht=Ot.length,Qt=Sa(S),ce=Qt.length;if(Ht!=ce&&!xt)return!1;for(var ye=Ht;ye--;){var Jt=Ot[ye];if(!(xt?Jt in S:me.call(S,Jt)))return!1}var Ce=tt.get(y);if(Ce&&tt.get(S))return Ce==S;var ke=!0;tt.set(y,S),tt.set(S,y);for(var Sn=xt;++ye<Ht;){Jt=Ot[ye];var nn=y[Jt],qn=S[Jt];if(U)var Th=xt?U(qn,nn,Jt,S,y,tt):U(nn,qn,Jt,y,S,tt);if(!(Th===void 0?nn===qn||P(nn,qn,U,at,tt):Th)){ke=!1;break}Sn||(Sn=Jt=="constructor")}if(ke&&!Sn){var Ca=y.constructor,ka=S.constructor;Ca!=ka&&"constructor"in y&&"constructor"in S&&!(typeof Ca=="function"&&Ca instanceof Ca&&typeof ka=="function"&&ka instanceof ka)&&(ke=!1)}return tt.delete(y),tt.delete(S),ke}function _a(y,S){var P=y.__data__;return FS(S)?P[typeof S=="string"?"string":"hash"]:P.map}function IS(y){for(var S=Sa(y),P=S.length;P--;){var U=S[P],at=y[U];S[P]=[U,at,yh(at)]}return S}function pi(y,S){var P=Rt(y,S);return DS(P)?P:void 0}var Mn=xS;(dl&&Mn(new dl(new ArrayBuffer(1)))!=O||lr&&Mn(new lr)!=m||fl&&Mn(fl.resolve())!=_||hl&&Mn(new hl)!=M||gl&&Mn(new gl)!=T)&&(Mn=function(y){var S=Kt.call(y),P=S==v?y.constructor:void 0,U=P?jn(P):void 0;if(U)switch(U){case $M:return O;case jM:return m;case VM:return _;case qM:return M;case XM:return T}return S});function NS(y,S,P){S=wa(S,y)?[S]:gh(S);for(var U,at=-1,xt=S.length;++at<xt;){var tt=Ta(S[at]);if(!(U=y!=null&&P(y,tt)))break;y=y[tt]}if(U)return U;var xt=y?y.length:0;return!!xt&&bl(xt)&&mh(tt,xt)&&(Vn(y)||xh(y))}function mh(y,S){return S=S??l,!!S&&(typeof y=="number"||J.test(y))&&y>-1&&y%1==0&&y<S}function wa(y,S){if(Vn(y))return!1;var P=typeof y;return P=="number"||P=="symbol"||P=="boolean"||y==null||vl(y)?!0:mt.test(y)||!Ct.test(y)||S!=null&&y in Object(S)}function FS(y){var S=typeof y;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?y!=="__proto__":y===null}function US(y){return!!Re&&Re in y}function BS(y){var S=y&&y.constructor,P=typeof S=="function"&&S.prototype||xe;return y===P}function yh(y){return y===y&&!Da(y)}function bh(y,S){return function(P){return P==null?!1:P[y]===S&&(S!==void 0||y in Object(P))}}var YS=yl(function(y){y=HS(y);var S=[];return $.test(y)&&S.push(""),y.replace(N,function(P,U,at,tt){S.push(at?tt.replace(V,"$1"):U||P)}),S});function Ta(y){if(typeof y=="string"||vl(y))return y;var S=y+"";return S=="0"&&1/y==-o?"-0":S}function jn(y){if(y!=null){try{return le.call(y)}catch{}try{return y+""}catch{}}return""}function yl(y,S){if(typeof y!="function"||S&&typeof S!="function")throw new TypeError(i);var P=function(){var U=arguments,at=S?S.apply(this,U):U[0],tt=P.cache;if(tt.has(at))return tt.get(at);var xt=y.apply(this,U);return P.cache=tt.set(at,xt),xt};return P.cache=new(yl.Cache||tn),P}yl.Cache=tn;function vh(y,S){return y===S||y!==y&&S!==S}function xh(y){return WS(y)&&me.call(y,"callee")&&(!WM.call(y,"callee")||Kt.call(y)==c)}var Vn=Array.isArray;function _h(y){return y!=null&&bl(y.length)&&!wh(y)}function WS(y){return Ma(y)&&_h(y)}function wh(y){var S=Da(y)?Kt.call(y):"";return S==p||S==x}function bl(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=l}function Da(y){var S=typeof y;return!!y&&(S=="object"||S=="function")}function Ma(y){return!!y&&typeof y=="object"}function vl(y){return typeof y=="symbol"||Ma(y)&&Kt.call(y)==k}var zS=zt?pe(zt):MS;function HS(y){return y==null?"":ES(y)}function $S(y,S,P){var U=y==null?void 0:hh(y,S);return U===void 0?P:U}function jS(y,S){return y!=null&&NS(y,S,_S)}function Sa(y){return _h(y)?yS(y):CS(y)}function VS(y,S){var P={};return S=SS(S),vS(y,function(U,at,tt){P[S(U,at,tt)]=U}),P}function qS(y){return y}function XS(y){return wa(y)?Me(Ta(y)):PS(y)}n.exports=VS}(ma,ma.exports);var TD=ma.exports;const DD=Fn(TD);var MD=1/0,SD=9007199254740991,CD="[object Arguments]",kD="[object Function]",OD="[object GeneratorFunction]",PD="[object Symbol]",ED=typeof ge=="object"&&ge&&ge.Object===Object&&ge,AD=typeof self=="object"&&self&&self.Object===Object&&self,RD=ED||AD||Function("return this")();function LD(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function ID(n,t){for(var e=-1,i=n?n.length:0,r=Array(i);++e<i;)r[e]=t(n[e],e,n);return r}function ND(n,t){for(var e=-1,i=t.length,r=n.length;++e<i;)n[r+e]=t[e];return n}var ol=Object.prototype,FD=ol.hasOwnProperty,ll=ol.toString,Qf=RD.Symbol,UD=ol.propertyIsEnumerable,Jf=Qf?Qf.isConcatSpreadable:void 0,th=Math.max;function eh(n,t,e,i,r){var a=-1,s=n.length;for(e||(e=zD),r||(r=[]);++a<s;){var o=n[a];t>0&&e(o)?t>1?eh(o,t-1,e,i,r):ND(r,o):i||(r[r.length]=o)}return r}function BD(n,t){return n=Object(n),YD(n,t,function(e,i){return i in n})}function YD(n,t,e){for(var i=-1,r=t.length,a={};++i<r;){var s=t[i],o=n[s];e(o,s)&&(a[s]=o)}return a}function WD(n,t){return t=th(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,r=th(e.length-t,0),a=Array(r);++i<r;)a[i]=e[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=e[i];return s[t]=a,LD(n,this,s)}}function zD(n){return jD(n)||$D(n)||!!(Jf&&n&&n[Jf])}function HD(n){if(typeof n=="string"||ZD(n))return n;var t=n+"";return t=="0"&&1/n==-MD?"-0":t}function $D(n){return qD(n)&&FD.call(n,"callee")&&(!UD.call(n,"callee")||ll.call(n)==CD)}var jD=Array.isArray;function VD(n){return n!=null&&GD(n.length)&&!XD(n)}function qD(n){return nh(n)&&VD(n)}function XD(n){var t=KD(n)?ll.call(n):"";return t==kD||t==OD}function GD(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=SD}function KD(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function nh(n){return!!n&&typeof n=="object"}function ZD(n){return typeof n=="symbol"||nh(n)&&ll.call(n)==PD}var QD=WD(function(n,t){return n==null?{}:BD(n,ID(eh(t,1),HD))}),JD=QD;const tM=Fn(JD);var ih={exports:{}};(function(n,t){(function(e,i){i()})(ge,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function r(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ge=="object"&&ge.global===ge?ge:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,d){var f=s.URL||s.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?a(g):r(g.href)?i(c,u,d):a(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){a(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(r(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){a(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(s.HTMLElement)||s.safari,x=/CriOS\/[\d]+/.test(navigator.userAgent);if((x||g&&p||o)&&typeof FileReader<"u"){var m=new FileReader;m.onloadend=function(){var _=m.result;_=x?_:_.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=_:location=_,f=null},m.readAsDataURL(c)}else{var b=s.URL||s.webkitURL,v=b.createObjectURL(c);f?f.location=v:location.href=v,f=null,setTimeout(function(){b.revokeObjectURL(v)},4e4)}});s.saveAs=l.saveAs=l,n.exports=l})})(ih);var eM=ih.exports,rh={exports:{}};/* @license
|
|
30
30
|
Papa Parse
|
|
31
31
|
v5.4.1
|
|
32
32
|
https://github.com/mholt/PapaParse
|
|
33
33
|
License: MIT
|
|
34
|
-
*/(function(n,t){(function(e,i){n.exports=i()})(ge,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,s={},o=0,l={parse:function(T,D){var O=(D=D||{}).dynamicTyping||!1;if(k(O)&&(D.dynamicTypingFunction=O,O={}),D.dynamicTyping=O,D.transform=!!k(D.transform)&&D.transform,D.worker&&l.WORKERS_SUPPORTED){var E=function(){if(!l.WORKERS_SUPPORTED)return!1;var R=(H=i.URL||i.webkitURL||null,B=e.toString(),l.BLOB_URL||(l.BLOB_URL=H.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",B,")();"],{type:"text/javascript"})))),q=new i.Worker(R),H,B;return q.onmessage=
|
|
34
|
+
*/(function(n,t){(function(e,i){n.exports=i()})(ge,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,s={},o=0,l={parse:function(T,D){var O=(D=D||{}).dynamicTyping||!1;if(k(O)&&(D.dynamicTypingFunction=O,O={}),D.dynamicTyping=O,D.transform=!!k(D.transform)&&D.transform,D.worker&&l.WORKERS_SUPPORTED){var E=function(){if(!l.WORKERS_SUPPORTED)return!1;var R=(H=i.URL||i.webkitURL||null,B=e.toString(),l.BLOB_URL||(l.BLOB_URL=H.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",B,")();"],{type:"text/javascript"})))),q=new i.Worker(R),H,B;return q.onmessage=v,q.id=o++,s[q.id]=q}();return E.userStep=D.step,E.userChunk=D.chunk,E.userComplete=D.complete,E.userError=D.error,D.step=k(D.step),D.chunk=k(D.chunk),D.complete=k(D.complete),D.error=k(D.error),delete D.worker,void E.postMessage({input:T,config:D,workerId:E.id})}var A=null;return l.NODE_STREAM_INPUT,typeof T=="string"?(T=function(R){return R.charCodeAt(0)===65279?R.slice(1):R}(T),A=D.download?new d(D):new g(D)):T.readable===!0&&k(T.read)&&k(T.on)?A=new p(D):(i.File&&T instanceof File||T instanceof Object)&&(A=new f(D)),A.stream(T)},unparse:function(T,D){var O=!1,E=!0,A=",",R=`\r
|
|
35
35
|
`,q='"',H=q+q,B=!1,I=null,rt=!1;(function(){if(typeof D=="object"){if(typeof D.delimiter!="string"||l.BAD_DELIMITERS.filter(function($){return D.delimiter.indexOf($)!==-1}).length||(A=D.delimiter),(typeof D.quotes=="boolean"||typeof D.quotes=="function"||Array.isArray(D.quotes))&&(O=D.quotes),typeof D.skipEmptyLines!="boolean"&&typeof D.skipEmptyLines!="string"||(B=D.skipEmptyLines),typeof D.newline=="string"&&(R=D.newline),typeof D.quoteChar=="string"&&(q=D.quoteChar),typeof D.header=="boolean"&&(E=D.header),Array.isArray(D.columns)){if(D.columns.length===0)throw new Error("Option columns is empty");I=D.columns}D.escapeChar!==void 0&&(H=D.escapeChar+q),(typeof D.escapeFormulae=="boolean"||D.escapeFormulae instanceof RegExp)&&(rt=D.escapeFormulae instanceof RegExp?D.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var W=new RegExp(m(q),"g");if(typeof T=="string"&&(T=JSON.parse(T)),Array.isArray(T)){if(!T.length||Array.isArray(T[0]))return Ct(null,T,B);if(typeof T[0]=="object")return Ct(I||Object.keys(T[0]),T,B)}else if(typeof T=="object")return typeof T.data=="string"&&(T.data=JSON.parse(T.data)),Array.isArray(T.data)&&(T.fields||(T.fields=T.meta&&T.meta.fields||I),T.fields||(T.fields=Array.isArray(T.data[0])?T.fields:typeof T.data[0]=="object"?Object.keys(T.data[0]):[]),Array.isArray(T.data[0])||typeof T.data[0]=="object"||(T.data=[T.data])),Ct(T.fields||[],T.data||[],B);throw new Error("Unable to serialize unrecognized input");function Ct($,N,Y){var V="";typeof $=="string"&&($=JSON.parse($)),typeof N=="string"&&(N=JSON.parse(N));var Z=Array.isArray($)&&0<$.length,J=!Array.isArray(N[0]);if(Z&&E){for(var F=0;F<$.length;F++)0<F&&(V+=A),V+=mt($[F],F);0<N.length&&(V+=R)}for(var L=0;L<N.length;L++){var Q=Z?$.length:N[L].length,G=!1,vt=Z?Object.keys(N[L]).length===0:N[L].length===0;if(Y&&!Z&&(G=Y==="greedy"?N[L].join("").trim()==="":N[L].length===1&&N[L][0].length===0),Y==="greedy"&&Z){for(var dt=[],It=0;It<Q;It++){var Dt=J?$[It]:It;dt.push(N[L][Dt])}G=dt.join("").trim()===""}if(!G){for(var ot=0;ot<Q;ot++){0<ot&&!vt&&(V+=A);var zt=Z&&J?$[ot]:ot;V+=mt(N[L][zt],ot)}L<N.length-1&&(!Y||0<Q&&!vt)&&(V+=R)}}return V}function mt($,N){if($==null)return"";if($.constructor===Date)return JSON.stringify($).slice(1,25);var Y=!1;rt&&typeof $=="string"&&rt.test($)&&($="'"+$,Y=!0);var V=$.toString().replace(W,H);return(Y=Y||O===!0||typeof O=="function"&&O($,N)||Array.isArray(O)&&O[N]||function(Z,J){for(var F=0;F<J.length;F++)if(-1<Z.indexOf(J[F]))return!0;return!1}(V,l.BAD_DELIMITERS)||-1<V.indexOf(A)||V.charAt(0)===" "||V.charAt(V.length-1)===" ")?q+V+q:V}}};if(l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
|
|
36
|
-
`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!r&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=
|
|
36
|
+
`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!r&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=b,l.ParserHandle=x,l.NetworkStreamer=d,l.FileStreamer=f,l.StringStreamer=g,l.ReadableStreamStreamer=p,i.jQuery){var c=i.jQuery;c.fn.parse=function(T){var D=T.config||{},O=[];return this.each(function(R){if(!(c(this).prop("tagName").toUpperCase()==="INPUT"&&c(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var q=0;q<this.files.length;q++)O.push({file:this.files[q],inputElem:this,instanceConfig:c.extend({},D)})}),E(),this;function E(){if(O.length!==0){var R,q,H,B,I=O[0];if(k(T.before)){var rt=T.before(I.file,I.inputElem);if(typeof rt=="object"){if(rt.action==="abort")return R="AbortError",q=I.file,H=I.inputElem,B=rt.reason,void(k(T.error)&&T.error({name:R},q,H,B));if(rt.action==="skip")return void A();typeof rt.config=="object"&&(I.instanceConfig=c.extend(I.instanceConfig,rt.config))}else if(rt==="skip")return void A()}var W=I.instanceConfig.complete;I.instanceConfig.complete=function(Ct){k(W)&&W(Ct,I.file,I.inputElem),A()},l.parse(I.file,I.instanceConfig)}else k(T.complete)&&T.complete()}function A(){O.splice(0,1),E()}}}function u(T){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(D){var O=M(D);O.chunkSize=parseInt(O.chunkSize),D.step||D.chunk||(O.chunkSize=null),this._handle=new x(O),(this._handle.streamer=this)._config=O}).call(this,T),this.parseChunk=function(D,O){if(this.isFirstChunk&&k(this._config.beforeFirstChunk)){var E=this._config.beforeFirstChunk(D);E!==void 0&&(D=E)}this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+D;this._partialLine="";var R=this._handle.parse(A,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var q=R.meta.cursor;this._finished||(this._partialLine=A.substring(q-this._baseIndex),this._baseIndex=q),R&&R.data&&(this._rowCount+=R.data.length);var H=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(a)i.postMessage({results:R,workerId:l.WORKER_ID,finished:H});else if(k(this._config.chunk)&&!O){if(this._config.chunk(R,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);R=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(R.data),this._completeResults.errors=this._completeResults.errors.concat(R.errors),this._completeResults.meta=R.meta),this._completed||!H||!k(this._config.complete)||R&&R.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),H||R&&R.meta.paused||this._nextChunk(),R}this._halted=!0},this._sendError=function(D){k(this._config.error)?this._config.error(D):a&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:D,finished:!1})}}function d(T){var D;(T=T||{}).chunkSize||(T.chunkSize=l.RemoteChunkSize),u.call(this,T),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(D=new XMLHttpRequest,this._config.withCredentials&&(D.withCredentials=this._config.withCredentials),r||(D.onload=C(this._chunkLoaded,this),D.onerror=C(this._chunkError,this)),D.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var O=this._config.downloadRequestHeaders;for(var E in O)D.setRequestHeader(E,O[E])}if(this._config.chunkSize){var A=this._start+this._config.chunkSize-1;D.setRequestHeader("Range","bytes="+this._start+"-"+A)}try{D.send(this._config.downloadRequestBody)}catch(R){this._chunkError(R.message)}r&&D.status===0&&this._chunkError()}},this._chunkLoaded=function(){D.readyState===4&&(D.status<200||400<=D.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:D.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(O){var E=O.getResponseHeader("Content-Range");return E===null?-1:parseInt(E.substring(E.lastIndexOf("/")+1))}(D),this.parseChunk(D.responseText)))},this._chunkError=function(O){var E=D.statusText||O;this._sendError(new Error(E))}}function f(T){var D,O;(T=T||{}).chunkSize||(T.chunkSize=l.LocalChunkSize),u.call(this,T);var E=typeof FileReader<"u";this.stream=function(A){this._input=A,O=A.slice||A.webkitSlice||A.mozSlice,E?((D=new FileReader).onload=C(this._chunkLoaded,this),D.onerror=C(this._chunkError,this)):D=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var A=this._input;if(this._config.chunkSize){var R=Math.min(this._start+this._config.chunkSize,this._input.size);A=O.call(A,this._start,R)}var q=D.readAsText(A,this._config.encoding);E||this._chunkLoaded({target:{result:q}})},this._chunkLoaded=function(A){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(A.target.result)},this._chunkError=function(){this._sendError(D.error)}}function g(T){var D;u.call(this,T=T||{}),this.stream=function(O){return D=O,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var O,E=this._config.chunkSize;return E?(O=D.substring(0,E),D=D.substring(E)):(O=D,D=""),this._finished=!D,this.parseChunk(O)}}}function p(T){u.call(this,T=T||{});var D=[],O=!0,E=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(A){this._input=A,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){E&&D.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),D.length?this.parseChunk(D.shift()):O=!0},this._streamData=C(function(A){try{D.push(typeof A=="string"?A:A.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(D.shift()))}catch(R){this._streamError(R)}},this),this._streamError=C(function(A){this._streamCleanUp(),this._sendError(A)},this),this._streamEnd=C(function(){this._streamCleanUp(),E=!0,this._streamData("")},this),this._streamCleanUp=C(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function x(T){var D,O,E,A=Math.pow(2,53),R=-A,q=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,H=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,B=this,I=0,rt=0,W=!1,Ct=!1,mt=[],$={data:[],errors:[],meta:{}};if(k(T.step)){var N=T.step;T.step=function(L){if($=L,Z())V();else{if(V(),$.data.length===0)return;I+=L.data.length,T.preview&&I>T.preview?O.abort():($.data=$.data[0],N($,B))}}}function Y(L){return T.skipEmptyLines==="greedy"?L.join("").trim()==="":L.length===1&&L[0].length===0}function V(){return $&&E&&(F("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),E=!1),T.skipEmptyLines&&($.data=$.data.filter(function(L){return!Y(L)})),Z()&&function(){if(!$)return;function L(G,vt){k(T.transformHeader)&&(G=T.transformHeader(G,vt)),mt.push(G)}if(Array.isArray($.data[0])){for(var Q=0;Z()&&Q<$.data.length;Q++)$.data[Q].forEach(L);$.data.splice(0,1)}else $.data.forEach(L)}(),function(){if(!$||!T.header&&!T.dynamicTyping&&!T.transform)return $;function L(G,vt){var dt,It=T.header?{}:[];for(dt=0;dt<G.length;dt++){var Dt=dt,ot=G[dt];T.header&&(Dt=dt>=mt.length?"__parsed_extra":mt[dt]),T.transform&&(ot=T.transform(ot,Dt)),ot=J(Dt,ot),Dt==="__parsed_extra"?(It[Dt]=It[Dt]||[],It[Dt].push(ot)):It[Dt]=ot}return T.header&&(dt>mt.length?F("FieldMismatch","TooManyFields","Too many fields: expected "+mt.length+" fields but parsed "+dt,rt+vt):dt<mt.length&&F("FieldMismatch","TooFewFields","Too few fields: expected "+mt.length+" fields but parsed "+dt,rt+vt)),It}var Q=1;return!$.data.length||Array.isArray($.data[0])?($.data=$.data.map(L),Q=$.data.length):$.data=L($.data,0),T.header&&$.meta&&($.meta.fields=mt),rt+=Q,$}()}function Z(){return T.header&&mt.length===0}function J(L,Q){return G=L,T.dynamicTypingFunction&&T.dynamicTyping[G]===void 0&&(T.dynamicTyping[G]=T.dynamicTypingFunction(G)),(T.dynamicTyping[G]||T.dynamicTyping)===!0?Q==="true"||Q==="TRUE"||Q!=="false"&&Q!=="FALSE"&&(function(vt){if(q.test(vt)){var dt=parseFloat(vt);if(R<dt&&dt<A)return!0}return!1}(Q)?parseFloat(Q):H.test(Q)?new Date(Q):Q===""?null:Q):Q;var G}function F(L,Q,G,vt){var dt={type:L,code:Q,message:G};vt!==void 0&&(dt.row=vt),$.errors.push(dt)}this.parse=function(L,Q,G){var vt=T.quoteChar||'"';if(T.newline||(T.newline=function(Dt,ot){Dt=Dt.substring(0,1048576);var zt=new RegExp(m(ot)+"([^]*?)"+m(ot),"gm"),Gt=(Dt=Dt.replace(zt,"")).split("\r"),Me=Dt.split(`
|
|
37
37
|
`),Ee=1<Me.length&&Me[0].length<Gt[0].length;if(Gt.length===1||Ee)return`
|
|
38
38
|
`;for(var pe=0,Rt=0;Rt<Gt.length;Rt++)Gt[Rt][0]===`
|
|
39
39
|
`&&pe++;return pe>=Gt.length/2?`\r
|
|
40
|
-
`:"\r"}(L,vt)),E=!1,T.delimiter)k(T.delimiter)&&(T.delimiter=T.delimiter(L),$.meta.delimiter=T.delimiter);else{var dt=function(Dt,ot,zt,Gt,Me){var Ee,pe,Rt,Nt;Me=Me||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Ze=0;Ze<Me.length;Ze++){var Mt=Me[Ze],Dn=0,Ae=0,Qe=0;Rt=void 0;for(var xe=new
|
|
40
|
+
`:"\r"}(L,vt)),E=!1,T.delimiter)k(T.delimiter)&&(T.delimiter=T.delimiter(L),$.meta.delimiter=T.delimiter);else{var dt=function(Dt,ot,zt,Gt,Me){var Ee,pe,Rt,Nt;Me=Me||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Ze=0;Ze<Me.length;Ze++){var Mt=Me[Ze],Dn=0,Ae=0,Qe=0;Rt=void 0;for(var xe=new b({comments:Gt,delimiter:Mt,newline:ot,preview:10}).parse(Dt),Se=0;Se<xe.data.length;Se++)if(zt&&Y(xe.data[Se]))Qe++;else{var Re=xe.data[Se].length;Ae+=Re,Rt!==void 0?0<Re&&(Dn+=Math.abs(Re-Rt),Rt=Re):Rt=Re}0<xe.data.length&&(Ae/=xe.data.length-Qe),(pe===void 0||Dn<=pe)&&(Nt===void 0||Nt<Ae)&&1.99<Ae&&(pe=Dn,Ee=Mt,Nt=Ae)}return{successful:!!(T.delimiter=Ee),bestDelimiter:Ee}}(L,T.newline,T.skipEmptyLines,T.comments,T.delimitersToGuess);dt.successful?T.delimiter=dt.bestDelimiter:(E=!0,T.delimiter=l.DefaultDelimiter),$.meta.delimiter=T.delimiter}var It=M(T);return T.preview&&T.header&&It.preview++,D=L,O=new b(It),$=O.parse(D,Q,G),V(),W?{meta:{paused:!0}}:$||{meta:{paused:!1}}},this.paused=function(){return W},this.pause=function(){W=!0,O.abort(),D=k(T.chunk)?"":D.substring(O.getCharIndex())},this.resume=function(){B.streamer._halted?(W=!1,B.streamer.parseChunk(D,!0)):setTimeout(B.resume,3)},this.aborted=function(){return Ct},this.abort=function(){Ct=!0,O.abort(),$.meta.aborted=!0,k(T.complete)&&T.complete($),D=""}}function m(T){return T.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(T){var D,O=(T=T||{}).delimiter,E=T.newline,A=T.comments,R=T.step,q=T.preview,H=T.fastMode,B=D=T.quoteChar===void 0||T.quoteChar===null?'"':T.quoteChar;if(T.escapeChar!==void 0&&(B=T.escapeChar),(typeof O!="string"||-1<l.BAD_DELIMITERS.indexOf(O))&&(O=","),A===O)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<l.BAD_DELIMITERS.indexOf(A))&&(A=!1),E!==`
|
|
41
41
|
`&&E!=="\r"&&E!==`\r
|
|
42
42
|
`&&(E=`
|
|
43
|
-
`);var I=0,rt=!1;this.parse=function(W,Ct,mt){if(typeof W!="string")throw new Error("Input must be a string");var $=W.length,N=O.length,Y=E.length,V=A.length,Z=k(R),J=[],F=[],L=[],Q=I=0;if(!W)return le();if(T.header&&!Ct){var G=W.split(E)[0].split(O),vt=[],dt={},It=!1;for(var Dt in G){var ot=G[Dt];k(T.transformHeader)&&(ot=T.transformHeader(ot,Dt));var zt=ot,Gt=dt[ot]||0;for(0<Gt&&(It=!0,zt=ot+"_"+Gt),dt[ot]=Gt+1;vt.includes(zt);)zt=zt+"_"+Gt;vt.push(zt)}if(It){var Me=W.split(E);Me[0]=vt.join(O),W=Me.join(E)}}if(H||H!==!1&&W.indexOf(D)===-1){for(var Ee=W.split(E),pe=0;pe<Ee.length;pe++){if(L=Ee[pe],I+=L.length,pe!==Ee.length-1)I+=E.length;else if(mt)return le();if(!A||L.substring(0,V)!==A){if(Z){if(J=[],Qe(L.split(O)),me(),rt)return le()}else Qe(L.split(O));if(q&&q<=pe)return J=J.slice(0,q),le(!0)}}return le()}for(var Rt=W.indexOf(O,I),Nt=W.indexOf(E,I),Ze=new RegExp(m(B)+m(D),"g"),Mt=W.indexOf(D,I);;)if(W[I]!==D)if(A&&L.length===0&&W.substring(I,I+V)===A){if(Nt===-1)return le();I=Nt+Y,Nt=W.indexOf(E,I),Rt=W.indexOf(O,I)}else if(Rt!==-1&&(Rt<Nt||Nt===-1))L.push(W.substring(I,Rt)),I=Rt+N,Rt=W.indexOf(O,I);else{if(Nt===-1)break;if(L.push(W.substring(I,Nt)),Re(Nt+Y),Z&&(me(),rt))return le();if(q&&J.length>=q)return le(!0)}else for(Mt=I,I++;;){if((Mt=W.indexOf(D,Mt+1))===-1)return mt||F.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:J.length,index:I}),Se();if(Mt===$-1)return Se(W.substring(I,Mt).replace(Ze,D));if(D!==B||W[Mt+1]!==B){if(D===B||Mt===0||W[Mt-1]!==B){Rt!==-1&&Rt<Mt+1&&(Rt=W.indexOf(O,Mt+1)),Nt!==-1&&Nt<Mt+1&&(Nt=W.indexOf(E,Mt+1));var Dn=xe(Nt===-1?Rt:Math.min(Rt,Nt));if(W.substr(Mt+1+Dn,N)===O){L.push(W.substring(I,Mt).replace(Ze,D)),W[I=Mt+1+Dn+N]!==D&&(Mt=W.indexOf(D,I)),Rt=W.indexOf(O,I),Nt=W.indexOf(E,I);break}var Ae=xe(Nt);if(W.substring(Mt+1+Ae,Mt+1+Ae+Y)===E){if(L.push(W.substring(I,Mt).replace(Ze,D)),Re(Mt+1+Ae+Y),Rt=W.indexOf(O,I),Mt=W.indexOf(D,I),Z&&(me(),rt))return le();if(q&&J.length>=q)return le(!0);break}F.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:J.length,index:I}),Mt++}}else Mt++}return Se();function Qe(Kt){J.push(Kt),Q=I}function xe(Kt){var ya=0;if(Kt!==-1){var gi=W.substring(Mt+1,Kt);gi&&gi.trim()===""&&(ya=gi.length)}return ya}function Se(Kt){return mt||(Kt===void 0&&(Kt=W.substring(I)),L.push(Kt),I=$,Qe(L),Z&&me()),le()}function Re(Kt){I=Kt,Qe(L),L=[],Nt=W.indexOf(E,I)}function le(Kt){return{data:J,errors:F,meta:{delimiter:O,linebreak:E,aborted:rt,truncated:!!Kt,cursor:Q+(Ct||0)}}}function me(){R(le()),J=[],F=[]}},this.abort=function(){rt=!0},this.getCharIndex=function(){return I}}function
|
|
44
|
-
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});tM.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,nM))}}),rM=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,r)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(iM,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),aM={class:"kong-ui-public-csv-export-modal"},sM={key:0,class:"selected-range"},oM={key:1,class:"text-muted",tag:"span"},ah=3,sh=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},selectedRange:{},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=St.useI18n(),i=n,r=t,a=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,s=h.ref(!0),o=h.computed(()=>{var p,v;return!!((v=(p=i.chartData)==null?void 0:p.records)!=null&&v.length)}),l=h.ref(1),c=h.computed(()=>f.value.rows.length),u=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ah,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),d=()=>{r("toggleModal",!1)},f=h.computed(()=>{var w,M,C;if(!o.value||!((w=i.chartData)!=null&&w.meta.metricNames))return{headers:[],rows:[],csvHeaders:{}};const p=i.chartData.records.some(k=>k.timestamp!==i.chartData.records[0].timestamp),v=i.chartData.records.map(k=>{const T=new Date(k.timestamp);return{...k.event,...p?{timestamp:To(T,"yyyy-MM-dd HH:mm:ss"),tzOffset:To(T,"XXX")}:{}}});let m=[];p&&(m=[{label:"Timestamp",key:"timestamp"},{label:"UtcOffset",key:"tzOffset"}]);const y="dimensions"in i.chartData.meta&&((M=i.chartData.meta)!=null&&M.dimensions)?(C=i.chartData.meta)==null?void 0:C.dimensions:{},x=[...m,...Object.keys(y).map(k=>({label:k,key:k})),...i.chartData.meta.metricNames.map(k=>({label:k,key:k}))],_=x.reduce((k,T)=>(k[T.key]=T.label,k),{});return{headers:x,csvHeaders:_,rows:v}}),g=()=>{const{rows:p}=f.value;return s.value=!1,{total:Number(p.length)||0,data:p.slice(0,ah)}};return h.watch(f,()=>{l.value++}),(p,v)=>{const m=h.resolveComponent("KEmptyState"),y=h.resolveComponent("KTable"),x=h.resolveComponent("KButton"),_=h.resolveComponent("KPrompt");return h.openBlock(),h.createElementBlock("div",aM,[h.createVNode(_,{class:"vitals-report","data-testid":"csv-export-modal","is-visible":"","show-dismiss-icon":"","text-align":"left",title:h.unref(e).t("csvExport.exportPreview"),onCanceled:d,onKeyup:h.withKeys(d,["esc"])},{"body-content":h.withCtx(()=>{var w;return[h.createElementVNode("div",null,[o.value?(h.openBlock(),h.createElementBlock("div",sM,[h.createElementVNode("p",null,h.toDisplayString(p.modalDescription?p.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(p.selectedRange),1)])):h.createCommentVNode("",!0),h.createVNode(y,{class:"vitals-table","disable-pagination":"","disable-sorting":"",fetcher:g,"fetcher-cache-key":String(l.value),"has-hover":!1,headers:((w=f.value)==null?void 0:w.headers)||[]},{"empty-state":h.withCtx(()=>[h.createVNode(m,{"cta-is-hidden":"",icon:"stateNoData","icon-size":"96"},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),message:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!s.value&&o.value?(h.openBlock(),h.createElementBlock("div",oM,h.toDisplayString(u.value),1)):h.createCommentVNode("",!0)])]}),"action-buttons":h.withCtx(()=>[h.createVNode(x,{appearance:"secondary",class:"cancel-btn",onClick:d},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(rM,{class:"vitals-report-export-button",filename:a,headers:f.value.csvHeaders,rows:f.value.rows},{default:h.withCtx(()=>[h.createVNode(x,{appearance:"primary","data-testid":"csv-download-button",disabled:s.value||!o.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),oh=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},cl={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;oh(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;oh(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},lM=h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:ee.TIMESERIES_LINE},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},timeRangeSec:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),i=h.ref(),r=h.ref(wn()),a=h.ref(wn()),s=h.ref([]),o=h.ref(),l=h.ref(h.inject("legendPosition",Bt.Right)),c=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:t.type,locked:!1,chartTooltipSortFn:t.chartTooltipSortFn}),u={id:r.value,afterUpdate(x){s.value=x.options.plugins.legend.labels.generateLabels(x).map(_=>({..._,value:t.legendValues&&t.legendValues[_.text]})).sort(t.chartLegendSortFn)}},d=h.computed(()=>[u,jf,...t.type===ee.TIMESERIES_LINE?[cl]:[]]),{options:f}=St.useLinechartOptions({tooltipState:c,timeRangeMs:h.toRef(t,"timeRangeMs"),timeRangeSec:h.toRef(t,"timeRangeSec"),granularity:h.toRef(t,"granularity"),legendID:r.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle")}),g=h.computed(()=>({...t.chartData,datasets:t.chartData.datasets.map((x,_)=>(Array.isArray(t.datasetColors)?(x.backgroundColor=t.datasetColors[_%t.datasetColors.length],x.borderColor=Ji(x.backgroundColor,50)):x.rawDimension in t.datasetColors&&(x.backgroundColor=t.datasetColors[x.rawDimension],x.borderColor=Ji(x.backgroundColor,50)),x.fill=t.fill,x))}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const p=x=>ea(x,{short:[st.DAILY,st.WEEKLY].includes(t.granularity)}),v=x=>({[Bt.Right]:"legend-row",[Bt.Bottom]:"column",[Bt.Hidden]:"hidden"})[x],m=({width:x,height:_})=>{c.width=x,c.height=_},y=()=>{var x,_,w;c.locked=!c.locked,i.value&&((_=(x=i.value.chart.tooltip)==null?void 0:x.dataPoints)!=null&&_.length)&&(cl.clickedSegment=c.locked?(w=i.value.chart.tooltip)==null?void 0:w.dataPoints[0]:void 0)};return h.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete cl.clickedSegment}),(x,_)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",v(l.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:_[0]||(_[0]=w=>y())},[n.type===h.unref(ee).TIMESERIES_LINE?(h.openBlock(),h.createBlock(h.unref(bD),{key:0,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:g.value,"data-testid":"time-series-line-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===h.unref(ee).TIMESERIES_BAR?(h.openBlock(),h.createBlock(h.unref(yD),{key:1,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:g.value,"data-testid":"time-series-bar-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(rl,{ref_key:"tooltipElement",ref:o,context:p(c.tooltipContext),"data-testid":"tooltip",left:c.left,locked:c.locked,series:c.tooltipSeries,"show-tooltip":c.showTooltip,"tooltip-title":n.tooltipTitle,top:c.top,unit:n.metricUnit,onDimensions:m,onLeft:_[1]||(_[1]=w=>c.left=w),onTop:_[2]||(_[2]=w=>c.top=w)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),h.createVNode(al,{id:r.value,"chart-instance":i.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),cM=Ke(lM,[["__scopeId","data-v-11d0cb06"]]),uM={class:"analytics-chart-shell"},dM={class:"chart-header"},fM={key:0,class:"chart-title"},hM={class:"chart-header-icons-wrapper"},gM={key:1,class:"chart-export-button"},pM={key:1,class:"analytics-chart-parent"},mM=h.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!1,default:""},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:""},filenamePrefix:{type:String,required:!1,default:void 0},legendPosition:{type:String,required:!1,default:Bt.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>t.filenamePrefix??(t.chartTitle||e.t("csvExport.defaultFilename"))),r=h.toRef(t,"chartData"),a=h.computed(()=>v.value?St.useExploreResultToTimeDataset({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value:St.useExploreResultToDatasets({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value),s=h.computed(()=>{var R;return(R=t.chartData)!=null&&R.meta?"start"in t.chartData.meta?t.chartData.meta.end-t.chartData.meta.start:void 0:0}),o=h.computed(()=>{var R;return(R=t.chartData)!=null&&R.meta?"startMs"in t.chartData.meta?t.chartData.meta.endMs-t.chartData.meta.startMs:void 0:0}),l=h.computed(()=>{var R;return(R=t.chartData.meta)!=null&&R.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),c=h.computed(()=>t.showLegendValues&&t.legendPosition!==Bt.Bottom),{legendValues:u}=St.useChartLegendValues(a,t.chartOptions.type,l),d=h.computed(()=>{var R,q,H;return((H=(q=(R=t.chartData)==null?void 0:R.meta)==null?void 0:q.limit)==null?void 0:H.toString())||null}),f=h.computed(()=>{var R,q;return((q=(R=t.chartData)==null?void 0:R.meta)==null?void 0:q.truncated)||!1}),g=e.t("limitedResultsShown",{maxReturned:d.value}),p=h.computed(()=>[ee.VERTICAL_BAR.toString(),ee.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),v=h.computed(()=>[ee.TIMESERIES_BAR,ee.TIMESERIES_LINE].some(R=>R===t.chartOptions.type)),m=h.computed(()=>t.chartOptions.type===ee.DOUGHNUT),y=h.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),x=h.computed(()=>{var H,B,I;if(!((H=t.chartData)!=null&&H.meta.metricNames)||!((B=t.chartData)!=null&&B.meta.metricUnits))return;const R=t.chartData.meta.metricNames[0],q=t.chartData.meta.metricUnits[R];return((I=t.chartOptions)==null?void 0:I.metricAxesTitle)||e.te(`metricAxisTitles.${R}`)&&e.te(`chartUnits.${q}`)&&e.t(`metricAxisTitles.${R}`,{unit:e.t(`chartUnits.${q}`,{plural:"s"})})||void 0}),_=h.computed(()=>{const R=v.value?"Time":Object.keys(t.chartData.meta.dimensions||t.chartData.meta.metricNames)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${R}`)&&e.t(`chartLabels.${R}`)||void 0}),w=h.computed(()=>{if(t.chartData.meta.granularity&&typeof t.chartData.meta.granularity!="number"&&"duration"in t.chartData.meta.granularity){const R=er(t.chartData.meta.granularity.duration);return e.t(`granularityAxisTitles.${R}`)}else if(t.chartData.meta.granularity&&!isNaN(Number(t.chartData.meta.granularity))){const R=er(Number(t.chartData.meta.granularity));return e.t(`granularityAxisTitles.${R}`)}return e.t("chartlabels.Time")}),M=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),C=h.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),k=h.computed(()=>v.value?Nx(a.value):t.chartData&&t.chartData.meta&&t.chartData.records.length),T=h.computed(()=>t.chartData.meta.granularity?typeof t.chartData.meta.granularity=="number"?er(t.chartData.meta.granularity)||st.HOURLY:er(t.chartData.meta.granularity.duration)||st.HOURLY:er(new Date(t.chartData.records[1].timestamp).getTime()-new Date(t.chartData.records[0].timestamp).getTime())||st.HOURLY),D=h.ref(!1),O=St.useChartSelectedRange(r),E=R=>{D.value=R},A=()=>{E(!0)};return h.provide("showLegendValues",c),h.provide("legendPosition",h.toRef(t,"legendPosition")),(R,q)=>{const H=h.resolveComponent("KTooltip"),B=h.resolveComponent("KButton"),I=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",uM,[h.createElementVNode("div",dM,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",fM,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",hM,[k.value&&f.value&&d.value?(h.openBlock(),h.createBlock(H,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(g)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(NT),{color:h.unref(UT),decorative:"",size:h.unref(BT)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&k.value?(h.openBlock(),h.createElementBlock("div",gM,[h.createVNode(B,{appearance:"tertiary",class:"chart-export-button-display","data-testid":"csv-export-button",onClick:h.withModifiers(A,["prevent"])},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.exportButton")),1)]),_:1})])):h.createCommentVNode("",!0),n.allowCsvExport&&k.value&&D.value?(h.openBlock(),h.createBlock(sh,{key:2,"chart-data":r.value,filename:i.value,"selected-range":h.unref(O),onToggleModal:E},null,8,["chart-data","filename","selected-range"])):h.createCommentVNode("",!0)]),k.value?(h.openBlock(),h.createElementBlock("div",pM,[v.value?(h.openBlock(),h.createBlock(cM,{key:0,"chart-data":a.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"dataset-colors":n.chartOptions.chartDatasetColors,"dimension-axes-title":w.value,fill:n.chartOptions.fill,granularity:T.value,"legend-values":h.unref(u),"metric-axes-title":x.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":o.value,"time-range-sec":s.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dataset-colors","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","time-range-sec","tooltip-title","type"])):p.value?(h.openBlock(),h.createBlock(cD,{key:1,annotations:n.showAnnotations,"chart-data":a.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"data-testid":"bar-chart-container","dimension-axes-title":_.value,"legend-values":h.unref(u),"metric-axes-title":x.value,"metric-unit":l.value,orientation:y.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):m.value?(h.openBlock(),h.createBlock(_D,{key:2,"chart-data":a.value,"dataset-colors":n.chartOptions.chartDatasetColors,fill:n.chartOptions.fill,"legend-position":n.legendPosition,"legend-values":h.unref(u),"metric-unit":l.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","fill","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(I,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"170"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(M.value),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(C.value),1)]),_:1}))])}}}),yM=Ke(mM,[["__scopeId","data-v-5e322ded"]]),bM={class:"chart-parent","data-testid":"doughnut-chart-parent"},vM={class:"chart-totals-flex"},xM={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},_M=h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:ii.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.ref(wn()),r=h.computed(()=>[t.chartData.datasets.reduce((p,v)=>(p.labels.push(v.label),p.borderColor.push(v.backgroundColor),p.backgroundColor.push(v.backgroundColor),p.data.push(v.data.reduce((m,y)=>m+y,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=h.computed(()=>({...t.chartData,datasets:r.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=h.ref(),l=h.computed(()=>{var g;return tr((g=r==null?void 0:r.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return tr(((g=r==null?void 0:r.value[0])==null?void 0:g.data[0])+((p=r==null?void 0:r.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=r==null?void 0:r.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>[ii.Full,ii.SingleMetric].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay===ii.Full);return(g,p)=>(h.openBlock(),h.createElementBlock("div",bM,[h.createElementVNode("div",vM,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",xM,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(Zf),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),wM=Ke(_M,[["__scopeId","data-v-5871cb7a"]]),TM={class:"simple-chart-shell"},DM={key:1,class:"analytics-chart-parent"},MM=Ke(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>{var c;const l=St.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),r=h.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),a=h.computed(()=>t.chartOptions.type===Qr.GAUGE),s=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=h.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.records.length);return(l,c)=>{const u=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",TM,[o.value?(h.openBlock(),h.createElementBlock("div",DM,[a.value?(h.openBlock(),h.createBlock(wM,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(u,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1}))])}}}),[["__scopeId","data-v-f014a616"]]),SM={class:"top-n-card-title","data-testid":"top-n-card-title"},CM={class:"top-n-card-description","data-testid":"top-n-card-description"},kM={key:3,class:"top-n-table","data-testid":"top-n-table"},OM={class:"table-headings"},PM={class:"table-row"},EM={class:"column-1"},AM={class:"column-2"},RM={class:"table-body","data-testid":"top-n-data"},LM=["data-testid"],IM={class:"column-1"},NM={class:"column-2"},FM=Ke(h.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>t.data.records),r=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),a=h.computed(()=>{var p,v;return(p=t.data.meta)!=null&&p.display&&((v=Object.keys(t.data.meta.display))==null?void 0:v[0])||""}),s=h.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=h.computed(()=>{var p,v;return(v=(p=t.data.meta)==null?void 0:p.metricNames)!=null&&v.length?t.data.meta.metricNames[0]:""}),l=h.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=h.computed(()=>{if(!r.value)return"";if(t.data.meta)if(Object.keys(s.value).length){if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.display");else return e.t("topNTable.errors.meta");return""}),u=p=>{const v=p.event;return String(v[a.value])},d=p=>{const v=u(p),m=s.value[v];return m?m.name:"-"},f=p=>{const v=u(p),m=s.value[v];return m?m.deleted:!1},g=p=>{if(!o.value)return"–";const m=p.event[o.value];return m?tr(m,{capital:!0,round:!0}):"–"};return(p,v)=>{const m=h.resolveComponent("KEmptyState"),y=h.resolveComponent("KSkeleton"),x=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(x,{class:"kong-ui-public-top-n-table"},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(m,{key:0,"cta-is-hidden":"","data-testid":"top-n-error-state","is-error":""},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(y,{key:1,"table-columns":2,type:"table"})):r.value?(h.openBlock(),h.createElementBlock("div",kM,[h.createElementVNode("div",OM,[h.createElementVNode("div",PM,[h.createElementVNode("div",EM,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",AM,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",RM,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(_,w)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${w}`,class:"table-row","data-testid":`row-${u(_)}`},[h.createElementVNode("div",IM,[h.renderSlot(p.$slots,"name",{record:{id:u(_),name:d(_),deleted:f(_),dimension:a.value}},()=>[h.createTextVNode(h.toDisplayString(d(_)),1)],!0)]),h.createElementVNode("div",NM," "+h.toDisplayString(g(_)),1)],8,LM))),128))])])):(h.openBlock(),h.createBlock(m,{key:2,"cta-is-hidden":"","data-testid":"top-n-empty-state",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("div",SM,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",CM,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1024)}}}),[["__scopeId","data-v-bd78642f"]]),ul="#e0e4ea",UM={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"]},or=(n,t)=>{let e=1;const i=UM[n],r=new Map;for(const a of t)r.set(a,i[e]),e=e%(i.length-1)+1;return r.set(-1,i[0]),r},lh=new Map([[100,or("100",[100,101,102,103])],[200,or("200",[200,201,202,203,204,205,206,207,208,226])],[300,or("300",[300,301,302,303,304,305,307,308])],[400,or("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,or("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ch=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=lh.get(e);return i===void 0?ul:i.get(t)??i.get(-1)??ul},BM=n=>{const t=ch(n);return{solid:t,light:t}};ct.AnalyticsChart=yM,ct.ChartLegendPosition=Bt,ct.ChartMetricDisplay=ii,ct.ChartTypes=ee,ct.ChartTypesSimple=Qr,ct.CsvExportModal=sh,ct.DECIMAL_DISPLAY=Id,ct.FONT_SIZE_REGULAR=Fd,ct.FONT_SIZE_SMALL=Nd,ct.MAX_LABEL_LENGTH=na,ct.SimpleChart=MM,ct.TopNTable=FM,ct.ValidType=Hn,ct.accessibleGrey=Ud,ct.codesInSpec=lh,ct.darkenColor=Ji,ct.datavisPalette=De,ct.formatTime=ea,ct.lightGrey=ul,ct.lookupDatavisColor=ai,ct.lookupStatusCodeCategoryColor=BM,ct.lookupStatusCodeColor=ch,ct.numberFormatter=ta,Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"})});
|
|
43
|
+
`);var I=0,rt=!1;this.parse=function(W,Ct,mt){if(typeof W!="string")throw new Error("Input must be a string");var $=W.length,N=O.length,Y=E.length,V=A.length,Z=k(R),J=[],F=[],L=[],Q=I=0;if(!W)return le();if(T.header&&!Ct){var G=W.split(E)[0].split(O),vt=[],dt={},It=!1;for(var Dt in G){var ot=G[Dt];k(T.transformHeader)&&(ot=T.transformHeader(ot,Dt));var zt=ot,Gt=dt[ot]||0;for(0<Gt&&(It=!0,zt=ot+"_"+Gt),dt[ot]=Gt+1;vt.includes(zt);)zt=zt+"_"+Gt;vt.push(zt)}if(It){var Me=W.split(E);Me[0]=vt.join(O),W=Me.join(E)}}if(H||H!==!1&&W.indexOf(D)===-1){for(var Ee=W.split(E),pe=0;pe<Ee.length;pe++){if(L=Ee[pe],I+=L.length,pe!==Ee.length-1)I+=E.length;else if(mt)return le();if(!A||L.substring(0,V)!==A){if(Z){if(J=[],Qe(L.split(O)),me(),rt)return le()}else Qe(L.split(O));if(q&&q<=pe)return J=J.slice(0,q),le(!0)}}return le()}for(var Rt=W.indexOf(O,I),Nt=W.indexOf(E,I),Ze=new RegExp(m(B)+m(D),"g"),Mt=W.indexOf(D,I);;)if(W[I]!==D)if(A&&L.length===0&&W.substring(I,I+V)===A){if(Nt===-1)return le();I=Nt+Y,Nt=W.indexOf(E,I),Rt=W.indexOf(O,I)}else if(Rt!==-1&&(Rt<Nt||Nt===-1))L.push(W.substring(I,Rt)),I=Rt+N,Rt=W.indexOf(O,I);else{if(Nt===-1)break;if(L.push(W.substring(I,Nt)),Re(Nt+Y),Z&&(me(),rt))return le();if(q&&J.length>=q)return le(!0)}else for(Mt=I,I++;;){if((Mt=W.indexOf(D,Mt+1))===-1)return mt||F.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:J.length,index:I}),Se();if(Mt===$-1)return Se(W.substring(I,Mt).replace(Ze,D));if(D!==B||W[Mt+1]!==B){if(D===B||Mt===0||W[Mt-1]!==B){Rt!==-1&&Rt<Mt+1&&(Rt=W.indexOf(O,Mt+1)),Nt!==-1&&Nt<Mt+1&&(Nt=W.indexOf(E,Mt+1));var Dn=xe(Nt===-1?Rt:Math.min(Rt,Nt));if(W.substr(Mt+1+Dn,N)===O){L.push(W.substring(I,Mt).replace(Ze,D)),W[I=Mt+1+Dn+N]!==D&&(Mt=W.indexOf(D,I)),Rt=W.indexOf(O,I),Nt=W.indexOf(E,I);break}var Ae=xe(Nt);if(W.substring(Mt+1+Ae,Mt+1+Ae+Y)===E){if(L.push(W.substring(I,Mt).replace(Ze,D)),Re(Mt+1+Ae+Y),Rt=W.indexOf(O,I),Mt=W.indexOf(D,I),Z&&(me(),rt))return le();if(q&&J.length>=q)return le(!0);break}F.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:J.length,index:I}),Mt++}}else Mt++}return Se();function Qe(Kt){J.push(Kt),Q=I}function xe(Kt){var ya=0;if(Kt!==-1){var gi=W.substring(Mt+1,Kt);gi&&gi.trim()===""&&(ya=gi.length)}return ya}function Se(Kt){return mt||(Kt===void 0&&(Kt=W.substring(I)),L.push(Kt),I=$,Qe(L),Z&&me()),le()}function Re(Kt){I=Kt,Qe(L),L=[],Nt=W.indexOf(E,I)}function le(Kt){return{data:J,errors:F,meta:{delimiter:O,linebreak:E,aborted:rt,truncated:!!Kt,cursor:Q+(Ct||0)}}}function me(){R(le()),J=[],F=[]}},this.abort=function(){rt=!0},this.getCharIndex=function(){return I}}function v(T){var D=T.data,O=s[D.workerId],E=!1;if(D.error)O.userError(D.error,D.file);else if(D.results&&D.results.data){var A={abort:function(){E=!0,_(D.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:w,resume:w};if(k(O.userStep)){for(var R=0;R<D.results.data.length&&(O.userStep({data:D.results.data[R],errors:D.results.errors,meta:D.results.meta},A),!E);R++);delete D.results}else k(O.userChunk)&&(O.userChunk(D.results,A,D.file),delete D.results)}D.finished&&!E&&_(D.workerId,D.results)}function _(T,D){var O=s[T];k(O.userComplete)&&O.userComplete(D),O.terminate(),delete s[T]}function w(){throw new Error("Not implemented.")}function M(T){if(typeof T!="object"||T===null)return T;var D=Array.isArray(T)?[]:{};for(var O in T)D[O]=M(T[O]);return D}function C(T,D){return function(){T.apply(D,arguments)}}function k(T){return typeof T=="function"}return a&&(i.onmessage=function(T){var D=T.data;if(l.WORKER_ID===void 0&&D&&(l.WORKER_ID=D.workerId),typeof D.input=="string")i.postMessage({workerId:l.WORKER_ID,results:l.parse(D.input,D.config),finished:!0});else if(i.File&&D.input instanceof File||D.input instanceof Object){var O=l.parse(D.input,D.config);O&&i.postMessage({workerId:l.WORKER_ID,results:O,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(u.prototype)).constructor=p,l})})(rh);var nM=rh.exports;const iM=["id"],rM=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,r=h.computed(()=>`export_${new Date().getTime()}`),a=h.computed(()=>{const u=l();return u.length?u:null}),s=()=>{const u=i.labels;if(typeof i.fields!==Hn.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===Hn.Object?d=>DD(d,(f,g)=>u[g]||g):d=>d},o=()=>{const u=i.fields;if(typeof i.fields!==Hn.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>tM(d,u):d=>d},l=()=>{if(typeof i.fields===Hn.Undefined&&typeof i.labels===Hn.Undefined)return i.data;const u=s(),d=o();return i.data.map(f=>u(d(f)))},c=()=>{if(!(a!=null&&a.value)){console.warn("No data to export");return}e("export-started",a.value);let u=nM.unparse(a.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
|
|
44
|
+
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});eM.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,iM))}}),aM=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,r)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(rM,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),sM={class:"kong-ui-public-csv-export-modal"},oM={key:0,class:"selected-range"},lM={key:1,class:"text-muted",tag:"span"},ah=3,sh=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},selectedRange:{},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=St.useI18n(),i=n,r=t,a=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,s=h.ref(!0),o=h.computed(()=>{var p,x;return!!((x=(p=i.chartData)==null?void 0:p.records)!=null&&x.length)}),l=h.ref(1),c=h.computed(()=>f.value.rows.length),u=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(ah,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),d=()=>{r("toggleModal",!1)},f=h.computed(()=>{var w,M,C;if(!o.value||!((w=i.chartData)!=null&&w.meta.metricNames))return{headers:[],rows:[],csvHeaders:{}};const p=i.chartData.records.some(k=>k.timestamp!==i.chartData.records[0].timestamp),x=i.chartData.records.map(k=>{const T=new Date(k.timestamp);return{...k.event,...p?{timestamp:To(T,"yyyy-MM-dd HH:mm:ss"),tzOffset:To(T,"XXX")}:{}}});let m=[];p&&(m=[{label:"Timestamp",key:"timestamp"},{label:"UtcOffset",key:"tzOffset"}]);const b="dimensions"in i.chartData.meta&&((M=i.chartData.meta)!=null&&M.dimensions)?(C=i.chartData.meta)==null?void 0:C.dimensions:{},v=[...m,...Object.keys(b).map(k=>({label:k,key:k})),...i.chartData.meta.metricNames.map(k=>({label:k,key:k}))],_=v.reduce((k,T)=>(k[T.key]=T.label,k),{});return{headers:v,csvHeaders:_,rows:x}}),g=()=>{const{rows:p}=f.value;return s.value=!1,{total:Number(p.length)||0,data:p.slice(0,ah)}};return h.watch(f,()=>{l.value++}),(p,x)=>{const m=h.resolveComponent("KEmptyState"),b=h.resolveComponent("KTable"),v=h.resolveComponent("KButton"),_=h.resolveComponent("KPrompt");return h.openBlock(),h.createElementBlock("div",sM,[h.createVNode(_,{class:"vitals-report","data-testid":"csv-export-modal","is-visible":"","show-dismiss-icon":"","text-align":"left",title:h.unref(e).t("csvExport.exportPreview"),onCanceled:d,onKeyup:h.withKeys(d,["esc"])},{"body-content":h.withCtx(()=>{var w;return[h.createElementVNode("div",null,[o.value?(h.openBlock(),h.createElementBlock("div",oM,[h.createElementVNode("p",null,h.toDisplayString(p.modalDescription?p.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(p.selectedRange),1)])):h.createCommentVNode("",!0),h.createVNode(b,{class:"vitals-table","disable-pagination":"","disable-sorting":"",fetcher:g,"fetcher-cache-key":String(l.value),"has-hover":!1,headers:((w=f.value)==null?void 0:w.headers)||[]},{"empty-state":h.withCtx(()=>[h.createVNode(m,{"cta-is-hidden":"",icon:"stateNoData","icon-size":"96"},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),message:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!s.value&&o.value?(h.openBlock(),h.createElementBlock("div",lM,h.toDisplayString(u.value),1)):h.createCommentVNode("",!0)])]}),"action-buttons":h.withCtx(()=>[h.createVNode(v,{appearance:"secondary",class:"cancel-btn",onClick:d},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(aM,{class:"vitals-report-export-button",filename:a,headers:f.value.csvHeaders,rows:f.value.rows},{default:h.withCtx(()=>[h.createVNode(v,{appearance:"primary","data-testid":"csv-download-button",disabled:s.value||!o.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),oh=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},cl={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;oh(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;oh(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},cM=h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:ee.TIMESERIES_LINE},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},timeRangeSec:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),i=h.ref(),r=h.ref(wn()),a=h.ref(wn()),s=h.ref([]),o=h.ref(),l=h.ref(h.inject("legendPosition",Bt.Right)),c=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:t.type,locked:!1,chartTooltipSortFn:t.chartTooltipSortFn}),u={id:r.value,afterUpdate(v){s.value=v.options.plugins.legend.labels.generateLabels(v).map(_=>({..._,value:t.legendValues&&t.legendValues[_.text]})).sort(t.chartLegendSortFn)}},d=h.computed(()=>[u,jf,...t.type===ee.TIMESERIES_LINE?[cl]:[]]),{options:f}=St.useLinechartOptions({tooltipState:c,timeRangeMs:h.toRef(t,"timeRangeMs"),timeRangeSec:h.toRef(t,"timeRangeSec"),granularity:h.toRef(t,"granularity"),legendID:r.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle")}),g=h.computed(()=>({...t.chartData,datasets:t.chartData.datasets.map((v,_)=>(Array.isArray(t.datasetColors)?(v.backgroundColor=t.datasetColors[_%t.datasetColors.length],v.borderColor=Ji(v.backgroundColor,50)):v.rawDimension in t.datasetColors&&(v.backgroundColor=t.datasetColors[v.rawDimension],v.borderColor=Ji(v.backgroundColor,50)),v.fill=t.fill,v))}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const p=v=>ea(v,{short:[st.DAILY,st.WEEKLY].includes(t.granularity)}),x=v=>({[Bt.Right]:"legend-row",[Bt.Bottom]:"column",[Bt.Hidden]:"hidden"})[v],m=({width:v,height:_})=>{c.width=v,c.height=_},b=()=>{var v,_,w;c.locked=!c.locked,i.value&&((_=(v=i.value.chart.tooltip)==null?void 0:v.dataPoints)!=null&&_.length)&&(cl.clickedSegment=c.locked?(w=i.value.chart.tooltip)==null?void 0:w.dataPoints[0]:void 0)};return h.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete cl.clickedSegment}),(v,_)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",x(l.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:_[0]||(_[0]=w=>b())},[n.type===h.unref(ee).TIMESERIES_LINE?(h.openBlock(),h.createBlock(h.unref(vD),{key:0,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:g.value,"data-testid":"time-series-line-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===h.unref(ee).TIMESERIES_BAR?(h.openBlock(),h.createBlock(h.unref(bD),{key:1,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:g.value,"data-testid":"time-series-bar-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(rl,{ref_key:"tooltipElement",ref:o,context:p(c.tooltipContext),"data-testid":"tooltip",left:c.left,locked:c.locked,series:c.tooltipSeries,"show-tooltip":c.showTooltip,"tooltip-title":n.tooltipTitle,top:c.top,unit:n.metricUnit,onDimensions:m,onLeft:_[1]||(_[1]=w=>c.left=w),onTop:_[2]||(_[2]=w=>c.top=w)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),h.createVNode(al,{id:r.value,"chart-instance":i.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),uM=Ke(cM,[["__scopeId","data-v-11d0cb06"]]),dM={class:"analytics-chart-shell"},fM={class:"chart-header"},hM={key:0,class:"chart-title"},gM={class:"chart-header-icons-wrapper"},pM={key:1,class:"chart-export-button"},mM={key:1,class:"analytics-chart-parent"},yM=h.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!1,default:""},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:""},filenamePrefix:{type:String,required:!1,default:void 0},legendPosition:{type:String,required:!1,default:Bt.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>t.filenamePrefix??(t.chartTitle||e.t("csvExport.defaultFilename"))),r=h.toRef(t,"chartData"),a=h.computed(()=>x.value?St.useExploreResultToTimeDataset({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value:St.useExploreResultToDatasets({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value),s=h.computed(()=>{var R;return(R=t.chartData)!=null&&R.meta?"start"in t.chartData.meta?t.chartData.meta.end-t.chartData.meta.start:void 0:0}),o=h.computed(()=>{var R;return(R=t.chartData)!=null&&R.meta?"startMs"in t.chartData.meta?t.chartData.meta.endMs-t.chartData.meta.startMs:void 0:0}),l=h.computed(()=>{var R;return(R=t.chartData.meta)!=null&&R.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),c=h.computed(()=>t.showLegendValues&&t.legendPosition!==Bt.Bottom),{legendValues:u}=St.useChartLegendValues(a,t.chartOptions.type,l),d=h.computed(()=>{var R,q,H;return((H=(q=(R=t.chartData)==null?void 0:R.meta)==null?void 0:q.limit)==null?void 0:H.toString())||null}),f=h.computed(()=>{var R,q;return((q=(R=t.chartData)==null?void 0:R.meta)==null?void 0:q.truncated)||!1}),g=e.t("limitedResultsShown",{maxReturned:d.value}),p=h.computed(()=>[ee.VERTICAL_BAR.toString(),ee.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),x=h.computed(()=>[ee.TIMESERIES_BAR,ee.TIMESERIES_LINE].some(R=>R===t.chartOptions.type)),m=h.computed(()=>t.chartOptions.type===ee.DOUGHNUT),b=h.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),v=h.computed(()=>{var H,B,I;if(!((H=t.chartData)!=null&&H.meta.metricNames)||!((B=t.chartData)!=null&&B.meta.metricUnits))return;const R=t.chartData.meta.metricNames[0],q=t.chartData.meta.metricUnits[R];return((I=t.chartOptions)==null?void 0:I.metricAxesTitle)||e.te(`metricAxisTitles.${R}`)&&e.te(`chartUnits.${q}`)&&e.t(`metricAxisTitles.${R}`,{unit:e.t(`chartUnits.${q}`,{plural:"s"})})||void 0}),_=h.computed(()=>{const R=x.value?"Time":Object.keys(t.chartData.meta.dimensions||t.chartData.meta.metricNames)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${R}`)&&e.t(`chartLabels.${R}`)||void 0}),w=h.computed(()=>{if(t.chartData.meta.granularity&&typeof t.chartData.meta.granularity!="number"&&"duration"in t.chartData.meta.granularity){const R=er(t.chartData.meta.granularity.duration);return e.t(`granularityAxisTitles.${R}`)}else if(t.chartData.meta.granularity&&!isNaN(Number(t.chartData.meta.granularity))){const R=er(Number(t.chartData.meta.granularity));return e.t(`granularityAxisTitles.${R}`)}return e.t("chartlabels.Time")}),M=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),C=h.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),k=h.computed(()=>x.value?Nx(a.value):t.chartData&&t.chartData.meta&&t.chartData.records.length),T=h.computed(()=>t.chartData.meta.granularity?typeof t.chartData.meta.granularity=="number"?er(t.chartData.meta.granularity)||st.HOURLY:er(t.chartData.meta.granularity.duration)||st.HOURLY:er(new Date(t.chartData.records[1].timestamp).getTime()-new Date(t.chartData.records[0].timestamp).getTime())||st.HOURLY),D=h.ref(!1),O=St.useChartSelectedRange(r),E=R=>{D.value=R},A=()=>{E(!0)};return h.provide("showLegendValues",c),h.provide("legendPosition",h.toRef(t,"legendPosition")),(R,q)=>{const H=h.resolveComponent("KTooltip"),B=h.resolveComponent("KButton"),I=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",dM,[h.createElementVNode("div",fM,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",hM,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",gM,[k.value&&f.value&&d.value?(h.openBlock(),h.createBlock(H,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(g)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(FT),{color:h.unref(BT),decorative:"",size:h.unref(YT)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&k.value?(h.openBlock(),h.createElementBlock("div",pM,[h.createVNode(B,{appearance:"tertiary",class:"chart-export-button-display","data-testid":"csv-export-button",onClick:h.withModifiers(A,["prevent"])},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.exportButton")),1)]),_:1})])):h.createCommentVNode("",!0),n.allowCsvExport&&k.value&&D.value?(h.openBlock(),h.createBlock(sh,{key:2,"chart-data":r.value,filename:i.value,"selected-range":h.unref(O),onToggleModal:E},null,8,["chart-data","filename","selected-range"])):h.createCommentVNode("",!0)]),k.value?(h.openBlock(),h.createElementBlock("div",mM,[x.value?(h.openBlock(),h.createBlock(uM,{key:0,"chart-data":a.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"dataset-colors":n.chartOptions.chartDatasetColors,"dimension-axes-title":w.value,fill:n.chartOptions.fill,granularity:T.value,"legend-values":h.unref(u),"metric-axes-title":v.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":o.value,"time-range-sec":s.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dataset-colors","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","time-range-sec","tooltip-title","type"])):p.value?(h.openBlock(),h.createBlock(uD,{key:1,annotations:n.showAnnotations,"chart-data":a.value,"chart-legend-sort-fn":n.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":n.chartOptions.chartTooltipSortFn,"data-testid":"bar-chart-container","dimension-axes-title":_.value,"legend-values":h.unref(u),"metric-axes-title":v.value,"metric-unit":l.value,orientation:b.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):m.value?(h.openBlock(),h.createBlock(wD,{key:2,"chart-data":a.value,"dataset-colors":n.chartOptions.chartDatasetColors,fill:n.chartOptions.fill,"legend-position":n.legendPosition,"legend-values":h.unref(u),"metric-unit":l.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","fill","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(I,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"170"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(M.value),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(C.value),1)]),_:1}))])}}}),bM=Ke(yM,[["__scopeId","data-v-5e322ded"]]),vM={class:"chart-parent","data-testid":"doughnut-chart-parent"},xM={class:"chart-totals-flex"},_M={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},wM=h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:ii.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:De},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.ref(wn()),r=h.computed(()=>[t.chartData.datasets.reduce((p,x)=>(p.labels.push(x.label),p.borderColor.push(x.backgroundColor),p.backgroundColor.push(x.backgroundColor),p.data.push(x.data.reduce((m,b)=>m+b,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=h.computed(()=>({...t.chartData,datasets:r.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=h.ref(),l=h.computed(()=>{var g;return tr((g=r==null?void 0:r.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return tr(((g=r==null?void 0:r.value[0])==null?void 0:g.data[0])+((p=r==null?void 0:r.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=r==null?void 0:r.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>[ii.Full,ii.SingleMetric].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay===ii.Full);return(g,p)=>(h.openBlock(),h.createElementBlock("div",vM,[h.createElementVNode("div",xM,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",_M,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(Zf),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),TM=Ke(wM,[["__scopeId","data-v-5871cb7a"]]),DM={class:"simple-chart-shell"},MM={key:1,class:"analytics-chart-parent"},SM=Ke(h.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>{var c;const l=St.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||De},h.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),r=h.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),a=h.computed(()=>t.chartOptions.type===Qr.GAUGE),s=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=h.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.records.length);return(l,c)=>{const u=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",DM,[o.value?(h.openBlock(),h.createElementBlock("div",MM,[a.value?(h.openBlock(),h.createBlock(TM,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(u,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1}))])}}}),[["__scopeId","data-v-f014a616"]]),CM={class:"top-n-card-title","data-testid":"top-n-card-title"},kM={class:"top-n-card-description","data-testid":"top-n-card-description"},OM={key:3,class:"top-n-table","data-testid":"top-n-table"},PM={class:"table-headings"},EM={class:"table-row"},AM={class:"column-1"},RM={class:"column-2"},LM={class:"table-body","data-testid":"top-n-data"},IM=["data-testid"],NM={class:"column-1"},FM={class:"column-2"},UM=Ke(h.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(n){const t=n,{i18n:e}=St.useI18n(),i=h.computed(()=>t.data.records),r=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),a=h.computed(()=>{var p,x;return(p=t.data.meta)!=null&&p.display&&((x=Object.keys(t.data.meta.display))==null?void 0:x[0])||""}),s=h.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=h.computed(()=>{var p,x;return(x=(p=t.data.meta)==null?void 0:p.metricNames)!=null&&x.length?t.data.meta.metricNames[0]:""}),l=h.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=h.computed(()=>{if(!r.value)return"";if(t.data.meta)if(Object.keys(s.value).length){if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.display");else return e.t("topNTable.errors.meta");return""}),u=p=>{const x=p.event;return String(x[a.value])},d=p=>{const x=u(p),m=s.value[x];return m?m.name:"-"},f=p=>{const x=u(p),m=s.value[x];return m?m.deleted:!1},g=p=>{if(!o.value)return"–";const m=p.event[o.value];return m?tr(m,{capital:!0,round:!0}):"–"};return(p,x)=>{const m=h.resolveComponent("KEmptyState"),b=h.resolveComponent("KSkeleton"),v=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(v,{class:"kong-ui-public-top-n-table"},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(m,{key:0,"cta-is-hidden":"","data-testid":"top-n-error-state","is-error":""},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),message:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(b,{key:1,"table-columns":2,type:"table"})):r.value?(h.openBlock(),h.createElementBlock("div",OM,[h.createElementVNode("div",PM,[h.createElementVNode("div",EM,[h.createElementVNode("div",AM,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",RM,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",LM,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(_,w)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${w}`,class:"table-row","data-testid":`row-${u(_)}`},[h.createElementVNode("div",NM,[h.renderSlot(p.$slots,"name",{record:{id:u(_),name:d(_),deleted:f(_),dimension:a.value}},()=>[h.createTextVNode(h.toDisplayString(d(_)),1)],!0)]),h.createElementVNode("div",FM," "+h.toDisplayString(g(_)),1)],8,IM))),128))])])):(h.openBlock(),h.createBlock(m,{key:2,"cta-is-hidden":"","data-testid":"top-n-empty-state",icon:"stateNoData","icon-size":"80"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("div",CM,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",kM,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1024)}}}),[["__scopeId","data-v-bd78642f"]]),ul="#e0e4ea",BM={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"]},or=(n,t)=>{let e=1;const i=BM[n],r=new Map;for(const a of t)r.set(a,i[e]),e=e%(i.length-1)+1;return r.set(-1,i[0]),r},lh=new Map([[100,or("100",[100,101,102,103])],[200,or("200",[200,201,202,203,204,205,206,207,208,226])],[300,or("300",[300,301,302,303,304,305,307,308])],[400,or("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,or("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ch=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=lh.get(e);return i===void 0?ul:i.get(t)??i.get(-1)??ul},YM=n=>{const t=ch(n);return{solid:t,light:t}};ct.AnalyticsChart=bM,ct.ChartLegendPosition=Bt,ct.ChartMetricDisplay=ii,ct.ChartTypes=ee,ct.ChartTypesSimple=Qr,ct.CsvExportModal=sh,ct.DECIMAL_DISPLAY=Id,ct.FONT_SIZE_REGULAR=Fd,ct.FONT_SIZE_SMALL=Nd,ct.MAX_LABEL_LENGTH=na,ct.SimpleChart=SM,ct.TopNTable=UM,ct.ValidType=Hn,ct.accessibleGrey=Ud,ct.codesInSpec=lh,ct.darkenColor=Ji,ct.datavisPalette=De,ct.formatTime=ea,ct.lightGrey=ul,ct.lookupDatavisColor=ai,ct.lookupStatusCodeCategoryColor=YM,ct.lookupStatusCodeColor=ch,ct.numberFormatter=ta,Object.defineProperty(ct,Symbol.toStringTag,{value:"Module"})});
|